From 0ddcce48549d7cd5cb20e613668ad14d9f8f7f59 Mon Sep 17 00:00:00 2001 From: scribam Date: Tue, 28 Apr 2020 13:45:08 +0200 Subject: [PATCH] deps: Update glslang to version 8.13.3743 --- core/deps/glslang/.appveyor.yml | 108 + core/deps/glslang/.gitattributes | 17 + core/deps/glslang/.gitignore | 10 + core/deps/glslang/.travis.yml | 128 + core/deps/glslang/BUILD.bazel | 2 + core/deps/glslang/BUILD.gn | 1 + core/deps/glslang/CMakeLists.txt | 91 +- core/deps/glslang/README.md | 141 +- core/deps/glslang/SPIRV/CMakeLists.txt | 3 +- core/deps/glslang/SPIRV/GLSL.ext.KHR.h | 7 +- core/deps/glslang/SPIRV/GlslangToSpv.cpp | 854 +- core/deps/glslang/SPIRV/Logger.cpp | 2 +- .../glslang/SPIRV/NonSemanticDebugPrintf.h | 50 + core/deps/glslang/SPIRV/SpvBuilder.cpp | 67 +- core/deps/glslang/SPIRV/SpvBuilder.h | 120 +- core/deps/glslang/SPIRV/SpvTools.cpp | 11 +- core/deps/glslang/SPIRV/disassemble.cpp | 9 +- core/deps/glslang/SPIRV/doc.cpp | 246 +- core/deps/glslang/SPIRV/hex_float.h | 4 +- core/deps/glslang/SPIRV/spirv.hpp | 143 +- core/deps/glslang/SPIRV/spvIR.h | 3 +- core/deps/glslang/StandAlone/CMakeLists.txt | 3 +- core/deps/glslang/StandAlone/StandAlone.cpp | 87 +- .../glslang/StandAlone/resource_limits_c.cpp | 65 + .../glslang/StandAlone/resource_limits_c.h | 54 + core/deps/glslang/StandAlone/spirv-remap.cpp | 2 - core/deps/glslang/Test/100.frag | 460 +- core/deps/glslang/Test/100Limits.vert | 152 +- .../deps/glslang/Test/100samplerExternal.frag | 82 +- core/deps/glslang/Test/100scope.vert | 152 +- core/deps/glslang/Test/110scope.vert | 174 +- core/deps/glslang/Test/120.frag | 2 +- core/deps/glslang/Test/120.vert | 12 +- core/deps/glslang/Test/130.vert | 156 +- core/deps/glslang/Test/140.vert | 118 +- core/deps/glslang/Test/150.frag | 132 +- core/deps/glslang/Test/150.geom | 278 +- core/deps/glslang/Test/150.tesc | 68 +- core/deps/glslang/Test/150.tese | 70 +- core/deps/glslang/Test/150.vert | 58 +- core/deps/glslang/Test/300.vert | 2 +- core/deps/glslang/Test/300link.frag | 16 +- core/deps/glslang/Test/300link2.frag | 22 +- core/deps/glslang/Test/300link3.frag | 14 +- .../deps/glslang/Test/300samplerExternal.frag | 82 +- .../glslang/Test/300samplerExternalYUV.frag | 76 +- core/deps/glslang/Test/310.comp | 468 +- core/deps/glslang/Test/310.frag | 742 +- core/deps/glslang/Test/310.geom | 304 +- core/deps/glslang/Test/310.inheritMemory.frag | 86 +- core/deps/glslang/Test/310.tesc | 368 +- core/deps/glslang/Test/310.tese | 256 +- core/deps/glslang/Test/310.vert | 776 +- core/deps/glslang/Test/310AofA.vert | 196 +- .../Test/310implicitSizeArrayError.vert | 16 +- core/deps/glslang/Test/320.comp | 4 +- core/deps/glslang/Test/320.frag | 362 +- core/deps/glslang/Test/320.geom | 268 +- core/deps/glslang/Test/320.tesc | 322 +- core/deps/glslang/Test/320.tese | 228 +- core/deps/glslang/Test/320.vert | 480 +- core/deps/glslang/Test/330.frag | 46 +- core/deps/glslang/Test/400.frag | 200 +- core/deps/glslang/Test/400.geom | 660 +- core/deps/glslang/Test/400.tesc | 210 +- core/deps/glslang/Test/400.tese | 210 +- core/deps/glslang/Test/400.vert | 176 +- core/deps/glslang/Test/410.geom | 78 +- core/deps/glslang/Test/410.tesc | 22 +- core/deps/glslang/Test/410.vert | 1 + core/deps/glslang/Test/420.comp | 58 +- core/deps/glslang/Test/420.frag | 28 + core/deps/glslang/Test/420.geom | 110 +- core/deps/glslang/Test/420.tesc | 86 +- core/deps/glslang/Test/420.tese | 180 +- core/deps/glslang/Test/420.vert | 24 +- core/deps/glslang/Test/420_size_gl_in.geom | 42 +- core/deps/glslang/Test/430.comp | 180 +- core/deps/glslang/Test/430.vert | 446 +- core/deps/glslang/Test/430AofA.frag | 216 +- core/deps/glslang/Test/435.vert | 2 +- core/deps/glslang/Test/440.frag | 306 +- core/deps/glslang/Test/440.vert | 394 +- core/deps/glslang/Test/450.comp | 15 +- core/deps/glslang/Test/450.frag | 136 +- core/deps/glslang/Test/450.geom | 38 +- core/deps/glslang/Test/450.tesc | 46 +- core/deps/glslang/Test/450.tese | 42 +- core/deps/glslang/Test/450.vert | 112 +- core/deps/glslang/Test/460.frag | 54 +- core/deps/glslang/Test/460.vert | 31 +- core/deps/glslang/Test/Operations.frag | 332 +- core/deps/glslang/Test/aggOps.frag | 102 +- core/deps/glslang/Test/always-discard.frag | 72 +- core/deps/glslang/Test/always-discard2.frag | 38 +- core/deps/glslang/Test/atomic_uint.frag | 54 +- core/deps/glslang/Test/badMacroArgs.frag | 6 +- .../glslang/Test/baseResults/150.frag.out | 104 +- .../glslang/Test/baseResults/410.vert.out | 12 + .../glslang/Test/baseResults/420.frag.out | 80 +- .../glslang/Test/baseResults/450.comp.out | 13 +- .../glslang/Test/baseResults/460.vert.out | 24 +- .../Test/baseResults/compoundsuffix.frag.hlsl | 90 +- .../Test/baseResults/compoundsuffix.vert.glsl | 30 +- .../Test/baseResults/constFold.frag.out | 88 +- .../glslang/Test/baseResults/cppBad.vert.out | 2 +- .../Test/baseResults/cppSimple.vert.out | 4 +- .../Test/baseResults/hlsl.gs-hs-mix.tesc.out | 2 - .../hlsl.intrinsics.f1632.frag.out | 135 +- .../Test/baseResults/hlsl.semantic.geom.out | 292 +- .../hlsl.singleArgIntPromo.vert.out | 312 + .../link.multiAnonBlocksInvalid.0.0.vert.out | 177 + .../link.multiAnonBlocksValid.0.0.vert.out | 157 + .../link.multiBlocksInvalid.0.0.vert.out | 182 + .../link.multiBlocksValid.1.0.vert.out | 163 + .../link.vk.differentPC.0.0.frag.out | 95 + .../link.vk.differentPC.1.0.frag.out | 97 + .../link.vk.matchingPC.0.0.frag.out | 155 + .../link.vk.multiBlocksValid.0.0.vert.out | 321 + .../link.vk.multiBlocksValid.1.0.geom.out | 451 + .../link.vk.pcNamingInvalid.0.0.vert.out | 111 + .../link.vk.pcNamingValid.0.0.vert.out | 206 + .../rayQuery-allOps.Error.rgen.out | 26 + .../Test/baseResults/rayQuery-allOps.comp.out | 433 + .../Test/baseResults/rayQuery-allOps.frag.out | 431 + .../Test/baseResults/rayQuery-allOps.rgen.out | 431 + .../rayQuery-committed.Error.rgen.out | 19 + .../baseResults/rayQuery-initialize.rgen.out | 166 + .../Test/baseResults/rayQuery-no-cse.rgen.out | 173 + .../Test/baseResults/rayQuery.rgen.out | 82 + .../baseResults/spv.AnyHitShader.rahit.out | 36 +- .../spv.ClosestHitShader.rchit.out | 40 +- .../baseResults/spv.IntersectShader.rint.out | 30 +- .../Test/baseResults/spv.MissShader.rmiss.out | 30 +- .../Test/baseResults/spv.Operations.frag.out | 981 +- .../baseResults/spv.RayCallable.rcall.out | 18 +- .../baseResults/spv.RayConstants.rgen.out | 10 +- .../baseResults/spv.RayGenShader.rgen.out | 20 +- .../baseResults/spv.RayGenShader11.rgen.out | 20 +- .../spv.RayGenShaderArray.rgen.out | 27 +- .../baseResults/spv.atomicCounter.comp.out | 15 + .../Test/baseResults/spv.debugPrintf.frag.out | 31 + .../spv.debugPrintf_Error.frag.out | 7 + .../spv.ext.AnyHitShader.rahit.out | 188 + .../spv.ext.AnyHitShader_Errors.rahit.out | 8 + .../spv.ext.ClosestHitShader.rchit.out | 194 + .../spv.ext.ClosestHitShader_Errors.rchit.out | 10 + .../spv.ext.IntersectShader.rint.out | 156 + .../spv.ext.IntersectShader_Errors.rint.out | 10 + .../baseResults/spv.ext.MissShader.rmiss.out | 99 + .../spv.ext.MissShader_Errors.rmiss.out | 21 + .../baseResults/spv.ext.RayCallable.rcall.out | 60 + .../spv.ext.RayCallable_Errors.rcall.out | 35 + .../baseResults/spv.ext.RayConstants.rgen.out | 46 + .../baseResults/spv.ext.RayGenShader.rgen.out | 104 + .../spv.ext.RayGenShader11.rgen.out | 91 + .../spv.ext.RayGenShaderArray.rgen.out | 141 + .../spv.ext.RayGenShader_Errors.rgen.out | 40 + .../spv.imageLoadStoreLod.frag.out | 1 - .../spv.memoryScopeSemantics.comp.out | 14 +- .../Test/baseResults/spv.nonuniform.frag.out | 28 + .../Test/baseResults/spv.nonuniform2.frag.out | 1 + .../Test/baseResults/spv.nonuniform3.frag.out | 61 + .../Test/baseResults/spv.nonuniform4.frag.out | 50 + .../Test/baseResults/spv.nonuniform5.frag.out | 56 + .../baseResults/spv.specConstant.vert.out | 6 +- .../Test/baseResults/spv.specTexture.frag.out | 43 + .../glslang/Test/baseResults/vulkan.frag.out | 14 +- .../glslang/Test/compoundsuffix.frag.hlsl | 12 +- .../glslang/Test/compoundsuffix.vert.glsl | 6 +- .../deps/glslang/Test/conditionalDiscard.frag | 28 +- core/deps/glslang/Test/constFold.frag | 55 +- .../glslang/Test/constantUnaryConversion.comp | 96 +- core/deps/glslang/Test/conversion.frag | 224 +- core/deps/glslang/Test/cppBad.vert | 10 +- core/deps/glslang/Test/cppBad2.vert | 4 +- core/deps/glslang/Test/cppDeepNest.frag | 234 +- .../Test/cppRelaxSkipTokensErrors.vert | 28 +- core/deps/glslang/Test/dataOut.frag | 16 +- core/deps/glslang/Test/dataOutIndirect.frag | 20 +- core/deps/glslang/Test/dce.frag | 112 +- core/deps/glslang/Test/decls.frag | 98 +- core/deps/glslang/Test/deepRvalue.frag | 72 +- core/deps/glslang/Test/depthOut.frag | 20 +- core/deps/glslang/Test/discard-dce.frag | 70 +- core/deps/glslang/Test/doWhileLoop.frag | 32 +- .../deps/glslang/Test/earlyReturnDiscard.frag | 204 +- core/deps/glslang/Test/flowControl.frag | 46 +- core/deps/glslang/Test/foo.h | 2 +- core/deps/glslang/Test/forLoop.frag | 82 +- core/deps/glslang/Test/functionCall.frag | 88 +- core/deps/glslang/Test/functionSemantics.frag | 148 +- core/deps/glslang/Test/glsl.450.subgroup.frag | 504 +- core/deps/glslang/Test/glsl.450.subgroup.geom | 508 +- core/deps/glslang/Test/glsl.450.subgroup.tesc | 506 +- core/deps/glslang/Test/glsl.450.subgroup.tese | 506 +- core/deps/glslang/Test/glsl.450.subgroup.vert | 506 +- .../Test/glsl.450.subgroupArithmetic.comp | 786 +- .../glslang/Test/glsl.450.subgroupBallot.comp | 172 +- .../Test/glsl.450.subgroupBallotNeg.comp | 66 +- .../glslang/Test/glsl.450.subgroupBasic.comp | 516 +- .../Test/glsl.450.subgroupClustered.comp | 286 +- .../Test/glsl.450.subgroupClusteredNeg.comp | 78 +- .../Test/glsl.450.subgroupPartitioned.comp | 840 +- .../glslang/Test/glsl.450.subgroupQuad.comp | 236 +- .../Test/glsl.450.subgroupShuffle.comp | 136 +- .../glsl.450.subgroupShuffleRelative.comp | 136 +- .../glslang/Test/glsl.450.subgroupVote.comp | 98 +- .../glslang/Test/glsl.entryPointRename.vert | 22 +- .../glslang/Test/glsl.entryPointRename2.vert | 12 +- .../glslang/Test/glsl.es320.subgroup.frag | 14 +- .../glslang/Test/glsl.es320.subgroup.geom | 26 +- .../glslang/Test/glsl.es320.subgroup.tesc | 24 +- .../glslang/Test/glsl.es320.subgroup.tese | 24 +- .../glslang/Test/glsl.es320.subgroup.vert | 22 +- .../Test/glsl.es320.subgroupArithmetic.comp | 664 +- .../Test/glsl.es320.subgroupBallot.comp | 150 +- .../Test/glsl.es320.subgroupBallotNeg.comp | 64 +- .../Test/glsl.es320.subgroupBasic.comp | 46 +- .../Test/glsl.es320.subgroupClustered.comp | 244 +- .../Test/glsl.es320.subgroupClusteredNeg.comp | 68 +- .../Test/glsl.es320.subgroupPartitioned.comp | 708 +- .../glslang/Test/glsl.es320.subgroupQuad.comp | 194 +- .../Test/glsl.es320.subgroupShuffle.comp | 114 +- .../glsl.es320.subgroupShuffleRelative.comp | 114 +- .../glslang/Test/glsl.es320.subgroupVote.comp | 86 +- core/deps/glslang/Test/glspv.esversion.vert | 10 +- core/deps/glslang/Test/glspv.frag | 56 +- core/deps/glslang/Test/glspv.version.frag | 10 +- core/deps/glslang/Test/glspv.version.vert | 10 +- core/deps/glslang/Test/glspv.vert | 40 +- core/deps/glslang/Test/hlsl.PointSize.vert | 6 +- core/deps/glslang/Test/hlsl.aliasOpaque.frag | 58 +- core/deps/glslang/Test/hlsl.attributeC11.frag | 44 +- .../Test/hlsl.attributeGlobalBuffer.frag | 14 +- core/deps/glslang/Test/hlsl.basic.comp | 12 +- core/deps/glslang/Test/hlsl.charLit.vert | 34 +- core/deps/glslang/Test/hlsl.conditional.frag | 16 +- .../Test/hlsl.deadFunctionMissingBody.vert | 16 +- .../glslang/Test/hlsl.earlydepthstencil.frag | 24 +- .../glslang/Test/hlsl.emptystructreturn.frag | 26 +- .../deps/glslang/Test/hlsl.flattenOpaque.frag | 80 +- .../glslang/Test/hlsl.flattenOpaqueInit.vert | 48 +- .../Test/hlsl.flattenOpaqueInitMix.vert | 24 +- .../deps/glslang/Test/hlsl.flattenSubset.frag | 72 +- .../glslang/Test/hlsl.flattenSubset2.frag | 48 +- core/deps/glslang/Test/hlsl.function.frag | 48 +- core/deps/glslang/Test/hlsl.gs-hs-mix.tesc | 238 +- core/deps/glslang/Test/hlsl.hlslOffset.vert | 40 +- core/deps/glslang/Test/hlsl.implicitBool.frag | 62 +- core/deps/glslang/Test/hlsl.inf.vert | 20 +- core/deps/glslang/Test/hlsl.init.frag | 32 +- core/deps/glslang/Test/hlsl.init2.frag | 20 +- core/deps/glslang/Test/hlsl.int.dot.frag | 26 +- .../glslang/Test/hlsl.layoutOverride.vert | 12 +- .../Test/hlsl.localStructuredBuffer.comp | 6 +- .../glslang/Test/hlsl.logicalConvert.frag | 44 +- .../deps/glslang/Test/hlsl.matrixSwizzle.vert | 14 +- .../deps/glslang/Test/hlsl.memberFunCall.frag | 32 +- .../glslang/Test/hlsl.multiDescriptorSet.frag | 90 +- core/deps/glslang/Test/hlsl.multiEntry.vert | 20 +- core/deps/glslang/Test/hlsl.multiReturn.frag | 38 +- core/deps/glslang/Test/hlsl.namespace.frag | 46 +- .../Test/hlsl.noSemantic.functionality1.comp | 12 +- .../Test/hlsl.nonstaticMemberFunction.frag | 70 +- .../Test/hlsl.partialFlattenLocal.vert | 52 +- .../Test/hlsl.partialFlattenMixed.vert | 30 +- core/deps/glslang/Test/hlsl.partialInit.frag | 72 +- core/deps/glslang/Test/hlsl.pp.expand.frag | 36 +- .../glslang/Test/hlsl.reflection.binding.frag | 68 +- core/deps/glslang/Test/hlsl.reflection.vert | 276 +- core/deps/glslang/Test/hlsl.scalarCast.vert | 74 +- core/deps/glslang/Test/hlsl.semantic.geom | 8 + core/deps/glslang/Test/hlsl.shapeConvRet.frag | 18 +- .../glslang/Test/hlsl.singleArgIntPromo.vert | 16 + core/deps/glslang/Test/hlsl.specConstant.frag | 30 +- .../Test/hlsl.staticMemberFunction.frag | 44 +- core/deps/glslang/Test/hlsl.struct.frag | 10 +- .../glslang/Test/hlsl.structIoFourWay.frag | 36 +- .../glslang/Test/hlsl.structStructName.frag | 14 +- .../glslang/Test/hlsl.synthesizeInput.frag | 16 +- core/deps/glslang/Test/hlsl.target.frag | 18 +- .../deps/glslang/Test/hlsl.targetStruct1.frag | 36 +- .../deps/glslang/Test/hlsl.targetStruct2.frag | 36 +- core/deps/glslang/Test/hlsl.this.frag | 58 +- core/deps/glslang/Test/hlsl.type.half.frag | 30 +- .../Test/hlsl.type.type.conversion.all.frag | 380 +- .../Test/hlsl.type.type.conversion.valid.frag | 180 +- .../deps/glslang/Test/hlsl.typeGraphCopy.vert | 48 +- .../deps/glslang/Test/hlsl.wavebroadcast.comp | 106 +- core/deps/glslang/Test/hlsl.waveprefix.comp | 110 +- core/deps/glslang/Test/hlsl.wavequad.comp | 306 +- core/deps/glslang/Test/hlsl.wavequery.comp | 14 +- core/deps/glslang/Test/hlsl.wavequery.frag | 22 +- .../deps/glslang/Test/hlsl.wavereduction.comp | 250 +- core/deps/glslang/Test/hlsl.wavevote.comp | 20 +- core/deps/glslang/Test/inc2/foo.h | 2 +- core/deps/glslang/Test/length.frag | 36 +- .../glslang/Test/lineContinuation100.vert | 112 +- .../Test/link.multiAnonBlocksInvalid.0.0.vert | 52 + .../Test/link.multiAnonBlocksInvalid.0.1.vert | 48 + .../Test/link.multiAnonBlocksValid.0.0.vert | 38 + .../Test/link.multiAnonBlocksValid.0.1.vert | 34 + .../Test/link.multiBlocksInvalid.0.0.vert | 40 + .../Test/link.multiBlocksInvalid.0.1.vert | 31 + .../Test/link.multiBlocksValid.1.0.vert | 32 + .../Test/link.multiBlocksValid.1.1.vert | 34 + .../glslang/Test/link.vk.differentPC.0.0.frag | 18 + .../glslang/Test/link.vk.differentPC.0.1.frag | 14 + .../glslang/Test/link.vk.differentPC.0.2.frag | 15 + .../glslang/Test/link.vk.differentPC.1.0.frag | 16 + .../glslang/Test/link.vk.differentPC.1.1.frag | 14 + .../glslang/Test/link.vk.differentPC.1.2.frag | 18 + .../glslang/Test/link.vk.matchingPC.0.0.frag | 18 + .../glslang/Test/link.vk.matchingPC.0.1.frag | 14 + .../glslang/Test/link.vk.matchingPC.0.2.frag | 14 + .../Test/link.vk.multiBlocksValid.0.0.vert | 49 + .../Test/link.vk.multiBlocksValid.0.1.vert | 46 + .../Test/link.vk.multiBlocksValid.1.0.geom | 62 + .../Test/link.vk.multiBlocksValid.1.1.geom | 54 + .../Test/link.vk.pcNamingInvalid.0.0.vert | 21 + .../Test/link.vk.pcNamingInvalid.0.1.vert | 22 + .../Test/link.vk.pcNamingValid.0.0.vert | 21 + .../Test/link.vk.pcNamingValid.0.1.vert | 22 + core/deps/glslang/Test/link1.frag | 76 +- core/deps/glslang/Test/link1.vk.frag | 48 +- core/deps/glslang/Test/link2.frag | 72 +- core/deps/glslang/Test/link2.vk.frag | 46 +- core/deps/glslang/Test/link3.frag | 18 +- core/deps/glslang/Test/localAggregates.frag | 144 +- core/deps/glslang/Test/loops.frag | 640 +- core/deps/glslang/Test/loopsArtificial.frag | 192 +- core/deps/glslang/Test/mains.frag | 18 +- core/deps/glslang/Test/mains1.frag | 10 +- core/deps/glslang/Test/mains2.frag | 10 +- core/deps/glslang/Test/matrix.frag | 110 +- core/deps/glslang/Test/matrix2.frag | 102 +- core/deps/glslang/Test/max_vertices_0.geom | 24 +- core/deps/glslang/Test/missingBodies.vert | 48 +- core/deps/glslang/Test/mixedArrayDecls.frag | 60 +- core/deps/glslang/Test/newTexture.frag | 150 +- core/deps/glslang/Test/noMain.vert | 10 +- core/deps/glslang/Test/noMain1.geom | 12 +- core/deps/glslang/Test/noMain2.geom | 14 +- core/deps/glslang/Test/nonVulkan.frag | 18 +- core/deps/glslang/Test/nonuniform.frag | 66 +- core/deps/glslang/Test/nosuffix | 6 +- core/deps/glslang/Test/numeral.frag | 212 +- core/deps/glslang/Test/parentBad | 6 +- core/deps/glslang/Test/precision.frag | 152 +- core/deps/glslang/Test/prepost.frag | 76 +- .../glslang/Test/preprocessor.bad_arg.vert | 16 +- .../glslang/Test/preprocessor.edge_cases.vert | 30 +- .../glslang/Test/preprocessor.errors.vert | 40 +- .../glslang/Test/preprocessor.extensions.vert | 24 +- .../Test/preprocessor.function_macro.vert | 40 +- .../Test/preprocessor.include.enabled.vert | 38 +- core/deps/glslang/Test/preprocessor.line.vert | 78 +- .../glslang/Test/preprocessor.pragma.vert | 26 +- .../glslang/Test/preprocessor.simple.vert | 130 +- .../glslang/Test/rayQuery-allOps.Error.rgen | 212 + core/deps/glslang/Test/rayQuery-allOps.comp | 212 + core/deps/glslang/Test/rayQuery-allOps.frag | 212 + core/deps/glslang/Test/rayQuery-allOps.rgen | 212 + .../Test/rayQuery-committed.Error.rgen | 105 + .../glslang/Test/rayQuery-initialize.rgen | 33 + core/deps/glslang/Test/rayQuery-no-cse.rgen | 35 + core/deps/glslang/Test/rayQuery.rgen | 23 + core/deps/glslang/Test/recurse1.frag | 96 +- core/deps/glslang/Test/recurse1.vert | 88 +- core/deps/glslang/Test/recurse2.frag | 56 +- core/deps/glslang/Test/reflection.frag | 16 +- core/deps/glslang/Test/reflection.linked.frag | 38 +- core/deps/glslang/Test/reflection.linked.vert | 38 +- .../deps/glslang/Test/reflection.options.geom | 62 +- .../deps/glslang/Test/reflection.options.vert | 128 +- core/deps/glslang/Test/reflection.vert | 490 +- core/deps/glslang/Test/runtests | 5 +- core/deps/glslang/Test/runtimeArray.vert | 220 +- core/deps/glslang/Test/sample.frag | 82 +- core/deps/glslang/Test/sample.vert | 86 +- .../deps/glslang/Test/simpleFunctionCall.frag | 30 +- core/deps/glslang/Test/specExamples.frag | 474 +- core/deps/glslang/Test/specExamples.vert | 392 +- .../Test/spv.1.3.8bitstorage-ssbo.vert | 30 +- .../glslang/Test/spv.1.3.8bitstorage-ubo.vert | 30 +- core/deps/glslang/Test/spv.1.3.coopmat.comp | 46 +- .../glslang/Test/spv.1.4.OpCopyLogical.comp | 96 +- .../Test/spv.1.4.OpCopyLogical.funcall.frag | 40 +- .../Test/spv.1.4.OpCopyLogicalBool.comp | 96 +- .../Test/spv.1.4.constructComposite.comp | 50 +- core/deps/glslang/Test/spv.1.4.image.frag | 76 +- .../glslang/Test/spv.1.4.sparseTexture.frag | 92 +- core/deps/glslang/Test/spv.1.4.texture.frag | 50 +- core/deps/glslang/Test/spv.100ops.frag | 54 +- core/deps/glslang/Test/spv.130.frag | 184 +- core/deps/glslang/Test/spv.140.frag | 92 +- core/deps/glslang/Test/spv.150.geom | 78 +- core/deps/glslang/Test/spv.150.vert | 76 +- .../glslang/Test/spv.16bitstorage-int.frag | 180 +- .../glslang/Test/spv.16bitstorage-uint.frag | 180 +- core/deps/glslang/Test/spv.16bitstorage.frag | 180 +- .../Test/spv.16bitstorage_Error-int.frag | 202 +- .../Test/spv.16bitstorage_Error-uint.frag | 202 +- .../glslang/Test/spv.16bitstorage_Error.frag | 204 +- core/deps/glslang/Test/spv.16bitxfb.vert | 64 +- core/deps/glslang/Test/spv.300BuiltIns.vert | 28 +- core/deps/glslang/Test/spv.300layout.frag | 44 +- core/deps/glslang/Test/spv.300layout.vert | 98 +- core/deps/glslang/Test/spv.300layoutp.vert | 98 +- core/deps/glslang/Test/spv.310.bitcast.frag | 80 +- core/deps/glslang/Test/spv.330.geom | 52 +- core/deps/glslang/Test/spv.400.frag | 524 +- core/deps/glslang/Test/spv.400.tesc | 86 +- core/deps/glslang/Test/spv.400.tese | 104 +- core/deps/glslang/Test/spv.420.geom | 86 +- core/deps/glslang/Test/spv.430.frag | 20 +- core/deps/glslang/Test/spv.430.vert | 74 +- core/deps/glslang/Test/spv.450.geom | 28 +- core/deps/glslang/Test/spv.450.noRedecl.tesc | 20 +- core/deps/glslang/Test/spv.450.tesc | 62 +- core/deps/glslang/Test/spv.460.comp | 18 +- core/deps/glslang/Test/spv.460.frag | 34 +- core/deps/glslang/Test/spv.460.vert | 12 +- .../glslang/Test/spv.8bitstorage-int.frag | 180 +- .../glslang/Test/spv.8bitstorage-ssbo.vert | 30 +- .../glslang/Test/spv.8bitstorage-ubo.vert | 30 +- .../glslang/Test/spv.8bitstorage-uint.frag | 180 +- .../Test/spv.8bitstorage_Error-int.frag | 202 +- .../Test/spv.8bitstorage_Error-uint.frag | 202 +- core/deps/glslang/Test/spv.AofA.frag | 86 +- .../Test/spv.GeometryShaderPassthrough.geom | 32 +- core/deps/glslang/Test/spv.Operations.frag | 290 +- .../glslang/Test/spv.RayGenShaderArray.rgen | 8 +- core/deps/glslang/Test/spv.accessChain.frag | 200 +- core/deps/glslang/Test/spv.aggOps.frag | 102 +- .../deps/glslang/Test/spv.always-discard.frag | 72 +- .../glslang/Test/spv.always-discard2.frag | 38 +- .../Test/spv.arbPostDepthCoverage.frag | 26 +- .../Test/spv.arbPostDepthCoverage_Error.frag | 24 +- core/deps/glslang/Test/spv.atomic.comp | 96 +- core/deps/glslang/Test/spv.atomicCounter.comp | 26 + core/deps/glslang/Test/spv.atomicInt64.comp | 158 +- core/deps/glslang/Test/spv.barrier.vert | 28 +- core/deps/glslang/Test/spv.bitCast.frag | 88 +- core/deps/glslang/Test/spv.bool.vert | 34 +- core/deps/glslang/Test/spv.boolInBlock.frag | 60 +- core/deps/glslang/Test/spv.bufferhandle1.frag | 56 +- .../deps/glslang/Test/spv.bufferhandle10.frag | 50 +- .../deps/glslang/Test/spv.bufferhandle11.frag | 50 +- .../deps/glslang/Test/spv.bufferhandle12.frag | 82 +- .../deps/glslang/Test/spv.bufferhandle13.frag | 60 +- .../deps/glslang/Test/spv.bufferhandle14.frag | 80 +- .../deps/glslang/Test/spv.bufferhandle15.frag | 76 +- .../deps/glslang/Test/spv.bufferhandle16.frag | 52 +- .../Test/spv.bufferhandle17_Errors.frag | 40 +- .../deps/glslang/Test/spv.bufferhandle18.frag | 118 +- .../Test/spv.bufferhandle19_Errors.frag | 64 +- core/deps/glslang/Test/spv.bufferhandle2.frag | 50 +- core/deps/glslang/Test/spv.bufferhandle3.frag | 50 +- core/deps/glslang/Test/spv.bufferhandle4.frag | 52 +- core/deps/glslang/Test/spv.bufferhandle5.frag | 32 +- core/deps/glslang/Test/spv.bufferhandle6.frag | 58 +- core/deps/glslang/Test/spv.bufferhandle7.frag | 48 +- core/deps/glslang/Test/spv.bufferhandle8.frag | 64 +- core/deps/glslang/Test/spv.bufferhandle9.frag | 60 +- .../glslang/Test/spv.bufferhandleUvec2.frag | 64 +- .../glslang/Test/spv.bufferhandle_Error.frag | 90 +- core/deps/glslang/Test/spv.builtInXFB.vert | 28 +- .../glslang/Test/spv.conditionalDemote.frag | 36 +- .../glslang/Test/spv.conditionalDiscard.frag | 28 +- .../deps/glslang/Test/spv.constConstruct.vert | 316 +- core/deps/glslang/Test/spv.constStruct.vert | 44 +- .../glslang/Test/spv.constructComposite.comp | 50 +- core/deps/glslang/Test/spv.conversion.frag | 224 +- core/deps/glslang/Test/spv.coopmat.comp | 220 +- core/deps/glslang/Test/spv.coopmat_Error.comp | 144 +- core/deps/glslang/Test/spv.dataOut.frag | 16 +- .../glslang/Test/spv.dataOutIndirect.frag | 24 +- .../glslang/Test/spv.dataOutIndirect.vert | 24 +- core/deps/glslang/Test/spv.debugInfo.frag | 102 +- core/deps/glslang/Test/spv.debugPrintf.frag | 13 + .../glslang/Test/spv.debugPrintf_Error.frag | 11 + core/deps/glslang/Test/spv.deepRvalue.frag | 72 +- .../deps/glslang/Test/spv.demoteDisabled.frag | 20 +- core/deps/glslang/Test/spv.depthOut.frag | 22 +- core/deps/glslang/Test/spv.discard-dce.frag | 70 +- core/deps/glslang/Test/spv.doWhileLoop.frag | 32 +- core/deps/glslang/Test/spv.double.comp | 50 +- .../glslang/Test/spv.earlyReturnDiscard.frag | 204 +- .../glslang/Test/spv.ext.AnyHitShader.rahit | 29 + .../Test/spv.ext.AnyHitShader_Errors.rahit | 11 + .../Test/spv.ext.ClosestHitShader.rchit | 27 + .../spv.ext.ClosestHitShader_Errors.rchit | 13 + .../glslang/Test/spv.ext.IntersectShader.rint | 23 + .../Test/spv.ext.IntersectShader_Errors.rint | 11 + .../glslang/Test/spv.ext.MissShader.rmiss | 15 + .../Test/spv.ext.MissShader_Errors.rmiss | 16 + .../glslang/Test/spv.ext.RayCallable.rcall | 13 + .../Test/spv.ext.RayCallable_Errors.rcall | 26 + .../glslang/Test/spv.ext.RayConstants.rgen | 15 + .../glslang/Test/spv.ext.RayGenShader.rgen | 21 + .../glslang/Test/spv.ext.RayGenShader11.rgen | 17 + .../Test/spv.ext.RayGenShaderArray.rgen | 22 + .../Test/spv.ext.RayGenShader_Errors.rgen | 42 + .../Test/spv.extPostDepthCoverage.frag | 18 +- .../Test/spv.extPostDepthCoverage_Error.frag | 18 +- core/deps/glslang/Test/spv.float16.frag | 612 +- core/deps/glslang/Test/spv.float16Fetch.frag | 2546 ++--- .../Test/spv.float16convertonlyarith.comp | 20 +- .../Test/spv.float16convertonlystorage.comp | 20 +- core/deps/glslang/Test/spv.flowControl.frag | 46 +- core/deps/glslang/Test/spv.forLoop.frag | 82 +- core/deps/glslang/Test/spv.forwardFun.frag | 78 +- core/deps/glslang/Test/spv.fsi.frag | 40 +- core/deps/glslang/Test/spv.fsi_Error.frag | 46 +- core/deps/glslang/Test/spv.functionCall.frag | 88 +- .../Test/spv.functionNestedOpaque.vert | 52 +- .../Test/spv.functionParameterTypes.frag | 40 +- .../glslang/Test/spv.functionSemantics.frag | 126 +- core/deps/glslang/Test/spv.glFragColor.frag | 12 +- core/deps/glslang/Test/spv.hlslDebugInfo.vert | 8 +- core/deps/glslang/Test/spv.hlslOffsets.vert | 52 +- core/deps/glslang/Test/spv.image.frag | 194 +- .../Test/spv.image.load-formatted.frag | 148 +- .../glslang/Test/spv.imageLoadStoreLod.frag | 70 +- core/deps/glslang/Test/spv.int64.frag | 536 +- core/deps/glslang/Test/spv.intOps.vert | 144 +- core/deps/glslang/Test/spv.intcoopmat.comp | 220 +- core/deps/glslang/Test/spv.interpOps.frag | 64 +- core/deps/glslang/Test/spv.layoutNested.vert | 152 +- core/deps/glslang/Test/spv.length.frag | 28 +- .../glslang/Test/spv.localAggregates.frag | 144 +- core/deps/glslang/Test/spv.loops.frag | 604 +- .../glslang/Test/spv.loopsArtificial.frag | 134 +- .../glslang/Test/spv.looseUniformNoLoc.vert | 28 +- core/deps/glslang/Test/spv.matFun.vert | 56 +- core/deps/glslang/Test/spv.matrix.frag | 98 +- core/deps/glslang/Test/spv.matrix2.frag | 100 +- .../glslang/Test/spv.memoryQualifier.frag | 74 +- .../Test/spv.memoryScopeSemantics.comp | 144 +- .../Test/spv.memoryScopeSemantics_Error.comp | 60 +- .../glslang/Test/spv.merge-unreachable.frag | 16 +- .../Test/spv.meshShaderPerView_Errors.mesh | 64 +- .../spv.meshShaderRedeclPerViewBuiltins.mesh | 106 +- core/deps/glslang/Test/spv.multiStruct.comp | 96 +- .../glslang/Test/spv.multiStructFuncall.frag | 40 +- .../Test/spv.multiviewPerViewAttributes.tesc | 28 +- .../Test/spv.multiviewPerViewAttributes.vert | 20 +- core/deps/glslang/Test/spv.newTexture.frag | 144 +- core/deps/glslang/Test/spv.noBuiltInLoc.vert | 36 +- core/deps/glslang/Test/spv.noLocation.vert | 78 +- core/deps/glslang/Test/spv.noWorkgroup.comp | 14 +- core/deps/glslang/Test/spv.nonSquare.vert | 50 +- core/deps/glslang/Test/spv.nonuniform.frag | 110 +- core/deps/glslang/Test/spv.nonuniform2.frag | 18 +- core/deps/glslang/Test/spv.nonuniform3.frag | 10 + core/deps/glslang/Test/spv.nonuniform4.frag | 8 + core/deps/glslang/Test/spv.nonuniform5.frag | 15 + core/deps/glslang/Test/spv.offsets.frag | 32 +- .../deps/glslang/Test/spv.perprimitiveNV.frag | 42 +- core/deps/glslang/Test/spv.precision.frag | 120 +- .../glslang/Test/spv.precisionNonESSamp.frag | 48 +- core/deps/glslang/Test/spv.prepost.frag | 76 +- .../Test/spv.privateVariableTypes.frag | 34 +- core/deps/glslang/Test/spv.pushConstant.vert | 34 +- .../glslang/Test/spv.pushConstantAnon.vert | 34 +- core/deps/glslang/Test/spv.qualifiers.vert | 38 +- core/deps/glslang/Test/spv.queryL.frag | 124 +- core/deps/glslang/Test/spv.rankShift.comp | 28 +- core/deps/glslang/Test/spv.scalarlayout.frag | 64 +- .../glslang/Test/spv.scalarlayoutfloat16.frag | 62 +- core/deps/glslang/Test/spv.separate.frag | 36 +- core/deps/glslang/Test/spv.set.vert | 28 +- core/deps/glslang/Test/spv.shaderBallot.comp | 116 +- .../glslang/Test/spv.shaderBallotAMD.comp | 408 +- .../glslang/Test/spv.shaderDrawParams.vert | 32 +- .../glslang/Test/spv.shaderFragMaskAMD.frag | 56 +- .../glslang/Test/spv.shaderGroupVote.comp | 42 +- .../glslang/Test/spv.shaderStencilExport.frag | 20 +- core/deps/glslang/Test/spv.shiftOps.frag | 36 +- core/deps/glslang/Test/spv.shortCircuit.frag | 100 +- .../glslang/Test/spv.simpleFunctionCall.frag | 26 +- core/deps/glslang/Test/spv.simpleMat.vert | 38 +- core/deps/glslang/Test/spv.sparseTexture.frag | 180 +- .../glslang/Test/spv.sparseTextureClamp.frag | 138 +- core/deps/glslang/Test/spv.specConst.vert | 16 +- .../glslang/Test/spv.specConstArrayCheck.vert | 28 +- core/deps/glslang/Test/spv.specConstant.comp | 26 +- core/deps/glslang/Test/spv.specConstant.vert | 102 +- .../Test/spv.specConstantOperations.vert | 14 +- core/deps/glslang/Test/spv.specTexture.frag | 10 + .../glslang/Test/spv.stereoViewRendering.tesc | 38 +- .../glslang/Test/spv.stereoViewRendering.vert | 24 +- core/deps/glslang/Test/spv.storageBuffer.vert | 32 +- .../glslang/Test/spv.structAssignment.frag | 82 +- core/deps/glslang/Test/spv.structDeref.frag | 142 +- core/deps/glslang/Test/spv.structure.frag | 62 +- core/deps/glslang/Test/spv.subgroup.frag | 14 +- core/deps/glslang/Test/spv.subgroup.geom | 26 +- core/deps/glslang/Test/spv.subgroup.tesc | 24 +- core/deps/glslang/Test/spv.subgroup.tese | 24 +- core/deps/glslang/Test/spv.subgroup.vert | 22 +- .../glslang/Test/spv.subgroupArithmetic.comp | 786 +- .../deps/glslang/Test/spv.subgroupBallot.comp | 172 +- .../glslang/Test/spv.subgroupBallotNeg.comp | 66 +- core/deps/glslang/Test/spv.subgroupBasic.comp | 46 +- .../glslang/Test/spv.subgroupClustered.comp | 286 +- .../Test/spv.subgroupClusteredNeg.comp | 78 +- .../spv.subgroupExtendedTypesArithmetic.comp | 1430 +-- ...pv.subgroupExtendedTypesArithmeticNeg.comp | 1430 +-- .../Test/spv.subgroupExtendedTypesBallot.comp | 176 +- .../spv.subgroupExtendedTypesBallotNeg.comp | 176 +- .../spv.subgroupExtendedTypesClustered.comp | 510 +- ...spv.subgroupExtendedTypesClusteredNeg.comp | 510 +- .../spv.subgroupExtendedTypesPartitioned.comp | 582 +- ...v.subgroupExtendedTypesPartitionedNeg.comp | 582 +- .../Test/spv.subgroupExtendedTypesQuad.comp | 330 +- .../spv.subgroupExtendedTypesQuadNeg.comp | 330 +- .../spv.subgroupExtendedTypesShuffle.comp | 190 +- .../spv.subgroupExtendedTypesShuffleNeg.comp | 190 +- ....subgroupExtendedTypesShuffleRelative.comp | 190 +- ...bgroupExtendedTypesShuffleRelativeNeg.comp | 190 +- .../Test/spv.subgroupExtendedTypesVote.comp | 132 +- .../spv.subgroupExtendedTypesVoteNeg.comp | 132 +- .../glslang/Test/spv.subgroupPartitioned.comp | 840 +- core/deps/glslang/Test/spv.subgroupQuad.comp | 236 +- .../glslang/Test/spv.subgroupShuffle.comp | 136 +- .../Test/spv.subgroupShuffleRelative.comp | 136 +- core/deps/glslang/Test/spv.subgroupVote.comp | 98 +- core/deps/glslang/Test/spv.subpass.frag | 58 +- core/deps/glslang/Test/spv.switch.frag | 284 +- core/deps/glslang/Test/spv.swizzle.frag | 104 +- .../glslang/Test/spv.swizzleInversion.frag | 32 +- core/deps/glslang/Test/spv.targetOpenGL.vert | 20 +- core/deps/glslang/Test/spv.targetVulkan.vert | 18 +- core/deps/glslang/Test/spv.test.frag | 44 +- core/deps/glslang/Test/spv.test.vert | 28 +- core/deps/glslang/Test/spv.texture.frag | 144 +- .../Test/spv.texture.sampler.transform.frag | 26 +- core/deps/glslang/Test/spv.texture.vert | 78 +- core/deps/glslang/Test/spv.textureBuffer.vert | 34 +- .../Test/spv.textureGatherBiasLod.frag | 176 +- core/deps/glslang/Test/spv.types.frag | 156 +- core/deps/glslang/Test/spv.uint.frag | 204 +- core/deps/glslang/Test/spv.uniformArray.frag | 34 +- .../glslang/Test/spv.variableArrayIndex.frag | 98 +- core/deps/glslang/Test/spv.varyingArray.frag | 38 +- .../Test/spv.varyingArrayIndirect.frag | 42 +- .../glslang/Test/spv.vecMatConstruct.frag | 28 +- .../deps/glslang/Test/spv.viewportArray2.tesc | 32 +- core/deps/glslang/Test/spv.voidFunction.frag | 68 +- .../deps/glslang/Test/spv.volatileAtomic.comp | 16 +- .../spv.vulkan100.subgroupArithmetic.comp | 786 +- .../spv.vulkan100.subgroupPartitioned.comp | 840 +- .../Test/spv.vulkan110.storageBuffer.vert | 32 +- core/deps/glslang/Test/spv.whileLoop.frag | 32 +- core/deps/glslang/Test/spv.xfb.vert | 38 +- core/deps/glslang/Test/spv.xfb2.vert | 34 +- core/deps/glslang/Test/spv.xfb3.vert | 34 +- core/deps/glslang/Test/structAssignment.frag | 78 +- core/deps/glslang/Test/structDeref.frag | 142 +- core/deps/glslang/Test/structure.frag | 62 +- core/deps/glslang/Test/swizzle.frag | 104 +- core/deps/glslang/Test/syntaxError.frag | 32 +- core/deps/glslang/Test/test.frag | 44 +- core/deps/glslang/Test/texture.frag | 144 +- core/deps/glslang/Test/tokenPaste.vert | 58 +- core/deps/glslang/Test/types.frag | 162 +- core/deps/glslang/Test/uniformArray.frag | 32 +- .../deps/glslang/Test/variableArrayIndex.frag | 96 +- core/deps/glslang/Test/varyingArray.frag | 38 +- .../glslang/Test/varyingArrayIndirect.frag | 42 +- core/deps/glslang/Test/versionsClean.frag | 90 +- core/deps/glslang/Test/versionsClean.vert | 86 +- core/deps/glslang/Test/versionsErrors.frag | 92 +- core/deps/glslang/Test/versionsErrors.vert | 92 +- core/deps/glslang/Test/voidFunction.frag | 68 +- core/deps/glslang/Test/vulkan.comp | 24 +- core/deps/glslang/Test/vulkan.frag | 210 +- core/deps/glslang/Test/vulkan.vert | 154 +- core/deps/glslang/Test/web.basic.vert | 30 +- core/deps/glslang/Test/web.builtins.vert | 28 +- core/deps/glslang/Test/whileLoop.frag | 32 +- core/deps/glslang/_config.yml | 2 +- .../CInterface/glslang_c_interface.cpp | 461 + core/deps/glslang/glslang/CMakeLists.txt | 16 +- core/deps/glslang/glslang/Include/BaseTypes.h | 84 +- .../glslang/glslang/Include/ConstantUnion.h | 2 +- core/deps/glslang/glslang/Include/Types.h | 56 +- .../glslang/Include/glslang_c_interface.h | 232 + .../glslang/Include/glslang_c_shader_types.h | 182 + .../glslang/glslang/Include/intermediate.h | 42 +- core/deps/glslang/glslang/Include/revision.h | 2 +- .../glslang/glslang/Include/revision.template | 26 +- .../glslang/MachineIndependent/Constant.cpp | 11 +- .../glslang/MachineIndependent/Initialize.cpp | 455 +- .../MachineIndependent/Intermediate.cpp | 18 +- .../MachineIndependent/ParseContextBase.cpp | 11 +- .../MachineIndependent/ParseHelper.cpp | 192 +- .../glslang/MachineIndependent/ParseHelper.h | 2 +- .../glslang/MachineIndependent/Scan.cpp | 55 +- .../glslang/MachineIndependent/ShaderLang.cpp | 34 +- .../MachineIndependent/SymbolTable.cpp | 6 +- .../glslang/MachineIndependent/Versions.cpp | 43 +- .../glslang/MachineIndependent/Versions.h | 14 +- .../glslang/MachineIndependent/glslang.m4 | 162 +- .../glslang/MachineIndependent/glslang.y | 163 +- .../MachineIndependent/glslang_tab.cpp | 8784 +++++++++-------- .../MachineIndependent/glslang_tab.cpp.h | 519 +- .../glslang/MachineIndependent/intermOut.cpp | 38 +- .../glslang/MachineIndependent/iomapper.cpp | 42 +- .../glslang/MachineIndependent/iomapper.h | 9 +- .../MachineIndependent/linkValidate.cpp | 122 +- .../MachineIndependent/localintermediate.h | 33 +- .../glslang/MachineIndependent/parseConst.cpp | 18 +- .../MachineIndependent/preprocessor/Pp.cpp | 23 +- .../preprocessor/PpContext.cpp | 3 +- .../preprocessor/PpContext.h | 5 +- .../preprocessor/PpScanner.cpp | 82 +- .../propagateNoContraction.cpp | 2 +- .../glslang/MachineIndependent/reflection.cpp | 2 +- .../glslang/MachineIndependent/reflection.h | 2 +- .../glslang/OSDependent/Web/CMakeLists.txt | 58 +- .../glslang/OSDependent/Web/glslang.js.cpp | 25 +- .../glslang/OSDependent/Web/glslang.pre.js | 39 +- core/deps/glslang/glslang/Public/ShaderLang.h | 57 +- core/deps/glslang/gtests/Hlsl.FromFile.cpp | 1 + core/deps/glslang/gtests/Link.FromFile.Vk.cpp | 11 + core/deps/glslang/gtests/Link.FromFile.cpp | 6 +- core/deps/glslang/gtests/Spv.FromFile.cpp | 30 + core/deps/glslang/gtests/TestFixture.cpp | 12 +- core/deps/glslang/hlsl/hlslGrammar.cpp | 2 + core/deps/glslang/hlsl/hlslParseHelper.cpp | 18 +- core/deps/glslang/hlsl/hlslParseHelper.h | 7 + core/deps/glslang/known_good.json | 4 +- 736 files changed, 51058 insertions(+), 39275 deletions(-) create mode 100644 core/deps/glslang/.appveyor.yml create mode 100755 core/deps/glslang/.gitattributes create mode 100644 core/deps/glslang/.gitignore create mode 100644 core/deps/glslang/.travis.yml mode change 100755 => 100644 core/deps/glslang/SPIRV/CMakeLists.txt mode change 100755 => 100644 core/deps/glslang/SPIRV/GlslangToSpv.cpp create mode 100644 core/deps/glslang/SPIRV/NonSemanticDebugPrintf.h create mode 100644 core/deps/glslang/StandAlone/resource_limits_c.cpp create mode 100644 core/deps/glslang/StandAlone/resource_limits_c.h create mode 100755 core/deps/glslang/Test/baseResults/hlsl.singleArgIntPromo.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.multiBlocksValid.1.0.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.differentPC.0.0.frag.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.differentPC.1.0.frag.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.matchingPC.0.0.frag.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out create mode 100755 core/deps/glslang/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-allOps.Error.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-allOps.comp.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-allOps.frag.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-allOps.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-committed.Error.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-initialize.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery-no-cse.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/rayQuery.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/spv.atomicCounter.comp.out create mode 100644 core/deps/glslang/Test/baseResults/spv.debugPrintf.frag.out create mode 100644 core/deps/glslang/Test/baseResults/spv.debugPrintf_Error.frag.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader.rahit.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader_Errors.rahit.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader.rchit.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader_Errors.rchit.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.IntersectShader.rint.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.IntersectShader_Errors.rint.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.MissShader.rmiss.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.MissShader_Errors.rmiss.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayCallable.rcall.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayCallable_Errors.rcall.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayConstants.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayGenShader.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayGenShader11.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/spv.ext.RayGenShader_Errors.rgen.out create mode 100644 core/deps/glslang/Test/baseResults/spv.nonuniform3.frag.out create mode 100644 core/deps/glslang/Test/baseResults/spv.nonuniform4.frag.out create mode 100644 core/deps/glslang/Test/baseResults/spv.nonuniform5.frag.out create mode 100755 core/deps/glslang/Test/baseResults/spv.specTexture.frag.out create mode 100755 core/deps/glslang/Test/hlsl.singleArgIntPromo.vert create mode 100755 core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.0.vert create mode 100755 core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.1.vert create mode 100755 core/deps/glslang/Test/link.multiAnonBlocksValid.0.0.vert create mode 100755 core/deps/glslang/Test/link.multiAnonBlocksValid.0.1.vert create mode 100755 core/deps/glslang/Test/link.multiBlocksInvalid.0.0.vert create mode 100755 core/deps/glslang/Test/link.multiBlocksInvalid.0.1.vert create mode 100755 core/deps/glslang/Test/link.multiBlocksValid.1.0.vert create mode 100755 core/deps/glslang/Test/link.multiBlocksValid.1.1.vert create mode 100755 core/deps/glslang/Test/link.vk.differentPC.0.0.frag create mode 100755 core/deps/glslang/Test/link.vk.differentPC.0.1.frag create mode 100755 core/deps/glslang/Test/link.vk.differentPC.0.2.frag create mode 100755 core/deps/glslang/Test/link.vk.differentPC.1.0.frag create mode 100755 core/deps/glslang/Test/link.vk.differentPC.1.1.frag create mode 100755 core/deps/glslang/Test/link.vk.differentPC.1.2.frag create mode 100755 core/deps/glslang/Test/link.vk.matchingPC.0.0.frag create mode 100755 core/deps/glslang/Test/link.vk.matchingPC.0.1.frag create mode 100755 core/deps/glslang/Test/link.vk.matchingPC.0.2.frag create mode 100755 core/deps/glslang/Test/link.vk.multiBlocksValid.0.0.vert create mode 100755 core/deps/glslang/Test/link.vk.multiBlocksValid.0.1.vert create mode 100755 core/deps/glslang/Test/link.vk.multiBlocksValid.1.0.geom create mode 100755 core/deps/glslang/Test/link.vk.multiBlocksValid.1.1.geom create mode 100755 core/deps/glslang/Test/link.vk.pcNamingInvalid.0.0.vert create mode 100755 core/deps/glslang/Test/link.vk.pcNamingInvalid.0.1.vert create mode 100755 core/deps/glslang/Test/link.vk.pcNamingValid.0.0.vert create mode 100755 core/deps/glslang/Test/link.vk.pcNamingValid.0.1.vert create mode 100644 core/deps/glslang/Test/rayQuery-allOps.Error.rgen create mode 100644 core/deps/glslang/Test/rayQuery-allOps.comp create mode 100644 core/deps/glslang/Test/rayQuery-allOps.frag create mode 100644 core/deps/glslang/Test/rayQuery-allOps.rgen create mode 100644 core/deps/glslang/Test/rayQuery-committed.Error.rgen create mode 100644 core/deps/glslang/Test/rayQuery-initialize.rgen create mode 100644 core/deps/glslang/Test/rayQuery-no-cse.rgen create mode 100644 core/deps/glslang/Test/rayQuery.rgen create mode 100644 core/deps/glslang/Test/spv.atomicCounter.comp create mode 100644 core/deps/glslang/Test/spv.debugPrintf.frag create mode 100644 core/deps/glslang/Test/spv.debugPrintf_Error.frag create mode 100644 core/deps/glslang/Test/spv.ext.AnyHitShader.rahit create mode 100644 core/deps/glslang/Test/spv.ext.AnyHitShader_Errors.rahit create mode 100644 core/deps/glslang/Test/spv.ext.ClosestHitShader.rchit create mode 100644 core/deps/glslang/Test/spv.ext.ClosestHitShader_Errors.rchit create mode 100644 core/deps/glslang/Test/spv.ext.IntersectShader.rint create mode 100644 core/deps/glslang/Test/spv.ext.IntersectShader_Errors.rint create mode 100644 core/deps/glslang/Test/spv.ext.MissShader.rmiss create mode 100644 core/deps/glslang/Test/spv.ext.MissShader_Errors.rmiss create mode 100644 core/deps/glslang/Test/spv.ext.RayCallable.rcall create mode 100644 core/deps/glslang/Test/spv.ext.RayCallable_Errors.rcall create mode 100644 core/deps/glslang/Test/spv.ext.RayConstants.rgen create mode 100644 core/deps/glslang/Test/spv.ext.RayGenShader.rgen create mode 100644 core/deps/glslang/Test/spv.ext.RayGenShader11.rgen create mode 100644 core/deps/glslang/Test/spv.ext.RayGenShaderArray.rgen create mode 100644 core/deps/glslang/Test/spv.ext.RayGenShader_Errors.rgen create mode 100644 core/deps/glslang/Test/spv.nonuniform3.frag create mode 100644 core/deps/glslang/Test/spv.nonuniform4.frag create mode 100644 core/deps/glslang/Test/spv.nonuniform5.frag create mode 100644 core/deps/glslang/Test/spv.specTexture.frag create mode 100644 core/deps/glslang/glslang/CInterface/glslang_c_interface.cpp create mode 100644 core/deps/glslang/glslang/Include/glslang_c_interface.h create mode 100644 core/deps/glslang/glslang/Include/glslang_c_shader_types.h mode change 100644 => 100755 core/deps/glslang/glslang/MachineIndependent/linkValidate.cpp mode change 100755 => 100644 core/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp mode change 100755 => 100644 core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp mode change 100755 => 100644 core/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp mode change 100644 => 100755 core/deps/glslang/gtests/Link.FromFile.Vk.cpp mode change 100644 => 100755 core/deps/glslang/gtests/Link.FromFile.cpp diff --git a/core/deps/glslang/.appveyor.yml b/core/deps/glslang/.appveyor.yml new file mode 100644 index 000000000..44d5f046e --- /dev/null +++ b/core/deps/glslang/.appveyor.yml @@ -0,0 +1,108 @@ +# Windows Build Configuration for AppVeyor +# http://www.appveyor.com/docs/appveyor-yml + +# build version format +version: "{build}" + +os: Visual Studio 2013 + +platform: + - x64 + +configuration: + - Debug + - Release + +branches: + only: + - master + +# changes to these files don't need to trigger testing +skip_commits: + files: + - README.md + - README-spirv-remap.txt + - LICENSE.txt + - CODE_OF_CONDUCT.md + - BUILD.* + - WORKSPACE + - kokoro/* + - make-revision + - Android.mk + - _config.yml + +# Travis advances the master-tot tag to current top of the tree after +# each push into the master branch, because it relies on that tag to +# upload build artifacts to the master-tot release. This will cause +# double testing for each push on Appveyor: one for the push, one for +# the tag advance. Disable testing tags. +skip_tags: true + +clone_depth: 5 + +matrix: + fast_finish: true # Show final status immediately if a test fails. + +# scripts that run after cloning repository +install: + - C:/Python27/python.exe update_glslang_sources.py + - set PATH=C:\ninja;C:\Python36;%PATH% + - git clone https://github.com/google/googletest.git External/googletest + - cd External/googletest + - git checkout 440527a61e1c91188195f7de212c63c77e8f0a45 + - cd ../.. + +build: + parallel: true # enable MSBuild parallel builds + verbosity: minimal + +build_script: + - mkdir build && cd build + - cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install .. + - cmake --build . --config %CONFIGURATION% --target install + +test_script: + - ctest -C %CONFIGURATION% --output-on-failure + - cd ../Test && bash runtests + - cd ../build + +after_test: + # For debug build, the generated dll has a postfix "d" in its name. + - ps: >- + If ($env:configuration -Match "Debug") { + $env:SUFFIX="d" + } Else { + $env:SUFFIX="" + } + - cd install + # Zip all glslang artifacts for uploading and deploying + - 7z a glslang-master-windows-"%PLATFORM%"-"%CONFIGURATION%".zip + bin\glslangValidator.exe + bin\spirv-remap.exe + include\glslang\* + lib\glslang%SUFFIX%.lib + lib\HLSL%SUFFIX%.lib + lib\OGLCompiler%SUFFIX%.lib + lib\OSDependent%SUFFIX%.lib + lib\SPIRV%SUFFIX%.lib + lib\SPVRemapper%SUFFIX%.lib + lib\SPIRV-Tools%SUFFIX%.lib + lib\SPIRV-Tools-opt%SUFFIX%.lib + +artifacts: + - path: build\install\*.zip + name: artifacts-zip + +deploy: + - provider: GitHub + auth_token: + secure: YglcSYdl0TylEa59H4K6lylBEDr586NAt2EMgZquSo+iuPrwgZQuJLPCoihSm9y6 + release: master-tot + description: "Continuous build of the latest master branch by Appveyor and Travis CI" + artifact: artifacts-zip + draft: false + prerelease: false + force_update: true + on: + branch: master + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013 diff --git a/core/deps/glslang/.gitattributes b/core/deps/glslang/.gitattributes new file mode 100755 index 000000000..2929e8358 --- /dev/null +++ b/core/deps/glslang/.gitattributes @@ -0,0 +1,17 @@ +# test files have a mix of lf/crlf, and that's a good thing, for testing, don't mess with it +# bash scripts need lines ending with lf, and that's correct for Windows too, e.g., under Cygwin +# (scripts often don't have a suffix) +* -text +*.sh text eof=lf + +# txt files should be native and normalized +*.txt text + +# source code can be native and normalized, but simpler if lf everywhere; will try that way +*.h text eol=lf +*.c text eol=lf +*.cpp text eol=lf +*.y text eol=lf +*.out text eol=lf +*.conf text eol=lf +*.err text eol=lf diff --git a/core/deps/glslang/.gitignore b/core/deps/glslang/.gitignore new file mode 100644 index 000000000..a1fe3944b --- /dev/null +++ b/core/deps/glslang/.gitignore @@ -0,0 +1,10 @@ +*.o +*.a +*.so +*.exe +tags +TAGS +build/ +Test/localResults/ +External/googletest +External/spirv-tools diff --git a/core/deps/glslang/.travis.yml b/core/deps/glslang/.travis.yml new file mode 100644 index 000000000..1fa3fc01c --- /dev/null +++ b/core/deps/glslang/.travis.yml @@ -0,0 +1,128 @@ +# Linux and Mac Build Configuration for Travis + +language: cpp + +os: + - linux + - osx + +# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. +sudo: false +dist: trusty + +env: + global: + - secure: aGFrgzyKp+84hKrGkxVWg8cHV61uqrKEHT38gfSQK6+WS4GfLOyH83p7WnsEBb7AMhzU7LMNFdvOFr6+NaMpVnqRvc40CEG1Q+lNg9Pq9mhIZLowvDrfqTL9kQ+8Nbw5Q6/dg6CTvY7fvRfpfCEmKIUZBRkoKUuHeuM1uy3IupFcdNuL5bSYn3Beo+apSJginh9DI4BLDXFUgBzTRSLLyCX5g3cpaeGGOCr8quJlYx75W6HRck5g9SZuLtUoH9GFEV3l+ZEWB8noErW+J56L03bwNwFuuAh321evw++oQk5KFa8rlDvar3SJ3b1RHB8u/eq5DBYMyaK/fS8+Q7QbGr8diF/wDe68bKO7U9IhpNfExXmczCpExjHomW5TQv4rYdGhygPMfW97aIsPRYyNKcl4fkmb7NDrM8w0Jscdq2g5c2Kz0ItyZoBri/NXLwFQQjaVCs7Pf97TjuMA7mK0GJmDTRzi6SrDYlWMt5BQL3y0CCojyfLIRcTh0CQjQI29s97bLfQrYAxt9GNNFR+HTXRLLrkaAlJkPGEPwUywlSfEThnvHLesNxYqemolAYpQT4ithoL4GehGIHmaxsW295aKVhuRf8K9eBODNqrfblvM42UHhjntT+92ZnQ/Gkq80GqaMxnxi4PO5FyPIxt0r981b54YBkWi8YA4P7w5pNI= + matrix: + - GLSLANG_BUILD_TYPE=Release + - GLSLANG_BUILD_TYPE=Debug + +compiler: + - clang + - gcc + +matrix: + fast_finish: true # Show final status immediately if a test fails. + exclude: + # Skip GCC builds on Mac OS X. + - os: osx + compiler: gcc + include: + # Additional build using Android NDK. + - env: BUILD_NDK=ON + +cache: + apt: true + +branches: + only: + - master + +addons: + apt: + packages: + - clang-3.6 + +install: + # Make sure that clang-3.6 is selected on Linux. + - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then + export CC=clang-3.6 CXX=clang++-3.6; + fi + # Download a recent Android NDK and use its android.toolchain.cmake file. + - if [[ "$BUILD_NDK" == "ON" ]]; then + export ANDROID_NDK=$HOME/android-ndk; + git init $ANDROID_NDK; + pushd $ANDROID_NDK; + git remote add dneto0 https://github.com/dneto0/android-ndk.git; + git fetch --depth=1 dneto0 r17b-strip; + git checkout FETCH_HEAD; + popd; + export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake; + fi + +before_script: + - git clone --depth=1 https://github.com/google/googletest.git External/googletest + - ./update_glslang_sources.py + +script: + - mkdir build && cd build + # For Android, do release building using NDK without testing. + # Use android-14, the oldest native API level supporeted by NDK r17b. + # We can use newer API levels if we want. + # For Linux and macOS, do debug/release building with testing. + - if [[ "$BUILD_NDK" == "ON" ]]; then + cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH} + -DANDROID_NATIVE_API_LEVEL=android-14 + -DCMAKE_BUILD_TYPE=Release + -DANDROID_ABI="armeabi-v7a with NEON" + -DBUILD_TESTING=OFF ..; + make -j4; + else + cmake -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE} + -DCMAKE_INSTALL_PREFIX=`pwd`/install ..; + make -j4 install; + ctest --output-on-failure && + cd ../Test && ./runtests; + fi + +after_success: + # For debug build, the generated dll has a postfix "d" in its name. + - if [[ "${GLSLANG_BUILD_TYPE}" == "Debug" ]]; then + export SUFFIX="d"; + else + export SUFFIX=""; + fi + # Create tarball for deployment + - if [[ ${CC} == clang* && "${BUILD_NDK}" != "ON" ]]; then + cd ../build/install; + export TARBALL=glslang-master-${TRAVIS_OS_NAME}-${GLSLANG_BUILD_TYPE}.zip; + zip ${TARBALL} + bin/glslangValidator + include/glslang/* + lib/libglslang${SUFFIX}.a + lib/libHLSL${SUFFIX}.a + lib/libOGLCompiler${SUFFIX}.a + lib/libOSDependent${SUFFIX}.a + lib/libSPIRV${SUFFIX}.a + lib/libSPVRemapper${SUFFIX}.a + lib/libSPIRV-Tools${SUFFIX}.a + lib/libSPIRV-Tools-opt${SUFFIX}.a; + fi + +before_deploy: + # Tag the current top of the tree as "master-tot". + # Travis CI replies on the tag name to properly push to GitHub Releases. + - git config --global user.name "Travis CI" + - git config --global user.email "builds@travis-ci.org" + - git tag -f master-tot + - git push -q -f https://${glslangtoken}@github.com/KhronosGroup/glslang --tags + +deploy: + provider: releases + api_key: ${glslangtoken} + on: + branch: master + condition: ${CC} == clang* && ${BUILD_NDK} != ON + file: ${TARBALL} + skip_cleanup: true + overwrite: true diff --git a/core/deps/glslang/BUILD.bazel b/core/deps/glslang/BUILD.bazel index cc18aa268..5930608a8 100644 --- a/core/deps/glslang/BUILD.bazel +++ b/core/deps/glslang/BUILD.bazel @@ -85,6 +85,7 @@ genrule( "SPIRV/GLSL.ext.KHR.h", "SPIRV/GLSL.ext.NV.h", "SPIRV/GLSL.std.450.h", + "SPIRV/NonSemanticDebugPrintf.h", "SPIRV/spirv.hpp", ], outs = [ @@ -93,6 +94,7 @@ genrule( "include/SPIRV/GLSL.ext.KHR.h", "include/SPIRV/GLSL.ext.NV.h", "include/SPIRV/GLSL.std.450.h", + "include/SPIRV/NonSemanticDebugPrintf.h", "include/SPIRV/spirv.hpp", ], cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/", diff --git a/core/deps/glslang/BUILD.gn b/core/deps/glslang/BUILD.gn index 098d7de66..49b4b0a33 100644 --- a/core/deps/glslang/BUILD.gn +++ b/core/deps/glslang/BUILD.gn @@ -70,6 +70,7 @@ source_set("glslang_sources") { "SPIRV/InReadableOrder.cpp", "SPIRV/Logger.cpp", "SPIRV/Logger.h", + "SPIRV/NonSemanticDebugPrintf.h", "SPIRV/SPVRemapper.cpp", "SPIRV/SPVRemapper.h", "SPIRV/SpvBuilder.cpp", diff --git a/core/deps/glslang/CMakeLists.txt b/core/deps/glslang/CMakeLists.txt index d6fc8d42a..cd9baf844 100644 --- a/core/deps/glslang/CMakeLists.txt +++ b/core/deps/glslang/CMakeLists.txt @@ -32,13 +32,31 @@ option(ENABLE_SPVREMAPPER "Enables building of SPVRemapper" ON) option(ENABLE_GLSLANG_BINARIES "Builds glslangValidator and spirv-remap" ON) -option(ENABLE_GLSLANG_WEB "Reduces glslang to minimum needed for web use" OFF) -option(ENABLE_GLSLANG_WEB_DEVEL "For ENABLE_GLSLANG_WEB builds, enables compilation error messages" OFF) -option(ENABLE_EMSCRIPTEN_SINGLE_FILE "If using Emscripten, enables SINGLE_FILE build" OFF) -option(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE "If using Emscripten, builds to run on Node instead of Web" OFF) +option(ENABLE_GLSLANG_JS + "If using Emscripten, build glslang.js. Otherwise, builds a sample executable for binary-size testing." OFF) +CMAKE_DEPENDENT_OPTION(ENABLE_GLSLANG_WEBMIN + "Reduces glslang to minimum needed for web use" + OFF "ENABLE_GLSLANG_JS" + OFF) +CMAKE_DEPENDENT_OPTION(ENABLE_GLSLANG_WEBMIN_DEVEL + "For ENABLE_GLSLANG_WEBMIN builds, enables compilation error messages" + OFF "ENABLE_GLSLANG_WEBMIN" + OFF) +CMAKE_DEPENDENT_OPTION(ENABLE_EMSCRIPTEN_SINGLE_FILE + "If using Emscripten, enables SINGLE_FILE build" + OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN" + OFF) +CMAKE_DEPENDENT_OPTION(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE + "If using Emscripten, builds to run on Node instead of Web" + OFF "ENABLE_GLSLANG_JS AND EMSCRIPTEN" + OFF) -CMAKE_DEPENDENT_OPTION(ENABLE_HLSL "Enables HLSL input support" ON "NOT ENABLE_GLSLANG_WEB" OFF) +CMAKE_DEPENDENT_OPTION(ENABLE_HLSL + "Enables HLSL input support" + ON "NOT ENABLE_GLSLANG_WEBMIN" + OFF) +option(ENABLE_RTTI "Enables RTTI" OFF) option(ENABLE_OPT "Enables spirv-opt capability if present" ON) option(ENABLE_PCH "Enables Precompiled header" ON) option(ENABLE_CTEST "Enables testing" ON) @@ -57,7 +75,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" AND ENABLE_PCH) + if(MSVC AND CMAKE_GENERATOR MATCHES "^Visual Studio" AND NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" 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}") @@ -77,12 +95,12 @@ if(ENABLE_HLSL) add_definitions(-DENABLE_HLSL) endif(ENABLE_HLSL) -if(ENABLE_GLSLANG_WEB) +if(ENABLE_GLSLANG_WEBMIN) add_definitions(-DGLSLANG_WEB) - if(ENABLE_GLSLANG_WEB_DEVEL) + if(ENABLE_GLSLANG_WEBMIN_DEVEL) add_definitions(-DGLSLANG_WEB_DEVEL) - endif(ENABLE_GLSLANG_WEB_DEVEL) -endif(ENABLE_GLSLANG_WEB) + endif(ENABLE_GLSLANG_WEBMIN_DEVEL) +endif(ENABLE_GLSLANG_WEBMIN) if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") @@ -100,45 +118,42 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs -Wunused-parameter -Wunused-value -Wunused-variable -Wunused-but-set-parameter -Wunused-but-set-variable -fno-exceptions) add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over. - add_compile_options(-fno-rtti) -elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + if(NOT ENABLE_RTTI) + add_compile_options(-fno-rtti) + endif() + if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.0") + add_compile_options(-Werror=deprecated-copy) + endif() +elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC) add_compile_options(-Wall -Wuninitialized -Wunused -Wunused-local-typedefs -Wunused-parameter -Wunused-value -Wunused-variable) add_compile_options(-Wno-reorder) # disable this from -Wall, since it happens all over. - add_compile_options(-fno-rtti) -elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") - add_compile_options(/GR-) # Disable RTTI + if(NOT ENABLE_RTTI) + add_compile_options(-fno-rtti) + endif() +elseif(MSVC) + if(NOT ENABLE_RTTI) + add_compile_options(/GR-) # Disable RTTI + endif() endif() -if(EMSCRIPTEN) - add_compile_options(-Os -fno-exceptions) - add_compile_options("SHELL: -s WASM=1") - add_compile_options("SHELL: -s WASM_OBJECT_FILES=0") - add_link_options(-Os) - add_link_options("SHELL: -s FILESYSTEM=0") - add_link_options("SHELL: --llvm-lto 1") - add_link_options("SHELL: --closure 1") - add_link_options("SHELL: -s ALLOW_MEMORY_GROWTH=1") - - if(ENABLE_EMSCRIPTEN_SINGLE_FILE) - add_link_options("SHELL: -s SINGLE_FILE=1") - endif(ENABLE_EMSCRIPTEN_SINGLE_FILE) -else() - if(ENABLE_GLSLANG_WEB) - if(MSVC) - add_compile_options(/Os /GR-) - else() - add_compile_options(-Os -fno-exceptions) - add_link_options(-Os) +if(ENABLE_GLSLANG_JS) + if(MSVC) + add_compile_options(/Os /GR-) + else() + add_compile_options(-Os -fno-exceptions) + if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC) + add_compile_options(-Wno-unused-parameter) + add_compile_options(-Wno-unused-variable -Wno-unused-const-variable) endif() - endif(ENABLE_GLSLANG_WEB) -endif(EMSCRIPTEN) + endif() +endif(ENABLE_GLSLANG_JS) # Request C++11 if(${CMAKE_VERSION} VERSION_LESS 3.1) # CMake versions before 3.1 do not understand CMAKE_CXX_STANDARD # remove this block once CMake >=3.1 has fixated in the ecosystem - add_compile_options(-std=c++11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/core/deps/glslang/README.md b/core/deps/glslang/README.md index 67801e479..ff844c028 100755 --- a/core/deps/glslang/README.md +++ b/core/deps/glslang/README.md @@ -1,44 +1,70 @@ -Also see the Khronos landing page for glslang as a reference front end: - -https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ - -The above page includes where to get binaries, and is kept up to date -regarding the feature level of glslang. - -glslang -======= +# News [![Build Status](https://travis-ci.org/KhronosGroup/glslang.svg?branch=master)](https://travis-ci.org/KhronosGroup/glslang) [![Build status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master) -An OpenGL and OpenGL ES shader front end and validator. +## Planned Deprecations/Removals + +1. **SPIRV Folder, 1-May, 2020.** Glslang, when installed through CMake, +will install a `SPIRV` folder into `${CMAKE_INSTALL_INCLUDEDIR}`. +This `SPIRV` folder is being moved to `glslang/SPIRV`. +During the transition the `SPIRV` folder will be installed into both locations. +The old install of `SPIRV/` will be removed as a CMake install target no sooner than May 1, 2020. +See issue #1964. + +2. **Visual Studio 2013, 20-July, 2020.** Keeping code compiling for MS Visual Studio 2013 will no longer be +a goal as of July 20, 2020, the fifth anniversary of the release of Visual Studio 2015. + +# Glslang Components and Status There are several components: -1. A GLSL/ESSL front-end for reference validation and translation of GLSL/ESSL into an AST. +### Reference Validator and GLSL/ESSL -> AST Front End -2. An HLSL front-end for translation of a broad generic HLL into the AST. See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status. +An OpenGL GLSL and OpenGL|ES GLSL (ESSL) front-end for reference validation and translation of GLSL/ESSL into an internal abstract syntax tree (AST). -3. A SPIR-V back end for translating the AST to SPIR-V. +**Status**: Virtually complete, with results carrying similar weight as the specifications. -4. A standalone wrapper, `glslangValidator`, that can be used as a command-line tool for the above. +### HLSL -> AST Front End -How to add a feature protected by a version/extension/stage/profile: See the -comment in `glslang/MachineIndependent/Versions.cpp`. +An HLSL front-end for translation of an approximation of HLSL to glslang's AST form. + +**Status**: Partially complete. Semantics are not reference quality and input is not validated. +This is in contrast to the [DXC project](https://github.com/Microsoft/DirectXShaderCompiler), which receives a much larger investment and attempts to have definitive/reference-level semantics. + +See [issue 362](https://github.com/KhronosGroup/glslang/issues/362) and [issue 701](https://github.com/KhronosGroup/glslang/issues/701) for current status. + +### AST -> SPIR-V Back End + +Translates glslang's AST to the Khronos-specified SPIR-V intermediate language. + +**Status**: Virtually complete. + +### Reflector + +An API for getting reflection information from the AST, reflection types/variables/etc. from the HLL source (not the SPIR-V). + +**Status**: There is a large amount of functionality present, but no specification/goal to measure completeness against. It is accurate for the input HLL and AST, but only approximate for what would later be emitted for SPIR-V. + +### Standalone Wrapper + +`glslangValidator` is command-line tool for accessing the functionality above. + +Status: Complete. Tasks waiting to be done are documented as GitHub issues. -Deprecations ------------- +## Other References -1. GLSLang, when installed through CMake, will install a `SPIRV` folder into -`${CMAKE_INSTALL_INCLUDEDIR}`. This `SPIRV` folder is being moved to -`glslang/SPIRV`. During the transition the `SPIRV` folder will be installed into -both locations. The old install of `SPIRV/` will be removed as a CMake install -target no sooner then May 1, 2020. See issue #1964. +Also see the Khronos landing page for glslang as a reference front end: -Execution of Standalone Wrapper -------------------------------- +https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ + +The above page, while not kept up to date, includes additional information regarding glslang as a reference validator. + +# How to Use Glslang + +## Execution of Standalone Wrapper To use the standalone binary form, execute `glslangValidator`, and it will print a usage statement. Basic operation is to give it a file containing a shader, @@ -55,8 +81,7 @@ The applied stage-specific rules are based on the file extension: There is also a non-shader extension * `.conf` for a configuration file of limits, see usage statement for example -Building --------- +## Building Instead of building manually, you can also download the binaries for your platform directly from the [master-tot release][master-tot-release] on GitHub. @@ -79,7 +104,7 @@ branch. The following steps assume a Bash shell. On Windows, that could be the Git Bash shell or some other shell of your choosing. -#### 1) Check-Out this project +#### 1) Check-Out this project ```bash cd @@ -127,6 +152,14 @@ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$(pwd)/install" $SOURCE # "Release" (for CMAKE_BUILD_TYPE) could also be "Debug" or "RelWithDebInfo" ``` +For building on Android: +```bash +cmake $SOURCE_DIR -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DANDROID_ABI=arm64-v8a -DCMAKE_BUILD_TYPE=Release -DANDROID_STL=c++_static -DANDROID_PLATFORM=android-24 -DCMAKE_SYSTEM_NAME=Android -DANDROID_TOOLCHAIN=clang -DANDROID_ARM_MODE=arm -DCMAKE_MAKE_PROGRAM=$ANDROID_NDK_ROOT/prebuilt/linux-x86_64/bin/make -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake +# If on Windows will be -DCMAKE_MAKE_PROGRAM=%ANDROID_NDK_ROOT%\prebuilt\windows-x86_64\bin\make.exe +# -G is needed for building on Windows +# -DANDROID_ABI can also be armeabi-v7a for 32 bit +``` + For building on Windows: ```bash @@ -176,31 +209,45 @@ With no arguments it builds the full grammar, and with a "web" argument, the web grammar subset (see more about the web subset in the next section). ### Building to WASM for the Web and Node +### Building a standalone JS/WASM library for the Web and Node Use the steps in [Build Steps](#build-steps), with the following notes/exceptions: -* For building the web subset of core glslang: +* `emsdk` needs to be present in your executable search path, *PATH* for + Bash-like environments: + + [Instructions located here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install) +* Wrap cmake call: `emcmake cmake` +* Set `-DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF`. +* Set `-DENABLE_HLSL=OFF` if HLSL is not needed. +* For a standalone JS/WASM library, turn on `-DENABLE_GLSLANG_JS=ON`. +* For building a minimum-size web subset of core glslang: + + turn on `-DENABLE_GLSLANG_WEBMIN=ON` (disables HLSL) + execute `updateGrammar web` from the glslang subdirectory (or if using your own scripts, `m4` needs a `-DGLSLANG_WEB` argument) - + set `-DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF` - + turn on `-DENABLE_GLSLANG_WEB=ON` - + optionally, for GLSL compilation error messages, turn on `-DENABLE_GLSLANG_WEB_DEVEL=ON` -* `emsdk` needs to be present in your executable search path, *PATH* for - Bash-like enivironments - + [Instructions located - here](https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install) -* Wrap cmake call: `emcmake cmake` + + optionally, for GLSL compilation error messages, turn on + `-DENABLE_GLSLANG_WEBMIN_DEVEL=ON` * To get a fully minimized build, make sure to use `brotli` to compress the .js and .wasm files Example: ```sh -emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_WEB=ON \ +emcmake cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GLSLANG_JS=ON \ -DENABLE_HLSL=OFF -DBUILD_TESTING=OFF -DENABLE_OPT=OFF -DINSTALL_GTEST=OFF .. ``` -Testing -------- +## Building glslang - Using vcpkg + +You can download and install glslang using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager: + + git clone https://github.com/Microsoft/vcpkg.git + cd vcpkg + ./bootstrap-vcpkg.sh + ./vcpkg integrate install + ./vcpkg install glslang + +The glslang port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. + +## Testing Right now, there are two test harnesses existing in glslang: one is [Google Test](gtests/), one is the [`runtests` script](Test/runtests). The former @@ -272,8 +319,7 @@ You can add your own private list of tests, not tracked publicly, by using `localtestlist` to list non-tracked tests. This is automatically read by `runtests` and included in the `diff` and `bump` process. -Programmatic Interfaces ------------------------ +## Programmatic Interfaces Another piece of software can programmatically translate shaders to an AST using one of two different interfaces: @@ -309,7 +355,7 @@ class TProgram Reflection queries ``` -For just validating (not generating code), subsitute these calls: +For just validating (not generating code), substitute these calls: ```cxx setEnvInput(EShSourceHlsl or EShSourceGlsl, stage, EShClientNone, 0); @@ -327,7 +373,7 @@ 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`. The `Sh*()` interface takes a "compiler" call-back object, which it calls after -building call back that is passed the AST and can then execute a backend on it. +building call back that is passed the AST and can then execute a back end on it. The following is a simplified resulting run-time call stack: @@ -338,8 +384,7 @@ ShCompile(shader, compiler) -> compiler(AST) -> In practice, `ShCompile()` takes shader strings, default version, and warning/error and other options for controlling compilation. -Basic Internal Operation ------------------------- +## Basic Internal Operation * Initial lexical analysis is done by the preprocessor in `MachineIndependent/Preprocessor`, and then refined by a GLSL scanner @@ -354,7 +399,7 @@ Basic Internal Operation * The intermediate representation is very high-level, and represented as an in-memory tree. This serves to lose no information from the original program, and to have efficient transfer of the result from - parsing to the back-end. In the AST, constants are propogated and + parsing to the back-end. In the AST, constants are propagated and folded, and a very small amount of dead code is eliminated. To aid linking and reflection, the last top-level branch in the AST @@ -386,6 +431,8 @@ Basic Internal Operation - the object does not come from the pool, and you have to do normal C++ memory management of what you `new` +* Features can be protected by version/extension/stage/profile: + See the comment in `glslang/MachineIndependent/Versions.cpp`. [cmake]: https://cmake.org/ [python]: https://www.python.org/ diff --git a/core/deps/glslang/SPIRV/CMakeLists.txt b/core/deps/glslang/SPIRV/CMakeLists.txt old mode 100755 new mode 100644 index 439b9918a..90406099a --- a/core/deps/glslang/SPIRV/CMakeLists.txt +++ b/core/deps/glslang/SPIRV/CMakeLists.txt @@ -27,7 +27,8 @@ set(HEADERS SpvTools.h disassemble.h GLSL.ext.AMD.h - GLSL.ext.NV.h) + GLSL.ext.NV.h + NonSemanticDebugPrintf.h) set(SPVREMAP_HEADERS SPVRemapper.h diff --git a/core/deps/glslang/SPIRV/GLSL.ext.KHR.h b/core/deps/glslang/SPIRV/GLSL.ext.KHR.h index e58e836a8..d783a8f29 100644 --- a/core/deps/glslang/SPIRV/GLSL.ext.KHR.h +++ b/core/deps/glslang/SPIRV/GLSL.ext.KHR.h @@ -1,5 +1,6 @@ /* -** Copyright (c) 2014-2016 The Khronos Group Inc. +** Copyright (c) 2014-2020 The Khronos Group Inc. +** Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and/or associated documentation files (the "Materials"), @@ -44,5 +45,7 @@ static const char* const E_SPV_EXT_physical_storage_buffer = "SPV_EXT_physi 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"; - +static const char* const E_SPV_KHR_non_semantic_info = "SPV_KHR_non_semantic_info"; +static const char* const E_SPV_KHR_ray_tracing = "SPV_KHR_ray_tracing"; +static const char* const E_SPV_KHR_ray_query = "SPV_KHR_ray_query"; #endif // #ifndef GLSLextKHR_H diff --git a/core/deps/glslang/SPIRV/GlslangToSpv.cpp b/core/deps/glslang/SPIRV/GlslangToSpv.cpp old mode 100755 new mode 100644 index 075563662..071dad301 --- a/core/deps/glslang/SPIRV/GlslangToSpv.cpp +++ b/core/deps/glslang/SPIRV/GlslangToSpv.cpp @@ -1,7 +1,8 @@ // // Copyright (C) 2014-2016 LunarG, Inc. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2020 Google, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -48,6 +49,7 @@ namespace spv { #include "GLSL.ext.EXT.h" #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" + #include "NonSemanticDebugPrintf.h" } // Glslang includes @@ -187,7 +189,8 @@ protected: void makeGlobalInitializers(const glslang::TIntermSequence&); void visitFunctions(const glslang::TIntermSequence&); void handleFunctionEntry(const glslang::TIntermAggregate* node); - void translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); + void translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, + spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); void translateArguments(glslang::TIntermUnary& node, std::vector& arguments); spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node); spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); @@ -196,28 +199,36 @@ protected: glslang::TBasicType typeProxy, bool reduceComparison = true); spv::Id createBinaryMatrixOperation(spv::Op, OpDecorations&, spv::Id typeId, spv::Id left, spv::Id right); spv::Id createUnaryOperation(glslang::TOperator op, OpDecorations&, spv::Id typeId, spv::Id operand, - glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); + glslang::TBasicType typeProxy, + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); spv::Id createUnaryMatrixOperation(spv::Op op, OpDecorations&, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy); spv::Id createConversion(glslang::TOperator op, OpDecorations&, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy); spv::Id createIntWidthConversion(glslang::TOperator op, spv::Id operand, int vectorSize); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); - spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); - spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); - spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, spv::Id typeId, std::vector& operands); - spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); - spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); + spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy, + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); + spv::Id createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, + glslang::TBasicType typeProxy); + spv::Id CreateInvocationsVectorOperation(spv::Op op, spv::GroupOperation groupOperation, + spv::Id typeId, std::vector& operands); + spv::Id createSubgroupOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, + glslang::TBasicType typeProxy); + spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy); spv::Id createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId); spv::Id getSymbolId(const glslang::TIntermSymbol* node); void addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier & qualifier); spv::Id createSpvConstant(const glslang::TIntermTyped&); - spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); + spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, + int& nextConst, bool specConstant); bool isTrivialLeaf(const glslang::TIntermTyped* node); bool isTrivial(const glslang::TIntermTyped* node); spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right); spv::Id getExtBuiltins(const char* name); - std::pair getForcedType(spv::BuiltIn, const glslang::TType&); + std::pair getForcedType(glslang::TBuiltInVariable builtIn, const glslang::TType&); spv::Id translateForcedType(spv::Id object); spv::Id createCompositeConstruct(spv::Id typeId, std::vector constituents); @@ -233,19 +244,24 @@ protected: spv::Builder builder; bool inEntryPoint; bool entryPointTerminated; - bool linkageOnly; // true when visiting the set of objects in the AST present only for establishing interface, whether or not they were statically used + bool linkageOnly; // true when visiting the set of objects in the AST present only for + // establishing interface, whether or not they were statically used std::set iOSet; // all input/output variables from either static use or declaration of interface const glslang::TIntermediate* glslangIntermediate; bool nanMinMaxClamp; // true if use NMin/NMax/NClamp instead of FMin/FMax/FClamp spv::Id stdBuiltins; + spv::Id nonSemanticDebugPrintf; std::unordered_map extBuiltinMap; std::unordered_map symbolValues; - std::unordered_set rValueParameters; // set of formal function parameters passed as rValues, rather than a pointer + std::unordered_set rValueParameters; // set of formal function parameters passed as rValues, + // rather than a pointer std::unordered_map functionMap; std::unordered_map structMap[glslang::ElpCount][glslang::ElmCount]; // for mapping glslang block indices to spv indices (e.g., due to hidden members): - std::unordered_map > memberRemapper; + std::unordered_map> memberRemapper; + // for mapping glslang symbol struct to symbol Id + std::unordered_map glslangTypeToIdMap; std::stack breakForLoop; // false means break for switch std::unordered_map counterOriginator; // Map pointee types for EbtReference to their forward pointers @@ -297,12 +313,12 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage) case EShLangTessControl: return spv::ExecutionModelTessellationControl; case EShLangTessEvaluation: return spv::ExecutionModelTessellationEvaluation; case EShLangGeometry: return spv::ExecutionModelGeometry; - case EShLangRayGenNV: return spv::ExecutionModelRayGenerationNV; - case EShLangIntersectNV: return spv::ExecutionModelIntersectionNV; - case EShLangAnyHitNV: return spv::ExecutionModelAnyHitNV; - case EShLangClosestHitNV: return spv::ExecutionModelClosestHitNV; - case EShLangMissNV: return spv::ExecutionModelMissNV; - case EShLangCallableNV: return spv::ExecutionModelCallableNV; + case EShLangRayGen: return spv::ExecutionModelRayGenerationKHR; + case EShLangIntersect: return spv::ExecutionModelIntersectionKHR; + case EShLangAnyHit: return spv::ExecutionModelAnyHitKHR; + case EShLangClosestHit: return spv::ExecutionModelClosestHitKHR; + case EShLangMiss: return spv::ExecutionModelMissKHR; + case EShLangCallable: return spv::ExecutionModelCallableKHR; case EShLangTaskNV: return spv::ExecutionModelTaskNV; case EShLangMeshNV: return spv::ExecutionModelMeshNV; #endif @@ -356,11 +372,11 @@ spv::Decoration TranslateBlockDecoration(const glslang::TType& type, bool useSto case glslang::EvqVaryingIn: return spv::DecorationBlock; case glslang::EvqVaryingOut: return spv::DecorationBlock; #ifndef GLSLANG_WEB - case glslang::EvqPayloadNV: return spv::DecorationBlock; - case glslang::EvqPayloadInNV: return spv::DecorationBlock; - case glslang::EvqHitAttrNV: return spv::DecorationBlock; - case glslang::EvqCallableDataNV: return spv::DecorationBlock; - case glslang::EvqCallableDataInNV: return spv::DecorationBlock; + case glslang::EvqPayload: return spv::DecorationBlock; + case glslang::EvqPayloadIn: return spv::DecorationBlock; + case glslang::EvqHitAttr: return spv::DecorationBlock; + case glslang::EvqCallableData: return spv::DecorationBlock; + case glslang::EvqCallableDataIn: return spv::DecorationBlock; #endif default: assert(0); @@ -372,7 +388,8 @@ 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& memory, bool useVulkanMemoryModel) +void TranslateMemoryDecoration(const glslang::TQualifier& qualifier, std::vector& memory, + bool useVulkanMemoryModel) { if (!useVulkanMemoryModel) { if (qualifier.isCoherent()) @@ -431,11 +448,11 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T } return spv::DecorationMax; #ifndef GLSLANG_WEB - case glslang::EvqPayloadNV: - case glslang::EvqPayloadInNV: - case glslang::EvqHitAttrNV: - case glslang::EvqCallableDataNV: - case glslang::EvqCallableDataInNV: + case glslang::EvqPayload: + case glslang::EvqPayloadIn: + case glslang::EvqHitAttr: + case glslang::EvqCallableData: + case glslang::EvqCallableDataIn: return spv::DecorationMax; #endif default: @@ -527,15 +544,11 @@ spv::MemoryAccessMask TGlslangToSpvTraverser::TranslateMemoryAccess( if (!glslangIntermediate->usingVulkanMemoryModel() || coherentFlags.isImage) return mask; - if (coherentFlags.volatil || - coherentFlags.coherent || - coherentFlags.devicecoherent || - coherentFlags.queuefamilycoherent || - coherentFlags.workgroupcoherent || - coherentFlags.subgroupcoherent) { + if (coherentFlags.isVolatile() || coherentFlags.anyCoherent()) { mask = mask | spv::MemoryAccessMakePointerAvailableKHRMask | spv::MemoryAccessMakePointerVisibleKHRMask; } + if (coherentFlags.nonprivate) { mask = mask | spv::MemoryAccessNonPrivatePointerKHRMask; } @@ -560,11 +573,7 @@ spv::ImageOperandsMask TGlslangToSpvTraverser::TranslateImageOperands( return mask; if (coherentFlags.volatil || - coherentFlags.coherent || - coherentFlags.devicecoherent || - coherentFlags.queuefamilycoherent || - coherentFlags.workgroupcoherent || - coherentFlags.subgroupcoherent) { + coherentFlags.anyCoherent()) { mask = mask | spv::ImageOperandsMakeTexelAvailableKHRMask | spv::ImageOperandsMakeTexelVisibleKHRMask; } @@ -593,14 +602,11 @@ spv::Builder::AccessChain::CoherentFlags TGlslangToSpvTraverser::TranslateCohere flags.workgroupcoherent = type.getQualifier().workgroupcoherent || type.getQualifier().storage == glslang::EvqShared; flags.subgroupcoherent = type.getQualifier().subgroupcoherent; + flags.shadercallcoherent = type.getQualifier().shadercallcoherent; flags.volatil = type.getQualifier().volatil; // *coherent variables are implicitly nonprivate in GLSL flags.nonprivate = type.getQualifier().nonprivate || - flags.subgroupcoherent || - flags.workgroupcoherent || - flags.queuefamilycoherent || - flags.devicecoherent || - flags.coherent || + flags.anyCoherent() || flags.volatil; flags.isImage = type.getBasicType() == glslang::EbtSampler; #endif @@ -624,6 +630,8 @@ spv::Scope TGlslangToSpvTraverser::TranslateMemoryScope( scope = spv::ScopeWorkgroup; } else if (coherentFlags.subgroupcoherent) { scope = spv::ScopeSubgroup; + } else if (coherentFlags.shadercallcoherent) { + scope = spv::ScopeShaderCallKHR; } if (glslangIntermediate->usingVulkanMemoryModel() && scope == spv::ScopeDevice) { builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR); @@ -638,7 +646,8 @@ spv::Scope TGlslangToSpvTraverser::TranslateMemoryScope( // is generated only when using the variable in an executable instruction, but not when // just declaring a struct member variable with it. This is true for PointSize, // ClipDistance, and CullDistance. -spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn, bool memberDeclaration) +spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn, + bool memberDeclaration) { switch (builtIn) { case glslang::EbvPointSize: @@ -931,34 +940,38 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInInvocationsPerPixelNV; // ray tracing - case glslang::EbvLaunchIdNV: - return spv::BuiltInLaunchIdNV; - case glslang::EbvLaunchSizeNV: - return spv::BuiltInLaunchSizeNV; - case glslang::EbvWorldRayOriginNV: - return spv::BuiltInWorldRayOriginNV; - case glslang::EbvWorldRayDirectionNV: - return spv::BuiltInWorldRayDirectionNV; - case glslang::EbvObjectRayOriginNV: - return spv::BuiltInObjectRayOriginNV; - case glslang::EbvObjectRayDirectionNV: - return spv::BuiltInObjectRayDirectionNV; - case glslang::EbvRayTminNV: - return spv::BuiltInRayTminNV; - case glslang::EbvRayTmaxNV: - return spv::BuiltInRayTmaxNV; - case glslang::EbvInstanceCustomIndexNV: - return spv::BuiltInInstanceCustomIndexNV; - case glslang::EbvHitTNV: - return spv::BuiltInHitTNV; - case glslang::EbvHitKindNV: - return spv::BuiltInHitKindNV; - case glslang::EbvObjectToWorldNV: - return spv::BuiltInObjectToWorldNV; - case glslang::EbvWorldToObjectNV: - return spv::BuiltInWorldToObjectNV; - case glslang::EbvIncomingRayFlagsNV: - return spv::BuiltInIncomingRayFlagsNV; + case glslang::EbvLaunchId: + return spv::BuiltInLaunchIdKHR; + case glslang::EbvLaunchSize: + return spv::BuiltInLaunchSizeKHR; + case glslang::EbvWorldRayOrigin: + return spv::BuiltInWorldRayOriginKHR; + case glslang::EbvWorldRayDirection: + return spv::BuiltInWorldRayDirectionKHR; + case glslang::EbvObjectRayOrigin: + return spv::BuiltInObjectRayOriginKHR; + case glslang::EbvObjectRayDirection: + return spv::BuiltInObjectRayDirectionKHR; + case glslang::EbvRayTmin: + return spv::BuiltInRayTminKHR; + case glslang::EbvRayTmax: + return spv::BuiltInRayTmaxKHR; + case glslang::EbvInstanceCustomIndex: + return spv::BuiltInInstanceCustomIndexKHR; + case glslang::EbvHitT: + return spv::BuiltInHitTKHR; + case glslang::EbvHitKind: + return spv::BuiltInHitKindKHR; + case glslang::EbvObjectToWorld: + case glslang::EbvObjectToWorld3x4: + return spv::BuiltInObjectToWorldKHR; + case glslang::EbvWorldToObject: + case glslang::EbvWorldToObject3x4: + return spv::BuiltInWorldToObjectKHR; + case glslang::EbvIncomingRayFlags: + return spv::BuiltInIncomingRayFlagsKHR; + case glslang::EbvGeometryIndex: + return spv::BuiltInRayGeometryIndexKHR; // barycentrics case glslang::EbvBaryCoordNV: @@ -1104,7 +1117,8 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy } } -spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(const glslang::TIntermSelection& selectionNode) const +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl( + const glslang::TIntermSelection& selectionNode) const { if (selectionNode.getFlatten()) return spv::SelectionControlFlattenMask; @@ -1113,7 +1127,8 @@ spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSelectionControl(cons return spv::SelectionControlMaskNone; } -spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSwitchControl(const glslang::TIntermSwitch& switchNode) const +spv::SelectionControlMask TGlslangToSpvTraverser::TranslateSwitchControl(const glslang::TIntermSwitch& switchNode) + const { if (switchNode.getFlatten()) return spv::SelectionControlFlattenMask; @@ -1167,6 +1182,8 @@ spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang: // Translate glslang type to SPIR-V storage class. spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType& type) { + if (type.getBasicType() == glslang::EbtRayQuery) + return spv::StorageClassFunction; if (type.getQualifier().isPipeInput()) return spv::StorageClassInput; if (type.getQualifier().isPipeOutput()) @@ -1181,8 +1198,8 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T } if (type.getQualifier().isUniformOrBuffer() && - type.getQualifier().isShaderRecordNV()) { - return spv::StorageClassShaderRecordBufferNV; + type.getQualifier().isShaderRecord()) { + return spv::StorageClassShaderRecordBufferKHR; } if (glslangIntermediate->usingStorageBuffer() && type.getQualifier().storage == glslang::EvqBuffer) { @@ -1204,11 +1221,11 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T case glslang::EvqTemporary: return spv::StorageClassFunction; 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; - case glslang::EvqCallableDataNV: return spv::StorageClassCallableDataNV; - case glslang::EvqCallableDataInNV: return spv::StorageClassIncomingCallableDataNV; + case glslang::EvqPayload: return spv::StorageClassRayPayloadKHR; + case glslang::EvqPayloadIn: return spv::StorageClassIncomingRayPayloadKHR; + case glslang::EvqHitAttr: return spv::StorageClassHitAttributeKHR; + case glslang::EvqCallableData: return spv::StorageClassCallableDataKHR; + case glslang::EvqCallableDataIn: return spv::StorageClassIncomingCallableDataKHR; #endif default: assert(0); @@ -1268,7 +1285,7 @@ bool IsDescriptorResource(const glslang::TType& type) // uniform and buffer blocks are included, unless it is a push_constant if (type.getBasicType() == glslang::EbtBlock) return type.getQualifier().isUniformOrBuffer() && - ! type.getQualifier().isShaderRecordNV() && + ! type.getQualifier().isShaderRecord() && ! type.getQualifier().isPushConstant(); // non block... @@ -1318,6 +1335,8 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa child.workgroupcoherent = true; if (parent.subgroupcoherent) child.subgroupcoherent = true; + if (parent.shadercallcoherent) + child.shadercallcoherent = true; if (parent.nonprivate) child.nonprivate = true; if (parent.volatil) @@ -1348,16 +1367,18 @@ bool HasNonLayoutQualifiers(const glslang::TType& type, const glslang::TQualifie // Implement the TGlslangToSpvTraverser class. // -TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const glslang::TIntermediate* glslangIntermediate, - spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options) - : TIntermTraverser(true, false, true), - options(options), - shaderEntry(nullptr), currentFunction(nullptr), - sequenceDepth(0), logger(buildLogger), - builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger), - inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), - glslangIntermediate(glslangIntermediate), - nanMinMaxClamp(glslangIntermediate->getNanMinMaxClamp()) +TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, + const glslang::TIntermediate* glslangIntermediate, + spv::SpvBuildLogger* buildLogger, glslang::SpvOptions& options) : + TIntermTraverser(true, false, true), + options(options), + shaderEntry(nullptr), currentFunction(nullptr), + sequenceDepth(0), logger(buildLogger), + builder(spvVersion, (glslang::GetKhronosToolId() << 16) | glslang::GetSpirvGeneratorVersion(), logger), + inEntryPoint(false), entryPointTerminated(false), linkageOnly(false), + glslangIntermediate(glslangIntermediate), + nanMinMaxClamp(glslangIntermediate->getNanMinMaxClamp()), + nonSemanticDebugPrintf(0) { spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage()); @@ -1400,7 +1421,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl addressingModel = spv::AddressingModelPhysicalStorageBuffer64EXT; builder.addIncorporatedExtension(spv::E_SPV_EXT_physical_storage_buffer, spv::Spv_1_5); builder.addCapability(spv::CapabilityPhysicalStorageBufferAddressesEXT); - }; + } if (glslangIntermediate->usingVulkanMemoryModel()) { memoryModel = spv::MemoryModelVulkanKHR; builder.addCapability(spv::CapabilityVulkanMemoryModelKHR); @@ -1427,6 +1448,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl builder.addExecutionMode(shaderEntry, spv::ExecutionModeXfb); } + if (sourceExtensions.find("GL_EXT_ray_flags_primitive_culling") != sourceExtensions.end()) { + builder.addCapability(spv::CapabilityRayTraversalPrimitiveCullingProvisionalKHR); + } + unsigned int mode; switch (glslangIntermediate->getStage()) { case EShLangVertex: @@ -1456,6 +1481,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl builder.addExecutionMode(shaderEntry, spv::ExecutionModeDepthReplacing); #ifndef GLSLANG_WEB + switch(glslangIntermediate->getDepth()) { case glslang::EldGreater: mode = spv::ExecutionModeDepthGreater; break; case glslang::EldLess: mode = spv::ExecutionModeDepthLess; break; @@ -1493,7 +1519,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl builder.addExtension(spv::E_SPV_EXT_fragment_shader_interlock); } #endif - break; + break; case EShLangCompute: builder.addCapability(spv::CapabilityShader); @@ -1518,7 +1544,8 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl glslang::TLayoutGeometry primitive; if (glslangIntermediate->getStage() == EShLangTessControl) { - builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices()); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, + glslangIntermediate->getVertices()); primitive = glslangIntermediate->getOutputPrimitive(); } else { primitive = glslangIntermediate->getInputPrimitive(); @@ -1580,15 +1607,24 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices()); break; - case EShLangRayGenNV: - case EShLangIntersectNV: - case EShLangAnyHitNV: - case EShLangClosestHitNV: - case EShLangMissNV: - case EShLangCallableNV: - builder.addCapability(spv::CapabilityRayTracingNV); - builder.addExtension("SPV_NV_ray_tracing"); + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + { + auto& extensions = glslangIntermediate->getRequestedExtensions(); + if (extensions.find("GL_NV_ray_tracing") == extensions.end()) { + builder.addCapability(spv::CapabilityRayTracingProvisionalKHR); + builder.addExtension("SPV_KHR_ray_tracing"); + } + else { + builder.addCapability(spv::CapabilityRayTracingNV); + builder.addExtension("SPV_NV_ray_tracing"); + } break; + } case EShLangTaskNV: case EShLangMeshNV: builder.addCapability(spv::CapabilityMeshShadingNV); @@ -1597,8 +1633,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, const gl glslangIntermediate->getLocalSize(1), glslangIntermediate->getLocalSize(2)); if (glslangIntermediate->getStage() == EShLangMeshNV) { - builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, glslangIntermediate->getVertices()); - builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputPrimitivesNV, glslangIntermediate->getPrimitives()); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices, + glslangIntermediate->getVertices()); + builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputPrimitivesNV, + glslangIntermediate->getPrimitives()); switch (glslangIntermediate->getOutputPrimitive()) { case glslang::ElgPoints: mode = spv::ExecutionModeOutputPoints; break; @@ -1661,6 +1699,9 @@ void TGlslangToSpvTraverser::dumpSpv(std::vector& out) void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) { SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (symbol->getType().isStruct()) + glslangTypeToIdMap[symbol->getType().getStruct()] = symbol->getId(); + if (symbol->getType().getQualifier().isSpecConstant()) spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); @@ -1682,7 +1723,8 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) } } - // If the SPIR-V type is required to be different than the AST type, + // If the SPIR-V type is required to be different than the AST type + // (for ex SubgroupMasks or 3x4 ObjectToWorld/WorldToObject matrices), // translate now from the SPIR-V type to the AST type, for the consuming // operation. // Note this turns it from an l-value to an r-value. @@ -1753,6 +1795,12 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) { builder.setLine(node->getLoc().line, node->getLoc().getFilename()); + if (node->getLeft()->getAsSymbolNode() != nullptr && node->getLeft()->getType().isStruct()) { + glslangTypeToIdMap[node->getLeft()->getType().getStruct()] = node->getLeft()->getAsSymbolNode()->getId(); + } + if (node->getRight()->getAsSymbolNode() != nullptr && node->getRight()->getType().isStruct()) { + glslangTypeToIdMap[node->getRight()->getType().getStruct()] = node->getRight()->getAsSymbolNode()->getId(); + } SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); if (node->getType().getQualifier().isSpecConstant()) @@ -1836,7 +1884,8 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T int dummySize; builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), TranslateCoherent(node->getLeft()->getType()), - glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); + glslangIntermediate->getBaseAlignmentScalar( + node->getLeft()->getType(), dummySize)); } else { // Load through a block reference is performed with a dot operator that @@ -1857,13 +1906,18 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T { // This may be, e.g., an anonymous block-member selection, which generally need // index remapping due to hidden members in anonymous blocks. - std::vector& remapper = memberRemapper[node->getLeft()->getType().getStruct()]; - assert(remapper.size() > 0); - spvIndex = remapper[glslangIndex]; + int glslangId = glslangTypeToIdMap[node->getLeft()->getType().getStruct()]; + if (memberRemapper.find(glslangId) != memberRemapper.end()) { + std::vector& remapper = memberRemapper[glslangId]; + assert(remapper.size() > 0); + spvIndex = remapper[glslangIndex]; + } } // normal case for indexing array or structure or block - builder.accessChainPush(builder.makeIntConstant(spvIndex), TranslateCoherent(node->getLeft()->getType()), node->getLeft()->getType().getBufferReferenceAlignment()); + builder.accessChainPush(builder.makeIntConstant(spvIndex), + TranslateCoherent(node->getLeft()->getType()), + node->getLeft()->getType().getBufferReferenceAlignment()); // Add capabilities here for accessing PointSize and clip/cull distance. // We have deferred generation of associated capabilities until now. @@ -1900,9 +1954,11 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T int dummySize; builder.accessChainPushComponent(index, convertGlslangToSpvType(node->getLeft()->getType()), TranslateCoherent(node->getLeft()->getType()), - glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), + dummySize)); } else - builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType()), node->getLeft()->getType().getBufferReferenceAlignment()); + builder.accessChainPush(index, TranslateCoherent(node->getLeft()->getType()), + node->getLeft()->getType().getBufferReferenceAlignment()); } return false; case glslang::EOpVectorSwizzle: @@ -1913,7 +1969,8 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T int dummySize; builder.accessChainPushSwizzle(swizzle, convertGlslangToSpvType(node->getLeft()->getType()), TranslateCoherent(node->getLeft()->getType()), - glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); + glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), + dummySize)); } return false; case glslang::EOpMatrixSwizzle: @@ -1929,7 +1986,8 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T if (isTrivial(node->getRight()->getAsTyped())) break; // handle below as a normal binary operation // otherwise, we need to do dynamic short circuiting on the right operand - spv::Id result = createShortCircuit(node->getOp(), *node->getLeft()->getAsTyped(), *node->getRight()->getAsTyped()); + spv::Id result = createShortCircuit(node->getOp(), *node->getLeft()->getAsTyped(), + *node->getRight()->getAsTyped()); builder.clearAccessChain(); builder.setAccessChainRValue(result); } @@ -1971,16 +2029,16 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // Figure out what, if any, type changes are needed when accessing a specific built-in. // Returns . // Also see comment for 'forceType', regarding tracking SPIR-V-required types. -std::pair TGlslangToSpvTraverser::getForcedType(spv::BuiltIn builtIn, +std::pair TGlslangToSpvTraverser::getForcedType(glslang::TBuiltInVariable glslangBuiltIn, const glslang::TType& glslangType) { - switch(builtIn) + switch(glslangBuiltIn) { - case spv::BuiltInSubgroupEqMask: - case spv::BuiltInSubgroupGeMask: - case spv::BuiltInSubgroupGtMask: - case spv::BuiltInSubgroupLeMask: - case spv::BuiltInSubgroupLtMask: { + case glslang::EbvSubGroupEqMask: + case glslang::EbvSubGroupGeMask: + case glslang::EbvSubGroupGtMask: + case glslang::EbvSubGroupLeMask: + case glslang::EbvSubGroupLtMask: { // these require changing a 64-bit scaler -> a vector of 32-bit components if (glslangType.isVector()) break; @@ -1988,6 +2046,15 @@ std::pair TGlslangToSpvTraverser::getForcedType(spv::BuiltIn b builder.makeUintType(64)); return ret; } + // There are no SPIR-V builtins defined for these and map onto original non-transposed + // builtins. During visitBinary we insert a transpose + case glslang::EbvWorldToObject3x4: + case glslang::EbvObjectToWorld3x4: { + std::pair ret(builder.makeMatrixType(builder.makeFloatType(32), 4, 3), + builder.makeMatrixType(builder.makeFloatType(32), 3, 4) + ); + return ret; + } default: break; } @@ -2026,7 +2093,15 @@ spv::Id TGlslangToSpvTraverser::translateForcedType(spv::Id object) } else { logger->missingFunctionality("forcing 32-bit vector type to non 64-bit scalar"); } - } else { + } else if (builder.isMatrixType(objectTypeId)) { + // There are no SPIR-V builtins defined for 3x4 variants of ObjectToWorld/WorldToObject + // and we insert a transpose after loading the original non-transposed builtins + builder.clearAccessChain(); + builder.setAccessChainLValue(object); + object = builder.accessChainLoad(spv::NoPrecision, spv::DecorationMax, objectTypeId); + return builder.createUnaryOp(spv::OpTranspose, desiredTypeId, object); + + } else { logger->missingFunctionality("forcing non 32-bit vector type"); } @@ -2077,7 +2152,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI } else { glslang::TIntermTyped* block = node->getOperand()->getAsBinaryNode()->getLeft(); block->traverse(this); - unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst(); + unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion() + ->getConstArray()[0].getUConst(); length = builder.createArrayLength(builder.accessChainGetLValue(), member); } @@ -2103,7 +2179,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // Does it need a swizzle inversion? If so, evaluation is inverted; // operate first on the swizzle base, then apply the swizzle. spv::Id invertedType = spv::NoType; - auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? invertedType : convertGlslangToSpvType(node->getType()); }; + auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? + invertedType : convertGlslangToSpvType(node->getType()); }; if (node->getOp() == glslang::EOpInterpolateAtCentroid) invertedType = getInvertedSwizzleType(*node->getOperand()); @@ -2124,7 +2201,15 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI if (node->getOp() == glslang::EOpAtomicCounterIncrement || node->getOp() == glslang::EOpAtomicCounterDecrement || node->getOp() == glslang::EOpAtomicCounter || - node->getOp() == glslang::EOpInterpolateAtCentroid) { + node->getOp() == glslang::EOpInterpolateAtCentroid || + node->getOp() == glslang::EOpRayQueryProceed || + node->getOp() == glslang::EOpRayQueryGetRayTMin || + node->getOp() == glslang::EOpRayQueryGetRayFlags || + node->getOp() == glslang::EOpRayQueryGetWorldRayOrigin || + node->getOp() == glslang::EOpRayQueryGetWorldRayDirection || + node->getOp() == glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque || + node->getOp() == glslang::EOpRayQueryTerminate || + node->getOp() == glslang::EOpRayQueryConfirmIntersection) { operand = builder.accessChainGetLValue(); // Special case l-value operands lvalueCoherentFlags = builder.getAccessChain().coherentFlags; lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType()); @@ -2140,11 +2225,13 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // it could be a conversion if (! result) - result = createConversion(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType()); + result = createConversion(node->getOp(), decorations, resultType(), operand, + node->getOperand()->getBasicType()); // if not, then possibly an operation if (! result) - result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, node->getOperand()->getBasicType(), lvalueCoherentFlags); + result = createUnaryOperation(node->getOp(), decorations, resultType(), operand, + node->getOperand()->getBasicType(), lvalueCoherentFlags); if (result) { if (invertedType) { @@ -2215,6 +2302,12 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI case glslang::EOpEndStreamPrimitive: builder.createNoResultOp(spv::OpEndStreamPrimitive, operand); return false; + case glslang::EOpRayQueryTerminate: + builder.createNoResultOp(spv::OpRayQueryTerminateKHR, operand); + return false; + case glslang::EOpRayQueryConfirmIntersection: + builder.createNoResultOp(spv::OpRayQueryConfirmIntersectionKHR, operand); + return false; #endif default: @@ -2237,7 +2330,8 @@ spv::Id TGlslangToSpvTraverser::createCompositeConstruct(spv::Id resultTypeId, s std::vector rTypeConstituents; int numrTypeConstituents = builder.getNumTypeConstituents(rType); for (int i = 0; i < numrTypeConstituents; ++i) { - rTypeConstituents.push_back(builder.createCompositeExtract(constituent, builder.getContainedTypeId(rType, i), i)); + rTypeConstituents.push_back(builder.createCompositeExtract(constituent, + builder.getContainedTypeId(rType, i), i)); } constituents[c] = createCompositeConstruct(lType, rTypeConstituents); } else { @@ -2263,8 +2357,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); spv::Id result = spv::NoResult; - spv::Id invertedType = spv::NoType; // to use to override the natural type of the node - auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? invertedType : convertGlslangToSpvType(node->getType()); }; + spv::Id invertedType = spv::NoType; // to use to override the natural type of the node + std::vector complexLvalues; // for holding swizzling l-values too complex for + // SPIR-V, for an out parameter + std::vector temporaryLvalues; // temporaries to pass, as proxies for complexLValues + + auto resultType = [&invertedType, &node, this](){ return invertedType != spv::NoType ? + invertedType : + convertGlslangToSpvType(node->getType()); }; // try texturing result = createImageTextureFunctionCall(node); @@ -2368,7 +2468,6 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.setLine(node->getLoc().line, node->getLoc().getFilename()); if (node->isUserDefined()) result = handleUserFunctionCall(node); - // assert(result); // this can happen for bad shaders because the call graph completeness checking is not yet done if (result) { builder.clearAccessChain(); builder.setAccessChainRValue(result); @@ -2619,13 +2718,43 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt binOp = node->getOp(); break; - case glslang::EOpIgnoreIntersectionNV: - case glslang::EOpTerminateRayNV: - case glslang::EOpTraceNV: - case glslang::EOpExecuteCallableNV: + case glslang::EOpIgnoreIntersection: + case glslang::EOpTerminateRay: + case glslang::EOpTrace: + case glslang::EOpExecuteCallable: case glslang::EOpWritePackedPrimitiveIndices4x8NV: noReturnValue = true; break; + case glslang::EOpRayQueryInitialize: + case glslang::EOpRayQueryTerminate: + case glslang::EOpRayQueryGenerateIntersection: + case glslang::EOpRayQueryConfirmIntersection: + builder.addExtension("SPV_KHR_ray_query"); + builder.addCapability(spv::CapabilityRayQueryProvisionalKHR); + noReturnValue = true; + break; + case glslang::EOpRayQueryProceed: + case glslang::EOpRayQueryGetIntersectionType: + case glslang::EOpRayQueryGetRayTMin: + case glslang::EOpRayQueryGetRayFlags: + case glslang::EOpRayQueryGetIntersectionT: + case glslang::EOpRayQueryGetIntersectionInstanceCustomIndex: + case glslang::EOpRayQueryGetIntersectionInstanceId: + case glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + case glslang::EOpRayQueryGetIntersectionGeometryIndex: + case glslang::EOpRayQueryGetIntersectionPrimitiveIndex: + case glslang::EOpRayQueryGetIntersectionBarycentrics: + case glslang::EOpRayQueryGetIntersectionFrontFace: + case glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque: + case glslang::EOpRayQueryGetIntersectionObjectRayDirection: + case glslang::EOpRayQueryGetIntersectionObjectRayOrigin: + case glslang::EOpRayQueryGetWorldRayDirection: + case glslang::EOpRayQueryGetWorldRayOrigin: + case glslang::EOpRayQueryGetIntersectionObjectToWorld: + case glslang::EOpRayQueryGetIntersectionWorldToObject: + builder.addExtension("SPV_KHR_ray_query"); + builder.addCapability(spv::CapabilityRayQueryProvisionalKHR); + break; case glslang::EOpCooperativeMatrixLoad: case glslang::EOpCooperativeMatrixStore: noReturnValue = true; @@ -2637,6 +2766,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt break; #endif + case glslang::EOpDebugPrintf: + noReturnValue = true; + break; + default: break; } @@ -2688,6 +2821,28 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt lvalue = true; break; + case glslang::EOpRayQueryInitialize: + case glslang::EOpRayQueryTerminate: + case glslang::EOpRayQueryConfirmIntersection: + case glslang::EOpRayQueryProceed: + case glslang::EOpRayQueryGenerateIntersection: + case glslang::EOpRayQueryGetIntersectionType: + case glslang::EOpRayQueryGetIntersectionT: + case glslang::EOpRayQueryGetIntersectionInstanceCustomIndex: + case glslang::EOpRayQueryGetIntersectionInstanceId: + case glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + case glslang::EOpRayQueryGetIntersectionGeometryIndex: + case glslang::EOpRayQueryGetIntersectionPrimitiveIndex: + case glslang::EOpRayQueryGetIntersectionBarycentrics: + case glslang::EOpRayQueryGetIntersectionFrontFace: + case glslang::EOpRayQueryGetIntersectionObjectRayDirection: + case glslang::EOpRayQueryGetIntersectionObjectRayOrigin: + case glslang::EOpRayQueryGetIntersectionObjectToWorld: + case glslang::EOpRayQueryGetIntersectionWorldToObject: + if (arg == 0) + lvalue = true; + break; + case glslang::EOpAtomicAdd: case glslang::EOpAtomicMin: case glslang::EOpAtomicMax: @@ -2713,9 +2868,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // Does it need a swizzle inversion? If so, evaluation is inverted; // operate first on the swizzle base, then apply the swizzle. + // That is, we transform + // + // interpolate(v.zy) -> interpolate(v).zy + // if (glslangOperands[0]->getAsOperator() && glslangOperands[0]->getAsOperator()->getOp() == glslang::EOpVectorSwizzle) - invertedType = convertGlslangToSpvType(glslangOperands[0]->getAsBinaryNode()->getLeft()->getType()); + invertedType = convertGlslangToSpvType( + glslangOperands[0]->getAsBinaryNode()->getLeft()->getType()); } break; case glslang::EOpAtomicLoad: @@ -2775,8 +2935,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.setAccessChain(save); // Point to the first element of the array. - builder.accessChainPush(elementId, TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()), - glslangOperands[arg]->getAsTyped()->getType().getBufferReferenceAlignment()); + builder.accessChainPush(elementId, + TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()), + glslangOperands[arg]->getAsTyped()->getType().getBufferReferenceAlignment()); spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags; unsigned int alignment = builder.getAccessChain().alignment; @@ -2786,7 +2947,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt memoryAccess &= ~spv::MemoryAccessMakePointerAvailableKHRMask; if (node->getOp() == glslang::EOpCooperativeMatrixStore) memoryAccess &= ~spv::MemoryAccessMakePointerVisibleKHRMask; - if (builder.getStorageClass(builder.getAccessChain().base) == spv::StorageClassPhysicalStorageBufferEXT) { + if (builder.getStorageClass(builder.getAccessChain().base) == + spv::StorageClassPhysicalStorageBufferEXT) { memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessAlignedMask); } @@ -2796,8 +2958,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt memoryAccessOperands.push_back(spv::IdImmediate(false, alignment)); } - if (memoryAccess & (spv::MemoryAccessMakePointerAvailableKHRMask | spv::MemoryAccessMakePointerVisibleKHRMask)) { - memoryAccessOperands.push_back(spv::IdImmediate(true, builder.makeUintConstant(TranslateMemoryScope(coherentFlags)))); + if (memoryAccess & + (spv::MemoryAccessMakePointerAvailableKHRMask | spv::MemoryAccessMakePointerVisibleKHRMask)) { + memoryAccessOperands.push_back(spv::IdImmediate(true, + builder.makeUintConstant(TranslateMemoryScope(coherentFlags)))); } } else if (arg == 2) { continue; @@ -2805,13 +2969,47 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt } #endif + // for l-values, pass the address, for r-values, pass the value if (lvalue) { - operands.push_back(builder.accessChainGetLValue()); + if (invertedType == spv::NoType && !builder.isSpvLvalue()) { + // SPIR-V cannot represent an l-value containing a swizzle that doesn't + // reduce to a simple access chain. So, we need a temporary vector to + // receive the result, and must later swizzle that into the original + // l-value. + complexLvalues.push_back(builder.getAccessChain()); + temporaryLvalues.push_back(builder.createVariable(spv::StorageClassFunction, + builder.accessChainGetInferredType(), "swizzleTemp")); + operands.push_back(temporaryLvalues.back()); + } else { + operands.push_back(builder.accessChainGetLValue()); + } lvalueCoherentFlags = builder.getAccessChain().coherentFlags; lvalueCoherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()); } else { builder.setLine(node->getLoc().line, node->getLoc().getFilename()); - operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType())); + glslang::TOperator glslangOp = node->getOp(); + if (arg == 1 && + (glslangOp == glslang::EOpRayQueryGetIntersectionType || + glslangOp == glslang::EOpRayQueryGetIntersectionT || + glslangOp == glslang::EOpRayQueryGetIntersectionInstanceCustomIndex || + glslangOp == glslang::EOpRayQueryGetIntersectionInstanceId || + glslangOp == glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset || + glslangOp == glslang::EOpRayQueryGetIntersectionGeometryIndex || + glslangOp == glslang::EOpRayQueryGetIntersectionPrimitiveIndex || + glslangOp == glslang::EOpRayQueryGetIntersectionBarycentrics || + glslangOp == glslang::EOpRayQueryGetIntersectionFrontFace || + glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayDirection || + glslangOp == glslang::EOpRayQueryGetIntersectionObjectRayOrigin || + glslangOp == glslang::EOpRayQueryGetIntersectionObjectToWorld || + glslangOp == glslang::EOpRayQueryGetIntersectionWorldToObject + )) { + bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst(); + operands.push_back(builder.makeIntConstant(cond ? 1 : 0)); + } + else { + operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType())); + } + } } @@ -2847,7 +3045,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt #endif if (atomic) { // Handle all atomics - result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags); + result = createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), + lvalueCoherentFlags); + } else if (node->getOp() == glslang::EOpDebugPrintf) { + if (!nonSemanticDebugPrintf) { + nonSemanticDebugPrintf = builder.import("NonSemantic.DebugPrintf"); + } + result = builder.createBuiltinCall(builder.makeVoidType(), nonSemanticDebugPrintf, spv::NonSemanticDebugPrintfDebugPrintf, operands); + builder.addExtension(spv::E_SPV_KHR_non_semantic_info); } else { // Pass through to generic operations. switch (glslangOperands.size()) { @@ -2869,8 +3074,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt result = createMiscOperation(node->getOp(), precision, resultType(), operands, node->getBasicType()); break; } - if (invertedType) + + if (invertedType != spv::NoResult) result = createInvertedSwizzle(precision, *glslangOperands[0]->getAsBinaryNode(), result); + + for (unsigned int i = 0; i < temporaryLvalues.size(); ++i) { + builder.setAccessChain(complexLvalues[i]); + builder.accessChainStore(builder.createLoad(temporaryLvalues[i])); + } } if (noReturnValue) @@ -3077,7 +3288,8 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T defaultSegment = (int)codeSegments.size(); else if (child->getAsBranchNode() && child->getAsBranchNode()->getFlowOp() == glslang::EOpCase) { valueIndexToSegment[caseValues.size()] = (int)codeSegments.size(); - caseValues.push_back(child->getAsBranchNode()->getExpression()->getAsConstantUnion()->getConstArray()[0].getIConst()); + caseValues.push_back(child->getAsBranchNode()->getExpression()->getAsConstantUnion() + ->getConstArray()[0].getIConst()); } else codeSegments.push_back(child); } @@ -3090,7 +3302,8 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T // make the switch statement std::vector segmentBlocks; // returned, as the blocks allocated in the call - builder.makeSwitch(selector, control, (int)codeSegments.size(), caseValues, valueIndexToSegment, defaultSegment, segmentBlocks); + builder.makeSwitch(selector, control, (int)codeSegments.size(), caseValues, valueIndexToSegment, defaultSegment, + segmentBlocks); // emit all the code in the segments breakForLoop.push(false); @@ -3347,7 +3560,8 @@ spv::Id TGlslangToSpvTraverser::getInvertedSwizzleType(const glslang::TIntermTyp // When inverting a swizzle with a parent op, this function // will apply the swizzle operation to a completed parent operation. -spv::Id TGlslangToSpvTraverser::createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped& node, spv::Id parentResult) +spv::Id TGlslangToSpvTraverser::createInvertedSwizzle(spv::Decoration precision, const glslang::TIntermTyped& node, + spv::Id parentResult) { std::vector swizzle; convertSwizzle(*node.getAsBinaryNode()->getRight()->getAsAggregate(), swizzle); @@ -3430,8 +3644,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty builder.addCapability(spv::CapabilityAtomicStorage); spvType = builder.makeUintType(32); break; - case glslang::EbtAccStructNV: - spvType = builder.makeAccelerationStructureNVType(); + case glslang::EbtAccStruct: + spvType = builder.makeAccelerationStructureType(); + break; + case glslang::EbtRayQuery: + spvType = builder.makeRayQueryType(); break; case glslang::EbtReference: { @@ -3483,10 +3700,13 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // else, we haven't seen it... if (type.getBasicType() == glslang::EbtBlock) - memberRemapper[glslangMembers].resize(glslangMembers->size()); + memberRemapper[glslangTypeToIdMap[glslangMembers]].resize(glslangMembers->size()); spvType = convertGlslangStructToSpvType(type, glslangMembers, explicitLayout, qualifier); } break; + case glslang::EbtString: + // no type used for OpString + return 0; default: assert(0); break; @@ -3612,22 +3832,23 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy { // Create a vector of struct types for SPIR-V to consume std::vector spvMembers; - int memberDelta = 0; // how much the member's index changes from glslang to SPIR-V, normally 0, except sometimes for blocks + int memberDelta = 0; // how much the member's index changes from glslang to SPIR-V, normally 0, + // except sometimes for blocks std::vector > deferredForwardPointers; for (int i = 0; i < (int)glslangMembers->size(); i++) { glslang::TType& glslangMember = *(*glslangMembers)[i].type; if (glslangMember.hiddenMember()) { ++memberDelta; if (type.getBasicType() == glslang::EbtBlock) - memberRemapper[glslangMembers][i] = -1; + memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1; } else { if (type.getBasicType() == glslang::EbtBlock) { if (filterMember(glslangMember)) { memberDelta++; - memberRemapper[glslangMembers][i] = -1; + memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1; continue; } - memberRemapper[glslangMembers][i] = i - memberDelta; + memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = i - memberDelta; } // modify just this child's view of the qualifier glslang::TQualifier memberQualifier = glslangMember.getQualifier(); @@ -3648,10 +3869,12 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy deferredForwardPointers.push_back(std::make_pair(&glslangMember, memberQualifier)); } spvMembers.push_back( - convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, true)); + convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, + true)); } else { spvMembers.push_back( - convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, false)); + convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember, + false)); } } } @@ -3685,7 +3908,7 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, glslang::TType& glslangMember = *(*glslangMembers)[i].type; int member = i; if (type.getBasicType() == glslang::EbtBlock) { - member = memberRemapper[glslangMembers][i]; + member = memberRemapper[glslangTypeToIdMap[glslangMembers]][i]; if (filterMember(glslangMember)) continue; } @@ -3839,11 +4062,11 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) alignment |= type.getBufferReferenceAlignment(); spv::Id loadedId = builder.accessChainLoad(TranslatePrecisionDecoration(type), - TranslateNonUniformDecoration(type.getQualifier()), - nominalTypeId, - spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask), - TranslateMemoryScope(coherentFlags), - alignment); + TranslateNonUniformDecoration(type.getQualifier()), + nominalTypeId, + spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask), + TranslateMemoryScope(coherentFlags), + alignment); // Need to convert to abstract types when necessary if (type.getBasicType() == glslang::EbtBool) { @@ -3857,7 +4080,8 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) int vecSize = builder.getNumTypeComponents(nominalTypeId); spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize); if (nominalTypeId != bvecType) - loadedId = builder.createBinOp(spv::OpINotEqual, bvecType, loadedId, makeSmearedConstant(builder.makeUintConstant(0), vecSize)); + loadedId = builder.createBinOp(spv::OpINotEqual, bvecType, loadedId, + makeSmearedConstant(builder.makeUintConstant(0), vecSize)); } } @@ -3906,7 +4130,8 @@ void TGlslangToSpvTraverser::accessChainStore(const glslang::TType& type, spv::I alignment |= type.getBufferReferenceAlignment(); builder.accessChainStore(rvalue, - spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerVisibleKHRMask), + spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & + ~spv::MemoryAccessMakePointerVisibleKHRMask), TranslateMemoryScope(coherentFlags), alignment); } @@ -3967,7 +4192,8 @@ void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id // set up the target storage builder.clearAccessChain(); builder.setAccessChainLValue(lValue); - builder.accessChainPush(builder.makeIntConstant(index), TranslateCoherent(type), type.getBufferReferenceAlignment()); + builder.accessChainPush(builder.makeIntConstant(index), TranslateCoherent(type), + type.getBufferReferenceAlignment()); // store the member multiTypeStore(glslangElementType, elementRValue); @@ -3987,7 +4213,8 @@ void TGlslangToSpvTraverser::multiTypeStore(const glslang::TType& type, spv::Id // set up the target storage builder.clearAccessChain(); builder.setAccessChainLValue(lValue); - builder.accessChainPush(builder.makeIntConstant(m), TranslateCoherent(type), type.getBufferReferenceAlignment()); + builder.accessChainPush(builder.makeIntConstant(m), TranslateCoherent(type), + type.getBufferReferenceAlignment()); // store the member multiTypeStore(glslangMemberType, memberRValue); @@ -4022,18 +4249,21 @@ glslang::TLayoutPacking TGlslangToSpvTraverser::getExplicitLayout(const glslang: } // Given an array type, returns the integer stride required for that array -int TGlslangToSpvTraverser::getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) +int TGlslangToSpvTraverser::getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking explicitLayout, + glslang::TLayoutMatrix matrixLayout) { int size; int stride; - glslangIntermediate->getMemberAlignment(arrayType, size, stride, explicitLayout, matrixLayout == glslang::ElmRowMajor); + glslangIntermediate->getMemberAlignment(arrayType, size, stride, explicitLayout, + matrixLayout == glslang::ElmRowMajor); return stride; } // Given a matrix type, or array (of array) of matrixes type, returns the integer stride required for that matrix // when used as a member of an interface block -int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) +int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking explicitLayout, + glslang::TLayoutMatrix matrixLayout) { glslang::TType elementType; elementType.shallowCopy(matrixType); @@ -4041,7 +4271,8 @@ int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, gl int size; int stride; - glslangIntermediate->getMemberAlignment(elementType, size, stride, explicitLayout, matrixLayout == glslang::ElmRowMajor); + glslangIntermediate->getMemberAlignment(elementType, size, stride, explicitLayout, + matrixLayout == glslang::ElmRowMajor); return stride; } @@ -4052,8 +4283,8 @@ int TGlslangToSpvTraverser::getMatrixStride(const glslang::TType& matrixType, gl // 'currentOffset' should be passed in already initialized, ready to modify, and reflecting // the migration of data from nextOffset -> currentOffset. It should be -1 on the first call. // -1 means a non-forced member offset (no decoration needed). -void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, - glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) +void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, + int& currentOffset, int& nextOffset, glslang::TLayoutPacking explicitLayout, glslang::TLayoutMatrix matrixLayout) { // this will get a positive value when deemed necessary nextOffset = -1; @@ -4083,7 +4314,8 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType int memberSize; int dummyStride; - int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout, matrixLayout == glslang::ElmRowMajor); + int memberAlignment = glslangIntermediate->getMemberAlignment(memberType, memberSize, dummyStride, explicitLayout, + matrixLayout == glslang::ElmRowMajor); // Adjust alignment for HLSL rules // TODO: make this consistent in early phases of code: @@ -4102,7 +4334,8 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& structType glslang::RoundToPow2(currentOffset, memberAlignment); // Bump up to vec4 if there is a bad straddle - if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize, currentOffset)) + if (explicitLayout != glslang::ElpScalar && glslangIntermediate->improperStraddle(memberType, memberSize, + currentOffset)) glslang::RoundToPow2(currentOffset, 16); nextOffset = currentOffset + memberSize; @@ -4174,7 +4407,8 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier, // Make all the functions, skeletally, without actually visiting their bodies. void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslFunctions) { - const auto getParamDecorations = [&](std::vector& decorations, const glslang::TType& type, bool useVulkanMemoryModel) { + const auto getParamDecorations = [&](std::vector& decorations, const glslang::TType& type, + bool useVulkanMemoryModel) { spv::Decoration paramPrecision = TranslatePrecisionDecoration(type); if (paramPrecision != spv::NoPrecision) decorations.push_back(paramPrecision); @@ -4272,7 +4506,8 @@ void TGlslangToSpvTraverser::makeGlobalInitializers(const glslang::TIntermSequen builder.setBuildPoint(shaderEntry->getLastBlock()); for (int i = 0; i < (int)initializers.size(); ++i) { glslang::TIntermAggregate* initializer = initializers[i]->getAsAggregate(); - if (initializer && initializer->getOp() != glslang::EOpFunction && initializer->getOp() != glslang::EOpLinkerObjects) { + if (initializer && initializer->getOp() != glslang::EOpFunction && initializer->getOp() != + glslang::EOpLinkerObjects) { // We're on a top-level node that's not a function. Treat as an initializer, whose // code goes into the beginning of the entry point. @@ -4300,7 +4535,8 @@ void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate builder.setBuildPoint(functionBlock); } -void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) +void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, + spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) { const glslang::TIntermSequence& glslangArguments = node.getSequence(); @@ -4313,7 +4549,8 @@ void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& sampler = glslangArguments[0]->getAsTyped()->getType().getSampler(); cubeCompare = sampler.dim == glslang::EsdCube && sampler.arrayed && sampler.shadow; #ifndef GLSLANG_WEB - f16ShadowCompare = sampler.shadow && glslangArguments[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16; + f16ShadowCompare = sampler.shadow && + glslangArguments[1]->getAsTyped()->getType().getBasicType() == glslang::EbtFloat16; #endif } @@ -4689,7 +4926,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO operands.push_back(imageOperand); } if (mask & spv::ImageOperandsMakeTexelVisibleKHRMask) { - spv::IdImmediate imageOperand = { true, builder.makeUintConstant(TranslateMemoryScope(TranslateCoherent(imageType))) }; + spv::IdImmediate imageOperand = { true, builder.makeUintConstant(TranslateMemoryScope( + TranslateCoherent(imageType))) }; operands.push_back(imageOperand); } @@ -4717,18 +4955,22 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO // imageAtomicStore has a void return type so base the pointer type on // the type of the value operand. if (node->getOp() == glslang::EOpImageAtomicStore) { - resultTypeId = builder.makePointer(spv::StorageClassImage, builder.getTypeId(operands[2].word)); + resultTypeId = builder.makePointer(spv::StorageClassImage, builder.getTypeId(*opIt)); } else { resultTypeId = builder.makePointer(spv::StorageClassImage, resultType()); } spv::Id pointer = builder.createOp(spv::OpImageTexelPointer, resultTypeId, operands); + if (imageType.getQualifier().nonUniform) { + builder.addDecoration(pointer, spv::DecorationNonUniformEXT); + } std::vector operands; operands.push_back(pointer); for (; opIt != arguments.end(); ++opIt) operands.push_back(*opIt); - return createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), lvalueCoherentFlags); + return createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(), + lvalueCoherentFlags); } } @@ -4753,7 +4995,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO std::vector comps; comps.push_back(zero); comps.push_back(zero); - operands.push_back(builder.makeCompositeConstant(builder.makeVectorType(builder.makeIntType(32), 2), comps)); + operands.push_back(builder.makeCompositeConstant( + builder.makeVectorType(builder.makeIntType(32), 2), comps)); } for (; opIt != arguments.end(); ++opIt) @@ -4842,7 +5085,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO else dRefComp = builder.getNumComponents(params.coords) - 1; indexes.push_back(dRefComp); - params.Dref = builder.createCompositeExtract(params.coords, builder.getScalarTypeId(builder.getTypeId(params.coords)), indexes); + params.Dref = builder.createCompositeExtract(params.coords, + builder.getScalarTypeId(builder.getTypeId(params.coords)), indexes); } // lod @@ -4967,7 +5211,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO flags.clear(); builder.accessChainPush(builder.makeIntConstant(i), flags, 0); - builder.accessChainStore(builder.createCompositeExtract(res, builder.getContainedTypeId(resType, i+1), i+1)); + builder.accessChainStore(builder.createCompositeExtract(res, builder.getContainedTypeId(resType, i+1), + i+1)); } return builder.createCompositeExtract(res, resultType(), 0); } @@ -4990,10 +5235,9 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO // copy the projective coordinate if we have to if (projTargetComp != projSourceComp) { spv::Id projComp = builder.createCompositeExtract(params.coords, - builder.getScalarTypeId(builder.getTypeId(params.coords)), - projSourceComp); + builder.getScalarTypeId(builder.getTypeId(params.coords)), projSourceComp); params.coords = builder.createCompositeInsert(projComp, params.coords, - builder.getTypeId(params.coords), projTargetComp); + builder.getTypeId(params.coords), projTargetComp); } } @@ -5073,7 +5317,8 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg ++lValueCount; } else if (writableParam(qualifiers[a])) { // need space to hold the copy - arg = builder.createVariable(spv::StorageClassFunction, builder.getContainedTypeId(function->getParamType(a)), "param"); + arg = builder.createVariable(spv::StorageClassFunction, + builder.getContainedTypeId(function->getParamType(a)), "param"); if (qualifiers[a] == glslang::EvqIn || qualifiers[a] == glslang::EvqInOut) { // need to copy the input into output space builder.setAccessChain(lValues[lValueCount]); @@ -5488,7 +5733,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, OpDecora } spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDecorations& decorations, spv::Id typeId, - spv::Id operand, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) + spv::Id operand, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) { spv::Op unaryOp = spv::OpNop; int extBuiltins = -1; @@ -5749,6 +5994,24 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe case glslang::EOpFwidthCoarse: unaryOp = spv::OpFwidthCoarse; break; + case glslang::EOpRayQueryProceed: + unaryOp = spv::OpRayQueryProceedKHR; + break; + case glslang::EOpRayQueryGetRayTMin: + unaryOp = spv::OpRayQueryGetRayTMinKHR; + break; + case glslang::EOpRayQueryGetRayFlags: + unaryOp = spv::OpRayQueryGetRayFlagsKHR; + break; + case glslang::EOpRayQueryGetWorldRayOrigin: + unaryOp = spv::OpRayQueryGetWorldRayOriginKHR; + break; + case glslang::EOpRayQueryGetWorldRayDirection: + unaryOp = spv::OpRayQueryGetWorldRayDirectionKHR; + break; + case glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque: + unaryOp = spv::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR; + break; case glslang::EOpInterpolateAtCentroid: if (typeProxy == glslang::EbtFloat16) builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float); @@ -6381,7 +6644,9 @@ spv::Id TGlslangToSpvTraverser::makeSmearedConstant(spv::Id constant, int vector } // For glslang ops that map to SPV atomic opCodes -spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy, const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) +spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv::Decoration /*precision*/, + spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy, + const spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) { spv::Op opCode = spv::OpNop; @@ -6397,12 +6662,14 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv case glslang::EOpAtomicMin: case glslang::EOpImageAtomicMin: case glslang::EOpAtomicCounterMin: - opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? spv::OpAtomicUMin : spv::OpAtomicSMin; + opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? + spv::OpAtomicUMin : spv::OpAtomicSMin; break; case glslang::EOpAtomicMax: case glslang::EOpImageAtomicMax: case glslang::EOpAtomicCounterMax: - opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? spv::OpAtomicUMax : spv::OpAtomicSMax; + opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ? + spv::OpAtomicUMax : spv::OpAtomicSMax; break; case glslang::EOpAtomicAnd: case glslang::EOpImageAtomicAnd: @@ -6467,7 +6734,8 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv scopeId = builder.makeUintConstant(spv::ScopeDevice); } // semantics default to relaxed - spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() && glslangIntermediate->usingVulkanMemoryModel() ? + spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() && + glslangIntermediate->usingVulkanMemoryModel() ? spv::MemorySemanticsVolatileMask : spv::MemorySemanticsMaskNone); spv::Id semanticsId2 = semanticsId; @@ -6480,20 +6748,24 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv valueId = operands[2]; if (operands.size() > 3) { scopeId = operands[3]; - semanticsId = builder.makeUintConstant(builder.getConstantScalar(operands[4]) | builder.getConstantScalar(operands[5])); - semanticsId2 = builder.makeUintConstant(builder.getConstantScalar(operands[6]) | builder.getConstantScalar(operands[7])); + semanticsId = builder.makeUintConstant( + builder.getConstantScalar(operands[4]) | builder.getConstantScalar(operands[5])); + semanticsId2 = builder.makeUintConstant( + builder.getConstantScalar(operands[6]) | builder.getConstantScalar(operands[7])); } } else if (opCode == spv::OpAtomicLoad) { if (operands.size() > 1) { scopeId = operands[1]; - semanticsId = builder.makeUintConstant(builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3])); + semanticsId = builder.makeUintConstant( + builder.getConstantScalar(operands[2]) | builder.getConstantScalar(operands[3])); } } else { // atomic store or RMW valueId = operands[1]; if (operands.size() > 2) { scopeId = operands[2]; - semanticsId = builder.makeUintConstant(builder.getConstantScalar(operands[3]) | builder.getConstantScalar(operands[4])); + semanticsId = builder.makeUintConstant + (builder.getConstantScalar(operands[3]) | builder.getConstantScalar(operands[4])); } } @@ -6538,7 +6810,8 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv } // Create group invocation operations. -spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, + std::vector& operands, glslang::TBasicType typeProxy) { bool isUnsigned = isTypeUnsignedInt(typeProxy); bool isFloat = isTypeFloat(typeProxy); @@ -6752,8 +7025,10 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv op == spv::OpGroupFMax || op == spv::OpGroupUMax || op == spv::OpGroupSMax || op == spv::OpGroupFAdd || op == spv::OpGroupIAdd || op == spv::OpGroupBroadcast || op == spv::OpSubgroupReadInvocationKHR || - op == spv::OpGroupFMinNonUniformAMD || op == spv::OpGroupUMinNonUniformAMD || op == spv::OpGroupSMinNonUniformAMD || - op == spv::OpGroupFMaxNonUniformAMD || op == spv::OpGroupUMaxNonUniformAMD || op == spv::OpGroupSMaxNonUniformAMD || + op == spv::OpGroupFMinNonUniformAMD || op == spv::OpGroupUMinNonUniformAMD || + op == spv::OpGroupSMinNonUniformAMD || + op == spv::OpGroupFMaxNonUniformAMD || op == spv::OpGroupUMaxNonUniformAMD || + op == spv::OpGroupSMaxNonUniformAMD || op == spv::OpGroupFAddNonUniformAMD || op == spv::OpGroupIAddNonUniformAMD); // Handle group invocation operations scalar by scalar. @@ -7142,7 +7417,8 @@ spv::Id TGlslangToSpvTraverser::createSubgroupOperation(glslang::TOperator op, s return builder.createOp(opCode, typeId, spvGroupOperands); } -spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, + spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { bool isUnsigned = isTypeUnsignedInt(typeProxy); bool isFloat = isTypeFloat(typeProxy); @@ -7244,14 +7520,16 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: 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); + 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)) { + if (glslangIntermediate->usingVulkanMemoryModel() && (executionScope == spv::ScopeDevice || + memoryScope == spv::ScopeDevice)) { builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR); } return 0; @@ -7334,7 +7612,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: if (builder.getNumComponents(operands[0]) == 1) frexpIntType = builder.makeIntegerType(width, true); else - frexpIntType = builder.makeVectorType(builder.makeIntegerType(width, true), builder.getNumComponents(operands[0])); + frexpIntType = builder.makeVectorType(builder.makeIntegerType(width, true), + builder.getNumComponents(operands[0])); typeId = builder.makeStructResultType(typeId0, frexpIntType); consumedOperands = 1; } @@ -7437,24 +7716,105 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::InterpolateAtVertexAMD; break; - case glslang::EOpReportIntersectionNV: - { + case glslang::EOpReportIntersection: typeId = builder.makeBoolType(); - opCode = spv::OpReportIntersectionNV; - } - break; - case glslang::EOpTraceNV: - { - builder.createNoResultOp(spv::OpTraceNV, operands); + opCode = spv::OpReportIntersectionKHR; + break; + case glslang::EOpTrace: + builder.createNoResultOp(spv::OpTraceRayKHR, operands); return 0; - } - break; - case glslang::EOpExecuteCallableNV: - { - builder.createNoResultOp(spv::OpExecuteCallableNV, operands); + case glslang::EOpExecuteCallable: + builder.createNoResultOp(spv::OpExecuteCallableKHR, operands); return 0; - } - break; + + case glslang::EOpRayQueryInitialize: + builder.createNoResultOp(spv::OpRayQueryInitializeKHR, operands); + return 0; + case glslang::EOpRayQueryTerminate: + builder.createNoResultOp(spv::OpRayQueryTerminateKHR, operands); + return 0; + case glslang::EOpRayQueryGenerateIntersection: + builder.createNoResultOp(spv::OpRayQueryGenerateIntersectionKHR, operands); + return 0; + case glslang::EOpRayQueryConfirmIntersection: + builder.createNoResultOp(spv::OpRayQueryConfirmIntersectionKHR, operands); + return 0; + case glslang::EOpRayQueryProceed: + typeId = builder.makeBoolType(); + opCode = spv::OpRayQueryProceedKHR; + break; + case glslang::EOpRayQueryGetIntersectionType: + typeId = builder.makeUintType(32); + opCode = spv::OpRayQueryGetIntersectionTypeKHR; + break; + case glslang::EOpRayQueryGetRayTMin: + typeId = builder.makeFloatType(32); + opCode = spv::OpRayQueryGetRayTMinKHR; + break; + case glslang::EOpRayQueryGetRayFlags: + typeId = builder.makeIntType(32); + opCode = spv::OpRayQueryGetRayFlagsKHR; + break; + case glslang::EOpRayQueryGetIntersectionT: + typeId = builder.makeFloatType(32); + opCode = spv::OpRayQueryGetIntersectionTKHR; + break; + case glslang::EOpRayQueryGetIntersectionInstanceCustomIndex: + typeId = builder.makeIntType(32); + opCode = spv::OpRayQueryGetIntersectionInstanceCustomIndexKHR; + break; + case glslang::EOpRayQueryGetIntersectionInstanceId: + typeId = builder.makeIntType(32); + opCode = spv::OpRayQueryGetIntersectionInstanceIdKHR; + break; + case glslang::EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + typeId = builder.makeIntType(32); + opCode = spv::OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR; + break; + case glslang::EOpRayQueryGetIntersectionGeometryIndex: + typeId = builder.makeIntType(32); + opCode = spv::OpRayQueryGetIntersectionGeometryIndexKHR; + break; + case glslang::EOpRayQueryGetIntersectionPrimitiveIndex: + typeId = builder.makeIntType(32); + opCode = spv::OpRayQueryGetIntersectionPrimitiveIndexKHR; + break; + case glslang::EOpRayQueryGetIntersectionBarycentrics: + typeId = builder.makeVectorType(builder.makeFloatType(32), 2); + opCode = spv::OpRayQueryGetIntersectionBarycentricsKHR; + break; + case glslang::EOpRayQueryGetIntersectionFrontFace: + typeId = builder.makeBoolType(); + opCode = spv::OpRayQueryGetIntersectionFrontFaceKHR; + break; + case glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque: + typeId = builder.makeBoolType(); + opCode = spv::OpRayQueryGetIntersectionCandidateAABBOpaqueKHR; + break; + case glslang::EOpRayQueryGetIntersectionObjectRayDirection: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpRayQueryGetIntersectionObjectRayDirectionKHR; + break; + case glslang::EOpRayQueryGetIntersectionObjectRayOrigin: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpRayQueryGetIntersectionObjectRayOriginKHR; + break; + case glslang::EOpRayQueryGetWorldRayDirection: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpRayQueryGetWorldRayDirectionKHR; + break; + case glslang::EOpRayQueryGetWorldRayOrigin: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::OpRayQueryGetWorldRayOriginKHR; + break; + case glslang::EOpRayQueryGetIntersectionObjectToWorld: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::OpRayQueryGetIntersectionObjectToWorldKHR; + break; + case glslang::EOpRayQueryGetIntersectionWorldToObject: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::OpRayQueryGetIntersectionWorldToObjectKHR; + break; case glslang::EOpWritePackedPrimitiveIndices4x8NV: builder.createNoResultOp(spv::OpWritePackedPrimitiveIndices4x8NV, operands); return 0; @@ -7544,7 +7904,8 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId) { // GLSL memory barriers use queuefamily scope in new model, device scope in old model - spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? spv::ScopeQueueFamilyKHR : spv::ScopeDevice; + spv::Scope memoryBarrierScope = glslangIntermediate->usingVulkanMemoryModel() ? + spv::ScopeQueueFamilyKHR : spv::ScopeDevice; switch (op) { case glslang::EOpBarrier: @@ -7650,13 +8011,24 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: spv::Id id = builder.createBuiltinCall(typeId, getExtBuiltins(spv::E_SPV_AMD_gcn_shader), spv::TimeAMD, args); return builder.setPrecision(id, precision); } - case glslang::EOpIgnoreIntersectionNV: - builder.createNoResultOp(spv::OpIgnoreIntersectionNV); + case glslang::EOpIgnoreIntersection: + builder.createNoResultOp(spv::OpIgnoreIntersectionKHR); return 0; - case glslang::EOpTerminateRayNV: - builder.createNoResultOp(spv::OpTerminateRayNV); + case glslang::EOpTerminateRay: + builder.createNoResultOp(spv::OpTerminateRayKHR); + return 0; + case glslang::EOpRayQueryInitialize: + builder.createNoResultOp(spv::OpRayQueryInitializeKHR); + return 0; + case glslang::EOpRayQueryTerminate: + builder.createNoResultOp(spv::OpRayQueryTerminateKHR); + return 0; + case glslang::EOpRayQueryGenerateIntersection: + builder.createNoResultOp(spv::OpRayQueryGenerateIntersectionKHR); + return 0; + case glslang::EOpRayQueryConfirmIntersection: + builder.createNoResultOp(spv::OpRayQueryConfirmIntersectionKHR); return 0; - case glslang::EOpBeginInvocationInterlock: builder.createNoResultOp(spv::OpBeginInvocationInterlockEXT); return 0; @@ -7708,7 +8080,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol // it was not found, create it spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); - auto forcedType = getForcedType(builtIn, symbol->getType()); + auto forcedType = getForcedType(symbol->getQualifier().builtIn, symbol->getType()); id = createSpvVariable(symbol, forcedType.first); symbolValues[symbol->getId()] = id; if (forcedType.second != spv::NoType) @@ -7773,7 +8145,8 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol #ifndef GLSLANG_WEB if (symbol->getType().isImage()) { std::vector memory; - TranslateMemoryDecoration(symbol->getType().getQualifier(), memory, glslangIntermediate->usingVulkanMemoryModel()); + TranslateMemoryDecoration(symbol->getType().getQualifier(), memory, + glslangIntermediate->usingVulkanMemoryModel()); for (unsigned int i = 0; i < memory.size(); ++i) builder.addDecoration(id, memory[i]); } @@ -7827,7 +8200,8 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } if (symbol->isReference()) { - builder.addDecoration(id, symbol->getType().getQualifier().restrict ? spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT); + builder.addDecoration(id, symbol->getType().getQualifier().restrict ? + spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT); } #endif @@ -7889,8 +8263,9 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n // hand off to the non-spec-constant path assert(node.getAsConstantUnion() != nullptr || node.getAsSymbolNode() != nullptr); int nextConst = 0; - return createSpvConstantFromConstUnionArray(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), - nextConst, false); + return createSpvConstantFromConstUnionArray(node.getType(), node.getAsConstantUnion() ? + node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), + nextConst, false); } // We now know we have a specialization constant to build @@ -7943,7 +8318,8 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n // If there are not enough elements present in 'consts', 0 will be substituted; // an empty 'consts' can be used to create a fully zeroed SPIR-V constant. // -spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glslang::TType& glslangType, const glslang::TConstUnionArray& consts, int& nextConst, bool specConstant) +spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glslang::TType& glslangType, + const glslang::TConstUnionArray& consts, int& nextConst, bool specConstant) { // vector of constants for SPIR-V std::vector spvConsts; @@ -8061,6 +8437,9 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla scalar = builder.createUnaryOp(spv::OpBitcast, typeId, scalar); break; #endif + case glslang::EbtString: + scalar = builder.getStringId(consts[nextConst].getSConst()->c_str()); + break; default: assert(0); break; @@ -8161,7 +8540,8 @@ bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node) // Emit short-circuiting code, where 'right' is never evaluated unless // the left side is true (for &&) or false (for ||). -spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslang::TIntermTyped& left, glslang::TIntermTyped& right) +spv::Id TGlslangToSpvTraverser::createShortCircuit(glslang::TOperator op, glslang::TIntermTyped& left, + glslang::TIntermTyped& right) { spv::Id boolTypeId = builder.makeBoolType(); diff --git a/core/deps/glslang/SPIRV/Logger.cpp b/core/deps/glslang/SPIRV/Logger.cpp index 7ea0c6342..cdc8469c4 100644 --- a/core/deps/glslang/SPIRV/Logger.cpp +++ b/core/deps/glslang/SPIRV/Logger.cpp @@ -69,4 +69,4 @@ std::string SpvBuildLogger::getAllMessages() const { } // end spv namespace -#endif \ No newline at end of file +#endif diff --git a/core/deps/glslang/SPIRV/NonSemanticDebugPrintf.h b/core/deps/glslang/SPIRV/NonSemanticDebugPrintf.h new file mode 100644 index 000000000..83796d75e --- /dev/null +++ b/core/deps/glslang/SPIRV/NonSemanticDebugPrintf.h @@ -0,0 +1,50 @@ +// Copyright (c) 2020 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and/or associated documentation files (the +// "Materials"), to deal in the Materials without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Materials, and to +// permit persons to whom the Materials are furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +// KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +// SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT +// https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +// + +#ifndef SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ +#define SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticDebugPrintfRevision = 1, + NonSemanticDebugPrintfRevision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticDebugPrintfInstructions { + NonSemanticDebugPrintfDebugPrintf = 1, + NonSemanticDebugPrintfInstructionsMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticDebugPrintf_H_ diff --git a/core/deps/glslang/SPIRV/SpvBuilder.cpp b/core/deps/glslang/SPIRV/SpvBuilder.cpp index bd208952e..6cf70a12d 100644 --- a/core/deps/glslang/SPIRV/SpvBuilder.cpp +++ b/core/deps/glslang/SPIRV/SpvBuilder.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2014-2015 LunarG, Inc. // Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -496,7 +497,8 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) return type->getResultId(); } -Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format) +Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, + ImageFormat format) { assert(sampled == 1 || sampled == 2); @@ -601,16 +603,31 @@ Id Builder::makeSampledImageType(Id imageType) } #ifndef GLSLANG_WEB -Id Builder::makeAccelerationStructureNVType() +Id Builder::makeAccelerationStructureType() { Instruction *type; - if (groupedTypes[OpTypeAccelerationStructureNV].size() == 0) { - type = new Instruction(getUniqueId(), NoType, OpTypeAccelerationStructureNV); - groupedTypes[OpTypeAccelerationStructureNV].push_back(type); + if (groupedTypes[OpTypeAccelerationStructureKHR].size() == 0) { + type = new Instruction(getUniqueId(), NoType, OpTypeAccelerationStructureKHR); + groupedTypes[OpTypeAccelerationStructureKHR].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); } else { - type = groupedTypes[OpTypeAccelerationStructureNV].back(); + type = groupedTypes[OpTypeAccelerationStructureKHR].back(); + } + + return type->getResultId(); +} + +Id Builder::makeRayQueryType() +{ + Instruction *type; + if (groupedTypes[OpTypeRayQueryProvisionalKHR].size() == 0) { + type = new Instruction(getUniqueId(), NoType, OpTypeRayQueryProvisionalKHR); + groupedTypes[OpTypeRayQueryProvisionalKHR].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + } else { + type = groupedTypes[OpTypeRayQueryProvisionalKHR].back(); } return type->getResultId(); @@ -1270,7 +1287,8 @@ Function* Builder::makeEntryPoint(const char* entryPoint) // Comments in header Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name, - const std::vector& paramTypes, const std::vector>& decorations, Block **entry) + const std::vector& paramTypes, + const std::vector>& decorations, Block **entry) { // Make the function and initial instructions in it Id typeId = makeFunctionType(returnType, paramTypes); @@ -1373,7 +1391,8 @@ Id Builder::createUndefined(Id type) } // av/vis/nonprivate are unnecessary and illegal for some storage classes. -spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) const +spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) + const { switch (sc) { case spv::StorageClassUniform: @@ -1392,7 +1411,8 @@ spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAc } // Comments in header -void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) +void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, + unsigned int alignment) { Instruction* store = new Instruction(OpStore); store->addIdOperand(lValue); @@ -1495,7 +1515,8 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) // Generate code for spec constants if in spec constant operation // generation mode. if (generatingOpCodeForSpecConst) { - return createSpecConstantOp(OpCompositeExtract, typeId, std::vector(1, composite), std::vector(1, index)); + return createSpecConstantOp(OpCompositeExtract, typeId, std::vector(1, composite), + std::vector(1, index)); } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); @@ -1697,7 +1718,8 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector& opera return op->getResultId(); } -Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& operands, const std::vector& literals) +Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& operands, + const std::vector& literals) { Instruction* op = new Instruction(getUniqueId(), typeId, OpSpecConstantOp); op->addImmediateOperand((unsigned) opCode); @@ -2187,7 +2209,8 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b if (constituent == 0) resultId = subResultId; else - resultId = setPrecision(createBinOp(equal ? OpLogicalAnd : OpLogicalOr, boolType, resultId, subResultId), precision); + resultId = setPrecision(createBinOp(equal ? OpLogicalAnd : OpLogicalOr, boolType, resultId, subResultId), + precision); } return resultId; @@ -2196,7 +2219,8 @@ Id Builder::createCompositeCompare(Decoration precision, Id value1, Id value2, b // OpCompositeConstruct Id Builder::createCompositeConstruct(Id typeId, const std::vector& constituents) { - assert(isAggregateType(typeId) || (getNumTypeConstituents(typeId) > 1 && getNumTypeConstituents(typeId) == (int)constituents.size())); + assert(isAggregateType(typeId) || (getNumTypeConstituents(typeId) > 1 && + getNumTypeConstituents(typeId) == (int)constituents.size())); if (generatingOpCodeForSpecConst) { // Sometime, even in spec-constant-op mode, the constant composite to be @@ -2609,7 +2633,8 @@ void Builder::clearAccessChain() } // Comments in header -void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) +void Builder::accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, + AccessChain::CoherentFlags coherentFlags, unsigned int alignment) { accessChain.coherentFlags |= coherentFlags; accessChain.alignment |= alignment; @@ -2663,7 +2688,8 @@ void Builder::accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess, sp } // Comments in header -Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) +Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resultType, + spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { Id id; @@ -2721,7 +2747,13 @@ Id Builder::accessChainLoad(Decoration precision, Decoration nonUniform, Id resu } // load through the access chain - id = createLoad(collapseAccessChain(), memoryAccess, scope, alignment); + id = collapseAccessChain(); + // Apply nonuniform both to the access chain and the loaded value. + // Buffer accesses need the access chain decorated, and this is where + // loaded image types get decorated. TODO: This should maybe move to + // createImageTextureFunctionCall. + addDecoration(id, nonUniform); + id = createLoad(id, memoryAccess, scope, alignment); setPrecision(id, precision); addDecoration(id, nonUniform); } @@ -3075,7 +3107,8 @@ void Builder::dumpSourceInstructions(std::vector& out) const dumpSourceInstructions(iItr->first, *iItr->second, out); } -void Builder::dumpInstructions(std::vector& out, const std::vector >& instructions) const +void Builder::dumpInstructions(std::vector& out, + const std::vector >& instructions) const { for (int i = 0; i < (int)instructions.size(); ++i) { instructions[i]->dump(out); diff --git a/core/deps/glslang/SPIRV/SpvBuilder.h b/core/deps/glslang/SPIRV/SpvBuilder.h index 31fee975f..71b90d609 100644 --- a/core/deps/glslang/SPIRV/SpvBuilder.h +++ b/core/deps/glslang/SPIRV/SpvBuilder.h @@ -1,7 +1,8 @@ // // Copyright (C) 2014-2015 LunarG, Inc. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2020 Google, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -94,6 +95,7 @@ public: const char* file_c_str = str.c_str(); fileString->addStringOperand(file_c_str); strings.push_back(std::unique_ptr(fileString)); + module.mapInstruction(fileString); stringIds[file_c_str] = strId; return strId; } @@ -181,7 +183,9 @@ public: Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols); // accelerationStructureNV type - Id makeAccelerationStructureNVType(); + Id makeAccelerationStructureType(); + // rayQueryEXT type + Id makeRayQueryType(); // For querying about types. Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } @@ -196,7 +200,8 @@ public: Id getContainedTypeId(Id typeId) const; Id getContainedTypeId(Id typeId, int) const; StorageClass getTypeStorageClass(Id typeId) const { return module.getStorageClass(typeId); } - ImageFormat getImageTypeFormat(Id typeId) const { return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); } + ImageFormat getImageTypeFormat(Id typeId) const + { return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); } bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); } bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); } @@ -206,12 +211,17 @@ public: bool isAggregate(Id resultId) const { return isAggregateType(getTypeId(resultId)); } bool isSampledImage(Id resultId) const { return isSampledImageType(getTypeId(resultId)); } - bool isBoolType(Id typeId) { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } - bool isIntType(Id typeId) const { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) != 0; } - bool isUintType(Id typeId) const { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) == 0; } + bool isBoolType(Id typeId) + { return groupedTypes[OpTypeBool].size() > 0 && typeId == groupedTypes[OpTypeBool].back()->getResultId(); } + bool isIntType(Id typeId) const + { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) != 0; } + bool isUintType(Id typeId) const + { return getTypeClass(typeId) == OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) == 0; } bool isFloatType(Id typeId) const { return getTypeClass(typeId) == OpTypeFloat; } bool isPointerType(Id typeId) const { return getTypeClass(typeId) == OpTypePointer; } - bool isScalarType(Id typeId) const { return getTypeClass(typeId) == OpTypeFloat || getTypeClass(typeId) == OpTypeInt || getTypeClass(typeId) == OpTypeBool; } + bool isScalarType(Id typeId) const + { return getTypeClass(typeId) == OpTypeFloat || getTypeClass(typeId) == OpTypeInt || + getTypeClass(typeId) == OpTypeBool; } bool isVectorType(Id typeId) const { return getTypeClass(typeId) == OpTypeVector; } bool isMatrixType(Id typeId) const { return getTypeClass(typeId) == OpTypeMatrix; } bool isStructType(Id typeId) const { return getTypeClass(typeId) == OpTypeStruct; } @@ -221,7 +231,8 @@ public: #else bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; } #endif - bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); } + bool isAggregateType(Id typeId) const + { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); } bool isImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeImage; } bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; } bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; } @@ -233,7 +244,8 @@ public: bool isConstant(Id resultId) const { return isConstantOpCode(getOpCode(resultId)); } bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; } bool isSpecConstant(Id resultId) const { return isSpecConstantOpCode(getOpCode(resultId)); } - unsigned int getConstantScalar(Id resultId) const { return module.getInstruction(resultId)->getImmediateOperand(0); } + unsigned int getConstantScalar(Id resultId) const + { return module.getInstruction(resultId)->getImmediateOperand(0); } StorageClass getStorageClass(Id resultId) const { return getTypeStorageClass(getTypeId(resultId)); } int getScalarTypeWidth(Id typeId) const @@ -275,14 +287,22 @@ public: // For making new constants (will return old constant if the requested one was already made). Id makeBoolConstant(bool b, bool specConstant = false); - Id makeInt8Constant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(8), (unsigned)i, specConstant); } - Id makeUint8Constant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(8), u, specConstant); } - Id makeInt16Constant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(16), (unsigned)i, specConstant); } - Id makeUint16Constant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(16), u, specConstant); } - Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } - Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); } - Id makeInt64Constant(long long i, bool specConstant = false) { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); } - Id makeUint64Constant(unsigned long long u, bool specConstant = false) { return makeInt64Constant(makeUintType(64), u, specConstant); } + Id makeInt8Constant(int i, bool specConstant = false) + { return makeIntConstant(makeIntType(8), (unsigned)i, specConstant); } + Id makeUint8Constant(unsigned u, bool specConstant = false) + { return makeIntConstant(makeUintType(8), u, specConstant); } + Id makeInt16Constant(int i, bool specConstant = false) + { return makeIntConstant(makeIntType(16), (unsigned)i, specConstant); } + Id makeUint16Constant(unsigned u, bool specConstant = false) + { return makeIntConstant(makeUintType(16), u, specConstant); } + Id makeIntConstant(int i, bool specConstant = false) + { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } + Id makeUintConstant(unsigned u, bool specConstant = false) + { return makeIntConstant(makeUintType(32), u, specConstant); } + Id makeInt64Constant(long long i, bool specConstant = false) + { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); } + Id makeUint64Constant(unsigned long long u, bool specConstant = false) + { return makeInt64Constant(makeUintType(64), u, specConstant); } Id makeFloatConstant(float f, bool specConstant = false); Id makeDoubleConstant(double d, bool specConstant = false); Id makeFloat16Constant(float f16, bool specConstant = false); @@ -313,8 +333,8 @@ public: // Make a shader-style function, and create its entry block if entry is non-zero. // Return the function, pass back the entry. // The returned pointer is only valid for the lifetime of this builder. - Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, const std::vector& paramTypes, - const std::vector>& precisions, Block **entry = 0); + Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name, + const std::vector& paramTypes, const std::vector>& precisions, Block **entry = 0); // Create a return. An 'implicit' return is one not appearing in the source // code. In the case of an implicit return, no post-return block is inserted. @@ -333,10 +353,12 @@ public: Id createUndefined(Id type); // Store into an Id and return the l-value - void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); + void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, + spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // Load from an Id and return it - Id createLoad(Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); + Id createLoad(Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, + spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // Create an OpAccessChain instruction Id createAccessChain(StorageClass, Id base, const std::vector& offsets); @@ -495,7 +517,7 @@ public: // recursion stack can hold the memory for it. // void makeSwitch(Id condition, unsigned int control, int numSegments, const std::vector& caseValues, - const std::vector& valueToSegment, int defaultSegment, std::vector& segmentBB); // return argument + const std::vector& valueToSegment, int defaultSegment, std::vector& segmentBB); // Add a branch to the innermost switch's merge block. void addSwitchBreak(); @@ -512,7 +534,7 @@ public: Block &head, &body, &merge, &continue_target; private: LoopBlocks(); - LoopBlocks& operator=(const LoopBlocks&); + LoopBlocks& operator=(const LoopBlocks&) = delete; }; // Start a new loop and prepare the builder to generate code for it. Until @@ -569,10 +591,13 @@ public: std::vector indexChain; Id instr; // cache the instruction that generates this access chain std::vector swizzle; // each std::vector element selects the next GLSL component number - Id component; // a dynamic component index, can coexist with a swizzle, done after the swizzle, NoResult if not present - Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; NoType unless a swizzle or component is present + Id component; // a dynamic component index, can coexist with a swizzle, + // done after the swizzle, NoResult if not present + Id preSwizzleBaseType; // dereferenced type, before swizzle or component is applied; + // NoType unless a swizzle or component is present bool isRValue; // true if 'base' is an r-value, otherwise, base is an l-value - unsigned int alignment; // bitwise OR of alignment values passed in. Accumulates worst alignment. Only tracks base and (optional) component selection alignment. + unsigned int alignment; // bitwise OR of alignment values passed in. Accumulates worst alignment. + // Only tracks base and (optional) component selection alignment. // Accumulate whether anything in the chain of structures has coherent decorations. struct CoherentFlags { @@ -583,12 +608,17 @@ public: CoherentFlags operator |=(const CoherentFlags &other) { return *this; } #else bool isVolatile() const { return volatil; } + bool anyCoherent() const { + return coherent || devicecoherent || queuefamilycoherent || workgroupcoherent || + subgroupcoherent || shadercallcoherent; + } unsigned coherent : 1; unsigned devicecoherent : 1; unsigned queuefamilycoherent : 1; unsigned workgroupcoherent : 1; unsigned subgroupcoherent : 1; + unsigned shadercallcoherent : 1; unsigned nonprivate : 1; unsigned volatil : 1; unsigned isImage : 1; @@ -599,6 +629,7 @@ public: queuefamilycoherent = 0; workgroupcoherent = 0; subgroupcoherent = 0; + shadercallcoherent = 0; nonprivate = 0; volatil = 0; isImage = 0; @@ -610,6 +641,7 @@ public: queuefamilycoherent |= other.queuefamilycoherent; workgroupcoherent |= other.workgroupcoherent; subgroupcoherent |= other.subgroupcoherent; + shadercallcoherent |= other.shadercallcoherent; nonprivate |= other.nonprivate; volatil |= other.volatil; isImage |= other.isImage; @@ -655,11 +687,13 @@ public: } // push new swizzle onto the end of any existing swizzle, merging into a single swizzle - void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, unsigned int alignment); + void accessChainPushSwizzle(std::vector& swizzle, Id preSwizzleBaseType, + AccessChain::CoherentFlags coherentFlags, unsigned int alignment); // push a dynamic component selection onto the access chain, only applicable with a // non-trivial swizzle or no swizzle - void accessChainPushComponent(Id component, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) + void accessChainPushComponent(Id component, Id preSwizzleBaseType, AccessChain::CoherentFlags coherentFlags, + unsigned int alignment) { if (accessChain.swizzle.size() != 1) { accessChain.component = component; @@ -671,10 +705,18 @@ public: } // use accessChain and swizzle to store value - void accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); + void accessChainStore(Id rvalue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, + spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); // use accessChain and swizzle to load an r-value - Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, unsigned int alignment = 0); + Id accessChainLoad(Decoration precision, Decoration nonUniform, Id ResultType, + spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMaskNone, spv::Scope scope = spv::ScopeMax, + unsigned int alignment = 0); + + // Return whether or not the access chain can be represented in SPIR-V + // as an l-value. + // E.g., a[3].yx cannot be, while a[3].y and a[3].y[x] can be. + bool isSpvLvalue() const { return accessChain.swizzle.size() <= 1; } // get the direct pointer for an l-value Id accessChainGetLValue(); @@ -703,7 +745,8 @@ public: void createBranch(Block* block); void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); - void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, const std::vector& operands); + void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control, + const std::vector& operands); // Sets to generate opcode for specialization constants. void setToSpecConstCodeGenMode() { generatingOpCodeForSpecConst = true; } @@ -729,7 +772,8 @@ public: void dumpSourceInstructions(const spv::Id fileId, const std::string& text, std::vector&) const; void dumpInstructions(std::vector&, const std::vector >&) const; void dumpModuleProcesses(std::vector&) const; - spv::MemoryAccessMask sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) const; + spv::MemoryAccessMask sanitizeMemoryAccessForStorageClass(spv::MemoryAccessMask memoryAccess, StorageClass sc) + const; unsigned int spvVersion; // the version of SPIR-V to emit in the header SourceLanguage source; @@ -764,10 +808,14 @@ public: std::vector > externals; std::vector > functions; - // not output, internally used for quick & dirty canonical (unique) creation - std::unordered_map> groupedConstants; // map type opcodes to constant inst. - std::unordered_map> groupedStructConstants; // map struct-id to constant instructions - std::unordered_map> groupedTypes; // map type opcodes to type instructions + // not output, internally used for quick & dirty canonical (unique) creation + + // map type opcodes to constant inst. + std::unordered_map> groupedConstants; + // map struct-id to constant instructions + std::unordered_map> groupedStructConstants; + // map type opcodes to type instructions + std::unordered_map> groupedTypes; // stack of switches std::stack switchMerges; diff --git a/core/deps/glslang/SPIRV/SpvTools.cpp b/core/deps/glslang/SPIRV/SpvTools.cpp index 7c3b03919..1e968ba54 100644 --- a/core/deps/glslang/SPIRV/SpvTools.cpp +++ b/core/deps/glslang/SPIRV/SpvTools.cpp @@ -1,6 +1,6 @@ // // Copyright (C) 2014-2016 LunarG, Inc. -// Copyright (C) 2018 Google, Inc. +// Copyright (C) 2018-2020 Google, Inc. // // All rights reserved. // @@ -67,6 +67,8 @@ spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLog logger->missingFunctionality("Target version for SPIRV-Tools validator"); return spv_target_env::SPV_ENV_VULKAN_1_1; } + case glslang::EShTargetVulkan_1_2: + return spv_target_env::SPV_ENV_VULKAN_1_2; default: break; } @@ -128,8 +130,8 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector< // Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of // legalizing HLSL SPIR-V. -void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector& spirv, - spv::SpvBuildLogger*, const SpvOptions* options) +void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector& spirv, + spv::SpvBuildLogger* logger, const SpvOptions* options) { spv_target_env target_env = SPV_ENV_UNIVERSAL_1_2; @@ -205,7 +207,8 @@ void SpirvToolsLegalize(const glslang::TIntermediate&, std::vector } spvtools::OptimizerOptions spvOptOptions; - spvOptOptions.set_run_validator(false); // The validator may run as a seperate step later on + optimizer.SetTargetEnv(MapToSpirvToolsEnv(intermediate.getSpv(), logger)); + spvOptOptions.set_run_validator(false); // The validator may run as a separate step later on optimizer.Run(spirv.data(), spirv.size(), &spirv, spvOptOptions); } diff --git a/core/deps/glslang/SPIRV/disassemble.cpp b/core/deps/glslang/SPIRV/disassemble.cpp index 930e79949..4faa89ea3 100644 --- a/core/deps/glslang/SPIRV/disassemble.cpp +++ b/core/deps/glslang/SPIRV/disassemble.cpp @@ -75,6 +75,7 @@ enum ExtInstSet { GLSLextAMDInst, GLSLextNVInst, OpenCLExtInst, + NonSemanticDebugPrintfExtInst, }; // Container class for a single instance of a SPIR-V stream, with methods for disassembly. @@ -480,8 +481,12 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, if (opCode == OpExtInst) { ExtInstSet extInstSet = GLSL450Inst; const char* name = idDescriptor[stream[word - 2]].c_str(); - if (0 == memcmp("OpenCL", name, 6)) { + if (strcmp("OpenCL.std", name) == 0) { extInstSet = OpenCLExtInst; + } else if (strcmp("OpenCL.DebugInfo.100", name) == 0) { + extInstSet = OpenCLExtInst; + } else if (strcmp("NonSemantic.DebugPrintf", name) == 0) { + extInstSet = NonSemanticDebugPrintfExtInst; } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 || strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 || @@ -505,6 +510,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, } else if (extInstSet == GLSLextNVInst) { out << "(" << GLSLextNVGetDebugNames(name, entrypoint) << ")"; + } else if (extInstSet == NonSemanticDebugPrintfExtInst) { + out << "(DebugPrintf)"; } } break; diff --git a/core/deps/glslang/SPIRV/doc.cpp b/core/deps/glslang/SPIRV/doc.cpp index bee5c7972..b1f2b820d 100644 --- a/core/deps/glslang/SPIRV/doc.cpp +++ b/core/deps/glslang/SPIRV/doc.cpp @@ -1,5 +1,6 @@ // // Copyright (C) 2014-2015 LunarG, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -99,12 +100,12 @@ const char* ExecutionModelString(int model) default: return "Bad"; - case ExecutionModelRayGenerationNV: return "RayGenerationNV"; - case ExecutionModelIntersectionNV: return "IntersectionNV"; - case ExecutionModelAnyHitNV: return "AnyHitNV"; - case ExecutionModelClosestHitNV: return "ClosestHitNV"; - case ExecutionModelMissNV: return "MissNV"; - case ExecutionModelCallableNV: return "CallableNV"; + case ExecutionModelRayGenerationKHR: return "RayGenerationKHR"; + case ExecutionModelIntersectionKHR: return "IntersectionKHR"; + case ExecutionModelAnyHitKHR: return "AnyHitKHR"; + case ExecutionModelClosestHitKHR: return "ClosestHitKHR"; + case ExecutionModelMissKHR: return "MissKHR"; + case ExecutionModelCallableKHR: return "CallableKHR"; } } @@ -209,12 +210,12 @@ const char* StorageClassString(int StorageClass) case 11: return "Image"; case 12: return "StorageBuffer"; - case StorageClassRayPayloadNV: return "RayPayloadNV"; - case StorageClassHitAttributeNV: return "HitAttributeNV"; - case StorageClassIncomingRayPayloadNV: return "IncomingRayPayloadNV"; - case StorageClassShaderRecordBufferNV: return "ShaderRecordBufferNV"; - case StorageClassCallableDataNV: return "CallableDataNV"; - case StorageClassIncomingCallableDataNV: return "IncomingCallableDataNV"; + case StorageClassRayPayloadKHR: return "RayPayloadKHR"; + case StorageClassHitAttributeKHR: return "HitAttributeKHR"; + case StorageClassIncomingRayPayloadKHR: return "IncomingRayPayloadKHR"; + case StorageClassShaderRecordBufferKHR: return "ShaderRecordBufferKHR"; + case StorageClassCallableDataKHR: return "CallableDataKHR"; + case StorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR"; case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT"; @@ -361,32 +362,33 @@ const char* BuiltInString(int builtIn) case 4996: return "BaryCoordSmoothCentroidAMD"; case 4997: return "BaryCoordSmoothSampleAMD"; case 4998: return "BaryCoordPullModelAMD"; - case BuiltInLaunchIdNV: return "LaunchIdNV"; - case BuiltInLaunchSizeNV: return "LaunchSizeNV"; - case BuiltInWorldRayOriginNV: return "WorldRayOriginNV"; - case BuiltInWorldRayDirectionNV: return "WorldRayDirectionNV"; - case BuiltInObjectRayOriginNV: return "ObjectRayOriginNV"; - case BuiltInObjectRayDirectionNV: return "ObjectRayDirectionNV"; - case BuiltInRayTminNV: return "RayTminNV"; - case BuiltInRayTmaxNV: return "RayTmaxNV"; - case BuiltInInstanceCustomIndexNV: return "InstanceCustomIndexNV"; - case BuiltInObjectToWorldNV: return "ObjectToWorldNV"; - case BuiltInWorldToObjectNV: return "WorldToObjectNV"; - case BuiltInHitTNV: return "HitTNV"; - case BuiltInHitKindNV: return "HitKindNV"; - case BuiltInIncomingRayFlagsNV: return "IncomingRayFlagsNV"; - case BuiltInViewportMaskNV: return "ViewportMaskNV"; - case BuiltInSecondaryPositionNV: return "SecondaryPositionNV"; - case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; - case BuiltInPositionPerViewNV: return "PositionPerViewNV"; - case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; + case BuiltInLaunchIdKHR: return "LaunchIdKHR"; + case BuiltInLaunchSizeKHR: return "LaunchSizeKHR"; + case BuiltInWorldRayOriginKHR: return "WorldRayOriginKHR"; + case BuiltInWorldRayDirectionKHR: return "WorldRayDirectionKHR"; + case BuiltInObjectRayOriginKHR: return "ObjectRayOriginKHR"; + case BuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR"; + case BuiltInRayTminKHR: return "RayTminKHR"; + case BuiltInRayTmaxKHR: return "RayTmaxKHR"; + case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR"; + case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR"; + case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR"; + case BuiltInWorldToObjectKHR: return "WorldToObjectKHR"; + case BuiltInHitTKHR: return "HitTKHR"; + case BuiltInHitKindKHR: return "HitKindKHR"; + case BuiltInIncomingRayFlagsKHR: return "IncomingRayFlagsKHR"; + case BuiltInViewportMaskNV: return "ViewportMaskNV"; + case BuiltInSecondaryPositionNV: return "SecondaryPositionNV"; + case BuiltInSecondaryViewportMaskNV: return "SecondaryViewportMaskNV"; + case BuiltInPositionPerViewNV: return "PositionPerViewNV"; + case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV"; // case BuiltInFragmentSizeNV: return "FragmentSizeNV"; // superseded by BuiltInFragSizeEXT // case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT - case BuiltInBaryCoordNV: return "BaryCoordNV"; - case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; + case BuiltInBaryCoordNV: return "BaryCoordNV"; + case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; - case BuiltInFragSizeEXT: return "FragSizeEXT"; - case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; + case BuiltInFragSizeEXT: return "FragSizeEXT"; + case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT"; case 5264: return "FullyCoveredEXT"; @@ -890,6 +892,9 @@ const char* CapabilityString(int info) case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; case CapabilityRayTracingNV: return "RayTracingNV"; + case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; + case CapabilityRayQueryProvisionalKHR: return "RayQueryProvisionalKHR"; + case CapabilityRayTraversalPrimitiveCullingProvisionalKHR: return "RayTraversalPrimitiveCullingProvisionalKHR"; case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV"; @@ -1326,15 +1331,40 @@ const char* OpcodeString(int op) case OpMemberDecorateStringGOOGLE: return "OpMemberDecorateStringGOOGLE"; case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV"; - case OpReportIntersectionNV: return "OpReportIntersectionNV"; - case OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; - case OpTerminateRayNV: return "OpTerminateRayNV"; - case OpTraceNV: return "OpTraceNV"; - case OpTypeAccelerationStructureNV: return "OpTypeAccelerationStructureNV"; - case OpExecuteCallableNV: return "OpExecuteCallableNV"; + case OpReportIntersectionKHR: return "OpReportIntersectionKHR"; + case OpIgnoreIntersectionKHR: return "OpIgnoreIntersectionKHR"; + case OpTerminateRayKHR: return "OpTerminateRayKHR"; + case OpTraceRayKHR: return "OpTraceRayKHR"; + case OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; + case OpExecuteCallableKHR: return "OpExecuteCallableKHR"; case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV"; case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV"; + case OpTypeRayQueryProvisionalKHR: return "OpTypeRayQueryProvisionalKHR"; + case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR"; + case OpRayQueryTerminateKHR: return "OpRayQueryTerminateKHR"; + case OpRayQueryGenerateIntersectionKHR: return "OpRayQueryGenerateIntersectionKHR"; + case OpRayQueryConfirmIntersectionKHR: return "OpRayQueryConfirmIntersectionKHR"; + case OpRayQueryProceedKHR: return "OpRayQueryProceedKHR"; + case OpRayQueryGetIntersectionTypeKHR: return "OpRayQueryGetIntersectionTypeKHR"; + case OpRayQueryGetRayTMinKHR: return "OpRayQueryGetRayTMinKHR"; + case OpRayQueryGetRayFlagsKHR: return "OpRayQueryGetRayFlagsKHR"; + case OpRayQueryGetIntersectionTKHR: return "OpRayQueryGetIntersectionTKHR"; + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: return "OpRayQueryGetIntersectionInstanceCustomIndexKHR"; + case OpRayQueryGetIntersectionInstanceIdKHR: return "OpRayQueryGetIntersectionInstanceIdKHR"; + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: return "OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR"; + case OpRayQueryGetIntersectionGeometryIndexKHR: return "OpRayQueryGetIntersectionGeometryIndexKHR"; + case OpRayQueryGetIntersectionPrimitiveIndexKHR: return "OpRayQueryGetIntersectionPrimitiveIndexKHR"; + case OpRayQueryGetIntersectionBarycentricsKHR: return "OpRayQueryGetIntersectionBarycentricsKHR"; + case OpRayQueryGetIntersectionFrontFaceKHR: return "OpRayQueryGetIntersectionFrontFaceKHR"; + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: return "OpRayQueryGetIntersectionCandidateAABBOpaqueKHR"; + case OpRayQueryGetIntersectionObjectRayDirectionKHR: return "OpRayQueryGetIntersectionObjectRayDirectionKHR"; + case OpRayQueryGetIntersectionObjectRayOriginKHR: return "OpRayQueryGetIntersectionObjectRayOriginKHR"; + case OpRayQueryGetWorldRayDirectionKHR: return "OpRayQueryGetWorldRayDirectionKHR"; + case OpRayQueryGetWorldRayOriginKHR: return "OpRayQueryGetWorldRayOriginKHR"; + case OpRayQueryGetIntersectionObjectToWorldKHR: return "OpRayQueryGetIntersectionObjectToWorldKHR"; + case OpRayQueryGetIntersectionWorldToObjectKHR: return "OpRayQueryGetIntersectionWorldToObjectKHR"; + case OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; case OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; case OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; @@ -2694,31 +2724,125 @@ void Parameterize() InstructionDesc[OpGroupNonUniformPartitionNV].operands.push(OperandId, "X"); - InstructionDesc[OpTypeAccelerationStructureNV].setResultAndType(true, false); + InstructionDesc[OpTypeAccelerationStructureKHR].setResultAndType(true, false); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'NV Acceleration Structure'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'Ray Flags'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'Cull Mask'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'SBT Record Offset'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'SBT Record Stride'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'Miss Index'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'Ray Origin'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'TMin'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'Ray Direction'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'TMax'"); - InstructionDesc[OpTraceNV].operands.push(OperandId, "'Payload'"); - InstructionDesc[OpTraceNV].setResultAndType(false, false); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'NV Acceleration Structure'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Ray Flags'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Cull Mask'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Ray Origin'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Ray Direction'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Payload'"); + InstructionDesc[OpTraceRayKHR].setResultAndType(false, false); - InstructionDesc[OpReportIntersectionNV].operands.push(OperandId, "'Hit Parameter'"); - InstructionDesc[OpReportIntersectionNV].operands.push(OperandId, "'Hit Kind'"); + InstructionDesc[OpReportIntersectionKHR].operands.push(OperandId, "'Hit Parameter'"); + InstructionDesc[OpReportIntersectionKHR].operands.push(OperandId, "'Hit Kind'"); - InstructionDesc[OpIgnoreIntersectionNV].setResultAndType(false, false); + InstructionDesc[OpIgnoreIntersectionKHR].setResultAndType(false, false); - InstructionDesc[OpTerminateRayNV].setResultAndType(false, false); + InstructionDesc[OpTerminateRayKHR].setResultAndType(false, false); - InstructionDesc[OpExecuteCallableNV].operands.push(OperandId, "SBT Record Index"); - InstructionDesc[OpExecuteCallableNV].operands.push(OperandId, "CallableData ID"); - InstructionDesc[OpExecuteCallableNV].setResultAndType(false, false); + InstructionDesc[OpExecuteCallableKHR].operands.push(OperandId, "SBT Record Index"); + InstructionDesc[OpExecuteCallableKHR].operands.push(OperandId, "CallableData ID"); + InstructionDesc[OpExecuteCallableKHR].setResultAndType(false, false); + + // Ray Query + InstructionDesc[OpTypeAccelerationStructureKHR].setResultAndType(true, false); + InstructionDesc[OpTypeRayQueryProvisionalKHR].setResultAndType(true, false); + + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'AccelerationS'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'CullMask'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'Origin'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'Tmin'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'Direction'"); + InstructionDesc[OpRayQueryInitializeKHR].operands.push(OperandId, "'Tmax'"); + InstructionDesc[OpRayQueryInitializeKHR].setResultAndType(false, false); + + InstructionDesc[OpRayQueryTerminateKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryTerminateKHR].setResultAndType(false, false); + + InstructionDesc[OpRayQueryGenerateIntersectionKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGenerateIntersectionKHR].operands.push(OperandId, "'THit'"); + InstructionDesc[OpRayQueryGenerateIntersectionKHR].setResultAndType(false, false); + + InstructionDesc[OpRayQueryConfirmIntersectionKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryConfirmIntersectionKHR].setResultAndType(false, false); + + InstructionDesc[OpRayQueryProceedKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryProceedKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionTypeKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionTypeKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionTypeKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetRayTMinKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetRayTMinKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetRayFlagsKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetRayFlagsKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionTKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionTKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionTKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionInstanceCustomIndexKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionInstanceCustomIndexKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionInstanceCustomIndexKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionInstanceIdKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionInstanceIdKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionInstanceIdKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionGeometryIndexKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionGeometryIndexKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionGeometryIndexKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionPrimitiveIndexKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionPrimitiveIndexKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionPrimitiveIndexKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionBarycentricsKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionBarycentricsKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionBarycentricsKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionFrontFaceKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionFrontFaceKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionFrontFaceKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionCandidateAABBOpaqueKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionCandidateAABBOpaqueKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionObjectRayDirectionKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionObjectRayDirectionKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionObjectRayDirectionKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionObjectRayOriginKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionObjectRayOriginKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionObjectRayOriginKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetWorldRayDirectionKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetWorldRayDirectionKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetWorldRayOriginKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetWorldRayOriginKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionObjectToWorldKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionObjectToWorldKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionObjectToWorldKHR].setResultAndType(true, true); + + InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].operands.push(OperandId, "'Committed'"); + InstructionDesc[OpRayQueryGetIntersectionWorldToObjectKHR].setResultAndType(true, true); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Sampled Image'"); InstructionDesc[OpImageSampleFootprintNV].operands.push(OperandId, "'Coordinate'"); diff --git a/core/deps/glslang/SPIRV/hex_float.h b/core/deps/glslang/SPIRV/hex_float.h index 905b21a45..8be8e9f7e 100644 --- a/core/deps/glslang/SPIRV/hex_float.h +++ b/core/deps/glslang/SPIRV/hex_float.h @@ -784,8 +784,8 @@ inline std::istream& ParseNormalFloat(std::istream& is, bool negate_value, if (val.isInfinity()) { // Fail the parse. Emulate standard behaviour by setting the value to // the closest normal value, and set the fail bit on the stream. - value.set_value((value.isNegative() | negate_value) ? T::lowest() - : T::max()); + value.set_value((value.isNegative() || negate_value) ? T::lowest() + : T::max()); is.setstate(std::ios_base::failbit); } return is; diff --git a/core/deps/glslang/SPIRV/spirv.hpp b/core/deps/glslang/SPIRV/spirv.hpp index 1e96f7b4a..dae36cf20 100644 --- a/core/deps/glslang/SPIRV/spirv.hpp +++ b/core/deps/glslang/SPIRV/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2019 The Khronos Group Inc. +// Copyright (c) 2014-2020 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -49,12 +49,12 @@ namespace spv { typedef unsigned int Id; -#define SPV_VERSION 0x10400 -#define SPV_REVISION 1 +#define SPV_VERSION 0x10500 +#define SPV_REVISION 3 static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010400; -static const unsigned int Revision = 1; +static const unsigned int Version = 0x00010500; +static const unsigned int Revision = 3; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -78,11 +78,17 @@ enum ExecutionModel { ExecutionModelKernel = 6, ExecutionModelTaskNV = 5267, ExecutionModelMeshNV = 5268, + ExecutionModelRayGenerationKHR = 5313, ExecutionModelRayGenerationNV = 5313, + ExecutionModelIntersectionKHR = 5314, ExecutionModelIntersectionNV = 5314, + ExecutionModelAnyHitKHR = 5315, ExecutionModelAnyHitNV = 5315, + ExecutionModelClosestHitKHR = 5316, ExecutionModelClosestHitNV = 5316, + ExecutionModelMissKHR = 5317, ExecutionModelMissNV = 5317, + ExecutionModelCallableKHR = 5318, ExecutionModelCallableNV = 5318, ExecutionModelMax = 0x7fffffff, }; @@ -179,11 +185,17 @@ enum StorageClass { StorageClassAtomicCounter = 10, StorageClassImage = 11, StorageClassStorageBuffer = 12, + StorageClassCallableDataKHR = 5328, StorageClassCallableDataNV = 5328, + StorageClassIncomingCallableDataKHR = 5329, StorageClassIncomingCallableDataNV = 5329, + StorageClassRayPayloadKHR = 5338, StorageClassRayPayloadNV = 5338, + StorageClassHitAttributeKHR = 5339, StorageClassHitAttributeNV = 5339, + StorageClassIncomingRayPayloadKHR = 5342, StorageClassIncomingRayPayloadNV = 5342, + StorageClassShaderRecordBufferKHR = 5343, StorageClassShaderRecordBufferNV = 5343, StorageClassPhysicalStorageBuffer = 5349, StorageClassPhysicalStorageBufferEXT = 5349, @@ -558,20 +570,35 @@ enum BuiltIn { BuiltInFragmentSizeNV = 5292, BuiltInFragInvocationCountEXT = 5293, BuiltInInvocationsPerPixelNV = 5293, + BuiltInLaunchIdKHR = 5319, BuiltInLaunchIdNV = 5319, + BuiltInLaunchSizeKHR = 5320, BuiltInLaunchSizeNV = 5320, + BuiltInWorldRayOriginKHR = 5321, BuiltInWorldRayOriginNV = 5321, + BuiltInWorldRayDirectionKHR = 5322, BuiltInWorldRayDirectionNV = 5322, + BuiltInObjectRayOriginKHR = 5323, BuiltInObjectRayOriginNV = 5323, + BuiltInObjectRayDirectionKHR = 5324, BuiltInObjectRayDirectionNV = 5324, + BuiltInRayTminKHR = 5325, BuiltInRayTminNV = 5325, + BuiltInRayTmaxKHR = 5326, BuiltInRayTmaxNV = 5326, + BuiltInInstanceCustomIndexKHR = 5327, BuiltInInstanceCustomIndexNV = 5327, + BuiltInObjectToWorldKHR = 5330, BuiltInObjectToWorldNV = 5330, + BuiltInWorldToObjectKHR = 5331, BuiltInWorldToObjectNV = 5331, + BuiltInHitTKHR = 5332, BuiltInHitTNV = 5332, + BuiltInHitKindKHR = 5333, BuiltInHitKindNV = 5333, + BuiltInIncomingRayFlagsKHR = 5351, BuiltInIncomingRayFlagsNV = 5351, + BuiltInRayGeometryIndexKHR = 5352, BuiltInWarpsPerSMNV = 5374, BuiltInSMCountNV = 5375, BuiltInWarpIDNV = 5376, @@ -709,6 +736,7 @@ enum Scope { ScopeInvocation = 4, ScopeQueueFamily = 5, ScopeQueueFamilyKHR = 5, + ScopeShaderCallKHR = 6, ScopeMax = 0x7fffffff, }; @@ -833,6 +861,8 @@ enum Capability { CapabilitySignedZeroInfNanPreserve = 4466, CapabilityRoundingModeRTE = 4467, CapabilityRoundingModeRTZ = 4468, + CapabilityRayQueryProvisionalKHR = 4471, + CapabilityRayTraversalPrimitiveCullingProvisionalKHR = 4478, CapabilityFloat16ImageAMD = 5008, CapabilityImageGatherBiasLodAMD = 5009, CapabilityFragmentMaskAMD = 5010, @@ -886,6 +916,7 @@ enum Capability { CapabilityPhysicalStorageBufferAddresses = 5347, CapabilityPhysicalStorageBufferAddressesEXT = 5347, CapabilityComputeDerivativeGroupLinearNV = 5350, + CapabilityRayTracingProvisionalKHR = 5353, CapabilityCooperativeMatrixNV = 5357, CapabilityFragmentShaderSampleInterlockEXT = 5363, CapabilityFragmentShaderShadingRateInterlockEXT = 5372, @@ -903,6 +934,53 @@ enum Capability { CapabilityMax = 0x7fffffff, }; +enum RayFlagsShift { + RayFlagsOpaqueKHRShift = 0, + RayFlagsNoOpaqueKHRShift = 1, + RayFlagsTerminateOnFirstHitKHRShift = 2, + RayFlagsSkipClosestHitShaderKHRShift = 3, + RayFlagsCullBackFacingTrianglesKHRShift = 4, + RayFlagsCullFrontFacingTrianglesKHRShift = 5, + RayFlagsCullOpaqueKHRShift = 6, + RayFlagsCullNoOpaqueKHRShift = 7, + RayFlagsSkipTrianglesKHRShift = 8, + RayFlagsSkipAABBsKHRShift = 9, + RayFlagsMax = 0x7fffffff, +}; + +enum RayFlagsMask { + RayFlagsMaskNone = 0, + RayFlagsOpaqueKHRMask = 0x00000001, + RayFlagsNoOpaqueKHRMask = 0x00000002, + RayFlagsTerminateOnFirstHitKHRMask = 0x00000004, + RayFlagsSkipClosestHitShaderKHRMask = 0x00000008, + RayFlagsCullBackFacingTrianglesKHRMask = 0x00000010, + RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020, + RayFlagsCullOpaqueKHRMask = 0x00000040, + RayFlagsCullNoOpaqueKHRMask = 0x00000080, + RayFlagsSkipTrianglesKHRMask = 0x00000100, + RayFlagsSkipAABBsKHRMask = 0x00000200, +}; + +enum RayQueryIntersection { + RayQueryIntersectionRayQueryCandidateIntersectionKHR = 0, + RayQueryIntersectionRayQueryCommittedIntersectionKHR = 1, + RayQueryIntersectionMax = 0x7fffffff, +}; + +enum RayQueryCommittedIntersectionType { + RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0, + RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1, + RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2, + RayQueryCommittedIntersectionTypeMax = 0x7fffffff, +}; + +enum RayQueryCandidateIntersectionType { + RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0, + RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1, + RayQueryCandidateIntersectionTypeMax = 0x7fffffff, +}; + enum Op { OpNop = 0, OpUndef = 1, @@ -1254,6 +1332,13 @@ enum Op { OpSubgroupAnyKHR = 4429, OpSubgroupAllEqualKHR = 4430, OpSubgroupReadInvocationKHR = 4432, + OpTypeRayQueryProvisionalKHR = 4472, + OpRayQueryInitializeKHR = 4473, + OpRayQueryTerminateKHR = 4474, + OpRayQueryGenerateIntersectionKHR = 4475, + OpRayQueryConfirmIntersectionKHR = 4476, + OpRayQueryProceedKHR = 4477, + OpRayQueryGetIntersectionTypeKHR = 4479, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -1268,11 +1353,17 @@ enum Op { OpImageSampleFootprintNV = 5283, OpGroupNonUniformPartitionNV = 5296, OpWritePackedPrimitiveIndices4x8NV = 5299, + OpReportIntersectionKHR = 5334, OpReportIntersectionNV = 5334, + OpIgnoreIntersectionKHR = 5335, OpIgnoreIntersectionNV = 5335, + OpTerminateRayKHR = 5336, OpTerminateRayNV = 5336, OpTraceNV = 5337, + OpTraceRayKHR = 5337, + OpTypeAccelerationStructureKHR = 5341, OpTypeAccelerationStructureNV = 5341, + OpExecuteCallableKHR = 5344, OpExecuteCallableNV = 5344, OpTypeCooperativeMatrixNV = 5358, OpCooperativeMatrixLoadNV = 5359, @@ -1429,6 +1520,23 @@ enum Op { OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814, OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815, OpSubgroupAvcSicGetInterRawSadsINTEL = 5816, + OpRayQueryGetRayTMinKHR = 6016, + OpRayQueryGetRayFlagsKHR = 6017, + OpRayQueryGetIntersectionTKHR = 6018, + OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019, + OpRayQueryGetIntersectionInstanceIdKHR = 6020, + OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021, + OpRayQueryGetIntersectionGeometryIndexKHR = 6022, + OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023, + OpRayQueryGetIntersectionBarycentricsKHR = 6024, + OpRayQueryGetIntersectionFrontFaceKHR = 6025, + OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026, + OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027, + OpRayQueryGetIntersectionObjectRayOriginKHR = 6028, + OpRayQueryGetWorldRayDirectionKHR = 6029, + OpRayQueryGetWorldRayOriginKHR = 6030, + OpRayQueryGetIntersectionObjectToWorldKHR = 6031, + OpRayQueryGetIntersectionWorldToObjectKHR = 6032, OpMax = 0x7fffffff, }; @@ -1787,6 +1895,13 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; + case OpTypeRayQueryProvisionalKHR: *hasResult = true; *hasResultType = false; break; + case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break; + case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break; case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -1960,6 +2075,23 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break; case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break; case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break; + case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break; } } #endif /* SPV_ENABLE_UTILITY_CODE */ @@ -1974,6 +2106,7 @@ inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); } inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); } inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); } +inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); } } // end namespace spv diff --git a/core/deps/glslang/SPIRV/spvIR.h b/core/deps/glslang/SPIRV/spvIR.h index cf6a71159..6523035e7 100755 --- a/core/deps/glslang/SPIRV/spvIR.h +++ b/core/deps/glslang/SPIRV/spvIR.h @@ -235,8 +235,7 @@ public: assert(instructions.size() > 0); instructions.resize(1); successors.clear(); - Instruction* unreachable = new Instruction(OpUnreachable); - addInstruction(std::unique_ptr(unreachable)); + addInstruction(std::unique_ptr(new Instruction(OpUnreachable))); } // Change this block into a canonical dead continue target branching to the // given header ID. Delete instructions as necessary. A canonical dead continue diff --git a/core/deps/glslang/StandAlone/CMakeLists.txt b/core/deps/glslang/StandAlone/CMakeLists.txt index 2cf2899c4..591ac340a 100644 --- a/core/deps/glslang/StandAlone/CMakeLists.txt +++ b/core/deps/glslang/StandAlone/CMakeLists.txt @@ -1,5 +1,6 @@ add_library(glslang-default-resource-limits - ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp) + ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/resource_limits_c.cpp) set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON) diff --git a/core/deps/glslang/StandAlone/StandAlone.cpp b/core/deps/glslang/StandAlone/StandAlone.cpp index c869fb129..a7ce53d4f 100644 --- a/core/deps/glslang/StandAlone/StandAlone.cpp +++ b/core/deps/glslang/StandAlone/StandAlone.cpp @@ -1,6 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2016-2020 Google, Inc. // // All rights reserved. // @@ -204,7 +205,7 @@ public: text.append("#define "); fixLine(def); - Processes.push_back("D"); + Processes.push_back("define-macro "); Processes.back().append(def); // The first "=" needs to turn into a space @@ -222,7 +223,7 @@ public: text.append("#undef "); fixLine(undef); - Processes.push_back("U"); + Processes.push_back("undef-macro "); Processes.back().append(undef); text.append(undef); @@ -241,6 +242,7 @@ protected: std::string text; // contents of preamble }; +// Track the user's #define and #undef from the command line. TPreamble UserPreamble; // @@ -257,12 +259,12 @@ const char* GetBinaryName(EShLanguage stage) case EShLangGeometry: name = "geom.spv"; break; case EShLangFragment: name = "frag.spv"; break; case EShLangCompute: name = "comp.spv"; break; - case EShLangRayGenNV: name = "rgen.spv"; break; - case EShLangIntersectNV: name = "rint.spv"; break; - case EShLangAnyHitNV: name = "rahit.spv"; break; - case EShLangClosestHitNV: name = "rchit.spv"; break; - case EShLangMissNV: name = "rmiss.spv"; break; - case EShLangCallableNV: name = "rcall.spv"; break; + case EShLangRayGen: name = "rgen.spv"; break; + case EShLangIntersect: name = "rint.spv"; break; + case EShLangAnyHit: name = "rahit.spv"; break; + case EShLangClosestHit: name = "rchit.spv"; break; + case EShLangMiss: name = "rmiss.spv"; break; + case EShLangCallable: name = "rcall.spv"; break; case EShLangMeshNV: name = "mesh.spv"; break; case EShLangTaskNV: name = "task.spv"; break; default: name = "unknown"; break; @@ -500,6 +502,13 @@ void ProcessArguments(std::vector>& workItem } else Error("expects vulkan100 or opengl100", lowerword.c_str()); bumpArg(); + } else if (lowerword == "define-macro" || + lowerword == "d") { + if (argc > 1) + UserPreamble.addDef(argv[1]); + else + Error("expects ", argv[0]); + bumpArg(); } else if (lowerword == "dump-builtin-symbols") { DumpBuiltinSymbols = true; } else if (lowerword == "entry-point") { @@ -601,6 +610,9 @@ void ProcessArguments(std::vector>& workItem } else if (strcmp(argv[1], "vulkan1.1") == 0) { setVulkanSpv(); ClientVersion = glslang::EShTargetVulkan_1_1; + } else if (strcmp(argv[1], "vulkan1.2") == 0) { + setVulkanSpv(); + ClientVersion = glslang::EShTargetVulkan_1_2; } else if (strcmp(argv[1], "opengl") == 0) { setOpenGlSpv(); ClientVersion = glslang::EShTargetOpenGL_450; @@ -623,10 +635,17 @@ void ProcessArguments(std::vector>& workItem TargetLanguage = glslang::EShTargetSpv; TargetVersion = glslang::EShTargetSpv_1_5; } else - Error("--target-env expected one of: vulkan1.0, vulkan1.1, opengl,\n" + Error("--target-env expected one of: vulkan1.0, vulkan1.1, vulkan1.2, opengl,\n" "spirv1.0, spirv1.1, spirv1.2, spirv1.3, spirv1.4, or spirv1.5"); } bumpArg(); + } else if (lowerword == "undef-macro" || + lowerword == "u") { + if (argc > 1) + UserPreamble.addUndef(argv[1]); + else + Error("expects ", argv[0]); + bumpArg(); } else if (lowerword == "variable-name" || // synonyms lowerword == "vn") { Options |= EOptionOutputHexadecimal; @@ -637,6 +656,9 @@ void ProcessArguments(std::vector>& workItem break; } else if (lowerword == "version") { Options |= EOptionDumpVersions; + } else if (lowerword == "help") { + usage(); + break; } else { Error("unrecognized command-line option", argv[0]); } @@ -649,7 +671,7 @@ void ProcessArguments(std::vector>& workItem if (argv[0][2] == 0) Options |= EOptionReadHlsl; else - UserPreamble.addDef(getStringOperand("-D macro name")); + UserPreamble.addDef(getStringOperand("-D")); break; case 'u': uniformLocationOverrides.push_back(getUniformOverride()); @@ -692,7 +714,7 @@ void ProcessArguments(std::vector>& workItem bumpArg(); break; case 'U': - UserPreamble.addUndef(getStringOperand("-U: macro name")); + UserPreamble.addUndef(getStringOperand("-U")); break; case 'V': setVulkanSpv(); @@ -811,6 +833,10 @@ void ProcessArguments(std::vector>& workItem TargetLanguage = glslang::EShTargetSpv; TargetVersion = glslang::EShTargetSpv_1_3; break; + case glslang::EShTargetVulkan_1_2: + TargetLanguage = glslang::EShTargetSpv; + TargetVersion = glslang::EShTargetSpv_1_5; + break; case glslang::EShTargetOpenGL_450: TargetLanguage = glslang::EShTargetSpv; TargetVersion = glslang::EShTargetSpv_1_0; @@ -1114,7 +1140,6 @@ void CompileAndLinkShaderUnits(std::vector compUnits) for (int stage = 0; stage < EShLangCount; ++stage) { if (program.getIntermediate((EShLanguage)stage)) { std::vector spirv; - std::string warningsErrors; spv::SpvBuildLogger logger; glslang::SpvOptions spvOptions; if (Options & EOptionDebug) @@ -1404,17 +1429,17 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName) else if (stageName == "comp") return EShLangCompute; else if (stageName == "rgen") - return EShLangRayGenNV; + return EShLangRayGen; else if (stageName == "rint") - return EShLangIntersectNV; + return EShLangIntersect; else if (stageName == "rahit") - return EShLangAnyHitNV; + return EShLangAnyHit; else if (stageName == "rchit") - return EShLangClosestHitNV; + return EShLangClosestHit; else if (stageName == "rmiss") - return EShLangMissNV; + return EShLangMiss; else if (stageName == "rcall") - return EShLangCallableNV; + return EShLangCallable; else if (stageName == "mesh") return EShLangMeshNV; else if (stageName == "task") @@ -1502,8 +1527,8 @@ void usage() "Options:\n" " -C cascading errors; risk crash from accumulation of error recoveries\n" " -D input is HLSL (this is the default when any suffix is .hlsl)\n" - " -D\n" - " -D define a pre-processor macro\n" + " -D | --define-macro | --D \n" + " define a pre-processor macro\n" " -E print pre-processed GLSL; cannot be used with -l;\n" " errors will appear on stderr\n" " -G[ver] create SPIR-V binary, under OpenGL semantics; turns on -l;\n" @@ -1519,7 +1544,8 @@ void usage() " -Os optimizes SPIR-V to minimize size\n" " -S uses specified stage rather than parsing the file extension\n" " choices for are vert, tesc, tese, geom, frag, or comp\n" - " -U undefine a pre-processor macro\n" + " -U | --undef-macro | --U \n" + " undefine a pre-processor macro\n" " -V[ver] create SPIR-V binary, under Vulkan semantics; turns on -l;\n" " default file name is .spv (-o overrides this)\n" " 'ver', when present, is the version of the input semantics,\n" @@ -1625,16 +1651,17 @@ void usage() " --sep synonym for --source-entrypoint\n" " --stdin read from stdin instead of from a file;\n" " requires providing the shader stage using -S\n" - " --target-env {vulkan1.0 | vulkan1.1 | opengl | \n" + " --target-env {vulkan1.0 | vulkan1.1 | vulkan1.2 | opengl | \n" " spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3 | spirv1.4 | spirv1.5}\n" - " set execution environment that emitted code\n" - " will execute in (versus source language\n" - " semantics selected by --client) defaults:\n" - " * 'vulkan1.0' under '--client vulkan'\n" - " * 'opengl' under '--client opengl'\n" - " * 'spirv1.0' under --target-env vulkan1.0\n" - " * 'spirv1.3' under --target-env vulkan1.1\n" - " multiple --targen-env can be specified.\n" + " Set the execution environment that the\n" + " generated code will be executed in.\n" + " Defaults to:\n" + " * vulkan1.0 under --client vulkan\n" + " * opengl under --client opengl\n" + " * spirv1.0 under --target-env vulkan1.0\n" + " * spirv1.3 under --target-env vulkan1.1\n" + " * spirv1.5 under --target-env vulkan1.2\n" + " Multiple --target-env can be specified.\n" " --variable-name \n" " --vn creates a C header file that contains a\n" " uint32_t array named \n" diff --git a/core/deps/glslang/StandAlone/resource_limits_c.cpp b/core/deps/glslang/StandAlone/resource_limits_c.cpp new file mode 100644 index 000000000..a1f681c7b --- /dev/null +++ b/core/deps/glslang/StandAlone/resource_limits_c.cpp @@ -0,0 +1,65 @@ +/** +BSD 2-Clause License + +Copyright (c) 2020, Travis Fort +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +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 HOLDER 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. +**/ + +#include "resource_limits_c.h" +#include "ResourceLimits.h" +#include +#include +#include + +const glslang_resource_t* glslang_default_resource(void) +{ + return reinterpret_cast(&glslang::DefaultTBuiltInResource); +} + +#if defined(__clang__) || defined(__GNUC__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#elif defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable : 4996) +#endif + +const char* glslang_default_resource_string() +{ + std::string cpp_str = glslang::GetDefaultTBuiltInResourceString(); + char* c_str = (char*)malloc(cpp_str.length() + 1); + strcpy(c_str, cpp_str.c_str()); + return c_str; +} + +#if defined(__clang__) || defined(__GNUC__) +#pragma GCC diagnostic pop +#elif defined(_MSC_VER) +#pragma warning(pop) +#endif + +void glslang_decode_resource_limits(glslang_resource_t* resources, char* config) +{ + glslang::DecodeResourceLimits(reinterpret_cast(resources), config); +} diff --git a/core/deps/glslang/StandAlone/resource_limits_c.h b/core/deps/glslang/StandAlone/resource_limits_c.h new file mode 100644 index 000000000..108fd5e21 --- /dev/null +++ b/core/deps/glslang/StandAlone/resource_limits_c.h @@ -0,0 +1,54 @@ +/** +BSD 2-Clause License + +Copyright (c) 2020, Travis Fort +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +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 HOLDER 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. +**/ + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ + +#include "../glslang/Include/glslang_c_interface.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +const glslang_resource_t* glslang_default_resource(void); + +// Returns the DefaultTBuiltInResource as a human-readable string. +// NOTE: User is responsible for freeing this string. +const char* glslang_default_resource_string(); + +// Decodes the resource limits from |config| to |resources|. +void glslang_decode_resource_limits(glslang_resource_t* resources, char* config); + +#ifdef __cplusplus +} +#endif + +#endif // _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_ diff --git a/core/deps/glslang/StandAlone/spirv-remap.cpp b/core/deps/glslang/StandAlone/spirv-remap.cpp index 5e2ed0aea..48878c3af 100644 --- a/core/deps/glslang/StandAlone/spirv-remap.cpp +++ b/core/deps/glslang/StandAlone/spirv-remap.cpp @@ -334,8 +334,6 @@ int main(int argc, char** argv) if (outputDir.empty()) usage(argv[0], "Output directory required"); - std::string errmsg; - // Main operations: read, remap, and write. execute(inputFile, outputDir, opts, verbosity); diff --git a/core/deps/glslang/Test/100.frag b/core/deps/glslang/Test/100.frag index a40d73f80..0508ea999 100644 --- a/core/deps/glslang/Test/100.frag +++ b/core/deps/glslang/Test/100.frag @@ -1,230 +1,230 @@ -// okay -#version 100 -int a[3] = { 2, 3, 4, }; // ERROR (lots) -#version 100 -int uint; - -attribute vec4 v[3]; // ERROR - -float f = 2; // ERROR - -uniform block { // ERROR - int x; -}; - -void foo(float); - -void main() -{ - foo(3); // ERROR - int s = 1 << 4; // ERROR - s = 16 >> 2; // ERROR - if (a == a); // ERROR - int b, c; - b = c & 4; // ERROR - b = c % 4; // ERROR - b = c | 4; // ERROR - b >>= 2; // ERROR - b <<= 2; // ERROR - b %= 3; // ERROR - - struct S { - float f; - float a[10]; - } s1, s2; - - s1 = s2; // ERROR - if (s1 == s2); // ERROR - if (s1 != s2); // ERROR - - switch(b) { // ERROR - } -} - -invariant gl_FragColor; -float fa[]; // ERROR -float f13; -invariant f13; // ERROR -struct S { int a; }; -invariant S; // ERROR, not an input or output -invariant float fi; // ERROR -varying vec4 av; -invariant av; // okay in v100 - -void foo10() -{ - invariant f; // ERROR - invariant float f2; // ERROR - float f3; - invariant f3; // ERROR -} - -uniform vec2 uv2; -invariant uv2; // ERROR -invariant uniform vec3 uv3; // ERROR - -sampler2D glob2D; // ERROR -void f11(sampler2D p2d) -{ - sampler2D v2D; // ERROR -} -varying sampler2D vary2D; // ERROR - -struct sp { - highp float f; - in float g; // ERROR - uniform float h; // ERROR - invariant float i; // ERROR -}; - -uniform sampler3D s3D; // ERROR - -#extension GL_OES_texture_3D : enable - -precision highp sampler3D; -uniform sampler3D s3D2; - -void foo234() -{ - texture3D(s3D2, vec3(0.2), 0.2); - texture3DProj(s3D2, v[1], 0.4); - dFdx(v[0]); // ERROR - dFdy(3.2); // ERROR - fwidth(f13); // ERROR -} - -#extension GL_OES_standard_derivatives : enable - -void foo236() -{ - dFdx(v[0]); - dFdy(3.2); - fwidth(f13); - gl_FragDepth = f13; // ERROR - gl_FragDepthEXT = f13; // ERROR -} - -#extension GL_EXT_frag_depth : enable - -void foo239() -{ - gl_FragDepth = f13; // ERROR - gl_FragDepthEXT = f13; -} - -#extension GL_OES_EGL_image_external : enable - -uniform samplerExternalOES sExt; - -void foo245() -{ - texture2D(sExt, vec2(0.2)); - texture2DProj(sExt, vec3(f13)); - texture2DProj(sExt, v[2]); -} - -precision mediump samplerExternalOES; -uniform samplerExternalOES mediumExt; -uniform highp samplerExternalOES highExt; - -void foo246() -{ - texture2D(mediumExt, vec2(0.2)); - texture2DProj(highExt, v[2]); - texture3D(sExt, vec3(f13)); // ERROR - texture2DProjLod(sExt, vec3(f13), f13); // ERROR - int a; - ~a; // ERROR - a | a; // ERROR - a & a; // ERROR -} - -#extension GL_OES_EGL_image_external : disable -uniform sampler2D s2Dg; - -int foo203940(int a, float b, float a) // ERROR, a redefined -{ - texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2); // ERROR, extension not enabled - return a; -} - -float f123 = 4.0f; // ERROR -float f124 = 5e10F; // ERROR - -#extension GL_EXT_shader_texture_lod : enable - -uniform samplerCube sCube; - -void foo323433() -{ - texture2DLodEXT(s2Dg, uv2, f13); - texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2); - texture2DGradEXT(s2Dg, uv2, uv2, uv2); - textureCubeGradEXT(sCube, vec3(f13), vec3(f13), vec3(f13)); -} - -int fgfg(float f, mediump int i); -int fgfg(float f, highp int i) { return 2; } // ERROR, precision qualifier difference - -int fffg(float f); -int fffg(float f); // ERROR, can't have multiple prototypes - -int gggf(float f); -int gggf(float f) { return 2; } - -int agggf(float f) { return 2; } -int agggf(float f); -int agggf(float f); // ERROR, second prototype - -varying struct SSS { float f; } s; // ERROR - -int vf(void); -int vf2(); -int vf3(void v); // ERROR -int vf4(int, void); // ERROR -int vf5(int, void v); // ERROR - -void badswizzle() -{ - vec3 a[5]; - a.y; // ERROR, no array swizzle - a.zy; // ERROR, no array swizzle - a.nothing; // ERROR - a.length(); // ERROR, not this version - a.method(); // ERROR -} - -float fooinit(); - -float fooinittest() -{ - return fooinit(); -} - -// Test extra-function initializers -const float fi1 = 3.0; -const float fi2 = 4.0; -const float fi3 = 5.0; - -float fooinit() -{ - return fi1 + fi2 + fi3; // should make a constant of 12.0 -} - -int init1 = gl_FrontFacing ? 1 : 2; // ERROR, non-const initializer - -#ifdef GL_EXT_shader_non_constant_global_initializers -#extension GL_EXT_shader_non_constant_global_initializers : enable -#endif - -int init2 = gl_FrontFacing ? 1 : 2; - -#define A__B // error -int a__b; // error - -#pragma STDGL invariant(all) - -#line 3000 -#error line of this error should be 3000 - -uniform samplerExternalOES badExt; // syntax ERROR +// okay +#version 100 +int a[3] = { 2, 3, 4, }; // ERROR (lots) +#version 100 +int uint; + +attribute vec4 v[3]; // ERROR + +float f = 2; // ERROR + +uniform block { // ERROR + int x; +}; + +void foo(float); + +void main() +{ + foo(3); // ERROR + int s = 1 << 4; // ERROR + s = 16 >> 2; // ERROR + if (a == a); // ERROR + int b, c; + b = c & 4; // ERROR + b = c % 4; // ERROR + b = c | 4; // ERROR + b >>= 2; // ERROR + b <<= 2; // ERROR + b %= 3; // ERROR + + struct S { + float f; + float a[10]; + } s1, s2; + + s1 = s2; // ERROR + if (s1 == s2); // ERROR + if (s1 != s2); // ERROR + + switch(b) { // ERROR + } +} + +invariant gl_FragColor; +float fa[]; // ERROR +float f13; +invariant f13; // ERROR +struct S { int a; }; +invariant S; // ERROR, not an input or output +invariant float fi; // ERROR +varying vec4 av; +invariant av; // okay in v100 + +void foo10() +{ + invariant f; // ERROR + invariant float f2; // ERROR + float f3; + invariant f3; // ERROR +} + +uniform vec2 uv2; +invariant uv2; // ERROR +invariant uniform vec3 uv3; // ERROR + +sampler2D glob2D; // ERROR +void f11(sampler2D p2d) +{ + sampler2D v2D; // ERROR +} +varying sampler2D vary2D; // ERROR + +struct sp { + highp float f; + in float g; // ERROR + uniform float h; // ERROR + invariant float i; // ERROR +}; + +uniform sampler3D s3D; // ERROR + +#extension GL_OES_texture_3D : enable + +precision highp sampler3D; +uniform sampler3D s3D2; + +void foo234() +{ + texture3D(s3D2, vec3(0.2), 0.2); + texture3DProj(s3D2, v[1], 0.4); + dFdx(v[0]); // ERROR + dFdy(3.2); // ERROR + fwidth(f13); // ERROR +} + +#extension GL_OES_standard_derivatives : enable + +void foo236() +{ + dFdx(v[0]); + dFdy(3.2); + fwidth(f13); + gl_FragDepth = f13; // ERROR + gl_FragDepthEXT = f13; // ERROR +} + +#extension GL_EXT_frag_depth : enable + +void foo239() +{ + gl_FragDepth = f13; // ERROR + gl_FragDepthEXT = f13; +} + +#extension GL_OES_EGL_image_external : enable + +uniform samplerExternalOES sExt; + +void foo245() +{ + texture2D(sExt, vec2(0.2)); + texture2DProj(sExt, vec3(f13)); + texture2DProj(sExt, v[2]); +} + +precision mediump samplerExternalOES; +uniform samplerExternalOES mediumExt; +uniform highp samplerExternalOES highExt; + +void foo246() +{ + texture2D(mediumExt, vec2(0.2)); + texture2DProj(highExt, v[2]); + texture3D(sExt, vec3(f13)); // ERROR + texture2DProjLod(sExt, vec3(f13), f13); // ERROR + int a; + ~a; // ERROR + a | a; // ERROR + a & a; // ERROR +} + +#extension GL_OES_EGL_image_external : disable +uniform sampler2D s2Dg; + +int foo203940(int a, float b, float a) // ERROR, a redefined +{ + texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2); // ERROR, extension not enabled + return a; +} + +float f123 = 4.0f; // ERROR +float f124 = 5e10F; // ERROR + +#extension GL_EXT_shader_texture_lod : enable + +uniform samplerCube sCube; + +void foo323433() +{ + texture2DLodEXT(s2Dg, uv2, f13); + texture2DProjGradEXT(s2Dg, vec3(f13), uv2, uv2); + texture2DGradEXT(s2Dg, uv2, uv2, uv2); + textureCubeGradEXT(sCube, vec3(f13), vec3(f13), vec3(f13)); +} + +int fgfg(float f, mediump int i); +int fgfg(float f, highp int i) { return 2; } // ERROR, precision qualifier difference + +int fffg(float f); +int fffg(float f); // ERROR, can't have multiple prototypes + +int gggf(float f); +int gggf(float f) { return 2; } + +int agggf(float f) { return 2; } +int agggf(float f); +int agggf(float f); // ERROR, second prototype + +varying struct SSS { float f; } s; // ERROR + +int vf(void); +int vf2(); +int vf3(void v); // ERROR +int vf4(int, void); // ERROR +int vf5(int, void v); // ERROR + +void badswizzle() +{ + vec3 a[5]; + a.y; // ERROR, no array swizzle + a.zy; // ERROR, no array swizzle + a.nothing; // ERROR + a.length(); // ERROR, not this version + a.method(); // ERROR +} + +float fooinit(); + +float fooinittest() +{ + return fooinit(); +} + +// Test extra-function initializers +const float fi1 = 3.0; +const float fi2 = 4.0; +const float fi3 = 5.0; + +float fooinit() +{ + return fi1 + fi2 + fi3; // should make a constant of 12.0 +} + +int init1 = gl_FrontFacing ? 1 : 2; // ERROR, non-const initializer + +#ifdef GL_EXT_shader_non_constant_global_initializers +#extension GL_EXT_shader_non_constant_global_initializers : enable +#endif + +int init2 = gl_FrontFacing ? 1 : 2; + +#define A__B // error +int a__b; // error + +#pragma STDGL invariant(all) + +#line 3000 +#error line of this error should be 3000 + +uniform samplerExternalOES badExt; // syntax ERROR diff --git a/core/deps/glslang/Test/100Limits.vert b/core/deps/glslang/Test/100Limits.vert index e42f76845..d23b7e898 100644 --- a/core/deps/glslang/Test/100Limits.vert +++ b/core/deps/glslang/Test/100Limits.vert @@ -1,76 +1,76 @@ -#version 100 - -int ga, gb; -float f; - -uniform sampler2D fsa[3]; -uniform float fua[10]; -attribute mat3 am3; -attribute vec2 av2; -varying vec4 va[4]; - -const mat2 m2 = mat2(1.0); -const vec3 v3 = vec3(2.0); - -void foo(inout float a) {} - -int bar() -{ - return 1; -} - -void main() -{ - while (ga < gb) { } - - do { } while (false); - - for ( ; ; ); // ERROR - for ( ; ga==gb; ); // ERROR - for ( ; ; f++); // ERROR - for ( ga = 0; ; ); // ERROR - for ( bool a = false; ; ); // ERROR - for (float a = 0.0; a == sin(f); ); // ERROR - for ( int a = 0; a < 10; a *= 2); // ERROR - for ( int a = 0; a <= 20; a++) --a; // ERROR - for ( int a = 0; a <= 20; a++) { if (ga==0) a = 4; } // ERROR - for (float a = 0.0; a <= 20.0; a += 2.0); - for (float a = 0.0; a != 20.0; a -= 2.0) { if (ga==0) ga = 4; } - for (float a = 0.0; a == 20.0; a--) for (float a = 0.0; a == 20.0; a--); // two different 'a's, everything okay - for (float a = 0.0; a <= 20.0; a += 2.0); - for (float a = 0.0; a <= 20.0; a += 2.0); - for (float a = 0.0; a > 2.0 * 20.0; a += v3.y); - for (float a = 0.0; a >= 20.0; a += 2.0) foo(a); // ERROR - - int ia[9]; - - fsa[ga]; // ERROR - fua[ga]; - am3[ga]; // ERROR - av2[ga]; // ERROR - va[2+ga]; // ERROR - m2[ga]; // ERROR - v3[ga/2]; // ERROR - ia[ga]; // ERROR - - for (int a = 3; a >= 0; a--) { - fsa[a]; - fua[a+2]; - am3[3*a]; - av2[3*a]; - va[a-1]; - m2[a/2]; - v3[a]; - ia[a]; - ia[bar()]; // ERROR - } - - fsa[2]; - fua[3]; - am3[2]; - av2[1]; - va[1]; - m2[1]; - v3[1]; - ia[3]; -} +#version 100 + +int ga, gb; +float f; + +uniform sampler2D fsa[3]; +uniform float fua[10]; +attribute mat3 am3; +attribute vec2 av2; +varying vec4 va[4]; + +const mat2 m2 = mat2(1.0); +const vec3 v3 = vec3(2.0); + +void foo(inout float a) {} + +int bar() +{ + return 1; +} + +void main() +{ + while (ga < gb) { } + + do { } while (false); + + for ( ; ; ); // ERROR + for ( ; ga==gb; ); // ERROR + for ( ; ; f++); // ERROR + for ( ga = 0; ; ); // ERROR + for ( bool a = false; ; ); // ERROR + for (float a = 0.0; a == sin(f); ); // ERROR + for ( int a = 0; a < 10; a *= 2); // ERROR + for ( int a = 0; a <= 20; a++) --a; // ERROR + for ( int a = 0; a <= 20; a++) { if (ga==0) a = 4; } // ERROR + for (float a = 0.0; a <= 20.0; a += 2.0); + for (float a = 0.0; a != 20.0; a -= 2.0) { if (ga==0) ga = 4; } + for (float a = 0.0; a == 20.0; a--) for (float a = 0.0; a == 20.0; a--); // two different 'a's, everything okay + for (float a = 0.0; a <= 20.0; a += 2.0); + for (float a = 0.0; a <= 20.0; a += 2.0); + for (float a = 0.0; a > 2.0 * 20.0; a += v3.y); + for (float a = 0.0; a >= 20.0; a += 2.0) foo(a); // ERROR + + int ia[9]; + + fsa[ga]; // ERROR + fua[ga]; + am3[ga]; // ERROR + av2[ga]; // ERROR + va[2+ga]; // ERROR + m2[ga]; // ERROR + v3[ga/2]; // ERROR + ia[ga]; // ERROR + + for (int a = 3; a >= 0; a--) { + fsa[a]; + fua[a+2]; + am3[3*a]; + av2[3*a]; + va[a-1]; + m2[a/2]; + v3[a]; + ia[a]; + ia[bar()]; // ERROR + } + + fsa[2]; + fua[3]; + am3[2]; + av2[1]; + va[1]; + m2[1]; + v3[1]; + ia[3]; +} diff --git a/core/deps/glslang/Test/100samplerExternal.frag b/core/deps/glslang/Test/100samplerExternal.frag index ff57a268e..9f6f397e0 100644 --- a/core/deps/glslang/Test/100samplerExternal.frag +++ b/core/deps/glslang/Test/100samplerExternal.frag @@ -1,41 +1,41 @@ -#version 100 - -#extension GL_OES_EGL_image_external : enable - -uniform samplerExternalOES sExt; -precision mediump samplerExternalOES; -uniform samplerExternalOES mediumExt; -uniform highp samplerExternalOES highExt; - -void main() -{ - texture2D(sExt, vec2(0.2)); - texture2D(mediumExt, vec2(0.2)); - texture2D(highExt, vec2(0.2)); - texture2DProj(sExt, vec3(0.3)); - texture2DProj(sExt, vec4(0.3)); - - int lod = 0; - highp float bias = 0.01; - textureSize(sExt, lod); // ERROR - texture(sExt, vec2(0.2)); // ERROR - texture(sExt, vec2(0.2), bias); // ERROR - textureProj(sExt, vec3(0.2)); // ERROR - textureProj(sExt, vec3(0.2), bias); // ERROR - textureProj(sExt, vec4(0.2)); // ERROR - textureProj(sExt, vec4(0.2), bias); // ERROR - texelFetch(sExt, ivec2(4), lod); // ERROR - - texture3D(sExt, vec3(0.3)); // ERROR - texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR - texture(sExt, vec3(0.3)); // ERROR - textureProjLod(sExt, vec3(0.3), 0.3); // ERROR -} - -#extension GL_OES_EGL_image_external : disable - -#extension GL_OES_EGL_image_external_essl3 : enable -uniform samplerExternalOES badExt; // ERROR -#extension GL_OES_EGL_image_external_essl3 : disable - -uniform samplerExternalOES badExt; // ERROR +#version 100 + +#extension GL_OES_EGL_image_external : enable + +uniform samplerExternalOES sExt; +precision mediump samplerExternalOES; +uniform samplerExternalOES mediumExt; +uniform highp samplerExternalOES highExt; + +void main() +{ + texture2D(sExt, vec2(0.2)); + texture2D(mediumExt, vec2(0.2)); + texture2D(highExt, vec2(0.2)); + texture2DProj(sExt, vec3(0.3)); + texture2DProj(sExt, vec4(0.3)); + + int lod = 0; + highp float bias = 0.01; + textureSize(sExt, lod); // ERROR + texture(sExt, vec2(0.2)); // ERROR + texture(sExt, vec2(0.2), bias); // ERROR + textureProj(sExt, vec3(0.2)); // ERROR + textureProj(sExt, vec3(0.2), bias); // ERROR + textureProj(sExt, vec4(0.2)); // ERROR + textureProj(sExt, vec4(0.2), bias); // ERROR + texelFetch(sExt, ivec2(4), lod); // ERROR + + texture3D(sExt, vec3(0.3)); // ERROR + texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR + texture(sExt, vec3(0.3)); // ERROR + textureProjLod(sExt, vec3(0.3), 0.3); // ERROR +} + +#extension GL_OES_EGL_image_external : disable + +#extension GL_OES_EGL_image_external_essl3 : enable +uniform samplerExternalOES badExt; // ERROR +#extension GL_OES_EGL_image_external_essl3 : disable + +uniform samplerExternalOES badExt; // ERROR diff --git a/core/deps/glslang/Test/100scope.vert b/core/deps/glslang/Test/100scope.vert index 7ffa7be9d..b0a72d1f1 100644 --- a/core/deps/glslang/Test/100scope.vert +++ b/core/deps/glslang/Test/100scope.vert @@ -1,76 +1,76 @@ -#version 100 - -int f(int a, int b, int c) -{ - int a = b; // ERROR, redefinition - - { - float a = float(a) + 1.0; - } - - return a; -} - -int f(int a, int b, int c); // okay to redeclare - -bool b; -float b(int a); // ERROR: redefinition - -float c(int a); -bool c; // ERROR: redefinition - -float f; // ERROR: redefinition -float tan; // okay, built-in is in an outer scope -float sin(float x); // ERROR: can't redefine built-in functions -float cos(float x) // ERROR: can't redefine built-in functions -{ - return 1.0; -} -bool radians(bool x) // okay, can overload built-in functions -{ - return true; -} - -invariant gl_Position; - -void main() -{ - int g(); // ERROR: no local function declarations - g(); - - float sin; // okay - sin; - sin(0.7); // ERROR, use of hidden function - f(1,2,3); - - float f; // hides f() - f = 3.0; - - gl_Position = vec4(f); - - for (int f = 0; f < 10; ++f) - ++f; - - int x = 1; - { - float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 - int z = z; // ERROR: z not previously defined. - } - { - int x = x; // x is initialized to '1' - } - - struct S - { - int x; - }; - { - S S = S(0); // 'S' is only visible as a struct and constructor - S.x; // 'S' is now visible as a variable - } - - int degrees; - degrees(3.2); // ERROR, use of hidden built-in function -} - -varying struct SSS { float f; } s; // ERROR +#version 100 + +int f(int a, int b, int c) +{ + int a = b; // ERROR, redefinition + + { + float a = float(a) + 1.0; + } + + return a; +} + +int f(int a, int b, int c); // okay to redeclare + +bool b; +float b(int a); // ERROR: redefinition + +float c(int a); +bool c; // ERROR: redefinition + +float f; // ERROR: redefinition +float tan; // okay, built-in is in an outer scope +float sin(float x); // ERROR: can't redefine built-in functions +float cos(float x) // ERROR: can't redefine built-in functions +{ + return 1.0; +} +bool radians(bool x) // okay, can overload built-in functions +{ + return true; +} + +invariant gl_Position; + +void main() +{ + int g(); // ERROR: no local function declarations + g(); + + float sin; // okay + sin; + sin(0.7); // ERROR, use of hidden function + f(1,2,3); + + float f; // hides f() + f = 3.0; + + gl_Position = vec4(f); + + for (int f = 0; f < 10; ++f) + ++f; + + int x = 1; + { + float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 + int z = z; // ERROR: z not previously defined. + } + { + int x = x; // x is initialized to '1' + } + + struct S + { + int x; + }; + { + S S = S(0); // 'S' is only visible as a struct and constructor + S.x; // 'S' is now visible as a variable + } + + int degrees; + degrees(3.2); // ERROR, use of hidden built-in function +} + +varying struct SSS { float f; } s; // ERROR diff --git a/core/deps/glslang/Test/110scope.vert b/core/deps/glslang/Test/110scope.vert index 3ed9fafb3..86c27a584 100644 --- a/core/deps/glslang/Test/110scope.vert +++ b/core/deps/glslang/Test/110scope.vert @@ -1,87 +1,87 @@ -#version 110 - -int f(int a, int b, int c) -{ - int a = b; // ERROR, redefinition - - { - float a = float(a) + 1.0; // okay - } - - return a; -} - -int f(int a, int b, int c); // okay to redeclare - -bool b; -float b(int a); // okay, b and b() are different - -float c(int a); -bool c; // okay, and c() are different - -float f; // okay f and f() are different -float tan; // okay, hides built-in function -float sin(float x); // okay, can redefine built-in functions -float cos(float x) // okay, can redefine built-in functions -{ - return 1.0; -} -bool radians(bool x) // okay, can overload built-in functions -{ - return true; -} - -int gi = f(1,2,3); // ERROR, can't call user-defined function from global scope - -void main() -{ - int g(); // okay - g(); - - float sin; // okay - sin; - sin(0.7); // okay - f(1,2,3); - - float f; - f = 3.0; - - gl_Position = vec4(f); - - for (int f = 0; f < 10; ++f) - ++f; - - int x = 1; - { - float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 - int z = z; // ERROR: z not previously defined. - } - { - int x = x; // x is initialized to '1' - } - - struct S - { - int x; - }; - { - S S = S(0); // 'S' is only visible as a struct and constructor - S.x; // 'S' is now visible as a variable - } - - int degrees; - degrees(3.2); - - { - S s; - s.x = 3; - struct S { // okay, hides S - bool b; - }; - S t; - t.b = true; - struct S { // ERROR, redefinition of struct S - float f; - }; - } -} +#version 110 + +int f(int a, int b, int c) +{ + int a = b; // ERROR, redefinition + + { + float a = float(a) + 1.0; // okay + } + + return a; +} + +int f(int a, int b, int c); // okay to redeclare + +bool b; +float b(int a); // okay, b and b() are different + +float c(int a); +bool c; // okay, and c() are different + +float f; // okay f and f() are different +float tan; // okay, hides built-in function +float sin(float x); // okay, can redefine built-in functions +float cos(float x) // okay, can redefine built-in functions +{ + return 1.0; +} +bool radians(bool x) // okay, can overload built-in functions +{ + return true; +} + +int gi = f(1,2,3); // ERROR, can't call user-defined function from global scope + +void main() +{ + int g(); // okay + g(); + + float sin; // okay + sin; + sin(0.7); // okay + f(1,2,3); + + float f; + f = 3.0; + + gl_Position = vec4(f); + + for (int f = 0; f < 10; ++f) + ++f; + + int x = 1; + { + float x = 2.0, /* 2nd x visible here */ y = x; // y is initialized to 2 + int z = z; // ERROR: z not previously defined. + } + { + int x = x; // x is initialized to '1' + } + + struct S + { + int x; + }; + { + S S = S(0); // 'S' is only visible as a struct and constructor + S.x; // 'S' is now visible as a variable + } + + int degrees; + degrees(3.2); + + { + S s; + s.x = 3; + struct S { // okay, hides S + bool b; + }; + S t; + t.b = true; + struct S { // ERROR, redefinition of struct S + float f; + }; + } +} diff --git a/core/deps/glslang/Test/120.frag b/core/deps/glslang/Test/120.frag index a2308bb1d..ea35b80e4 100644 --- a/core/deps/glslang/Test/120.frag +++ b/core/deps/glslang/Test/120.frag @@ -245,4 +245,4 @@ void voidTernary() b ? 3 : foo12111(); // ERROR } -float halfFloat1 = 1.0h; // syntax ERROR +float halfFloat1 = 1.0h; // syntax ERROR diff --git a/core/deps/glslang/Test/120.vert b/core/deps/glslang/Test/120.vert index 37eeb8207..7b98492b4 100644 --- a/core/deps/glslang/Test/120.vert +++ b/core/deps/glslang/Test/120.vert @@ -139,12 +139,12 @@ void foo2() bool b = any(lessThan(v4, attv4)); // tests aggregate arg to unary built-in } -void noise() -{ - float f1 = noise1(1.0); - vec2 f2 = noise2(vec2(1.0)); - vec3 f3 = noise3(vec3(1.0)); - vec4 f4 = noise4(vec4(1.0)); +void noise() +{ + float f1 = noise1(1.0); + vec2 f2 = noise2(vec2(1.0)); + vec3 f3 = noise3(vec3(1.0)); + vec4 f4 = noise4(vec4(1.0)); } // version 130 features diff --git a/core/deps/glslang/Test/130.vert b/core/deps/glslang/Test/130.vert index 287ba6a02..d5208cb12 100644 --- a/core/deps/glslang/Test/130.vert +++ b/core/deps/glslang/Test/130.vert @@ -1,78 +1,78 @@ -#version 130 - -uniform int c; -uniform usampler2D us2D; - -in ivec2 x; -in vec2 v2a; -in float c1D; -in vec2 c2D; -in vec3 c3D; -smooth vec4 c4D; // ?? - -uniform vec4 v4; - -void main() -{ - float f = 3; - switch (c) { // full switch testing in switch.frag - case 1: - f = sin(f); - break; - case 2: - f = f * f; - default: - f = 3.0; - } - - uint i; - i = texture(us2D, x).w; // full uint testing in uint.frag - i << 3u | 0x8Au >> 1u & 0xFFu; - - vec3 modfOut, modfIn; - vec3 v11 = modf(modfIn, modfOut); - float t = trunc(f); - vec2 v12 = round(v2a); - vec2 v13 = roundEven(v2a); - bvec2 b10 = isnan(v2a); - bvec4 b11 = isinf(v4); - - sinh(c1D) + - cosh(c1D) * tanh(c2D); - asinh(c4D) + acosh(c4D); - atanh(c3D); - - int id = gl_VertexID; - gl_ClipDistance[1] = 0.3; -} - -// version 140 features - -//uniform isamplerBuffer sbuf; - -//layout(std140) uniform blockName { -// int anonMem; -//}; - -void foo88() -{ - int id = gl_InstanceID; // ERROR - //id += anonMem; - id += texelFetch(id, 8); - - gl_ClipVertex; // these are all present... - gl_Color; - gl_LightSource[0]; - gl_DepthRange.far; - gl_TexCoord; - gl_FogFragCoord; - gl_FrontColor; -} - -// token pasting - -#define mac abc##def -int mac; - -#define macr(A,B) A##B -int macr(qrs,tuv); +#version 130 + +uniform int c; +uniform usampler2D us2D; + +in ivec2 x; +in vec2 v2a; +in float c1D; +in vec2 c2D; +in vec3 c3D; +smooth vec4 c4D; // ?? + +uniform vec4 v4; + +void main() +{ + float f = 3; + switch (c) { // full switch testing in switch.frag + case 1: + f = sin(f); + break; + case 2: + f = f * f; + default: + f = 3.0; + } + + uint i; + i = texture(us2D, x).w; // full uint testing in uint.frag + i << 3u | 0x8Au >> 1u & 0xFFu; + + vec3 modfOut, modfIn; + vec3 v11 = modf(modfIn, modfOut); + float t = trunc(f); + vec2 v12 = round(v2a); + vec2 v13 = roundEven(v2a); + bvec2 b10 = isnan(v2a); + bvec4 b11 = isinf(v4); + + sinh(c1D) + + cosh(c1D) * tanh(c2D); + asinh(c4D) + acosh(c4D); + atanh(c3D); + + int id = gl_VertexID; + gl_ClipDistance[1] = 0.3; +} + +// version 140 features + +//uniform isamplerBuffer sbuf; + +//layout(std140) uniform blockName { +// int anonMem; +//}; + +void foo88() +{ + int id = gl_InstanceID; // ERROR + //id += anonMem; + id += texelFetch(id, 8); + + gl_ClipVertex; // these are all present... + gl_Color; + gl_LightSource[0]; + gl_DepthRange.far; + gl_TexCoord; + gl_FogFragCoord; + gl_FrontColor; +} + +// token pasting + +#define mac abc##def +int mac; + +#define macr(A,B) A##B +int macr(qrs,tuv); diff --git a/core/deps/glslang/Test/140.vert b/core/deps/glslang/Test/140.vert index 5acc5ca18..8035144ab 100644 --- a/core/deps/glslang/Test/140.vert +++ b/core/deps/glslang/Test/140.vert @@ -1,62 +1,62 @@ -#version 140 - -uniform isamplerBuffer sbuf; - -layout(std140) uniform blockName { - int anonMem; -}; - -void main() -{ - int id = gl_InstanceID; - id += anonMem; - id += texelFetch(sbuf, 8).w; - gl_ClipVertex; // could be ERROR, but compiling under compatibility profile - gl_Color; // could be ERROR, but compiling under compatibility profile - gl_LightSource[0]; // could be ERROR, but compiling under compatibility profile - gl_DepthRange.far; - gl_TexCoord; // could be ERROR, but compiling under compatibility profile - gl_FogFragCoord; // could be ERROR, but compiling under compatibility profile - gl_FrontColor; // could be ERROR, but compiling under compatibility profile -} - -out vec4 gl_Position; // ERROR - -layout(location = 9) in vec4 locBad; // ERROR - -#extension GL_ARB_explicit_attrib_location : enable - -layout(location = 9) in vec4 loc; - -#extension GL_ARB_separate_shader_objects : enable - -out vec4 gl_Position; -in vec4 gl_Position; // ERROR -out vec3 gl_Position; // ERROR - -out float gl_PointSize; -out vec4 gl_ClipVertex; -out float gl_FogFragCoord; - -uniform sampler2DRect s2dr; -uniform sampler2DRectShadow s2drs; -in ivec2 itloc2; -in vec2 tloc2; -in vec3 tloc3; -in vec4 tloc4; - -void foo() -{ - vec4 v = texelFetch(s2dr, itloc2); - v += texelFetch(s2dr, itloc2, 0.2); // ERROR, no lod - v += texture(s2dr, tloc2); - v += texture(s2dr, tloc2, 0.3); // ERROR, no bias - v += texture(s2drs, tloc3); - v += textureProj(s2dr, tloc3); - v += textureProj(s2dr, tloc4); - v += textureProjGradOffset(s2dr, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2)); - v += textureProjGradOffset(s2drs, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2)); -} +#version 140 + +uniform isamplerBuffer sbuf; + +layout(std140) uniform blockName { + int anonMem; +}; + +void main() +{ + int id = gl_InstanceID; + id += anonMem; + id += texelFetch(sbuf, 8).w; + gl_ClipVertex; // could be ERROR, but compiling under compatibility profile + gl_Color; // could be ERROR, but compiling under compatibility profile + gl_LightSource[0]; // could be ERROR, but compiling under compatibility profile + gl_DepthRange.far; + gl_TexCoord; // could be ERROR, but compiling under compatibility profile + gl_FogFragCoord; // could be ERROR, but compiling under compatibility profile + gl_FrontColor; // could be ERROR, but compiling under compatibility profile +} + +out vec4 gl_Position; // ERROR + +layout(location = 9) in vec4 locBad; // ERROR + +#extension GL_ARB_explicit_attrib_location : enable + +layout(location = 9) in vec4 loc; + +#extension GL_ARB_separate_shader_objects : enable + +out vec4 gl_Position; +in vec4 gl_Position; // ERROR +out vec3 gl_Position; // ERROR + +out float gl_PointSize; +out vec4 gl_ClipVertex; +out float gl_FogFragCoord; + +uniform sampler2DRect s2dr; +uniform sampler2DRectShadow s2drs; +in ivec2 itloc2; +in vec2 tloc2; +in vec3 tloc3; +in vec4 tloc4; + +void foo() +{ + vec4 v = texelFetch(s2dr, itloc2); + v += texelFetch(s2dr, itloc2, 0.2); // ERROR, no lod + v += texture(s2dr, tloc2); + v += texture(s2dr, tloc2, 0.3); // ERROR, no bias + v += texture(s2drs, tloc3); + v += textureProj(s2dr, tloc3); + v += textureProj(s2dr, tloc4); + v += textureProjGradOffset(s2dr, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2)); + v += textureProjGradOffset(s2drs, tloc4, ivec2(0.0), ivec2(0.0), ivec2(1,2)); +} void devi() { diff --git a/core/deps/glslang/Test/150.frag b/core/deps/glslang/Test/150.frag index a1a813970..e24dba05f 100644 --- a/core/deps/glslang/Test/150.frag +++ b/core/deps/glslang/Test/150.frag @@ -1,51 +1,81 @@ -#version 150 core - -in vec4 gl_FragCoord; -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR -layout(pixel_center_integer) in vec4 gl_FragCoord; // ERROR -layout(origin_upper_left) in vec4 foo; // ERROR -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; - -void main() -{ - vec4 c = gl_FragCoord; -} - -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, declared after use - -in struct S { float f; } s; - -float patch = 3.1; - -uniform sampler2DMS sms; -uniform isampler2DMS isms; -uniform usampler2DMS usms; -uniform sampler2DMSArray smsa; -uniform isampler2DMSArray ismsa; -uniform usampler2DMSArray usmsa; - -flat in ivec2 p2; -flat in ivec3 p3; -flat in int samp; - -void barWxyz() -{ - ivec2 t11 = textureSize( sms); - ivec2 t12 = textureSize(isms); - ivec2 t13 = textureSize(usms); - ivec3 t21 = textureSize( smsa); - ivec3 t22 = textureSize(ismsa); - ivec3 t23 = textureSize(usmsa); - vec4 t31 = texelFetch( sms, p2, samp); - ivec4 t32 = texelFetch(isms, p2, samp); - uvec4 t33 = texelFetch(usms, p2, 3); - vec4 t41 = texelFetch( smsa, p3, samp); - ivec4 t42 = texelFetch(ismsa, ivec3(2), samp); - uvec4 t43 = texelFetch(usmsa, p3, samp); -} - -int primitiveID() -{ - return gl_PrimitiveID; - gl_PerFragment; // ERROR, block name can't get reused -} +#version 150 core + +in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR +layout(pixel_center_integer) in vec4 gl_FragCoord; // ERROR +layout(origin_upper_left) in vec4 foo; // ERROR +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; + +void main() +{ + vec4 c = gl_FragCoord; +} + +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, declared after use + +in struct S { float f; } s; + +float patch = 3.1; + +uniform sampler2DMS sms; +uniform isampler2DMS isms; +uniform usampler2DMS usms; +uniform sampler2DMSArray smsa; +uniform isampler2DMSArray ismsa; +uniform usampler2DMSArray usmsa; + +flat in ivec2 p2; +flat in ivec3 p3; +flat in int samp; + +void barWxyz() +{ + ivec2 t11 = textureSize( sms); + ivec2 t12 = textureSize(isms); + ivec2 t13 = textureSize(usms); + ivec3 t21 = textureSize( smsa); + ivec3 t22 = textureSize(ismsa); + ivec3 t23 = textureSize(usmsa); + vec4 t31 = texelFetch( sms, p2, samp); + ivec4 t32 = texelFetch(isms, p2, samp); + uvec4 t33 = texelFetch(usms, p2, 3); + vec4 t41 = texelFetch( smsa, p3, samp); + ivec4 t42 = texelFetch(ismsa, ivec3(2), samp); + uvec4 t43 = texelFetch(usmsa, p3, samp); +} + +int primitiveID() +{ + return gl_PrimitiveID; + gl_PerFragment; // ERROR, block name can't get reused +} + +in double type1; // ERROR +#extension GL_ARB_gpu_shader_fp64 : enable +double type2; +double type3 = 2.0; +int absTest = sqrt(type3); +double absTest2 = sqrt(type3); +double absTest3 = sqrt(2); +float dk = sqrt(11); + +#extension GL_ARB_shader_bit_encoding: enable + +float f; +vec4 v4; +ivec4 iv4a; +uvec2 uv2c; +void bitEncodingPass() +{ + int i = floatBitsToInt(f); + uvec4 uv11 = floatBitsToUint(v4); + vec4 v14 = intBitsToFloat(iv4a); + vec2 v15 = uintBitsToFloat(uv2c); +} + +#extension GL_ARB_shader_bit_encoding: disable + +void bitEncodingFail() +{ + int i = floatBitsToInt(f); // Error, extention GL_ARB_bit_encoding is diabled +} diff --git a/core/deps/glslang/Test/150.geom b/core/deps/glslang/Test/150.geom index d2ff4eb15..d5b3c9b3d 100644 --- a/core/deps/glslang/Test/150.geom +++ b/core/deps/glslang/Test/150.geom @@ -1,139 +1,139 @@ -#version 150 core - -in fromVertex { - in vec3 color; -} fromV[]; - -out toFragment { - out vec3 color; -} toF; - -out fromVertex { // okay to reuse a block name for another block name - vec3 color; -}; - -out fooB { - vec2 color; -} fromVertex; // ERROR, cannot reuse block name as block instance - -int fromVertex; // ERROR, cannot reuse a block name for something else - -out fooC { - vec2 color; -} fooC; // ERROR, cannot have same name for block and instance name - -void main() -{ - EmitVertex(); - EndPrimitive(); - EmitStreamVertex(1); // ERROR - EndStreamPrimitive(0); // ERROR - - color = fromV[0].color; - gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; - gl_Position = gl_in[0].gl_Position; - gl_PointSize = gl_in[3].gl_PointSize; - gl_PrimitiveID = gl_PrimitiveIDIn; - gl_Layer = 2; -} - -out vec4 ov0; // stream should be 0 -layout(stream = 4) out vec4 ov4; -out vec4 o1v0; // stream should be 0 - -layout(stream = 3) uniform; // ERROR -layout(stream = 3) in; // ERROR -layout(stream = 3) uniform int ua; // ERROR -layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR - -layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out; // just means "stream = 3, triangle_strip" -layout(stream = 3, triangle_strip) out; -out vec4 ov3; // stream should be 3 - -layout(stream = 6) out ooutb { vec4 a; } ouuaa6; - -layout(stream = 6) out ooutb2 { - layout(stream = 6) vec4 a; -} ouua6; - -layout(stream = 7) out ooutb3 { - layout(stream = 6) vec4 a; // ERROR -} ouua7; - -out vec4 ov2s3; // stream should be 3 - -layout(max_vertices = 200) out; -layout(max_vertices = 300) out; // ERROR, too big -void foo(layout(max_vertices = 4) int a) // ERROR -{ - ouuaa6.a = vec4(1.0); -} - -layout(line_strip, points, triangle_strip, stream = 3, points) out; // ERROR, changing output primitive -layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive -layout(triangle_strip) in; // ERROR, not an input primitive -layout(triangle_strip) uniform; // ERROR -layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable -layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input -layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 -out outbn2 { - layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 - layout(max_vertices = 3) int b; // ERROR, not on a block member - layout(triangle_strip) int c; // ERROR, not on a block member -} outbi; - -layout(lines) out; // ERROR, not on output -layout(lines_adjacency) in; -layout(triangles) in; // ERROR, can't change it -layout(triangles_adjacency) in; // ERROR, can't change it -layout(invocations = 4) in; // ERROR, not until 4.0 - -in inbn { - layout(stream = 2) int a; // ERROR, stream on input -} inbi[]; - -in sameName { - int a15; -} insn[]; - -out sameName { - float f15; -}; - -uniform sameName { - bool b15; -}; - -float summ = gl_MaxVertexAttribs + - gl_MaxVertexUniformComponents + - gl_MaxVaryingFloats + - gl_MaxVaryingComponents + - gl_MaxVertexOutputComponents + - gl_MaxGeometryInputComponents + - gl_MaxGeometryOutputComponents + - gl_MaxFragmentInputComponents + - gl_MaxVertexTextureImageUnits + - gl_MaxCombinedTextureImageUnits + - gl_MaxTextureImageUnits + - gl_MaxFragmentUniformComponents + - gl_MaxDrawBuffers + - gl_MaxClipDistances + - gl_MaxGeometryTextureImageUnits + - gl_MaxGeometryOutputVertices + - gl_MaxGeometryTotalOutputComponents + - gl_MaxGeometryUniformComponents + - gl_MaxGeometryVaryingComponents; - -void fooe1() -{ - gl_ViewportIndex = gl_MaxViewports - 1; -} - -#extension GL_ARB_viewport_array : enable - -void fooe2() -{ - gl_ViewportIndex = gl_MaxViewports - 1; -} - -out int gl_ViewportIndex; +#version 150 core + +in fromVertex { + in vec3 color; +} fromV[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { // okay to reuse a block name for another block name + vec3 color; +}; + +out fooB { + vec2 color; +} fromVertex; // ERROR, cannot reuse block name as block instance + +int fromVertex; // ERROR, cannot reuse a block name for something else + +out fooC { + vec2 color; +} fooC; // ERROR, cannot have same name for block and instance name + +void main() +{ + EmitVertex(); + EndPrimitive(); + EmitStreamVertex(1); // ERROR + EndStreamPrimitive(0); // ERROR + + color = fromV[0].color; + gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; + gl_Position = gl_in[0].gl_Position; + gl_PointSize = gl_in[3].gl_PointSize; + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; +} + +out vec4 ov0; // stream should be 0 +layout(stream = 4) out vec4 ov4; +out vec4 o1v0; // stream should be 0 + +layout(stream = 3) uniform; // ERROR +layout(stream = 3) in; // ERROR +layout(stream = 3) uniform int ua; // ERROR +layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR + +layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out; // just means "stream = 3, triangle_strip" +layout(stream = 3, triangle_strip) out; +out vec4 ov3; // stream should be 3 + +layout(stream = 6) out ooutb { vec4 a; } ouuaa6; + +layout(stream = 6) out ooutb2 { + layout(stream = 6) vec4 a; +} ouua6; + +layout(stream = 7) out ooutb3 { + layout(stream = 6) vec4 a; // ERROR +} ouua7; + +out vec4 ov2s3; // stream should be 3 + +layout(max_vertices = 200) out; +layout(max_vertices = 300) out; // ERROR, too big +void foo(layout(max_vertices = 4) int a) // ERROR +{ + ouuaa6.a = vec4(1.0); +} + +layout(line_strip, points, triangle_strip, stream = 3, points) out; // ERROR, changing output primitive +layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive +layout(triangle_strip) in; // ERROR, not an input primitive +layout(triangle_strip) uniform; // ERROR +layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable +layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input +layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 +out outbn2 { + layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 + layout(max_vertices = 3) int b; // ERROR, not on a block member + layout(triangle_strip) int c; // ERROR, not on a block member +} outbi; + +layout(lines) out; // ERROR, not on output +layout(lines_adjacency) in; +layout(triangles) in; // ERROR, can't change it +layout(triangles_adjacency) in; // ERROR, can't change it +layout(invocations = 4) in; // ERROR, not until 4.0 + +in inbn { + layout(stream = 2) int a; // ERROR, stream on input +} inbi[]; + +in sameName { + int a15; +} insn[]; + +out sameName { + float f15; +}; + +uniform sameName { + bool b15; +}; + +float summ = gl_MaxVertexAttribs + + gl_MaxVertexUniformComponents + + gl_MaxVaryingFloats + + gl_MaxVaryingComponents + + gl_MaxVertexOutputComponents + + gl_MaxGeometryInputComponents + + gl_MaxGeometryOutputComponents + + gl_MaxFragmentInputComponents + + gl_MaxVertexTextureImageUnits + + gl_MaxCombinedTextureImageUnits + + gl_MaxTextureImageUnits + + gl_MaxFragmentUniformComponents + + gl_MaxDrawBuffers + + gl_MaxClipDistances + + gl_MaxGeometryTextureImageUnits + + gl_MaxGeometryOutputVertices + + gl_MaxGeometryTotalOutputComponents + + gl_MaxGeometryUniformComponents + + gl_MaxGeometryVaryingComponents; + +void fooe1() +{ + gl_ViewportIndex = gl_MaxViewports - 1; +} + +#extension GL_ARB_viewport_array : enable + +void fooe2() +{ + gl_ViewportIndex = gl_MaxViewports - 1; +} + +out int gl_ViewportIndex; diff --git a/core/deps/glslang/Test/150.tesc b/core/deps/glslang/Test/150.tesc index 0acfe32c5..66c0f3ea4 100644 --- a/core/deps/glslang/Test/150.tesc +++ b/core/deps/glslang/Test/150.tesc @@ -1,34 +1,34 @@ -#version 150 - -#extension GL_ARB_tessellation_shader : enable - -layout(vertices = 4) out; -int outa[gl_out.length()]; - -patch out vec4 patchOut; - -void main() -{ - barrier(); - - int a = gl_MaxTessControlInputComponents + - gl_MaxTessControlOutputComponents + - gl_MaxTessControlTextureImageUnits + - gl_MaxTessControlUniformComponents + - gl_MaxTessControlTotalOutputComponents; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - int iid = gl_InvocationID; - - gl_out[gl_InvocationID].gl_Position = p; - gl_out[gl_InvocationID].gl_PointSize = ps; - gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; - - gl_TessLevelOuter[3] = 3.2; - gl_TessLevelInner[1] = 1.3; -} +#version 150 + +#extension GL_ARB_tessellation_shader : enable + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; +} diff --git a/core/deps/glslang/Test/150.tese b/core/deps/glslang/Test/150.tese index f609697dd..aea65e810 100644 --- a/core/deps/glslang/Test/150.tese +++ b/core/deps/glslang/Test/150.tese @@ -1,35 +1,35 @@ -#version 150 - -#extension GL_ARB_tessellation_shader : enable - -layout(quads, cw) in; -layout(fractional_odd_spacing) in; -layout(point_mode) in; -patch in vec4 patchIn; - -void main() -{ - barrier(); // ERROR - - int a = gl_MaxTessEvaluationInputComponents + - gl_MaxTessEvaluationOutputComponents + - gl_MaxTessEvaluationTextureImageUnits + - gl_MaxTessEvaluationUniformComponents + - gl_MaxTessPatchComponents + - gl_MaxPatchVertices + - gl_MaxTessGenLevel; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - vec3 tc = gl_TessCoord; - float tlo = gl_TessLevelOuter[3]; - float tli = gl_TessLevelInner[1]; - - gl_Position = p; - gl_PointSize = ps; - gl_ClipDistance[2] = cd; -} +#version 150 + +#extension GL_ARB_tessellation_shader : enable + +layout(quads, cw) in; +layout(fractional_odd_spacing) in; +layout(point_mode) in; +patch in vec4 patchIn; + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; +} diff --git a/core/deps/glslang/Test/150.vert b/core/deps/glslang/Test/150.vert index 85a6d2f02..4dd9e5ca8 100644 --- a/core/deps/glslang/Test/150.vert +++ b/core/deps/glslang/Test/150.vert @@ -1,29 +1,29 @@ -#version 150 core - -#ifndef GL_core_profile -# error standard macro GL_core_profile not defined -#endif - -in vec4 iv4; - -uniform float ps; - -invariant gl_Position; - -void main() -{ - gl_Position = iv4; - gl_PointSize = ps; - gl_ClipDistance[2] = iv4.x; - gl_ClipVertex = iv4; -} - -out float gl_ClipDistance[4]; - -uniform foob { - int a[]; -}; -int a[5]; // ERROR, resizing user-block member - -#line 3000 -#error line of this error should be 3001 +#version 150 core + +#ifndef GL_core_profile +# error standard macro GL_core_profile not defined +#endif + +in vec4 iv4; + +uniform float ps; + +invariant gl_Position; + +void main() +{ + gl_Position = iv4; + gl_PointSize = ps; + gl_ClipDistance[2] = iv4.x; + gl_ClipVertex = iv4; +} + +out float gl_ClipDistance[4]; + +uniform foob { + int a[]; +}; +int a[5]; // ERROR, resizing user-block member + +#line 3000 +#error line of this error should be 3001 diff --git a/core/deps/glslang/Test/300.vert b/core/deps/glslang/Test/300.vert index 8169d66ba..daf98b836 100644 --- a/core/deps/glslang/Test/300.vert +++ b/core/deps/glslang/Test/300.vert @@ -184,7 +184,7 @@ void fooDeeparray() yp = y; xp = y; // ERROR, wrong size yp = x; // ERROR, wrong size -} +} layout(num_views = 2) in; // ERROR, no extension diff --git a/core/deps/glslang/Test/300link.frag b/core/deps/glslang/Test/300link.frag index b80d172d3..5d39cc0f9 100644 --- a/core/deps/glslang/Test/300link.frag +++ b/core/deps/glslang/Test/300link.frag @@ -1,8 +1,8 @@ -#version 300 es - -precision highp float; - -out vec4 color1; -out vec4 color2; - -void main() {} +#version 300 es + +precision highp float; + +out vec4 color1; +out vec4 color2; + +void main() {} diff --git a/core/deps/glslang/Test/300link2.frag b/core/deps/glslang/Test/300link2.frag index d8ed3352e..7800ac9bc 100644 --- a/core/deps/glslang/Test/300link2.frag +++ b/core/deps/glslang/Test/300link2.frag @@ -1,11 +1,11 @@ -#version 300 es -precision mediump float; -in vec4 pos; - -layout(location = 1) out vec4 c; -layout(location = 5) out vec4 p; -layout(location = 9) out vec4 q[2]; - -void main() -{ -} +#version 300 es +precision mediump float; +in vec4 pos; + +layout(location = 1) out vec4 c; +layout(location = 5) out vec4 p; +layout(location = 9) out vec4 q[2]; + +void main() +{ +} diff --git a/core/deps/glslang/Test/300link3.frag b/core/deps/glslang/Test/300link3.frag index e35dcc93a..410592c66 100644 --- a/core/deps/glslang/Test/300link3.frag +++ b/core/deps/glslang/Test/300link3.frag @@ -1,7 +1,7 @@ -#version 300 es - -precision highp float; - -out vec4 color1; - -void main() {} +#version 300 es + +precision highp float; + +out vec4 color1; + +void main() {} diff --git a/core/deps/glslang/Test/300samplerExternal.frag b/core/deps/glslang/Test/300samplerExternal.frag index 5cb0f47d8..3724f8e0a 100644 --- a/core/deps/glslang/Test/300samplerExternal.frag +++ b/core/deps/glslang/Test/300samplerExternal.frag @@ -1,41 +1,41 @@ -#version 300 es - -#extension GL_OES_EGL_image_external_essl3 : enable - -uniform samplerExternalOES sExt; -precision mediump samplerExternalOES; -uniform samplerExternalOES mediumExt; -uniform highp samplerExternalOES highExt; - -void main() -{ - texture2D(sExt, vec2(0.2)); // ERROR - texture2D(mediumExt, vec2(0.2)); // ERROR - texture2D(highExt, vec2(0.2)); // ERROR - texture2DProj(sExt, vec3(0.3)); // ERROR - texture2DProj(sExt, vec4(0.3)); // ERROR - - int lod = 0; - highp float bias = 0.01; - textureSize(sExt, lod); - texture(sExt, vec2(0.2)); - texture(sExt, vec2(0.2), bias); - textureProj(sExt, vec3(0.2)); - textureProj(sExt, vec3(0.2), bias); - textureProj(sExt, vec4(0.2)); - textureProj(sExt, vec4(0.2), bias); - texelFetch(sExt, ivec2(4), lod); - - texture3D(sExt, vec3(0.3)); // ERROR - texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR - texture(sExt, vec3(0.3)); // ERROR - textureProjLod(sExt, vec3(0.3), 0.3); // ERROR -} - -#extension GL_OES_EGL_image_external_essl3 : disable - -#extension GL_OES_EGL_image_external : enable -uniform samplerExternalOES badExt; // ERROR -#extension GL_OES_EGL_image_external : disable - -uniform samplerExternalOES badExt; // ERROR +#version 300 es + +#extension GL_OES_EGL_image_external_essl3 : enable + +uniform samplerExternalOES sExt; +precision mediump samplerExternalOES; +uniform samplerExternalOES mediumExt; +uniform highp samplerExternalOES highExt; + +void main() +{ + texture2D(sExt, vec2(0.2)); // ERROR + texture2D(mediumExt, vec2(0.2)); // ERROR + texture2D(highExt, vec2(0.2)); // ERROR + texture2DProj(sExt, vec3(0.3)); // ERROR + texture2DProj(sExt, vec4(0.3)); // ERROR + + int lod = 0; + highp float bias = 0.01; + textureSize(sExt, lod); + texture(sExt, vec2(0.2)); + texture(sExt, vec2(0.2), bias); + textureProj(sExt, vec3(0.2)); + textureProj(sExt, vec3(0.2), bias); + textureProj(sExt, vec4(0.2)); + textureProj(sExt, vec4(0.2), bias); + texelFetch(sExt, ivec2(4), lod); + + texture3D(sExt, vec3(0.3)); // ERROR + texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR + texture(sExt, vec3(0.3)); // ERROR + textureProjLod(sExt, vec3(0.3), 0.3); // ERROR +} + +#extension GL_OES_EGL_image_external_essl3 : disable + +#extension GL_OES_EGL_image_external : enable +uniform samplerExternalOES badExt; // ERROR +#extension GL_OES_EGL_image_external : disable + +uniform samplerExternalOES badExt; // ERROR diff --git a/core/deps/glslang/Test/300samplerExternalYUV.frag b/core/deps/glslang/Test/300samplerExternalYUV.frag index 62f444774..add21285e 100644 --- a/core/deps/glslang/Test/300samplerExternalYUV.frag +++ b/core/deps/glslang/Test/300samplerExternalYUV.frag @@ -1,38 +1,38 @@ -#version 300 es - -#extension GL_EXT_YUV_target : enable - -uniform __samplerExternal2DY2YEXT sExt; -precision mediump __samplerExternal2DY2YEXT; -uniform __samplerExternal2DY2YEXT mediumExt; -uniform highp __samplerExternal2DY2YEXT highExt; - -void main() -{ - texture2D(sExt, vec2(0.2)); // ERROR - texture2D(mediumExt, vec2(0.2)); // ERROR - texture2D(highExt, vec2(0.2)); // ERROR - texture2DProj(sExt, vec3(0.3)); // ERROR - texture2DProj(sExt, vec4(0.3)); // ERROR - - int lod = 0; - highp float bias = 0.01; - textureSize(sExt, lod); - texture(sExt, vec2(0.2)); - texture(sExt, vec2(0.2), bias); - textureProj(sExt, vec3(0.2)); - textureProj(sExt, vec3(0.2), bias); - textureProj(sExt, vec4(0.2)); - textureProj(sExt, vec4(0.2), bias); - texelFetch(sExt, ivec2(4), lod); - - texture3D(sExt, vec3(0.3)); // ERROR - texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR - texture(sExt, vec3(0.3)); // ERROR - textureProjLod(sExt, vec3(0.3), 0.3); // ERROR -} - -#extension GL_EXT_YUV_target : disable - -uniform __samplerExternal2DY2YEXT badExt; // ERROR - +#version 300 es + +#extension GL_EXT_YUV_target : enable + +uniform __samplerExternal2DY2YEXT sExt; +precision mediump __samplerExternal2DY2YEXT; +uniform __samplerExternal2DY2YEXT mediumExt; +uniform highp __samplerExternal2DY2YEXT highExt; + +void main() +{ + texture2D(sExt, vec2(0.2)); // ERROR + texture2D(mediumExt, vec2(0.2)); // ERROR + texture2D(highExt, vec2(0.2)); // ERROR + texture2DProj(sExt, vec3(0.3)); // ERROR + texture2DProj(sExt, vec4(0.3)); // ERROR + + int lod = 0; + highp float bias = 0.01; + textureSize(sExt, lod); + texture(sExt, vec2(0.2)); + texture(sExt, vec2(0.2), bias); + textureProj(sExt, vec3(0.2)); + textureProj(sExt, vec3(0.2), bias); + textureProj(sExt, vec4(0.2)); + textureProj(sExt, vec4(0.2), bias); + texelFetch(sExt, ivec2(4), lod); + + texture3D(sExt, vec3(0.3)); // ERROR + texture2DProjLod(sExt, vec3(0.3), 0.3); // ERROR + texture(sExt, vec3(0.3)); // ERROR + textureProjLod(sExt, vec3(0.3), 0.3); // ERROR +} + +#extension GL_EXT_YUV_target : disable + +uniform __samplerExternal2DY2YEXT badExt; // ERROR + diff --git a/core/deps/glslang/Test/310.comp b/core/deps/glslang/Test/310.comp index bfa05bbe7..33ecbf018 100644 --- a/core/deps/glslang/Test/310.comp +++ b/core/deps/glslang/Test/310.comp @@ -1,237 +1,237 @@ -#version 310 es - -layout(local_size_x = 2) in; -layout(local_size_x = 16) in; // ERROR, changing -layout(local_size_z = 4096) in; // ERROR, too large -layout(local_size_x = 2) in; -layout(local_size_y = 0) in; // ERROR, 0 not allowed -const int total = gl_MaxComputeWorkGroupCount.y - + gl_MaxComputeUniformComponents - + gl_MaxComputeTextureImageUnits - + gl_MaxComputeImageUniforms - + gl_MaxComputeAtomicCounters - + gl_MaxComputeAtomicCounterBuffers; - -buffer ShaderStorageBlock -{ - int value; - float values[]; -}; - -buffer InvalidShaderStorageBlock -{ - float values[]; // ERROR - int value; -} invalid; - -void main() -{ - barrier(); - memoryBarrier(); - memoryBarrierAtomicCounter(); - memoryBarrierBuffer(); - memoryBarrierShared(); - memoryBarrierImage(); - groupMemoryBarrier(); - value = int(values[gl_LocalInvocationIndex]); -} - -layout(location = 2) in vec3 v3; // ERROR -in float f; // ERROR -out float fo; // ERROR - -shared vec4 s; -layout(location = 2) shared vec4 sl; // ERROR -shared float fs = 4.2; // ERROR - -layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR - -int arrX[gl_WorkGroupSize.x]; -int arrY[gl_WorkGroupSize.y]; -int arrZ[gl_WorkGroupSize.z]; - -readonly buffer roblock -{ - int value; - float values[]; -} ro; - -void foo() -{ - ro.values[2] = 4.7; // ERROR, readonly - ro.values.length(); - ++s; -} - -buffer vec4 v; // ERROR - -uniform usampler2D us2dbad; // ERROR, default precision - -precision highp usampler2D; -precision highp iimage2DArray; -precision highp iimage2D; - -uniform usampler2D us2d; - -uniform iimage2DArray ii2dabad; // ERROR, not writeonly -uniform writeonly iimage2DArray ii2da; - -layout(r32i) uniform iimage2D iimg2D; -layout(rgba32i) uniform readonly iimage2D iimg2Drgba; -layout(rgba32f) uniform readonly image2D img2Drgba; // ERROR, no default -layout(r32ui) uniform uimage2D uimg2D; // ERROR, no default - -void qux() -{ - int i = 4; - imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310 - imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); // ERROR no longer in 310 - imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout - imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR img2Drgba is not integer image - ivec4 pos = imageLoad(iimg2D, ivec2(i,i)); - imageStore(ii2da, ivec3(i,i,i), ivec4(0)); - imageLoad(img2Drgba, ivec2(i,i)); - imageLoad(ii2da, ivec3(i,i,i)); // ERROR, drops writeonly -} - -volatile float vol; // ERROR, not an image -readonly int vol2; // ERROR, not an image - -void passr(coherent readonly iimage2D image) -{ -} - -layout(r32i) coherent readonly uniform iimage2D qualim1; -layout(r32i) coherent restrict readonly uniform iimage2D qualim2; - -void passrc() -{ - passr(qualim1); // ERROR, changing formats - passr(qualim2); // ERROR, drops restrict, ERROR, changing formats - passr(iimg2D); // ERROR, changing formats -} - -highp layout(rg8i) uniform readonly uimage2D i1bad; // ERROR, type mismatch -highp layout(rgba32i) uniform readonly image2D i2bad; // ERROR, type mismatch -highp layout(rgba32f) uniform readonly uimage2D i3bad; // ERROR, type mismatch -layout(r8_snorm) uniform readonly iimage2D i4bad; // ERROR, type mismatch -layout(rgba32ui) uniform readonly iimage2D i5bad; // ERROR, type mismatch -layout(r8ui) uniform readonly iimage2D i6bad; // ERROR, type mismatch - -layout(binding = 0) uniform atomic_uint counter; - -uint func(atomic_uint c) -{ - return atomicCounterIncrement(c); -} - -uint func2(out atomic_uint c) // ERROR, output -{ - return counter; // ERROR, type mismatch - return atomicCounter(counter); -} - -void mainAC() -{ - atomic_uint non_uniform_counter; // ERROR - uint val = atomicCounter(counter); - atomicCounterDecrement(counter); -} - -layout(binding = 1) uniform mediump atomic_uint counterBad; // ERROR, not highp - -layout(binding = 2, offset = 4) uniform atomic_uint countArr[4]; -uniform int i; - -void opac() -{ - int a[3]; - a[counter]; // ERROR, non-integer - countArr[2]; - countArr[i]; -} - -shared int atomi; -shared uint atomu; - -void atoms() -{ - int origi = atomicAdd(atomi, 3); - uint origu = atomicAnd(atomu, 7u); - origi = atomicExchange(atomi, 4); - origu = atomicCompSwap(atomu, 10u, 8u); -} - -precision highp atomic_uint; -precision lowp atomic_uint; // ERROR - -precise int pfoo; // ERROR, reserved - -dmat2x4 dm; // ERROR -uniform samplerCubeArray sca; // ERROR -uniform iimage2DRect i2dr; // ERROR -highp uniform image2DMS i2dms; // ERROR -uniform uimage2DMSArray u2dmsa; // ERROR - -highp layout(r32f) coherent volatile restrict readonly writeonly uniform image2D okay1; - layout(r32i) coherent volatile restrict readonly uniform iimage2D okay2; -highp layout(r32ui) coherent volatile restrict writeonly uniform uimage2D okay3; -highp layout(r32f) coherent volatile restrict uniform image2D okay4; - -highp layout(rgba32f) coherent volatile restrict uniform image2D badQ1; // ERROR, bad qualifiers - layout(rgba8i) coherent volatile restrict uniform iimage2D badQ2; // ERROR, bad qualifiers -highp layout(rgba16ui) coherent volatile restrict uniform uimage2D badQ3; // ERROR, bad qualifiers - -writeonly buffer woblock -{ - int value; - float values[]; -} wo; - -void foowo() -{ - float g; - g = wo.values[2]; // ERROR, writeonly - float f = wo.values[2]; // ERROR, writeonly - ++wo.values[2]; // ERROR, writeonly - wo.values[2]--; // ERROR, writeonly - f + wo.values[2]; // ERROR, writeonly - wo.values[2] - f; // ERROR, writeonly - bool b; - b ? f : wo.values[2]; // ERROR, writeonly - b ? wo.values[2] : f; // ERROR, writeonly - if (f == wo.values[2]) // ERROR, writeonly - ++f; - if (f >= wo.values[2]) // ERROR, writeonly - ++f; - f = vec3(wo.values[2]).x; // ERROR, writeonly - ~wo.value; // ERROR, writeonly - wo.values[2] = 3.4; -} - -buffer multioblock -{ - readonly int value; - writeonly float values[]; -} multio; - -void foomultio() -{ - float g; - g = wo.values[2]; // ERROR, writeonly - ~wo.value; - wo.values[2] = 3.4; - wo.value = 2; // ERROR, readonly -} - -in inb { // ERROR - int a; -} inbi; - -out outb { // ERROR - int a; -} outbi; - +#version 310 es + +layout(local_size_x = 2) in; +layout(local_size_x = 16) in; // ERROR, changing +layout(local_size_z = 4096) in; // ERROR, too large +layout(local_size_x = 2) in; +layout(local_size_y = 0) in; // ERROR, 0 not allowed +const int total = gl_MaxComputeWorkGroupCount.y + + gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + +buffer ShaderStorageBlock +{ + int value; + float values[]; +}; + +buffer InvalidShaderStorageBlock +{ + float values[]; // ERROR + int value; +} invalid; + +void main() +{ + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierShared(); + memoryBarrierImage(); + groupMemoryBarrier(); + value = int(values[gl_LocalInvocationIndex]); +} + +layout(location = 2) in vec3 v3; // ERROR +in float f; // ERROR +out float fo; // ERROR + +shared vec4 s; +layout(location = 2) shared vec4 sl; // ERROR +shared float fs = 4.2; // ERROR + +layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +readonly buffer roblock +{ + int value; + float values[]; +} ro; + +void foo() +{ + ro.values[2] = 4.7; // ERROR, readonly + ro.values.length(); + ++s; +} + +buffer vec4 v; // ERROR + +uniform usampler2D us2dbad; // ERROR, default precision + +precision highp usampler2D; +precision highp iimage2DArray; +precision highp iimage2D; + +uniform usampler2D us2d; + +uniform iimage2DArray ii2dabad; // ERROR, not writeonly +uniform writeonly iimage2DArray ii2da; + +layout(r32i) uniform iimage2D iimg2D; +layout(rgba32i) uniform readonly iimage2D iimg2Drgba; +layout(rgba32f) uniform readonly image2D img2Drgba; // ERROR, no default +layout(r32ui) uniform uimage2D uimg2D; // ERROR, no default + +void qux() +{ + int i = 4; + imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310 + imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); // ERROR no longer in 310 + imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout + imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR img2Drgba is not integer image + ivec4 pos = imageLoad(iimg2D, ivec2(i,i)); + imageStore(ii2da, ivec3(i,i,i), ivec4(0)); + imageLoad(img2Drgba, ivec2(i,i)); + imageLoad(ii2da, ivec3(i,i,i)); // ERROR, drops writeonly +} + +volatile float vol; // ERROR, not an image +readonly int vol2; // ERROR, not an image + +void passr(coherent readonly iimage2D image) +{ +} + +layout(r32i) coherent readonly uniform iimage2D qualim1; +layout(r32i) coherent restrict readonly uniform iimage2D qualim2; + +void passrc() +{ + passr(qualim1); // ERROR, changing formats + passr(qualim2); // ERROR, drops restrict, ERROR, changing formats + passr(iimg2D); // ERROR, changing formats +} + +highp layout(rg8i) uniform readonly uimage2D i1bad; // ERROR, type mismatch +highp layout(rgba32i) uniform readonly image2D i2bad; // ERROR, type mismatch +highp layout(rgba32f) uniform readonly uimage2D i3bad; // ERROR, type mismatch +layout(r8_snorm) uniform readonly iimage2D i4bad; // ERROR, type mismatch +layout(rgba32ui) uniform readonly iimage2D i5bad; // ERROR, type mismatch +layout(r8ui) uniform readonly iimage2D i6bad; // ERROR, type mismatch + +layout(binding = 0) uniform atomic_uint counter; + +uint func(atomic_uint c) +{ + return atomicCounterIncrement(c); +} + +uint func2(out atomic_uint c) // ERROR, output +{ + return counter; // ERROR, type mismatch + return atomicCounter(counter); +} + +void mainAC() +{ + atomic_uint non_uniform_counter; // ERROR + uint val = atomicCounter(counter); + atomicCounterDecrement(counter); +} + +layout(binding = 1) uniform mediump atomic_uint counterBad; // ERROR, not highp + +layout(binding = 2, offset = 4) uniform atomic_uint countArr[4]; +uniform int i; + +void opac() +{ + int a[3]; + a[counter]; // ERROR, non-integer + countArr[2]; + countArr[i]; +} + +shared int atomi; +shared uint atomu; + +void atoms() +{ + int origi = atomicAdd(atomi, 3); + uint origu = atomicAnd(atomu, 7u); + origi = atomicExchange(atomi, 4); + origu = atomicCompSwap(atomu, 10u, 8u); +} + +precision highp atomic_uint; +precision lowp atomic_uint; // ERROR + +precise int pfoo; // ERROR, reserved + +dmat2x4 dm; // ERROR +uniform samplerCubeArray sca; // ERROR +uniform iimage2DRect i2dr; // ERROR +highp uniform image2DMS i2dms; // ERROR +uniform uimage2DMSArray u2dmsa; // ERROR + +highp layout(r32f) coherent volatile restrict readonly writeonly uniform image2D okay1; + layout(r32i) coherent volatile restrict readonly uniform iimage2D okay2; +highp layout(r32ui) coherent volatile restrict writeonly uniform uimage2D okay3; +highp layout(r32f) coherent volatile restrict uniform image2D okay4; + +highp layout(rgba32f) coherent volatile restrict uniform image2D badQ1; // ERROR, bad qualifiers + layout(rgba8i) coherent volatile restrict uniform iimage2D badQ2; // ERROR, bad qualifiers +highp layout(rgba16ui) coherent volatile restrict uniform uimage2D badQ3; // ERROR, bad qualifiers + +writeonly buffer woblock +{ + int value; + float values[]; +} wo; + +void foowo() +{ + float g; + g = wo.values[2]; // ERROR, writeonly + float f = wo.values[2]; // ERROR, writeonly + ++wo.values[2]; // ERROR, writeonly + wo.values[2]--; // ERROR, writeonly + f + wo.values[2]; // ERROR, writeonly + wo.values[2] - f; // ERROR, writeonly + bool b; + b ? f : wo.values[2]; // ERROR, writeonly + b ? wo.values[2] : f; // ERROR, writeonly + if (f == wo.values[2]) // ERROR, writeonly + ++f; + if (f >= wo.values[2]) // ERROR, writeonly + ++f; + f = vec3(wo.values[2]).x; // ERROR, writeonly + ~wo.value; // ERROR, writeonly + wo.values[2] = 3.4; +} + +buffer multioblock +{ + readonly int value; + writeonly float values[]; +} multio; + +void foomultio() +{ + float g; + g = wo.values[2]; // ERROR, writeonly + ~wo.value; + wo.values[2] = 3.4; + wo.value = 2; // ERROR, readonly +} + +in inb { // ERROR + int a; +} inbi; + +out outb { // ERROR + int a; +} outbi; + float t__; // ERROR, no __ until revision 310 // ERROR, no __ until revision 310 diff --git a/core/deps/glslang/Test/310.frag b/core/deps/glslang/Test/310.frag index 980b9d8e8..8a11f67a5 100755 --- a/core/deps/glslang/Test/310.frag +++ b/core/deps/glslang/Test/310.frag @@ -1,291 +1,291 @@ -#version 310 es -highp float nodef3(float); // ERROR, no default precision -precision mediump float; -precision highp usampler2D; -precision highp sampler2D; -precision highp isampler2DArray; - -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, not supported - -layout(location = 2) in vec3 v3; -layout(location = 2) in mat4 yi; // ERROR, locations conflict with xi - -uniform sampler2D arrayedSampler[5]; -uniform usampler2D usamp2d; -uniform usampler2DRect samp2dr; // ERROR, reserved -uniform isampler2DArray isamp2DA; - -in vec2 c2D; -uniform int i; - -void main() -{ - vec4 v = texture(arrayedSampler[i], c2D); // ERROR - - ivec2 offsets[4]; - const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); - uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2); // ERROR, not supported - vec4 v4 = textureGather(arrayedSampler[0], c2D); - ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); - iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i); // ERROR, last argument not const - iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4); // ERROR, last argument out of range - iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); - iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(0.5)); - iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); // ERROR, offset not constant -} - -out vec4 outp; -void foo23() -{ - const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); - - textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(c2D)); // ERROR, offset not constant - textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[1]); - textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[2]); // ERROR, offset out of range - textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range - - if (gl_HelperInvocation) - ++outp; - - int sum = gl_MaxVertexImageUniforms + - gl_MaxFragmentImageUniforms + - gl_MaxComputeImageUniforms + - gl_MaxCombinedImageUniforms + - gl_MaxCombinedShaderOutputResources; - - bool b1, b2, b3, b; - - b1 = mix(b2, b3, b); - uvec3 um3 = mix(uvec3(i), uvec3(i), bvec3(b)); - ivec4 im4 = mix(ivec4(i), ivec4(i), bvec4(b)); +#version 310 es +highp float nodef3(float); // ERROR, no default precision +precision mediump float; +precision highp usampler2D; +precision highp sampler2D; +precision highp isampler2DArray; + +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, not supported + +layout(location = 2) in vec3 v3; +layout(location = 2) in mat4 yi; // ERROR, locations conflict with xi + +uniform sampler2D arrayedSampler[5]; +uniform usampler2D usamp2d; +uniform usampler2DRect samp2dr; // ERROR, reserved +uniform isampler2DArray isamp2DA; + +in vec2 c2D; +uniform int i; + +void main() +{ + vec4 v = texture(arrayedSampler[i], c2D); // ERROR + + ivec2 offsets[4]; + const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); + uvec4 uv4 = textureGatherOffsets(samp2dr, c2D, offsets, 2); // ERROR, not supported + vec4 v4 = textureGather(arrayedSampler[0], c2D); + ivec4 iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), i); // ERROR, last argument not const + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 4); // ERROR, last argument out of range + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(0.5)); + iv4 = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); // ERROR, offset not constant +} + +out vec4 outp; +void foo23() +{ + const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); + + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(c2D)); // ERROR, offset not constant + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[1]); + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), offsets[2]); // ERROR, offset out of range + textureProjGradOffset(usamp2d, outp, vec2(0.0), vec2(0.0), ivec2(-10, 20)); // ERROR, offset out of range + + if (gl_HelperInvocation) + ++outp; + + int sum = gl_MaxVertexImageUniforms + + gl_MaxFragmentImageUniforms + + gl_MaxComputeImageUniforms + + gl_MaxCombinedImageUniforms + + gl_MaxCombinedShaderOutputResources; + + bool b1, b2, b3, b; + + b1 = mix(b2, b3, b); + uvec3 um3 = mix(uvec3(i), uvec3(i), bvec3(b)); + ivec4 im4 = mix(ivec4(i), ivec4(i), bvec4(b)); 1 << mix(1u, 1u, false); // does not require folding -} -layout(binding=3) uniform sampler2D s1; -layout(binding=3) uniform sampler2D s2; // ERROR: overlapping bindings? Don't see that in the 310 spec. -highp layout(binding=2) uniform writeonly image2D i2D; - layout(binding=4) uniform readonly image3D i3D; // ERROR, no default precision - layout(binding=5) uniform imageCube iCube; // ERROR, no default precision - layout(binding=6) uniform image2DArray i2DA; // ERROR, no default precision - layout(binding=6) uniform coherent volatile restrict image2D i2Dqualified; // ERROR, no default precision - -layout(binding = 1) uniform bb { - int foo; - layout(binding = 2) float f; // ERROR -} bbi; - -in centroid vec4 centroidIn; -layout(location = 200000) uniform vec4 bigl; // ERROR, location too big - -layout(early_fragment_tests) in; - -layout(location = 40) out vec4 bigout1; // ERROR, too big -layout(location = 40) out vec4 bigout2; // ERROR, overlap -layout(location = -2) out vec4 neg; // ERROR, negative - -layout(std430) buffer b430 { - int i; -} b430i; - -layout(shared) uniform bshar { - int i; -} bshari; - -in smooth vec4 smoothIn; -in flat int flatIn; - -uniform sampler2DMS s2dms; // ERROR, no default precision qualifier - -void foots() -{ - highp ivec2 v2 = textureSize(s1, 2); - highp ivec3 v3 = textureSize(isamp2DA, 3); - v2 = textureSize(s2dms); - v2 = imageSize(i2D); - v3 = imageSize(i3D); - v2 = imageSize(iCube); - v3 = imageSize(i2DA); - v2 = imageSize(i2Dqualified); -} - -out bool bout; // ERROR -highp out image2D imageOut; // ERROR -out mat2x3 mout; // ERROR - -in bool inb; // ERROR -in sampler2D ino; // ERROR -in float ina[4]; -in float inaa[4][2]; // ERROR -struct S { float f; }; -in S ins; -in S[4] inasa; // ERROR -in S insa[4]; // ERROR -struct SA { float f[4]; }; -in SA inSA; // ERROR -struct SS { float f; S s; }; -in SS inSS; // ERROR - -#ifndef GL_EXT_shader_io_blocks -#error GL_EXT_shader_io_blocks not defined -#endif - -#extension GL_EXT_shader_io_blocks : enable - -out outbname { int a; } outbinst; // ERROR, not out block in fragment shader - -in inbname { - int a; - vec4 v; - struct { int b; } s; // ERROR, nested struct definition -} inbinst; - -in inbname2 { - layout(location = 12) int aAnon; - layout(location = 13) centroid in vec4 vAnon; -}; - -in layout(location = 13) vec4 aliased; // ERROR, aliased - -in inbname2 { // ERROR, reuse of block name - int aAnon; - centroid in vec4 vAnon; -}; - -in badmember { // ERROR, aAnon already in global scope - int aAnon; -}; - -int inbname; // ERROR, redefinition of block name - -vec4 vAnon; // ERROR, anon in global scope; redefinition - -in arrayed { - float f; -} arrayedInst[4]; - -void fooIO() -{ - vec4 v = inbinst.v + vAnon; - v *= arrayedInst[2].f; - v *= arrayedInst[i].f; -} - -in vec4 gl_FragCoord; -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES - -layout(early_fragment_tests) in; -out float gl_FragDepth; -layout(depth_any) out float gl_FragDepth; // ERROR, non-ES - -void foo_IO() -{ - gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared - gl_Layer; // ERROR, not present - gl_PrimitiveID; // ERROR, not present - bool f = gl_FrontFacing; -} - -out float gl_FragDepth; - -#extension GL_OES_geometry_shader : enable - -void foo_GS() -{ - highp int l = gl_Layer; - highp int p = gl_PrimitiveID; -} - -in vec2 inf, ing; -uniform ivec2 offsets[4]; -uniform sampler2D sArray[4]; -uniform int sIndex; -layout(binding = 0) uniform atomic_uint auArray[2]; -uniform ubName { int i; } ubInst[4]; -buffer bbName { int i; } bbInst[4]; -highp uniform writeonly image2D iArray[5]; -const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); - -void pfooBad() -{ - precise vec2 h; // ERROR reserved - h = fma(inf, ing, h); // ERROR, not available - textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); // ERROR, offset not constant - textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); // ERROR, not available -} - -#extension GL_OES_gpu_shader5 : enable - -void pfoo() -{ - precise vec2 h; - h = fma(inf, ing, h); - textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); - textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); - textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant -} - -#extension GL_EXT_texture_cube_map_array : enable - -precision highp imageCubeArray ; -precision highp iimageCubeArray ; -precision highp uimageCubeArray ; - -precision highp samplerCubeArray ; -precision highp samplerCubeArrayShadow; -precision highp isamplerCubeArray ; -precision highp usamplerCubeArray ; - -uniform writeonly imageCubeArray CA1; -uniform writeonly iimageCubeArray CA2; -uniform writeonly uimageCubeArray CA3; - -#ifdef GL_EXT_texture_cube_map_array -uniform samplerCubeArray CA4; -uniform samplerCubeArrayShadow CA5; -uniform isamplerCubeArray CA6; -uniform usamplerCubeArray CA7; -#endif - -void CAT() -{ - highp vec4 b4 = texture(CA4, vec4(0.5), 0.24); - highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26); - highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27); -} - -void badSample() -{ - lowp int a1 = gl_SampleID; // ERROR, need extension - mediump vec2 a2 = gl_SamplePosition; // ERROR, need extension - highp int a3 = gl_SampleMaskIn[0]; // ERROR, need extension - gl_SampleMask[0] = a3; // ERROR, need extension - mediump int n = gl_NumSamples; // ERROR, need extension -} - -#ifdef GL_OES_sample_variables -#extension GL_OES_sample_variables : enable -#endif - -void goodSample() -{ - lowp int a1 = gl_SampleID; - mediump vec2 a2 = gl_SamplePosition; - highp int a3 = gl_SampleMaskIn[0]; - gl_SampleMask[0] = a3; - mediump int n1 = gl_MaxSamples; - mediump int n2 = gl_NumSamples; -} - -uniform layout(r32f) highp image2D im2Df; -uniform layout(r32ui) highp uimage2D im2Du; -uniform layout(r32i) highp iimage2D im2Di; -uniform ivec2 P; - -void badImageAtom() -{ - float datf; - int dati; - uint datu; - +} +layout(binding=3) uniform sampler2D s1; +layout(binding=3) uniform sampler2D s2; // ERROR: overlapping bindings? Don't see that in the 310 spec. +highp layout(binding=2) uniform writeonly image2D i2D; + layout(binding=4) uniform readonly image3D i3D; // ERROR, no default precision + layout(binding=5) uniform imageCube iCube; // ERROR, no default precision + layout(binding=6) uniform image2DArray i2DA; // ERROR, no default precision + layout(binding=6) uniform coherent volatile restrict image2D i2Dqualified; // ERROR, no default precision + +layout(binding = 1) uniform bb { + int foo; + layout(binding = 2) float f; // ERROR +} bbi; + +in centroid vec4 centroidIn; +layout(location = 200000) uniform vec4 bigl; // ERROR, location too big + +layout(early_fragment_tests) in; + +layout(location = 40) out vec4 bigout1; // ERROR, too big +layout(location = 40) out vec4 bigout2; // ERROR, overlap +layout(location = -2) out vec4 neg; // ERROR, negative + +layout(std430) buffer b430 { + int i; +} b430i; + +layout(shared) uniform bshar { + int i; +} bshari; + +in smooth vec4 smoothIn; +in flat int flatIn; + +uniform sampler2DMS s2dms; // ERROR, no default precision qualifier + +void foots() +{ + highp ivec2 v2 = textureSize(s1, 2); + highp ivec3 v3 = textureSize(isamp2DA, 3); + v2 = textureSize(s2dms); + v2 = imageSize(i2D); + v3 = imageSize(i3D); + v2 = imageSize(iCube); + v3 = imageSize(i2DA); + v2 = imageSize(i2Dqualified); +} + +out bool bout; // ERROR +highp out image2D imageOut; // ERROR +out mat2x3 mout; // ERROR + +in bool inb; // ERROR +in sampler2D ino; // ERROR +in float ina[4]; +in float inaa[4][2]; // ERROR +struct S { float f; }; +in S ins; +in S[4] inasa; // ERROR +in S insa[4]; // ERROR +struct SA { float f[4]; }; +in SA inSA; // ERROR +struct SS { float f; S s; }; +in SS inSS; // ERROR + +#ifndef GL_EXT_shader_io_blocks +#error GL_EXT_shader_io_blocks not defined +#endif + +#extension GL_EXT_shader_io_blocks : enable + +out outbname { int a; } outbinst; // ERROR, not out block in fragment shader + +in inbname { + int a; + vec4 v; + struct { int b; } s; // ERROR, nested struct definition +} inbinst; + +in inbname2 { + layout(location = 12) int aAnon; + layout(location = 13) centroid in vec4 vAnon; +}; + +in layout(location = 13) vec4 aliased; // ERROR, aliased + +in inbname2 { // ERROR, reuse of block name + int aAnon; + centroid in vec4 vAnon; +}; + +in badmember { // ERROR, aAnon already in global scope + int aAnon; +}; + +int inbname; // ERROR, redefinition of block name + +vec4 vAnon; // ERROR, anon in global scope; redefinition + +in arrayed { + float f; +} arrayedInst[4]; + +void fooIO() +{ + vec4 v = inbinst.v + vAnon; + v *= arrayedInst[2].f; + v *= arrayedInst[i].f; +} + +in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES + +layout(early_fragment_tests) in; +out float gl_FragDepth; +layout(depth_any) out float gl_FragDepth; // ERROR, non-ES + +void foo_IO() +{ + gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared + gl_Layer; // ERROR, not present + gl_PrimitiveID; // ERROR, not present + bool f = gl_FrontFacing; +} + +out float gl_FragDepth; + +#extension GL_OES_geometry_shader : enable + +void foo_GS() +{ + highp int l = gl_Layer; + highp int p = gl_PrimitiveID; +} + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfooBad() +{ + precise vec2 h; // ERROR reserved + h = fma(inf, ing, h); // ERROR, not available + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); // ERROR, offset not constant + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); // ERROR, not available +} + +#extension GL_OES_gpu_shader5 : enable + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +#extension GL_EXT_texture_cube_map_array : enable + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +#ifdef GL_EXT_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp vec4 b4 = texture(CA4, vec4(0.5), 0.24); + highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26); + highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27); +} + +void badSample() +{ + lowp int a1 = gl_SampleID; // ERROR, need extension + mediump vec2 a2 = gl_SamplePosition; // ERROR, need extension + highp int a3 = gl_SampleMaskIn[0]; // ERROR, need extension + gl_SampleMask[0] = a3; // ERROR, need extension + mediump int n = gl_NumSamples; // ERROR, need extension +} + +#ifdef GL_OES_sample_variables +#extension GL_OES_sample_variables : enable +#endif + +void goodSample() +{ + lowp int a1 = gl_SampleID; + mediump vec2 a2 = gl_SamplePosition; + highp int a3 = gl_SampleMaskIn[0]; + gl_SampleMask[0] = a3; + mediump int n1 = gl_MaxSamples; + mediump int n2 = gl_NumSamples; +} + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +void badImageAtom() +{ + float datf; + int dati; + uint datu; + imageAtomicAdd( im2Di, P, dati); // ERROR, need extension imageAtomicAdd( im2Du, P, datu); // ERROR, need extension imageAtomicMin( im2Di, P, dati); // ERROR, need extension @@ -301,24 +301,24 @@ void badImageAtom() imageAtomicExchange(im2Di, P, dati); // ERROR, need extension imageAtomicExchange(im2Du, P, datu); // ERROR, need extension imageAtomicExchange(im2Df, P, datf); // ERROR, need extension - imageAtomicCompSwap(im2Di, P, 3, dati); // ERROR, need extension - imageAtomicCompSwap(im2Du, P, 5u, datu); // ERROR, need extension -} - -#ifdef GL_OES_shader_image_atomic -#extension GL_OES_shader_image_atomic : enable -#endif - -uniform layout(rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly -uniform layout(rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly -uniform layout(rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly - -void goodImageAtom() -{ - float datf; - int dati; - uint datu; - + imageAtomicCompSwap(im2Di, P, 3, dati); // ERROR, need extension + imageAtomicCompSwap(im2Du, P, 5u, datu); // ERROR, need extension +} + +#ifdef GL_OES_shader_image_atomic +#extension GL_OES_shader_image_atomic : enable +#endif + +uniform layout(rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly +uniform layout(rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly +uniform layout(rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + imageAtomicAdd( im2Di, P, dati); imageAtomicAdd( im2Du, P, datu); imageAtomicMin( im2Di, P, dati); @@ -334,75 +334,75 @@ void goodImageAtom() imageAtomicExchange(im2Di, P, dati); imageAtomicExchange(im2Du, P, datu); imageAtomicExchange(im2Df, P, datf); - imageAtomicCompSwap(im2Di, P, 3, dati); - imageAtomicCompSwap(im2Du, P, 5u, datu); - + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); + imageAtomicMax(badIm2Di, P, dati); // ERROR, not an allowed layout() on the image imageAtomicMax(badIm2Du, P, datu); // ERROR, not an allowed layout() on the image imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image -} - -sample in vec4 colorSampInBad; // ERROR, reserved -centroid out vec4 colorCentroidBad; // ERROR -flat out vec4 colorBadFlat; // ERROR -smooth out vec4 colorBadSmooth; // ERROR -noperspective out vec4 colorBadNo; // ERROR -flat centroid in vec2 colorfc; -in float scalarIn; - -void badInterp() -{ - interpolateAtCentroid(colorfc); // ERROR, need extension - interpolateAtSample(colorfc, 1); // ERROR, need extension - interpolateAtOffset(colorfc, vec2(0.2)); // ERROR, need extension -} - -#if defined GL_OES_shader_multisample_interpolation -#extension GL_OES_shader_multisample_interpolation : enable -#endif - -sample in vec4 colorSampIn; -sample out vec4 colorSampleBad; // ERROR -flat sample in vec4 colorfsi; -sample in vec3 sampInArray[4]; - -void interp() -{ - float res; - vec2 res2; - vec3 res3; - vec4 res4; - - res2 = interpolateAtCentroid(colorfc); - res4 = interpolateAtCentroid(colorSampIn); - res4 = interpolateAtCentroid(colorfsi); - res = interpolateAtCentroid(scalarIn); - res3 = interpolateAtCentroid(sampInArray); // ERROR - res3 = interpolateAtCentroid(sampInArray[2]); - res2 = interpolateAtCentroid(sampInArray[2].xy); // ERROR - - res3 = interpolateAtSample(sampInArray, 1); // ERROR - res3 = interpolateAtSample(sampInArray[i], 0); - res2 = interpolateAtSample(sampInArray[2].xy, 2); // ERROR - res = interpolateAtSample(scalarIn, 1); - - res3 = interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR - res3 = interpolateAtOffset(sampInArray[2], vec2(0.2)); - res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle - res = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference - res = interpolateAtOffset(scalarIn, vec2(0.2)); - - float f; - res = interpolateAtCentroid(f); // ERROR, not interpolant - res4 = interpolateAtSample(outp, 0); // ERROR, not interpolant -} - -layout(blend_support_softlight) out; // ERROR, need extension - -#ifdef GL_KHR_blend_equation_advanced -#extension GL_KHR_blend_equation_advanced : enable -#endif - +} + +sample in vec4 colorSampInBad; // ERROR, reserved +centroid out vec4 colorCentroidBad; // ERROR +flat out vec4 colorBadFlat; // ERROR +smooth out vec4 colorBadSmooth; // ERROR +noperspective out vec4 colorBadNo; // ERROR +flat centroid in vec2 colorfc; +in float scalarIn; + +void badInterp() +{ + interpolateAtCentroid(colorfc); // ERROR, need extension + interpolateAtSample(colorfc, 1); // ERROR, need extension + interpolateAtOffset(colorfc, vec2(0.2)); // ERROR, need extension +} + +#if defined GL_OES_shader_multisample_interpolation +#extension GL_OES_shader_multisample_interpolation : enable +#endif + +sample in vec4 colorSampIn; +sample out vec4 colorSampleBad; // ERROR +flat sample in vec4 colorfsi; +sample in vec3 sampInArray[4]; + +void interp() +{ + float res; + vec2 res2; + vec3 res3; + vec4 res4; + + res2 = interpolateAtCentroid(colorfc); + res4 = interpolateAtCentroid(colorSampIn); + res4 = interpolateAtCentroid(colorfsi); + res = interpolateAtCentroid(scalarIn); + res3 = interpolateAtCentroid(sampInArray); // ERROR + res3 = interpolateAtCentroid(sampInArray[2]); + res2 = interpolateAtCentroid(sampInArray[2].xy); // ERROR + + res3 = interpolateAtSample(sampInArray, 1); // ERROR + res3 = interpolateAtSample(sampInArray[i], 0); + res2 = interpolateAtSample(sampInArray[2].xy, 2); // ERROR + res = interpolateAtSample(scalarIn, 1); + + res3 = interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR + res3 = interpolateAtOffset(sampInArray[2], vec2(0.2)); + res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle + res = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference + res = interpolateAtOffset(scalarIn, vec2(0.2)); + + float f; + res = interpolateAtCentroid(f); // ERROR, not interpolant + res4 = interpolateAtSample(outp, 0); // ERROR, not interpolant +} + +layout(blend_support_softlight) out; // ERROR, need extension + +#ifdef GL_KHR_blend_equation_advanced +#extension GL_KHR_blend_equation_advanced : enable +#endif + layout(blend_support_multiply) out; layout(blend_support_screen) out; layout(blend_support_overlay) out; diff --git a/core/deps/glslang/Test/310.geom b/core/deps/glslang/Test/310.geom index f93bdbfa4..bf0b1ae04 100644 --- a/core/deps/glslang/Test/310.geom +++ b/core/deps/glslang/Test/310.geom @@ -1,152 +1,152 @@ -#version 310 es - -#ifdef GL_EXT_geometry_shader -#extension GL_EXT_geometry_shader : enable -#else -#error no GL_EXT_geometry_shader -#endif - -#ifndef GL_OES_geometry_shader -#error no GL_OES_geometry_shader -#endif - -precision mediump float; - -in fromVertex { - in vec3 color; -} fromV[]; - -in vec4 nonBlockUnsized[]; - -out toFragment { - out vec3 color; -} toF; - -out fromVertex { // okay to reuse a block name for another block name - vec3 color; -}; - -out fooB { // ERROR, cannot reuse block name as block instance - vec2 color; -} fromVertex; - -int fromVertex; // ERROR, cannot reuse a block name for something else - -out fooC { // ERROR, cannot have same name for block and instance name - vec2 color; -} fooC; - -void main() -{ - EmitVertex(); - EndPrimitive(); - EmitStreamVertex(1); // ERROR - EndStreamPrimitive(0); // ERROR - - color = fromV[0].color; - gl_ClipDistance[3] = // ERROR, no ClipDistance - gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance - gl_Position = gl_in[0].gl_Position; - - gl_PrimitiveID = gl_PrimitiveIDIn; - gl_Layer = 2; -} - -layout(stream = 4) out vec4 ov4; // ERROR, no streams - -layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip" - -out ooutb { vec4 a; } ouuaa6; - -layout(max_vertices = 200) out; -layout(max_vertices = 300) out; // ERROR, too big -void foo(layout(max_vertices = 4) int a) // ERROR -{ - ouuaa6.a = vec4(1.0); -} - -layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive -layout(line_strip, points) out; // ERROR, changing output primitive -layout(triangle_strip) in; // ERROR, not an input primitive -layout(triangle_strip) uniform; // ERROR -layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable -layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input -layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 -out outbn2 { - layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 - layout(max_vertices = 3) int b; // ERROR, not on a block member - layout(triangle_strip) int c; // ERROR, not on a block member -} outbi; - -layout(lines) out; // ERROR, not on output -layout(lines_adjacency) in; -layout(triangles) in; // ERROR, can't change it -layout(triangles_adjacency) in; // ERROR, can't change it -layout(invocations = 4) in; - -in sameName { - int a15; -} insn[]; - -out sameName { - float f15; -}; - -uniform sameName { - bool b15; -}; - -const int summ = gl_MaxVertexAttribs + - gl_MaxGeometryInputComponents + - gl_MaxGeometryOutputComponents + - gl_MaxGeometryImageUniforms + - gl_MaxGeometryTextureImageUnits + - gl_MaxGeometryOutputVertices + - gl_MaxGeometryTotalOutputComponents + - gl_MaxGeometryUniformComponents + - gl_MaxGeometryAtomicCounters + - gl_MaxGeometryAtomicCounterBuffers + - gl_MaxVertexTextureImageUnits + - gl_MaxCombinedTextureImageUnits + - gl_MaxTextureImageUnits + - gl_MaxDrawBuffers; - -void fooe1() -{ - gl_ViewportIndex; // ERROR, not in ES - gl_MaxViewports; // ERROR, not in ES - insn.length(); // 4: lines_adjacency - int inv = gl_InvocationID; -} - -in vec4 explArray[4]; -in vec4 explArrayBad[5]; // ERROR, wrong size -in vec4 nonArrayed; // ERROR, not an array -flat out vec3 myColor1; -centroid out vec3 myColor2; -centroid in vec3 centr[]; -sample out vec4 perSampleColor; // ERROR without sample extensions - -layout(max_vertices = 200) out; // matching redecl - -layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component - -void notHere() -{ - gl_MaxGeometryVaryingComponents; // ERROR, not in ES - gl_VerticesIn; // ERROR, not in ES -} - -void pointSize1() -{ - highp float ps = gl_in[3].gl_PointSize; // ERROR, need point_size extension - gl_PointSize = ps; // ERROR, need point_size extension -} - -#extension GL_OES_geometry_point_size : enable - -void pointSize2() -{ - highp float ps = gl_in[3].gl_PointSize; - gl_PointSize = ps; -} +#version 310 es + +#ifdef GL_EXT_geometry_shader +#extension GL_EXT_geometry_shader : enable +#else +#error no GL_EXT_geometry_shader +#endif + +#ifndef GL_OES_geometry_shader +#error no GL_OES_geometry_shader +#endif + +precision mediump float; + +in fromVertex { + in vec3 color; +} fromV[]; + +in vec4 nonBlockUnsized[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { // okay to reuse a block name for another block name + vec3 color; +}; + +out fooB { // ERROR, cannot reuse block name as block instance + vec2 color; +} fromVertex; + +int fromVertex; // ERROR, cannot reuse a block name for something else + +out fooC { // ERROR, cannot have same name for block and instance name + vec2 color; +} fooC; + +void main() +{ + EmitVertex(); + EndPrimitive(); + EmitStreamVertex(1); // ERROR + EndStreamPrimitive(0); // ERROR + + color = fromV[0].color; + gl_ClipDistance[3] = // ERROR, no ClipDistance + gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance + gl_Position = gl_in[0].gl_Position; + + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; +} + +layout(stream = 4) out vec4 ov4; // ERROR, no streams + +layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip" + +out ooutb { vec4 a; } ouuaa6; + +layout(max_vertices = 200) out; +layout(max_vertices = 300) out; // ERROR, too big +void foo(layout(max_vertices = 4) int a) // ERROR +{ + ouuaa6.a = vec4(1.0); +} + +layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive +layout(line_strip, points) out; // ERROR, changing output primitive +layout(triangle_strip) in; // ERROR, not an input primitive +layout(triangle_strip) uniform; // ERROR +layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable +layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input +layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 +out outbn2 { + layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 + layout(max_vertices = 3) int b; // ERROR, not on a block member + layout(triangle_strip) int c; // ERROR, not on a block member +} outbi; + +layout(lines) out; // ERROR, not on output +layout(lines_adjacency) in; +layout(triangles) in; // ERROR, can't change it +layout(triangles_adjacency) in; // ERROR, can't change it +layout(invocations = 4) in; + +in sameName { + int a15; +} insn[]; + +out sameName { + float f15; +}; + +uniform sameName { + bool b15; +}; + +const int summ = gl_MaxVertexAttribs + + gl_MaxGeometryInputComponents + + gl_MaxGeometryOutputComponents + + gl_MaxGeometryImageUniforms + + gl_MaxGeometryTextureImageUnits + + gl_MaxGeometryOutputVertices + + gl_MaxGeometryTotalOutputComponents + + gl_MaxGeometryUniformComponents + + gl_MaxGeometryAtomicCounters + + gl_MaxGeometryAtomicCounterBuffers + + gl_MaxVertexTextureImageUnits + + gl_MaxCombinedTextureImageUnits + + gl_MaxTextureImageUnits + + gl_MaxDrawBuffers; + +void fooe1() +{ + gl_ViewportIndex; // ERROR, not in ES + gl_MaxViewports; // ERROR, not in ES + insn.length(); // 4: lines_adjacency + int inv = gl_InvocationID; +} + +in vec4 explArray[4]; +in vec4 explArrayBad[5]; // ERROR, wrong size +in vec4 nonArrayed; // ERROR, not an array +flat out vec3 myColor1; +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions + +layout(max_vertices = 200) out; // matching redecl + +layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component + +void notHere() +{ + gl_MaxGeometryVaryingComponents; // ERROR, not in ES + gl_VerticesIn; // ERROR, not in ES +} + +void pointSize1() +{ + highp float ps = gl_in[3].gl_PointSize; // ERROR, need point_size extension + gl_PointSize = ps; // ERROR, need point_size extension +} + +#extension GL_OES_geometry_point_size : enable + +void pointSize2() +{ + highp float ps = gl_in[3].gl_PointSize; + gl_PointSize = ps; +} diff --git a/core/deps/glslang/Test/310.inheritMemory.frag b/core/deps/glslang/Test/310.inheritMemory.frag index 04544304a..bdf128327 100644 --- a/core/deps/glslang/Test/310.inheritMemory.frag +++ b/core/deps/glslang/Test/310.inheritMemory.frag @@ -1,43 +1,43 @@ -#version 310 es -precision mediump float; - -struct S { - float buff[10]; -}; - -layout(std430, binding=2) readonly buffer RoBuff { - float buff_ro[10]; - S s_ro; -} ro_buffer; - -layout(std430, binding=2) buffer Buff { - float buff[10]; - S s; -} non_ro_buffer; - -void non_ro_fun(float[10] buff) { } -void non_ro_funf(float el) { } -void non_ro_funS(S s) { } - -out vec4 fragColor; - -void main() -{ - S s; - - non_ro_fun(s.buff); - non_ro_funf(s.buff[3]); - non_ro_funS(s); - - non_ro_fun(non_ro_buffer.buff); - non_ro_fun(non_ro_buffer.s.buff); - non_ro_funf(non_ro_buffer.buff[3]); - non_ro_funf(non_ro_buffer.s.buff[3]); - non_ro_funS(non_ro_buffer.s); - - non_ro_fun(ro_buffer.buff_ro); - non_ro_fun(ro_buffer.s_ro.buff); - non_ro_funf(ro_buffer.buff_ro[3]); - non_ro_funf(ro_buffer.s_ro.buff[3]); - non_ro_funS(ro_buffer.s_ro); -} +#version 310 es +precision mediump float; + +struct S { + float buff[10]; +}; + +layout(std430, binding=2) readonly buffer RoBuff { + float buff_ro[10]; + S s_ro; +} ro_buffer; + +layout(std430, binding=2) buffer Buff { + float buff[10]; + S s; +} non_ro_buffer; + +void non_ro_fun(float[10] buff) { } +void non_ro_funf(float el) { } +void non_ro_funS(S s) { } + +out vec4 fragColor; + +void main() +{ + S s; + + non_ro_fun(s.buff); + non_ro_funf(s.buff[3]); + non_ro_funS(s); + + non_ro_fun(non_ro_buffer.buff); + non_ro_fun(non_ro_buffer.s.buff); + non_ro_funf(non_ro_buffer.buff[3]); + non_ro_funf(non_ro_buffer.s.buff[3]); + non_ro_funS(non_ro_buffer.s); + + non_ro_fun(ro_buffer.buff_ro); + non_ro_fun(ro_buffer.s_ro.buff); + non_ro_funf(ro_buffer.buff_ro[3]); + non_ro_funf(ro_buffer.s_ro.buff[3]); + non_ro_funS(ro_buffer.s_ro); +} diff --git a/core/deps/glslang/Test/310.tesc b/core/deps/glslang/Test/310.tesc index 1694a793a..7b8d0db80 100644 --- a/core/deps/glslang/Test/310.tesc +++ b/core/deps/glslang/Test/310.tesc @@ -1,184 +1,184 @@ -#version 310 es - -#extension GL_OES_tessellation_shader : enable - -layout(vertices = 4) out; -out int outa[gl_out.length()]; - -layout(quads) in; // ERROR -layout(ccw) out; // ERROR -layout(fractional_even_spacing) in; // ERROR - -patch in vec4 patchIn; // ERROR -patch out vec4 patchOut; - -void main() -{ - barrier(); - - int a = gl_MaxTessControlInputComponents + - gl_MaxTessControlOutputComponents + - gl_MaxTessControlTextureImageUnits + - gl_MaxTessControlUniformComponents + - gl_MaxTessControlTotalOutputComponents; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension - float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - int iid = gl_InvocationID; - - gl_out[gl_InvocationID].gl_Position = p; - gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension - gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES - - gl_TessLevelOuter[3] = 3.2; - gl_TessLevelInner[1] = 1.3; - - if (a > 10) - barrier(); // ERROR - else - barrier(); // ERROR - - barrier(); - - do { - barrier(); // ERROR - } while (a > 10); - - switch (a) { - default: - barrier(); // ERROR - break; - } - a < 12 ? a : (barrier(), a); // ERROR - { - barrier(); - } - - return; - - barrier(); // ERROR -} - -layout(vertices = 4) in; // ERROR, not on in -layout(vertices = 5) out; // ERROR, changing # - -void foo() -{ - gl_out[4].gl_Position; // ERROR, out of range - - barrier(); // ERROR, not in main -} - -in vec2 ina; // ERROR, not array -in vec2 inb[]; -in vec2 inc[18]; // ERROR, wrong size -in vec2 ind[gl_MaxPatchVertices]; -patch out float implA[]; // ERROR, not sized - -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 3) in vec4 ivla[]; -layout(location = 4) in vec4 ivlb[]; -layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping - -layout(location = 3) out vec4 ovla[]; -layout(location = 4) out vec4 ovlb[]; -layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping - -void foop() -{ - precise float d; // ERROR without gpu_shader5 - d = fma(d, d, d); // ERROR without gpu_shader5 -} - -patch out pinbn { - int a; -} pinbi; - -centroid out vec3 myColor2[]; -centroid in vec3 centr[]; -sample out vec4 perSampleColor[]; // ERROR without sample extensions - -layout(vertices = 4) out float badlay[]; // ERROR, not on a variable -out float misSized[5]; // ERROR, size doesn't match -out float okaySize[4]; - -#extension GL_OES_tessellation_point_size : enable - -void pointSize2() -{ - float ps = gl_in[1].gl_PointSize; - gl_out[gl_InvocationID].gl_PointSize = ps; -} - -#extension GL_OES_gpu_shader5 : enable - -precise vec3 pv3; - -void goodfoop() -{ - precise float d; - - pv3 *= pv3; - pv3 = fma(pv3, pv3, pv3); - d = fma(d, d, d); -} - -void bbextBad() -{ - gl_BoundingBoxEXT; // ERROR without GL_EXT_primitive_bounding_box - gl_BoundingBox; // ERROR, version < 320 -} - -#extension GL_EXT_primitive_bounding_box : enable - -void bbext() -{ - gl_BoundingBoxEXT[0] = vec4(0.0); - gl_BoundingBoxEXT[1] = vec4(1.0); - gl_BoundingBoxEXT[2] = vec4(2.0); // ERROR, overflow -} - -void bbBad() -{ - gl_BoundingBoxOES; // ERROR without GL_OES_primitive_bounding_box -} - -#extension GL_OES_primitive_bounding_box : enable - -void bb() -{ - gl_BoundingBoxOES[0] = vec4(0.0); - gl_BoundingBoxOES[1] = vec4(1.0); - gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow -} - -out patch badpatchBName { // ERROR, array size required - float f; -} badpatchIName[]; - -out patch patchBName { - float f; -} patchIName[4]; - -void outputtingOutparam(out int a) -{ - a = 2; -} - -void outputting() -{ - outa[gl_InvocationID] = 2; - outa[1] = 2; // ERROR, not gl_InvocationID - gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID - outa[1]; - gl_out[0]; - outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID - outputtingOutparam(outa[gl_InvocationID]); - patchIName[1].f = 3.14; - outa[(gl_InvocationID)] = 2; -} +#version 310 es + +#extension GL_OES_tessellation_shader : enable + +layout(vertices = 4) out; +out int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR, not on in +layout(vertices = 5) out; // ERROR, changing # + +void foo() +{ + gl_out[4].gl_Position; // ERROR, out of range + + barrier(); // ERROR, not in main +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; +patch out float implA[]; // ERROR, not sized + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +void foop() +{ + precise float d; // ERROR without gpu_shader5 + d = fma(d, d, d); // ERROR without gpu_shader5 +} + +patch out pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2[]; +centroid in vec3 centr[]; +sample out vec4 perSampleColor[]; // ERROR without sample extensions + +layout(vertices = 4) out float badlay[]; // ERROR, not on a variable +out float misSized[5]; // ERROR, size doesn't match +out float okaySize[4]; + +#extension GL_OES_tessellation_point_size : enable + +void pointSize2() +{ + float ps = gl_in[1].gl_PointSize; + gl_out[gl_InvocationID].gl_PointSize = ps; +} + +#extension GL_OES_gpu_shader5 : enable + +precise vec3 pv3; + +void goodfoop() +{ + precise float d; + + pv3 *= pv3; + pv3 = fma(pv3, pv3, pv3); + d = fma(d, d, d); +} + +void bbextBad() +{ + gl_BoundingBoxEXT; // ERROR without GL_EXT_primitive_bounding_box + gl_BoundingBox; // ERROR, version < 320 +} + +#extension GL_EXT_primitive_bounding_box : enable + +void bbext() +{ + gl_BoundingBoxEXT[0] = vec4(0.0); + gl_BoundingBoxEXT[1] = vec4(1.0); + gl_BoundingBoxEXT[2] = vec4(2.0); // ERROR, overflow +} + +void bbBad() +{ + gl_BoundingBoxOES; // ERROR without GL_OES_primitive_bounding_box +} + +#extension GL_OES_primitive_bounding_box : enable + +void bb() +{ + gl_BoundingBoxOES[0] = vec4(0.0); + gl_BoundingBoxOES[1] = vec4(1.0); + gl_BoundingBoxOES[2] = vec4(2.0); // ERROR, overflow +} + +out patch badpatchBName { // ERROR, array size required + float f; +} badpatchIName[]; + +out patch patchBName { + float f; +} patchIName[4]; + +void outputtingOutparam(out int a) +{ + a = 2; +} + +void outputting() +{ + outa[gl_InvocationID] = 2; + outa[1] = 2; // ERROR, not gl_InvocationID + gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID + outa[1]; + gl_out[0]; + outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID + outputtingOutparam(outa[gl_InvocationID]); + patchIName[1].f = 3.14; + outa[(gl_InvocationID)] = 2; +} diff --git a/core/deps/glslang/Test/310.tese b/core/deps/glslang/Test/310.tese index 69d9b241d..bbeaa87fc 100644 --- a/core/deps/glslang/Test/310.tese +++ b/core/deps/glslang/Test/310.tese @@ -1,128 +1,128 @@ -#version 310 es - -#extension GL_EXT_tessellation_shader : enable -#extension GL_OES_tessellation_shader : enable -#extension GL_EXT_tessellation_shader : disable - -layout(vertices = 4) out; // ERROR -layout(quads, cw) in; -layout(triangles) in; // ERROR -layout(isolines) in; // ERROR - -layout(ccw) in; // ERROR -layout(cw) in; - -layout(fractional_odd_spacing) in; -layout(equal_spacing) in; // ERROR -layout(fractional_even_spacing) in; // ERROR - -layout(point_mode) in; - -patch in vec4 patchIn; -patch out vec4 patchOut; // ERROR - -void main() -{ - barrier(); // ERROR - - int a = gl_MaxTessEvaluationInputComponents + - gl_MaxTessEvaluationOutputComponents + - gl_MaxTessEvaluationTextureImageUnits + - gl_MaxTessEvaluationUniformComponents + - gl_MaxTessPatchComponents + - gl_MaxPatchVertices + - gl_MaxTessGenLevel; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension - float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - vec3 tc = gl_TessCoord; - float tlo = gl_TessLevelOuter[3]; - float tli = gl_TessLevelInner[1]; - - gl_Position = p; - gl_PointSize = ps; // ERROR, need point_size extension - gl_ClipDistance[2] = cd; // ERROR, not in ES -} - -smooth patch in vec4 badp1; // ERROR -flat patch in vec4 badp2; // ERROR -noperspective patch in vec4 badp3; // ERROR -patch sample in vec3 badp4; // ERROR - -#extension GL_ARB_separate_shader_objects : enable - -in gl_PerVertex -{ - vec4 gl_Position; -} gl_in[]; - -in gl_PerVertex // ERROR, second redeclaration of gl_in -{ - vec4 gl_Position; -} gl_in[]; - -layout(quads, cw) out; // ERROR -layout(triangles) out; // ERROR -layout(isolines) out; // ERROR -layout(cw) out; // ERROR -layout(fractional_odd_spacing) out; // ERROR -layout(equal_spacing) out; // ERROR -layout(fractional_even_spacing) out; // ERROR -layout(point_mode) out; // ERROR - -in vec2 ina; // ERROR, not array -in vec2 inb[]; -in vec2 inc[18]; // ERROR, wrong size -in vec2 ind[gl_MaxPatchVertices]; - -in testbla { // ERROR, not array - int f; -} bla; - -in testblb { - int f; -} blb[]; - -in testblc { // ERROR wrong size - int f; -} blc[18]; - -in testbld { - int f; -} bld[gl_MaxPatchVertices]; - -layout(location = 23) in vec4 ivla[]; -layout(location = 24) in vec4 ivlb[]; -layout(location = 24) in vec4 ivlc[]; // ERROR, overlap - -layout(location = 23) out vec4 ovla[2]; -layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap - -in float gl_TessLevelOuter[4]; // ERROR, can't redeclare - -patch in pinbn { - int a; -} pinbi; - -centroid out vec3 myColor2; -centroid in vec3 centr[]; -sample out vec4 perSampleColor; // ERROR without sample extensions - -#extension GL_OES_tessellation_point_size : enable - -void pointSize2() -{ - float ps = gl_in[1].gl_PointSize; // ERROR, not in the redeclaration, but no error on use of gl_PointSize - gl_PointSize = ps; -} - -#extension GL_EXT_primitive_bounding_box : enable - -void bbbad() -{ - gl_BoundingBoxOES; // ERROR, wrong stage -} +#version 310 es + +#extension GL_EXT_tessellation_shader : enable +#extension GL_OES_tessellation_shader : enable +#extension GL_EXT_tessellation_shader : disable + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; // ERROR, need point_size extension + gl_ClipDistance[2] = cd; // ERROR, not in ES +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + vec4 gl_Position; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + vec4 gl_Position; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { // ERROR, not array + int f; +} bla; + +in testblb { + int f; +} blb[]; + +in testblc { // ERROR wrong size + int f; +} blc[18]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR, overlap + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions + +#extension GL_OES_tessellation_point_size : enable + +void pointSize2() +{ + float ps = gl_in[1].gl_PointSize; // ERROR, not in the redeclaration, but no error on use of gl_PointSize + gl_PointSize = ps; +} + +#extension GL_EXT_primitive_bounding_box : enable + +void bbbad() +{ + gl_BoundingBoxOES; // ERROR, wrong stage +} diff --git a/core/deps/glslang/Test/310.vert b/core/deps/glslang/Test/310.vert index c2c37f1ef..92a50e2ef 100644 --- a/core/deps/glslang/Test/310.vert +++ b/core/deps/glslang/Test/310.vert @@ -1,372 +1,372 @@ -#version 310 es - -shared vec4 s; // ERROR -layout(local_size_x = 2) out; // ERROR -buffer vec4 v; // ERROR -in int ini; -layout(location = 2) uniform mat4 x; -layout(location = 3) uniform mat4 y; -layout(location = 2) out mat4 xi; -layout(location = 3) out mat4 yi; // ERROR, locations conflict with xi - -void main() -{ - uvec2 u2; - u2 = uaddCarry(u2, u2, u2); - uint u1; - u1 = usubBorrow(u1, u1, u1); - uvec4 u4; - umulExtended(u4, u4, u4, u4); - ivec4 i4; - imulExtended(i4, i4, i4, i4); - int i1; - i1 = bitfieldExtract(i1, 4, 5); - uvec3 u3; - u3 = bitfieldExtract(u3, 4, 5); - ivec3 i3; - i3 = bitfieldInsert(i3, i3, 4, 5); - u1 = bitfieldInsert(u1, u1, 4, 5); - ivec2 i2; - i2 = bitfieldReverse(i2); - u4 = bitfieldReverse(u4); - i1 = bitCount(i1); - i3 = bitCount(u3); - i2 = findLSB(i2); - i4 = findLSB(u4); - i1 = findMSB(i1); - i2 = findMSB(u2); - - vec3 v3; - v3 = frexp(v3, i3); - vec2 v2; - v2 = ldexp(v2, i2); - - mediump vec4 v4; - u1 = packUnorm4x8(v4); - u1 = packSnorm4x8(v4); - v4 = unpackUnorm4x8(u1); - v4 = unpackSnorm4x8(u1); -} - -precision highp sampler2DMS; -precision highp isampler2DMS; -precision highp usampler2DMS; - -uniform sampler2DMS s2dms; -uniform isampler2DMS is2dms; -uniform usampler2DMS us2dms; -uniform usampler2DMSArray us2dmsa; // ERROR - -void foo() -{ - ivec2 v2; - v2 = textureSize(s2dms); - v2 = textureSize(us2dms); - vec4 v4 = texelFetch(s2dms, v2, 2); - ivec4 iv4 = texelFetch(is2dms, v2, 2); - textureSamples(s2dms); // ERROR - float f; - frexp(f, ini); // ERROR, i not writable -} - -out bool outb; // ERROR -out sampler2D outo; // ERROR -out float outa[4]; -out float outaa[4][2]; // ERROR -struct S { float f; }; -out S outs; -out S[4] outasa; // ERROR -out S outsa[4]; // ERROR -struct SA { float f[4]; }; -out SA outSA; // ERROR -struct SS { float f; S s; }; -out SS outSS; // ERROR - -layout(std430) uniform U430 { int a; } U430i; // ERROR -layout(std430) buffer B430 { int a; } B430i; - -#ifndef GL_OES_shader_io_blocks -#error GL_OES_shader_io_blocks not defined -#endif - -#extension GL_OES_shader_io_blocks : enable - -out outbname { - int a; - out vec4 v; - highp sampler2D s; // ERROR, opaque type -} outbinst; - -out outbname2 { - layout(location = 12) int aAnon; - layout(location = 13) vec4 vAnon; -}; - -layout(location = 12) out highp int aliased; // ERROR, aliasing location - -in inbname { int a; } inbinst; // ERROR, no in block in vertex shader - -out gl_PerVertex { // ERROR, has extra member - highp vec4 gl_Position; - highp vec4 t; -}; - -void foo_IO() -{ - int sum = gl_VertexID + - gl_InstanceID; - gl_Position = vec4(1.0); - gl_PointSize = 2.0; // ERROR, removed by redeclaration -} - -out gl_PerVertex { // ERROR, already used and already redeclared - highp vec4 gl_Position; - highp vec4 t; -}; - -smooth out smo { // ERROR, no smooth on a block - int i; -} smon; - -flat out fmo { // ERROR, no flat on a block - int i; -} fmon; - -centroid out cmo { // ERROR, no centroid on a block - int i; -} cmon; - -invariant out imo { // ERROR, no invariant on a block - int i; -} imon; - -in vec2 inf, ing; -uniform ivec2 offsets[4]; -uniform sampler2D sArray[4]; -uniform int sIndex; -layout(binding = 0) uniform atomic_uint auArray[2]; -uniform ubName { int i; } ubInst[4]; -buffer bbName { int i; } bbInst[4]; -highp uniform writeonly image2D iArray[5]; -const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); - -void pfooBad() -{ - precise vec2 h; // ERROR reserved - h = fma(inf, ing, h); // ERROR, not available - sArray[sIndex + 1]; // ERRRO, not supported - auArray[sIndex + 1]; - ubInst[1]; - bbInst[2]; - ubInst[sIndex + 1]; // ERROR, not supported - bbInst[sIndex]; // ERROR, not supported - iArray[2]; - iArray[sIndex * 2]; // ERROR, not supported - textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); // ERROR, offset not constant - textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); // ERROR, not available -} - -#extension GL_OES_gpu_shader5 : enable - -void pfoo() -{ - precise vec2 h; - h = fma(inf, ing, h); - sArray[sIndex + 1]; - ubInst[sIndex + 1]; - bbInst[sIndex - 2]; // ERROR, still not supported - iArray[2]; - iArray[sIndex - 2]; - textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); - textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); - textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant -} - -uniform samplerBuffer badSamp1; // ERROR, reserved -uniform isamplerBuffer badSamp2; // ERROR, reserved -uniform usamplerBuffer badSamp3; // ERROR, reserved -uniform writeonly imageBuffer badSamp4; // ERROR, reserved -uniform writeonly iimageBuffer badSamp5; // ERROR, reserved -uniform writeonly uimageBuffer badSamp6; // ERROR, reserved - -#extension GL_OES_texture_buffer : enable -#extension GL_EXT_texture_buffer : enable - -uniform samplerBuffer noPreSamp1; // ERROR, no default precision -uniform isamplerBuffer noPreSamp2; // ERROR, no default precision -uniform usamplerBuffer noPreSamp3; // ERROR, no default precision -uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision -uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision -uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision - -precision highp samplerBuffer; -precision highp isamplerBuffer; -precision highp usamplerBuffer; -precision highp imageBuffer; -precision highp iimageBuffer; -precision highp uimageBuffer; - -#ifdef GL_OES_texture_buffer -uniform samplerBuffer bufSamp1; -uniform isamplerBuffer bufSamp2; -uniform usamplerBuffer bufSamp3; -#endif -#ifdef GL_EXT_texture_buffer -uniform writeonly imageBuffer bufSamp4; -uniform writeonly iimageBuffer bufSamp5; -uniform writeonly uimageBuffer bufSamp6; -#endif - -void bufferT() -{ - highp int s1 = textureSize(bufSamp1); - highp int s2 = textureSize(bufSamp2); - highp int s3 = textureSize(bufSamp3); - - highp int s4 = imageSize(bufSamp4); - highp int s5 = imageSize(bufSamp5); - highp int s6 = imageSize(bufSamp6); - - highp vec4 f1 = texelFetch(bufSamp1, s1); - highp ivec4 f2 = texelFetch(bufSamp2, s2); - highp uvec4 f3 = texelFetch(bufSamp3, s3); -} - -uniform writeonly imageCubeArray badCA1; // ERROR, reserved -uniform writeonly iimageCubeArray badCA2; // ERROR, reserved -uniform writeonly uimageCubeArray badCA3; // ERROR, reserved - -uniform samplerCubeArray badCA4; // ERROR, reserved -uniform samplerCubeArrayShadow badCA5; // ERROR, reserved -uniform isamplerCubeArray badCA6; // ERROR, reserved -uniform usamplerCubeArray badCA7; // ERROR, reserved - -#extension GL_OES_texture_cube_map_array : enable - -uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision -uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision -uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision - -uniform samplerCubeArray noPreCA4; // ERROR, no default precision -uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision -uniform isamplerCubeArray noPreCA6; // ERROR, no default precision -uniform usamplerCubeArray noPreCA7; // ERROR, no default precision - -precision highp imageCubeArray ; -precision highp iimageCubeArray ; -precision highp uimageCubeArray ; - -precision highp samplerCubeArray ; -precision highp samplerCubeArrayShadow; -precision highp isamplerCubeArray ; -precision highp usamplerCubeArray ; - -uniform writeonly imageCubeArray CA1; -uniform writeonly iimageCubeArray CA2; -uniform writeonly uimageCubeArray CA3; - -layout(rgba16f) uniform readonly imageCubeArray rCA1; -layout(rgba32i) uniform readonly iimageCubeArray rCA2; -layout(r32ui) uniform readonly uimageCubeArray rCA3; - -#ifdef GL_OES_texture_cube_map_array -uniform samplerCubeArray CA4; -uniform samplerCubeArrayShadow CA5; -uniform isamplerCubeArray CA6; -uniform usamplerCubeArray CA7; -#endif - -void CAT() -{ - highp ivec3 s4 = textureSize(CA4, 1); - highp ivec3 s5 = textureSize(CA5, 1); - highp ivec3 s6 = textureSize(CA6, 1); - highp ivec3 s7 = textureSize(CA7, 1); - - highp vec4 t4 = texture(CA4, vec4(0.5)); - highp float t5 = texture(CA5, vec4(0.5), 3.0); - highp ivec4 t6 = texture(CA6, vec4(0.5)); - highp uvec4 t7 = texture(CA7, vec4(0.5)); - - highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24); - highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26); - highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27); - - highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2)); - highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2)); - highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2)); - - highp vec4 gath4 = textureGather(CA4, vec4(0.5)); - highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2); - highp ivec4 gath6 = textureGather(CA6, vec4(0.5)); - highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1); - highp uvec4 gath7 = textureGather(CA7, vec4(0.5)); - highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0); - - highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5); - - highp ivec3 s1 = imageSize(CA1); - highp ivec3 s2 = imageSize(CA2); - highp ivec3 s3 = imageSize(CA3); - - imageStore(CA1, s3, vec4(1)); - imageStore(CA2, s3, ivec4(1)); - imageStore(CA3, s3, uvec4(1)); - - highp vec4 cl1 = imageLoad(rCA1, s3); - highp ivec4 cl2 = imageLoad(rCA2, s3); - highp uvec4 cl3 = imageLoad(rCA3, s3); -} - -uniform sampler2DMSArray bad2DMS; // ERROR, reserved -uniform isampler2DMSArray bad2DMSi; // ERROR, reserved -uniform usampler2DMSArray bad2DMSu; // ERROR, reserved - -#extension GL_OES_texture_storage_multisample_2d_array : enable - -#ifdef GL_OES_texture_storage_multisample_2d_array - -uniform sampler2DMSArray noPrec2DMS; // ERROR, no default -uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default -uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default - -#endif - -precision highp sampler2DMSArray; -precision highp isampler2DMSArray; -precision highp usampler2DMSArray; - -uniform sampler2DMSArray samp2DMSA; -uniform isampler2DMSArray samp2DMSAi; -uniform usampler2DMSArray samp2DMSAu; - -void MSA() -{ - vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2); - ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2); - uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2); - - ivec3 tfs = textureSize(samp2DMSA); - ivec3 tfsi = textureSize(samp2DMSAi); - ivec3 tfsb = textureSize(samp2DMSAi, 4); // ERROR, no lod - ivec3 tfsu = textureSize(samp2DMSAu); -} - -#ifdef GL_OES_shader_image_atomic -#extension GL_OES_shader_image_atomic : enable -#endif - -uniform layout(r32f) highp image2D im2Df; -uniform layout(r32ui) highp uimage2D im2Du; -uniform layout(r32i) highp iimage2D im2Di; -uniform ivec2 P; - -void goodImageAtom() -{ - float datf; - int dati; - uint datu; - +#version 310 es + +shared vec4 s; // ERROR +layout(local_size_x = 2) out; // ERROR +buffer vec4 v; // ERROR +in int ini; +layout(location = 2) uniform mat4 x; +layout(location = 3) uniform mat4 y; +layout(location = 2) out mat4 xi; +layout(location = 3) out mat4 yi; // ERROR, locations conflict with xi + +void main() +{ + uvec2 u2; + u2 = uaddCarry(u2, u2, u2); + uint u1; + u1 = usubBorrow(u1, u1, u1); + uvec4 u4; + umulExtended(u4, u4, u4, u4); + ivec4 i4; + imulExtended(i4, i4, i4, i4); + int i1; + i1 = bitfieldExtract(i1, 4, 5); + uvec3 u3; + u3 = bitfieldExtract(u3, 4, 5); + ivec3 i3; + i3 = bitfieldInsert(i3, i3, 4, 5); + u1 = bitfieldInsert(u1, u1, 4, 5); + ivec2 i2; + i2 = bitfieldReverse(i2); + u4 = bitfieldReverse(u4); + i1 = bitCount(i1); + i3 = bitCount(u3); + i2 = findLSB(i2); + i4 = findLSB(u4); + i1 = findMSB(i1); + i2 = findMSB(u2); + + vec3 v3; + v3 = frexp(v3, i3); + vec2 v2; + v2 = ldexp(v2, i2); + + mediump vec4 v4; + u1 = packUnorm4x8(v4); + u1 = packSnorm4x8(v4); + v4 = unpackUnorm4x8(u1); + v4 = unpackSnorm4x8(u1); +} + +precision highp sampler2DMS; +precision highp isampler2DMS; +precision highp usampler2DMS; + +uniform sampler2DMS s2dms; +uniform isampler2DMS is2dms; +uniform usampler2DMS us2dms; +uniform usampler2DMSArray us2dmsa; // ERROR + +void foo() +{ + ivec2 v2; + v2 = textureSize(s2dms); + v2 = textureSize(us2dms); + vec4 v4 = texelFetch(s2dms, v2, 2); + ivec4 iv4 = texelFetch(is2dms, v2, 2); + textureSamples(s2dms); // ERROR + float f; + frexp(f, ini); // ERROR, i not writable +} + +out bool outb; // ERROR +out sampler2D outo; // ERROR +out float outa[4]; +out float outaa[4][2]; // ERROR +struct S { float f; }; +out S outs; +out S[4] outasa; // ERROR +out S outsa[4]; // ERROR +struct SA { float f[4]; }; +out SA outSA; // ERROR +struct SS { float f; S s; }; +out SS outSS; // ERROR + +layout(std430) uniform U430 { int a; } U430i; // ERROR +layout(std430) buffer B430 { int a; } B430i; + +#ifndef GL_OES_shader_io_blocks +#error GL_OES_shader_io_blocks not defined +#endif + +#extension GL_OES_shader_io_blocks : enable + +out outbname { + int a; + out vec4 v; + highp sampler2D s; // ERROR, opaque type +} outbinst; + +out outbname2 { + layout(location = 12) int aAnon; + layout(location = 13) vec4 vAnon; +}; + +layout(location = 12) out highp int aliased; // ERROR, aliasing location + +in inbname { int a; } inbinst; // ERROR, no in block in vertex shader + +out gl_PerVertex { // ERROR, has extra member + highp vec4 gl_Position; + highp vec4 t; +}; + +void foo_IO() +{ + int sum = gl_VertexID + + gl_InstanceID; + gl_Position = vec4(1.0); + gl_PointSize = 2.0; // ERROR, removed by redeclaration +} + +out gl_PerVertex { // ERROR, already used and already redeclared + highp vec4 gl_Position; + highp vec4 t; +}; + +smooth out smo { // ERROR, no smooth on a block + int i; +} smon; + +flat out fmo { // ERROR, no flat on a block + int i; +} fmon; + +centroid out cmo { // ERROR, no centroid on a block + int i; +} cmon; + +invariant out imo { // ERROR, no invariant on a block + int i; +} imon; + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfooBad() +{ + precise vec2 h; // ERROR reserved + h = fma(inf, ing, h); // ERROR, not available + sArray[sIndex + 1]; // ERRRO, not supported + auArray[sIndex + 1]; + ubInst[1]; + bbInst[2]; + ubInst[sIndex + 1]; // ERROR, not supported + bbInst[sIndex]; // ERROR, not supported + iArray[2]; + iArray[sIndex * 2]; // ERROR, not supported + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); // ERROR, offset not constant + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); // ERROR, not available +} + +#extension GL_OES_gpu_shader5 : enable + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + sArray[sIndex + 1]; + ubInst[sIndex + 1]; + bbInst[sIndex - 2]; // ERROR, still not supported + iArray[2]; + iArray[sIndex - 2]; + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +uniform samplerBuffer badSamp1; // ERROR, reserved +uniform isamplerBuffer badSamp2; // ERROR, reserved +uniform usamplerBuffer badSamp3; // ERROR, reserved +uniform writeonly imageBuffer badSamp4; // ERROR, reserved +uniform writeonly iimageBuffer badSamp5; // ERROR, reserved +uniform writeonly uimageBuffer badSamp6; // ERROR, reserved + +#extension GL_OES_texture_buffer : enable +#extension GL_EXT_texture_buffer : enable + +uniform samplerBuffer noPreSamp1; // ERROR, no default precision +uniform isamplerBuffer noPreSamp2; // ERROR, no default precision +uniform usamplerBuffer noPreSamp3; // ERROR, no default precision +uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision +uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision +uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision + +precision highp samplerBuffer; +precision highp isamplerBuffer; +precision highp usamplerBuffer; +precision highp imageBuffer; +precision highp iimageBuffer; +precision highp uimageBuffer; + +#ifdef GL_OES_texture_buffer +uniform samplerBuffer bufSamp1; +uniform isamplerBuffer bufSamp2; +uniform usamplerBuffer bufSamp3; +#endif +#ifdef GL_EXT_texture_buffer +uniform writeonly imageBuffer bufSamp4; +uniform writeonly iimageBuffer bufSamp5; +uniform writeonly uimageBuffer bufSamp6; +#endif + +void bufferT() +{ + highp int s1 = textureSize(bufSamp1); + highp int s2 = textureSize(bufSamp2); + highp int s3 = textureSize(bufSamp3); + + highp int s4 = imageSize(bufSamp4); + highp int s5 = imageSize(bufSamp5); + highp int s6 = imageSize(bufSamp6); + + highp vec4 f1 = texelFetch(bufSamp1, s1); + highp ivec4 f2 = texelFetch(bufSamp2, s2); + highp uvec4 f3 = texelFetch(bufSamp3, s3); +} + +uniform writeonly imageCubeArray badCA1; // ERROR, reserved +uniform writeonly iimageCubeArray badCA2; // ERROR, reserved +uniform writeonly uimageCubeArray badCA3; // ERROR, reserved + +uniform samplerCubeArray badCA4; // ERROR, reserved +uniform samplerCubeArrayShadow badCA5; // ERROR, reserved +uniform isamplerCubeArray badCA6; // ERROR, reserved +uniform usamplerCubeArray badCA7; // ERROR, reserved + +#extension GL_OES_texture_cube_map_array : enable + +uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision +uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision +uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision + +uniform samplerCubeArray noPreCA4; // ERROR, no default precision +uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision +uniform isamplerCubeArray noPreCA6; // ERROR, no default precision +uniform usamplerCubeArray noPreCA7; // ERROR, no default precision + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +layout(rgba16f) uniform readonly imageCubeArray rCA1; +layout(rgba32i) uniform readonly iimageCubeArray rCA2; +layout(r32ui) uniform readonly uimageCubeArray rCA3; + +#ifdef GL_OES_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp ivec3 s4 = textureSize(CA4, 1); + highp ivec3 s5 = textureSize(CA5, 1); + highp ivec3 s6 = textureSize(CA6, 1); + highp ivec3 s7 = textureSize(CA7, 1); + + highp vec4 t4 = texture(CA4, vec4(0.5)); + highp float t5 = texture(CA5, vec4(0.5), 3.0); + highp ivec4 t6 = texture(CA6, vec4(0.5)); + highp uvec4 t7 = texture(CA7, vec4(0.5)); + + highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24); + highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26); + highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27); + + highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2)); + highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2)); + highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2)); + + highp vec4 gath4 = textureGather(CA4, vec4(0.5)); + highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2); + highp ivec4 gath6 = textureGather(CA6, vec4(0.5)); + highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1); + highp uvec4 gath7 = textureGather(CA7, vec4(0.5)); + highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0); + + highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5); + + highp ivec3 s1 = imageSize(CA1); + highp ivec3 s2 = imageSize(CA2); + highp ivec3 s3 = imageSize(CA3); + + imageStore(CA1, s3, vec4(1)); + imageStore(CA2, s3, ivec4(1)); + imageStore(CA3, s3, uvec4(1)); + + highp vec4 cl1 = imageLoad(rCA1, s3); + highp ivec4 cl2 = imageLoad(rCA2, s3); + highp uvec4 cl3 = imageLoad(rCA3, s3); +} + +uniform sampler2DMSArray bad2DMS; // ERROR, reserved +uniform isampler2DMSArray bad2DMSi; // ERROR, reserved +uniform usampler2DMSArray bad2DMSu; // ERROR, reserved + +#extension GL_OES_texture_storage_multisample_2d_array : enable + +#ifdef GL_OES_texture_storage_multisample_2d_array + +uniform sampler2DMSArray noPrec2DMS; // ERROR, no default +uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default +uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default + +#endif + +precision highp sampler2DMSArray; +precision highp isampler2DMSArray; +precision highp usampler2DMSArray; + +uniform sampler2DMSArray samp2DMSA; +uniform isampler2DMSArray samp2DMSAi; +uniform usampler2DMSArray samp2DMSAu; + +void MSA() +{ + vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2); + ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2); + uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2); + + ivec3 tfs = textureSize(samp2DMSA); + ivec3 tfsi = textureSize(samp2DMSAi); + ivec3 tfsb = textureSize(samp2DMSAi, 4); // ERROR, no lod + ivec3 tfsu = textureSize(samp2DMSAu); +} + +#ifdef GL_OES_shader_image_atomic +#extension GL_OES_shader_image_atomic : enable +#endif + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + imageAtomicAdd( im2Di, P, dati); imageAtomicAdd( im2Du, P, datu); imageAtomicMin( im2Di, P, dati); @@ -382,22 +382,22 @@ void goodImageAtom() imageAtomicExchange(im2Di, P, dati); imageAtomicExchange(im2Du, P, datu); imageAtomicExchange(im2Df, P, datf); - imageAtomicCompSwap(im2Di, P, 3, dati); - imageAtomicCompSwap(im2Du, P, 5u, datu); -} - -sample out vec4 colorSampInBad; // ERROR, reserved - -#extension GL_OES_shader_multisample_interpolation : enable - -sample out vec4 colorSample; -flat sample out vec4 colorfsi; -sample out vec3 sampInArray[4]; -in vec4 inv4; - -void badInterp() -{ - interpolateAtCentroid(inv4); // ERROR, wrong stage - interpolateAtSample(inv4, 1); // ERROR, need extension - interpolateAtOffset(inv4, vec2(0.2)); // ERROR, need extension -} + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); +} + +sample out vec4 colorSampInBad; // ERROR, reserved + +#extension GL_OES_shader_multisample_interpolation : enable + +sample out vec4 colorSample; +flat sample out vec4 colorfsi; +sample out vec3 sampInArray[4]; +in vec4 inv4; + +void badInterp() +{ + interpolateAtCentroid(inv4); // ERROR, wrong stage + interpolateAtSample(inv4, 1); // ERROR, need extension + interpolateAtOffset(inv4, vec2(0.2)); // ERROR, need extension +} diff --git a/core/deps/glslang/Test/310AofA.vert b/core/deps/glslang/Test/310AofA.vert index db3f4ae13..fba297725 100644 --- a/core/deps/glslang/Test/310AofA.vert +++ b/core/deps/glslang/Test/310AofA.vert @@ -13,109 +13,109 @@ void main() { f(false, 12.1, uint[NZ](uint(0),uint(1),uint(1),uint(2)), d); } -buffer b { - float u[]; // ERROR - vec4 v[]; +buffer b { + float u[]; // ERROR + vec4 v[]; } name[3]; - -uniform ub { - float u; - vec4 v[]; // ERROR + +uniform ub { + float u; + vec4 v[]; // ERROR } uname[3]; -buffer b2 { - float u; - vec4 v[][]; // ERROR +buffer b2 { + float u; + vec4 v[][]; // ERROR } name2[3]; -buffer b3 { - float u; - vec4 v[][7]; +buffer b3 { + float u; + vec4 v[][7]; } name3[3]; // General arrays of arrays - -float[4][5][6] many[1][2][3]; - -float gu[][7]; // ERROR, size required -float g4[4][7]; -float g5[5][7]; - -float[4][7] foo(float a[5][7]) -{ - float r[7]; - r = a[2]; - float[](a[0], a[1], r, a[3]); // ERROR, too few dims - float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims - return float[4][7](a[0], a[1], r, a[3]); - return float[][](a[0], a[1], r, a[3]); - return float[][7](a[0], a[1], a[2], a[3]); -} - -void bar(float[5][7]) {} - -void foo2() -{ - { - float gu[3][4][2]; - - gu[2][4][1] = 4.0; // ERROR, overflow - } - vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0))); - vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0))); - vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0))); - vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0))); - - g4 = foo(g5); - g5 = g4; // ERROR, wrong types - gu = g4; // ERROR, not yet sized - - foo(gu); // ERROR, not yet sized - bar(g5); - - if (foo(g5) == g4) - ; - if (foo(g5) == g5) // ERROR, different types - ; - - float u[5][7]; - u[5][2] = 5.0; // ERROR - foo(u); - - vec4 badAss[3]; - name[1].v[-1]; // ERROR - name[1].v[1] = vec4(4.3); - name[1].v = badAss; // ERROR, bad assignemnt - - name3[0].v[1].length(); // 7 - name3[0].v.length(); // run time -} - -struct badS { - int sa[]; // ERROR - int a[][]; // ERROR - int b[][2]; // ERROR - int c[2][]; // ERROR - int d[][4]; // ERROR -}; - -in float inArray[2][3]; // ERROR -out float outArray[2][3]; // ERROR - -uniform ubaa { - int a; -} ubaaname[2][3]; // ERROR - -vec3 func(in mat3[2] x[3]) -{ - mat3 a0 = x[2][1]; - return a0[2]; -} + +float[4][5][6] many[1][2][3]; + +float gu[][7]; // ERROR, size required +float g4[4][7]; +float g5[5][7]; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + float[](a[0], a[1], r, a[3]); // ERROR, too few dims + float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims + return float[4][7](a[0], a[1], r, a[3]); + return float[][](a[0], a[1], r, a[3]); + return float[][7](a[0], a[1], a[2], a[3]); +} + +void bar(float[5][7]) {} + +void foo2() +{ + { + float gu[3][4][2]; + + gu[2][4][1] = 4.0; // ERROR, overflow + } + vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0))); + vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + + g4 = foo(g5); + g5 = g4; // ERROR, wrong types + gu = g4; // ERROR, not yet sized + + foo(gu); // ERROR, not yet sized + bar(g5); + + if (foo(g5) == g4) + ; + if (foo(g5) == g5) // ERROR, different types + ; + + float u[5][7]; + u[5][2] = 5.0; // ERROR + foo(u); + + vec4 badAss[3]; + name[1].v[-1]; // ERROR + name[1].v[1] = vec4(4.3); + name[1].v = badAss; // ERROR, bad assignemnt + + name3[0].v[1].length(); // 7 + name3[0].v.length(); // run time +} + +struct badS { + int sa[]; // ERROR + int a[][]; // ERROR + int b[][2]; // ERROR + int c[2][]; // ERROR + int d[][4]; // ERROR +}; + +in float inArray[2][3]; // ERROR +out float outArray[2][3]; // ERROR + +uniform ubaa { + int a; +} ubaaname[2][3]; // ERROR + +vec3 func(in mat3[2] x[3]) +{ + mat3 a0 = x[2][1]; + return a0[2]; +} diff --git a/core/deps/glslang/Test/310implicitSizeArrayError.vert b/core/deps/glslang/Test/310implicitSizeArrayError.vert index 12c24c801..7aa0ee1b7 100644 --- a/core/deps/glslang/Test/310implicitSizeArrayError.vert +++ b/core/deps/glslang/Test/310implicitSizeArrayError.vert @@ -1,8 +1,8 @@ -#version 310 es -layout (binding=0) uniform Block { - highp int a[]; -} uni; -layout (location=0) out highp int o; -void main() { - o = uni.a[2]; -} +#version 310 es +layout (binding=0) uniform Block { + highp int a[]; +} uni; +layout (location=0) out highp int o; +void main() { + o = uni.a[2]; +} diff --git a/core/deps/glslang/Test/320.comp b/core/deps/glslang/Test/320.comp index bd6742c94..5b389959b 100644 --- a/core/deps/glslang/Test/320.comp +++ b/core/deps/glslang/Test/320.comp @@ -1,8 +1,8 @@ -#version 320 es +#version 320 es float fX; float fY; - + void main() { dFdx(fX); diff --git a/core/deps/glslang/Test/320.frag b/core/deps/glslang/Test/320.frag index 25ebfe75a..bed3f1203 100644 --- a/core/deps/glslang/Test/320.frag +++ b/core/deps/glslang/Test/320.frag @@ -1,136 +1,136 @@ -#version 320 es - -out outbname { int a; } outbinst; // ERROR, not out block in fragment shader - -in inbname { - int a; - vec4 v; - struct { int b; } s; // ERROR, nested struct definition -} inbinst; - -in inbname2 { - layout(location = 12) int aAnon; - layout(location = 13) centroid in vec4 vAnon; -}; - -in layout(location = 13) vec4 aliased; // ERROR, aliased - -in inbname2 { // ERROR, reuse of block name - int aAnon; - centroid in vec4 vAnon; -}; - -in badmember { // ERROR, aAnon already in global scope - int aAnon; -}; - -int inbname; // ERROR, redefinition of block name - -vec4 vAnon; // ERROR, anon in global scope; redefinition - -in arrayed { - float f; -} arrayedInst[4]; -uniform int i; -void fooIO() -{ - vec4 v = inbinst.v + vAnon; - v *= arrayedInst[2].f; - v *= arrayedInst[i].f; -} - -in vec4 gl_FragCoord; -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES - -layout(early_fragment_tests) in; -out float gl_FragDepth; -layout(depth_any) out float gl_FragDepth; // ERROR, non-ES - -void main() -{ - gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared - bool f = gl_FrontFacing; -} - -out float gl_FragDepth; - -void foo_GS() -{ - highp int l = gl_Layer; - highp int p = gl_PrimitiveID; -} - -in vec2 inf, ing; -uniform ivec2 offsets[4]; -uniform sampler2D sArray[4]; -uniform int sIndex; -layout(binding = 0) uniform atomic_uint auArray[2]; -uniform ubName { int i; } ubInst[4]; -buffer bbName { int i; } bbInst[4]; -highp uniform writeonly image2D iArray[5]; -const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); - -void pfoo() -{ - precise vec2 h; - h = fma(inf, ing, h); - textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); - textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); - textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant -} - -precision highp imageCubeArray ; -precision highp iimageCubeArray ; -precision highp uimageCubeArray ; - -precision highp samplerCubeArray ; -precision highp samplerCubeArrayShadow; -precision highp isamplerCubeArray ; -precision highp usamplerCubeArray ; - -uniform writeonly imageCubeArray CA1; -uniform writeonly iimageCubeArray CA2; -uniform writeonly uimageCubeArray CA3; - -#ifdef GL_EXT_texture_cube_map_array -uniform samplerCubeArray CA4; -uniform samplerCubeArrayShadow CA5; -uniform isamplerCubeArray CA6; -uniform usamplerCubeArray CA7; -#endif - -void CAT() -{ - highp vec4 b4 = texture(CA4, vec4(0.5), 0.24); - highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26); - highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27); -} - -void goodSample() -{ - lowp int a1 = gl_SampleID; - mediump vec2 a2 = gl_SamplePosition; - highp int a3 = gl_SampleMaskIn[0]; - gl_SampleMask[0] = a3; - mediump int n1 = gl_MaxSamples; - mediump int n2 = gl_NumSamples; -} - -uniform layout(r32f) highp image2D im2Df; -uniform layout(r32ui) highp uimage2D im2Du; -uniform layout(r32i) highp iimage2D im2Di; -uniform ivec2 P; - -uniform layout(rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly -uniform layout(rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly -uniform layout(rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly - -void goodImageAtom() -{ - float datf; - int dati; - uint datu; - +#version 320 es + +out outbname { int a; } outbinst; // ERROR, not out block in fragment shader + +in inbname { + int a; + vec4 v; + struct { int b; } s; // ERROR, nested struct definition +} inbinst; + +in inbname2 { + layout(location = 12) int aAnon; + layout(location = 13) centroid in vec4 vAnon; +}; + +in layout(location = 13) vec4 aliased; // ERROR, aliased + +in inbname2 { // ERROR, reuse of block name + int aAnon; + centroid in vec4 vAnon; +}; + +in badmember { // ERROR, aAnon already in global scope + int aAnon; +}; + +int inbname; // ERROR, redefinition of block name + +vec4 vAnon; // ERROR, anon in global scope; redefinition + +in arrayed { + float f; +} arrayedInst[4]; +uniform int i; +void fooIO() +{ + vec4 v = inbinst.v + vAnon; + v *= arrayedInst[2].f; + v *= arrayedInst[i].f; +} + +in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; // ERROR, non-ES + +layout(early_fragment_tests) in; +out float gl_FragDepth; +layout(depth_any) out float gl_FragDepth; // ERROR, non-ES + +void main() +{ + gl_FragDepth = 0.2; // ERROR, early_fragment_tests declared + bool f = gl_FrontFacing; +} + +out float gl_FragDepth; + +void foo_GS() +{ + highp int l = gl_Layer; + highp int p = gl_PrimitiveID; +} + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +#ifdef GL_EXT_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp vec4 b4 = texture(CA4, vec4(0.5), 0.24); + highp ivec4 b6 = texture(CA6, vec4(0.5), 0.26); + highp uvec4 b7 = texture(CA7, vec4(0.5), 0.27); +} + +void goodSample() +{ + lowp int a1 = gl_SampleID; + mediump vec2 a2 = gl_SamplePosition; + highp int a3 = gl_SampleMaskIn[0]; + gl_SampleMask[0] = a3; + mediump int n1 = gl_MaxSamples; + mediump int n2 = gl_NumSamples; +} + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +uniform layout(rgba32f) highp image2D badIm2Df; // ERROR, needs readonly or writeonly +uniform layout(rgba8ui) highp uimage2D badIm2Du; // ERROR, needs readonly or writeonly +uniform layout(rgba16i) highp iimage2D badIm2Di; // ERROR, needs readonly or writeonly + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + imageAtomicAdd( im2Di, P, dati); imageAtomicAdd( im2Du, P, datu); imageAtomicMin( im2Di, P, dati); @@ -146,57 +146,57 @@ void goodImageAtom() imageAtomicExchange(im2Di, P, dati); imageAtomicExchange(im2Du, P, datu); imageAtomicExchange(im2Df, P, datf); - imageAtomicCompSwap(im2Di, P, 3, dati); - imageAtomicCompSwap(im2Du, P, 5u, datu); - + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); + imageAtomicMax(badIm2Di, P, dati); // ERROR, not an allowed layout() on the image imageAtomicMax(badIm2Du, P, datu); // ERROR, not an allowed layout() on the image imageAtomicExchange(badIm2Df, P, datf); // ERROR, not an allowed layout() on the image -} - -centroid out vec4 colorCentroidBad; // ERROR -flat out vec4 colorBadFlat; // ERROR -smooth out vec4 colorBadSmooth; // ERROR -noperspective out vec4 colorBadNo; // ERROR -flat centroid in vec2 colorfc; -in float scalarIn; - -sample in vec4 colorSampIn; -sample out vec4 colorSampleBad; // ERROR -flat sample in vec4 colorfsi; -sample in vec3 sampInArray[4]; - -void interp() -{ - float res; - vec2 res2; - vec3 res3; - vec4 res4; - - res2 = interpolateAtCentroid(colorfc); - res4 = interpolateAtCentroid(colorSampIn); - res4 = interpolateAtCentroid(colorfsi); - res = interpolateAtCentroid(scalarIn); - res3 = interpolateAtCentroid(sampInArray); // ERROR - res3 = interpolateAtCentroid(sampInArray[2]); - res2 = interpolateAtCentroid(sampInArray[2].xy); // ERROR - - res3 = interpolateAtSample(sampInArray, 1); // ERROR - res3 = interpolateAtSample(sampInArray[i], 0); - res2 = interpolateAtSample(sampInArray[2].xy, 2); // ERROR - res = interpolateAtSample(scalarIn, 1); - - res3 = interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR - res3 = interpolateAtOffset(sampInArray[2], vec2(0.2)); - res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle - res = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference - res = interpolateAtOffset(scalarIn, vec2(0.2)); - - float f; - res = interpolateAtCentroid(f); // ERROR, not interpolant - res4 = interpolateAtSample(outp, 0); // ERROR, not interpolant -} - +} + +centroid out vec4 colorCentroidBad; // ERROR +flat out vec4 colorBadFlat; // ERROR +smooth out vec4 colorBadSmooth; // ERROR +noperspective out vec4 colorBadNo; // ERROR +flat centroid in vec2 colorfc; +in float scalarIn; + +sample in vec4 colorSampIn; +sample out vec4 colorSampleBad; // ERROR +flat sample in vec4 colorfsi; +sample in vec3 sampInArray[4]; + +void interp() +{ + float res; + vec2 res2; + vec3 res3; + vec4 res4; + + res2 = interpolateAtCentroid(colorfc); + res4 = interpolateAtCentroid(colorSampIn); + res4 = interpolateAtCentroid(colorfsi); + res = interpolateAtCentroid(scalarIn); + res3 = interpolateAtCentroid(sampInArray); // ERROR + res3 = interpolateAtCentroid(sampInArray[2]); + res2 = interpolateAtCentroid(sampInArray[2].xy); // ERROR + + res3 = interpolateAtSample(sampInArray, 1); // ERROR + res3 = interpolateAtSample(sampInArray[i], 0); + res2 = interpolateAtSample(sampInArray[2].xy, 2); // ERROR + res = interpolateAtSample(scalarIn, 1); + + res3 = interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR + res3 = interpolateAtOffset(sampInArray[2], vec2(0.2)); + res2 = interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle + res = interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference + res = interpolateAtOffset(scalarIn, vec2(0.2)); + + float f; + res = interpolateAtCentroid(f); // ERROR, not interpolant + res4 = interpolateAtSample(outp, 0); // ERROR, not interpolant +} + layout(blend_support_multiply) out; layout(blend_support_screen) out; layout(blend_support_overlay) out; diff --git a/core/deps/glslang/Test/320.geom b/core/deps/glslang/Test/320.geom index 484e8fabe..38d71c314 100644 --- a/core/deps/glslang/Test/320.geom +++ b/core/deps/glslang/Test/320.geom @@ -1,134 +1,134 @@ -#version 320 es - -precision mediump float; - -in fromVertex { - in vec3 color; -} fromV[]; - -in vec4 nonBlockUnsized[]; - -out toFragment { - out vec3 color; -} toF; - -out fromVertex { // okay to reuse a block name for another block name - vec3 color; -}; - -out fooB { // ERROR, cannot reuse block name as block instance - vec2 color; -} fromVertex; - -int fromVertex; // ERROR, cannot reuse a block name for something else - -out fooC { // ERROR, cannot have same name for block and instance name - vec2 color; -} fooC; - -void main() -{ - EmitVertex(); - EndPrimitive(); - EmitStreamVertex(1); // ERROR - EndStreamPrimitive(0); // ERROR - - color = fromV[0].color; - gl_ClipDistance[3] = // ERROR, no ClipDistance - gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance - gl_Position = gl_in[0].gl_Position; - - gl_PrimitiveID = gl_PrimitiveIDIn; - gl_Layer = 2; -} - -layout(stream = 4) out vec4 ov4; // ERROR, no streams - -layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip" - -out ooutb { vec4 a; } ouuaa6; - -layout(max_vertices = 200) out; -layout(max_vertices = 300) out; // ERROR, too big -void foo(layout(max_vertices = 4) int a) // ERROR -{ - ouuaa6.a = vec4(1.0); -} - -layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive -layout(line_strip, points) out; // ERROR, changing output primitive -layout(triangle_strip) in; // ERROR, not an input primitive -layout(triangle_strip) uniform; // ERROR -layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable -layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input -layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 -out outbn2 { - layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 - layout(max_vertices = 3) int b; // ERROR, not on a block member - layout(triangle_strip) int c; // ERROR, not on a block member -} outbi; - -layout(lines) out; // ERROR, not on output -layout(lines_adjacency) in; -layout(triangles) in; // ERROR, can't change it -layout(triangles_adjacency) in; // ERROR, can't change it -layout(invocations = 4) in; - -in sameName { - int a15; -} insn[]; - -out sameName { - float f15; -}; - -uniform sameName { - bool b15; -}; - -const int summ = gl_MaxVertexAttribs + - gl_MaxGeometryInputComponents + - gl_MaxGeometryOutputComponents + - gl_MaxGeometryImageUniforms + - gl_MaxGeometryTextureImageUnits + - gl_MaxGeometryOutputVertices + - gl_MaxGeometryTotalOutputComponents + - gl_MaxGeometryUniformComponents + - gl_MaxGeometryAtomicCounters + - gl_MaxGeometryAtomicCounterBuffers + - gl_MaxVertexTextureImageUnits + - gl_MaxCombinedTextureImageUnits + - gl_MaxTextureImageUnits + - gl_MaxDrawBuffers; - -void fooe1() -{ - gl_ViewportIndex; // ERROR, not in ES - gl_MaxViewports; // ERROR, not in ES - insn.length(); // 4: lines_adjacency - int inv = gl_InvocationID; -} - -in vec4 explArray[4]; -in vec4 explArrayBad[5]; // ERROR, wrong size -in vec4 nonArrayed; // ERROR, not an array -flat out vec3 myColor1; -centroid out vec3 myColor2; -centroid in vec3 centr[]; -sample out vec4 perSampleColor; // ERROR without sample extensions - -layout(max_vertices = 200) out; // matching redecl - -layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component - -void notHere() -{ - gl_MaxGeometryVaryingComponents; // ERROR, not in ES - gl_VerticesIn; // ERROR, not in ES -} - -void pointSize2() -{ - highp float ps = gl_in[3].gl_PointSize; // ERROR, need extension - gl_PointSize = ps; // ERROR, need extension -} +#version 320 es + +precision mediump float; + +in fromVertex { + in vec3 color; +} fromV[]; + +in vec4 nonBlockUnsized[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { // okay to reuse a block name for another block name + vec3 color; +}; + +out fooB { // ERROR, cannot reuse block name as block instance + vec2 color; +} fromVertex; + +int fromVertex; // ERROR, cannot reuse a block name for something else + +out fooC { // ERROR, cannot have same name for block and instance name + vec2 color; +} fooC; + +void main() +{ + EmitVertex(); + EndPrimitive(); + EmitStreamVertex(1); // ERROR + EndStreamPrimitive(0); // ERROR + + color = fromV[0].color; + gl_ClipDistance[3] = // ERROR, no ClipDistance + gl_in[1].gl_ClipDistance[2]; // ERROR, no ClipDistance + gl_Position = gl_in[0].gl_Position; + + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; +} + +layout(stream = 4) out vec4 ov4; // ERROR, no streams + +layout(line_strip, points, triangle_strip, points, triangle_strip) out; // just means triangle_strip" + +out ooutb { vec4 a; } ouuaa6; + +layout(max_vertices = 200) out; +layout(max_vertices = 300) out; // ERROR, too big +void foo(layout(max_vertices = 4) int a) // ERROR +{ + ouuaa6.a = vec4(1.0); +} + +layout(line_strip, points, triangle_strip, points) out; // ERROR, changing output primitive +layout(line_strip, points) out; // ERROR, changing output primitive +layout(triangle_strip) in; // ERROR, not an input primitive +layout(triangle_strip) uniform; // ERROR +layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable +layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input +layout(invocations = 3) out outbn { int a; }; // 2 ERROR, not on a block, not until 4.0 +out outbn2 { + layout(invocations = 3) int a; // 2 ERRORs, not on a block member, not until 4.0 + layout(max_vertices = 3) int b; // ERROR, not on a block member + layout(triangle_strip) int c; // ERROR, not on a block member +} outbi; + +layout(lines) out; // ERROR, not on output +layout(lines_adjacency) in; +layout(triangles) in; // ERROR, can't change it +layout(triangles_adjacency) in; // ERROR, can't change it +layout(invocations = 4) in; + +in sameName { + int a15; +} insn[]; + +out sameName { + float f15; +}; + +uniform sameName { + bool b15; +}; + +const int summ = gl_MaxVertexAttribs + + gl_MaxGeometryInputComponents + + gl_MaxGeometryOutputComponents + + gl_MaxGeometryImageUniforms + + gl_MaxGeometryTextureImageUnits + + gl_MaxGeometryOutputVertices + + gl_MaxGeometryTotalOutputComponents + + gl_MaxGeometryUniformComponents + + gl_MaxGeometryAtomicCounters + + gl_MaxGeometryAtomicCounterBuffers + + gl_MaxVertexTextureImageUnits + + gl_MaxCombinedTextureImageUnits + + gl_MaxTextureImageUnits + + gl_MaxDrawBuffers; + +void fooe1() +{ + gl_ViewportIndex; // ERROR, not in ES + gl_MaxViewports; // ERROR, not in ES + insn.length(); // 4: lines_adjacency + int inv = gl_InvocationID; +} + +in vec4 explArray[4]; +in vec4 explArrayBad[5]; // ERROR, wrong size +in vec4 nonArrayed; // ERROR, not an array +flat out vec3 myColor1; +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; // ERROR without sample extensions + +layout(max_vertices = 200) out; // matching redecl + +layout(location = 7, component = 2) in float comp[]; // ERROR, es has no component + +void notHere() +{ + gl_MaxGeometryVaryingComponents; // ERROR, not in ES + gl_VerticesIn; // ERROR, not in ES +} + +void pointSize2() +{ + highp float ps = gl_in[3].gl_PointSize; // ERROR, need extension + gl_PointSize = ps; // ERROR, need extension +} diff --git a/core/deps/glslang/Test/320.tesc b/core/deps/glslang/Test/320.tesc index 89019cdf1..fbe0463e7 100644 --- a/core/deps/glslang/Test/320.tesc +++ b/core/deps/glslang/Test/320.tesc @@ -1,161 +1,161 @@ -#version 320 es - -layout(vertices = 4) out; -out int outa[gl_out.length()]; - -layout(quads) in; // ERROR -layout(ccw) out; // ERROR -layout(fractional_even_spacing) in; // ERROR - -patch in vec4 patchIn; // ERROR -patch out vec4 patchOut; - -void main() -{ - barrier(); - - int a = gl_MaxTessControlInputComponents + - gl_MaxTessControlOutputComponents + - gl_MaxTessControlTextureImageUnits + - gl_MaxTessControlUniformComponents + - gl_MaxTessControlTotalOutputComponents; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension - float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - int iid = gl_InvocationID; - - gl_out[gl_InvocationID].gl_Position = p; - gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension - gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES - - gl_TessLevelOuter[3] = 3.2; - gl_TessLevelInner[1] = 1.3; - - if (a > 10) - barrier(); // ERROR - else - barrier(); // ERROR - - barrier(); - - do { - barrier(); // ERROR - } while (a > 10); - - switch (a) { - default: - barrier(); // ERROR - break; - } - a < 12 ? a : (barrier(), a); // ERROR - { - barrier(); - } - - return; - - barrier(); // ERROR -} - -layout(vertices = 4) in; // ERROR, not on in -layout(vertices = 5) out; // ERROR, changing # - -void foo() -{ - gl_out[4].gl_Position; // ERROR, out of range - - barrier(); // ERROR, not in main -} - -in vec2 ina; // ERROR, not array -in vec2 inb[]; -in vec2 inc[18]; // ERROR, wrong size -in vec2 ind[gl_MaxPatchVertices]; -patch out float implA[]; // ERROR, not sized - -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 3) in vec4 ivla[]; -layout(location = 4) in vec4 ivlb[]; -layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping - -layout(location = 3) out vec4 ovla[]; -layout(location = 4) out vec4 ovlb[]; -layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping - -patch out pinbn { - int a; -} pinbi; - -centroid out vec3 myColor2[]; -centroid in vec3 centr[]; -sample out vec4 perSampleColor[]; - -layout(vertices = 4) out float badlay[]; // ERROR, not on a variable -out float misSized[5]; // ERROR, size doesn't match -out float okaySize[4]; - -void pointSize2() -{ - float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension - gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension -} - -precise vec3 pv3; - -void goodfoop() -{ - precise float d; - - pv3 *= pv3; - pv3 = fma(pv3, pv3, pv3); - d = fma(d, d, d); -} - -void bb() -{ - gl_BoundingBoxEXT[0] = vec4(0.0); // ERROR without GL_EXT_primitive_bounding_box - gl_BoundingBoxOES[0] = vec4(0.0); // ERROR without GL_OES_primitive_bounding_box - gl_BoundingBox[0] = vec4(1.0); - gl_BoundingBox[1] = vec4(1.0); - gl_BoundingBox[2] = vec4(2.0); // ERROR, overflow -} - -#extension GL_EXT_primitive_bounding_box : enable -#extension GL_OES_primitive_bounding_box : enable - -void bbext() -{ - gl_BoundingBoxEXT[1] = vec4(0.0); - gl_BoundingBoxOES[1] = vec4(0.0); -} - -out patch badpatchBName { // ERROR, array size required - float f; -} badpatchIName[]; - -out patch patchBName { - float f; -} patchIName[4]; - -void outputtingOutparam(out int a) -{ - a = 2; -} - -void outputting() -{ - outa[gl_InvocationID] = 2; - outa[1] = 2; // ERROR, not gl_InvocationID - gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID - outa[1]; - gl_out[0]; - outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID - outputtingOutparam(outa[gl_InvocationID]); - patchIName[1].f = 3.14; - outa[(gl_InvocationID)] = 2; -} +#version 320 es + +layout(vertices = 4) out; +out int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; // ERROR, not in ES + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR, not on in +layout(vertices = 5) out; // ERROR, changing # + +void foo() +{ + gl_out[4].gl_Position; // ERROR, out of range + + barrier(); // ERROR, not in main +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; +patch out float implA[]; // ERROR, not sized + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +patch out pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2[]; +centroid in vec3 centr[]; +sample out vec4 perSampleColor[]; + +layout(vertices = 4) out float badlay[]; // ERROR, not on a variable +out float misSized[5]; // ERROR, size doesn't match +out float okaySize[4]; + +void pointSize2() +{ + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR, need point_size extension +} + +precise vec3 pv3; + +void goodfoop() +{ + precise float d; + + pv3 *= pv3; + pv3 = fma(pv3, pv3, pv3); + d = fma(d, d, d); +} + +void bb() +{ + gl_BoundingBoxEXT[0] = vec4(0.0); // ERROR without GL_EXT_primitive_bounding_box + gl_BoundingBoxOES[0] = vec4(0.0); // ERROR without GL_OES_primitive_bounding_box + gl_BoundingBox[0] = vec4(1.0); + gl_BoundingBox[1] = vec4(1.0); + gl_BoundingBox[2] = vec4(2.0); // ERROR, overflow +} + +#extension GL_EXT_primitive_bounding_box : enable +#extension GL_OES_primitive_bounding_box : enable + +void bbext() +{ + gl_BoundingBoxEXT[1] = vec4(0.0); + gl_BoundingBoxOES[1] = vec4(0.0); +} + +out patch badpatchBName { // ERROR, array size required + float f; +} badpatchIName[]; + +out patch patchBName { + float f; +} patchIName[4]; + +void outputtingOutparam(out int a) +{ + a = 2; +} + +void outputting() +{ + outa[gl_InvocationID] = 2; + outa[1] = 2; // ERROR, not gl_InvocationID + gl_out[0].gl_Position = vec4(1.0); // ERROR, not gl_InvocationID + outa[1]; + gl_out[0]; + outputtingOutparam(outa[0]); // ERROR, not gl_InvocationID + outputtingOutparam(outa[gl_InvocationID]); + patchIName[1].f = 3.14; + outa[(gl_InvocationID)] = 2; +} diff --git a/core/deps/glslang/Test/320.tese b/core/deps/glslang/Test/320.tese index e0e6985eb..cce2637cb 100644 --- a/core/deps/glslang/Test/320.tese +++ b/core/deps/glslang/Test/320.tese @@ -1,114 +1,114 @@ -#version 320 es - -layout(vertices = 4) out; // ERROR -layout(quads, cw) in; -layout(triangles) in; // ERROR -layout(isolines) in; // ERROR - -layout(ccw) in; // ERROR -layout(cw) in; - -layout(fractional_odd_spacing) in; -layout(equal_spacing) in; // ERROR -layout(fractional_even_spacing) in; // ERROR - -layout(point_mode) in; - -patch in vec4 patchIn; -patch out vec4 patchOut; // ERROR - -void main() -{ - barrier(); // ERROR - - int a = gl_MaxTessEvaluationInputComponents + - gl_MaxTessEvaluationOutputComponents + - gl_MaxTessEvaluationTextureImageUnits + - gl_MaxTessEvaluationUniformComponents + - gl_MaxTessPatchComponents + - gl_MaxPatchVertices + - gl_MaxTessGenLevel; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension - float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - vec3 tc = gl_TessCoord; - float tlo = gl_TessLevelOuter[3]; - float tli = gl_TessLevelInner[1]; - - gl_Position = p; - gl_PointSize = ps; // ERROR, need point_size extension - gl_ClipDistance[2] = cd; // ERROR, not in ES -} - -smooth patch in vec4 badp1; // ERROR -flat patch in vec4 badp2; // ERROR -noperspective patch in vec4 badp3; // ERROR -patch sample in vec3 badp4; // ERROR - -#extension GL_ARB_separate_shader_objects : enable - -in gl_PerVertex -{ - vec4 gl_Position; -} gl_in[]; - -in gl_PerVertex // ERROR, second redeclaration of gl_in -{ - vec4 gl_Position; -} gl_in[]; - -layout(quads, cw) out; // ERROR -layout(triangles) out; // ERROR -layout(isolines) out; // ERROR -layout(cw) out; // ERROR -layout(fractional_odd_spacing) out; // ERROR -layout(equal_spacing) out; // ERROR -layout(fractional_even_spacing) out; // ERROR -layout(point_mode) out; // ERROR - -in vec2 ina; // ERROR, not array -in vec2 inb[]; -in vec2 inc[18]; // ERROR, wrong size -in vec2 ind[gl_MaxPatchVertices]; - -in testbla { // ERROR, not array - int f; -} bla; - -in testblb { - int f; -} blb[]; - -in testblc { // ERROR wrong size - int f; -} blc[18]; - -in testbld { - int f; -} bld[gl_MaxPatchVertices]; - -layout(location = 23) in vec4 ivla[]; -layout(location = 24) in vec4 ivlb[]; -layout(location = 24) in vec4 ivlc[]; // ERROR, overlap - -layout(location = 23) out vec4 ovla[2]; -layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap - -in float gl_TessLevelOuter[4]; // ERROR, can't redeclare - -patch in pinbn { - int a; -} pinbi; - -centroid out vec3 myColor2; -centroid in vec3 centr[]; -sample out vec4 perSampleColor; - -void bbbad() -{ - gl_BoundingBoxOES; // ERROR, wrong stage -} +#version 320 es + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; // ERROR, need point_size extension + float cd = gl_in[1].gl_ClipDistance[2]; // ERROR, not in ES + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; // ERROR, need point_size extension + gl_ClipDistance[2] = cd; // ERROR, not in ES +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + vec4 gl_Position; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + vec4 gl_Position; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { // ERROR, not array + int f; +} bla; + +in testblb { + int f; +} blb[]; + +in testblc { // ERROR wrong size + int f; +} blc[18]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR, overlap + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR, overlap + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; + +centroid out vec3 myColor2; +centroid in vec3 centr[]; +sample out vec4 perSampleColor; + +void bbbad() +{ + gl_BoundingBoxOES; // ERROR, wrong stage +} diff --git a/core/deps/glslang/Test/320.vert b/core/deps/glslang/Test/320.vert index f1d71dd07..42f1515cc 100644 --- a/core/deps/glslang/Test/320.vert +++ b/core/deps/glslang/Test/320.vert @@ -1,228 +1,228 @@ -#version 320 es - -out outbname { - int a; - out vec4 v; - highp sampler2D s; // ERROR, opaque type -} outbinst; - -out outbname2 { - layout(location = 12) int aAnon; - layout(location = 13) vec4 vAnon; -}; - -layout(location = 12) out highp int aliased; // ERROR, aliasing location - -in inbname { int a; } inbinst; // ERROR, no in block in vertex shader - -out gl_PerVertex { // ERROR, has extra member - highp vec4 gl_Position; - highp vec4 t; -}; - -void main() -{ - int sum = gl_VertexID + - gl_InstanceID; - gl_Position = vec4(1.0); - gl_PointSize = 2.0; // ERROR, removed by redeclaration -} - -out gl_PerVertex { // ERROR, already used and already redeclared - highp vec4 gl_Position; - highp vec4 t; -}; - -smooth out smo { // ERROR, no smooth on a block - int i; -} smon; - -flat out fmo { // ERROR, no flat on a block - int i; -} fmon; - -centroid out cmo { // ERROR, no centroid on a block - int i; -} cmon; - -invariant out imo { // ERROR, no invariant on a block - int i; -} imon; - -in vec2 inf, ing; -uniform ivec2 offsets[4]; -uniform sampler2D sArray[4]; -uniform int sIndex; -layout(binding = 0) uniform atomic_uint auArray[2]; -uniform ubName { int i; } ubInst[4]; -buffer bbName { int i; } bbInst[4]; -highp uniform writeonly image2D iArray[5]; -const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); - -void pfoo() -{ - precise vec2 h; - h = fma(inf, ing, h); - sArray[sIndex + 1]; - ubInst[sIndex + 1]; - bbInst[sIndex - 2]; // ERROR, still not supported - iArray[2]; - iArray[sIndex - 2]; - textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); - textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); - textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant -} - -uniform samplerBuffer noPreSamp1; // ERROR, no default precision -uniform isamplerBuffer noPreSamp2; // ERROR, no default precision -uniform usamplerBuffer noPreSamp3; // ERROR, no default precision -uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision -uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision -uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision - -precision highp samplerBuffer; -precision highp isamplerBuffer; -precision highp usamplerBuffer; -precision highp imageBuffer; -precision highp iimageBuffer; -precision highp uimageBuffer; - -#ifdef GL_OES_texture_buffer -uniform samplerBuffer bufSamp1; -uniform isamplerBuffer bufSamp2; -uniform usamplerBuffer bufSamp3; -#endif -#ifdef GL_EXT_texture_buffer -uniform writeonly imageBuffer bufSamp4; -uniform writeonly iimageBuffer bufSamp5; -uniform writeonly uimageBuffer bufSamp6; -#endif - -void bufferT() -{ - highp int s1 = textureSize(bufSamp1); - highp int s2 = textureSize(bufSamp2); - highp int s3 = textureSize(bufSamp3); - - highp int s4 = imageSize(bufSamp4); - highp int s5 = imageSize(bufSamp5); - highp int s6 = imageSize(bufSamp6); - - highp vec4 f1 = texelFetch(bufSamp1, s1); - highp ivec4 f2 = texelFetch(bufSamp2, s2); - highp uvec4 f3 = texelFetch(bufSamp3, s3); -} - -uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision -uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision -uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision - -uniform samplerCubeArray noPreCA4; // ERROR, no default precision -uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision -uniform isamplerCubeArray noPreCA6; // ERROR, no default precision -uniform usamplerCubeArray noPreCA7; // ERROR, no default precision - -precision highp imageCubeArray ; -precision highp iimageCubeArray ; -precision highp uimageCubeArray ; - -precision highp samplerCubeArray ; -precision highp samplerCubeArrayShadow; -precision highp isamplerCubeArray ; -precision highp usamplerCubeArray ; - -uniform writeonly imageCubeArray CA1; -uniform writeonly iimageCubeArray CA2; -uniform writeonly uimageCubeArray CA3; - -layout(rgba16f) uniform readonly imageCubeArray rCA1; -layout(rgba32i) uniform readonly iimageCubeArray rCA2; -layout(r32ui) uniform readonly uimageCubeArray rCA3; - -#ifdef GL_OES_texture_cube_map_array -uniform samplerCubeArray CA4; -uniform samplerCubeArrayShadow CA5; -uniform isamplerCubeArray CA6; -uniform usamplerCubeArray CA7; -#endif - -void CAT() -{ - highp ivec3 s4 = textureSize(CA4, 1); - highp ivec3 s5 = textureSize(CA5, 1); - highp ivec3 s6 = textureSize(CA6, 1); - highp ivec3 s7 = textureSize(CA7, 1); - - highp vec4 t4 = texture(CA4, vec4(0.5)); - highp float t5 = texture(CA5, vec4(0.5), 3.0); - highp ivec4 t6 = texture(CA6, vec4(0.5)); - highp uvec4 t7 = texture(CA7, vec4(0.5)); - - highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24); - highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26); - highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27); - - highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2)); - highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2)); - highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2)); - - highp vec4 gath4 = textureGather(CA4, vec4(0.5)); - highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2); - highp ivec4 gath6 = textureGather(CA6, vec4(0.5)); - highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1); - highp uvec4 gath7 = textureGather(CA7, vec4(0.5)); - highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0); - - highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5); - - highp ivec3 s1 = imageSize(CA1); - highp ivec3 s2 = imageSize(CA2); - highp ivec3 s3 = imageSize(CA3); - - imageStore(CA1, s3, vec4(1)); - imageStore(CA2, s3, ivec4(1)); - imageStore(CA3, s3, uvec4(1)); - - highp vec4 cl1 = imageLoad(rCA1, s3); - highp ivec4 cl2 = imageLoad(rCA2, s3); - highp uvec4 cl3 = imageLoad(rCA3, s3); -} - -uniform sampler2DMSArray noPrec2DMS; // ERROR, no default -uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default -uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default - -precision highp sampler2DMSArray; -precision highp isampler2DMSArray; -precision highp usampler2DMSArray; - -uniform sampler2DMSArray samp2DMSA; -uniform isampler2DMSArray samp2DMSAi; -uniform usampler2DMSArray samp2DMSAu; - -void MSA() -{ - vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2); - ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2); - uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2); - - ivec3 tfs = textureSize(samp2DMSA); - ivec3 tfsi = textureSize(samp2DMSAi); - ivec3 tfsb = textureSize(samp2DMSAi, 4); // ERROR, no lod - ivec3 tfsu = textureSize(samp2DMSAu); -} - -uniform layout(r32f) highp image2D im2Df; -uniform layout(r32ui) highp uimage2D im2Du; -uniform layout(r32i) highp iimage2D im2Di; -uniform ivec2 P; - -void goodImageAtom() -{ - float datf; - int dati; - uint datu; - +#version 320 es + +out outbname { + int a; + out vec4 v; + highp sampler2D s; // ERROR, opaque type +} outbinst; + +out outbname2 { + layout(location = 12) int aAnon; + layout(location = 13) vec4 vAnon; +}; + +layout(location = 12) out highp int aliased; // ERROR, aliasing location + +in inbname { int a; } inbinst; // ERROR, no in block in vertex shader + +out gl_PerVertex { // ERROR, has extra member + highp vec4 gl_Position; + highp vec4 t; +}; + +void main() +{ + int sum = gl_VertexID + + gl_InstanceID; + gl_Position = vec4(1.0); + gl_PointSize = 2.0; // ERROR, removed by redeclaration +} + +out gl_PerVertex { // ERROR, already used and already redeclared + highp vec4 gl_Position; + highp vec4 t; +}; + +smooth out smo { // ERROR, no smooth on a block + int i; +} smon; + +flat out fmo { // ERROR, no flat on a block + int i; +} fmon; + +centroid out cmo { // ERROR, no centroid on a block + int i; +} cmon; + +invariant out imo { // ERROR, no invariant on a block + int i; +} imon; + +in vec2 inf, ing; +uniform ivec2 offsets[4]; +uniform sampler2D sArray[4]; +uniform int sIndex; +layout(binding = 0) uniform atomic_uint auArray[2]; +uniform ubName { int i; } ubInst[4]; +buffer bbName { int i; } bbInst[4]; +highp uniform writeonly image2D iArray[5]; +const ivec2 constOffsets[4] = ivec2[4](ivec2(0.1), ivec2(0.2), ivec2(0.3), ivec2(0.4)); + +void pfoo() +{ + precise vec2 h; + h = fma(inf, ing, h); + sArray[sIndex + 1]; + ubInst[sIndex + 1]; + bbInst[sIndex - 2]; // ERROR, still not supported + iArray[2]; + iArray[sIndex - 2]; + textureGatherOffset(sArray[0], vec2(0.1), ivec2(inf)); + textureGatherOffsets(sArray[0], vec2(0.1), constOffsets); + textureGatherOffsets(sArray[0], vec2(0.1), offsets); // ERROR, offset not constant +} + +uniform samplerBuffer noPreSamp1; // ERROR, no default precision +uniform isamplerBuffer noPreSamp2; // ERROR, no default precision +uniform usamplerBuffer noPreSamp3; // ERROR, no default precision +uniform writeonly imageBuffer noPreSamp4; // ERROR, no default precision +uniform writeonly iimageBuffer noPreSamp5; // ERROR, no default precision +uniform writeonly uimageBuffer noPreSamp6; // ERROR, no default precision + +precision highp samplerBuffer; +precision highp isamplerBuffer; +precision highp usamplerBuffer; +precision highp imageBuffer; +precision highp iimageBuffer; +precision highp uimageBuffer; + +#ifdef GL_OES_texture_buffer +uniform samplerBuffer bufSamp1; +uniform isamplerBuffer bufSamp2; +uniform usamplerBuffer bufSamp3; +#endif +#ifdef GL_EXT_texture_buffer +uniform writeonly imageBuffer bufSamp4; +uniform writeonly iimageBuffer bufSamp5; +uniform writeonly uimageBuffer bufSamp6; +#endif + +void bufferT() +{ + highp int s1 = textureSize(bufSamp1); + highp int s2 = textureSize(bufSamp2); + highp int s3 = textureSize(bufSamp3); + + highp int s4 = imageSize(bufSamp4); + highp int s5 = imageSize(bufSamp5); + highp int s6 = imageSize(bufSamp6); + + highp vec4 f1 = texelFetch(bufSamp1, s1); + highp ivec4 f2 = texelFetch(bufSamp2, s2); + highp uvec4 f3 = texelFetch(bufSamp3, s3); +} + +uniform writeonly imageCubeArray noPreCA1; // ERROR, no default precision +uniform writeonly iimageCubeArray noPreCA2; // ERROR, no default precision +uniform writeonly uimageCubeArray noPreCA3; // ERROR, no default precision + +uniform samplerCubeArray noPreCA4; // ERROR, no default precision +uniform samplerCubeArrayShadow noPreCA5; // ERROR, no default precision +uniform isamplerCubeArray noPreCA6; // ERROR, no default precision +uniform usamplerCubeArray noPreCA7; // ERROR, no default precision + +precision highp imageCubeArray ; +precision highp iimageCubeArray ; +precision highp uimageCubeArray ; + +precision highp samplerCubeArray ; +precision highp samplerCubeArrayShadow; +precision highp isamplerCubeArray ; +precision highp usamplerCubeArray ; + +uniform writeonly imageCubeArray CA1; +uniform writeonly iimageCubeArray CA2; +uniform writeonly uimageCubeArray CA3; + +layout(rgba16f) uniform readonly imageCubeArray rCA1; +layout(rgba32i) uniform readonly iimageCubeArray rCA2; +layout(r32ui) uniform readonly uimageCubeArray rCA3; + +#ifdef GL_OES_texture_cube_map_array +uniform samplerCubeArray CA4; +uniform samplerCubeArrayShadow CA5; +uniform isamplerCubeArray CA6; +uniform usamplerCubeArray CA7; +#endif + +void CAT() +{ + highp ivec3 s4 = textureSize(CA4, 1); + highp ivec3 s5 = textureSize(CA5, 1); + highp ivec3 s6 = textureSize(CA6, 1); + highp ivec3 s7 = textureSize(CA7, 1); + + highp vec4 t4 = texture(CA4, vec4(0.5)); + highp float t5 = texture(CA5, vec4(0.5), 3.0); + highp ivec4 t6 = texture(CA6, vec4(0.5)); + highp uvec4 t7 = texture(CA7, vec4(0.5)); + + highp vec4 L4 = textureLod(CA4, vec4(0.5), 0.24); + highp ivec4 L6 = textureLod(CA6, vec4(0.5), 0.26); + highp uvec4 L7 = textureLod(CA7, vec4(0.5), 0.27); + + highp vec4 g4 = textureGrad(CA4, vec4(0.5), vec3(0.1), vec3(0.2)); + highp ivec4 g6 = textureGrad(CA6, vec4(0.5), vec3(0.1), vec3(0.2)); + highp uvec4 g7 = textureGrad(CA7, vec4(0.5), vec3(0.1), vec3(0.2)); + + highp vec4 gath4 = textureGather(CA4, vec4(0.5)); + highp vec4 gathC4 = textureGather(CA4, vec4(0.5), 2); + highp ivec4 gath6 = textureGather(CA6, vec4(0.5)); + highp ivec4 gathC6 = textureGather(CA6, vec4(0.5), 1); + highp uvec4 gath7 = textureGather(CA7, vec4(0.5)); + highp uvec4 gathC7 = textureGather(CA7, vec4(0.5), 0); + + highp vec4 gath5 = textureGather(CA5, vec4(0.5), 2.5); + + highp ivec3 s1 = imageSize(CA1); + highp ivec3 s2 = imageSize(CA2); + highp ivec3 s3 = imageSize(CA3); + + imageStore(CA1, s3, vec4(1)); + imageStore(CA2, s3, ivec4(1)); + imageStore(CA3, s3, uvec4(1)); + + highp vec4 cl1 = imageLoad(rCA1, s3); + highp ivec4 cl2 = imageLoad(rCA2, s3); + highp uvec4 cl3 = imageLoad(rCA3, s3); +} + +uniform sampler2DMSArray noPrec2DMS; // ERROR, no default +uniform isampler2DMSArray noPrec2DMSi; // ERROR, no default +uniform usampler2DMSArray noPrec2DMSu; // ERROR, no default + +precision highp sampler2DMSArray; +precision highp isampler2DMSArray; +precision highp usampler2DMSArray; + +uniform sampler2DMSArray samp2DMSA; +uniform isampler2DMSArray samp2DMSAi; +uniform usampler2DMSArray samp2DMSAu; + +void MSA() +{ + vec4 tf = texelFetch(samp2DMSA, ivec3(5), 2); + ivec4 tfi = texelFetch(samp2DMSAi, ivec3(5), 2); + uvec4 tfu = texelFetch(samp2DMSAu, ivec3(5), 2); + + ivec3 tfs = textureSize(samp2DMSA); + ivec3 tfsi = textureSize(samp2DMSAi); + ivec3 tfsb = textureSize(samp2DMSAi, 4); // ERROR, no lod + ivec3 tfsu = textureSize(samp2DMSAu); +} + +uniform layout(r32f) highp image2D im2Df; +uniform layout(r32ui) highp uimage2D im2Du; +uniform layout(r32i) highp iimage2D im2Di; +uniform ivec2 P; + +void goodImageAtom() +{ + float datf; + int dati; + uint datu; + imageAtomicAdd( im2Di, P, dati); imageAtomicAdd( im2Du, P, datu); imageAtomicMin( im2Di, P, dati); @@ -238,18 +238,18 @@ void goodImageAtom() imageAtomicExchange(im2Di, P, dati); imageAtomicExchange(im2Du, P, datu); imageAtomicExchange(im2Df, P, datf); - imageAtomicCompSwap(im2Di, P, 3, dati); - imageAtomicCompSwap(im2Du, P, 5u, datu); -} - -sample out vec4 colorSample; -flat sample out vec4 colorfsi; -sample out vec3 sampInArray[4]; -in vec4 inv4; - -void badInterp() -{ - interpolateAtCentroid(inv4); // ERROR, wrong stage - interpolateAtSample(inv4, 1); // ERROR, need extension - interpolateAtOffset(inv4, vec2(0.2)); // ERROR, need extension -} + imageAtomicCompSwap(im2Di, P, 3, dati); + imageAtomicCompSwap(im2Du, P, 5u, datu); +} + +sample out vec4 colorSample; +flat sample out vec4 colorfsi; +sample out vec3 sampInArray[4]; +in vec4 inv4; + +void badInterp() +{ + interpolateAtCentroid(inv4); // ERROR, wrong stage + interpolateAtSample(inv4, 1); // ERROR, need extension + interpolateAtOffset(inv4, vec2(0.2)); // ERROR, need extension +} diff --git a/core/deps/glslang/Test/330.frag b/core/deps/glslang/Test/330.frag index 37387ca79..b37d8de8e 100644 --- a/core/deps/glslang/Test/330.frag +++ b/core/deps/glslang/Test/330.frag @@ -126,29 +126,29 @@ layout(location=27, index=0) in vec4 indexIn; // ERROR, not on in layout(location=0, index=0) in; // ERROR, not just on in layout(location=0, index=0) out; // ERROR, need a variable layout(location=26, index=0) out indexBlock { int a; } indexBlockI; // ERROR, not on a block - -uniform sampler1D samp1D; -uniform sampler2DShadow samp2Ds; - -void qlod() -{ - vec2 lod; - float pf; - vec2 pf2; - vec3 pf3; - - lod = textureQueryLod(samp1D, pf); // ERROR, not until 400 - lod = textureQueryLod(samp2Ds, pf2); // ERROR, not until 400 -} - -int precise; // okay, not a keyword yet -struct SKeyMem { int precise; } KeyMem; // okay, not a keyword yet - -void fooKeyMem() -{ - KeyMem.precise; -} - + +uniform sampler1D samp1D; +uniform sampler2DShadow samp2Ds; + +void qlod() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); // ERROR, not until 400 + lod = textureQueryLod(samp2Ds, pf2); // ERROR, not until 400 +} + +int precise; // okay, not a keyword yet +struct SKeyMem { int precise; } KeyMem; // okay, not a keyword yet + +void fooKeyMem() +{ + KeyMem.precise; +} + layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range layout(location=4) uniform vec4 ucolor0; // ERROR: extension is not enabled diff --git a/core/deps/glslang/Test/400.frag b/core/deps/glslang/Test/400.frag index 2ac6ae2a8..039d4809f 100644 --- a/core/deps/glslang/Test/400.frag +++ b/core/deps/glslang/Test/400.frag @@ -99,103 +99,103 @@ void foodc2() d = packDouble2x32(u2); u2 = unpackDouble2x32(d); } - -sample in vec4 colorSampIn; -sample out vec4 colorSampleBad; // ERROR -noperspective in vec4 colorfsi; -sample in vec3 sampInArray[4]; -smooth in float scalarIn; -flat centroid in vec2 colorfc; - -struct S { - float x; -}; - -in S s1; -sample S s2; - -void interp() -{ - interpolateAtCentroid(colorfc); - interpolateAtCentroid(colorSampIn); - interpolateAtCentroid(colorfsi); - interpolateAtCentroid(scalarIn); - interpolateAtCentroid(sampInArray); // ERROR - interpolateAtCentroid(sampInArray[2]); - interpolateAtCentroid(sampInArray[2].xy); // ERROR - - interpolateAtSample(sampInArray, 1); // ERROR - interpolateAtSample(sampInArray[i], 0); - interpolateAtSample(s1.x, 2); - interpolateAtSample(scalarIn, 1); - - interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR - interpolateAtOffset(sampInArray[2], vec2(0.2)); - interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle - interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference - interpolateAtOffset(s2.x, vec2(0.2)); // ERROR - - float f; - interpolateAtCentroid(f); // ERROR, not interpolant - interpolateAtSample(outp, 0); // ERROR, not interpolant -} - -uniform sampler1D samp1D; -uniform isampler2D isamp2D; -uniform usampler3D usamp3D; -uniform samplerCube sampCube; -uniform isampler1DArray isamp1DA; -uniform usampler2DArray usamp2DA; -uniform isamplerCubeArray isampCubeA; - -uniform sampler1DShadow samp1Ds; -uniform sampler2DShadow samp2Ds; -uniform samplerCubeShadow sampCubes; -uniform sampler1DArrayShadow samp1DAs; -uniform sampler2DArrayShadow samp2DAs; -uniform samplerCubeArrayShadow sampCubeAs; - -uniform samplerBuffer sampBuf; -uniform sampler2DRect sampRect; - -void qlod() -{ - vec2 lod; - float pf; - vec2 pf2; - vec3 pf3; - - lod = textureQueryLod(samp1D, pf); - lod = textureQueryLod(isamp2D, pf2); - lod = textureQueryLod(usamp3D, pf3); - lod = textureQueryLod(sampCube, pf3); - lod = textureQueryLod(isamp1DA, pf); - lod = textureQueryLod(usamp2DA, pf2); - lod = textureQueryLod(isampCubeA, pf3); - - lod = textureQueryLod(samp1Ds, pf); - lod = textureQueryLod(samp2Ds, pf2); - lod = textureQueryLod(sampCubes, pf3); - lod = textureQueryLod(samp1DAs, pf); - lod = textureQueryLod(samp2DAs, pf2); - lod = textureQueryLod(sampCubeAs, pf3); - - lod = textureQueryLod(sampBuf, pf); // ERROR - lod = textureQueryLod(sampRect, pf2); // ERROR -} - -uniform uint uu; -out uint iout; - -void bitwiseConv() -{ - iout = uu & i; - iout += uu ^ i; - iout += i | uu; -} - -subroutine(subT1, subT2); -subroutine float subT1() { return 1.0; } -subroutine float subT2() { return 1.0; } - -struct SKeyMem { int precise; } KeyMem; // ERROR, keyword can't be a member + +sample in vec4 colorSampIn; +sample out vec4 colorSampleBad; // ERROR +noperspective in vec4 colorfsi; +sample in vec3 sampInArray[4]; +smooth in float scalarIn; +flat centroid in vec2 colorfc; + +struct S { + float x; +}; + +in S s1; +sample S s2; + +void interp() +{ + interpolateAtCentroid(colorfc); + interpolateAtCentroid(colorSampIn); + interpolateAtCentroid(colorfsi); + interpolateAtCentroid(scalarIn); + interpolateAtCentroid(sampInArray); // ERROR + interpolateAtCentroid(sampInArray[2]); + interpolateAtCentroid(sampInArray[2].xy); // ERROR + + interpolateAtSample(sampInArray, 1); // ERROR + interpolateAtSample(sampInArray[i], 0); + interpolateAtSample(s1.x, 2); + interpolateAtSample(scalarIn, 1); + + interpolateAtOffset(sampInArray, vec2(0.2)); // ERROR + interpolateAtOffset(sampInArray[2], vec2(0.2)); + interpolateAtOffset(sampInArray[2].xy, vec2(0.2)); // ERROR, no swizzle + interpolateAtOffset(scalarIn + scalarIn, vec2(0.2)); // ERROR, no binary ops other than dereference + interpolateAtOffset(s2.x, vec2(0.2)); // ERROR + + float f; + interpolateAtCentroid(f); // ERROR, not interpolant + interpolateAtSample(outp, 0); // ERROR, not interpolant +} + +uniform sampler1D samp1D; +uniform isampler2D isamp2D; +uniform usampler3D usamp3D; +uniform samplerCube sampCube; +uniform isampler1DArray isamp1DA; +uniform usampler2DArray usamp2DA; +uniform isamplerCubeArray isampCubeA; + +uniform sampler1DShadow samp1Ds; +uniform sampler2DShadow samp2Ds; +uniform samplerCubeShadow sampCubes; +uniform sampler1DArrayShadow samp1DAs; +uniform sampler2DArrayShadow samp2DAs; +uniform samplerCubeArrayShadow sampCubeAs; + +uniform samplerBuffer sampBuf; +uniform sampler2DRect sampRect; + +void qlod() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); + lod = textureQueryLod(isamp2D, pf2); + lod = textureQueryLod(usamp3D, pf3); + lod = textureQueryLod(sampCube, pf3); + lod = textureQueryLod(isamp1DA, pf); + lod = textureQueryLod(usamp2DA, pf2); + lod = textureQueryLod(isampCubeA, pf3); + + lod = textureQueryLod(samp1Ds, pf); + lod = textureQueryLod(samp2Ds, pf2); + lod = textureQueryLod(sampCubes, pf3); + lod = textureQueryLod(samp1DAs, pf); + lod = textureQueryLod(samp2DAs, pf2); + lod = textureQueryLod(sampCubeAs, pf3); + + lod = textureQueryLod(sampBuf, pf); // ERROR + lod = textureQueryLod(sampRect, pf2); // ERROR +} + +uniform uint uu; +out uint iout; + +void bitwiseConv() +{ + iout = uu & i; + iout += uu ^ i; + iout += i | uu; +} + +subroutine(subT1, subT2); +subroutine float subT1() { return 1.0; } +subroutine float subT2() { return 1.0; } + +struct SKeyMem { int precise; } KeyMem; // ERROR, keyword can't be a member diff --git a/core/deps/glslang/Test/400.geom b/core/deps/glslang/Test/400.geom index 752e0d60b..f8e89558c 100644 --- a/core/deps/glslang/Test/400.geom +++ b/core/deps/glslang/Test/400.geom @@ -1,330 +1,330 @@ -#version 400 core - -void main() -{ - EmitStreamVertex(1); - EndStreamPrimitive(0); - EmitVertex(); - EndPrimitive(); - int id = gl_InvocationID; -} - -layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block -layout(max_vertices = 127) out; -layout(invocations = 4) in; - -#extension GL_ARB_separate_shader_objects : enable - -in gl_PerVertex { // testing input arrays with a block redeclaration, see 420.geom for without - vec4 gl_Position; - layout(std140, location = 3) patch float gl_PointSize; // ERRORs... -} gl_in[]; - -void foo() -{ - gl_in.length(); // ERROR - gl_in[1].gl_Position; -} - -in vec4 color[]; -in vec4 color2[]; -in vec4 colorS[3]; -in vec4 colorBad[4]; - -void foo2() -{ - color.length(); // ERROR - colorS.length(); -} - -layout(triangles) in; // give ERROR just for colorBad - -in vec4 color[3]; -in vec4 color2[3]; -in vec4 colorbad2[2]; // ERROR - -void foo3() -{ - gl_in.length(); - color.length(); - color2.length(); - colorS.length(); -} - -layout(location = 4) in vec4 cva[3]; -layout(location = 5) in vec4 cvb[3]; -layout(location = 2) in mat3 cmc[3]; // ERROR, collision - -patch in vec4 patchIn[]; // ERROR -patch out vec4 patchOut; // ERROR - -in float scalar; // ERROR, no array - -layout(max_vertices = 127, invocations = 4) out; // ERROR -layout(invocations = 4, max_vertices = 127) in; // ERROR -layout(max_vertices = 127, invocations = 4) uniform; // 2 ERRORs - -in inblockscalar { - int a; -} inbls; // ERROR, not an array - -in inblocka { - int a; -} inbla[17]; // ERROR, wrong array size - -void bits() -{ - uvec2 u2; - u2 = uaddCarry(u2, u2, u2); - uint u1; - u1 = usubBorrow(u1, u1, u1); - uvec4 u4; - umulExtended(u4, u4, u4, u4); - ivec4 i4; - imulExtended(i4, i4, i4, i4); - int i1; - i1 = bitfieldExtract(i1, 4, 5); - uvec3 u3; - u3 = bitfieldExtract(u3, 4, 5); - ivec3 i3; - i3 = bitfieldInsert(i3, i3, 4, 5); - u1 = bitfieldInsert(u1, u1, 4, 5); - ivec2 i2; - i2 = bitfieldReverse(i2); - u4 = bitfieldReverse(u4); - i1 = bitCount(i1); - i3 = bitCount(u3); - i2 = findLSB(i2); - i4 = findLSB(u4); - i1 = findMSB(i1); - i2 = findMSB(u2); -} - -layout(location = 7, index = 1) out vec4 indexedOut; - -uniform sampler1D samp1D; -uniform sampler2DShadow samp2Ds; - -void qlod() -{ - vec2 lod; - float pf; - vec2 pf2; - vec3 pf3; - - lod = textureQueryLod(samp1D, pf); // ERROR, only in fragment - lod = textureQueryLod(samp2Ds, pf2); // ERROR, only in fragment -} - -void doubles() -{ - double doublev; - dvec2 dvec2v; - dvec3 dvec3v; - dvec4 dvec4v; - - bool boolv; - bvec2 bvec2v; - bvec3 bvec3v; - bvec4 bvec4v; - - doublev = sqrt(2.9); - dvec2v = sqrt(dvec2(2.7)); - dvec3v = sqrt(dvec3(2.0)); - dvec4v = sqrt(dvec4(2.1)); - - doublev += inversesqrt(doublev); - dvec2v += inversesqrt(dvec2v); - dvec3v += inversesqrt(dvec3v); - dvec4v += inversesqrt(dvec4v); - - doublev += abs(doublev); - dvec2v += abs(dvec2v); - dvec3v += abs(dvec3v); - dvec4v += abs(dvec4v); - - doublev += sign(doublev); - dvec2v += sign(dvec2v); - dvec3v += sign(dvec3v); - dvec4v += sign(dvec4v); - - doublev += floor(doublev); - dvec2v += floor(dvec2v); - dvec3v += floor(dvec3v); - dvec4v += floor(dvec4v); - - doublev += trunc(doublev); - dvec2v += trunc(dvec2v); - dvec3v += trunc(dvec3v); - dvec4v += trunc(dvec4v); - - doublev += round(doublev); - dvec2v += round(dvec2v); - dvec3v += round(dvec3v); - dvec4v += round(dvec4v); - - doublev += roundEven(doublev); - dvec2v += roundEven(dvec2v); - dvec3v += roundEven(dvec3v); - dvec4v += roundEven(dvec4v); - - doublev += ceil(doublev); - dvec2v += ceil(dvec2v); - dvec3v += ceil(dvec3v); - dvec4v += ceil(dvec4v); - - doublev += fract(doublev); - dvec2v += fract(dvec2v); - dvec3v += fract(dvec3v); - dvec4v += fract(dvec4v); - - doublev += mod(doublev, doublev); - dvec2v += mod(dvec2v, doublev); - dvec3v += mod(dvec3v, doublev); - dvec4v += mod(dvec4v, doublev); - dvec2v += mod(dvec2v, dvec2v); - dvec3v += mod(dvec3v, dvec3v); - dvec4v += mod(dvec4v, dvec4v); - - doublev += modf(doublev, doublev); - dvec2v += modf(dvec2v, dvec2v); - dvec3v += modf(dvec3v, dvec3v); - dvec4v += modf(dvec4v, dvec4v); - - doublev += min(doublev, doublev); - dvec2v += min(dvec2v, doublev); - dvec3v += min(dvec3v, doublev); - dvec4v += min(dvec4v, doublev); - dvec2v += min(dvec2v, dvec2v); - dvec3v += min(dvec3v, dvec3v); - dvec4v += min(dvec4v, dvec4v); - - doublev += max(doublev, doublev); - dvec2v += max(dvec2v, doublev); - dvec3v += max(dvec3v, doublev); - dvec4v += max(dvec4v, doublev); - dvec2v += max(dvec2v, dvec2v); - dvec3v += max(dvec3v, dvec3v); - dvec4v += max(dvec4v, dvec4v); - - doublev += clamp(doublev, doublev, doublev); - dvec2v += clamp(dvec2v, doublev, doublev); - dvec3v += clamp(dvec3v, doublev, doublev); - dvec4v += clamp(dvec4v, doublev, doublev); - dvec2v += clamp(dvec2v, dvec2v, dvec2v); - dvec3v += clamp(dvec3v, dvec3v, dvec3v); - dvec4v += clamp(dvec4v, dvec4v, dvec4v); - - doublev += mix(doublev, doublev, doublev); - dvec2v += mix(dvec2v, dvec2v, doublev); - dvec3v += mix(dvec3v, dvec3v, doublev); - dvec4v += mix(dvec4v, dvec4v, doublev); - dvec2v += mix(dvec2v, dvec2v, dvec2v); - dvec3v += mix(dvec3v, dvec3v, dvec3v); - dvec4v += mix(dvec4v, dvec4v, dvec4v); - doublev += mix(doublev, doublev, boolv); - dvec2v += mix(dvec2v, dvec2v, bvec2v); - dvec3v += mix(dvec3v, dvec3v, bvec3v); - dvec4v += mix(dvec4v, dvec4v, bvec4v); - - doublev += step(doublev, doublev); - dvec2v += step(dvec2v, dvec2v); - dvec3v += step(dvec3v, dvec3v); - dvec4v += step(dvec4v, dvec4v); - dvec2v += step(doublev, dvec2v); - dvec3v += step(doublev, dvec3v); - dvec4v += step(doublev, dvec4v); - - doublev += smoothstep(doublev, doublev, doublev); - dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); - dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); - dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); - dvec2v += smoothstep(doublev, doublev, dvec2v); - dvec3v += smoothstep(doublev, doublev, dvec3v); - dvec4v += smoothstep(doublev, doublev, dvec4v); - - boolv = isnan(doublev); - bvec2v = isnan(dvec2v); - bvec3v = isnan(dvec3v); - bvec4v = isnan(dvec4v); - - boolv = boolv ? isinf(doublev) : false; - bvec2v = boolv ? isinf(dvec2v) : bvec2(false); - bvec3v = boolv ? isinf(dvec3v) : bvec3(false); - bvec4v = boolv ? isinf(dvec4v) : bvec4(false); - - doublev += length(doublev); - doublev += length(dvec2v); - doublev += length(dvec3v); - doublev += length(dvec4v); - - doublev += distance(doublev, doublev); - doublev += distance(dvec2v, dvec2v); - doublev += distance(dvec3v, dvec3v); - doublev += distance(dvec4v, dvec4v); - - doublev += dot(doublev, doublev); - doublev += dot(dvec2v, dvec2v); - doublev += dot(dvec3v, dvec3v); - doublev += dot(dvec4v, dvec4v); - - dvec3v += cross(dvec3v, dvec3v); - - doublev += normalize(doublev); - dvec2v += normalize(dvec2v); - dvec3v += normalize(dvec3v); - dvec4v += normalize(dvec4v); - - doublev += faceforward(doublev, doublev, doublev); - dvec2v += faceforward(dvec2v, dvec2v, dvec2v); - dvec3v += faceforward(dvec3v, dvec3v, dvec3v); - dvec4v += faceforward(dvec4v, dvec4v, dvec4v); - - doublev += reflect(doublev, doublev); - dvec2v += reflect(dvec2v, dvec2v); - dvec3v += reflect(dvec3v, dvec3v); - dvec4v += reflect(dvec4v, dvec4v); - - doublev += refract(doublev, doublev, doublev); - dvec2v += refract(dvec2v, dvec2v, doublev); - dvec3v += refract(dvec3v, dvec3v, doublev); - dvec4v += refract(dvec4v, dvec4v, doublev); - - dmat2 dmat2v = outerProduct(dvec2v, dvec2v); - dmat3 dmat3v = outerProduct(dvec3v, dvec3v); - dmat4 dmat4v = outerProduct(dvec4v, dvec4v); - dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); - dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); - dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); - dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); - dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); - dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); - - dmat2v *= matrixCompMult(dmat2v, dmat2v); - dmat3v *= matrixCompMult(dmat3v, dmat3v); - dmat4v *= matrixCompMult(dmat4v, dmat4v); - dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); - dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); - dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); - dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); - dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); - dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); - - dmat2v *= transpose(dmat2v); - dmat3v *= transpose(dmat3v); - dmat4v *= transpose(dmat4v); - dmat2x3v = transpose(dmat3x2v); - dmat3x2v = transpose(dmat2x3v); - dmat2x4v = transpose(dmat4x2v); - dmat4x2v = transpose(dmat2x4v); - dmat3x4v = transpose(dmat4x3v); - dmat4x3v = transpose(dmat3x4v); - - doublev += determinant(dmat2v); - doublev += determinant(dmat3v); - doublev += determinant(dmat4v); - - dmat2v *= inverse(dmat2v); - dmat3v *= inverse(dmat3v); - dmat4v *= inverse(dmat4v); -} +#version 400 core + +void main() +{ + EmitStreamVertex(1); + EndStreamPrimitive(0); + EmitVertex(); + EndPrimitive(); + int id = gl_InvocationID; +} + +layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block +layout(max_vertices = 127) out; +layout(invocations = 4) in; + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex { // testing input arrays with a block redeclaration, see 420.geom for without + vec4 gl_Position; + layout(std140, location = 3) patch float gl_PointSize; // ERRORs... +} gl_in[]; + +void foo() +{ + gl_in.length(); // ERROR + gl_in[1].gl_Position; +} + +in vec4 color[]; +in vec4 color2[]; +in vec4 colorS[3]; +in vec4 colorBad[4]; + +void foo2() +{ + color.length(); // ERROR + colorS.length(); +} + +layout(triangles) in; // give ERROR just for colorBad + +in vec4 color[3]; +in vec4 color2[3]; +in vec4 colorbad2[2]; // ERROR + +void foo3() +{ + gl_in.length(); + color.length(); + color2.length(); + colorS.length(); +} + +layout(location = 4) in vec4 cva[3]; +layout(location = 5) in vec4 cvb[3]; +layout(location = 2) in mat3 cmc[3]; // ERROR, collision + +patch in vec4 patchIn[]; // ERROR +patch out vec4 patchOut; // ERROR + +in float scalar; // ERROR, no array + +layout(max_vertices = 127, invocations = 4) out; // ERROR +layout(invocations = 4, max_vertices = 127) in; // ERROR +layout(max_vertices = 127, invocations = 4) uniform; // 2 ERRORs + +in inblockscalar { + int a; +} inbls; // ERROR, not an array + +in inblocka { + int a; +} inbla[17]; // ERROR, wrong array size + +void bits() +{ + uvec2 u2; + u2 = uaddCarry(u2, u2, u2); + uint u1; + u1 = usubBorrow(u1, u1, u1); + uvec4 u4; + umulExtended(u4, u4, u4, u4); + ivec4 i4; + imulExtended(i4, i4, i4, i4); + int i1; + i1 = bitfieldExtract(i1, 4, 5); + uvec3 u3; + u3 = bitfieldExtract(u3, 4, 5); + ivec3 i3; + i3 = bitfieldInsert(i3, i3, 4, 5); + u1 = bitfieldInsert(u1, u1, 4, 5); + ivec2 i2; + i2 = bitfieldReverse(i2); + u4 = bitfieldReverse(u4); + i1 = bitCount(i1); + i3 = bitCount(u3); + i2 = findLSB(i2); + i4 = findLSB(u4); + i1 = findMSB(i1); + i2 = findMSB(u2); +} + +layout(location = 7, index = 1) out vec4 indexedOut; + +uniform sampler1D samp1D; +uniform sampler2DShadow samp2Ds; + +void qlod() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); // ERROR, only in fragment + lod = textureQueryLod(samp2Ds, pf2); // ERROR, only in fragment +} + +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(2.1)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + + dmat2v *= matrixCompMult(dmat2v, dmat2v); + dmat3v *= matrixCompMult(dmat3v, dmat3v); + dmat4v *= matrixCompMult(dmat4v, dmat4v); + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); +} diff --git a/core/deps/glslang/Test/400.tesc b/core/deps/glslang/Test/400.tesc index 5cefab1b0..6d609d589 100644 --- a/core/deps/glslang/Test/400.tesc +++ b/core/deps/glslang/Test/400.tesc @@ -1,108 +1,108 @@ -#version 400 core - -layout(vertices = 4) out; -int outa[gl_out.length()]; - -layout(quads) in; // ERROR -layout(ccw) out; // ERROR -layout(fractional_even_spacing) in; // ERROR - -patch in vec4 patchIn; // ERROR -patch out vec4 patchOut; - -void main() -{ - barrier(); - - int a = gl_MaxTessControlInputComponents + - gl_MaxTessControlOutputComponents + - gl_MaxTessControlTextureImageUnits + - gl_MaxTessControlUniformComponents + - gl_MaxTessControlTotalOutputComponents; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - int iid = gl_InvocationID; - - gl_out[gl_InvocationID].gl_Position = p; - gl_out[gl_InvocationID].gl_PointSize = ps; - gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; - - gl_TessLevelOuter[3] = 3.2; - gl_TessLevelInner[1] = 1.3; - - if (a > 10) - barrier(); // ERROR - else - barrier(); // ERROR - - barrier(); - - do { - barrier(); // ERROR - } while (a > 10); - - switch (a) { - default: - barrier(); // ERROR - break; - } - a < 12 ? a : (barrier(), a); // ERROR - { - barrier(); - } - - return; - - barrier(); // ERROR -} - -layout(vertices = 4) in; // ERROR -layout(vertices = 5) out; // ERROR - -void foo() -{ - gl_out[4].gl_PointSize; // ERROR - - barrier(); // ERROR -} - -in vec2 ina; // ERROR, not array -in vec2 inb[]; -in vec2 inc[18]; // ERROR, wrong size -in vec2 ind[gl_MaxPatchVertices]; - -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 3) in vec4 ivla[]; -layout(location = 4) in vec4 ivlb[]; -layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping - -layout(location = 3) out vec4 ovla[]; -layout(location = 4) out vec4 ovlb[]; -layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping - -precise vec3 pv3; - -void foop() -{ - precise double d; - - pv3 *= pv3; - pv3 = fma(pv3, pv3, pv3); - d = fma(d, d, d); -} - -patch out pinbn { - int a; -} pinbi; - -invariant precise out vec4 badOrder[]; // ERROR, precise must appear first -void badp(out precise float f); // ERROR, precise must appear first +#version 400 core + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +layout(quads) in; // ERROR +layout(ccw) out; // ERROR +layout(fractional_even_spacing) in; // ERROR + +patch in vec4 patchIn; // ERROR +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; + + if (a > 10) + barrier(); // ERROR + else + barrier(); // ERROR + + barrier(); + + do { + barrier(); // ERROR + } while (a > 10); + + switch (a) { + default: + barrier(); // ERROR + break; + } + a < 12 ? a : (barrier(), a); // ERROR + { + barrier(); + } + + return; + + barrier(); // ERROR +} + +layout(vertices = 4) in; // ERROR +layout(vertices = 5) out; // ERROR + +void foo() +{ + gl_out[4].gl_PointSize; // ERROR + + barrier(); // ERROR +} + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; +layout(location = 4) in vec4 ivlc[]; // ERROR, overlapping + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; +layout(location = 4) out vec4 ovlc[]; // ERROR, overlapping + +precise vec3 pv3; + +void foop() +{ + precise double d; + + pv3 *= pv3; + pv3 = fma(pv3, pv3, pv3); + d = fma(d, d, d); +} + +patch out pinbn { + int a; +} pinbi; + +invariant precise out vec4 badOrder[]; // ERROR, precise must appear first +void badp(out precise float f); // ERROR, precise must appear first void devi() { diff --git a/core/deps/glslang/Test/400.tese b/core/deps/glslang/Test/400.tese index c26b83eb3..a3d30fea9 100644 --- a/core/deps/glslang/Test/400.tese +++ b/core/deps/glslang/Test/400.tese @@ -1,108 +1,108 @@ -#version 400 core - -layout(vertices = 4) out; // ERROR -layout(quads, cw) in; -layout(triangles) in; // ERROR -layout(isolines) in; // ERROR - -layout(ccw) in; // ERROR -layout(cw) in; - -layout(fractional_odd_spacing) in; -layout(equal_spacing) in; // ERROR -layout(fractional_even_spacing) in; // ERROR - -layout(point_mode) in; - -patch in vec4 patchIn; -patch out vec4 patchOut; // ERROR - -void main() -{ - barrier(); // ERROR - - int a = gl_MaxTessEvaluationInputComponents + - gl_MaxTessEvaluationOutputComponents + - gl_MaxTessEvaluationTextureImageUnits + - gl_MaxTessEvaluationUniformComponents + - gl_MaxTessPatchComponents + - gl_MaxPatchVertices + - gl_MaxTessGenLevel; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - vec3 tc = gl_TessCoord; - float tlo = gl_TessLevelOuter[3]; - float tli = gl_TessLevelInner[1]; - - gl_Position = p; - gl_PointSize = ps; - gl_ClipDistance[2] = cd; -} - -smooth patch in vec4 badp1; // ERROR -flat patch in vec4 badp2; // ERROR -noperspective patch in vec4 badp3; // ERROR -patch sample in vec3 badp4; // ERROR - -#extension GL_ARB_separate_shader_objects : enable - -in gl_PerVertex -{ - float gl_ClipDistance[1]; -} gl_in[]; - -in gl_PerVertex // ERROR, second redeclaration of gl_in -{ - float gl_ClipDistance[1]; -} gl_in[]; - -layout(quads, cw) out; // ERROR -layout(triangles) out; // ERROR -layout(isolines) out; // ERROR -layout(cw) out; // ERROR -layout(fractional_odd_spacing) out; // ERROR -layout(equal_spacing) out; // ERROR -layout(fractional_even_spacing) out; // ERROR -layout(point_mode) out; // ERROR - -in vec2 ina; // ERROR, not array -in vec2 inb[]; -in vec2 inc[18]; // ERROR, wrong size -in vec2 ind[gl_MaxPatchVertices]; - -in testbla { - int f; -} bla; // ERROR, not array - -in testblb { - int f; -} blb[]; - -in testblc { - int f; -} blc[18]; // ERROR wrong size - -in testbld { - int f; -} bld[gl_MaxPatchVertices]; - -layout(location = 23) in vec4 ivla[]; -layout(location = 24) in vec4 ivlb[]; -layout(location = 24) in vec4 ivlc[]; // ERROR - -layout(location = 23) out vec4 ovla[2]; -layout(location = 24) out vec4 ovlb[2]; // ERROR - -in float gl_TessLevelOuter[4]; // ERROR, can't redeclare - -patch in pinbn { - int a; -} pinbi; +#version 400 core + +layout(vertices = 4) out; // ERROR +layout(quads, cw) in; +layout(triangles) in; // ERROR +layout(isolines) in; // ERROR + +layout(ccw) in; // ERROR +layout(cw) in; + +layout(fractional_odd_spacing) in; +layout(equal_spacing) in; // ERROR +layout(fractional_even_spacing) in; // ERROR + +layout(point_mode) in; + +patch in vec4 patchIn; +patch out vec4 patchOut; // ERROR + +void main() +{ + barrier(); // ERROR + + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; +} + +smooth patch in vec4 badp1; // ERROR +flat patch in vec4 badp2; // ERROR +noperspective patch in vec4 badp3; // ERROR +patch sample in vec3 badp4; // ERROR + +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + float gl_ClipDistance[1]; +} gl_in[]; + +in gl_PerVertex // ERROR, second redeclaration of gl_in +{ + float gl_ClipDistance[1]; +} gl_in[]; + +layout(quads, cw) out; // ERROR +layout(triangles) out; // ERROR +layout(isolines) out; // ERROR +layout(cw) out; // ERROR +layout(fractional_odd_spacing) out; // ERROR +layout(equal_spacing) out; // ERROR +layout(fractional_even_spacing) out; // ERROR +layout(point_mode) out; // ERROR + +in vec2 ina; // ERROR, not array +in vec2 inb[]; +in vec2 inc[18]; // ERROR, wrong size +in vec2 ind[gl_MaxPatchVertices]; + +in testbla { + int f; +} bla; // ERROR, not array + +in testblb { + int f; +} blb[]; + +in testblc { + int f; +} blc[18]; // ERROR wrong size + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; +layout(location = 24) in vec4 ivlc[]; // ERROR + +layout(location = 23) out vec4 ovla[2]; +layout(location = 24) out vec4 ovlb[2]; // ERROR + +in float gl_TessLevelOuter[4]; // ERROR, can't redeclare + +patch in pinbn { + int a; +} pinbi; void devi() { diff --git a/core/deps/glslang/Test/400.vert b/core/deps/glslang/Test/400.vert index 4548eeb61..315c7ea04 100644 --- a/core/deps/glslang/Test/400.vert +++ b/core/deps/glslang/Test/400.vert @@ -5,90 +5,90 @@ in dvec3 d3; // ERROR, no doubles in dmat4 dm4; // ERROR, no doubles // function selection under type conversion -void foo1(double a, uint b) {} -void foo1(double a, int b) {} -void foo1(double a, float b) {} -void foo1(double a, double b){} - -void foo2(double a, float b) {} -void foo2(double a, double b){} - -void foo3(double a, float b) {} -void foo3(float a, double b) {} - -void ftd( int, float, double) {} -void ftd( uint, float, double) {} -void ftd(float, double, double) {} - -void main() -{ - double d; - uint u; - int i; - float f; - - foo1(d, d); - foo1(d, u); - foo1(d, i); - foo1(d, f); - - foo1(f, d); - foo1(f, u); - foo1(f, i); - foo1(f, f); - - foo1(u, d); - foo1(u, u); - foo1(u, i); - foo1(u, f); - - foo1(i, d); - foo1(i, u); - foo1(i, i); - foo1(i, f); - - foo2(d, d); - foo2(d, u); - foo2(d, i); - foo2(d, f); - - foo2(f, d); - foo2(f, u); - foo2(f, i); - foo2(f, f); - - foo2(u, d); - foo2(u, u); - foo2(u, i); - foo2(u, f); - - foo2(i, d); - foo2(i, u); - foo2(i, i); - foo2(i, f); - - foo3(d, d); // ERROR, no match - foo3(d, u); - foo3(d, i); - foo3(d, f); - - foo3(f, d); - foo3(f, u); // ERROR, ambiguous - foo3(f, i); // ERROR, ambiguous - foo3(f, f); // ERROR, ambiguous - - foo3(u, d); - foo3(u, u); // ERROR, ambiguous - foo3(u, i); // ERROR, ambiguous - foo3(u, f); // ERROR, ambiguous - - foo3(i, d); - foo3(i, u); // ERROR, ambiguous - foo3(i, i); // ERROR, ambiguous - foo3(i, f); // ERROR, ambiguous - - ftd(i, f, f); - ftd(u, f, f); +void foo1(double a, uint b) {} +void foo1(double a, int b) {} +void foo1(double a, float b) {} +void foo1(double a, double b){} + +void foo2(double a, float b) {} +void foo2(double a, double b){} + +void foo3(double a, float b) {} +void foo3(float a, double b) {} + +void ftd( int, float, double) {} +void ftd( uint, float, double) {} +void ftd(float, double, double) {} + +void main() +{ + double d; + uint u; + int i; + float f; + + foo1(d, d); + foo1(d, u); + foo1(d, i); + foo1(d, f); + + foo1(f, d); + foo1(f, u); + foo1(f, i); + foo1(f, f); + + foo1(u, d); + foo1(u, u); + foo1(u, i); + foo1(u, f); + + foo1(i, d); + foo1(i, u); + foo1(i, i); + foo1(i, f); + + foo2(d, d); + foo2(d, u); + foo2(d, i); + foo2(d, f); + + foo2(f, d); + foo2(f, u); + foo2(f, i); + foo2(f, f); + + foo2(u, d); + foo2(u, u); + foo2(u, i); + foo2(u, f); + + foo2(i, d); + foo2(i, u); + foo2(i, i); + foo2(i, f); + + foo3(d, d); // ERROR, no match + foo3(d, u); + foo3(d, i); + foo3(d, f); + + foo3(f, d); + foo3(f, u); // ERROR, ambiguous + foo3(f, i); // ERROR, ambiguous + foo3(f, f); // ERROR, ambiguous + + foo3(u, d); + foo3(u, u); // ERROR, ambiguous + foo3(u, i); // ERROR, ambiguous + foo3(u, f); // ERROR, ambiguous + + foo3(i, d); + foo3(i, u); // ERROR, ambiguous + foo3(i, i); // ERROR, ambiguous + foo3(i, f); // ERROR, ambiguous + + ftd(i, f, f); + ftd(u, f, f); } void itf(int, float, int); @@ -96,10 +96,10 @@ void itf(int, double, int); void tf() { - double d; - uint u; - int i; - float f; + double d; + uint u; + int i; + float f; itf(i, i, i); itf(i, u, i); diff --git a/core/deps/glslang/Test/410.geom b/core/deps/glslang/Test/410.geom index 7aadc3901..8775aeb15 100644 --- a/core/deps/glslang/Test/410.geom +++ b/core/deps/glslang/Test/410.geom @@ -1,39 +1,39 @@ -#version 410 core - -void main() -{ - gl_ViewportIndex = 7; -} - -in gl_PerVertex { - float gl_PointSize; -} myIn[]; // ERROR, can't redeclare a different name - -in gl_PerVertex { - float gl_PointSize; -} gl_myIn[]; // ERROR, can't redeclare a different name - -in gl_PerVertex { - float gl_PointSize; -} gl_in[]; - -in gl_PerVertex { - float gl_PointSize; -} gl_in[]; // ERROR, can't do it again - -out gl_PerVertex { - float gl_PointSize; -}; - -void foo() -{ - float p = gl_in[1].gl_PointSize; // use of redeclared - gl_PointSize = p; // use of redeclared - vec4 v = gl_in[1].gl_Position; // ERROR, not included in the redeclaration - gl_Position = vec4(1.0); // ERROR, not included in the redeclaration -} - -float foo5() -{ - return 4; // implicit conversion of return type -} +#version 410 core + +void main() +{ + gl_ViewportIndex = 7; +} + +in gl_PerVertex { + float gl_PointSize; +} myIn[]; // ERROR, can't redeclare a different name + +in gl_PerVertex { + float gl_PointSize; +} gl_myIn[]; // ERROR, can't redeclare a different name + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; // ERROR, can't do it again + +out gl_PerVertex { + float gl_PointSize; +}; + +void foo() +{ + float p = gl_in[1].gl_PointSize; // use of redeclared + gl_PointSize = p; // use of redeclared + vec4 v = gl_in[1].gl_Position; // ERROR, not included in the redeclaration + gl_Position = vec4(1.0); // ERROR, not included in the redeclaration +} + +float foo5() +{ + return 4; // implicit conversion of return type +} diff --git a/core/deps/glslang/Test/410.tesc b/core/deps/glslang/Test/410.tesc index edb2af96b..d96a27003 100644 --- a/core/deps/glslang/Test/410.tesc +++ b/core/deps/glslang/Test/410.tesc @@ -1,11 +1,11 @@ -#version 400 core - -// no layout(vertices = ...) out; -int outa[gl_out.length()]; // ERROR - -patch out vec4 patchOut; - -void main() -{ - -} +#version 400 core + +// no layout(vertices = ...) out; +int outa[gl_out.length()]; // ERROR + +patch out vec4 patchOut; + +void main() +{ + +} diff --git a/core/deps/glslang/Test/410.vert b/core/deps/glslang/Test/410.vert index 0ecf4768a..1891a670a 100644 --- a/core/deps/glslang/Test/410.vert +++ b/core/deps/glslang/Test/410.vert @@ -6,4 +6,5 @@ in dmat4 dm4; void main() { + int test = gl_MaxFragmentUniformVectors; } diff --git a/core/deps/glslang/Test/420.comp b/core/deps/glslang/Test/420.comp index b189310b7..d92e6f0d0 100644 --- a/core/deps/glslang/Test/420.comp +++ b/core/deps/glslang/Test/420.comp @@ -1,30 +1,30 @@ -#version 420 - -layout(local_size_x = 2) in; // ERROR, no compute - -#extension GL_ARB_compute_shader : enable - -layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in; - -shared vec3 sfoo; - -void main() -{ - sfoo = vec3(gl_WorkGroupSize.x, gl_WorkGroupSize.y, gl_WorkGroupSize.z); - sfoo += gl_WorkGroupSize + gl_NumWorkGroups + gl_WorkGroupID + gl_LocalInvocationID + gl_GlobalInvocationID; - sfoo *= gl_LocalInvocationIndex; - sfoo += gl_MaxComputeWorkGroupCount + gl_MaxComputeWorkGroupSize; - sfoo *= gl_MaxComputeUniformComponents + - gl_MaxComputeTextureImageUnits + - gl_MaxComputeImageUniforms + - gl_MaxComputeAtomicCounters + - gl_MaxComputeAtomicCounterBuffers; - - barrier(); - memoryBarrier(); - memoryBarrierAtomicCounter(); - memoryBarrierBuffer(); - memoryBarrierImage(); - memoryBarrierShared(); - groupMemoryBarrier(); +#version 420 + +layout(local_size_x = 2) in; // ERROR, no compute + +#extension GL_ARB_compute_shader : enable + +layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in; + +shared vec3 sfoo; + +void main() +{ + sfoo = vec3(gl_WorkGroupSize.x, gl_WorkGroupSize.y, gl_WorkGroupSize.z); + sfoo += gl_WorkGroupSize + gl_NumWorkGroups + gl_WorkGroupID + gl_LocalInvocationID + gl_GlobalInvocationID; + sfoo *= gl_LocalInvocationIndex; + sfoo += gl_MaxComputeWorkGroupCount + gl_MaxComputeWorkGroupSize; + sfoo *= gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierImage(); + memoryBarrierShared(); + groupMemoryBarrier(); } \ No newline at end of file diff --git a/core/deps/glslang/Test/420.frag b/core/deps/glslang/Test/420.frag index 1444758ea..d3020b364 100644 --- a/core/deps/glslang/Test/420.frag +++ b/core/deps/glslang/Test/420.frag @@ -12,3 +12,31 @@ layout(depth_less) in float depth; // ERROR: depth_less only applies to gl_FragD layout(depth_any) out float gl_FragDepth; // ERROR, done after use layout(binding=0) uniform atomic_uint a[]; + +uniform writeonly image2D i2D; +ivec2 iv2dim = imageSize(i2D); // ERROR: imageSize called without enabling GL_ARB_shader_image_size extension +#extension GL_ARB_shader_image_size : enable +ivec2 iv2dim1 = imageSize(i2D); + +#extension GL_ARB_shader_storage_buffer_object : enable + +layout(binding = 0,std430) buffer Buffer +{ + int atomi; + uint atomu; +}; + +void atomicOpPass() +{ + int origi = atomicAdd(atomi, 3); + uint origu = atomicAnd(atomu, 7u); + origi = atomicExchange(atomi, 4); + origu = atomicCompSwap(atomu, 10u, 8u); +} + +#extension GL_ARB_shader_storage_buffer_object : disable + +layout(binding = 1,std430) buffer BufferFail // Error std430 and "buffer" block support disabled +{ + int atom1i; +}; diff --git a/core/deps/glslang/Test/420.geom b/core/deps/glslang/Test/420.geom index 8195a11a5..43903bc70 100644 --- a/core/deps/glslang/Test/420.geom +++ b/core/deps/glslang/Test/420.geom @@ -1,55 +1,55 @@ -#version 420 core - -// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with - -int i; - -void foo() -{ - gl_in.length(); // ERROR - gl_in[1].gl_Position; - gl_in[i].gl_Position; // ERROR -} - -layout(triangles) in; - -in vec4 color3[3]; - -void foo3() -{ - gl_in.length(); - gl_in[i].gl_Position; - color3.length(); -} - -uniform sampler2D s2D; -in vec2 coord[]; -uniform vec4 v4; - -void foo4() -{ - const ivec2 offsets[5] = - { - ivec2(0,1), - ivec2(1,-2), - ivec2(0,3), - ivec2(-3,0), - ivec2(2,1) - }; - - vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); - - offsets[i].xy = ivec2(3); // ERROR - v4.x = 3.2; // ERROR - v4.xy; // should have non-uniform type -} - -out gl_PerVertex { - float gl_PointSize[1]; // ERROR, adding array - float gl_ClipDistance; // ERROR, removing array -}; - -float foo5() -{ - return i; // implicit conversion of return type -} +#version 420 core + +// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with + +int i; + +void foo() +{ + gl_in.length(); // ERROR + gl_in[1].gl_Position; + gl_in[i].gl_Position; // ERROR +} + +layout(triangles) in; + +in vec4 color3[3]; + +void foo3() +{ + gl_in.length(); + gl_in[i].gl_Position; + color3.length(); +} + +uniform sampler2D s2D; +in vec2 coord[]; +uniform vec4 v4; + +void foo4() +{ + const ivec2 offsets[5] = + { + ivec2(0,1), + ivec2(1,-2), + ivec2(0,3), + ivec2(-3,0), + ivec2(2,1) + }; + + vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); + + offsets[i].xy = ivec2(3); // ERROR + v4.x = 3.2; // ERROR + v4.xy; // should have non-uniform type +} + +out gl_PerVertex { + float gl_PointSize[1]; // ERROR, adding array + float gl_ClipDistance; // ERROR, removing array +}; + +float foo5() +{ + return i; // implicit conversion of return type +} diff --git a/core/deps/glslang/Test/420.tesc b/core/deps/glslang/Test/420.tesc index 7271d7f91..b9fd21c2f 100644 --- a/core/deps/glslang/Test/420.tesc +++ b/core/deps/glslang/Test/420.tesc @@ -1,43 +1,43 @@ -#version 420 core - -#extension GL_ARB_separate_shader_objects : enable - -layout(vertices = 4) out; - -out gl_PerVertex { - vec4 gl_Position; -} gl_out[3]; // ERROR, wrong size - -out int a[gl_out.length()]; -out int outb[5]; // ERROR, wrong size -out int outc[]; - -void main() -{ - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - int iid = gl_InvocationID; - - gl_out[gl_InvocationID].gl_Position = p; - gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR -} - -out float outf; // ERROR, no array - -layout (location = 0) in dmat2x4 vs_tcs_first[]; -layout (location = 12) in dmat2x4 vs_tcs_last[]; - -void foo() -{ - if ((dmat2x4(dvec4(-0.625, -0.5, -0.375lf, -0.25), dvec4(-0.375, -0.25, -0.125, 0)) != vs_tcs_first[0]) || - (dmat2x4(dvec4(0.375, 0.5, 0.625, 0.75), dvec4(0.625, 0.75, 0.875, -0.625)) != vs_tcs_last[0])) - { - ; - } -} - -layout(vertices = 0) out; // ERROR, can't be 0 +#version 420 core + +#extension GL_ARB_separate_shader_objects : enable + +layout(vertices = 4) out; + +out gl_PerVertex { + vec4 gl_Position; +} gl_out[3]; // ERROR, wrong size + +out int a[gl_out.length()]; +out int outb[5]; // ERROR, wrong size +out int outc[]; + +void main() +{ + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; // ERROR +} + +out float outf; // ERROR, no array + +layout (location = 0) in dmat2x4 vs_tcs_first[]; +layout (location = 12) in dmat2x4 vs_tcs_last[]; + +void foo() +{ + if ((dmat2x4(dvec4(-0.625, -0.5, -0.375lf, -0.25), dvec4(-0.375, -0.25, -0.125, 0)) != vs_tcs_first[0]) || + (dmat2x4(dvec4(0.375, 0.5, 0.625, 0.75), dvec4(0.625, 0.75, 0.875, -0.625)) != vs_tcs_last[0])) + { + ; + } +} + +layout(vertices = 0) out; // ERROR, can't be 0 diff --git a/core/deps/glslang/Test/420.tese b/core/deps/glslang/Test/420.tese index feaaa8a67..4c3693a83 100644 --- a/core/deps/glslang/Test/420.tese +++ b/core/deps/glslang/Test/420.tese @@ -1,90 +1,90 @@ -#version 420 core - -const mat2x2 a = mat2( vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) ); -mat2x2 b = { vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) }; -const mat2x2 c = { { 1.0, 0.0, }, { 0.0, 1.0 } }; - -float a2[2] = { 3.4, 4.2, 5.0 }; // illegal -vec2 b2 = { 1.0, 2.0, 3.0 }; // illegal -mat3x3 c2 = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal -mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting - -struct { - float a; - int b; -} e = { 1.2, 2, }; - -struct { - float a; - int b; -} e2 = { 1, 3 }; // legal, first initializer is converted - -struct { - float a; - int b; -} e3 = { 1.2, 2, 3 }; // illegal - -int a3 = true; // illegal -vec4 b3[2] = { vec4(0.0), 1.0 }; // illegal -vec4 b4[2] = vec4[2](vec4(0.0), mat2x2(1.0)); // illegal -mat4x2 c3 = { vec3(0.0), vec3(1.0) }; // illegal - -struct S1 { - vec4 a; - vec4 b; -}; - -struct { - float s; - float t; -} d2[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal - -float b5[] = { 3.4, 4.2, 5.0, 5.2, 1.1 }; - -struct S3 { - float f; - mat2x3 m23; -}; - -struct S4 { - uvec2 uv2; - S3 s[2]; -}; - -struct Single1 { int f; }; -Single1 single1 = { 10 }; - -struct Single2 { uvec2 v; }; -Single2 single2 = { { 1, 2 } }; - -struct Single3 { Single1 s1; }; -Single3 single3 = { { 3 } }; - -struct Single4 { Single2 s1; }; -Single4 single4 = { { { 4u, 5u } } }; - -const S4 constructed = S4(uvec2(1, 2), - S3[2](S3(3.0, mat2x3(4.0)), - S3(5.0, mat2x3(6.0)))); - -const S4 curlybad1 = { {1, 2}, - { {3, {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } }, // ERROR, the mat2x3 isn't isolated - {5.0, {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } }; - -const S4 curlyInit = { {1, 2}, - { {3, { {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } } }, - {5.0, { {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } } }; - -float vc1, vc2, vc3; -vec3 av3 = vec3(vc1, vc2, vc3); -vec3 bv3 = { vc1, vc2, vc3 }; - -void main() -{ - memoryBarrier(); - - if (constructed == curlybad1) - ; - if (constructed == curlyInit) - ; -} +#version 420 core + +const mat2x2 a = mat2( vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) ); +mat2x2 b = { vec2( 1.0, 0.0 ), vec2( 0.0, 1.0 ) }; +const mat2x2 c = { { 1.0, 0.0, }, { 0.0, 1.0 } }; + +float a2[2] = { 3.4, 4.2, 5.0 }; // illegal +vec2 b2 = { 1.0, 2.0, 3.0 }; // illegal +mat3x3 c2 = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal +mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting + +struct { + float a; + int b; +} e = { 1.2, 2, }; + +struct { + float a; + int b; +} e2 = { 1, 3 }; // legal, first initializer is converted + +struct { + float a; + int b; +} e3 = { 1.2, 2, 3 }; // illegal + +int a3 = true; // illegal +vec4 b3[2] = { vec4(0.0), 1.0 }; // illegal +vec4 b4[2] = vec4[2](vec4(0.0), mat2x2(1.0)); // illegal +mat4x2 c3 = { vec3(0.0), vec3(1.0) }; // illegal + +struct S1 { + vec4 a; + vec4 b; +}; + +struct { + float s; + float t; +} d2[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal + +float b5[] = { 3.4, 4.2, 5.0, 5.2, 1.1 }; + +struct S3 { + float f; + mat2x3 m23; +}; + +struct S4 { + uvec2 uv2; + S3 s[2]; +}; + +struct Single1 { int f; }; +Single1 single1 = { 10 }; + +struct Single2 { uvec2 v; }; +Single2 single2 = { { 1, 2 } }; + +struct Single3 { Single1 s1; }; +Single3 single3 = { { 3 } }; + +struct Single4 { Single2 s1; }; +Single4 single4 = { { { 4u, 5u } } }; + +const S4 constructed = S4(uvec2(1, 2), + S3[2](S3(3.0, mat2x3(4.0)), + S3(5.0, mat2x3(6.0)))); + +const S4 curlybad1 = { {1, 2}, + { {3, {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } }, // ERROR, the mat2x3 isn't isolated + {5.0, {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } }; + +const S4 curlyInit = { {1, 2}, + { {3, { {4.0, 0, 0.0}, {0.0, 4.0, 0.0 } } }, + {5.0, { {6, 0.0, 0.0}, {0.0, 6.0, 0.0 } } } } }; + +float vc1, vc2, vc3; +vec3 av3 = vec3(vc1, vc2, vc3); +vec3 bv3 = { vc1, vc2, vc3 }; + +void main() +{ + memoryBarrier(); + + if (constructed == curlybad1) + ; + if (constructed == curlyInit) + ; +} diff --git a/core/deps/glslang/Test/420.vert b/core/deps/glslang/Test/420.vert index 2f08608cf..c7ffa9027 100644 --- a/core/deps/glslang/Test/420.vert +++ b/core/deps/glslang/Test/420.vert @@ -147,15 +147,15 @@ uniform offcheck { layout(offset = 16) int foo; // ERROR } offcheckI; -uniform sampler1D samp1D; -uniform sampler1DShadow samp1Ds; - -void qlod() -{ - int levels; - - levels = textureQueryLevels(samp1D); // ERROR, not until 430 - levels = textureQueryLevels(samp1Ds); // ERROR, not until 430 -} - -layout(binding=0) writeonly uniform image1D badArray[]; +uniform sampler1D samp1D; +uniform sampler1DShadow samp1Ds; + +void qlod() +{ + int levels; + + levels = textureQueryLevels(samp1D); // ERROR, not until 430 + levels = textureQueryLevels(samp1Ds); // ERROR, not until 430 +} + +layout(binding=0) writeonly uniform image1D badArray[]; diff --git a/core/deps/glslang/Test/420_size_gl_in.geom b/core/deps/glslang/Test/420_size_gl_in.geom index 0fc1cd96c..b709d5aa3 100644 --- a/core/deps/glslang/Test/420_size_gl_in.geom +++ b/core/deps/glslang/Test/420_size_gl_in.geom @@ -1,21 +1,21 @@ -#version 420 core - -// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with - -int i; - -layout(triangles) in; -in vec4 colorun[]; -in vec4 color3[3]; - -void foo() -{ - gl_in.length(); - gl_in[1].gl_Position; - gl_in.length(); - gl_in[i].gl_Position; // should be sized to 3 by 'triangles' -} - -in gl_PerVertex { // ERROR, already used - vec4 gl_Position; -} gl_in[]; +#version 420 core + +// testing input arrays without a gl_in[] block redeclaration, see 400.geom for with + +int i; + +layout(triangles) in; +in vec4 colorun[]; +in vec4 color3[3]; + +void foo() +{ + gl_in.length(); + gl_in[1].gl_Position; + gl_in.length(); + gl_in[i].gl_Position; // should be sized to 3 by 'triangles' +} + +in gl_PerVertex { // ERROR, already used + vec4 gl_Position; +} gl_in[]; diff --git a/core/deps/glslang/Test/430.comp b/core/deps/glslang/Test/430.comp index 31caaaa6a..178b9942d 100644 --- a/core/deps/glslang/Test/430.comp +++ b/core/deps/glslang/Test/430.comp @@ -1,90 +1,90 @@ -#version 430 core - -layout(local_size_x = 2) in; -layout(local_size_x = 16) in; // ERROR, changing -layout(local_size_z = 4096) in; // ERROR, too large -layout(local_size_x = 2) in; - -const int total = gl_MaxComputeWorkGroupCount.y - + gl_MaxComputeUniformComponents - + gl_MaxComputeTextureImageUnits - + gl_MaxComputeImageUniforms - + gl_MaxComputeAtomicCounters - + gl_MaxComputeAtomicCounterBuffers; - -buffer ShaderStorageBlock -{ - int value; - float values[]; -}; - -buffer InvalidShaderStorageBlock -{ - float values[]; - int value; -} invalid; - -void main() -{ - barrier(); - memoryBarrier(); - memoryBarrierAtomicCounter(); - memoryBarrierBuffer(); - memoryBarrierShared(); - memoryBarrierImage(); - groupMemoryBarrier(); - value = int(values[gl_LocalInvocationIndex]); - - int a; - if (a > 10) - barrier(); -} - -layout(location = 2) in vec3 v3; // ERROR -in float f; // ERROR -out float fo; // ERROR - -shared vec4 s; -layout(location = 2) shared vec4 sl; // ERROR -shared float fs = 4.2; // ERROR - -layout(local_size_y = 1) in; -layout(local_size_y = 2) in; // ERROR, changing -layout(local_size_y = 1) in; -layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR - -int arrX[gl_WorkGroupSize.x]; -int arrY[gl_WorkGroupSize.y]; -int arrZ[gl_WorkGroupSize.z]; - -readonly buffer roblock -{ - int value; - float values[]; -} ro; - -void foo() -{ - ro.values[2] = 4.7; // ERROR, readonly - ro.values.length(); - barrier(); -} - -uniform double roll; -uniform writeonly image2D destTex; -void fooaoeu() { - ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); - double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0); - dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4); - double globalCoef = 1.0; - int i = globalCoef; // ERROR, can't convert from double to int - double di = i; -} - -in inb { // ERROR - int a; -} inbi; - -out outb { // ERROR - int a; -} outbi; +#version 430 core + +layout(local_size_x = 2) in; +layout(local_size_x = 16) in; // ERROR, changing +layout(local_size_z = 4096) in; // ERROR, too large +layout(local_size_x = 2) in; + +const int total = gl_MaxComputeWorkGroupCount.y + + gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + +buffer ShaderStorageBlock +{ + int value; + float values[]; +}; + +buffer InvalidShaderStorageBlock +{ + float values[]; + int value; +} invalid; + +void main() +{ + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierShared(); + memoryBarrierImage(); + groupMemoryBarrier(); + value = int(values[gl_LocalInvocationIndex]); + + int a; + if (a > 10) + barrier(); +} + +layout(location = 2) in vec3 v3; // ERROR +in float f; // ERROR +out float fo; // ERROR + +shared vec4 s; +layout(location = 2) shared vec4 sl; // ERROR +shared float fs = 4.2; // ERROR + +layout(local_size_y = 1) in; +layout(local_size_y = 2) in; // ERROR, changing +layout(local_size_y = 1) in; +layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +readonly buffer roblock +{ + int value; + float values[]; +} ro; + +void foo() +{ + ro.values[2] = 4.7; // ERROR, readonly + ro.values.length(); + barrier(); +} + +uniform double roll; +uniform writeonly image2D destTex; +void fooaoeu() { + ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); + double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0); + dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4); + double globalCoef = 1.0; + int i = globalCoef; // ERROR, can't convert from double to int + double di = i; +} + +in inb { // ERROR + int a; +} inbi; + +out outb { // ERROR + int a; +} outbi; diff --git a/core/deps/glslang/Test/430.vert b/core/deps/glslang/Test/430.vert index 13d180639..84c322083 100644 --- a/core/deps/glslang/Test/430.vert +++ b/core/deps/glslang/Test/430.vert @@ -1,223 +1,223 @@ -#version 430 core - -layout(location = 3) vec4 v4; // ERROR - -layout(location = 4) uniform vec4 uv4; - -layout(location = 2) in inb1 { vec4 v; } b1; // ERROR -layout(location = 2) out outb1 { vec4 v; } b2; // ERROR - -out gl_PerVertex { - float gl_ClipDistance[]; -}; - -void foo() -{ - gl_ClipDistance[2] = 3.7; -} - -struct sp { - highp float f; - in float g; // ERROR - uniform float h; // ERROR - invariant float i; // ERROR - volatile float j; // ERROR - layout(row_major) mat3 m3; // ERROR -}; - -void foo3(invariant vec4 v4, // ERROR - volatile vec3 v3, - layout(location = 3) vec2 v2, // ERROR - centroid vec3 cv3) // ERROR -{ -} - -struct S { - mat3x2 m[7]; // needs 7*3 locations - float f; // needs 1 location -}; // needs 22 locations - -layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53 -layout(location = 54) out float cf; -layout(location = 53) out float cg; // ERROR, collision at 31 - -layout(location = 10) in vec4 alias1; -layout(location = 10) in vec4 alias2; // okay for vertex input on desktop - -out float gl_ClipDistance[17]; // ERROR, size too big - -// enhanced_layouts (most tests are in 440.*) - -layout(location = start*start - 2 - 4) in vec4 v6e; // ERROR - -layout(location = 28) in inblock2e { - layout(location = 25) float f2; // ERROR -} ininst2e; - -in ublock4e { - layout(location = 50) float f1; // ERROR - layout(location = 51) float f2; // ERROR -} in4e; - -layout(align=16, std140) uniform ubl4e { int a; } inst4e;// ERROR - -layout(align=32) uniform ubl9e { // ERROR - layout(offset=12, align=4) float f; // ERROR - layout(offset=20) float g; // ERROR -} inst9e; - -layout(std140) uniform blocke { - vec4 a; - layout(offset = 32) vec3 b; // ERROR -} spinste; - -int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR -int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR - -out bblck2 { - layout(xfb_offset=64) vec4 bbv; // ERROR -} bbinst2; - -layout(xfb_buffer = 3, xfb_stride = 64) out; // ERROR - -layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR -layout( xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR - -layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR - vec4 bbv1; - vec4 bbv2; -} bbinst4e; - -out bblck5e { - layout(xfb_offset=0) vec4 bbv1; // ERROR - layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR -} bbinst5e; - -#extension GL_ARB_enhanced_layouts : enable - -layout(align=16, std140) uniform ubl4 { int a; } inst4; -layout(std430) uniform; - -layout(align=32) uniform ubl9 { - layout(offset=12, align=4) float f; - layout(offset=20) float g; -} inst9; - -layout(std140) uniform block { - vec4 a; // a takes offsets 0-15 - layout(offset = 32) vec3 b; // b takes offsets 32-43 -} spinst; - -int aconst[gl_MaxTransformFeedbackBuffers]; -int bconst[gl_MaxTransformFeedbackInterleavedComponents]; - -const int start2 = 5; -layout(location = start2 * start2 - 2 - 4) in vec4 v6; - -layout(location = 28) in inblock2 { // ERROR, input block in vertex shader, other errors are valid checks still... - bool b1; - float f1; - layout(location = 25) float f2; -} ininst2; - -in ublock4 { // ERROR, input block in vertex shader, other errors are valid checks still... - layout(location = 50) float f1; - layout(location = 51) float f2; -} in4; - -out bblck2g { - layout(xfb_offset=64) vec4 bbv; -} bbinst2g; - -layout(xfb_buffer = 1, xfb_stride = 80) out; // default buffer is 3 - -layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg; -layout( xfb_offset=32, xfb_stride=80) out vec4 bh; - -layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 { - vec4 bbv1; -} bbinst4; - -out bblck5 { - layout(xfb_offset=0) vec4 bbv1; - layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2; -} bbinst5; - -shared vec4 sharedv; // ERROR - -void fooBarrier() -{ - barrier(); // ERROR - memoryBarrier(); - memoryBarrierAtomicCounter(); - memoryBarrierBuffer(); - memoryBarrierShared(); // ERROR - memoryBarrierImage(); - groupMemoryBarrier(); // ERROR -} - -buffer vec4 v; // ERROR - -uniform sampler2DMS s2dms; -uniform usampler2DMSArray us2dmsa; -layout(rgba32i) uniform iimage2DMS ii2dms; -layout(rgba32f) uniform image2DMSArray i2dmsa; - -void fooq() -{ - int s = textureSamples(s2dms); // ERROR - s += textureSamples(us2dmsa); // ERROR - s += imageSamples(ii2dms); // ERROR - s += imageSamples(i2dmsa); // ERROR -} - -#extension GL_ARB_shader_texture_image_samples : enable - -void fooq2() -{ - int s = textureSamples(s2dms); - s += textureSamples(us2dmsa); - s += imageSamples(ii2dms); - s += imageSamples(i2dmsa); -} - -uniform sampler1D samp1D; -uniform usampler2D usamp2D; -uniform isampler3D isamp3D; -uniform isamplerCube isampCube; -uniform isampler1DArray isamp1DA; -uniform sampler2DArray samp2DA; -uniform usamplerCubeArray usampCubeA; - -uniform sampler1DShadow samp1Ds; -uniform sampler2DShadow samp2Ds; -uniform samplerCubeShadow sampCubes; -uniform sampler1DArrayShadow samp1DAs; -uniform sampler2DArrayShadow samp2DAs; -uniform samplerCubeArrayShadow sampCubeAs; - -uniform samplerBuffer sampBuf; -uniform sampler2DRect sampRect; - -void qlod() -{ - int levels; - - levels = textureQueryLevels(samp1D); - levels = textureQueryLevels(usamp2D); - levels = textureQueryLevels(isamp3D); - levels = textureQueryLevels(isampCube); - levels = textureQueryLevels(isamp1DA); - levels = textureQueryLevels(samp2DA); - levels = textureQueryLevels(usampCubeA); - - levels = textureQueryLevels(samp1Ds); - levels = textureQueryLevels(samp2Ds); - levels = textureQueryLevels(sampCubes); - levels = textureQueryLevels(samp1DAs); - levels = textureQueryLevels(samp2DAs); - levels = textureQueryLevels(sampCubeAs); - - levels = textureQueryLevels(sampBuf); // ERROR - levels = textureQueryLevels(sampRect); // ERROR -} +#version 430 core + +layout(location = 3) vec4 v4; // ERROR + +layout(location = 4) uniform vec4 uv4; + +layout(location = 2) in inb1 { vec4 v; } b1; // ERROR +layout(location = 2) out outb1 { vec4 v; } b2; // ERROR + +out gl_PerVertex { + float gl_ClipDistance[]; +}; + +void foo() +{ + gl_ClipDistance[2] = 3.7; +} + +struct sp { + highp float f; + in float g; // ERROR + uniform float h; // ERROR + invariant float i; // ERROR + volatile float j; // ERROR + layout(row_major) mat3 m3; // ERROR +}; + +void foo3(invariant vec4 v4, // ERROR + volatile vec3 v3, + layout(location = 3) vec2 v2, // ERROR + centroid vec3 cv3) // ERROR +{ +} + +struct S { + mat3x2 m[7]; // needs 7*3 locations + float f; // needs 1 location +}; // needs 22 locations + +layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53 +layout(location = 54) out float cf; +layout(location = 53) out float cg; // ERROR, collision at 31 + +layout(location = 10) in vec4 alias1; +layout(location = 10) in vec4 alias2; // okay for vertex input on desktop + +out float gl_ClipDistance[17]; // ERROR, size too big + +// enhanced_layouts (most tests are in 440.*) + +layout(location = start*start - 2 - 4) in vec4 v6e; // ERROR + +layout(location = 28) in inblock2e { + layout(location = 25) float f2; // ERROR +} ininst2e; + +in ublock4e { + layout(location = 50) float f1; // ERROR + layout(location = 51) float f2; // ERROR +} in4e; + +layout(align=16, std140) uniform ubl4e { int a; } inst4e;// ERROR + +layout(align=32) uniform ubl9e { // ERROR + layout(offset=12, align=4) float f; // ERROR + layout(offset=20) float g; // ERROR +} inst9e; + +layout(std140) uniform blocke { + vec4 a; + layout(offset = 32) vec3 b; // ERROR +} spinste; + +int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR +int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR + +out bblck2 { + layout(xfb_offset=64) vec4 bbv; // ERROR +} bbinst2; + +layout(xfb_buffer = 3, xfb_stride = 64) out; // ERROR + +layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR +layout( xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR + +layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR + vec4 bbv1; + vec4 bbv2; +} bbinst4e; + +out bblck5e { + layout(xfb_offset=0) vec4 bbv1; // ERROR + layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR +} bbinst5e; + +#extension GL_ARB_enhanced_layouts : enable + +layout(align=16, std140) uniform ubl4 { int a; } inst4; +layout(std430) uniform; + +layout(align=32) uniform ubl9 { + layout(offset=12, align=4) float f; + layout(offset=20) float g; +} inst9; + +layout(std140) uniform block { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 +} spinst; + +int aconst[gl_MaxTransformFeedbackBuffers]; +int bconst[gl_MaxTransformFeedbackInterleavedComponents]; + +const int start2 = 5; +layout(location = start2 * start2 - 2 - 4) in vec4 v6; + +layout(location = 28) in inblock2 { // ERROR, input block in vertex shader, other errors are valid checks still... + bool b1; + float f1; + layout(location = 25) float f2; +} ininst2; + +in ublock4 { // ERROR, input block in vertex shader, other errors are valid checks still... + layout(location = 50) float f1; + layout(location = 51) float f2; +} in4; + +out bblck2g { + layout(xfb_offset=64) vec4 bbv; +} bbinst2g; + +layout(xfb_buffer = 1, xfb_stride = 80) out; // default buffer is 3 + +layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg; +layout( xfb_offset=32, xfb_stride=80) out vec4 bh; + +layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 { + vec4 bbv1; +} bbinst4; + +out bblck5 { + layout(xfb_offset=0) vec4 bbv1; + layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2; +} bbinst5; + +shared vec4 sharedv; // ERROR + +void fooBarrier() +{ + barrier(); // ERROR + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierShared(); // ERROR + memoryBarrierImage(); + groupMemoryBarrier(); // ERROR +} + +buffer vec4 v; // ERROR + +uniform sampler2DMS s2dms; +uniform usampler2DMSArray us2dmsa; +layout(rgba32i) uniform iimage2DMS ii2dms; +layout(rgba32f) uniform image2DMSArray i2dmsa; + +void fooq() +{ + int s = textureSamples(s2dms); // ERROR + s += textureSamples(us2dmsa); // ERROR + s += imageSamples(ii2dms); // ERROR + s += imageSamples(i2dmsa); // ERROR +} + +#extension GL_ARB_shader_texture_image_samples : enable + +void fooq2() +{ + int s = textureSamples(s2dms); + s += textureSamples(us2dmsa); + s += imageSamples(ii2dms); + s += imageSamples(i2dmsa); +} + +uniform sampler1D samp1D; +uniform usampler2D usamp2D; +uniform isampler3D isamp3D; +uniform isamplerCube isampCube; +uniform isampler1DArray isamp1DA; +uniform sampler2DArray samp2DA; +uniform usamplerCubeArray usampCubeA; + +uniform sampler1DShadow samp1Ds; +uniform sampler2DShadow samp2Ds; +uniform samplerCubeShadow sampCubes; +uniform sampler1DArrayShadow samp1DAs; +uniform sampler2DArrayShadow samp2DAs; +uniform samplerCubeArrayShadow sampCubeAs; + +uniform samplerBuffer sampBuf; +uniform sampler2DRect sampRect; + +void qlod() +{ + int levels; + + levels = textureQueryLevels(samp1D); + levels = textureQueryLevels(usamp2D); + levels = textureQueryLevels(isamp3D); + levels = textureQueryLevels(isampCube); + levels = textureQueryLevels(isamp1DA); + levels = textureQueryLevels(samp2DA); + levels = textureQueryLevels(usampCubeA); + + levels = textureQueryLevels(samp1Ds); + levels = textureQueryLevels(samp2Ds); + levels = textureQueryLevels(sampCubes); + levels = textureQueryLevels(samp1DAs); + levels = textureQueryLevels(samp2DAs); + levels = textureQueryLevels(sampCubeAs); + + levels = textureQueryLevels(sampBuf); // ERROR + levels = textureQueryLevels(sampRect); // ERROR +} diff --git a/core/deps/glslang/Test/430AofA.frag b/core/deps/glslang/Test/430AofA.frag index c081ea800..54d092308 100644 --- a/core/deps/glslang/Test/430AofA.frag +++ b/core/deps/glslang/Test/430AofA.frag @@ -1,108 +1,108 @@ -#version 430 - -float[4][5][6] many[1][2][3]; - -float gu[][7]; -float gimp[][]; // ERROR, implicit inner -float g4[4][7]; -float g5[5][7]; - -float[4][7] foo(float a[5][7]) -{ - float r[7]; - r = a[2]; - float[](a[0], a[1], r, a[3]); // ERROR, too few dims - float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims - return float[4][7](a[0], a[1], r, a[3]); - return float[][](a[0], a[1], r, a[3]); - return float[][7](a[0], a[1], a[2], a[3]); -} - -void bar(float[5][7]) {} - -void main() -{ - { - float gu[3][4][2]; - - gu[2][4][1] = 4.0; // ERROR, overflow - } - vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0))); - vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0))); - vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0))); - vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0))); - - vec4 a4[3][2] = {vec4[](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0)) }; - vec4 aim[][2] = {vec4[2](vec4(4.0), vec4(2.0)), - vec4[](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)) }; - vec4 aim2[][] = {vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[](vec4(4.0), vec4(2.0)) }; - vec4 aim3[3][] = {vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)) }; - - vec4 bad2[3][] = {vec4[2](vec4(4.0), vec4(2.0)), // ERROR - vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)), - vec4[2](vec4(4.0), vec4(2.0)) }; - - vec4 bad3[3][] = {vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)), // ERROR - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)) }; - - vec4 bad4[4][] = {vec4[2](vec4(4.0), vec4(2.0)), // ERROR - vec4[2](vec4(4.0), vec4(2.0)), - vec4[2](vec4(4.0), vec4(2.0)) }; - - - g4 = foo(g5); - g5 = g4; // ERROR, wrong types - gu = g4; // ERROR, not yet sized - - foo(gu); // ERROR, not yet sized - bar(g5); - - if (foo(g5) == g4) - ; - if (foo(g5) == g5) // ERROR, different types - ; - - float u[][7]; - u[2][2] = 3.0; - float u[5][7]; - u[5][2] = 5.0; // ERROR - foo(u); -} - -void foo3() -{ - float resize1[][5][7]; - resize1.length(); // ERROR - resize1[1][4][5] = 2.0; - resize1.length(); // ERROR - float resize1[3][5][7]; - resize1.length(); // 3 in AST - resize1[1].length(); // 5 in AST - resize1[1][1].length(); // 7 in AST - resize1[1][1][1].length(); // ERROR - - float resize2[][5][7]; - float resize2[3][4][7]; // ERROR, inner dim change - - float resize3[][5][7]; - float resize3[3][5][9]; // ERROR, inner dim changed - - float resize4[][5][7]; - int resize4[3][5][7]; // ERROR, element type -} +#version 430 + +float[4][5][6] many[1][2][3]; + +float gu[][7]; +float gimp[][]; // ERROR, implicit inner +float g4[4][7]; +float g5[5][7]; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + float[](a[0], a[1], r, a[3]); // ERROR, too few dims + float[4][7][4](a[0], a[1], r, a[3]); // ERROR, too many dims + return float[4][7](a[0], a[1], r, a[3]); + return float[][](a[0], a[1], r, a[3]); + return float[][7](a[0], a[1], a[2], a[3]); +} + +void bar(float[5][7]) {} + +void main() +{ + { + float gu[3][4][2]; + + gu[2][4][1] = 4.0; // ERROR, overflow + } + vec4 ca4[3][2] = vec4[][](vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0))); + vec4 caim[][2] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim2[][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + vec4 caim3[3][] = vec4[][](vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0))); + + vec4 a4[3][2] = {vec4[](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)) }; + vec4 aim[][2] = {vec4[2](vec4(4.0), vec4(2.0)), + vec4[](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + vec4 aim2[][] = {vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[](vec4(4.0), vec4(2.0)) }; + vec4 aim3[3][] = {vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + vec4 bad2[3][] = {vec4[2](vec4(4.0), vec4(2.0)), // ERROR + vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + vec4 bad3[3][] = {vec4[3](vec4(4.0), vec4(2.0), vec4(5.0)), // ERROR + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + vec4 bad4[4][] = {vec4[2](vec4(4.0), vec4(2.0)), // ERROR + vec4[2](vec4(4.0), vec4(2.0)), + vec4[2](vec4(4.0), vec4(2.0)) }; + + + g4 = foo(g5); + g5 = g4; // ERROR, wrong types + gu = g4; // ERROR, not yet sized + + foo(gu); // ERROR, not yet sized + bar(g5); + + if (foo(g5) == g4) + ; + if (foo(g5) == g5) // ERROR, different types + ; + + float u[][7]; + u[2][2] = 3.0; + float u[5][7]; + u[5][2] = 5.0; // ERROR + foo(u); +} + +void foo3() +{ + float resize1[][5][7]; + resize1.length(); // ERROR + resize1[1][4][5] = 2.0; + resize1.length(); // ERROR + float resize1[3][5][7]; + resize1.length(); // 3 in AST + resize1[1].length(); // 5 in AST + resize1[1][1].length(); // 7 in AST + resize1[1][1][1].length(); // ERROR + + float resize2[][5][7]; + float resize2[3][4][7]; // ERROR, inner dim change + + float resize3[][5][7]; + float resize3[3][5][9]; // ERROR, inner dim changed + + float resize4[][5][7]; + int resize4[3][5][7]; // ERROR, element type +} diff --git a/core/deps/glslang/Test/435.vert b/core/deps/glslang/Test/435.vert index fff970ac2..bf27ce967 100644 --- a/core/deps/glslang/Test/435.vert +++ b/core/deps/glslang/Test/435.vert @@ -1,2 +1,2 @@ -#version 435 +#version 435 void main() {} \ No newline at end of file diff --git a/core/deps/glslang/Test/440.frag b/core/deps/glslang/Test/440.frag index 143c0caad..4eb1a3ffd 100644 --- a/core/deps/glslang/Test/440.frag +++ b/core/deps/glslang/Test/440.frag @@ -1,153 +1,153 @@ -#version 440 - -// Note 'location'-only tests for enhanced layouts are in 330.frag -// Generic 'component' tests are in 440.vert - -// a consumes components 2 and 3 of location 4 -layout(location = 4, component = 2) in vec2 a; - -// b consumes component 1 of location 4 -layout(location = 4, component = 1) in float b; -layout(location = 4, component = 2) in vec2 h; // ERROR, component overlap not okay for fragment in - -layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3 - -// e consumes beginning (components 0, 1 and 2) of each of 6 slots -layout(location = 20, component = 0) in vec3 e[6]; - -// f consumes last component of the same 6 slots -layout(location = 20, component = 3) in float f[6]; - -layout(location = 30, component = 3) out int be; -layout(location = 30, component = 0) out vec3 bf; // ERROR, not the same basic type - -writeonly uniform; // ERROR -readonly in; // ERROR -flat out; // ERROR -mediump uniform; - -layout(offset=12) uniform; // ERROR -layout(offset=12) in; // ERROR -layout(offset=12) out; // ERROR - -layout(align=16) uniform; // ERROR -layout(align=16) in; // ERROR -layout(align=16) out; // ERROR - -layout(offset=12) uniform ubl1 { int a; } inst1; // ERROR -layout(offset=12) in inbl2 { int a; } inst2; // ERROR -layout(offset=12) out inbl3 { int a; } inst3; // ERROR - -layout(align=16, std140) uniform ubl4 { int a; } inst4; -layout(align=16) uniform ubl8 { int a; } inst8; // ERROR, no packing -layout(align=16) in inbl5 { int a; } inst5; // ERROR -layout(align=16) out inbl6 { int a; } inst6; // ERROR - -layout(offset=12) uniform vec4 v1; // ERROR -layout(offset=12) in vec4 v2; // ERROR -layout(offset=12) out vec4 v3; // ERROR - -layout(align=16) uniform vec4 v4; // ERROR -layout(align=16) in vec4 v5; // ERROR -layout(align=16) out vec4 v6; // ERROR - -layout(std140) in; // ERROR -layout(std140) uniform vec4 v7; // ERROR - -layout(align=48) uniform ubl7 { // ERROR, not power of 2 - layout(offset=12, align=4) float f; // ERROR, no packing -} inst7; - -in ibl10 { - layout(offset=12) float f; // ERROR - layout(align=4) float g; // ERROR -} inst10; - -layout(std430) uniform; - -layout(align=32) uniform ubl9 { - float e; - layout(offset=12, align=4) float f; - layout(offset=20) float g; - float h; -} inst9; - -uniform ubl11 { - layout(offset=12, align=4) float f; - float g; -} inst11; - -layout(std140) uniform block { - vec4 a; // a takes offsets 0-15 - layout(offset = 32) vec3 b; // b takes offsets 32-43 - layout(offset = 40) vec2 c; // ERROR, lies within previous member - layout(align = 6) double g; // ERROR, 6 is not a power of 2 - layout(offset=68) double h; // ERROR, offset not aligned -} specExampleErrors; - -layout(std140) uniform block2 { - vec4 a; // a takes offsets 0-15 - layout(offset = 32) vec3 b; // b takes offsets 32-43 - layout(offset = 48) vec2 d; // d takes offsets 48-55 - layout(align = 16) float e; // e takes offsets 64-67 - layout(align = 2) double f; // f takes offsets 72-79 - layout(offset = 80) float h; // h takes offsets 80-83 - layout(align = 64) dvec3 i; // i takes offsets 128-151 - layout(offset = 164, align = 8) float j; // j takes offsets 168-171 -} specExample; - -layout(std430) buffer block430 { - vec4 a; // a takes offsets 0-15 - layout(offset = 32) vec3 b; // b takes offsets 32-43 - layout(offset = 40) vec2 c; // ERROR, lies within previous member - layout(align = 6) double g; // ERROR, 6 is not a power of 2 - layout(offset=68) double h; // ERROR, offset not aligned - layout(align = 0) double i; // ERROR, 0 not a power of 2 -} specExampleErrors430; - -layout(std430) buffer block2430 { - vec4 a; // a takes offsets 0-15 - layout(offset = 32) vec3 b; // b takes offsets 32-43 - layout(offset = 48) vec2 d; // d takes offsets 48-55 - layout(align = 16) float e; // e takes offsets 64-67 - layout(align = 2) double f; // f takes offsets 72-79 - layout(offset = 80) float h; // h takes offsets 80-83 - layout(align = 64) dvec3 i; // i takes offsets 128-151 - layout(offset = 164, align = 8) float j; // j takes offsets 168-171 -} specExample430; - -layout(std430, align = 128) buffer block24300 { - vec4 a; - vec3 b; - vec2 d; - float e; - double f; - float h; - dvec3 i; -} specExample4300; - -layout(std430, align = 128) buffer block24301 { - vec4 a; - vec3 b; - vec2 d; - layout(offset=388) float e; - layout(align=8) double f; - float h; - dvec3 i; -} specExample4301; - -int aconst[gl_MaxTransformFeedbackBuffers]; -int bconst[gl_MaxTransformFeedbackInterleavedComponents]; - -sample in vec3 sampInArray[4]; - -void interp() -{ - interpolateAtCentroid(sampInArray[2].xy); - interpolateAtSample(sampInArray[2].x.x, 2); -} - -int layer() -{ - return gl_Layer; -} +#version 440 + +// Note 'location'-only tests for enhanced layouts are in 330.frag +// Generic 'component' tests are in 440.vert + +// a consumes components 2 and 3 of location 4 +layout(location = 4, component = 2) in vec2 a; + +// b consumes component 1 of location 4 +layout(location = 4, component = 1) in float b; +layout(location = 4, component = 2) in vec2 h; // ERROR, component overlap not okay for fragment in + +layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3 + +// e consumes beginning (components 0, 1 and 2) of each of 6 slots +layout(location = 20, component = 0) in vec3 e[6]; + +// f consumes last component of the same 6 slots +layout(location = 20, component = 3) in float f[6]; + +layout(location = 30, component = 3) out int be; +layout(location = 30, component = 0) out vec3 bf; // ERROR, not the same basic type + +writeonly uniform; // ERROR +readonly in; // ERROR +flat out; // ERROR +mediump uniform; + +layout(offset=12) uniform; // ERROR +layout(offset=12) in; // ERROR +layout(offset=12) out; // ERROR + +layout(align=16) uniform; // ERROR +layout(align=16) in; // ERROR +layout(align=16) out; // ERROR + +layout(offset=12) uniform ubl1 { int a; } inst1; // ERROR +layout(offset=12) in inbl2 { int a; } inst2; // ERROR +layout(offset=12) out inbl3 { int a; } inst3; // ERROR + +layout(align=16, std140) uniform ubl4 { int a; } inst4; +layout(align=16) uniform ubl8 { int a; } inst8; // ERROR, no packing +layout(align=16) in inbl5 { int a; } inst5; // ERROR +layout(align=16) out inbl6 { int a; } inst6; // ERROR + +layout(offset=12) uniform vec4 v1; // ERROR +layout(offset=12) in vec4 v2; // ERROR +layout(offset=12) out vec4 v3; // ERROR + +layout(align=16) uniform vec4 v4; // ERROR +layout(align=16) in vec4 v5; // ERROR +layout(align=16) out vec4 v6; // ERROR + +layout(std140) in; // ERROR +layout(std140) uniform vec4 v7; // ERROR + +layout(align=48) uniform ubl7 { // ERROR, not power of 2 + layout(offset=12, align=4) float f; // ERROR, no packing +} inst7; + +in ibl10 { + layout(offset=12) float f; // ERROR + layout(align=4) float g; // ERROR +} inst10; + +layout(std430) uniform; + +layout(align=32) uniform ubl9 { + float e; + layout(offset=12, align=4) float f; + layout(offset=20) float g; + float h; +} inst9; + +uniform ubl11 { + layout(offset=12, align=4) float f; + float g; +} inst11; + +layout(std140) uniform block { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 40) vec2 c; // ERROR, lies within previous member + layout(align = 6) double g; // ERROR, 6 is not a power of 2 + layout(offset=68) double h; // ERROR, offset not aligned +} specExampleErrors; + +layout(std140) uniform block2 { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 48) vec2 d; // d takes offsets 48-55 + layout(align = 16) float e; // e takes offsets 64-67 + layout(align = 2) double f; // f takes offsets 72-79 + layout(offset = 80) float h; // h takes offsets 80-83 + layout(align = 64) dvec3 i; // i takes offsets 128-151 + layout(offset = 164, align = 8) float j; // j takes offsets 168-171 +} specExample; + +layout(std430) buffer block430 { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 40) vec2 c; // ERROR, lies within previous member + layout(align = 6) double g; // ERROR, 6 is not a power of 2 + layout(offset=68) double h; // ERROR, offset not aligned + layout(align = 0) double i; // ERROR, 0 not a power of 2 +} specExampleErrors430; + +layout(std430) buffer block2430 { + vec4 a; // a takes offsets 0-15 + layout(offset = 32) vec3 b; // b takes offsets 32-43 + layout(offset = 48) vec2 d; // d takes offsets 48-55 + layout(align = 16) float e; // e takes offsets 64-67 + layout(align = 2) double f; // f takes offsets 72-79 + layout(offset = 80) float h; // h takes offsets 80-83 + layout(align = 64) dvec3 i; // i takes offsets 128-151 + layout(offset = 164, align = 8) float j; // j takes offsets 168-171 +} specExample430; + +layout(std430, align = 128) buffer block24300 { + vec4 a; + vec3 b; + vec2 d; + float e; + double f; + float h; + dvec3 i; +} specExample4300; + +layout(std430, align = 128) buffer block24301 { + vec4 a; + vec3 b; + vec2 d; + layout(offset=388) float e; + layout(align=8) double f; + float h; + dvec3 i; +} specExample4301; + +int aconst[gl_MaxTransformFeedbackBuffers]; +int bconst[gl_MaxTransformFeedbackInterleavedComponents]; + +sample in vec3 sampInArray[4]; + +void interp() +{ + interpolateAtCentroid(sampInArray[2].xy); + interpolateAtSample(sampInArray[2].x.x, 2); +} + +int layer() +{ + return gl_Layer; +} diff --git a/core/deps/glslang/Test/440.vert b/core/deps/glslang/Test/440.vert index 206b01898..4ab6f2ee2 100644 --- a/core/deps/glslang/Test/440.vert +++ b/core/deps/glslang/Test/440.vert @@ -1,197 +1,197 @@ -#version 440 - -// Note 'location' tests for enhanced layouts are in 330.frag - -layout(location = 2, component = 2) in vec2 a; -layout(location = 2, component = 1) in float b; - -layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3 - -layout(location = 0, component = 3) in float d[4]; - -layout(location = 4, component = 0) in vec3 e[5]; -layout(location = 4, component = 3) in float f[5]; - -layout(location = 9, component = 4) in float g[6]; // ERROR, component too big - -layout(location = 4, component = 2) in vec2 h; // component overlap okay for vertex in - -layout(location = 3, component = 2) out vec2 i; -layout(location = 3, component = 0) out vec2 j; - -layout(location = 4, component = 2) out vec2 k; -layout(location = 4, component = 2) out vec2 m; // ERROR, component overlap - -layout(location = 2, component = 2) out vec2 n; -layout(location = 2, component = 0) out vec3 p; // ERROR, component overlap - -layout(location = 10, component = 3) out float q[6]; -layout(location = 10, component = 0) out vec3 r[6]; - -layout(location = 15, component = 3) out float s; // ERROR, overlap -layout(location = 10, component = 1) out float t; // ERROR, overlap - -layout(location = 20, component = 2) out float u; -layout(location = 20, component = 0) out float v; -layout(location = 20, component = 3) out float w; -layout(location = 20, component = 1) out vec2 x; // ERROR, overlap - -layout(location = 30, component = 3) out vec2 y; // ERROR, goes to component 4 -layout(location = 31, component = 1) out vec4 z; // ERROR, goes to component 4 - -layout(location = 32, component = 1) out mat4 ba; // ERROR -layout(location = 33, component = 1) out struct S {int a;} Ss; // ERROR -layout(location = 34, component = 1) out bn { int a;} bb; // ERROR - -layout(component = 1) out float bc; // ERROR, no location - -out blockname { - layout(location = 40, component = 2) out float u; - layout(location = 40, component = 0) out float v; - layout(location = 40, component = 3) out float w; - layout(location = 40, component = 1) out vec2 x; // ERROR, overlap - - layout(location = 41, component = 3) out vec2 y; // ERROR, goes to component 4 - layout(location = 42, component = 1) out vec4 z; // ERROR, goes to component 4 - - layout(location = 42, component = 1) out mat4 ba; // ERROR - layout(location = 43, component = 1) out S Ss; // ERROR -} bd; - -layout(location = 1, component = 1) out; // ERROR, no global setting - -layout(location = 50, component = 3) out int be; -layout(location = 50, component = 0) out vec3 bf; - -layout(location = 51, component = 1) out double dfo; // ERROR, odd component -layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow -layout(location = 53) out double dfo2; -layout(location = 53, component = 2) out vec2 ffv2; // okay, fits -layout(location = 54) out dvec4 dvec4out; // uses up location 55 too -layout(location = 55) out float overf; // ERROR, collides with previous dvec4 -layout(location = 56, component = 1) out vec2 df2o; -layout(location = 56, component = 3) out float sf2o; -layout(location = 57, component = 2) out vec2 dv3o; -layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component -layout(location=58) out flat dvec3 dv3o2; // uses part of location 59 -layout(location=59, component=2) out flat double dfo3; // okay, fits -layout(location=59, component=0) out flat double dfo4; // ERROR, overlaps the dvec3 in starting in 58 - -out bblck1 { - vec4 bbv; -} bbinst1; - -out bblck2 { - layout(xfb_offset=64) vec4 bbv; -} bbinst2; - -layout(xfb_buffer = 3, xfb_stride = 64) out; // default buffer is 3 - -out bblck3 { - layout(xfb_offset=16) vec4 bbv; // in xfb_buffer 3 -} bbinst3; - -uniform ubblck3 { - layout(xfb_offset=16) vec4 bbv; // ERROR, not in a uniform -} ubbinst3; - -layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bg; -layout( xfb_offset=32, xfb_stride=64) out vec4 bh; - -layout(xfb_offset=48) out; // ERROR - -layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4 { - vec4 bbv1; - vec4 bbv2; -} bbinst4; - -out bblck5 { - layout(xfb_offset=0) vec4 bbv1; - layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; - layout(xfb_buffer=2) vec4 bbv3; // ERROR, wrong buffer -} bbinst5; - -out layout(xfb_buffer=2) bblck6 { - layout(xfb_offset=0) vec4 bbv1; - layout(xfb_stride=64, xfb_buffer=3, xfb_offset=32) vec4 bbv2; // ERROR, overlap 32 from bh, and buffer contradiction - layout(xfb_buffer=2, xfb_offset=0) vec4 bbv3; // ERROR, overlap 0 from bbinst5 - layout(xfb_buffer=2) vec4 bbv5; - layout(xfb_offset=24) float bbf6; // ERROR, overlap 24 from bbv1 in bbinst4 -} bbinst6; - -layout(xfb_stride=48) out; // ERROR, stride of buffer 3 - -layout(xfb_buffer=1) out; // default buffer is 1 -layout(xfb_offset=4) out float bj; -layout(xfb_offset=0) out ivec2 bk; // ERROR, overlap 4 - -layout(xfb_buffer=3, xfb_stride=48) out; // ERROR, stride of buffer 3 (default is now 3) -layout(xfb_stride=48) out float bl; // ERROR, stride of buffer 3 - -layout(xfb_stride=48) out bblck7 { // ERROR, stride of buffer 3 - layout(xfb_stride=64) vec4 bbv1; - layout(xfb_stride=32) vec4 bbv2; // ERROR, stride of buffer 3 -} bbinst7; - -struct S5 { - int i; // 4 bytes plus 4 byte hole - double d; // 8 bytes - float f; // 4 bytes -}; // total size = 20 - -struct T { - bool b; // 4 plus 4 byte hole - S5 s; // 20 - vec2 v2; // 8 -}; // total size = 36 - -out layout(xfb_buffer=0, xfb_offset=0, xfb_stride=92) bblck8 { // ERROR, stride not multiple of 8 - bool b; // offset 0 - T t; // offset 8, size 40 - int i; // offset 40 + 4 = 48 - mat3x3 m3; // offset 52 - float f; // offset 52 + 9*4 = 88 - float g; // ERROR, overflow stride -} bbinst8; - -out layout(xfb_buffer=4) bblck9 { - layout(xfb_offset=1) bool b; // ERROR - layout(xfb_offset=12) T t; // ERROR - layout(xfb_offset=52) mat3x3 m3; // non-multiple of 8 okay - layout(xfb_offset=90) int i; // ERROR - layout(xfb_offset=98) double d; // ERROR - layout(xfb_offset=108) S s; // non-multiple of 8 okay -} bbinst9; - -layout(xfb_buffer=5, xfb_stride=6) out; // link ERROR, stride not multiple of 4 -layout(xfb_offset=0) out float bm; - -layout(xfb_buffer=6, xfb_stride=2000) out; // ERROR, stride too big - -out layout(xfb_buffer=7, xfb_offset=0) bblck10 { // link ERROR, implicit stride too big - dmat4x4 m1; - dmat4x4 m2; - float f; -} bbinst10; - -layout(xfb_buffer = 3) out; -layout(xfb_offset = 32) out gl_PerVertex { - layout(xfb_buffer = 2) float gl_PointSize; // ERROR, change in xfb_buffer - vec4 gl_Position; -}; - -int drawParamsBad() -{ - return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested -} - -#extension GL_ARB_shader_draw_parameters: enable - -int drawParams() -{ - return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; - gl_BaseVertexARB = 3; // ERROR, can't write to shader 'in' - gl_BaseInstanceARB = 3; // ERROR, can't write to shader 'in' - gl_DrawIDARB = 3; // ERROR, can't write to shader 'in' - glBaseInstanceARB; // ERROR, not defined -} +#version 440 + +// Note 'location' tests for enhanced layouts are in 330.frag + +layout(location = 2, component = 2) in vec2 a; +layout(location = 2, component = 1) in float b; + +layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3 + +layout(location = 0, component = 3) in float d[4]; + +layout(location = 4, component = 0) in vec3 e[5]; +layout(location = 4, component = 3) in float f[5]; + +layout(location = 9, component = 4) in float g[6]; // ERROR, component too big + +layout(location = 4, component = 2) in vec2 h; // component overlap okay for vertex in + +layout(location = 3, component = 2) out vec2 i; +layout(location = 3, component = 0) out vec2 j; + +layout(location = 4, component = 2) out vec2 k; +layout(location = 4, component = 2) out vec2 m; // ERROR, component overlap + +layout(location = 2, component = 2) out vec2 n; +layout(location = 2, component = 0) out vec3 p; // ERROR, component overlap + +layout(location = 10, component = 3) out float q[6]; +layout(location = 10, component = 0) out vec3 r[6]; + +layout(location = 15, component = 3) out float s; // ERROR, overlap +layout(location = 10, component = 1) out float t; // ERROR, overlap + +layout(location = 20, component = 2) out float u; +layout(location = 20, component = 0) out float v; +layout(location = 20, component = 3) out float w; +layout(location = 20, component = 1) out vec2 x; // ERROR, overlap + +layout(location = 30, component = 3) out vec2 y; // ERROR, goes to component 4 +layout(location = 31, component = 1) out vec4 z; // ERROR, goes to component 4 + +layout(location = 32, component = 1) out mat4 ba; // ERROR +layout(location = 33, component = 1) out struct S {int a;} Ss; // ERROR +layout(location = 34, component = 1) out bn { int a;} bb; // ERROR + +layout(component = 1) out float bc; // ERROR, no location + +out blockname { + layout(location = 40, component = 2) out float u; + layout(location = 40, component = 0) out float v; + layout(location = 40, component = 3) out float w; + layout(location = 40, component = 1) out vec2 x; // ERROR, overlap + + layout(location = 41, component = 3) out vec2 y; // ERROR, goes to component 4 + layout(location = 42, component = 1) out vec4 z; // ERROR, goes to component 4 + + layout(location = 42, component = 1) out mat4 ba; // ERROR + layout(location = 43, component = 1) out S Ss; // ERROR +} bd; + +layout(location = 1, component = 1) out; // ERROR, no global setting + +layout(location = 50, component = 3) out int be; +layout(location = 50, component = 0) out vec3 bf; + +layout(location = 51, component = 1) out double dfo; // ERROR, odd component +layout(location = 52, component = 2) out dvec2 dvo; // ERROR, overflow +layout(location = 53) out double dfo2; +layout(location = 53, component = 2) out vec2 ffv2; // okay, fits +layout(location = 54) out dvec4 dvec4out; // uses up location 55 too +layout(location = 55) out float overf; // ERROR, collides with previous dvec4 +layout(location = 56, component = 1) out vec2 df2o; +layout(location = 56, component = 3) out float sf2o; +layout(location = 57, component = 2) out vec2 dv3o; +layout(location = 57, component = 3) out float sf4o; // ERROR, overlapping component +layout(location=58) out flat dvec3 dv3o2; // uses part of location 59 +layout(location=59, component=2) out flat double dfo3; // okay, fits +layout(location=59, component=0) out flat double dfo4; // ERROR, overlaps the dvec3 in starting in 58 + +out bblck1 { + vec4 bbv; +} bbinst1; + +out bblck2 { + layout(xfb_offset=64) vec4 bbv; +} bbinst2; + +layout(xfb_buffer = 3, xfb_stride = 64) out; // default buffer is 3 + +out bblck3 { + layout(xfb_offset=16) vec4 bbv; // in xfb_buffer 3 +} bbinst3; + +uniform ubblck3 { + layout(xfb_offset=16) vec4 bbv; // ERROR, not in a uniform +} ubbinst3; + +layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bg; +layout( xfb_offset=32, xfb_stride=64) out vec4 bh; + +layout(xfb_offset=48) out; // ERROR + +layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4 { + vec4 bbv1; + vec4 bbv2; +} bbinst4; + +out bblck5 { + layout(xfb_offset=0) vec4 bbv1; + layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; + layout(xfb_buffer=2) vec4 bbv3; // ERROR, wrong buffer +} bbinst5; + +out layout(xfb_buffer=2) bblck6 { + layout(xfb_offset=0) vec4 bbv1; + layout(xfb_stride=64, xfb_buffer=3, xfb_offset=32) vec4 bbv2; // ERROR, overlap 32 from bh, and buffer contradiction + layout(xfb_buffer=2, xfb_offset=0) vec4 bbv3; // ERROR, overlap 0 from bbinst5 + layout(xfb_buffer=2) vec4 bbv5; + layout(xfb_offset=24) float bbf6; // ERROR, overlap 24 from bbv1 in bbinst4 +} bbinst6; + +layout(xfb_stride=48) out; // ERROR, stride of buffer 3 + +layout(xfb_buffer=1) out; // default buffer is 1 +layout(xfb_offset=4) out float bj; +layout(xfb_offset=0) out ivec2 bk; // ERROR, overlap 4 + +layout(xfb_buffer=3, xfb_stride=48) out; // ERROR, stride of buffer 3 (default is now 3) +layout(xfb_stride=48) out float bl; // ERROR, stride of buffer 3 + +layout(xfb_stride=48) out bblck7 { // ERROR, stride of buffer 3 + layout(xfb_stride=64) vec4 bbv1; + layout(xfb_stride=32) vec4 bbv2; // ERROR, stride of buffer 3 +} bbinst7; + +struct S5 { + int i; // 4 bytes plus 4 byte hole + double d; // 8 bytes + float f; // 4 bytes +}; // total size = 20 + +struct T { + bool b; // 4 plus 4 byte hole + S5 s; // 20 + vec2 v2; // 8 +}; // total size = 36 + +out layout(xfb_buffer=0, xfb_offset=0, xfb_stride=92) bblck8 { // ERROR, stride not multiple of 8 + bool b; // offset 0 + T t; // offset 8, size 40 + int i; // offset 40 + 4 = 48 + mat3x3 m3; // offset 52 + float f; // offset 52 + 9*4 = 88 + float g; // ERROR, overflow stride +} bbinst8; + +out layout(xfb_buffer=4) bblck9 { + layout(xfb_offset=1) bool b; // ERROR + layout(xfb_offset=12) T t; // ERROR + layout(xfb_offset=52) mat3x3 m3; // non-multiple of 8 okay + layout(xfb_offset=90) int i; // ERROR + layout(xfb_offset=98) double d; // ERROR + layout(xfb_offset=108) S s; // non-multiple of 8 okay +} bbinst9; + +layout(xfb_buffer=5, xfb_stride=6) out; // link ERROR, stride not multiple of 4 +layout(xfb_offset=0) out float bm; + +layout(xfb_buffer=6, xfb_stride=2000) out; // ERROR, stride too big + +out layout(xfb_buffer=7, xfb_offset=0) bblck10 { // link ERROR, implicit stride too big + dmat4x4 m1; + dmat4x4 m2; + float f; +} bbinst10; + +layout(xfb_buffer = 3) out; +layout(xfb_offset = 32) out gl_PerVertex { + layout(xfb_buffer = 2) float gl_PointSize; // ERROR, change in xfb_buffer + vec4 gl_Position; +}; + +int drawParamsBad() +{ + return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; // ERROR, extension not requested +} + +#extension GL_ARB_shader_draw_parameters: enable + +int drawParams() +{ + return gl_BaseVertexARB + gl_BaseInstanceARB + gl_DrawIDARB; + gl_BaseVertexARB = 3; // ERROR, can't write to shader 'in' + gl_BaseInstanceARB = 3; // ERROR, can't write to shader 'in' + gl_DrawIDARB = 3; // ERROR, can't write to shader 'in' + glBaseInstanceARB; // ERROR, not defined +} diff --git a/core/deps/glslang/Test/450.comp b/core/deps/glslang/Test/450.comp index 8bcf60d3d..316674dd7 100644 --- a/core/deps/glslang/Test/450.comp +++ b/core/deps/glslang/Test/450.comp @@ -1,6 +1,9 @@ -#version 450 core -layout(local_size_x = 0) in; // ERROR, 0 not allowed -void main() -{ - shared float f; // ERROR shared must be global -} +#version 450 core +layout(local_size_x = 0) in; // ERROR, 0 not allowed + +layout(binding=10000) uniform atomic_uint; // ERROR + +void main() +{ + shared float f; // ERROR shared must be global +} diff --git a/core/deps/glslang/Test/450.frag b/core/deps/glslang/Test/450.frag index e3396d9aa..076d0b3a9 100644 --- a/core/deps/glslang/Test/450.frag +++ b/core/deps/glslang/Test/450.frag @@ -1,68 +1,68 @@ -#version 450 core - -in float in1; -in vec2 in2; -in vec3 in3; -in vec4 in4; - -void main() -{ - vec2 v2 = dFdxFine(in2); - vec3 v3 = dFdyCoarse(in3); - vec4 v4 = fwidth(in4); - v4 = dFdyFine(in4); - v3 = dFdyFine(in3); - float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1); - v4 = fwidthCoarse(in4) + fwidthFine(in4); - - float cull = gl_CullDistance[2]; - float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples; - - if (gl_HelperInvocation) - ++v4; - - int sum = gl_MaxVertexImageUniforms + - gl_MaxFragmentImageUniforms + - gl_MaxComputeImageUniforms + - gl_MaxCombinedImageUniforms + - gl_MaxCombinedShaderOutputResources; - - bool b1, b3, b; - uint uin; - bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b)); - uint um = mix(uin, uin, b); - ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b)); -} - -uniform sampler2DMS s2dms; -uniform usampler2DMSArray us2dmsa; -layout(rgba32i) uniform iimage2DMS ii2dms; -layout(rgba32f) uniform image2DMSArray i2dmsa; - -void foo() -{ - int s = textureSamples(s2dms); - s += textureSamples(us2dmsa); - s += imageSamples(ii2dms); - s += imageSamples(i2dmsa); - float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5); -} - -in float gl_CullDistance[6]; - -float cull(int i) -{ - return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i]; -} - -layout(location = 6) in bName1 { - float f; - layout(location = 7) float g; - mat4 m; -} bInst1; -layout(location = 12) in bName2 { - float f; - layout(location = 13) float g; // ERROR, location on array -} bInst2[3]; - -layout(early_fragment_tests) in float f; // ERROR, must be standalone +#version 450 core + +in float in1; +in vec2 in2; +in vec3 in3; +in vec4 in4; + +void main() +{ + vec2 v2 = dFdxFine(in2); + vec3 v3 = dFdyCoarse(in3); + vec4 v4 = fwidth(in4); + v4 = dFdyFine(in4); + v3 = dFdyFine(in3); + float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1); + v4 = fwidthCoarse(in4) + fwidthFine(in4); + + float cull = gl_CullDistance[2]; + float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples; + + if (gl_HelperInvocation) + ++v4; + + int sum = gl_MaxVertexImageUniforms + + gl_MaxFragmentImageUniforms + + gl_MaxComputeImageUniforms + + gl_MaxCombinedImageUniforms + + gl_MaxCombinedShaderOutputResources; + + bool b1, b3, b; + uint uin; + bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b)); + uint um = mix(uin, uin, b); + ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b)); +} + +uniform sampler2DMS s2dms; +uniform usampler2DMSArray us2dmsa; +layout(rgba32i) uniform iimage2DMS ii2dms; +layout(rgba32f) uniform image2DMSArray i2dmsa; + +void foo() +{ + int s = textureSamples(s2dms); + s += textureSamples(us2dmsa); + s += imageSamples(ii2dms); + s += imageSamples(i2dmsa); + float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5); +} + +in float gl_CullDistance[6]; + +float cull(int i) +{ + return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i]; +} + +layout(location = 6) in bName1 { + float f; + layout(location = 7) float g; + mat4 m; +} bInst1; +layout(location = 12) in bName2 { + float f; + layout(location = 13) float g; // ERROR, location on array +} bInst2[3]; + +layout(early_fragment_tests) in float f; // ERROR, must be standalone diff --git a/core/deps/glslang/Test/450.geom b/core/deps/glslang/Test/450.geom index a419614eb..45cbecba5 100644 --- a/core/deps/glslang/Test/450.geom +++ b/core/deps/glslang/Test/450.geom @@ -1,19 +1,19 @@ -#version 450 core - -in gl_PerVertex { - float gl_CullDistance[3]; -} gl_in[]; - -out gl_PerVertex { - float gl_CullDistance[3]; -}; - -layout(triangles) in; - -void main() -{ - gl_in[3].gl_Position; // ERROR, out of range - gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; -} - -layout(points) in float f[3]; // ERROR, must be standalone +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[]; + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +layout(triangles) in; + +void main() +{ + gl_in[3].gl_Position; // ERROR, out of range + gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} + +layout(points) in float f[3]; // ERROR, must be standalone diff --git a/core/deps/glslang/Test/450.tesc b/core/deps/glslang/Test/450.tesc index da4e6fc1d..bf5c08373 100644 --- a/core/deps/glslang/Test/450.tesc +++ b/core/deps/glslang/Test/450.tesc @@ -1,23 +1,23 @@ -#version 450 core - -in gl_PerVertex { - float gl_CullDistance[3]; -} gl_in[gl_MaxPatchVertices]; - -out gl_PerVertex { - float gl_CullDistance[3]; -} gl_out[4]; - -void main() -{ - gl_out[gl_InvocationID].gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; -} - -layout(location = 4) out bName1 { - float f; - layout(location = 5) float g; -} bInst1[2]; -layout(location = 6) out bName2 { - float f; - layout(location = 7) float g; // ERROR, location on array -} bInst2[2][3]; +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[gl_MaxPatchVertices]; + +out gl_PerVertex { + float gl_CullDistance[3]; +} gl_out[4]; + +void main() +{ + gl_out[gl_InvocationID].gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} + +layout(location = 4) out bName1 { + float f; + layout(location = 5) float g; +} bInst1[2]; +layout(location = 6) out bName2 { + float f; + layout(location = 7) float g; // ERROR, location on array +} bInst2[2][3]; diff --git a/core/deps/glslang/Test/450.tese b/core/deps/glslang/Test/450.tese index 4fcb142be..8cdeb2072 100644 --- a/core/deps/glslang/Test/450.tese +++ b/core/deps/glslang/Test/450.tese @@ -1,21 +1,21 @@ -#version 450 core - -in gl_PerVertex { - float gl_CullDistance[3]; -} gl_in[gl_MaxPatchVertices]; - -out gl_PerVertex { - float gl_CullDistance[3]; -}; - -void main() -{ - gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; -} - -layout(equal_spacing) in float f1[]; // ERROR, must be standalone -layout(fractional_even_spacing) in float f2[]; // ERROR, must be standalone -layout(fractional_odd_spacing) in float f3[]; // ERROR, must be standalone -layout(cw) in float f4[]; // ERROR, must be standalone -layout(ccw) in float f5[]; // ERROR, must be standalone -layout(point_mode) in float f6[]; // ERROR, must be standalone +#version 450 core + +in gl_PerVertex { + float gl_CullDistance[3]; +} gl_in[gl_MaxPatchVertices]; + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = gl_in[1].gl_CullDistance[2]; +} + +layout(equal_spacing) in float f1[]; // ERROR, must be standalone +layout(fractional_even_spacing) in float f2[]; // ERROR, must be standalone +layout(fractional_odd_spacing) in float f3[]; // ERROR, must be standalone +layout(cw) in float f4[]; // ERROR, must be standalone +layout(ccw) in float f5[]; // ERROR, must be standalone +layout(point_mode) in float f6[]; // ERROR, must be standalone diff --git a/core/deps/glslang/Test/450.vert b/core/deps/glslang/Test/450.vert index a7ea8bbfd..e99a133c1 100644 --- a/core/deps/glslang/Test/450.vert +++ b/core/deps/glslang/Test/450.vert @@ -1,56 +1,56 @@ -#version 450 core - -out gl_PerVertex { - float gl_CullDistance[3]; -}; - -void main() -{ - gl_CullDistance[2] = 4.5; -} - -out bool outb; // ERROR -out sampler2D outo; // ERROR -out float outa[4]; -out float outaa[4][2]; -struct S { float f; }; -out S outs; -out S[4] outasa; -out S outsa[4]; -struct SA { float f[4]; }; -out SA outSA; -struct SS { float f; S s; }; -out SS outSS; - -layout(binding = 0) uniform atomic_uint aui; -uint ui; - -void foo() -{ - SS::f; - atomicCounterAdd(aui, ui); // ERROR, need 4.6 - atomicCounterSubtract(aui, ui); // ERROR, need 4.6 - atomicCounterMin(aui, ui); // ERROR, need 4.6 - atomicCounterMax(aui, ui); // ERROR, need 4.6 - atomicCounterAnd(aui, ui); // ERROR, need 4.6 - atomicCounterOr(aui, ui); // ERROR, need 4.6 - atomicCounterXor(aui, ui); // ERROR, need 4.6 - atomicCounterExchange(aui, ui); // ERROR, need 4.6 - atomicCounterCompSwap(aui, ui, ui); // ERROR, need 4.6 - - int a = gl_BaseVertex + gl_BaseInstance + gl_DrawID; // ERROR, need 4.6 - - bool b1; - anyInvocation(b1); // ERROR, need 4.6 - allInvocations(b1); // ERROR, need 4.6 - allInvocationsEqual(b1); // ERROR, need 4.6 -} -; // ERROR: no extraneous semicolons - -layout(location = 0) uniform locBlock { // ERROR, no location uniform block - int a; -}; - -layout(location = 0) buffer locBuffBlock { // ERROR, no location on buffer block - int b; -}; +#version 450 core + +out gl_PerVertex { + float gl_CullDistance[3]; +}; + +void main() +{ + gl_CullDistance[2] = 4.5; +} + +out bool outb; // ERROR +out sampler2D outo; // ERROR +out float outa[4]; +out float outaa[4][2]; +struct S { float f; }; +out S outs; +out S[4] outasa; +out S outsa[4]; +struct SA { float f[4]; }; +out SA outSA; +struct SS { float f; S s; }; +out SS outSS; + +layout(binding = 0) uniform atomic_uint aui; +uint ui; + +void foo() +{ + SS::f; + atomicCounterAdd(aui, ui); // ERROR, need 4.6 + atomicCounterSubtract(aui, ui); // ERROR, need 4.6 + atomicCounterMin(aui, ui); // ERROR, need 4.6 + atomicCounterMax(aui, ui); // ERROR, need 4.6 + atomicCounterAnd(aui, ui); // ERROR, need 4.6 + atomicCounterOr(aui, ui); // ERROR, need 4.6 + atomicCounterXor(aui, ui); // ERROR, need 4.6 + atomicCounterExchange(aui, ui); // ERROR, need 4.6 + atomicCounterCompSwap(aui, ui, ui); // ERROR, need 4.6 + + int a = gl_BaseVertex + gl_BaseInstance + gl_DrawID; // ERROR, need 4.6 + + bool b1; + anyInvocation(b1); // ERROR, need 4.6 + allInvocations(b1); // ERROR, need 4.6 + allInvocationsEqual(b1); // ERROR, need 4.6 +} +; // ERROR: no extraneous semicolons + +layout(location = 0) uniform locBlock { // ERROR, no location uniform block + int a; +}; + +layout(location = 0) buffer locBuffBlock { // ERROR, no location on buffer block + int b; +}; diff --git a/core/deps/glslang/Test/460.frag b/core/deps/glslang/Test/460.frag index 98f175996..23f8eea65 100644 --- a/core/deps/glslang/Test/460.frag +++ b/core/deps/glslang/Test/460.frag @@ -1,32 +1,32 @@ -#version 460 core - -struct S { - float f; - vec4 v; -}; - -in S s; - -void main() -{ - interpolateAtCentroid(s.v); - bool b1; - b1 = anyInvocation(b1); - b1 = allInvocations(b1); - b1 = allInvocationsEqual(b1); -} - -void attExtBad() -{ - // ERRORs, not enabled +#version 460 core + +struct S { + float f; + vec4 v; +}; + +in S s; + +void main() +{ + interpolateAtCentroid(s.v); + bool b1; + b1 = anyInvocation(b1); + b1 = allInvocations(b1); + b1 = allInvocationsEqual(b1); +} + +void attExtBad() +{ + // ERRORs, not enabled [[dependency_length(1+3)]] for (int i = 0; i < 8; ++i) { } [[flatten]] if (true) { } else { } } - -#extension GL_EXT_control_flow_attributes : enable - -void attExt() -{ - [[dependency_length(-3)]] do { } while(true); // ERROR, not positive + +#extension GL_EXT_control_flow_attributes : enable + +void attExt() +{ + [[dependency_length(-3)]] do { } while(true); // ERROR, not positive [[dependency_length(0)]] do { } while(true); // ERROR, not positive } diff --git a/core/deps/glslang/Test/460.vert b/core/deps/glslang/Test/460.vert index b433c9f5c..cf4f4adaf 100644 --- a/core/deps/glslang/Test/460.vert +++ b/core/deps/glslang/Test/460.vert @@ -1,15 +1,16 @@ -#version 460 core - -int i; -; // extraneous semicolon okay -float f;;; - -void main() -{ - bool b1; - b1 = anyInvocation(b1); - b1 = allInvocations(b1); - b1 = allInvocationsEqual(b1); -} -; -; +#version 460 core + +int i; +; // extraneous semicolon okay +float f;;; + +void main() +{ + bool b1; + float array[int(mod(float (7.1), float (4.0)))]; + b1 = anyInvocation(b1); + b1 = allInvocations(b1); + b1 = allInvocationsEqual(b1); +} +; +; diff --git a/core/deps/glslang/Test/Operations.frag b/core/deps/glslang/Test/Operations.frag index 1ae33903d..ca06a752e 100644 --- a/core/deps/glslang/Test/Operations.frag +++ b/core/deps/glslang/Test/Operations.frag @@ -1,166 +1,166 @@ -#version 130 - -uniform ivec4 uiv4; -uniform vec4 uv4; -uniform bool ub; -uniform bvec4 ub41, ub42; -uniform float uf; -uniform int ui; - - -uniform uvec4 uuv4; -uniform uint uui; - - -void main() -{ - vec4 v; - float f; - bool b; - bvec4 bv4; - int i; - - uint u; - - - // floating point - v = radians(uv4); - v += degrees(v); - v += (i = ui*ui, sin(v)); - v += cos(v); - v += tan(v); - v += asin(v); - v += acos(v); - - v += atan(v); - v += sinh(v); - v += cosh(v); - v += tanh(v); - v += asinh(v); - v += acosh(v); - v += atanh(v); - - v += pow(v, v); - v += exp(v); - v += log(v); - v += exp2(v); - v += log2(v); - v += sqrt(v); - v += inversesqrt(v); - v += abs(v); - v += sign(v); - v += floor(v); - - - v += trunc(v); - v += round(v); - v += roundEven(v); - - - v += ceil(v); - v += fract(v); - v += mod(v, v); - v += mod(v, v.x); - - - v += modf(v, v); - - - v += min(v, uv4); - v += max(v, uv4); - v += clamp(v, uv4, uv4); - v += mix(v,v,v); - - - v += mix(v,v,bv4); - v += intBitsToFloat(ivec4(i)); - v += uintBitsToFloat(uv4); - v += fma(v,v,v); - v += frexp(v); - v += ldexp(v); - v += unpackUnorm2x16(v); - v += unpackUnorm4x8(v); - v += unpackSnorm4x8(v); - - - v += step(v,v); - v += smoothstep(v,v,v); - v += step(uf,v); - v += smoothstep(uf,uf,v); - v += normalize(v); - v += faceforward(v, v, v); - v += reflect(v, v); - v += refract(v, v, uf); - v += dFdx(v); - v += dFdy(v); - v += fwidth(v); - //noise*(v); - - - // signed integer - i += abs(ui); - i += sign(i); - i += min(i, ui); - i += max(i, ui); - i += clamp(i, ui, ui); - - floatsBitsToInt(v); - packUnorm2x16(v); - packUnorm4x8(v); - packSnorm4x8(v); - - // unsigned integer - u = abs(uui); - u += sign(u); - u += min(u, uui); - u += max(u, uui); - u += clamp(u, uui, uui); - u += floatsBitToInt(v); - u += packUnorm2x16(v); - u += packUnorm4x8(v); - i += uui & i; // ERRORs, no int/uint conversions before 400 - i += uui ^ i; - i += i | uui; - - // bool - - b = isnan(uf); - b = isinf(v.y); - - b = any(lessThan(v, uv4)); - b = (b && any(lessThanEqual(v, uv4))); - b = (b && any(greaterThan(v, uv4))); - b = (b && any(greaterThanEqual(v, uv4))); - b = (b && any(equal(ub41, ub42))); - b = (b && any(notEqual(ub41, ub42))); - b = (b && any(ub41)); - b = (b && all(ub41)); - b = (b && any(not(ub41))); - - i = ((i + ui) * i - ui) / i; - i = i % ui; - if (i == ui || i != ui && i == ui ^^ i != 2) - ++i; - - f = ((uf + uf) * uf - uf) / uf; - - f += length(v); - f += distance(v, v); - f += dot(v, v); - f += dot(f, uf); - f += cross(v.xyz, v.xyz).x; - - if (f == uf || f != uf && f != 2.0) - ++f; - - i &= ui; - i |= 0x42; - i ^= ui; - i %= 17; - i >>= 2; - i <<= ui; - i = ~i; - b = !b; - - gl_FragColor = b ? vec4(i) + vec4(f) + v : v; -} +#version 130 + +uniform ivec4 uiv4; +uniform vec4 uv4; +uniform bool ub; +uniform bvec4 ub41, ub42; +uniform float uf; +uniform int ui; + + +uniform uvec4 uuv4; +uniform uint uui; + + +void main() +{ + vec4 v; + float f; + bool b; + bvec4 bv4; + int i; + + uint u; + + + // floating point + v = radians(uv4); + v += degrees(v); + v += (i = ui*ui, sin(v)); + v += cos(v); + v += tan(v); + v += asin(v); + v += acos(v); + + v += atan(v); + v += sinh(v); + v += cosh(v); + v += tanh(v); + v += asinh(v); + v += acosh(v); + v += atanh(v); + + v += pow(v, v); + v += exp(v); + v += log(v); + v += exp2(v); + v += log2(v); + v += sqrt(v); + v += inversesqrt(v); + v += abs(v); + v += sign(v); + v += floor(v); + + + v += trunc(v); + v += round(v); + v += roundEven(v); + + + v += ceil(v); + v += fract(v); + v += mod(v, v); + v += mod(v, v.x); + + + v += modf(v, v); + + + v += min(v, uv4); + v += max(v, uv4); + v += clamp(v, uv4, uv4); + v += mix(v,v,v); + + + v += mix(v,v,bv4); + v += intBitsToFloat(ivec4(i)); + v += uintBitsToFloat(uv4); + v += fma(v,v,v); + v += frexp(v); + v += ldexp(v); + v += unpackUnorm2x16(v); + v += unpackUnorm4x8(v); + v += unpackSnorm4x8(v); + + + v += step(v,v); + v += smoothstep(v,v,v); + v += step(uf,v); + v += smoothstep(uf,uf,v); + v += normalize(v); + v += faceforward(v, v, v); + v += reflect(v, v); + v += refract(v, v, uf); + v += dFdx(v); + v += dFdy(v); + v += fwidth(v); + //noise*(v); + + + // signed integer + i += abs(ui); + i += sign(i); + i += min(i, ui); + i += max(i, ui); + i += clamp(i, ui, ui); + + floatsBitsToInt(v); + packUnorm2x16(v); + packUnorm4x8(v); + packSnorm4x8(v); + + // unsigned integer + u = abs(uui); + u += sign(u); + u += min(u, uui); + u += max(u, uui); + u += clamp(u, uui, uui); + u += floatsBitToInt(v); + u += packUnorm2x16(v); + u += packUnorm4x8(v); + i += uui & i; // ERRORs, no int/uint conversions before 400 + i += uui ^ i; + i += i | uui; + + // bool + + b = isnan(uf); + b = isinf(v.y); + + b = any(lessThan(v, uv4)); + b = (b && any(lessThanEqual(v, uv4))); + b = (b && any(greaterThan(v, uv4))); + b = (b && any(greaterThanEqual(v, uv4))); + b = (b && any(equal(ub41, ub42))); + b = (b && any(notEqual(ub41, ub42))); + b = (b && any(ub41)); + b = (b && all(ub41)); + b = (b && any(not(ub41))); + + i = ((i + ui) * i - ui) / i; + i = i % ui; + if (i == ui || i != ui && i == ui ^^ i != 2) + ++i; + + f = ((uf + uf) * uf - uf) / uf; + + f += length(v); + f += distance(v, v); + f += dot(v, v); + f += dot(f, uf); + f += cross(v.xyz, v.xyz).x; + + if (f == uf || f != uf && f != 2.0) + ++f; + + i &= ui; + i |= 0x42; + i ^= ui; + i %= 17; + i >>= 2; + i <<= ui; + i = ~i; + b = !b; + + gl_FragColor = b ? vec4(i) + vec4(f) + v : v; +} diff --git a/core/deps/glslang/Test/aggOps.frag b/core/deps/glslang/Test/aggOps.frag index 7e8fa2167..a0450dca9 100644 --- a/core/deps/glslang/Test/aggOps.frag +++ b/core/deps/glslang/Test/aggOps.frag @@ -1,51 +1,51 @@ -#version 130 - -uniform sampler2D sampler; -varying mediump vec2 coord; - -varying vec4 u, w; - -struct s1 { - int i; - float f; -}; - -struct s2 { - int i; - float f; - s1 s1_1; -}; - -uniform s1 foo1; -uniform s2 foo2a; -uniform s2 foo2b; - -void main() -{ - vec4 v; - s1 a[3], b[3]; - a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); - b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); - - if (foo2a == foo2b) - v = texture2D(sampler, coord); - else - v = texture2D(sampler, 2.0*coord); - - if (u == v) - v *= 3.0; - - if (u != v) - v *= 4.0; - - if (coord == v.yw) - v *= 5.0; - - if (a == b) - v *= 6.0; - - if (a != b) - v *= 7.0; - - gl_FragColor = v; -} +#version 130 + +uniform sampler2D sampler; +varying mediump vec2 coord; + +varying vec4 u, w; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +uniform s1 foo1; +uniform s2 foo2a; +uniform s2 foo2b; + +void main() +{ + vec4 v; + s1 a[3], b[3]; + a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); + b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); + + if (foo2a == foo2b) + v = texture2D(sampler, coord); + else + v = texture2D(sampler, 2.0*coord); + + if (u == v) + v *= 3.0; + + if (u != v) + v *= 4.0; + + if (coord == v.yw) + v *= 5.0; + + if (a == b) + v *= 6.0; + + if (a != b) + v *= 7.0; + + gl_FragColor = v; +} diff --git a/core/deps/glslang/Test/always-discard.frag b/core/deps/glslang/Test/always-discard.frag index 9ec493a58..cea4ceec6 100644 --- a/core/deps/glslang/Test/always-discard.frag +++ b/core/deps/glslang/Test/always-discard.frag @@ -1,36 +1,36 @@ -#version 110 -varying vec2 tex_coord; - -void main (void) -{ - vec4 white = vec4(1.0); - vec4 black = vec4(0.2); - vec4 color = white; - - // First, cut out our circle - float x = tex_coord.x*2.0 - 1.0; - float y = tex_coord.y*2.0 - 1.0; - - float radius = sqrt(x*x + y*y); - if (radius > 1.0) { - if (radius > 1.1) { - ++color; - } - - gl_FragColor = color; - - if (radius > 1.2) { - ++color; - } - - } - - discard; - - // If we're near an edge, darken us a tiny bit - if (radius >= 0.75) - color -= abs(pow(radius, 16.0)/2.0); - - gl_FragColor = color; - -} +#version 110 +varying vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + } + + discard; + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/core/deps/glslang/Test/always-discard2.frag b/core/deps/glslang/Test/always-discard2.frag index 4d9e957f8..a619369d6 100644 --- a/core/deps/glslang/Test/always-discard2.frag +++ b/core/deps/glslang/Test/always-discard2.frag @@ -1,19 +1,19 @@ -#version 110 -varying vec2 tex_coord; - -void main (void) -{ - vec4 white = vec4(1.0); - vec4 black = vec4(0.2); - vec4 color = white; - - // First, cut out our circle - float x = tex_coord.x*2.0 - 1.0; - float y = tex_coord.y*2.0 - 1.0; - - discard; - - - gl_FragColor = color; - -} +#version 110 +varying vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + discard; + + + gl_FragColor = color; + +} diff --git a/core/deps/glslang/Test/atomic_uint.frag b/core/deps/glslang/Test/atomic_uint.frag index 2c9ddb1ca..41552144d 100644 --- a/core/deps/glslang/Test/atomic_uint.frag +++ b/core/deps/glslang/Test/atomic_uint.frag @@ -20,30 +20,30 @@ void main() uint val = atomicCounter(counter); atomicCounterDecrement(counter); } - -layout(binding = 1, offset = 3) uniform atomic_uint countArr[4]; -uniform int i; - -void opac() -{ - counter + counter; // ERROR - -counter; // ERROR - int a[3]; - a[counter]; // ERROR - countArr[2]; - countArr[i]; - counter = 4; // ERROR -} - -in atomic_uint acin; // ERROR -atomic_uint acg; // ERROR -uniform atomic_uint; -uniform atomic_uint aNoBind; // ERROR, no binding -layout(binding=0, offset=32) uniform atomic_uint aOffset; -layout(binding=0, offset=4) uniform atomic_uint; -layout(binding=0) uniform atomic_uint bar3; // offset is 4 -layout(binding=0) uniform atomic_uint ac[2]; // offset = 8 -layout(binding=0) uniform atomic_uint ad; // offset = 20 -layout(offset=8) uniform atomic_uint bar4; // ERROR, no binding -layout(binding = 0, offset = 12) uniform atomic_uint overlap; // ERROR, overlapping offsets -layout(binding = 20) uniform atomic_uint bigBind; // ERROR, binding too big + +layout(binding = 1, offset = 3) uniform atomic_uint countArr[4]; +uniform int i; + +void opac() +{ + counter + counter; // ERROR + -counter; // ERROR + int a[3]; + a[counter]; // ERROR + countArr[2]; + countArr[i]; + counter = 4; // ERROR +} + +in atomic_uint acin; // ERROR +atomic_uint acg; // ERROR +uniform atomic_uint; +uniform atomic_uint aNoBind; // ERROR, no binding +layout(binding=0, offset=32) uniform atomic_uint aOffset; +layout(binding=0, offset=4) uniform atomic_uint; +layout(binding=0) uniform atomic_uint bar3; // offset is 4 +layout(binding=0) uniform atomic_uint ac[2]; // offset = 8 +layout(binding=0) uniform atomic_uint ad; // offset = 20 +layout(offset=8) uniform atomic_uint bar4; // ERROR, no binding +layout(binding = 0, offset = 12) uniform atomic_uint overlap; // ERROR, overlapping offsets +layout(binding = 20) uniform atomic_uint bigBind; // ERROR, binding too big diff --git a/core/deps/glslang/Test/badMacroArgs.frag b/core/deps/glslang/Test/badMacroArgs.frag index fbcab1be8..7d7de8703 100644 --- a/core/deps/glslang/Test/badMacroArgs.frag +++ b/core/deps/glslang/Test/badMacroArgs.frag @@ -1,4 +1,4 @@ -#version 400 - -#define m(a) a +#version 400 + +#define m(a) a m() \ No newline at end of file diff --git a/core/deps/glslang/Test/baseResults/150.frag.out b/core/deps/glslang/Test/baseResults/150.frag.out index e51b13d15..4a55ea40e 100644 --- a/core/deps/glslang/Test/baseResults/150.frag.out +++ b/core/deps/glslang/Test/baseResults/150.frag.out @@ -5,10 +5,17 @@ ERROR: 0:6: 'layout qualifier' : can only apply origin_upper_left and pixel_cent ERROR: 0:14: 'gl_FragCoord' : cannot redeclare after use ERROR: 0:50: 'gl_PerFragment' : cannot be used (maybe an instance name is needed) ERROR: 0:50: 'gl_PerFragment' : undeclared identifier -ERROR: 6 compilation errors. No code generated. +ERROR: 0:53: 'double' : Reserved word. +ERROR: 0:53: 'double' : not supported for this version or the enabled extensions +ERROR: 0:53: 'double' : must be qualified as flat in +ERROR: 0:57: '=' : cannot convert from ' global double' to ' global int' +ERROR: 0:80: 'floatBitsToInt' : required extension not requested: GL_ARB_shader_bit_encoding +ERROR: 11 compilation errors. No code generated. Shader version: 150 +Requested GL_ARB_gpu_shader_fp64 +Requested GL_ARB_shader_bit_encoding gl_FragCoord pixel center is integer gl_FragCoord origin is upper left ERROR: node is still EOpNull! @@ -109,6 +116,57 @@ ERROR: node is still EOpNull! 0:49 Branch: Return with expression 0:49 'gl_PrimitiveID' ( flat in int PrimitiveID) 0:50 'gl_PerFragment' ( temp float) +0:56 Sequence +0:56 move second child to first child ( temp double) +0:56 'type3' ( global double) +0:56 Constant: +0:56 2.000000 +0:58 Sequence +0:58 move second child to first child ( temp double) +0:58 'absTest2' ( global double) +0:58 sqrt ( global double) +0:58 'type3' ( global double) +0:59 Sequence +0:59 move second child to first child ( temp double) +0:59 'absTest3' ( global double) +0:59 Constant: +0:59 1.414214 +0:60 Sequence +0:60 move second child to first child ( temp float) +0:60 'dk' ( global float) +0:60 Constant: +0:60 3.316625 +0:68 Function Definition: bitEncodingPass( ( global void) +0:68 Function Parameters: +0:70 Sequence +0:70 Sequence +0:70 move second child to first child ( temp int) +0:70 'i' ( temp int) +0:70 floatBitsToInt ( global int) +0:70 'f' ( global float) +0:71 Sequence +0:71 move second child to first child ( temp 4-component vector of uint) +0:71 'uv11' ( temp 4-component vector of uint) +0:71 floatBitsToUint ( global 4-component vector of uint) +0:71 'v4' ( global 4-component vector of float) +0:72 Sequence +0:72 move second child to first child ( temp 4-component vector of float) +0:72 'v14' ( temp 4-component vector of float) +0:72 intBitsToFloat ( global 4-component vector of float) +0:72 'iv4a' ( global 4-component vector of int) +0:73 Sequence +0:73 move second child to first child ( temp 2-component vector of float) +0:73 'v15' ( temp 2-component vector of float) +0:73 uintBitsToFloat ( global 2-component vector of float) +0:73 'uv2c' ( global 2-component vector of uint) +0:78 Function Definition: bitEncodingFail( ( global void) +0:78 Function Parameters: +0:80 Sequence +0:80 Sequence +0:80 move second child to first child ( temp int) +0:80 'i' ( temp int) +0:80 floatBitsToInt ( global int) +0:80 'f' ( global float) 0:? Linker Objects 0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) 0:? 'foo' ( smooth in 4-component vector of float) @@ -123,12 +181,25 @@ ERROR: node is still EOpNull! 0:? 'p2' ( flat in 2-component vector of int) 0:? 'p3' ( flat in 3-component vector of int) 0:? 'samp' ( flat in int) +0:? 'type1' ( smooth in double) +0:? 'type2' ( global double) +0:? 'type3' ( global double) +0:? 'absTest' ( global int) +0:? 'absTest2' ( global double) +0:? 'absTest3' ( global double) +0:? 'dk' ( global float) +0:? 'f' ( global float) +0:? 'v4' ( global 4-component vector of float) +0:? 'iv4a' ( global 4-component vector of int) +0:? 'uv2c' ( global 2-component vector of uint) Linked fragment stage: Shader version: 150 +Requested GL_ARB_gpu_shader_fp64 +Requested GL_ARB_shader_bit_encoding gl_FragCoord pixel center is integer gl_FragCoord origin is upper left ERROR: node is still EOpNull! @@ -144,6 +215,26 @@ ERROR: node is still EOpNull! 0:18 'patch' ( global float) 0:18 Constant: 0:18 3.100000 +0:56 Sequence +0:56 move second child to first child ( temp double) +0:56 'type3' ( global double) +0:56 Constant: +0:56 2.000000 +0:58 Sequence +0:58 move second child to first child ( temp double) +0:58 'absTest2' ( global double) +0:58 sqrt ( global double) +0:58 'type3' ( global double) +0:59 Sequence +0:59 move second child to first child ( temp double) +0:59 'absTest3' ( global double) +0:59 Constant: +0:59 1.414214 +0:60 Sequence +0:60 move second child to first child ( temp float) +0:60 'dk' ( global float) +0:60 Constant: +0:60 3.316625 0:? Linker Objects 0:? 'gl_FragCoord' ( gl_FragCoord 4-component vector of float FragCoord) 0:? 'foo' ( smooth in 4-component vector of float) @@ -158,4 +249,15 @@ ERROR: node is still EOpNull! 0:? 'p2' ( flat in 2-component vector of int) 0:? 'p3' ( flat in 3-component vector of int) 0:? 'samp' ( flat in int) +0:? 'type1' ( smooth in double) +0:? 'type2' ( global double) +0:? 'type3' ( global double) +0:? 'absTest' ( global int) +0:? 'absTest2' ( global double) +0:? 'absTest3' ( global double) +0:? 'dk' ( global float) +0:? 'f' ( global float) +0:? 'v4' ( global 4-component vector of float) +0:? 'iv4a' ( global 4-component vector of int) +0:? 'uv2c' ( global 2-component vector of uint) diff --git a/core/deps/glslang/Test/baseResults/410.vert.out b/core/deps/glslang/Test/baseResults/410.vert.out index aacdf36c0..79268bc99 100644 --- a/core/deps/glslang/Test/baseResults/410.vert.out +++ b/core/deps/glslang/Test/baseResults/410.vert.out @@ -3,6 +3,12 @@ Shader version: 410 0:? Sequence 0:7 Function Definition: main( ( global void) 0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'test' ( temp int) +0:9 Constant: +0:9 16 (const int) 0:? Linker Objects 0:? 'd' ( in double) 0:? 'd3' ( in 3-component vector of double) @@ -18,6 +24,12 @@ Shader version: 410 0:? Sequence 0:7 Function Definition: main( ( global void) 0:7 Function Parameters: +0:9 Sequence +0:9 Sequence +0:9 move second child to first child ( temp int) +0:9 'test' ( temp int) +0:9 Constant: +0:9 16 (const int) 0:? Linker Objects 0:? 'd' ( in double) 0:? 'd3' ( in 3-component vector of double) diff --git a/core/deps/glslang/Test/baseResults/420.frag.out b/core/deps/glslang/Test/baseResults/420.frag.out index ffb8f6d28..1a7586a72 100644 --- a/core/deps/glslang/Test/baseResults/420.frag.out +++ b/core/deps/glslang/Test/baseResults/420.frag.out @@ -3,10 +3,15 @@ ERROR: 0:4: 'redeclaration' : all redeclarations must use the same depth layout ERROR: 0:11: 'layout qualifier' : can only apply depth layout to gl_FragDepth ERROR: 0:12: 'gl_FragDepth' : cannot redeclare after use ERROR: 0:14: 'atomic_uint' : array must be explicitly sized -ERROR: 4 compilation errors. No code generated. +ERROR: 0:17: 'imageSize' : required extension not requested: GL_ARB_shader_image_size +ERROR: 0:39: 'std430' : not supported for this version or the enabled extensions +ERROR: 0:39: '' : syntax error, unexpected IDENTIFIER, expecting LEFT_BRACE or COMMA or SEMICOLON +ERROR: 7 compilation errors. No code generated. Shader version: 420 +Requested GL_ARB_shader_image_size +Requested GL_ARB_shader_storage_buffer_object using depth_any ERROR: node is still EOpNull! 0:6 Function Definition: main( ( global void) @@ -16,16 +21,75 @@ ERROR: node is still EOpNull! 0:8 'gl_FragDepth' ( gl_FragDepth float FragDepth) 0:8 Constant: 0:8 0.300000 +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of int) +0:17 'iv2dim' ( global 2-component vector of int) +0:17 imageQuerySize ( global 2-component vector of int) +0:17 'i2D' ( writeonly uniform image2D) +0:19 Sequence +0:19 move second child to first child ( temp 2-component vector of int) +0:19 'iv2dim1' ( global 2-component vector of int) +0:19 imageQuerySize ( global 2-component vector of int) +0:19 'i2D' ( writeonly uniform image2D) +0:29 Function Definition: atomicOpPass( ( global void) +0:29 Function Parameters: +0:31 Sequence +0:31 Sequence +0:31 move second child to first child ( temp int) +0:31 'origi' ( temp int) +0:31 AtomicAdd ( global int) +0:31 atomi: direct index for structure (layout( column_major std430 offset=0) buffer int) +0:31 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu}) +0:31 Constant: +0:31 0 (const uint) +0:31 Constant: +0:31 3 (const int) +0:32 Sequence +0:32 move second child to first child ( temp uint) +0:32 'origu' ( temp uint) +0:32 AtomicAnd ( global uint) +0:32 atomu: direct index for structure (layout( column_major std430 offset=4) buffer uint) +0:32 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 7 (const uint) +0:33 move second child to first child ( temp int) +0:33 'origi' ( temp int) +0:33 AtomicExchange ( global int) +0:33 atomi: direct index for structure (layout( column_major std430 offset=0) buffer int) +0:33 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu}) +0:33 Constant: +0:33 0 (const uint) +0:33 Constant: +0:33 4 (const int) +0:34 move second child to first child ( temp uint) +0:34 'origu' ( temp uint) +0:34 AtomicCompSwap ( global uint) +0:34 atomu: direct index for structure (layout( column_major std430 offset=4) buffer uint) +0:34 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu}) +0:34 Constant: +0:34 1 (const uint) +0:34 Constant: +0:34 10 (const uint) +0:34 Constant: +0:34 8 (const uint) 0:? Linker Objects 0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) 0:? 'depth' ( smooth in float) 0:? 'a' (layout( binding=0 offset=0) uniform unsized 1-element array of atomic_uint) +0:? 'i2D' ( writeonly uniform image2D) +0:? 'iv2dim' ( global 2-component vector of int) +0:? 'iv2dim1' ( global 2-component vector of int) +0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu}) Linked fragment stage: Shader version: 420 +Requested GL_ARB_shader_image_size +Requested GL_ARB_shader_storage_buffer_object using depth_any ERROR: node is still EOpNull! 0:6 Function Definition: main( ( global void) @@ -35,8 +99,22 @@ ERROR: node is still EOpNull! 0:8 'gl_FragDepth' ( gl_FragDepth float FragDepth) 0:8 Constant: 0:8 0.300000 +0:17 Sequence +0:17 move second child to first child ( temp 2-component vector of int) +0:17 'iv2dim' ( global 2-component vector of int) +0:17 imageQuerySize ( global 2-component vector of int) +0:17 'i2D' ( writeonly uniform image2D) +0:19 Sequence +0:19 move second child to first child ( temp 2-component vector of int) +0:19 'iv2dim1' ( global 2-component vector of int) +0:19 imageQuerySize ( global 2-component vector of int) +0:19 'i2D' ( writeonly uniform image2D) 0:? Linker Objects 0:? 'gl_FragDepth' ( gl_FragDepth float FragDepth) 0:? 'depth' ( smooth in float) 0:? 'a' (layout( binding=0 offset=0) uniform 1-element array of atomic_uint) +0:? 'i2D' ( writeonly uniform image2D) +0:? 'iv2dim' ( global 2-component vector of int) +0:? 'iv2dim1' ( global 2-component vector of int) +0:? 'anon@0' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer int atomi, layout( column_major std430 offset=4) buffer uint atomu}) diff --git a/core/deps/glslang/Test/baseResults/450.comp.out b/core/deps/glslang/Test/baseResults/450.comp.out index 4ae77ccaa..ce95f8db7 100644 --- a/core/deps/glslang/Test/baseResults/450.comp.out +++ b/core/deps/glslang/Test/baseResults/450.comp.out @@ -1,14 +1,15 @@ 450.comp ERROR: 0:2: 'local_size_x' : must be at least 1 -ERROR: 0:5: 'shared' : not allowed in nested scope -ERROR: 2 compilation errors. No code generated. +ERROR: 0:4: 'binding' : atomic_uint binding is too large +ERROR: 0:8: 'shared' : not allowed in nested scope +ERROR: 3 compilation errors. No code generated. Shader version: 450 local_size = (1, 1, 1) ERROR: node is still EOpNull! -0:3 Function Definition: main( ( global void) -0:3 Function Parameters: +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: 0:? Linker Objects @@ -18,7 +19,7 @@ Linked compute stage: Shader version: 450 local_size = (1, 1, 1) ERROR: node is still EOpNull! -0:3 Function Definition: main( ( global void) -0:3 Function Parameters: +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: 0:? Linker Objects diff --git a/core/deps/glslang/Test/baseResults/460.vert.out b/core/deps/glslang/Test/baseResults/460.vert.out index 8fa659b30..7f4093bf7 100644 --- a/core/deps/glslang/Test/baseResults/460.vert.out +++ b/core/deps/glslang/Test/baseResults/460.vert.out @@ -4,18 +4,18 @@ Shader version: 460 0:7 Function Definition: main( ( global void) 0:7 Function Parameters: 0:? Sequence -0:10 move second child to first child ( temp bool) -0:10 'b1' ( temp bool) -0:10 anyInvocation ( global bool) -0:10 'b1' ( temp bool) 0:11 move second child to first child ( temp bool) 0:11 'b1' ( temp bool) -0:11 allInvocations ( global bool) +0:11 anyInvocation ( global bool) 0:11 'b1' ( temp bool) 0:12 move second child to first child ( temp bool) 0:12 'b1' ( temp bool) -0:12 allInvocationsEqual ( global bool) +0:12 allInvocations ( global bool) 0:12 'b1' ( temp bool) +0:13 move second child to first child ( temp bool) +0:13 'b1' ( temp bool) +0:13 allInvocationsEqual ( global bool) +0:13 'b1' ( temp bool) 0:? Linker Objects 0:? 'i' ( global int) 0:? 'f' ( global float) @@ -31,18 +31,18 @@ Shader version: 460 0:7 Function Definition: main( ( global void) 0:7 Function Parameters: 0:? Sequence -0:10 move second child to first child ( temp bool) -0:10 'b1' ( temp bool) -0:10 anyInvocation ( global bool) -0:10 'b1' ( temp bool) 0:11 move second child to first child ( temp bool) 0:11 'b1' ( temp bool) -0:11 allInvocations ( global bool) +0:11 anyInvocation ( global bool) 0:11 'b1' ( temp bool) 0:12 move second child to first child ( temp bool) 0:12 'b1' ( temp bool) -0:12 allInvocationsEqual ( global bool) +0:12 allInvocations ( global bool) 0:12 'b1' ( temp bool) +0:13 move second child to first child ( temp bool) +0:13 'b1' ( temp bool) +0:13 allInvocationsEqual ( global bool) +0:13 'b1' ( temp bool) 0:? Linker Objects 0:? 'i' ( global int) 0:? 'f' ( global float) diff --git a/core/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl b/core/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl index d5b1455f2..650d1d0b8 100644 --- a/core/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl +++ b/core/deps/glslang/Test/baseResults/compoundsuffix.frag.hlsl @@ -1,45 +1,45 @@ -compoundsuffix.frag.hlsl -// Module Version 10000 -// Generated by (magic number): 80008 -// Id's are bound by 22 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 20 - ExecutionMode 4 OriginUpperLeft - Source HLSL 500 - Name 4 "main" - Name 11 "@main(vf4;" - Name 10 "fragColor" - Name 15 "fragColor" - Name 16 "param" - Name 20 "fragColor" - Decorate 20(fragColor) Location 0 - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeFloat 32 - 7: TypeVector 6(float) 4 - 8: TypePointer Function 7(fvec4) - 9: TypeFunction 2 8(ptr) - 13: 6(float) Constant 1065353216 - 14: 7(fvec4) ConstantComposite 13 13 13 13 - 19: TypePointer Output 7(fvec4) - 20(fragColor): 19(ptr) Variable Output - 4(main): 2 Function None 3 - 5: Label - 15(fragColor): 8(ptr) Variable Function - 16(param): 8(ptr) Variable Function - 17: 2 FunctionCall 11(@main(vf4;) 16(param) - 18: 7(fvec4) Load 16(param) - Store 15(fragColor) 18 - 21: 7(fvec4) Load 15(fragColor) - Store 20(fragColor) 21 - Return - FunctionEnd - 11(@main(vf4;): 2 Function None 9 - 10(fragColor): 8(ptr) FunctionParameter - 12: Label - Store 10(fragColor) 14 - Return - FunctionEnd +compoundsuffix.frag.hlsl +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 20 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "fragColor" + Name 15 "fragColor" + Name 16 "param" + Name 20 "fragColor" + Decorate 20(fragColor) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 2 8(ptr) + 13: 6(float) Constant 1065353216 + 14: 7(fvec4) ConstantComposite 13 13 13 13 + 19: TypePointer Output 7(fvec4) + 20(fragColor): 19(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 15(fragColor): 8(ptr) Variable Function + 16(param): 8(ptr) Variable Function + 17: 2 FunctionCall 11(@main(vf4;) 16(param) + 18: 7(fvec4) Load 16(param) + Store 15(fragColor) 18 + 21: 7(fvec4) Load 15(fragColor) + Store 20(fragColor) 21 + Return + FunctionEnd + 11(@main(vf4;): 2 Function None 9 + 10(fragColor): 8(ptr) FunctionParameter + 12: Label + Store 10(fragColor) 14 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl b/core/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl index 8535b478a..58354a409 100644 --- a/core/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl +++ b/core/deps/glslang/Test/baseResults/compoundsuffix.vert.glsl @@ -1,15 +1,15 @@ -compoundsuffix.vert.glsl -Shader version: 100 -0:? Sequence -0:1 Function Definition: main( ( global void) -0:1 Function Parameters: -0:3 Sequence -0:3 move second child to first child ( temp highp 4-component vector of float) -0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position) -0:3 Constant: -0:3 1.000000 -0:3 1.000000 -0:3 1.000000 -0:3 1.000000 -0:? Linker Objects - +compoundsuffix.vert.glsl +Shader version: 100 +0:? Sequence +0:1 Function Definition: main( ( global void) +0:1 Function Parameters: +0:3 Sequence +0:3 move second child to first child ( temp highp 4-component vector of float) +0:3 'gl_Position' ( gl_Position highp 4-component vector of float Position) +0:3 Constant: +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:3 1.000000 +0:? Linker Objects + diff --git a/core/deps/glslang/Test/baseResults/constFold.frag.out b/core/deps/glslang/Test/baseResults/constFold.frag.out index 2a48c421e..045afc047 100644 --- a/core/deps/glslang/Test/baseResults/constFold.frag.out +++ b/core/deps/glslang/Test/baseResults/constFold.frag.out @@ -260,27 +260,27 @@ ERROR: node is still EOpNull! 0:120 1.000000 0:120 Constant: 0:120 3 (const int) -0:126 Function Definition: foo3( ( global void) -0:126 Function Parameters: -0:128 Sequence -0:128 Sequence -0:128 move second child to first child ( temp 3X2 matrix of float) -0:128 'r32' ( temp 3X2 matrix of float) -0:128 Constant: -0:128 43.000000 -0:128 64.000000 -0:128 51.000000 -0:128 76.000000 -0:128 59.000000 -0:128 88.000000 -0:138 Function Definition: foo4( ( global void) -0:138 Function Parameters: -0:140 Sequence -0:140 Sequence -0:140 move second child to first child ( temp int) -0:140 'a' ( temp int) -0:140 Constant: -0:140 9 (const int) +0:129 Function Definition: foo3( ( global void) +0:129 Function Parameters: +0:131 Sequence +0:131 Sequence +0:131 move second child to first child ( temp 3X2 matrix of float) +0:131 'r32' ( temp 3X2 matrix of float) +0:131 Constant: +0:131 43.000000 +0:131 64.000000 +0:131 51.000000 +0:131 76.000000 +0:131 59.000000 +0:131 88.000000 +0:141 Function Definition: foo4( ( global void) +0:141 Function Parameters: +0:143 Sequence +0:143 Sequence +0:143 move second child to first child ( temp int) +0:143 'a' ( temp int) +0:143 Constant: +0:143 9 (const int) 0:? Linker Objects 0:? 'a' ( const int) 0:? 1 (const int) @@ -367,6 +367,29 @@ ERROR: node is still EOpNull! 0:? 13.000000 0:? 14.000000 0:? 15.000000 +0:? 'm22' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 'mm34' ( const 3X4 matrix of float) +0:? 7.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 7.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 7.000000 +0:? 0.000000 +0:? 'mv4' ( const 4-component vector of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 0:? 'a0' ( const 3-element array of structure{ global int i, global float f, global bool b}) 0:? 3 (const int) 0:? 2.000000 @@ -635,6 +658,29 @@ ERROR: node is still EOpNull! 0:? 13.000000 0:? 14.000000 0:? 15.000000 +0:? 'm22' ( const 2X2 matrix of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:? 'mm34' ( const 3X4 matrix of float) +0:? 7.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 7.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 0.000000 +0:? 7.000000 +0:? 0.000000 +0:? 'mv4' ( const 4-component vector of float) +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 0:? 'a0' ( const 3-element array of structure{ global int i, global float f, global bool b}) 0:? 3 (const int) 0:? 2.000000 diff --git a/core/deps/glslang/Test/baseResults/cppBad.vert.out b/core/deps/glslang/Test/baseResults/cppBad.vert.out index 13a5fc1ce..aaecdf077 100644 --- a/core/deps/glslang/Test/baseResults/cppBad.vert.out +++ b/core/deps/glslang/Test/baseResults/cppBad.vert.out @@ -3,7 +3,7 @@ WARNING: 0:1: '#define' : missing space after macro name ERROR: 0:3: 'preprocessor evaluation' : bad expression ERROR: 0:3: '#if' : unexpected tokens following directive ERROR: 0:6: 'string' : End of line in string -ERROR: 0:6: '""' : string literals not supported +ERROR: 0:6: 'string literal' : required extension not requested: GL_EXT_debug_printf ERROR: 0:6: '' : syntax error, unexpected INT, expecting COMMA or SEMICOLON ERROR: 5 compilation errors. No code generated. diff --git a/core/deps/glslang/Test/baseResults/cppSimple.vert.out b/core/deps/glslang/Test/baseResults/cppSimple.vert.out index 85beb4eb5..3257856ce 100644 --- a/core/deps/glslang/Test/baseResults/cppSimple.vert.out +++ b/core/deps/glslang/Test/baseResults/cppSimple.vert.out @@ -18,8 +18,8 @@ ERROR: 0:117: '#error' : bad5 ERROR: 0:120: '#if' : unexpected tokens following directive ERROR: 0:121: '#error' : bad6 ERROR: 0:122: '#endif' : unexpected tokens following directive -ERROR: 0:135: '""' : string literals not supported -ERROR: 0:136: '""' : string literals not supported +ERROR: 0:135: 'string literal' : required extension not requested: GL_EXT_debug_printf +ERROR: 0:136: 'string literal' : required extension not requested: GL_EXT_debug_printf ERROR: 0:136: 'length' : no matching overloaded function found ERROR: 0:136: '=' : cannot convert from ' const float' to ' global int' ERROR: 0:138: ''' : character literals not supported diff --git a/core/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out b/core/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out index fabc11091..ffa96b1b1 100644 --- a/core/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out +++ b/core/deps/glslang/Test/baseResults/hlsl.gs-hs-mix.tesc.out @@ -1,7 +1,6 @@ hlsl.gs-hs-mix.tesc Shader version: 500 vertices = 3 -input primitive = triangles vertex spacing = fractional_odd_spacing triangle order = ccw 0:? Sequence @@ -402,7 +401,6 @@ Linked tessellation control stage: Shader version: 500 vertices = 3 -input primitive = triangles vertex spacing = fractional_odd_spacing triangle order = ccw 0:? Sequence diff --git a/core/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out b/core/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out index 785b083df..5277c5c4a 100644 --- a/core/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out +++ b/core/deps/glslang/Test/baseResults/hlsl.intrinsics.f1632.frag.out @@ -17,8 +17,13 @@ gl_FragCoord origin is upper left 0:7 'inF0' ( in 1-component vector of uint) 0:? Sequence 0:8 Branch: Return with expression -0:8 Constant: -0:8 0.000000 +0:8 Construct float ( temp 1-component vector of float) +0:8 direct index ( temp float) +0:8 unpackHalf2x16 ( temp 2-component vector of float) +0:8 Construct uint ( in uint) +0:8 'inF0' ( in 1-component vector of uint) +0:8 Constant: +0:8 0 (const int) 0:12 Function Definition: PixelShaderFunction2(vu2; ( temp 2-component vector of float) 0:12 Function Parameters: 0:12 'inF0' ( in 2-component vector of uint) @@ -149,8 +154,13 @@ gl_FragCoord origin is upper left 0:7 'inF0' ( in 1-component vector of uint) 0:? Sequence 0:8 Branch: Return with expression -0:8 Constant: -0:8 0.000000 +0:8 Construct float ( temp 1-component vector of float) +0:8 direct index ( temp float) +0:8 unpackHalf2x16 ( temp 2-component vector of float) +0:8 Construct uint ( in uint) +0:8 'inF0' ( in 1-component vector of uint) +0:8 Constant: +0:8 0 (const int) 0:12 Function Definition: PixelShaderFunction2(vu2; ( temp 2-component vector of float) 0:12 Function Parameters: 0:12 'inF0' ( in 2-component vector of uint) @@ -261,12 +271,12 @@ gl_FragCoord origin is upper left // Module Version 10000 // Generated by (magic number): 80008 -// Id's are bound by 103 +// Id's are bound by 106 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 101 + EntryPoint Fragment 4 "main" 104 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" @@ -281,8 +291,8 @@ gl_FragCoord origin is upper left Name 35 "PixelShaderFunction(vu4;" Name 34 "inF0" Name 38 "@main(" - Name 101 "@entryPointOutput" - Decorate 101(@entryPointOutput) Location 0 + Name 104 "@entryPointOutput" + Decorate 104(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -303,17 +313,17 @@ gl_FragCoord origin is upper left 33: TypeFunction 32(fvec4) 31(ptr) 37: TypeFunction 32(fvec4) 42: 6(int) Constant 0 - 46: 8(float) Constant 0 - 53: 6(int) Constant 1 - 69: 6(int) Constant 2 - 89: 6(int) Constant 3 - 97: 32(fvec4) ConstantComposite 46 46 46 46 - 100: TypePointer Output 32(fvec4) -101(@entryPointOutput): 100(ptr) Variable Output + 55: 6(int) Constant 1 + 71: 6(int) Constant 2 + 91: 6(int) Constant 3 + 99: 8(float) Constant 0 + 100: 32(fvec4) ConstantComposite 99 99 99 99 + 103: TypePointer Output 32(fvec4) +104(@entryPointOutput): 103(ptr) Variable Output 4(main): 2 Function None 3 5: Label - 102: 32(fvec4) FunctionCall 38(@main() - Store 101(@entryPointOutput) 102 + 105: 32(fvec4) FunctionCall 38(@main() + Store 104(@entryPointOutput) 105 Return FunctionEnd 11(PixelShaderFunctionS(u1;): 8(float) Function None 9 @@ -327,63 +337,66 @@ gl_FragCoord origin is upper left 14(PixelShaderFunction1(vu1;): 8(float) Function None 9 13(inF0): 7(ptr) FunctionParameter 15: Label - ReturnValue 46 + 46: 6(int) Load 13(inF0) + 47: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 46 + 48: 8(float) CompositeExtract 47 0 + ReturnValue 48 FunctionEnd 21(PixelShaderFunction2(vu2;): 18(fvec2) Function None 19 20(inF0): 17(ptr) FunctionParameter 22: Label - 49: 7(ptr) AccessChain 20(inF0) 42 - 50: 6(int) Load 49 - 51: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 50 - 52: 8(float) CompositeExtract 51 0 - 54: 7(ptr) AccessChain 20(inF0) 53 - 55: 6(int) Load 54 - 56: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 55 - 57: 8(float) CompositeExtract 56 0 - 58: 18(fvec2) CompositeConstruct 52 57 - ReturnValue 58 + 51: 7(ptr) AccessChain 20(inF0) 42 + 52: 6(int) Load 51 + 53: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 52 + 54: 8(float) CompositeExtract 53 0 + 56: 7(ptr) AccessChain 20(inF0) 55 + 57: 6(int) Load 56 + 58: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 57 + 59: 8(float) CompositeExtract 58 0 + 60: 18(fvec2) CompositeConstruct 54 59 + ReturnValue 60 FunctionEnd 28(PixelShaderFunction3(vu3;): 25(fvec3) Function None 26 27(inF0): 24(ptr) FunctionParameter 29: Label - 61: 7(ptr) AccessChain 27(inF0) 42 - 62: 6(int) Load 61 - 63: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 62 - 64: 8(float) CompositeExtract 63 0 - 65: 7(ptr) AccessChain 27(inF0) 53 - 66: 6(int) Load 65 - 67: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 66 - 68: 8(float) CompositeExtract 67 0 - 70: 7(ptr) AccessChain 27(inF0) 69 - 71: 6(int) Load 70 - 72: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 71 - 73: 8(float) CompositeExtract 72 0 - 74: 25(fvec3) CompositeConstruct 64 68 73 - ReturnValue 74 + 63: 7(ptr) AccessChain 27(inF0) 42 + 64: 6(int) Load 63 + 65: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 64 + 66: 8(float) CompositeExtract 65 0 + 67: 7(ptr) AccessChain 27(inF0) 55 + 68: 6(int) Load 67 + 69: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 68 + 70: 8(float) CompositeExtract 69 0 + 72: 7(ptr) AccessChain 27(inF0) 71 + 73: 6(int) Load 72 + 74: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 73 + 75: 8(float) CompositeExtract 74 0 + 76: 25(fvec3) CompositeConstruct 66 70 75 + ReturnValue 76 FunctionEnd 35(PixelShaderFunction(vu4;): 32(fvec4) Function None 33 34(inF0): 31(ptr) FunctionParameter 36: Label - 77: 7(ptr) AccessChain 34(inF0) 42 - 78: 6(int) Load 77 - 79: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 78 - 80: 8(float) CompositeExtract 79 0 - 81: 7(ptr) AccessChain 34(inF0) 53 - 82: 6(int) Load 81 - 83: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 82 - 84: 8(float) CompositeExtract 83 0 - 85: 7(ptr) AccessChain 34(inF0) 69 - 86: 6(int) Load 85 - 87: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 86 - 88: 8(float) CompositeExtract 87 0 - 90: 7(ptr) AccessChain 34(inF0) 89 - 91: 6(int) Load 90 - 92: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 91 - 93: 8(float) CompositeExtract 92 0 - 94: 32(fvec4) CompositeConstruct 80 84 88 93 - ReturnValue 94 + 79: 7(ptr) AccessChain 34(inF0) 42 + 80: 6(int) Load 79 + 81: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 80 + 82: 8(float) CompositeExtract 81 0 + 83: 7(ptr) AccessChain 34(inF0) 55 + 84: 6(int) Load 83 + 85: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 84 + 86: 8(float) CompositeExtract 85 0 + 87: 7(ptr) AccessChain 34(inF0) 71 + 88: 6(int) Load 87 + 89: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 88 + 90: 8(float) CompositeExtract 89 0 + 92: 7(ptr) AccessChain 34(inF0) 91 + 93: 6(int) Load 92 + 94: 18(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 93 + 95: 8(float) CompositeExtract 94 0 + 96: 32(fvec4) CompositeConstruct 82 86 90 95 + ReturnValue 96 FunctionEnd 38(@main(): 32(fvec4) Function None 37 39: Label - ReturnValue 97 + ReturnValue 100 FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/hlsl.semantic.geom.out b/core/deps/glslang/Test/baseResults/hlsl.semantic.geom.out index daf4eed22..29ec23515 100644 --- a/core/deps/glslang/Test/baseResults/hlsl.semantic.geom.out +++ b/core/deps/glslang/Test/baseResults/hlsl.semantic.geom.out @@ -66,6 +66,58 @@ output primitive = line_strip 0:13 Function Call: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) 0:? 'VertexID' ( temp 3-element array of uint) 0:? 'OutputStream' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:21 Function Definition: notmain(u1[2];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) +0:21 Function Parameters: +0:21 'VertexID' ( in 2-element array of uint) +0:21 'OutputStream' ( out structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:? Sequence +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp float) +0:? 'OutputStream.clip0' ( out float Position) +0:23 clip0: direct index for structure ( temp float) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 0 (const int) +0:? Sequence +0:23 move second child to first child ( temp float) +0:23 direct index ( out float ClipDistance) +0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) +0:23 Constant: +0:23 0 (const int) +0:23 clip0: direct index for structure ( temp float) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 1 (const int) +0:? Sequence +0:23 move second child to first child ( temp float) +0:23 direct index ( out float CullDistance) +0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) +0:23 Constant: +0:23 0 (const int) +0:23 cull0: direct index for structure ( temp float) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 2 (const int) +0:23 move second child to first child ( temp uint) +0:? 'OutputStream.vpai' ( out uint ViewportIndex) +0:23 vpai: direct index for structure ( temp uint) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 3 (const int) +0:23 move second child to first child ( temp uint) +0:? 'OutputStream.rtai' ( out uint Layer) +0:23 rtai: direct index for structure ( temp uint) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 4 (const int) +0:23 move second child to first child ( temp int) +0:? 'OutputStream.ii' (layout( location=0) out int) +0:23 ii: direct index for structure ( temp int) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 5 (const int) +0:23 EmitVertex ( temp void) 0:? Linker Objects 0:? 'VertexID' (layout( location=0) in 3-element array of uint) 0:? 'OutputStream.clip0' ( out float Position) @@ -146,6 +198,58 @@ output primitive = line_strip 0:13 Function Call: @main(u1[3];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) 0:? 'VertexID' ( temp 3-element array of uint) 0:? 'OutputStream' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:21 Function Definition: notmain(u1[2];struct-S-f1-f1-f1-u1-u1-i11; ( temp void) +0:21 Function Parameters: +0:21 'VertexID' ( in 2-element array of uint) +0:21 'OutputStream' ( out structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:? Sequence +0:23 Sequence +0:23 Sequence +0:23 move second child to first child ( temp float) +0:? 'OutputStream.clip0' ( out float Position) +0:23 clip0: direct index for structure ( temp float) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 0 (const int) +0:? Sequence +0:23 move second child to first child ( temp float) +0:23 direct index ( out float ClipDistance) +0:? 'OutputStream.clip0' ( out 1-element array of float ClipDistance) +0:23 Constant: +0:23 0 (const int) +0:23 clip0: direct index for structure ( temp float) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 1 (const int) +0:? Sequence +0:23 move second child to first child ( temp float) +0:23 direct index ( out float CullDistance) +0:? 'OutputStream.cull0' ( out 1-element array of float CullDistance) +0:23 Constant: +0:23 0 (const int) +0:23 cull0: direct index for structure ( temp float) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 2 (const int) +0:23 move second child to first child ( temp uint) +0:? 'OutputStream.vpai' ( out uint ViewportIndex) +0:23 vpai: direct index for structure ( temp uint) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 3 (const int) +0:23 move second child to first child ( temp uint) +0:? 'OutputStream.rtai' ( out uint Layer) +0:23 rtai: direct index for structure ( temp uint) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 4 (const int) +0:23 move second child to first child ( temp int) +0:? 'OutputStream.ii' (layout( location=0) out int) +0:23 ii: direct index for structure ( temp int) +0:23 's' ( temp structure{ temp float clip0, temp float clip0, temp float cull0, temp uint vpai, temp uint rtai, temp int ii}) +0:23 Constant: +0:23 5 (const int) +0:23 EmitVertex ( temp void) 0:? Linker Objects 0:? 'VertexID' (layout( location=0) in 3-element array of uint) 0:? 'OutputStream.clip0' ( out float Position) @@ -158,7 +262,7 @@ output primitive = line_strip Validation failed // Module Version 10000 // Generated by (magic number): 80008 -// Id's are bound by 65 +// Id's are bound by 88 Capability Geometry Capability ClipDistance @@ -166,7 +270,7 @@ Validation failed Capability MultiViewport 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Geometry 4 "main" 20 29 34 40 45 50 57 + EntryPoint Geometry 4 "main" 28 37 42 48 53 58 65 ExecutionMode 4 Triangles ExecutionMode 4 Invocations 1 ExecutionMode 4 OutputLineStrip @@ -183,25 +287,29 @@ Validation failed Name 17 "@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;" Name 15 "VertexID" Name 16 "OutputStream" - Name 20 "OutputStream.clip0" - Name 21 "s" - Name 29 "OutputStream.clip0" - Name 34 "OutputStream.cull0" - Name 40 "OutputStream.vpai" - Name 45 "OutputStream.rtai" - Name 50 "OutputStream.ii" - Name 55 "VertexID" - Name 57 "VertexID" - Name 59 "OutputStream" - Name 60 "param" - Name 62 "param" - Decorate 20(OutputStream.clip0) BuiltIn Position - Decorate 29(OutputStream.clip0) BuiltIn ClipDistance - Decorate 34(OutputStream.cull0) BuiltIn CullDistance - Decorate 40(OutputStream.vpai) BuiltIn ViewportIndex - Decorate 45(OutputStream.rtai) BuiltIn Layer - Decorate 50(OutputStream.ii) Location 0 - Decorate 57(VertexID) Location 0 + Name 25 "notmain(u1[2];struct-S-f1-f1-f1-u1-u1-i11;" + Name 23 "VertexID" + Name 24 "OutputStream" + Name 28 "OutputStream.clip0" + Name 29 "s" + Name 37 "OutputStream.clip0" + Name 42 "OutputStream.cull0" + Name 48 "OutputStream.vpai" + Name 53 "OutputStream.rtai" + Name 58 "OutputStream.ii" + Name 63 "VertexID" + Name 65 "VertexID" + Name 67 "OutputStream" + Name 68 "param" + Name 70 "param" + Name 73 "s" + Decorate 28(OutputStream.clip0) BuiltIn Position + Decorate 37(OutputStream.clip0) BuiltIn ClipDistance + Decorate 42(OutputStream.cull0) BuiltIn CullDistance + Decorate 48(OutputStream.vpai) BuiltIn ViewportIndex + Decorate 53(OutputStream.rtai) BuiltIn Layer + Decorate 58(OutputStream.ii) Location 0 + Decorate 65(VertexID) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -213,69 +321,101 @@ Validation failed 12(S): TypeStruct 10(float) 10(float) 10(float) 6(int) 6(int) 11(int) 13: TypePointer Function 12(S) 14: TypeFunction 2 9(ptr) 13(ptr) - 19: TypePointer Output 10(float) -20(OutputStream.clip0): 19(ptr) Variable Output - 22: 11(int) Constant 0 - 23: TypePointer Function 10(float) - 26: 6(int) Constant 1 - 27: TypeArray 10(float) 26 - 28: TypePointer Output 27 -29(OutputStream.clip0): 28(ptr) Variable Output - 30: 11(int) Constant 1 -34(OutputStream.cull0): 28(ptr) Variable Output - 35: 11(int) Constant 2 - 39: TypePointer Output 6(int) -40(OutputStream.vpai): 39(ptr) Variable Output - 41: 11(int) Constant 3 - 42: TypePointer Function 6(int) -45(OutputStream.rtai): 39(ptr) Variable Output - 46: 11(int) Constant 4 - 49: TypePointer Output 11(int) -50(OutputStream.ii): 49(ptr) Variable Output - 51: 11(int) Constant 5 - 52: TypePointer Function 11(int) - 56: TypePointer Input 8 - 57(VertexID): 56(ptr) Variable Input + 19: 6(int) Constant 2 + 20: TypeArray 6(int) 19 + 21: TypePointer Function 20 + 22: TypeFunction 2 21(ptr) 13(ptr) + 27: TypePointer Output 10(float) +28(OutputStream.clip0): 27(ptr) Variable Output + 30: 11(int) Constant 0 + 31: TypePointer Function 10(float) + 34: 6(int) Constant 1 + 35: TypeArray 10(float) 34 + 36: TypePointer Output 35 +37(OutputStream.clip0): 36(ptr) Variable Output + 38: 11(int) Constant 1 +42(OutputStream.cull0): 36(ptr) Variable Output + 43: 11(int) Constant 2 + 47: TypePointer Output 6(int) +48(OutputStream.vpai): 47(ptr) Variable Output + 49: 11(int) Constant 3 + 50: TypePointer Function 6(int) +53(OutputStream.rtai): 47(ptr) Variable Output + 54: 11(int) Constant 4 + 57: TypePointer Output 11(int) +58(OutputStream.ii): 57(ptr) Variable Output + 59: 11(int) Constant 5 + 60: TypePointer Function 11(int) + 64: TypePointer Input 8 + 65(VertexID): 64(ptr) Variable Input 4(main): 2 Function None 3 5: Label - 55(VertexID): 9(ptr) Variable Function -59(OutputStream): 13(ptr) Variable Function - 60(param): 9(ptr) Variable Function - 62(param): 13(ptr) Variable Function - 58: 8 Load 57(VertexID) - Store 55(VertexID) 58 - 61: 8 Load 55(VertexID) - Store 60(param) 61 - 63: 2 FunctionCall 17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;) 60(param) 62(param) - 64: 12(S) Load 62(param) - Store 59(OutputStream) 64 + 63(VertexID): 9(ptr) Variable Function +67(OutputStream): 13(ptr) Variable Function + 68(param): 9(ptr) Variable Function + 70(param): 13(ptr) Variable Function + 66: 8 Load 65(VertexID) + Store 63(VertexID) 66 + 69: 8 Load 63(VertexID) + Store 68(param) 69 + 71: 2 FunctionCall 17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;) 68(param) 70(param) + 72: 12(S) Load 70(param) + Store 67(OutputStream) 72 Return FunctionEnd 17(@main(u1[3];struct-S-f1-f1-f1-u1-u1-i11;): 2 Function None 14 15(VertexID): 9(ptr) FunctionParameter 16(OutputStream): 13(ptr) FunctionParameter 18: Label - 21(s): 13(ptr) Variable Function - 24: 23(ptr) AccessChain 21(s) 22 - 25: 10(float) Load 24 - Store 20(OutputStream.clip0) 25 - 31: 23(ptr) AccessChain 21(s) 30 - 32: 10(float) Load 31 - 33: 19(ptr) AccessChain 29(OutputStream.clip0) 22 - Store 33 32 - 36: 23(ptr) AccessChain 21(s) 35 - 37: 10(float) Load 36 - 38: 19(ptr) AccessChain 34(OutputStream.cull0) 22 - Store 38 37 - 43: 42(ptr) AccessChain 21(s) 41 - 44: 6(int) Load 43 - Store 40(OutputStream.vpai) 44 - 47: 42(ptr) AccessChain 21(s) 46 - 48: 6(int) Load 47 - Store 45(OutputStream.rtai) 48 - 53: 52(ptr) AccessChain 21(s) 51 - 54: 11(int) Load 53 - Store 50(OutputStream.ii) 54 + 29(s): 13(ptr) Variable Function + 32: 31(ptr) AccessChain 29(s) 30 + 33: 10(float) Load 32 + Store 28(OutputStream.clip0) 33 + 39: 31(ptr) AccessChain 29(s) 38 + 40: 10(float) Load 39 + 41: 27(ptr) AccessChain 37(OutputStream.clip0) 30 + Store 41 40 + 44: 31(ptr) AccessChain 29(s) 43 + 45: 10(float) Load 44 + 46: 27(ptr) AccessChain 42(OutputStream.cull0) 30 + Store 46 45 + 51: 50(ptr) AccessChain 29(s) 49 + 52: 6(int) Load 51 + Store 48(OutputStream.vpai) 52 + 55: 50(ptr) AccessChain 29(s) 54 + 56: 6(int) Load 55 + Store 53(OutputStream.rtai) 56 + 61: 60(ptr) AccessChain 29(s) 59 + 62: 11(int) Load 61 + Store 58(OutputStream.ii) 62 + EmitVertex + Return + FunctionEnd +25(notmain(u1[2];struct-S-f1-f1-f1-u1-u1-i11;): 2 Function None 22 + 23(VertexID): 21(ptr) FunctionParameter +24(OutputStream): 13(ptr) FunctionParameter + 26: Label + 73(s): 13(ptr) Variable Function + 74: 31(ptr) AccessChain 73(s) 30 + 75: 10(float) Load 74 + Store 28(OutputStream.clip0) 75 + 76: 31(ptr) AccessChain 73(s) 38 + 77: 10(float) Load 76 + 78: 27(ptr) AccessChain 37(OutputStream.clip0) 30 + Store 78 77 + 79: 31(ptr) AccessChain 73(s) 43 + 80: 10(float) Load 79 + 81: 27(ptr) AccessChain 42(OutputStream.cull0) 30 + Store 81 80 + 82: 50(ptr) AccessChain 73(s) 49 + 83: 6(int) Load 82 + Store 48(OutputStream.vpai) 83 + 84: 50(ptr) AccessChain 73(s) 54 + 85: 6(int) Load 84 + Store 53(OutputStream.rtai) 85 + 86: 60(ptr) AccessChain 73(s) 59 + 87: 11(int) Load 86 + Store 58(OutputStream.ii) 87 EmitVertex Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/hlsl.singleArgIntPromo.vert.out b/core/deps/glslang/Test/baseResults/hlsl.singleArgIntPromo.vert.out new file mode 100755 index 000000000..71c1bb2ad --- /dev/null +++ b/core/deps/glslang/Test/baseResults/hlsl.singleArgIntPromo.vert.out @@ -0,0 +1,312 @@ +hlsl.singleArgIntPromo.vert +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp int) +0:3 'd' ( temp int) +0:3 Constant: +0:3 4 (const int) +0:4 Sequence +0:4 move second child to first child ( temp 2-component vector of int) +0:4 'd2' ( temp 2-component vector of int) +0:? Construct ivec2 ( temp 2-component vector of int) +0:4 Constant: +0:4 5 (const int) +0:4 'd' ( temp int) +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'f1' ( temp float) +0:5 Constant: +0:5 2.321928 +0:6 Sequence +0:6 move second child to first child ( temp 2-component vector of float) +0:6 'f2' ( temp 2-component vector of float) +0:6 log ( temp 2-component vector of float) +0:6 Convert int to float ( temp 2-component vector of float) +0:6 'd2' ( temp 2-component vector of int) +0:7 Sequence +0:7 move second child to first child ( temp 3-component vector of float) +0:7 'f3' ( temp 3-component vector of float) +0:? Constant: +0:? 1.945910 +0:? 0.693147 +0:? 1.098612 +0:8 Sequence +0:8 move second child to first child ( temp 2-component vector of float) +0:8 'f22' ( temp 2-component vector of float) +0:8 Constant: +0:8 0.000000 +0:8 0.000000 +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'a' ( temp int) +0:10 Constant: +0:10 5 (const int) +0:11 Sequence +0:11 move second child to first child ( temp mediump float) +0:11 'b' ( temp mediump float) +0:11 direct index ( temp mediump float) +0:11 unpackHalf2x16 ( temp mediump 2-component vector of float) +0:11 Convert int to uint ( temp mediump uint) +0:11 'a' ( temp mediump int) +0:11 Constant: +0:11 0 (const int) +0:12 multiply second child into first child ( temp mediump float) +0:12 'b' ( temp mediump float) +0:12 'b' ( temp mediump float) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'c' ( temp uint) +0:13 packHalf2x16 ( temp uint) +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 'b' ( temp mediump float) +0:13 Constant: +0:13 0.000000 +0:15 Branch: Return with expression +0:15 add ( temp float) +0:15 add ( temp float) +0:15 add ( temp float) +0:15 add ( temp float) +0:15 'f1' ( temp float) +0:15 direct index ( temp float) +0:15 'f2' ( temp 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp float) +0:15 'f3' ( temp 3-component vector of float) +0:15 Constant: +0:15 2 (const int) +0:15 direct index ( temp float) +0:15 'f22' ( temp 2-component vector of float) +0:15 Constant: +0:15 1 (const int) +0:15 Convert uint to float ( temp float) +0:15 'c' ( temp uint) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:2 Function Call: @main( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) + + +Linked vertex stage: + + +Shader version: 500 +0:? Sequence +0:2 Function Definition: @main( ( temp float) +0:2 Function Parameters: +0:? Sequence +0:3 Sequence +0:3 move second child to first child ( temp int) +0:3 'd' ( temp int) +0:3 Constant: +0:3 4 (const int) +0:4 Sequence +0:4 move second child to first child ( temp 2-component vector of int) +0:4 'd2' ( temp 2-component vector of int) +0:? Construct ivec2 ( temp 2-component vector of int) +0:4 Constant: +0:4 5 (const int) +0:4 'd' ( temp int) +0:5 Sequence +0:5 move second child to first child ( temp float) +0:5 'f1' ( temp float) +0:5 Constant: +0:5 2.321928 +0:6 Sequence +0:6 move second child to first child ( temp 2-component vector of float) +0:6 'f2' ( temp 2-component vector of float) +0:6 log ( temp 2-component vector of float) +0:6 Convert int to float ( temp 2-component vector of float) +0:6 'd2' ( temp 2-component vector of int) +0:7 Sequence +0:7 move second child to first child ( temp 3-component vector of float) +0:7 'f3' ( temp 3-component vector of float) +0:? Constant: +0:? 1.945910 +0:? 0.693147 +0:? 1.098612 +0:8 Sequence +0:8 move second child to first child ( temp 2-component vector of float) +0:8 'f22' ( temp 2-component vector of float) +0:8 Constant: +0:8 0.000000 +0:8 0.000000 +0:10 Sequence +0:10 move second child to first child ( temp int) +0:10 'a' ( temp int) +0:10 Constant: +0:10 5 (const int) +0:11 Sequence +0:11 move second child to first child ( temp mediump float) +0:11 'b' ( temp mediump float) +0:11 direct index ( temp mediump float) +0:11 unpackHalf2x16 ( temp mediump 2-component vector of float) +0:11 Convert int to uint ( temp mediump uint) +0:11 'a' ( temp mediump int) +0:11 Constant: +0:11 0 (const int) +0:12 multiply second child into first child ( temp mediump float) +0:12 'b' ( temp mediump float) +0:12 'b' ( temp mediump float) +0:13 Sequence +0:13 move second child to first child ( temp uint) +0:13 'c' ( temp uint) +0:13 packHalf2x16 ( temp uint) +0:13 Construct vec2 ( temp 2-component vector of float) +0:13 'b' ( temp mediump float) +0:13 Constant: +0:13 0.000000 +0:15 Branch: Return with expression +0:15 add ( temp float) +0:15 add ( temp float) +0:15 add ( temp float) +0:15 add ( temp float) +0:15 'f1' ( temp float) +0:15 direct index ( temp float) +0:15 'f2' ( temp 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:15 direct index ( temp float) +0:15 'f3' ( temp 3-component vector of float) +0:15 Constant: +0:15 2 (const int) +0:15 direct index ( temp float) +0:15 'f22' ( temp 2-component vector of float) +0:15 Constant: +0:15 1 (const int) +0:15 Convert uint to float ( temp float) +0:15 'c' ( temp uint) +0:2 Function Definition: main( ( temp void) +0:2 Function Parameters: +0:? Sequence +0:2 move second child to first child ( temp float) +0:? '@entryPointOutput' (layout( location=0) out float) +0:2 Function Call: @main( ( temp float) +0:? Linker Objects +0:? '@entryPointOutput' (layout( location=0) out float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 75 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 73 + Source HLSL 500 + Name 4 "main" + Name 8 "@main(" + Name 12 "d" + Name 16 "d2" + Name 21 "f1" + Name 25 "f2" + Name 31 "f3" + Name 36 "f22" + Name 39 "a" + Name 40 "b" + Name 51 "c" + Name 73 "@entryPointOutput" + Decorate 40(b) RelaxedPrecision + Decorate 41 RelaxedPrecision + Decorate 43 RelaxedPrecision + Decorate 44 RelaxedPrecision + Decorate 46 RelaxedPrecision + Decorate 47 RelaxedPrecision + Decorate 48 RelaxedPrecision + Decorate 49 RelaxedPrecision + Decorate 52 RelaxedPrecision + Decorate 73(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeFunction 6(float) + 10: TypeInt 32 1 + 11: TypePointer Function 10(int) + 13: 10(int) Constant 4 + 14: TypeVector 10(int) 2 + 15: TypePointer Function 14(ivec2) + 17: 10(int) Constant 5 + 20: TypePointer Function 6(float) + 22: 6(float) Constant 1075092088 + 23: TypeVector 6(float) 2 + 24: TypePointer Function 23(fvec2) + 29: TypeVector 6(float) 3 + 30: TypePointer Function 29(fvec3) + 32: 6(float) Constant 1073288085 + 33: 6(float) Constant 1060205080 + 34: 6(float) Constant 1066180436 + 35: 29(fvec3) ConstantComposite 32 33 34 + 37: 6(float) Constant 0 + 38: 23(fvec2) ConstantComposite 37 37 + 42: TypeInt 32 0 + 45: 42(int) Constant 0 + 50: TypePointer Function 42(int) + 59: 42(int) Constant 2 + 63: 42(int) Constant 1 + 72: TypePointer Output 6(float) +73(@entryPointOutput): 72(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 74: 6(float) FunctionCall 8(@main() + Store 73(@entryPointOutput) 74 + Return + FunctionEnd + 8(@main(): 6(float) Function None 7 + 9: Label + 12(d): 11(ptr) Variable Function + 16(d2): 15(ptr) Variable Function + 21(f1): 20(ptr) Variable Function + 25(f2): 24(ptr) Variable Function + 31(f3): 30(ptr) Variable Function + 36(f22): 24(ptr) Variable Function + 39(a): 11(ptr) Variable Function + 40(b): 20(ptr) Variable Function + 51(c): 50(ptr) Variable Function + Store 12(d) 13 + 18: 10(int) Load 12(d) + 19: 14(ivec2) CompositeConstruct 17 18 + Store 16(d2) 19 + Store 21(f1) 22 + 26: 14(ivec2) Load 16(d2) + 27: 23(fvec2) ConvertSToF 26 + 28: 23(fvec2) ExtInst 1(GLSL.std.450) 28(Log) 27 + Store 25(f2) 28 + Store 31(f3) 35 + Store 36(f22) 38 + Store 39(a) 17 + 41: 10(int) Load 39(a) + 43: 42(int) Bitcast 41 + 44: 23(fvec2) ExtInst 1(GLSL.std.450) 62(UnpackHalf2x16) 43 + 46: 6(float) CompositeExtract 44 0 + Store 40(b) 46 + 47: 6(float) Load 40(b) + 48: 6(float) Load 40(b) + 49: 6(float) FMul 48 47 + Store 40(b) 49 + 52: 6(float) Load 40(b) + 53: 23(fvec2) CompositeConstruct 52 37 + 54: 42(int) ExtInst 1(GLSL.std.450) 58(PackHalf2x16) 53 + Store 51(c) 54 + 55: 6(float) Load 21(f1) + 56: 20(ptr) AccessChain 25(f2) 45 + 57: 6(float) Load 56 + 58: 6(float) FAdd 55 57 + 60: 20(ptr) AccessChain 31(f3) 59 + 61: 6(float) Load 60 + 62: 6(float) FAdd 58 61 + 64: 20(ptr) AccessChain 36(f22) 63 + 65: 6(float) Load 64 + 66: 6(float) FAdd 62 65 + 67: 42(int) Load 51(c) + 68: 6(float) ConvertUToF 67 + 69: 6(float) FAdd 66 68 + ReturnValue 69 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out b/core/deps/glslang/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out new file mode 100755 index 000000000..b8ba78912 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.multiAnonBlocksInvalid.0.0.vert.out @@ -0,0 +1,177 @@ +link.multiAnonBlocksInvalid.0.0.vert +ERROR: 0:22: 'ColorBlock' : nameless block contains a member that already has a name at global scope +ERROR: 0:42: 'v1' : redefinition +ERROR: 0:43: 'uProj' : redefinition +ERROR: 3 compilation errors. No code generated. + + +Shader version: 430 +ERROR: node is still EOpNull! +0:46 Function Definition: main( ( global void) +0:46 Function Parameters: +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'oColor' ( smooth out 4-component vector of float) +0:48 component-wise multiply ( temp 4-component vector of float) +0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:48 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:48 Constant: +0:48 0 (const uint) +0:48 Function Call: getColor2( ( global 4-component vector of float) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 v1: direct index for structure ( out 4-component vector of float) +0:49 'anon@2' ( out block{ out 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:49 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:49 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:51 move second child to first child ( temp 4-component vector of float) +0:51 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:51 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:51 Constant: +0:51 0 (const uint) +0:51 matrix-times-vector ( temp 4-component vector of float) +0:51 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:51 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:51 Constant: +0:51 0 (const uint) +0:51 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1}) +0:? 'myName' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiAnonBlocksInvalid.0.1.vert +Shader version: 430 +0:? Sequence +0:38 Function Definition: getColor2( ( global 4-component vector of float) +0:38 Function Parameters: +0:40 Sequence +0:40 Branch: Return with expression +0:40 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:40 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:40 Constant: +0:40 0 (const uint) +0:43 Function Definition: getWorld( ( global 4-component vector of float) +0:43 Function Parameters: +0:45 Sequence +0:45 Branch: Return with expression +0:45 matrix-times-vector ( temp 4-component vector of float) +0:45 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:45 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:45 Constant: +0:45 1 (const uint) +0:45 'P' ( in 4-component vector of float) +0:46 move second child to first child ( temp 4-component vector of float) +0:46 v2: direct index for structure ( out 4-component vector of float) +0:46 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:? 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'anon@3' (layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float a}) +0:? 'anon@4' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Types must match: + anon@0: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}" versus anon@1: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}" +ERROR: Linking vertex stage: Types must match: + anon@2: " out block{ out 4-component vector of float v1}" versus " out block{ out 4-component vector of float v1, out 4-component vector of float v2}" +ERROR: Linking vertex stage: Types must match: + anon@1: "layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}" versus anon@3: "layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float a}" +ERROR: Linking vertex stage: Matched Uniform or Storage blocks must all be anonymous, or all be named: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + myName: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}" versus anon@4: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}" + +Shader version: 430 +ERROR: node is still EOpNull! +0:46 Function Definition: main( ( global void) +0:46 Function Parameters: +0:48 Sequence +0:48 move second child to first child ( temp 4-component vector of float) +0:48 'oColor' ( smooth out 4-component vector of float) +0:48 component-wise multiply ( temp 4-component vector of float) +0:48 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:48 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:48 Constant: +0:48 0 (const uint) +0:48 Function Call: getColor2( ( global 4-component vector of float) +0:49 move second child to first child ( temp 4-component vector of float) +0:49 v1: direct index for structure ( out 4-component vector of float) +0:49 'anon@2' ( out block{ out 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:49 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:49 'anon@3' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2, layout( column_major std140 offset=32) uniform 4-component vector of float v1}) +0:49 Constant: +0:49 0 (const uint) +0:51 move second child to first child ( temp 4-component vector of float) +0:51 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:51 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:51 Constant: +0:51 0 (const uint) +0:51 matrix-times-vector ( temp 4-component vector of float) +0:51 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:51 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:51 Constant: +0:51 0 (const uint) +0:51 Function Call: getWorld( ( global 4-component vector of float) +0:38 Function Definition: getColor2( ( global 4-component vector of float) +0:38 Function Parameters: +0:40 Sequence +0:40 Branch: Return with expression +0:40 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:40 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:40 Constant: +0:40 0 (const uint) +0:43 Function Definition: getWorld( ( global 4-component vector of float) +0:43 Function Parameters: +0:45 Sequence +0:45 Branch: Return with expression +0:45 matrix-times-vector ( temp 4-component vector of float) +0:45 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:45 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:45 Constant: +0:45 1 (const uint) +0:45 'P' ( in 4-component vector of float) +0:46 move second child to first child ( temp 4-component vector of float) +0:46 v2: direct index for structure ( out 4-component vector of float) +0:46 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:46 Constant: +0:46 1 (const uint) +0:46 Constant: +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:46 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'anon@1' (layout( column_major shared) buffer block{layout( column_major shared) buffer 4-component vector of float b}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1}) +0:? 'myName' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float m}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@4' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:? 'P' ( in 4-component vector of float) + diff --git a/core/deps/glslang/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out b/core/deps/glslang/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out new file mode 100755 index 000000000..87c31b1eb --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.multiAnonBlocksValid.0.0.vert.out @@ -0,0 +1,157 @@ +link.multiAnonBlocksValid.0.0.vert +Shader version: 430 +0:? Sequence +0:32 Function Definition: main( ( global void) +0:32 Function Parameters: +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'oColor' ( smooth out 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:34 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:34 Constant: +0:34 0 (const uint) +0:34 Function Call: getColor2( ( global 4-component vector of float) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 v1: direct index for structure ( out 4-component vector of float) +0:35 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:35 Constant: +0:35 0 (const uint) +0:35 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:35 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:35 Constant: +0:35 0 (const uint) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:37 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:37 Constant: +0:37 0 (const uint) +0:37 matrix-times-vector ( temp 4-component vector of float) +0:37 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:37 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:37 Constant: +0:37 0 (const uint) +0:37 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiAnonBlocksValid.0.1.vert +Shader version: 430 +0:? Sequence +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const uint) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const uint) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 430 +0:? Sequence +0:32 Function Definition: main( ( global void) +0:32 Function Parameters: +0:34 Sequence +0:34 move second child to first child ( temp 4-component vector of float) +0:34 'oColor' ( smooth out 4-component vector of float) +0:34 component-wise multiply ( temp 4-component vector of float) +0:34 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:34 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:34 Constant: +0:34 0 (const uint) +0:34 Function Call: getColor2( ( global 4-component vector of float) +0:35 move second child to first child ( temp 4-component vector of float) +0:35 v1: direct index for structure ( out 4-component vector of float) +0:35 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:35 Constant: +0:35 0 (const uint) +0:35 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:35 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:35 Constant: +0:35 0 (const uint) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:37 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:37 Constant: +0:37 0 (const uint) +0:37 matrix-times-vector ( temp 4-component vector of float) +0:37 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:37 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:37 Constant: +0:37 0 (const uint) +0:37 Function Call: getWorld( ( global 4-component vector of float) +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const uint) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'anon@1' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const uint) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'anon@2' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const uint) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'anon@1' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'anon@2' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@3' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'P' ( in 4-component vector of float) + diff --git a/core/deps/glslang/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out b/core/deps/glslang/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out new file mode 100755 index 000000000..12b5c4326 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.multiBlocksInvalid.0.0.vert.out @@ -0,0 +1,182 @@ +link.multiBlocksInvalid.0.0.vert +Shader version: 430 +0:? Sequence +0:34 Function Definition: main( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of float) +0:36 'oColor' ( smooth out 4-component vector of float) +0:36 component-wise multiply ( temp 4-component vector of float) +0:36 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:36 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:36 Constant: +0:36 0 (const int) +0:36 Function Call: getColor2( ( global 4-component vector of float) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 v1: direct index for structure ( out 4-component vector of float) +0:37 'oV' ( out block{ out 4-component vector of float v1}) +0:37 Constant: +0:37 0 (const int) +0:37 add ( temp 4-component vector of float) +0:37 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:37 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:37 color1: direct index for structure (layout( column_major std430 offset=0) buffer 4-component vector of float) +0:37 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:39 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:39 Constant: +0:39 0 (const uint) +0:39 matrix-times-vector ( temp 4-component vector of float) +0:39 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:39 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:39 Constant: +0:39 0 (const int) +0:39 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'oV' ( out block{ out 4-component vector of float v1}) +0:? 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:? 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiBlocksInvalid.0.1.vert +Shader version: 430 +0:? Sequence +0:21 Function Definition: getColor2( ( global 4-component vector of float) +0:21 Function Parameters: +0:23 Sequence +0:23 Branch: Return with expression +0:23 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:23 'uColorB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:23 Constant: +0:23 0 (const int) +0:26 Function Definition: getWorld( ( global 4-component vector of float) +0:26 Function Parameters: +0:28 Sequence +0:28 Branch: Return with expression +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 uWorld: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:28 'uDefaultB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}) +0:28 Constant: +0:28 0 (const int) +0:28 'P' ( in 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v2: direct index for structure ( out 4-component vector of float) +0:29 'oVert' ( out block{ out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:? Linker Objects +0:? 'uColorB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:? 'uDefaultB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}) +0:? 'oVert' ( out block{ out 4-component vector of float v2}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Types must match: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uC: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}" versus uColorB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}" +ERROR: Linking vertex stage: Types must match: +ERROR: Linking vertex stage: Storage qualifiers must match: +ERROR: Linking vertex stage: Layout qualification must match: + uBufC: "layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}" versus uColorB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}" +ERROR: Linking vertex stage: Types must match: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uD: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}" versus uDefaultB: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}" +ERROR: Linking vertex stage: Types must match: +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + oV: " out block{ out 4-component vector of float v1}" versus oVert: " out block{ out 4-component vector of float v2}" + +Shader version: 430 +0:? Sequence +0:34 Function Definition: main( ( global void) +0:34 Function Parameters: +0:36 Sequence +0:36 move second child to first child ( temp 4-component vector of float) +0:36 'oColor' ( smooth out 4-component vector of float) +0:36 component-wise multiply ( temp 4-component vector of float) +0:36 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:36 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:36 Constant: +0:36 0 (const int) +0:36 Function Call: getColor2( ( global 4-component vector of float) +0:37 move second child to first child ( temp 4-component vector of float) +0:37 v1: direct index for structure ( out 4-component vector of float) +0:37 'oV' ( out block{ out 4-component vector of float v1}) +0:37 Constant: +0:37 0 (const int) +0:37 add ( temp 4-component vector of float) +0:37 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:37 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:37 color1: direct index for structure (layout( column_major std430 offset=0) buffer 4-component vector of float) +0:37 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) +0:37 Constant: +0:37 0 (const int) +0:39 move second child to first child ( temp 4-component vector of float) +0:39 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:39 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:39 Constant: +0:39 0 (const uint) +0:39 matrix-times-vector ( temp 4-component vector of float) +0:39 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:39 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:39 Constant: +0:39 0 (const int) +0:39 Function Call: getWorld( ( global 4-component vector of float) +0:21 Function Definition: getColor2( ( global 4-component vector of float) +0:21 Function Parameters: +0:23 Sequence +0:23 Branch: Return with expression +0:23 color2: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:23 'uColorB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color2}) +0:23 Constant: +0:23 0 (const int) +0:26 Function Definition: getWorld( ( global 4-component vector of float) +0:26 Function Parameters: +0:28 Sequence +0:28 Branch: Return with expression +0:28 matrix-times-vector ( temp 4-component vector of float) +0:28 uWorld: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:28 'uDefaultB' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uWorld}) +0:28 Constant: +0:28 0 (const int) +0:28 'P' ( in 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v2: direct index for structure ( out 4-component vector of float) +0:29 'oVert' ( out block{ out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 Constant: +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:29 1.000000 +0:? Linker Objects +0:? 'uD' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj}) +0:? 'oV' ( out block{ out 4-component vector of float v1}) +0:? 'uC' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1}) +0:? 'uBufC' (layout( column_major std430) buffer block{layout( column_major std430 offset=0) buffer 4-component vector of float color1}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'P' ( in 4-component vector of float) + diff --git a/core/deps/glslang/Test/baseResults/link.multiBlocksValid.1.0.vert.out b/core/deps/glslang/Test/baseResults/link.multiBlocksValid.1.0.vert.out new file mode 100755 index 000000000..2f32abd25 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.multiBlocksValid.1.0.vert.out @@ -0,0 +1,163 @@ +link.multiBlocksValid.1.0.vert +Shader version: 430 +0:? Sequence +0:26 Function Definition: main( ( global void) +0:26 Function Parameters: +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'oColor' ( smooth out 4-component vector of float) +0:28 component-wise multiply ( temp 4-component vector of float) +0:28 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:28 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:28 Constant: +0:28 0 (const int) +0:28 Function Call: getColor2( ( global 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v1: direct index for structure ( out 4-component vector of float) +0:29 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:29 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:29 Constant: +0:29 0 (const int) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:31 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:31 Constant: +0:31 0 (const uint) +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:31 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 0 (const int) +0:31 Function Call: getWorld( ( global 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out unsized 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.multiBlocksValid.1.1.vert +Shader version: 430 +0:? Sequence +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const int) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'b' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const int) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'c' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'b' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'c' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'P' ( in 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + c: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}" versus a: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + a: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}" versus b: "layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + b: " out block{ out 4-component vector of float v1, out 4-component vector of float v2}" versus c: " out block{ out 4-component vector of float v1, out 4-component vector of float v2}" + +Shader version: 430 +0:? Sequence +0:26 Function Definition: main( ( global void) +0:26 Function Parameters: +0:28 Sequence +0:28 move second child to first child ( temp 4-component vector of float) +0:28 'oColor' ( smooth out 4-component vector of float) +0:28 component-wise multiply ( temp 4-component vector of float) +0:28 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:28 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:28 Constant: +0:28 0 (const int) +0:28 Function Call: getColor2( ( global 4-component vector of float) +0:29 move second child to first child ( temp 4-component vector of float) +0:29 v1: direct index for structure ( out 4-component vector of float) +0:29 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:29 Constant: +0:29 0 (const int) +0:29 color1: direct index for structure (layout( column_major std140 offset=0) uniform 4-component vector of float) +0:29 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:29 Constant: +0:29 0 (const int) +0:31 move second child to first child ( temp 4-component vector of float) +0:31 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:31 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:31 Constant: +0:31 0 (const uint) +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uProj: direct index for structure (layout( column_major std140 offset=0) uniform 4X4 matrix of float) +0:31 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 0 (const int) +0:31 Function Call: getWorld( ( global 4-component vector of float) +0:24 Function Definition: getColor2( ( global 4-component vector of float) +0:24 Function Parameters: +0:26 Sequence +0:26 Branch: Return with expression +0:26 color2: direct index for structure (layout( column_major std140 offset=16) uniform 4-component vector of float) +0:26 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:26 Constant: +0:26 1 (const int) +0:29 Function Definition: getWorld( ( global 4-component vector of float) +0:29 Function Parameters: +0:31 Sequence +0:31 Branch: Return with expression +0:31 matrix-times-vector ( temp 4-component vector of float) +0:31 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform 4X4 matrix of float) +0:31 'b' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:31 Constant: +0:31 1 (const int) +0:31 'P' ( in 4-component vector of float) +0:32 move second child to first child ( temp 4-component vector of float) +0:32 v2: direct index for structure ( out 4-component vector of float) +0:32 'c' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:32 Constant: +0:32 1 (const int) +0:32 Constant: +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:32 1.000000 +0:? Linker Objects +0:? 'a' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform 4X4 matrix of float uWorld}) +0:? 'b' ( out block{ out 4-component vector of float v1, out 4-component vector of float v2}) +0:? 'c' (layout( column_major std140) uniform block{layout( column_major std140 offset=0) uniform 4-component vector of float color1, layout( column_major std140 offset=16) uniform 4-component vector of float color2}) +0:? 'oColor' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:? 'P' ( in 4-component vector of float) + diff --git a/core/deps/glslang/Test/baseResults/link.vk.differentPC.0.0.frag.out b/core/deps/glslang/Test/baseResults/link.vk.differentPC.0.0.frag.out new file mode 100755 index 000000000..d7cfd2207 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.differentPC.0.0.frag.out @@ -0,0 +1,95 @@ +link.vk.differentPC.0.0.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp highp 4-component vector of float) +0:17 'color' (layout( location=0) out highp 4-component vector of float) +0:17 add ( temp highp 4-component vector of float) +0:17 color: direct index for structure (layout( column_major std430 offset=0) uniform highp 4-component vector of float) +0:17 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:17 Constant: +0:17 0 (const int) +0:17 vector-scale ( temp highp 4-component vector of float) +0:17 Function Call: getColor2( ( global highp 4-component vector of float) +0:17 Function Call: getScale( ( global highp float) +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +link.vk.differentPC.0.1.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: getColor2( ( global highp 4-component vector of float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 color2: direct index for structure (layout( column_major std430 offset=16) uniform highp 4-component vector of float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +link.vk.differentPC.0.2.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: getScale( ( global highp float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 scale2: direct index for structure (layout( column_major std430 offset=32) uniform highp float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale2}) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale2}) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Types must match: + uPC: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}" versus "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale2}" + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp highp 4-component vector of float) +0:17 'color' (layout( location=0) out highp 4-component vector of float) +0:17 add ( temp highp 4-component vector of float) +0:17 color: direct index for structure (layout( column_major std430 offset=0) uniform highp 4-component vector of float) +0:17 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:17 Constant: +0:17 0 (const int) +0:17 vector-scale ( temp highp 4-component vector of float) +0:17 Function Call: getColor2( ( global highp 4-component vector of float) +0:17 Function Call: getScale( ( global highp float) +0:11 Function Definition: getColor2( ( global highp 4-component vector of float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 color2: direct index for structure (layout( column_major std430 offset=16) uniform highp 4-component vector of float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 1 (const int) +0:11 Function Definition: getScale( ( global highp float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 scale2: direct index for structure (layout( column_major std430 offset=32) uniform highp float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale2}) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +Validation failed +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/link.vk.differentPC.1.0.frag.out b/core/deps/glslang/Test/baseResults/link.vk.differentPC.1.0.frag.out new file mode 100755 index 000000000..632f18b13 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.differentPC.1.0.frag.out @@ -0,0 +1,97 @@ +link.vk.differentPC.1.0.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: getScale( ( global highp float) +0:12 Function Parameters: +0:14 Sequence +0:14 Branch: Return with expression +0:14 scale: direct index for structure (layout( column_major std430 offset=32) uniform highp float) +0:14 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale, layout( column_major std430 offset=36) uniform highp float scale2}) +0:14 Constant: +0:14 2 (const int) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale, layout( column_major std430 offset=36) uniform highp float scale2}) + +link.vk.differentPC.1.1.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: getColor2( ( global highp 4-component vector of float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 color2: direct index for structure (layout( column_major std430 offset=16) uniform highp 4-component vector of float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +link.vk.differentPC.1.2.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp highp 4-component vector of float) +0:17 'color' (layout( location=0) out highp 4-component vector of float) +0:17 add ( temp highp 4-component vector of float) +0:17 color: direct index for structure (layout( column_major std430 offset=0) uniform highp 4-component vector of float) +0:17 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:17 Constant: +0:17 0 (const int) +0:17 vector-scale ( temp highp 4-component vector of float) +0:17 Function Call: getColor2( ( global highp 4-component vector of float) +0:17 Function Call: getScale( ( global highp float) +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + + +Linked fragment stage: + +ERROR: Linking fragment stage: Types must match: + uPC: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale, layout( column_major std430 offset=36) uniform highp float scale2}" versus "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}" +ERROR: Linking fragment stage: Types must match: + uPC: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale, layout( column_major std430 offset=36) uniform highp float scale2}" versus "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}" + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: getScale( ( global highp float) +0:12 Function Parameters: +0:14 Sequence +0:14 Branch: Return with expression +0:14 scale: direct index for structure (layout( column_major std430 offset=32) uniform highp float) +0:14 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale, layout( column_major std430 offset=36) uniform highp float scale2}) +0:14 Constant: +0:14 2 (const int) +0:11 Function Definition: getColor2( ( global highp 4-component vector of float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 color2: direct index for structure (layout( column_major std430 offset=16) uniform highp 4-component vector of float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 1 (const int) +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp highp 4-component vector of float) +0:17 'color' (layout( location=0) out highp 4-component vector of float) +0:17 add ( temp highp 4-component vector of float) +0:17 color: direct index for structure (layout( column_major std430 offset=0) uniform highp 4-component vector of float) +0:17 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:17 Constant: +0:17 0 (const int) +0:17 vector-scale ( temp highp 4-component vector of float) +0:17 Function Call: getColor2( ( global highp 4-component vector of float) +0:17 Function Call: getScale( ( global highp float) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale, layout( column_major std430 offset=36) uniform highp float scale2}) +0:? 'color' (layout( location=0) out highp 4-component vector of float) + +Validation failed +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/link.vk.matchingPC.0.0.frag.out b/core/deps/glslang/Test/baseResults/link.vk.matchingPC.0.0.frag.out new file mode 100755 index 000000000..1d6875a06 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.matchingPC.0.0.frag.out @@ -0,0 +1,155 @@ +link.vk.matchingPC.0.0.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp highp 4-component vector of float) +0:17 'color' (layout( location=0) out highp 4-component vector of float) +0:17 add ( temp highp 4-component vector of float) +0:17 color: direct index for structure (layout( column_major std430 offset=0) uniform highp 4-component vector of float) +0:17 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:17 Constant: +0:17 0 (const int) +0:17 vector-scale ( temp highp 4-component vector of float) +0:17 Function Call: getColor2( ( global highp 4-component vector of float) +0:17 Function Call: getScale( ( global highp float) +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +link.vk.matchingPC.0.1.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: getColor2( ( global highp 4-component vector of float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 color2: direct index for structure (layout( column_major std430 offset=16) uniform highp 4-component vector of float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 1 (const int) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +link.vk.matchingPC.0.2.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:11 Function Definition: getScale( ( global highp float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 scale: direct index for structure (layout( column_major std430 offset=32) uniform highp float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 move second child to first child ( temp highp 4-component vector of float) +0:17 'color' (layout( location=0) out highp 4-component vector of float) +0:17 add ( temp highp 4-component vector of float) +0:17 color: direct index for structure (layout( column_major std430 offset=0) uniform highp 4-component vector of float) +0:17 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:17 Constant: +0:17 0 (const int) +0:17 vector-scale ( temp highp 4-component vector of float) +0:17 Function Call: getColor2( ( global highp 4-component vector of float) +0:17 Function Call: getScale( ( global highp float) +0:11 Function Definition: getColor2( ( global highp 4-component vector of float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 color2: direct index for structure (layout( column_major std430 offset=16) uniform highp 4-component vector of float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 1 (const int) +0:11 Function Definition: getScale( ( global highp float) +0:11 Function Parameters: +0:13 Sequence +0:13 Branch: Return with expression +0:13 scale: direct index for structure (layout( column_major std430 offset=32) uniform highp float) +0:13 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) +0:13 Constant: +0:13 2 (const int) +0:? Linker Objects +0:? 'color' (layout( location=0) out highp 4-component vector of float) +0:? 'uPC' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4-component vector of float color, layout( column_major std430 offset=16) uniform highp 4-component vector of float color2, layout( column_major std430 offset=32) uniform highp float scale}) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 15 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + Name 4 "main" + Name 9 "getColor2(" + Name 12 "getScale(" + Name 15 "color" + Name 16 "PushConstantBlock" + MemberName 16(PushConstantBlock) 0 "color" + MemberName 16(PushConstantBlock) 1 "color2" + MemberName 16(PushConstantBlock) 2 "scale" + Name 18 "uPC" + Decorate 15(color) Location 0 + MemberDecorate 16(PushConstantBlock) 0 Offset 0 + MemberDecorate 16(PushConstantBlock) 1 Offset 16 + MemberDecorate 16(PushConstantBlock) 2 Offset 32 + Decorate 16(PushConstantBlock) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeFunction 6(float) + 14: TypePointer Output 7(fvec4) + 15(color): 14(ptr) Variable Output +16(PushConstantBlock): TypeStruct 7(fvec4) 7(fvec4) 6(float) + 17: TypePointer PushConstant 16(PushConstantBlock) + 18(uPC): 17(ptr) Variable PushConstant + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypePointer PushConstant 7(fvec4) + 28: 19(int) Constant 1 + 33: 19(int) Constant 2 + 34: TypePointer PushConstant 6(float) + 4(main): 2 Function None 3 + 5: Label + 22: 21(ptr) AccessChain 18(uPC) 20 + 23: 7(fvec4) Load 22 + 24: 7(fvec4) FunctionCall 9(getColor2() + 25: 6(float) FunctionCall 12(getScale() + 26: 7(fvec4) VectorTimesScalar 24 25 + 27: 7(fvec4) FAdd 23 26 + Store 15(color) 27 + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 29: 21(ptr) AccessChain 18(uPC) 28 + 30: 7(fvec4) Load 29 + ReturnValue 30 + FunctionEnd + 12(getScale(): 6(float) Function None 11 + 13: Label + 35: 34(ptr) AccessChain 18(uPC) 33 + 36: 6(float) Load 35 + ReturnValue 36 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out b/core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out new file mode 100755 index 000000000..6440a3b5d --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.0.0.vert.out @@ -0,0 +1,321 @@ +link.vk.multiBlocksValid.0.0.vert +Shader version: 430 +0:? Sequence +0:43 Function Definition: main( ( global void) +0:43 Function Parameters: +0:45 Sequence +0:45 move second child to first child ( temp highp 4-component vector of float) +0:45 'oColor' ( smooth out highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:45 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:45 Constant: +0:45 0 (const int) +0:45 Function Call: getColor2( ( global highp 4-component vector of float) +0:45 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) +0:45 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 v1: direct index for structure ( out highp 4-component vector of float) +0:46 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:46 Constant: +0:46 0 (const int) +0:46 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:46 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 0 (const int) +0:48 move second child to first child ( temp highp 4-component vector of float) +0:48 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:48 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:48 Constant: +0:48 0 (const uint) +0:48 matrix-times-vector ( temp highp 4-component vector of float) +0:48 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:48 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:48 Constant: +0:48 0 (const int) +0:48 Function Call: getWorld( ( global highp 4-component vector of float) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) + +link.vk.multiBlocksValid.0.1.vert +Shader version: 430 +0:? Sequence +0:36 Function Definition: getColor2( ( global highp 4-component vector of float) +0:36 Function Parameters: +0:38 Sequence +0:38 Branch: Return with expression +0:38 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:38 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:38 Constant: +0:38 2 (const int) +0:41 Function Definition: getWorld( ( global highp 4-component vector of float) +0:41 Function Parameters: +0:43 Sequence +0:43 move second child to first child ( temp highp 4-component vector of float) +0:43 v1: direct index for structure ( out highp 4-component vector of float) +0:43 'anon@0' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:43 Constant: +0:43 0 (const uint) +0:43 Constant: +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:44 Branch: Return with expression +0:44 matrix-times-vector ( temp highp 4-component vector of float) +0:44 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:44 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:44 Constant: +0:44 1 (const int) +0:44 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuffer' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'anon@0' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:? 'P' ( in highp 4-component vector of float) + + +Linked vertex stage: + +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uC: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" versus uColor: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uBuf: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" versus uBuffer: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + uM: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" versus uMatrix: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + oV: " out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}" versus anon@0: " out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}" + +Shader version: 430 +0:? Sequence +0:43 Function Definition: main( ( global void) +0:43 Function Parameters: +0:45 Sequence +0:45 move second child to first child ( temp highp 4-component vector of float) +0:45 'oColor' ( smooth out highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 component-wise multiply ( temp highp 4-component vector of float) +0:45 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:45 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:45 Constant: +0:45 0 (const int) +0:45 Function Call: getColor2( ( global highp 4-component vector of float) +0:45 c: direct index for structure (layout( column_major std430 offset=0) buffer highp 4-component vector of float) +0:45 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:45 Constant: +0:45 0 (const int) +0:46 move second child to first child ( temp highp 4-component vector of float) +0:46 v1: direct index for structure ( out highp 4-component vector of float) +0:46 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:46 Constant: +0:46 0 (const int) +0:46 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:46 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 0 (const int) +0:48 move second child to first child ( temp highp 4-component vector of float) +0:48 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:48 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:48 Constant: +0:48 0 (const uint) +0:48 matrix-times-vector ( temp highp 4-component vector of float) +0:48 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:48 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:48 Constant: +0:48 0 (const int) +0:48 Function Call: getWorld( ( global highp 4-component vector of float) +0:36 Function Definition: getColor2( ( global highp 4-component vector of float) +0:36 Function Parameters: +0:38 Sequence +0:38 Branch: Return with expression +0:38 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:38 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:38 Constant: +0:38 2 (const int) +0:41 Function Definition: getWorld( ( global highp 4-component vector of float) +0:41 Function Parameters: +0:43 Sequence +0:43 move second child to first child ( temp highp 4-component vector of float) +0:43 v1: direct index for structure ( out highp 4-component vector of float) +0:43 'anon@0' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:43 Constant: +0:43 0 (const uint) +0:43 Constant: +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:43 1.000000 +0:44 Branch: Return with expression +0:44 matrix-times-vector ( temp highp 4-component vector of float) +0:44 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:44 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:44 Constant: +0:44 1 (const int) +0:44 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'oV' ( out block{ out highp 4-component vector of float v1, out highp 4-component vector of float v2}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uColorBuf' (layout( binding=0 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4-component vector of float c}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'P' ( in highp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 73 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 34 42 65 + Source GLSL 430 + Name 4 "main" + Name 9 "getColor2(" + Name 11 "getWorld(" + Name 14 "oColor" + Name 16 "ColorBlock" + MemberName 16(ColorBlock) 0 "color1" + MemberName 16(ColorBlock) 1 "b" + MemberName 16(ColorBlock) 2 "color2" + MemberName 16(ColorBlock) 3 "color3" + Name 18 "uC" + Name 26 "SecondaryColorBlock" + MemberName 26(SecondaryColorBlock) 0 "c" + Name 28 "uColorBuf" + Name 32 "Vertex" + MemberName 32(Vertex) 0 "v1" + MemberName 32(Vertex) 1 "v2" + Name 34 "oV" + Name 40 "gl_PerVertex" + MemberName 40(gl_PerVertex) 0 "gl_Position" + MemberName 40(gl_PerVertex) 1 "gl_PointSize" + MemberName 40(gl_PerVertex) 2 "gl_ClipDistance" + Name 42 "" + Name 44 "MatrixBlock" + MemberName 44(MatrixBlock) 0 "uProj" + MemberName 44(MatrixBlock) 1 "uWorld" + Name 46 "uM" + Name 65 "P" + Name 70 "BufferBlock" + MemberName 70(BufferBlock) 0 "p" + Name 72 "uBuf" + MemberDecorate 16(ColorBlock) 0 Offset 0 + MemberDecorate 16(ColorBlock) 1 Offset 16 + MemberDecorate 16(ColorBlock) 2 Offset 32 + MemberDecorate 16(ColorBlock) 3 Offset 48 + Decorate 16(ColorBlock) Block + Decorate 18(uC) DescriptorSet 0 + Decorate 18(uC) Binding 1 + MemberDecorate 26(SecondaryColorBlock) 0 Offset 0 + Decorate 26(SecondaryColorBlock) BufferBlock + Decorate 28(uColorBuf) DescriptorSet 0 + Decorate 28(uColorBuf) Binding 0 + Decorate 32(Vertex) Block + MemberDecorate 40(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 40(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 40(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 40(gl_PerVertex) Block + MemberDecorate 44(MatrixBlock) 0 ColMajor + MemberDecorate 44(MatrixBlock) 0 Offset 0 + MemberDecorate 44(MatrixBlock) 0 MatrixStride 16 + MemberDecorate 44(MatrixBlock) 1 ColMajor + MemberDecorate 44(MatrixBlock) 1 Offset 64 + MemberDecorate 44(MatrixBlock) 1 MatrixStride 16 + Decorate 44(MatrixBlock) Block + Decorate 46(uM) DescriptorSet 0 + Decorate 46(uM) Binding 0 + MemberDecorate 70(BufferBlock) 0 ColMajor + MemberDecorate 70(BufferBlock) 0 Offset 0 + MemberDecorate 70(BufferBlock) 0 MatrixStride 16 + Decorate 70(BufferBlock) BufferBlock + Decorate 72(uBuf) DescriptorSet 0 + Decorate 72(uBuf) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 13: TypePointer Output 7(fvec4) + 14(oColor): 13(ptr) Variable Output + 15: TypeInt 32 0 + 16(ColorBlock): TypeStruct 7(fvec4) 15(int) 7(fvec4) 7(fvec4) + 17: TypePointer Uniform 16(ColorBlock) + 18(uC): 17(ptr) Variable Uniform + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: TypePointer Uniform 7(fvec4) +26(SecondaryColorBlock): TypeStruct 7(fvec4) + 27: TypePointer Uniform 26(SecondaryColorBlock) + 28(uColorBuf): 27(ptr) Variable Uniform + 32(Vertex): TypeStruct 7(fvec4) 7(fvec4) + 33: TypePointer Output 32(Vertex) + 34(oV): 33(ptr) Variable Output + 38: 15(int) Constant 1 + 39: TypeArray 6(float) 38 +40(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 39 + 41: TypePointer Output 40(gl_PerVertex) + 42: 41(ptr) Variable Output + 43: TypeMatrix 7(fvec4) 4 + 44(MatrixBlock): TypeStruct 43 43 + 45: TypePointer Uniform 44(MatrixBlock) + 46(uM): 45(ptr) Variable Uniform + 47: TypePointer Uniform 43 + 53: 19(int) Constant 2 + 58: 6(float) Constant 1065353216 + 59: 7(fvec4) ConstantComposite 58 58 58 58 + 61: 19(int) Constant 1 + 64: TypePointer Input 7(fvec4) + 65(P): 64(ptr) Variable Input + 70(BufferBlock): TypeStruct 43 + 71: TypePointer Uniform 70(BufferBlock) + 72(uBuf): 71(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 22: 21(ptr) AccessChain 18(uC) 20 + 23: 7(fvec4) Load 22 + 24: 7(fvec4) FunctionCall 9(getColor2() + 25: 7(fvec4) FMul 23 24 + 29: 21(ptr) AccessChain 28(uColorBuf) 20 + 30: 7(fvec4) Load 29 + 31: 7(fvec4) FMul 25 30 + Store 14(oColor) 31 + 35: 21(ptr) AccessChain 18(uC) 20 + 36: 7(fvec4) Load 35 + 37: 13(ptr) AccessChain 34(oV) 20 + Store 37 36 + 48: 47(ptr) AccessChain 46(uM) 20 + 49: 43 Load 48 + 50: 7(fvec4) FunctionCall 11(getWorld() + 51: 7(fvec4) MatrixTimesVector 49 50 + 52: 13(ptr) AccessChain 42 20 + Store 52 51 + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 54: 21(ptr) AccessChain 18(uC) 53 + 55: 7(fvec4) Load 54 + ReturnValue 55 + FunctionEnd + 11(getWorld(): 7(fvec4) Function None 8 + 12: Label + 60: 13(ptr) AccessChain 34(oV) 20 + Store 60 59 + 62: 47(ptr) AccessChain 46(uM) 61 + 63: 43 Load 62 + 66: 7(fvec4) Load 65(P) + 67: 7(fvec4) MatrixTimesVector 63 66 + ReturnValue 67 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out b/core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out new file mode 100755 index 000000000..413da7e9e --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.multiBlocksValid.1.0.geom.out @@ -0,0 +1,451 @@ +link.vk.multiBlocksValid.1.0.geom +Shader version: 430 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:48 Function Definition: main( ( global void) +0:48 Function Parameters: +0:50 Sequence +0:50 move second child to first child ( temp highp 4-component vector of float) +0:50 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:50 component-wise multiply ( temp highp 4-component vector of float) +0:50 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:50 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:50 Constant: +0:50 0 (const int) +0:50 Function Call: getColor2( ( global highp 4-component vector of float) +0:52 move second child to first child ( temp highp float) +0:52 'globalF' ( global highp float) +0:52 Constant: +0:52 1.000000 +0:54 Sequence +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than ( temp bool) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 move second child to first child ( temp highp 4-component vector of float) +0:56 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:56 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:56 Constant: +0:56 0 (const uint) +0:56 matrix-times-vector ( temp highp 4-component vector of float) +0:56 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:56 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:56 Constant: +0:56 0 (const int) +0:56 Function Call: getWorld(i1; ( global highp 4-component vector of float) +0:56 'i' ( temp highp int) +0:57 move second child to first child ( temp highp 4-component vector of float) +0:57 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:57 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:57 Constant: +0:57 0 (const int) +0:57 add ( temp highp 4-component vector of float) +0:57 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:57 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:57 Constant: +0:57 0 (const int) +0:57 vector-scale ( temp highp 4-component vector of float) +0:57 v2: direct index for structure ( in highp 4-component vector of float) +0:57 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'i' ( temp highp int) +0:57 Constant: +0:57 1 (const int) +0:57 'globalF' ( global highp float) +0:58 EmitVertex ( global void) +0:54 Loop Terminal Expression +0:54 Post-Increment ( temp highp int) +0:54 'i' ( temp highp int) +0:61 EndPrimitive ( global void) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:? 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:? 'globalF' ( global highp float) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 1-element array of float ClipDistance gl_ClipDistance}) + +link.vk.multiBlocksValid.1.1.geom +Shader version: 430 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:44 Function Definition: getColor2( ( global highp 4-component vector of float) +0:44 Function Parameters: +0:46 Sequence +0:46 Branch: Return with expression +0:46 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:46 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 2 (const int) +0:49 Function Definition: getWorld(i1; ( global highp 4-component vector of float) +0:49 Function Parameters: +0:49 'i' ( in highp int) +0:51 Sequence +0:51 move second child to first child ( temp highp 4-component vector of float) +0:51 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:51 'anon@0' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:52 Branch: Return with expression +0:52 matrix-times-vector ( temp highp 4-component vector of float) +0:52 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:52 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:52 Constant: +0:52 1 (const int) +0:52 v1: direct index for structure ( in highp 4-component vector of float) +0:52 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'iVV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'i' ( in highp int) +0:52 Constant: +0:52 0 (const int) +0:? Linker Objects +0:? 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuffer' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:? 'iVV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:? 'P' ( in 3-element array of highp 4-component vector of float) + + +Linked geometry stage: + +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + uC: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" versus uColor: "layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + uBuf: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" versus uBuffer: "layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + uM: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" versus uMatrix: "layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + oV: "layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}" versus anon@0: "layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}" +WARNING: Linking geometry stage: Matched shader interfaces are using different instance names. + iV: " in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}" versus iVV: " in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}" + +Shader version: 430 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:48 Function Definition: main( ( global void) +0:48 Function Parameters: +0:50 Sequence +0:50 move second child to first child ( temp highp 4-component vector of float) +0:50 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:50 component-wise multiply ( temp highp 4-component vector of float) +0:50 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:50 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:50 Constant: +0:50 0 (const int) +0:50 Function Call: getColor2( ( global highp 4-component vector of float) +0:52 move second child to first child ( temp highp float) +0:52 'globalF' ( global highp float) +0:52 Constant: +0:52 1.000000 +0:54 Sequence +0:54 Sequence +0:54 move second child to first child ( temp highp int) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than ( temp bool) +0:54 'i' ( temp highp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 move second child to first child ( temp highp 4-component vector of float) +0:56 gl_Position: direct index for structure (layout( stream=0) gl_Position highp 4-component vector of float Position) +0:56 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 1-element array of float ClipDistance gl_ClipDistance}) +0:56 Constant: +0:56 0 (const uint) +0:56 matrix-times-vector ( temp highp 4-component vector of float) +0:56 uProj: direct index for structure (layout( column_major std140 offset=0) uniform highp 4X4 matrix of float) +0:56 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:56 Constant: +0:56 0 (const int) +0:56 Function Call: getWorld(i1; ( global highp 4-component vector of float) +0:56 'i' ( temp highp int) +0:57 move second child to first child ( temp highp 4-component vector of float) +0:57 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:57 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:57 Constant: +0:57 0 (const int) +0:57 add ( temp highp 4-component vector of float) +0:57 color1: direct index for structure (layout( column_major std140 offset=0) uniform highp 4-component vector of float) +0:57 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:57 Constant: +0:57 0 (const int) +0:57 vector-scale ( temp highp 4-component vector of float) +0:57 v2: direct index for structure ( in highp 4-component vector of float) +0:57 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:57 'i' ( temp highp int) +0:57 Constant: +0:57 1 (const int) +0:57 'globalF' ( global highp float) +0:58 EmitVertex ( global void) +0:54 Loop Terminal Expression +0:54 Post-Increment ( temp highp int) +0:54 'i' ( temp highp int) +0:61 EndPrimitive ( global void) +0:44 Function Definition: getColor2( ( global highp 4-component vector of float) +0:44 Function Parameters: +0:46 Sequence +0:46 Branch: Return with expression +0:46 color2: direct index for structure (layout( column_major std140 offset=32) uniform highp 4-component vector of float) +0:46 'uColor' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:46 Constant: +0:46 2 (const int) +0:49 Function Definition: getWorld(i1; ( global highp 4-component vector of float) +0:49 Function Parameters: +0:49 'i' ( in highp int) +0:51 Sequence +0:51 move second child to first child ( temp highp 4-component vector of float) +0:51 val1: direct index for structure (layout( stream=0) out highp 4-component vector of float) +0:51 'anon@0' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:51 Constant: +0:51 0 (const uint) +0:51 Constant: +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:51 1.000000 +0:52 Branch: Return with expression +0:52 matrix-times-vector ( temp highp 4-component vector of float) +0:52 uWorld: direct index for structure (layout( column_major std140 offset=64) uniform highp 4X4 matrix of float) +0:52 'uMatrix' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:52 Constant: +0:52 1 (const int) +0:52 v1: direct index for structure ( in highp 4-component vector of float) +0:52 indirect index ( temp block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'iVV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:52 'i' ( in highp int) +0:52 Constant: +0:52 0 (const int) +0:? Linker Objects +0:? 'uM' (layout( binding=0 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4X4 matrix of float uProj, layout( column_major std140 offset=64) uniform highp 4X4 matrix of float uWorld}) +0:? 'iV' ( in 3-element array of block{ in highp 4-component vector of float v1, in highp 4-component vector of float v2}) +0:? 'oV' (layout( stream=0) out block{layout( stream=0) out highp 4-component vector of float val1}) +0:? 'uC' (layout( binding=1 column_major std140) uniform block{layout( column_major std140 offset=0) uniform highp 4-component vector of float color1, layout( column_major std140 offset=16) uniform bool b, layout( column_major std140 offset=32) uniform highp 4-component vector of float color2, layout( column_major std140 offset=48) uniform highp 4-component vector of float color3}) +0:? 'uBuf' (layout( binding=1 column_major std430) buffer block{layout( column_major std430 offset=0) buffer highp 4X4 matrix of float p}) +0:? 'oColor' (layout( stream=0) out highp 4-component vector of float) +0:? 'globalF' ( global highp float) +0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'P' ( in 3-element array of highp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 101 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 18 46 61 68 100 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source GLSL 430 + Name 4 "main" + Name 9 "getColor2(" + Name 15 "getWorld(i1;" + Name 14 "i" + Name 18 "oColor" + Name 20 "ColorBlock" + MemberName 20(ColorBlock) 0 "color1" + MemberName 20(ColorBlock) 1 "b" + MemberName 20(ColorBlock) 2 "color2" + MemberName 20(ColorBlock) 3 "color3" + Name 22 "uC" + Name 30 "globalF" + Name 32 "i" + Name 44 "gl_PerVertex" + MemberName 44(gl_PerVertex) 0 "gl_Position" + MemberName 44(gl_PerVertex) 1 "gl_PointSize" + MemberName 44(gl_PerVertex) 2 "gl_ClipDistance" + Name 46 "" + Name 48 "MatrixBlock" + MemberName 48(MatrixBlock) 0 "uProj" + MemberName 48(MatrixBlock) 1 "uWorld" + Name 50 "uM" + Name 54 "param" + Name 59 "Vertex" + MemberName 59(Vertex) 0 "val1" + Name 61 "oV" + Name 64 "Vertex" + MemberName 64(Vertex) 0 "v1" + MemberName 64(Vertex) 1 "v2" + Name 68 "iV" + Name 95 "BufferBlock" + MemberName 95(BufferBlock) 0 "p" + Name 97 "uBuf" + Name 100 "P" + MemberDecorate 20(ColorBlock) 0 Offset 0 + MemberDecorate 20(ColorBlock) 1 Offset 16 + MemberDecorate 20(ColorBlock) 2 Offset 32 + MemberDecorate 20(ColorBlock) 3 Offset 48 + Decorate 20(ColorBlock) Block + Decorate 22(uC) DescriptorSet 0 + Decorate 22(uC) Binding 1 + MemberDecorate 44(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 44(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 44(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 44(gl_PerVertex) Block + MemberDecorate 48(MatrixBlock) 0 ColMajor + MemberDecorate 48(MatrixBlock) 0 Offset 0 + MemberDecorate 48(MatrixBlock) 0 MatrixStride 16 + MemberDecorate 48(MatrixBlock) 1 ColMajor + MemberDecorate 48(MatrixBlock) 1 Offset 64 + MemberDecorate 48(MatrixBlock) 1 MatrixStride 16 + Decorate 48(MatrixBlock) Block + Decorate 50(uM) DescriptorSet 0 + Decorate 50(uM) Binding 0 + Decorate 59(Vertex) Block + Decorate 64(Vertex) Block + MemberDecorate 95(BufferBlock) 0 ColMajor + MemberDecorate 95(BufferBlock) 0 Offset 0 + MemberDecorate 95(BufferBlock) 0 MatrixStride 16 + Decorate 95(BufferBlock) BufferBlock + Decorate 97(uBuf) DescriptorSet 0 + Decorate 97(uBuf) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 11: TypeInt 32 1 + 12: TypePointer Function 11(int) + 13: TypeFunction 7(fvec4) 12(ptr) + 17: TypePointer Output 7(fvec4) + 18(oColor): 17(ptr) Variable Output + 19: TypeInt 32 0 + 20(ColorBlock): TypeStruct 7(fvec4) 19(int) 7(fvec4) 7(fvec4) + 21: TypePointer Uniform 20(ColorBlock) + 22(uC): 21(ptr) Variable Uniform + 23: 11(int) Constant 0 + 24: TypePointer Uniform 7(fvec4) + 29: TypePointer Private 6(float) + 30(globalF): 29(ptr) Variable Private + 31: 6(float) Constant 1065353216 + 39: 11(int) Constant 3 + 40: TypeBool + 42: 19(int) Constant 1 + 43: TypeArray 6(float) 42 +44(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 43 + 45: TypePointer Output 44(gl_PerVertex) + 46: 45(ptr) Variable Output + 47: TypeMatrix 7(fvec4) 4 + 48(MatrixBlock): TypeStruct 47 47 + 49: TypePointer Uniform 48(MatrixBlock) + 50(uM): 49(ptr) Variable Uniform + 51: TypePointer Uniform 47 + 59(Vertex): TypeStruct 7(fvec4) + 60: TypePointer Output 59(Vertex) + 61(oV): 60(ptr) Variable Output + 64(Vertex): TypeStruct 7(fvec4) 7(fvec4) + 65: 19(int) Constant 3 + 66: TypeArray 64(Vertex) 65 + 67: TypePointer Input 66 + 68(iV): 67(ptr) Variable Input + 70: 11(int) Constant 1 + 71: TypePointer Input 7(fvec4) + 80: 11(int) Constant 2 + 85: 7(fvec4) ConstantComposite 31 31 31 31 + 95(BufferBlock): TypeStruct 47 + 96: TypePointer Uniform 95(BufferBlock) + 97(uBuf): 96(ptr) Variable Uniform + 98: TypeArray 7(fvec4) 65 + 99: TypePointer Input 98 + 100(P): 99(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 32(i): 12(ptr) Variable Function + 54(param): 12(ptr) Variable Function + 25: 24(ptr) AccessChain 22(uC) 23 + 26: 7(fvec4) Load 25 + 27: 7(fvec4) FunctionCall 9(getColor2() + 28: 7(fvec4) FMul 26 27 + Store 18(oColor) 28 + Store 30(globalF) 31 + Store 32(i) 23 + Branch 33 + 33: Label + LoopMerge 35 36 None + Branch 37 + 37: Label + 38: 11(int) Load 32(i) + 41: 40(bool) SLessThan 38 39 + BranchConditional 41 34 35 + 34: Label + 52: 51(ptr) AccessChain 50(uM) 23 + 53: 47 Load 52 + 55: 11(int) Load 32(i) + Store 54(param) 55 + 56: 7(fvec4) FunctionCall 15(getWorld(i1;) 54(param) + 57: 7(fvec4) MatrixTimesVector 53 56 + 58: 17(ptr) AccessChain 46 23 + Store 58 57 + 62: 24(ptr) AccessChain 22(uC) 23 + 63: 7(fvec4) Load 62 + 69: 11(int) Load 32(i) + 72: 71(ptr) AccessChain 68(iV) 69 70 + 73: 7(fvec4) Load 72 + 74: 6(float) Load 30(globalF) + 75: 7(fvec4) VectorTimesScalar 73 74 + 76: 7(fvec4) FAdd 63 75 + 77: 17(ptr) AccessChain 61(oV) 23 + Store 77 76 + EmitVertex + Branch 36 + 36: Label + 78: 11(int) Load 32(i) + 79: 11(int) IAdd 78 70 + Store 32(i) 79 + Branch 33 + 35: Label + EndPrimitive + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 81: 24(ptr) AccessChain 22(uC) 80 + 82: 7(fvec4) Load 81 + ReturnValue 82 + FunctionEnd +15(getWorld(i1;): 7(fvec4) Function None 13 + 14(i): 12(ptr) FunctionParameter + 16: Label + 86: 17(ptr) AccessChain 61(oV) 23 + Store 86 85 + 87: 51(ptr) AccessChain 50(uM) 70 + 88: 47 Load 87 + 89: 11(int) Load 14(i) + 90: 71(ptr) AccessChain 68(iV) 89 23 + 91: 7(fvec4) Load 90 + 92: 7(fvec4) MatrixTimesVector 88 91 + ReturnValue 92 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out b/core/deps/glslang/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out new file mode 100755 index 000000000..45f6a3979 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.pcNamingInvalid.0.0.vert.out @@ -0,0 +1,111 @@ +link.vk.pcNamingInvalid.0.0.vert +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' ( smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) + +link.vk.pcNamingInvalid.0.1.vert +Shader version: 450 +0:? Sequence +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'P' ( in highp 4-component vector of float) + + +Linked vertex stage: + +ERROR: Linking vertex stage: Only one push_constant block is allowed per stage + +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' ( smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' ( in highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' ( smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'P' ( in highp 4-component vector of float) + +Validation failed +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out b/core/deps/glslang/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out new file mode 100755 index 000000000..c9dba1535 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/link.vk.pcNamingValid.0.0.vert.out @@ -0,0 +1,206 @@ +link.vk.pcNamingValid.0.0.vert +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) + +link.vk.pcNamingValid.0.1.vert +Shader version: 450 +0:? Sequence +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' (layout( location=0) in highp 4-component vector of float) +0:? Linker Objects +0:? 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'P' (layout( location=0) in highp 4-component vector of float) + + +Linked vertex stage: + +WARNING: Linking vertex stage: Matched shader interfaces are using different instance names. + a: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}" versus b: "layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}" + +Shader version: 450 +0:? Sequence +0:16 Function Definition: main( ( global void) +0:16 Function Parameters: +0:18 Sequence +0:18 move second child to first child ( temp highp 4-component vector of float) +0:18 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:18 component-wise multiply ( temp highp 4-component vector of float) +0:18 color1: direct index for structure (layout( column_major std430 offset=128) uniform highp 4-component vector of float) +0:18 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:18 Constant: +0:18 2 (const int) +0:18 Function Call: getColor2( ( global highp 4-component vector of float) +0:20 move second child to first child ( temp highp 4-component vector of float) +0:20 gl_Position: direct index for structure ( gl_Position highp 4-component vector of float Position) +0:20 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:20 Constant: +0:20 0 (const uint) +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uProj: direct index for structure (layout( column_major std430 offset=64) uniform highp 4X4 matrix of float) +0:20 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 1 (const int) +0:20 Function Call: getWorld( ( global highp 4-component vector of float) +0:13 Function Definition: getColor2( ( global highp 4-component vector of float) +0:13 Function Parameters: +0:15 Sequence +0:15 Branch: Return with expression +0:15 color2: direct index for structure (layout( column_major std430 offset=144) uniform highp 4-component vector of float) +0:15 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:15 Constant: +0:15 3 (const int) +0:18 Function Definition: getWorld( ( global highp 4-component vector of float) +0:18 Function Parameters: +0:20 Sequence +0:20 Branch: Return with expression +0:20 matrix-times-vector ( temp highp 4-component vector of float) +0:20 uWorld: direct index for structure (layout( column_major std430 offset=0) uniform highp 4X4 matrix of float) +0:20 'b' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:20 Constant: +0:20 0 (const int) +0:20 'P' (layout( location=0) in highp 4-component vector of float) +0:? Linker Objects +0:? 'a' (layout( column_major std430 push_constant) uniform block{layout( column_major std430 offset=0) uniform highp 4X4 matrix of float uWorld, layout( column_major std430 offset=64) uniform highp 4X4 matrix of float uProj, layout( column_major std430 offset=128) uniform highp 4-component vector of float color1, layout( column_major std430 offset=144) uniform highp 4-component vector of float color2}) +0:? 'oColor' (layout( location=0) smooth out highp 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) +0:? 'P' (layout( location=0) in highp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 53 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 14 31 48 + Source GLSL 450 + Name 4 "main" + Name 9 "getColor2(" + Name 11 "getWorld(" + Name 14 "oColor" + Name 16 "PCBlock" + MemberName 16(PCBlock) 0 "uWorld" + MemberName 16(PCBlock) 1 "uProj" + MemberName 16(PCBlock) 2 "color1" + MemberName 16(PCBlock) 3 "color2" + Name 18 "a" + Name 29 "gl_PerVertex" + MemberName 29(gl_PerVertex) 0 "gl_Position" + MemberName 29(gl_PerVertex) 1 "gl_PointSize" + MemberName 29(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 29(gl_PerVertex) 3 "gl_CullDistance" + Name 31 "" + Name 48 "P" + Decorate 14(oColor) Location 0 + MemberDecorate 16(PCBlock) 0 ColMajor + MemberDecorate 16(PCBlock) 0 Offset 0 + MemberDecorate 16(PCBlock) 0 MatrixStride 16 + MemberDecorate 16(PCBlock) 1 ColMajor + MemberDecorate 16(PCBlock) 1 Offset 64 + MemberDecorate 16(PCBlock) 1 MatrixStride 16 + MemberDecorate 16(PCBlock) 2 Offset 128 + MemberDecorate 16(PCBlock) 3 Offset 144 + Decorate 16(PCBlock) Block + MemberDecorate 29(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 29(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 29(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 29(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 29(gl_PerVertex) Block + Decorate 48(P) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeFunction 7(fvec4) + 13: TypePointer Output 7(fvec4) + 14(oColor): 13(ptr) Variable Output + 15: TypeMatrix 7(fvec4) 4 + 16(PCBlock): TypeStruct 15 15 7(fvec4) 7(fvec4) + 17: TypePointer PushConstant 16(PCBlock) + 18(a): 17(ptr) Variable PushConstant + 19: TypeInt 32 1 + 20: 19(int) Constant 2 + 21: TypePointer PushConstant 7(fvec4) + 26: TypeInt 32 0 + 27: 26(int) Constant 1 + 28: TypeArray 6(float) 27 +29(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 28 28 + 30: TypePointer Output 29(gl_PerVertex) + 31: 30(ptr) Variable Output + 32: 19(int) Constant 0 + 33: 19(int) Constant 1 + 34: TypePointer PushConstant 15 + 40: 19(int) Constant 3 + 47: TypePointer Input 7(fvec4) + 48(P): 47(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 22: 21(ptr) AccessChain 18(a) 20 + 23: 7(fvec4) Load 22 + 24: 7(fvec4) FunctionCall 9(getColor2() + 25: 7(fvec4) FMul 23 24 + Store 14(oColor) 25 + 35: 34(ptr) AccessChain 18(a) 33 + 36: 15 Load 35 + 37: 7(fvec4) FunctionCall 11(getWorld() + 38: 7(fvec4) MatrixTimesVector 36 37 + 39: 13(ptr) AccessChain 31 32 + Store 39 38 + Return + FunctionEnd + 9(getColor2(): 7(fvec4) Function None 8 + 10: Label + 41: 21(ptr) AccessChain 18(a) 40 + 42: 7(fvec4) Load 41 + ReturnValue 42 + FunctionEnd + 11(getWorld(): 7(fvec4) Function None 8 + 12: Label + 45: 34(ptr) AccessChain 18(a) 32 + 46: 15 Load 45 + 49: 7(fvec4) Load 48(P) + 50: 7(fvec4) MatrixTimesVector 46 49 + ReturnValue 50 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/rayQuery-allOps.Error.rgen.out b/core/deps/glslang/Test/baseResults/rayQuery-allOps.Error.rgen.out new file mode 100644 index 000000000..98101c326 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-allOps.Error.rgen.out @@ -0,0 +1,26 @@ +rayQuery-allOps.Error.rgen +ERROR: 0:47: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global bool' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:49: '=' : cannot convert from ' global uint' to ' temp highp int' +ERROR: 0:59: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global bool' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:64: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global 2-component vector of float' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:69: '' : boolean expression expected +ERROR: 0:74: '' : boolean expression expected +ERROR: 0:79: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' global 3-component vector of float' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:84: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' global 3-component vector of float' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:89: '' : boolean expression expected +ERROR: 0:94: '' : boolean expression expected +ERROR: 0:99: '' : boolean expression expected +ERROR: 0:127: '=' : cannot convert from ' global uint' to ' temp highp int' +ERROR: 0:145: '==' : wrong operand types: no operation '==' exists that takes a left-hand operand of type ' global 2-component vector of float' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:158: '' : boolean expression expected +ERROR: 0:163: '' : boolean expression expected +ERROR: 0:168: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' global 3-component vector of float' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:173: '>' : wrong operand types: no operation '>' exists that takes a left-hand operand of type ' global 3-component vector of float' and a right operand of type ' const int' (or there is no acceptable conversion) +ERROR: 0:178: '' : boolean expression expected +ERROR: 0:183: '' : boolean expression expected +ERROR: 0:195: '' : boolean expression expected +ERROR: 0:200: '' : boolean expression expected +ERROR: 21 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/rayQuery-allOps.comp.out b/core/deps/glslang/Test/baseResults/rayQuery-allOps.comp.out new file mode 100644 index 000000000..2ac7cd392 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-allOps.comp.out @@ -0,0 +1,433 @@ +rayQuery-allOps.comp +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 258 + + Capability Shader + Capability RayQueryProvisionalKHR + Capability RayTraversalPrimitiveCullingProvisionalKHR + Extension "SPV_KHR_ray_query" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source GLSL 460 + SourceExtension "GL_EXT_ray_flags_primitive_culling" + SourceExtension "GL_EXT_ray_query" + Name 4 "main" + Name 6 "doSomething(" + Name 10 "Ray" + MemberName 10(Ray) 0 "pos" + MemberName 10(Ray) 1 "tmin" + MemberName 10(Ray) 2 "dir" + MemberName 10(Ray) 3 "tmax" + Name 12 "makeRayDesc(" + Name 15 "Log" + MemberName 15(Log) 0 "x" + MemberName 15(Log) 1 "y" + Name 17 "" + Name 26 "ray" + Name 43 "ray" + Name 47 "rayQuery" + Name 50 "rtas" + Name 69 "candidateType" + Name 78 "_mat4x3" + Name 83 "_mat3x4" + Name 143 "t" + Name 156 "committedStatus" + Name 241 "o" + Name 243 "d" + Name 253 "Ray" + MemberName 253(Ray) 0 "pos" + MemberName 253(Ray) 1 "tmin" + MemberName 253(Ray) 2 "dir" + MemberName 253(Ray) 3 "tmax" + Name 255 "Rays" + MemberName 255(Rays) 0 "rays" + Name 257 "" + MemberDecorate 15(Log) 0 Offset 0 + MemberDecorate 15(Log) 1 Offset 4 + Decorate 15(Log) BufferBlock + Decorate 17 DescriptorSet 0 + Decorate 17 Binding 0 + Decorate 50(rtas) DescriptorSet 0 + Decorate 50(rtas) Binding 1 + MemberDecorate 253(Ray) 0 Offset 0 + MemberDecorate 253(Ray) 1 Offset 12 + MemberDecorate 253(Ray) 2 Offset 16 + MemberDecorate 253(Ray) 3 Offset 28 + Decorate 254 ArrayStride 32 + MemberDecorate 255(Rays) 0 Offset 0 + Decorate 255(Rays) BufferBlock + Decorate 257 DescriptorSet 0 + Decorate 257 Binding 2 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 3 + 10(Ray): TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float) + 11: TypeFunction 10(Ray) + 14: TypeInt 32 0 + 15(Log): TypeStruct 14(int) 14(int) + 16: TypePointer Uniform 15(Log) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 14(int) Constant 0 + 21: TypePointer Uniform 14(int) + 23: 18(int) Constant 1 + 25: TypePointer Function 10(Ray) + 27: 8(float) Constant 0 + 28: 9(fvec3) ConstantComposite 27 27 27 + 29: TypePointer Function 9(fvec3) + 31: 18(int) Constant 2 + 32: 8(float) Constant 1065353216 + 33: 9(fvec3) ConstantComposite 32 27 27 + 35: TypePointer Function 8(float) + 37: 18(int) Constant 3 + 38: 8(float) Constant 1176255488 + 45: TypeRayQueryProvisionalKHR + 46: TypePointer Function 45 + 48: TypeAccelerationStructureKHR + 49: TypePointer UniformConstant 48 + 50(rtas): 49(ptr) Variable UniformConstant + 52: 14(int) Constant 255 + 66: TypeBool + 68: TypePointer Function 14(int) + 70: 66(bool) ConstantFalse + 76: TypeMatrix 9(fvec3) 4 + 77: TypePointer Function 76 + 80: TypeVector 8(float) 4 + 81: TypeMatrix 80(fvec4) 3 + 82: TypePointer Function 81 + 86: 66(bool) ConstantTrue + 91: TypeVector 8(float) 2 + 144: 8(float) Constant 1056964608 + 175: 14(int) Constant 1 + 198: 14(int) Constant 2 + 231: 14(int) Constant 256 + 253(Ray): TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float) + 254: TypeRuntimeArray 253(Ray) + 255(Rays): TypeStruct 254 + 256: TypePointer Uniform 255(Rays) + 257: 256(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 43(ray): 25(ptr) Variable Function + 47(rayQuery): 46(ptr) Variable Function +69(candidateType): 68(ptr) Variable Function + 78(_mat4x3): 77(ptr) Variable Function + 83(_mat3x4): 82(ptr) Variable Function + 143(t): 35(ptr) Variable Function +156(committedStatus): 68(ptr) Variable Function + 241(o): 29(ptr) Variable Function + 243(d): 29(ptr) Variable Function + 44: 10(Ray) FunctionCall 12(makeRayDesc() + Store 43(ray) 44 + 51: 48 Load 50(rtas) + 53: 29(ptr) AccessChain 43(ray) 19 + 54: 9(fvec3) Load 53 + 55: 35(ptr) AccessChain 43(ray) 23 + 56: 8(float) Load 55 + 57: 29(ptr) AccessChain 43(ray) 31 + 58: 9(fvec3) Load 57 + 59: 35(ptr) AccessChain 43(ray) 37 + 60: 8(float) Load 59 + RayQueryInitializeKHR 47(rayQuery) 51 20 52 54 56 58 60 + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 67: 66(bool) RayQueryProceedKHR 47(rayQuery) + BranchConditional 67 62 63 + 62: Label + 71: 14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 19 + Store 69(candidateType) 71 + 72: 14(int) Load 69(candidateType) + SelectionMerge 75 None + Switch 72 75 + case 0: 73 + case 1: 74 + 73: Label + RayQueryTerminateKHR 47(rayQuery) + 79: 76 RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19 + Store 78(_mat4x3) 79 + 84: 76 Load 78(_mat4x3) + 85: 81 Transpose 84 + Store 83(_mat3x4) 85 + RayQueryConfirmIntersectionKHR 47(rayQuery) + 87: 66(bool) RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23 + SelectionMerge 89 None + BranchConditional 87 88 89 + 88: Label + 90: 2 FunctionCall 6(doSomething() + Branch 89 + 89: Label + 92: 91(fvec2) RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23 + 93: 8(float) CompositeExtract 92 0 + 94: 66(bool) FOrdEqual 93 27 + SelectionMerge 96 None + BranchConditional 94 95 96 + 95: Label + 97: 2 FunctionCall 6(doSomething() + Branch 96 + 96: Label + 98: 18(int) RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23 + 99: 66(bool) SGreaterThan 98 19 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 102: 2 FunctionCall 6(doSomething() + Branch 101 + 101: Label + 103: 18(int) RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23 + 104: 66(bool) SGreaterThan 103 19 + SelectionMerge 106 None + BranchConditional 104 105 106 + 105: Label + 107: 2 FunctionCall 6(doSomething() + Branch 106 + 106: Label + 108: 9(fvec3) RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23 + 109: 8(float) CompositeExtract 108 0 + 110: 66(bool) FOrdGreaterThan 109 27 + SelectionMerge 112 None + BranchConditional 110 111 112 + 111: Label + 113: 2 FunctionCall 6(doSomething() + Branch 112 + 112: Label + 114: 9(fvec3) RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23 + 115: 8(float) CompositeExtract 114 0 + 116: 66(bool) FOrdGreaterThan 115 27 + SelectionMerge 118 None + BranchConditional 116 117 118 + 117: Label + 119: 2 FunctionCall 6(doSomething() + Branch 118 + 118: Label + 120: 18(int) RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23 + 121: 66(bool) SGreaterThan 120 19 + SelectionMerge 123 None + BranchConditional 121 122 123 + 122: Label + 124: 2 FunctionCall 6(doSomething() + Branch 123 + 123: Label + 125: 8(float) RayQueryGetIntersectionTKHR 47(rayQuery) 23 + 126: 66(bool) FOrdGreaterThan 125 27 + SelectionMerge 128 None + BranchConditional 126 127 128 + 127: Label + 129: 2 FunctionCall 6(doSomething() + Branch 128 + 128: Label + 130: 18(int) RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR 47(rayQuery) 23 + 131: 66(bool) UGreaterThan 130 20 + SelectionMerge 133 None + BranchConditional 131 132 133 + 132: Label + 134: 2 FunctionCall 6(doSomething() + Branch 133 + 133: Label + Branch 75 + 74: Label + 136: 76 RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19 + Store 78(_mat4x3) 136 + 137: 76 Load 78(_mat4x3) + 138: 81 Transpose 137 + Store 83(_mat3x4) 138 + 139: 66(bool) RayQueryGetIntersectionCandidateAABBOpaqueKHR 47(rayQuery) + SelectionMerge 141 None + BranchConditional 139 140 141 + 140: Label + 142: 2 FunctionCall 6(doSomething() + Branch 141 + 141: Label + Store 143(t) 144 + 145: 8(float) Load 143(t) + RayQueryGenerateIntersectionKHR 47(rayQuery) 145 + RayQueryTerminateKHR 47(rayQuery) + Branch 75 + 75: Label + Branch 64 + 64: Label + Branch 61 + 63: Label + 148: 35(ptr) AccessChain 83(_mat3x4) 19 20 + 149: 8(float) Load 148 + 150: 35(ptr) AccessChain 78(_mat4x3) 19 20 + 151: 8(float) Load 150 + 152: 66(bool) FOrdEqual 149 151 + SelectionMerge 154 None + BranchConditional 152 153 154 + 153: Label + 155: 2 FunctionCall 6(doSomething() + Branch 154 + 154: Label + 157: 14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 23 + Store 156(committedStatus) 157 + 158: 14(int) Load 156(committedStatus) + SelectionMerge 162 None + Switch 158 162 + case 0: 159 + case 1: 160 + case 2: 161 + 159: Label + 163: 76 RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 19 + Store 78(_mat4x3) 163 + 164: 76 Load 78(_mat4x3) + 165: 81 Transpose 164 + Store 83(_mat3x4) 165 + Branch 162 + 160: Label + 167: 76 RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 23 + Store 78(_mat4x3) 167 + 168: 76 Load 78(_mat4x3) + 169: 81 Transpose 168 + Store 83(_mat3x4) 169 + 170: 66(bool) RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23 + SelectionMerge 172 None + BranchConditional 170 171 172 + 171: Label + 173: 2 FunctionCall 6(doSomething() + Branch 172 + 172: Label + 174: 91(fvec2) RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23 + 176: 8(float) CompositeExtract 174 1 + 177: 66(bool) FOrdEqual 176 27 + SelectionMerge 179 None + BranchConditional 177 178 179 + 178: Label + 180: 2 FunctionCall 6(doSomething() + Branch 179 + 179: Label + Branch 162 + 161: Label + 182: 18(int) RayQueryGetIntersectionGeometryIndexKHR 47(rayQuery) 23 + 183: 66(bool) SGreaterThan 182 19 + SelectionMerge 185 None + BranchConditional 183 184 185 + 184: Label + 186: 2 FunctionCall 6(doSomething() + Branch 185 + 185: Label + 187: 18(int) RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23 + 188: 66(bool) SGreaterThan 187 19 + SelectionMerge 190 None + BranchConditional 188 189 190 + 189: Label + 191: 2 FunctionCall 6(doSomething() + Branch 190 + 190: Label + 192: 18(int) RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23 + 193: 66(bool) SGreaterThan 192 19 + SelectionMerge 195 None + BranchConditional 193 194 195 + 194: Label + 196: 2 FunctionCall 6(doSomething() + Branch 195 + 195: Label + 197: 9(fvec3) RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23 + 199: 8(float) CompositeExtract 197 2 + 200: 66(bool) FOrdGreaterThan 199 27 + SelectionMerge 202 None + BranchConditional 200 201 202 + 201: Label + 203: 2 FunctionCall 6(doSomething() + Branch 202 + 202: Label + 204: 9(fvec3) RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23 + 205: 8(float) CompositeExtract 204 0 + 206: 66(bool) FOrdGreaterThan 205 27 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 209: 2 FunctionCall 6(doSomething() + Branch 208 + 208: Label + 210: 18(int) RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23 + 211: 66(bool) SGreaterThan 210 19 + SelectionMerge 213 None + BranchConditional 211 212 213 + 212: Label + 214: 2 FunctionCall 6(doSomething() + Branch 213 + 213: Label + 215: 8(float) RayQueryGetIntersectionTKHR 47(rayQuery) 23 + 216: 66(bool) FOrdGreaterThan 215 27 + SelectionMerge 218 None + BranchConditional 216 217 218 + 217: Label + 219: 2 FunctionCall 6(doSomething() + Branch 218 + 218: Label + Branch 162 + 162: Label + 222: 35(ptr) AccessChain 83(_mat3x4) 19 20 + 223: 8(float) Load 222 + 224: 35(ptr) AccessChain 78(_mat4x3) 19 20 + 225: 8(float) Load 224 + 226: 66(bool) FOrdEqual 223 225 + SelectionMerge 228 None + BranchConditional 226 227 228 + 227: Label + 229: 2 FunctionCall 6(doSomething() + Branch 228 + 228: Label + 230: 14(int) RayQueryGetRayFlagsKHR 47(rayQuery) + 232: 66(bool) UGreaterThan 230 231 + SelectionMerge 234 None + BranchConditional 232 233 234 + 233: Label + 235: 2 FunctionCall 6(doSomething() + Branch 234 + 234: Label + 236: 8(float) RayQueryGetRayTMinKHR 47(rayQuery) + 237: 66(bool) FOrdGreaterThan 236 27 + SelectionMerge 239 None + BranchConditional 237 238 239 + 238: Label + 240: 2 FunctionCall 6(doSomething() + Branch 239 + 239: Label + 242: 9(fvec3) RayQueryGetWorldRayOriginKHR 47(rayQuery) + Store 241(o) 242 + 244: 9(fvec3) RayQueryGetWorldRayDirectionKHR 47(rayQuery) + Store 243(d) 244 + 245: 35(ptr) AccessChain 241(o) 20 + 246: 8(float) Load 245 + 247: 35(ptr) AccessChain 243(d) 198 + 248: 8(float) Load 247 + 249: 66(bool) FOrdEqual 246 248 + SelectionMerge 251 None + BranchConditional 249 250 251 + 250: Label + 252: 2 FunctionCall 6(doSomething() + Branch 251 + 251: Label + Return + FunctionEnd + 6(doSomething(): 2 Function None 3 + 7: Label + 22: 21(ptr) AccessChain 17 19 + Store 22 20 + 24: 21(ptr) AccessChain 17 23 + Store 24 20 + Return + FunctionEnd +12(makeRayDesc(): 10(Ray) Function None 11 + 13: Label + 26(ray): 25(ptr) Variable Function + 30: 29(ptr) AccessChain 26(ray) 19 + Store 30 28 + 34: 29(ptr) AccessChain 26(ray) 31 + Store 34 33 + 36: 35(ptr) AccessChain 26(ray) 23 + Store 36 27 + 39: 35(ptr) AccessChain 26(ray) 37 + Store 39 38 + 40: 10(Ray) Load 26(ray) + ReturnValue 40 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/rayQuery-allOps.frag.out b/core/deps/glslang/Test/baseResults/rayQuery-allOps.frag.out new file mode 100644 index 000000000..3160c2b71 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-allOps.frag.out @@ -0,0 +1,431 @@ +rayQuery-allOps.frag +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 257 + + Capability Shader + Capability RayQueryProvisionalKHR + Extension "SPV_KHR_ray_query" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 460 + SourceExtension "GL_EXT_ray_query" + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 6 "doSomething(" + Name 10 "Ray" + MemberName 10(Ray) 0 "pos" + MemberName 10(Ray) 1 "tmin" + MemberName 10(Ray) 2 "dir" + MemberName 10(Ray) 3 "tmax" + Name 12 "makeRayDesc(" + Name 15 "Log" + MemberName 15(Log) 0 "x" + MemberName 15(Log) 1 "y" + Name 17 "" + Name 26 "ray" + Name 43 "ray" + Name 47 "rayQuery" + Name 50 "rtas" + Name 69 "candidateType" + Name 78 "_mat4x3" + Name 83 "_mat3x4" + Name 143 "t" + Name 156 "committedStatus" + Name 240 "o" + Name 242 "d" + Name 252 "Ray" + MemberName 252(Ray) 0 "pos" + MemberName 252(Ray) 1 "tmin" + MemberName 252(Ray) 2 "dir" + MemberName 252(Ray) 3 "tmax" + Name 254 "Rays" + MemberName 254(Rays) 0 "rays" + Name 256 "" + MemberDecorate 15(Log) 0 Offset 0 + MemberDecorate 15(Log) 1 Offset 4 + Decorate 15(Log) BufferBlock + Decorate 17 DescriptorSet 0 + Decorate 17 Binding 0 + Decorate 50(rtas) DescriptorSet 0 + Decorate 50(rtas) Binding 1 + MemberDecorate 252(Ray) 0 Offset 0 + MemberDecorate 252(Ray) 1 Offset 12 + MemberDecorate 252(Ray) 2 Offset 16 + MemberDecorate 252(Ray) 3 Offset 28 + Decorate 253 ArrayStride 32 + MemberDecorate 254(Rays) 0 Offset 0 + Decorate 254(Rays) BufferBlock + Decorate 256 DescriptorSet 0 + Decorate 256 Binding 2 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 3 + 10(Ray): TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float) + 11: TypeFunction 10(Ray) + 14: TypeInt 32 0 + 15(Log): TypeStruct 14(int) 14(int) + 16: TypePointer Uniform 15(Log) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 14(int) Constant 0 + 21: TypePointer Uniform 14(int) + 23: 18(int) Constant 1 + 25: TypePointer Function 10(Ray) + 27: 8(float) Constant 0 + 28: 9(fvec3) ConstantComposite 27 27 27 + 29: TypePointer Function 9(fvec3) + 31: 18(int) Constant 2 + 32: 8(float) Constant 1065353216 + 33: 9(fvec3) ConstantComposite 32 27 27 + 35: TypePointer Function 8(float) + 37: 18(int) Constant 3 + 38: 8(float) Constant 1176255488 + 45: TypeRayQueryProvisionalKHR + 46: TypePointer Function 45 + 48: TypeAccelerationStructureKHR + 49: TypePointer UniformConstant 48 + 50(rtas): 49(ptr) Variable UniformConstant + 52: 14(int) Constant 255 + 66: TypeBool + 68: TypePointer Function 14(int) + 70: 66(bool) ConstantFalse + 76: TypeMatrix 9(fvec3) 4 + 77: TypePointer Function 76 + 80: TypeVector 8(float) 4 + 81: TypeMatrix 80(fvec4) 3 + 82: TypePointer Function 81 + 86: 66(bool) ConstantTrue + 91: TypeVector 8(float) 2 + 144: 8(float) Constant 1056964608 + 175: 14(int) Constant 1 + 198: 14(int) Constant 2 + 252(Ray): TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float) + 253: TypeRuntimeArray 252(Ray) + 254(Rays): TypeStruct 253 + 255: TypePointer Uniform 254(Rays) + 256: 255(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 43(ray): 25(ptr) Variable Function + 47(rayQuery): 46(ptr) Variable Function +69(candidateType): 68(ptr) Variable Function + 78(_mat4x3): 77(ptr) Variable Function + 83(_mat3x4): 82(ptr) Variable Function + 143(t): 35(ptr) Variable Function +156(committedStatus): 68(ptr) Variable Function + 240(o): 29(ptr) Variable Function + 242(d): 29(ptr) Variable Function + 44: 10(Ray) FunctionCall 12(makeRayDesc() + Store 43(ray) 44 + 51: 48 Load 50(rtas) + 53: 29(ptr) AccessChain 43(ray) 19 + 54: 9(fvec3) Load 53 + 55: 35(ptr) AccessChain 43(ray) 23 + 56: 8(float) Load 55 + 57: 29(ptr) AccessChain 43(ray) 31 + 58: 9(fvec3) Load 57 + 59: 35(ptr) AccessChain 43(ray) 37 + 60: 8(float) Load 59 + RayQueryInitializeKHR 47(rayQuery) 51 20 52 54 56 58 60 + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 67: 66(bool) RayQueryProceedKHR 47(rayQuery) + BranchConditional 67 62 63 + 62: Label + 71: 14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 19 + Store 69(candidateType) 71 + 72: 14(int) Load 69(candidateType) + SelectionMerge 75 None + Switch 72 75 + case 0: 73 + case 1: 74 + 73: Label + RayQueryTerminateKHR 47(rayQuery) + 79: 76 RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19 + Store 78(_mat4x3) 79 + 84: 76 Load 78(_mat4x3) + 85: 81 Transpose 84 + Store 83(_mat3x4) 85 + RayQueryConfirmIntersectionKHR 47(rayQuery) + 87: 66(bool) RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23 + SelectionMerge 89 None + BranchConditional 87 88 89 + 88: Label + 90: 2 FunctionCall 6(doSomething() + Branch 89 + 89: Label + 92: 91(fvec2) RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23 + 93: 8(float) CompositeExtract 92 0 + 94: 66(bool) FOrdEqual 93 27 + SelectionMerge 96 None + BranchConditional 94 95 96 + 95: Label + 97: 2 FunctionCall 6(doSomething() + Branch 96 + 96: Label + 98: 18(int) RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23 + 99: 66(bool) SGreaterThan 98 19 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 102: 2 FunctionCall 6(doSomething() + Branch 101 + 101: Label + 103: 18(int) RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23 + 104: 66(bool) SGreaterThan 103 19 + SelectionMerge 106 None + BranchConditional 104 105 106 + 105: Label + 107: 2 FunctionCall 6(doSomething() + Branch 106 + 106: Label + 108: 9(fvec3) RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23 + 109: 8(float) CompositeExtract 108 0 + 110: 66(bool) FOrdGreaterThan 109 27 + SelectionMerge 112 None + BranchConditional 110 111 112 + 111: Label + 113: 2 FunctionCall 6(doSomething() + Branch 112 + 112: Label + 114: 9(fvec3) RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23 + 115: 8(float) CompositeExtract 114 0 + 116: 66(bool) FOrdGreaterThan 115 27 + SelectionMerge 118 None + BranchConditional 116 117 118 + 117: Label + 119: 2 FunctionCall 6(doSomething() + Branch 118 + 118: Label + 120: 18(int) RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23 + 121: 66(bool) SGreaterThan 120 19 + SelectionMerge 123 None + BranchConditional 121 122 123 + 122: Label + 124: 2 FunctionCall 6(doSomething() + Branch 123 + 123: Label + 125: 8(float) RayQueryGetIntersectionTKHR 47(rayQuery) 23 + 126: 66(bool) FOrdGreaterThan 125 27 + SelectionMerge 128 None + BranchConditional 126 127 128 + 127: Label + 129: 2 FunctionCall 6(doSomething() + Branch 128 + 128: Label + 130: 18(int) RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR 47(rayQuery) 23 + 131: 66(bool) UGreaterThan 130 20 + SelectionMerge 133 None + BranchConditional 131 132 133 + 132: Label + 134: 2 FunctionCall 6(doSomething() + Branch 133 + 133: Label + Branch 75 + 74: Label + 136: 76 RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19 + Store 78(_mat4x3) 136 + 137: 76 Load 78(_mat4x3) + 138: 81 Transpose 137 + Store 83(_mat3x4) 138 + 139: 66(bool) RayQueryGetIntersectionCandidateAABBOpaqueKHR 47(rayQuery) + SelectionMerge 141 None + BranchConditional 139 140 141 + 140: Label + 142: 2 FunctionCall 6(doSomething() + Branch 141 + 141: Label + Store 143(t) 144 + 145: 8(float) Load 143(t) + RayQueryGenerateIntersectionKHR 47(rayQuery) 145 + RayQueryTerminateKHR 47(rayQuery) + Branch 75 + 75: Label + Branch 64 + 64: Label + Branch 61 + 63: Label + 148: 35(ptr) AccessChain 83(_mat3x4) 19 20 + 149: 8(float) Load 148 + 150: 35(ptr) AccessChain 78(_mat4x3) 19 20 + 151: 8(float) Load 150 + 152: 66(bool) FOrdEqual 149 151 + SelectionMerge 154 None + BranchConditional 152 153 154 + 153: Label + 155: 2 FunctionCall 6(doSomething() + Branch 154 + 154: Label + 157: 14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 23 + Store 156(committedStatus) 157 + 158: 14(int) Load 156(committedStatus) + SelectionMerge 162 None + Switch 158 162 + case 0: 159 + case 1: 160 + case 2: 161 + 159: Label + 163: 76 RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 19 + Store 78(_mat4x3) 163 + 164: 76 Load 78(_mat4x3) + 165: 81 Transpose 164 + Store 83(_mat3x4) 165 + Branch 162 + 160: Label + 167: 76 RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 23 + Store 78(_mat4x3) 167 + 168: 76 Load 78(_mat4x3) + 169: 81 Transpose 168 + Store 83(_mat3x4) 169 + 170: 66(bool) RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23 + SelectionMerge 172 None + BranchConditional 170 171 172 + 171: Label + 173: 2 FunctionCall 6(doSomething() + Branch 172 + 172: Label + 174: 91(fvec2) RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23 + 176: 8(float) CompositeExtract 174 1 + 177: 66(bool) FOrdEqual 176 27 + SelectionMerge 179 None + BranchConditional 177 178 179 + 178: Label + 180: 2 FunctionCall 6(doSomething() + Branch 179 + 179: Label + Branch 162 + 161: Label + 182: 18(int) RayQueryGetIntersectionGeometryIndexKHR 47(rayQuery) 23 + 183: 66(bool) SGreaterThan 182 19 + SelectionMerge 185 None + BranchConditional 183 184 185 + 184: Label + 186: 2 FunctionCall 6(doSomething() + Branch 185 + 185: Label + 187: 18(int) RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23 + 188: 66(bool) SGreaterThan 187 19 + SelectionMerge 190 None + BranchConditional 188 189 190 + 189: Label + 191: 2 FunctionCall 6(doSomething() + Branch 190 + 190: Label + 192: 18(int) RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23 + 193: 66(bool) SGreaterThan 192 19 + SelectionMerge 195 None + BranchConditional 193 194 195 + 194: Label + 196: 2 FunctionCall 6(doSomething() + Branch 195 + 195: Label + 197: 9(fvec3) RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23 + 199: 8(float) CompositeExtract 197 2 + 200: 66(bool) FOrdGreaterThan 199 27 + SelectionMerge 202 None + BranchConditional 200 201 202 + 201: Label + 203: 2 FunctionCall 6(doSomething() + Branch 202 + 202: Label + 204: 9(fvec3) RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23 + 205: 8(float) CompositeExtract 204 0 + 206: 66(bool) FOrdGreaterThan 205 27 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 209: 2 FunctionCall 6(doSomething() + Branch 208 + 208: Label + 210: 18(int) RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23 + 211: 66(bool) SGreaterThan 210 19 + SelectionMerge 213 None + BranchConditional 211 212 213 + 212: Label + 214: 2 FunctionCall 6(doSomething() + Branch 213 + 213: Label + 215: 8(float) RayQueryGetIntersectionTKHR 47(rayQuery) 23 + 216: 66(bool) FOrdGreaterThan 215 27 + SelectionMerge 218 None + BranchConditional 216 217 218 + 217: Label + 219: 2 FunctionCall 6(doSomething() + Branch 218 + 218: Label + Branch 162 + 162: Label + 222: 35(ptr) AccessChain 83(_mat3x4) 19 20 + 223: 8(float) Load 222 + 224: 35(ptr) AccessChain 78(_mat4x3) 19 20 + 225: 8(float) Load 224 + 226: 66(bool) FOrdEqual 223 225 + SelectionMerge 228 None + BranchConditional 226 227 228 + 227: Label + 229: 2 FunctionCall 6(doSomething() + Branch 228 + 228: Label + 230: 14(int) RayQueryGetRayFlagsKHR 47(rayQuery) + 231: 66(bool) UGreaterThan 230 20 + SelectionMerge 233 None + BranchConditional 231 232 233 + 232: Label + 234: 2 FunctionCall 6(doSomething() + Branch 233 + 233: Label + 235: 8(float) RayQueryGetRayTMinKHR 47(rayQuery) + 236: 66(bool) FOrdGreaterThan 235 27 + SelectionMerge 238 None + BranchConditional 236 237 238 + 237: Label + 239: 2 FunctionCall 6(doSomething() + Branch 238 + 238: Label + 241: 9(fvec3) RayQueryGetWorldRayOriginKHR 47(rayQuery) + Store 240(o) 241 + 243: 9(fvec3) RayQueryGetWorldRayDirectionKHR 47(rayQuery) + Store 242(d) 243 + 244: 35(ptr) AccessChain 240(o) 20 + 245: 8(float) Load 244 + 246: 35(ptr) AccessChain 242(d) 198 + 247: 8(float) Load 246 + 248: 66(bool) FOrdEqual 245 247 + SelectionMerge 250 None + BranchConditional 248 249 250 + 249: Label + 251: 2 FunctionCall 6(doSomething() + Branch 250 + 250: Label + Return + FunctionEnd + 6(doSomething(): 2 Function None 3 + 7: Label + 22: 21(ptr) AccessChain 17 19 + Store 22 20 + 24: 21(ptr) AccessChain 17 23 + Store 24 20 + Return + FunctionEnd +12(makeRayDesc(): 10(Ray) Function None 11 + 13: Label + 26(ray): 25(ptr) Variable Function + 30: 29(ptr) AccessChain 26(ray) 19 + Store 30 28 + 34: 29(ptr) AccessChain 26(ray) 31 + Store 34 33 + 36: 35(ptr) AccessChain 26(ray) 23 + Store 36 27 + 39: 35(ptr) AccessChain 26(ray) 37 + Store 39 38 + 40: 10(Ray) Load 26(ray) + ReturnValue 40 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/rayQuery-allOps.rgen.out b/core/deps/glslang/Test/baseResults/rayQuery-allOps.rgen.out new file mode 100644 index 000000000..a61769efc --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-allOps.rgen.out @@ -0,0 +1,431 @@ +rayQuery-allOps.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 257 + + Capability RayQueryProvisionalKHR + Capability RayTracingNV + Extension "SPV_KHR_ray_query" + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" + Source GLSL 460 + SourceExtension "GL_EXT_ray_query" + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 6 "doSomething(" + Name 10 "Ray" + MemberName 10(Ray) 0 "pos" + MemberName 10(Ray) 1 "tmin" + MemberName 10(Ray) 2 "dir" + MemberName 10(Ray) 3 "tmax" + Name 12 "makeRayDesc(" + Name 15 "Log" + MemberName 15(Log) 0 "x" + MemberName 15(Log) 1 "y" + Name 17 "" + Name 26 "ray" + Name 43 "ray" + Name 47 "rayQuery" + Name 50 "rtas" + Name 69 "candidateType" + Name 78 "_mat4x3" + Name 83 "_mat3x4" + Name 143 "t" + Name 156 "committedStatus" + Name 240 "o" + Name 242 "d" + Name 252 "Ray" + MemberName 252(Ray) 0 "pos" + MemberName 252(Ray) 1 "tmin" + MemberName 252(Ray) 2 "dir" + MemberName 252(Ray) 3 "tmax" + Name 254 "Rays" + MemberName 254(Rays) 0 "rays" + Name 256 "" + MemberDecorate 15(Log) 0 Offset 0 + MemberDecorate 15(Log) 1 Offset 4 + Decorate 15(Log) BufferBlock + Decorate 17 DescriptorSet 0 + Decorate 17 Binding 0 + Decorate 50(rtas) DescriptorSet 0 + Decorate 50(rtas) Binding 1 + MemberDecorate 252(Ray) 0 Offset 0 + MemberDecorate 252(Ray) 1 Offset 12 + MemberDecorate 252(Ray) 2 Offset 16 + MemberDecorate 252(Ray) 3 Offset 28 + Decorate 253 ArrayStride 32 + MemberDecorate 254(Rays) 0 Offset 0 + Decorate 254(Rays) BufferBlock + Decorate 256 DescriptorSet 0 + Decorate 256 Binding 2 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeFloat 32 + 9: TypeVector 8(float) 3 + 10(Ray): TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float) + 11: TypeFunction 10(Ray) + 14: TypeInt 32 0 + 15(Log): TypeStruct 14(int) 14(int) + 16: TypePointer Uniform 15(Log) + 17: 16(ptr) Variable Uniform + 18: TypeInt 32 1 + 19: 18(int) Constant 0 + 20: 14(int) Constant 0 + 21: TypePointer Uniform 14(int) + 23: 18(int) Constant 1 + 25: TypePointer Function 10(Ray) + 27: 8(float) Constant 0 + 28: 9(fvec3) ConstantComposite 27 27 27 + 29: TypePointer Function 9(fvec3) + 31: 18(int) Constant 2 + 32: 8(float) Constant 1065353216 + 33: 9(fvec3) ConstantComposite 32 27 27 + 35: TypePointer Function 8(float) + 37: 18(int) Constant 3 + 38: 8(float) Constant 1176255488 + 45: TypeRayQueryProvisionalKHR + 46: TypePointer Function 45 + 48: TypeAccelerationStructureKHR + 49: TypePointer UniformConstant 48 + 50(rtas): 49(ptr) Variable UniformConstant + 52: 14(int) Constant 255 + 66: TypeBool + 68: TypePointer Function 14(int) + 70: 66(bool) ConstantFalse + 76: TypeMatrix 9(fvec3) 4 + 77: TypePointer Function 76 + 80: TypeVector 8(float) 4 + 81: TypeMatrix 80(fvec4) 3 + 82: TypePointer Function 81 + 86: 66(bool) ConstantTrue + 91: TypeVector 8(float) 2 + 144: 8(float) Constant 1056964608 + 175: 14(int) Constant 1 + 198: 14(int) Constant 2 + 252(Ray): TypeStruct 9(fvec3) 8(float) 9(fvec3) 8(float) + 253: TypeRuntimeArray 252(Ray) + 254(Rays): TypeStruct 253 + 255: TypePointer Uniform 254(Rays) + 256: 255(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 43(ray): 25(ptr) Variable Function + 47(rayQuery): 46(ptr) Variable Function +69(candidateType): 68(ptr) Variable Function + 78(_mat4x3): 77(ptr) Variable Function + 83(_mat3x4): 82(ptr) Variable Function + 143(t): 35(ptr) Variable Function +156(committedStatus): 68(ptr) Variable Function + 240(o): 29(ptr) Variable Function + 242(d): 29(ptr) Variable Function + 44: 10(Ray) FunctionCall 12(makeRayDesc() + Store 43(ray) 44 + 51: 48 Load 50(rtas) + 53: 29(ptr) AccessChain 43(ray) 19 + 54: 9(fvec3) Load 53 + 55: 35(ptr) AccessChain 43(ray) 23 + 56: 8(float) Load 55 + 57: 29(ptr) AccessChain 43(ray) 31 + 58: 9(fvec3) Load 57 + 59: 35(ptr) AccessChain 43(ray) 37 + 60: 8(float) Load 59 + RayQueryInitializeKHR 47(rayQuery) 51 20 52 54 56 58 60 + Branch 61 + 61: Label + LoopMerge 63 64 None + Branch 65 + 65: Label + 67: 66(bool) RayQueryProceedKHR 47(rayQuery) + BranchConditional 67 62 63 + 62: Label + 71: 14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 19 + Store 69(candidateType) 71 + 72: 14(int) Load 69(candidateType) + SelectionMerge 75 None + Switch 72 75 + case 0: 73 + case 1: 74 + 73: Label + RayQueryTerminateKHR 47(rayQuery) + 79: 76 RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19 + Store 78(_mat4x3) 79 + 84: 76 Load 78(_mat4x3) + 85: 81 Transpose 84 + Store 83(_mat3x4) 85 + RayQueryConfirmIntersectionKHR 47(rayQuery) + 87: 66(bool) RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23 + SelectionMerge 89 None + BranchConditional 87 88 89 + 88: Label + 90: 2 FunctionCall 6(doSomething() + Branch 89 + 89: Label + 92: 91(fvec2) RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23 + 93: 8(float) CompositeExtract 92 0 + 94: 66(bool) FOrdEqual 93 27 + SelectionMerge 96 None + BranchConditional 94 95 96 + 95: Label + 97: 2 FunctionCall 6(doSomething() + Branch 96 + 96: Label + 98: 18(int) RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23 + 99: 66(bool) SGreaterThan 98 19 + SelectionMerge 101 None + BranchConditional 99 100 101 + 100: Label + 102: 2 FunctionCall 6(doSomething() + Branch 101 + 101: Label + 103: 18(int) RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23 + 104: 66(bool) SGreaterThan 103 19 + SelectionMerge 106 None + BranchConditional 104 105 106 + 105: Label + 107: 2 FunctionCall 6(doSomething() + Branch 106 + 106: Label + 108: 9(fvec3) RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23 + 109: 8(float) CompositeExtract 108 0 + 110: 66(bool) FOrdGreaterThan 109 27 + SelectionMerge 112 None + BranchConditional 110 111 112 + 111: Label + 113: 2 FunctionCall 6(doSomething() + Branch 112 + 112: Label + 114: 9(fvec3) RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23 + 115: 8(float) CompositeExtract 114 0 + 116: 66(bool) FOrdGreaterThan 115 27 + SelectionMerge 118 None + BranchConditional 116 117 118 + 117: Label + 119: 2 FunctionCall 6(doSomething() + Branch 118 + 118: Label + 120: 18(int) RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23 + 121: 66(bool) SGreaterThan 120 19 + SelectionMerge 123 None + BranchConditional 121 122 123 + 122: Label + 124: 2 FunctionCall 6(doSomething() + Branch 123 + 123: Label + 125: 8(float) RayQueryGetIntersectionTKHR 47(rayQuery) 23 + 126: 66(bool) FOrdGreaterThan 125 27 + SelectionMerge 128 None + BranchConditional 126 127 128 + 127: Label + 129: 2 FunctionCall 6(doSomething() + Branch 128 + 128: Label + 130: 18(int) RayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR 47(rayQuery) 23 + 131: 66(bool) UGreaterThan 130 20 + SelectionMerge 133 None + BranchConditional 131 132 133 + 132: Label + 134: 2 FunctionCall 6(doSomething() + Branch 133 + 133: Label + Branch 75 + 74: Label + 136: 76 RayQueryGetIntersectionObjectToWorldKHR 47(rayQuery) 19 + Store 78(_mat4x3) 136 + 137: 76 Load 78(_mat4x3) + 138: 81 Transpose 137 + Store 83(_mat3x4) 138 + 139: 66(bool) RayQueryGetIntersectionCandidateAABBOpaqueKHR 47(rayQuery) + SelectionMerge 141 None + BranchConditional 139 140 141 + 140: Label + 142: 2 FunctionCall 6(doSomething() + Branch 141 + 141: Label + Store 143(t) 144 + 145: 8(float) Load 143(t) + RayQueryGenerateIntersectionKHR 47(rayQuery) 145 + RayQueryTerminateKHR 47(rayQuery) + Branch 75 + 75: Label + Branch 64 + 64: Label + Branch 61 + 63: Label + 148: 35(ptr) AccessChain 83(_mat3x4) 19 20 + 149: 8(float) Load 148 + 150: 35(ptr) AccessChain 78(_mat4x3) 19 20 + 151: 8(float) Load 150 + 152: 66(bool) FOrdEqual 149 151 + SelectionMerge 154 None + BranchConditional 152 153 154 + 153: Label + 155: 2 FunctionCall 6(doSomething() + Branch 154 + 154: Label + 157: 14(int) RayQueryGetIntersectionTypeKHR 47(rayQuery) 23 + Store 156(committedStatus) 157 + 158: 14(int) Load 156(committedStatus) + SelectionMerge 162 None + Switch 158 162 + case 0: 159 + case 1: 160 + case 2: 161 + 159: Label + 163: 76 RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 19 + Store 78(_mat4x3) 163 + 164: 76 Load 78(_mat4x3) + 165: 81 Transpose 164 + Store 83(_mat3x4) 165 + Branch 162 + 160: Label + 167: 76 RayQueryGetIntersectionWorldToObjectKHR 47(rayQuery) 23 + Store 78(_mat4x3) 167 + 168: 76 Load 78(_mat4x3) + 169: 81 Transpose 168 + Store 83(_mat3x4) 169 + 170: 66(bool) RayQueryGetIntersectionFrontFaceKHR 47(rayQuery) 23 + SelectionMerge 172 None + BranchConditional 170 171 172 + 171: Label + 173: 2 FunctionCall 6(doSomething() + Branch 172 + 172: Label + 174: 91(fvec2) RayQueryGetIntersectionBarycentricsKHR 47(rayQuery) 23 + 176: 8(float) CompositeExtract 174 1 + 177: 66(bool) FOrdEqual 176 27 + SelectionMerge 179 None + BranchConditional 177 178 179 + 178: Label + 180: 2 FunctionCall 6(doSomething() + Branch 179 + 179: Label + Branch 162 + 161: Label + 182: 18(int) RayQueryGetIntersectionGeometryIndexKHR 47(rayQuery) 23 + 183: 66(bool) SGreaterThan 182 19 + SelectionMerge 185 None + BranchConditional 183 184 185 + 184: Label + 186: 2 FunctionCall 6(doSomething() + Branch 185 + 185: Label + 187: 18(int) RayQueryGetIntersectionInstanceIdKHR 47(rayQuery) 23 + 188: 66(bool) SGreaterThan 187 19 + SelectionMerge 190 None + BranchConditional 188 189 190 + 189: Label + 191: 2 FunctionCall 6(doSomething() + Branch 190 + 190: Label + 192: 18(int) RayQueryGetIntersectionInstanceCustomIndexKHR 47(rayQuery) 23 + 193: 66(bool) SGreaterThan 192 19 + SelectionMerge 195 None + BranchConditional 193 194 195 + 194: Label + 196: 2 FunctionCall 6(doSomething() + Branch 195 + 195: Label + 197: 9(fvec3) RayQueryGetIntersectionObjectRayDirectionKHR 47(rayQuery) 23 + 199: 8(float) CompositeExtract 197 2 + 200: 66(bool) FOrdGreaterThan 199 27 + SelectionMerge 202 None + BranchConditional 200 201 202 + 201: Label + 203: 2 FunctionCall 6(doSomething() + Branch 202 + 202: Label + 204: 9(fvec3) RayQueryGetIntersectionObjectRayOriginKHR 47(rayQuery) 23 + 205: 8(float) CompositeExtract 204 0 + 206: 66(bool) FOrdGreaterThan 205 27 + SelectionMerge 208 None + BranchConditional 206 207 208 + 207: Label + 209: 2 FunctionCall 6(doSomething() + Branch 208 + 208: Label + 210: 18(int) RayQueryGetIntersectionPrimitiveIndexKHR 47(rayQuery) 23 + 211: 66(bool) SGreaterThan 210 19 + SelectionMerge 213 None + BranchConditional 211 212 213 + 212: Label + 214: 2 FunctionCall 6(doSomething() + Branch 213 + 213: Label + 215: 8(float) RayQueryGetIntersectionTKHR 47(rayQuery) 23 + 216: 66(bool) FOrdGreaterThan 215 27 + SelectionMerge 218 None + BranchConditional 216 217 218 + 217: Label + 219: 2 FunctionCall 6(doSomething() + Branch 218 + 218: Label + Branch 162 + 162: Label + 222: 35(ptr) AccessChain 83(_mat3x4) 19 20 + 223: 8(float) Load 222 + 224: 35(ptr) AccessChain 78(_mat4x3) 19 20 + 225: 8(float) Load 224 + 226: 66(bool) FOrdEqual 223 225 + SelectionMerge 228 None + BranchConditional 226 227 228 + 227: Label + 229: 2 FunctionCall 6(doSomething() + Branch 228 + 228: Label + 230: 14(int) RayQueryGetRayFlagsKHR 47(rayQuery) + 231: 66(bool) UGreaterThan 230 20 + SelectionMerge 233 None + BranchConditional 231 232 233 + 232: Label + 234: 2 FunctionCall 6(doSomething() + Branch 233 + 233: Label + 235: 8(float) RayQueryGetRayTMinKHR 47(rayQuery) + 236: 66(bool) FOrdGreaterThan 235 27 + SelectionMerge 238 None + BranchConditional 236 237 238 + 237: Label + 239: 2 FunctionCall 6(doSomething() + Branch 238 + 238: Label + 241: 9(fvec3) RayQueryGetWorldRayOriginKHR 47(rayQuery) + Store 240(o) 241 + 243: 9(fvec3) RayQueryGetWorldRayDirectionKHR 47(rayQuery) + Store 242(d) 243 + 244: 35(ptr) AccessChain 240(o) 20 + 245: 8(float) Load 244 + 246: 35(ptr) AccessChain 242(d) 198 + 247: 8(float) Load 246 + 248: 66(bool) FOrdEqual 245 247 + SelectionMerge 250 None + BranchConditional 248 249 250 + 249: Label + 251: 2 FunctionCall 6(doSomething() + Branch 250 + 250: Label + Return + FunctionEnd + 6(doSomething(): 2 Function None 3 + 7: Label + 22: 21(ptr) AccessChain 17 19 + Store 22 20 + 24: 21(ptr) AccessChain 17 23 + Store 24 20 + Return + FunctionEnd +12(makeRayDesc(): 10(Ray) Function None 11 + 13: Label + 26(ray): 25(ptr) Variable Function + 30: 29(ptr) AccessChain 26(ray) 19 + Store 30 28 + 34: 29(ptr) AccessChain 26(ray) 31 + Store 34 33 + 36: 35(ptr) AccessChain 26(ray) 23 + Store 36 27 + 39: 35(ptr) AccessChain 26(ray) 37 + Store 39 38 + 40: 10(Ray) Load 26(ray) + ReturnValue 40 + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/rayQuery-committed.Error.rgen.out b/core/deps/glslang/Test/baseResults/rayQuery-committed.Error.rgen.out new file mode 100644 index 000000000..037f6927f --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-committed.Error.rgen.out @@ -0,0 +1,19 @@ +rayQuery-committed.Error.rgen +ERROR: 0:48: 'committed' : argument must be compile-time constant +ERROR: 0:53: 'committed' : argument must be compile-time constant +ERROR: 0:54: 'committed' : argument must be compile-time constant +ERROR: 0:58: 'committed' : argument must be compile-time constant +ERROR: 0:62: 'committed' : argument must be compile-time constant +ERROR: 0:66: 'committed' : argument must be compile-time constant +ERROR: 0:70: 'committed' : argument must be compile-time constant +ERROR: 0:74: 'committed' : argument must be compile-time constant +ERROR: 0:78: 'committed' : argument must be compile-time constant +ERROR: 0:82: 'committed' : argument must be compile-time constant +ERROR: 0:86: 'committed' : argument must be compile-time constant +ERROR: 0:90: 'committed' : argument must be compile-time constant +ERROR: 0:97: 'committed' : argument must be compile-time constant +ERROR: 0:100: 'committed' : argument must be compile-time constant +ERROR: 14 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/rayQuery-initialize.rgen.out b/core/deps/glslang/Test/baseResults/rayQuery-initialize.rgen.out new file mode 100644 index 000000000..782493009 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-initialize.rgen.out @@ -0,0 +1,166 @@ +rayQuery-initialize.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 103 + + Capability RayQueryProvisionalKHR + Capability RayTracingNV + Extension "SPV_KHR_ray_query" + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" 23 28 + Source GLSL 460 + SourceExtension "GL_EXT_ray_query" + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 8 "launchIndex(" + Name 14 "Ray" + MemberName 14(Ray) 0 "pos" + MemberName 14(Ray) 1 "tmin" + MemberName 14(Ray) 2 "dir" + MemberName 14(Ray) 3 "tmax" + Name 19 "doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;" + Name 17 "rayQuery" + Name 18 "ray" + Name 23 "gl_LaunchIDNV" + Name 28 "gl_LaunchSizeNV" + Name 50 "rtas" + Name 69 "index" + Name 71 "ray" + Name 72 "Ray" + MemberName 72(Ray) 0 "pos" + MemberName 72(Ray) 1 "tmin" + MemberName 72(Ray) 2 "dir" + MemberName 72(Ray) 3 "tmax" + Name 74 "Rays" + MemberName 74(Rays) 0 "rays" + Name 76 "" + Name 89 "rayQuery" + Name 90 "param" + Decorate 23(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 28(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR + Decorate 50(rtas) DescriptorSet 0 + Decorate 50(rtas) Binding 0 + MemberDecorate 72(Ray) 0 Offset 0 + MemberDecorate 72(Ray) 1 Offset 12 + MemberDecorate 72(Ray) 2 Offset 16 + MemberDecorate 72(Ray) 3 Offset 28 + Decorate 73 ArrayStride 32 + MemberDecorate 74(Rays) 0 Offset 0 + Decorate 74(Rays) BufferBlock + Decorate 76 DescriptorSet 0 + Decorate 76 Binding 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeFunction 6(int) + 10: TypeRayQueryProvisionalKHR + 11: TypePointer Function 10 + 12: TypeFloat 32 + 13: TypeVector 12(float) 3 + 14(Ray): TypeStruct 13(fvec3) 12(float) 13(fvec3) 12(float) + 15: TypePointer Function 14(Ray) + 16: TypeFunction 2 11(ptr) 15(ptr) + 21: TypeVector 6(int) 3 + 22: TypePointer Input 21(ivec3) +23(gl_LaunchIDNV): 22(ptr) Variable Input + 24: 6(int) Constant 2 + 25: TypePointer Input 6(int) +28(gl_LaunchSizeNV): 22(ptr) Variable Input + 29: 6(int) Constant 0 + 33: 6(int) Constant 1 + 48: TypeAccelerationStructureKHR + 49: TypePointer UniformConstant 48 + 50(rtas): 49(ptr) Variable UniformConstant + 52: 6(int) Constant 16 + 53: TypeInt 32 1 + 54: 53(int) Constant 0 + 55: TypePointer Function 13(fvec3) + 58: 53(int) Constant 1 + 59: TypePointer Function 12(float) + 62: 53(int) Constant 2 + 65: 53(int) Constant 3 + 68: TypePointer Function 6(int) + 72(Ray): TypeStruct 13(fvec3) 12(float) 13(fvec3) 12(float) + 73: TypeRuntimeArray 72(Ray) + 74(Rays): TypeStruct 73 + 75: TypePointer Uniform 74(Rays) + 76: 75(ptr) Variable Uniform + 78: TypePointer Uniform 72(Ray) + 94: 6(int) Constant 32 + 4(main): 2 Function None 3 + 5: Label + 69(index): 68(ptr) Variable Function + 71(ray): 15(ptr) Variable Function + 89(rayQuery): 11(ptr) Variable Function + 90(param): 15(ptr) Variable Function + 70: 6(int) FunctionCall 8(launchIndex() + Store 69(index) 70 + 77: 6(int) Load 69(index) + 79: 78(ptr) AccessChain 76 54 77 + 80: 72(Ray) Load 79 + 81: 13(fvec3) CompositeExtract 80 0 + 82: 55(ptr) AccessChain 71(ray) 54 + Store 82 81 + 83: 12(float) CompositeExtract 80 1 + 84: 59(ptr) AccessChain 71(ray) 58 + Store 84 83 + 85: 13(fvec3) CompositeExtract 80 2 + 86: 55(ptr) AccessChain 71(ray) 62 + Store 86 85 + 87: 12(float) CompositeExtract 80 3 + 88: 59(ptr) AccessChain 71(ray) 65 + Store 88 87 + 91: 14(Ray) Load 71(ray) + Store 90(param) 91 + 92: 2 FunctionCall 19(doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;) 89(rayQuery) 90(param) + 93: 48 Load 50(rtas) + 95: 55(ptr) AccessChain 71(ray) 54 + 96: 13(fvec3) Load 95 + 97: 59(ptr) AccessChain 71(ray) 58 + 98: 12(float) Load 97 + 99: 55(ptr) AccessChain 71(ray) 62 + 100: 13(fvec3) Load 99 + 101: 59(ptr) AccessChain 71(ray) 65 + 102: 12(float) Load 101 + RayQueryInitializeKHR 89(rayQuery) 93 33 94 96 98 100 102 + Return + FunctionEnd + 8(launchIndex(): 6(int) Function None 7 + 9: Label + 26: 25(ptr) AccessChain 23(gl_LaunchIDNV) 24 + 27: 6(int) Load 26 + 30: 25(ptr) AccessChain 28(gl_LaunchSizeNV) 29 + 31: 6(int) Load 30 + 32: 6(int) IMul 27 31 + 34: 25(ptr) AccessChain 28(gl_LaunchSizeNV) 33 + 35: 6(int) Load 34 + 36: 6(int) IMul 32 35 + 37: 25(ptr) AccessChain 23(gl_LaunchIDNV) 33 + 38: 6(int) Load 37 + 39: 25(ptr) AccessChain 28(gl_LaunchSizeNV) 29 + 40: 6(int) Load 39 + 41: 6(int) IMul 38 40 + 42: 6(int) IAdd 36 41 + 43: 25(ptr) AccessChain 23(gl_LaunchIDNV) 29 + 44: 6(int) Load 43 + 45: 6(int) IAdd 42 44 + ReturnValue 45 + FunctionEnd +19(doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;): 2 Function None 16 + 17(rayQuery): 11(ptr) FunctionParameter + 18(ray): 15(ptr) FunctionParameter + 20: Label + 51: 48 Load 50(rtas) + 56: 55(ptr) AccessChain 18(ray) 54 + 57: 13(fvec3) Load 56 + 60: 59(ptr) AccessChain 18(ray) 58 + 61: 12(float) Load 60 + 63: 55(ptr) AccessChain 18(ray) 62 + 64: 13(fvec3) Load 63 + 66: 59(ptr) AccessChain 18(ray) 65 + 67: 12(float) Load 66 + RayQueryInitializeKHR 17(rayQuery) 51 29 52 57 61 64 67 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/rayQuery-no-cse.rgen.out b/core/deps/glslang/Test/baseResults/rayQuery-no-cse.rgen.out new file mode 100644 index 000000000..c09e34822 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery-no-cse.rgen.out @@ -0,0 +1,173 @@ +rayQuery-no-cse.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 107 + + Capability RayQueryProvisionalKHR + Capability RayTracingNV + Extension "SPV_KHR_ray_query" + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" 23 28 + Source GLSL 460 + SourceExtension "GL_EXT_ray_query" + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 8 "launchIndex(" + Name 14 "Ray" + MemberName 14(Ray) 0 "pos" + MemberName 14(Ray) 1 "tmin" + MemberName 14(Ray) 2 "dir" + MemberName 14(Ray) 3 "tmax" + Name 19 "doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;" + Name 17 "rayQuery" + Name 18 "ray" + Name 23 "gl_LaunchIDNV" + Name 28 "gl_LaunchSizeNV" + Name 50 "rtas" + Name 69 "index" + Name 71 "ray" + Name 72 "Ray" + MemberName 72(Ray) 0 "pos" + MemberName 72(Ray) 1 "tmin" + MemberName 72(Ray) 2 "dir" + MemberName 72(Ray) 3 "tmax" + Name 74 "Rays" + MemberName 74(Rays) 0 "rays" + Name 76 "" + Name 89 "rayQuery1" + Name 90 "param" + Name 103 "rayQuery2" + Name 104 "param" + Decorate 23(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 28(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR + Decorate 50(rtas) DescriptorSet 0 + Decorate 50(rtas) Binding 0 + MemberDecorate 72(Ray) 0 Offset 0 + MemberDecorate 72(Ray) 1 Offset 12 + MemberDecorate 72(Ray) 2 Offset 16 + MemberDecorate 72(Ray) 3 Offset 28 + Decorate 73 ArrayStride 32 + MemberDecorate 74(Rays) 0 Offset 0 + Decorate 74(Rays) BufferBlock + Decorate 76 DescriptorSet 0 + Decorate 76 Binding 2 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeFunction 6(int) + 10: TypeRayQueryProvisionalKHR + 11: TypePointer Function 10 + 12: TypeFloat 32 + 13: TypeVector 12(float) 3 + 14(Ray): TypeStruct 13(fvec3) 12(float) 13(fvec3) 12(float) + 15: TypePointer Function 14(Ray) + 16: TypeFunction 2 11(ptr) 15(ptr) + 21: TypeVector 6(int) 3 + 22: TypePointer Input 21(ivec3) +23(gl_LaunchIDNV): 22(ptr) Variable Input + 24: 6(int) Constant 2 + 25: TypePointer Input 6(int) +28(gl_LaunchSizeNV): 22(ptr) Variable Input + 29: 6(int) Constant 0 + 33: 6(int) Constant 1 + 48: TypeAccelerationStructureKHR + 49: TypePointer UniformConstant 48 + 50(rtas): 49(ptr) Variable UniformConstant + 52: 6(int) Constant 16 + 53: TypeInt 32 1 + 54: 53(int) Constant 0 + 55: TypePointer Function 13(fvec3) + 58: 53(int) Constant 1 + 59: TypePointer Function 12(float) + 62: 53(int) Constant 2 + 65: 53(int) Constant 3 + 68: TypePointer Function 6(int) + 72(Ray): TypeStruct 13(fvec3) 12(float) 13(fvec3) 12(float) + 73: TypeRuntimeArray 72(Ray) + 74(Rays): TypeStruct 73 + 75: TypePointer Uniform 74(Rays) + 76: 75(ptr) Variable Uniform + 78: TypePointer Uniform 72(Ray) + 94: 6(int) Constant 32 + 4(main): 2 Function None 3 + 5: Label + 69(index): 68(ptr) Variable Function + 71(ray): 15(ptr) Variable Function + 89(rayQuery1): 11(ptr) Variable Function + 90(param): 15(ptr) Variable Function + 103(rayQuery2): 11(ptr) Variable Function + 104(param): 15(ptr) Variable Function + 70: 6(int) FunctionCall 8(launchIndex() + Store 69(index) 70 + 77: 6(int) Load 69(index) + 79: 78(ptr) AccessChain 76 54 77 + 80: 72(Ray) Load 79 + 81: 13(fvec3) CompositeExtract 80 0 + 82: 55(ptr) AccessChain 71(ray) 54 + Store 82 81 + 83: 12(float) CompositeExtract 80 1 + 84: 59(ptr) AccessChain 71(ray) 58 + Store 84 83 + 85: 13(fvec3) CompositeExtract 80 2 + 86: 55(ptr) AccessChain 71(ray) 62 + Store 86 85 + 87: 12(float) CompositeExtract 80 3 + 88: 59(ptr) AccessChain 71(ray) 65 + Store 88 87 + 91: 14(Ray) Load 71(ray) + Store 90(param) 91 + 92: 2 FunctionCall 19(doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;) 89(rayQuery1) 90(param) + 93: 48 Load 50(rtas) + 95: 55(ptr) AccessChain 71(ray) 54 + 96: 13(fvec3) Load 95 + 97: 59(ptr) AccessChain 71(ray) 58 + 98: 12(float) Load 97 + 99: 55(ptr) AccessChain 71(ray) 62 + 100: 13(fvec3) Load 99 + 101: 59(ptr) AccessChain 71(ray) 65 + 102: 12(float) Load 101 + RayQueryInitializeKHR 89(rayQuery1) 93 33 94 96 98 100 102 + 105: 14(Ray) Load 71(ray) + Store 104(param) 105 + 106: 2 FunctionCall 19(doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;) 103(rayQuery2) 104(param) + Return + FunctionEnd + 8(launchIndex(): 6(int) Function None 7 + 9: Label + 26: 25(ptr) AccessChain 23(gl_LaunchIDNV) 24 + 27: 6(int) Load 26 + 30: 25(ptr) AccessChain 28(gl_LaunchSizeNV) 29 + 31: 6(int) Load 30 + 32: 6(int) IMul 27 31 + 34: 25(ptr) AccessChain 28(gl_LaunchSizeNV) 33 + 35: 6(int) Load 34 + 36: 6(int) IMul 32 35 + 37: 25(ptr) AccessChain 23(gl_LaunchIDNV) 33 + 38: 6(int) Load 37 + 39: 25(ptr) AccessChain 28(gl_LaunchSizeNV) 29 + 40: 6(int) Load 39 + 41: 6(int) IMul 38 40 + 42: 6(int) IAdd 36 41 + 43: 25(ptr) AccessChain 23(gl_LaunchIDNV) 29 + 44: 6(int) Load 43 + 45: 6(int) IAdd 42 44 + ReturnValue 45 + FunctionEnd +19(doInitialize(rq1;struct-Ray-vf3-f1-vf3-f11;): 2 Function None 16 + 17(rayQuery): 11(ptr) FunctionParameter + 18(ray): 15(ptr) FunctionParameter + 20: Label + 51: 48 Load 50(rtas) + 56: 55(ptr) AccessChain 18(ray) 54 + 57: 13(fvec3) Load 56 + 60: 59(ptr) AccessChain 18(ray) 58 + 61: 12(float) Load 60 + 63: 55(ptr) AccessChain 18(ray) 62 + 64: 13(fvec3) Load 63 + 66: 59(ptr) AccessChain 18(ray) 65 + 67: 12(float) Load 66 + RayQueryInitializeKHR 17(rayQuery) 51 29 52 57 61 64 67 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/rayQuery.rgen.out b/core/deps/glslang/Test/baseResults/rayQuery.rgen.out new file mode 100644 index 000000000..4658338c1 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/rayQuery.rgen.out @@ -0,0 +1,82 @@ +rayQuery.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 44 + + Capability RayQueryProvisionalKHR + Capability RayTracingNV + Extension "SPV_KHR_ray_query" + Extension "SPV_NV_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" + Source GLSL 460 + SourceExtension "GL_EXT_ray_query" + SourceExtension "GL_NV_ray_tracing" + Name 4 "main" + Name 8 "rayFlags" + Name 12 "tMin" + Name 14 "tMax" + Name 18 "localRayQuery" + Name 21 "acc0" + Name 26 "block" + MemberName 26(block) 0 "dir" + MemberName 26(block) 1 "origin" + Name 28 "" + Decorate 21(acc0) DescriptorSet 0 + Decorate 21(acc0) Binding 0 + MemberDecorate 26(block) 0 Offset 0 + MemberDecorate 26(block) 1 Offset 16 + Decorate 26(block) BufferBlock + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: 6(int) Constant 9 + 10: TypeFloat 32 + 11: TypePointer Function 10(float) + 13: 10(float) Constant 0 + 15: 10(float) Constant 1148846080 + 16: TypeRayQueryProvisionalKHR + 17: TypePointer Function 16 + 19: TypeAccelerationStructureKHR + 20: TypePointer UniformConstant 19 + 21(acc0): 20(ptr) Variable UniformConstant + 24: 6(int) Constant 255 + 25: TypeVector 10(float) 3 + 26(block): TypeStruct 25(fvec3) 25(fvec3) + 27: TypePointer ShaderRecordBufferKHR 26(block) + 28: 27(ptr) Variable ShaderRecordBufferKHR + 29: TypeInt 32 1 + 30: 29(int) Constant 1 + 31: TypePointer ShaderRecordBufferKHR 25(fvec3) + 35: 29(int) Constant 0 + 39: TypeBool + 4(main): 2 Function None 3 + 5: Label + 8(rayFlags): 7(ptr) Variable Function + 12(tMin): 11(ptr) Variable Function + 14(tMax): 11(ptr) Variable Function +18(localRayQuery): 17(ptr) Variable Function + Store 8(rayFlags) 9 + Store 12(tMin) 13 + Store 14(tMax) 15 + 22: 19 Load 21(acc0) + 23: 6(int) Load 8(rayFlags) + 32: 31(ptr) AccessChain 28 30 + 33: 25(fvec3) Load 32 + 34: 10(float) Load 12(tMin) + 36: 31(ptr) AccessChain 28 35 + 37: 25(fvec3) Load 36 + 38: 10(float) Load 14(tMax) + RayQueryInitializeKHR 18(localRayQuery) 22 23 24 33 34 37 38 + 40: 39(bool) RayQueryProceedKHR 18(localRayQuery) + 41: 39(bool) LogicalNot 40 + SelectionMerge 43 None + BranchConditional 41 42 43 + 42: Label + RayQueryTerminateKHR 18(localRayQuery) + Branch 43 + 43: Label + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out b/core/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out index d044b9730..6bef52dd2 100644 --- a/core/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out +++ b/core/deps/glslang/Test/baseResults/spv.AnyHitShader.rahit.out @@ -7,7 +7,7 @@ spv.AnyHitShader.rahit Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint AnyHitNV 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 + EntryPoint AnyHitKHR 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -42,21 +42,21 @@ spv.AnyHitShader.rahit Name 66 "v14" Name 67 "gl_WorldToObjectNV" Name 71 "incomingPayload" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId Decorate 23(gl_InstanceID) BuiltIn InstanceId - Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexNV - Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV - Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV - Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV - Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV - Decorate 47(gl_RayTminNV) BuiltIn RayTminNV - Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxNV - Decorate 53(gl_HitTNV) BuiltIn HitTNV - Decorate 58(gl_HitKindNV) BuiltIn HitKindNV - Decorate 64(gl_ObjectToWorldNV) BuiltIn ObjectToWorldNV - Decorate 67(gl_WorldToObjectNV) BuiltIn WorldToObjectNV + Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexKHR + Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginKHR + Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionKHR + Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginKHR + Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionKHR + Decorate 47(gl_RayTminNV) BuiltIn RayTminKHR + Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxKHR + Decorate 53(gl_HitTNV) BuiltIn HitTKHR + Decorate 58(gl_HitKindNV) BuiltIn HitKindKHR + Decorate 64(gl_ObjectToWorldNV) BuiltIn ObjectToWorldKHR + Decorate 67(gl_WorldToObjectNV) BuiltIn WorldToObjectKHR Decorate 71(incomingPayload) Location 1 2: TypeVoid 3: TypeFunction 2 @@ -94,8 +94,8 @@ spv.AnyHitShader.rahit 64(gl_ObjectToWorldNV): 63(ptr) Variable Input 67(gl_WorldToObjectNV): 63(ptr) Variable Input 69: TypeVector 28(float) 4 - 70: TypePointer IncomingRayPayloadNV 69(fvec4) -71(incomingPayload): 70(ptr) Variable IncomingRayPayloadNV + 70: TypePointer IncomingRayPayloadKHR 69(fvec4) +71(incomingPayload): 70(ptr) Variable IncomingRayPayloadKHR 72: 28(float) Constant 1056964608 73: 69(fvec4) ConstantComposite 72 72 72 72 75: 16(int) Constant 1 @@ -153,10 +153,10 @@ spv.AnyHitShader.rahit SelectionMerge 79 None BranchConditional 77 78 80 78: Label - IgnoreIntersectionNV + IgnoreIntersectionKHR Branch 79 80: Label - TerminateRayNV + TerminateRayKHR Branch 79 79: Label Return diff --git a/core/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out b/core/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out index 482008dc8..cefdc5098 100644 --- a/core/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out +++ b/core/deps/glslang/Test/baseResults/spv.ClosestHitShader.rchit.out @@ -7,7 +7,7 @@ spv.ClosestHitShader.rchit Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint ClosestHitNV 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 + EntryPoint ClosestHitKHR 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -44,21 +44,21 @@ spv.ClosestHitShader.rchit Name 71 "accNV" Name 85 "localPayload" Name 87 "incomingPayload" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId Decorate 23(gl_InstanceID) BuiltIn InstanceId - Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexNV - Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV - Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV - Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV - Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV - Decorate 47(gl_RayTminNV) BuiltIn RayTminNV - Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxNV - Decorate 53(gl_HitTNV) BuiltIn HitTNV - Decorate 58(gl_HitKindNV) BuiltIn HitKindNV - Decorate 64(gl_ObjectToWorldNV) BuiltIn ObjectToWorldNV - Decorate 67(gl_WorldToObjectNV) BuiltIn WorldToObjectNV + Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexKHR + Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginKHR + Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionKHR + Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginKHR + Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionKHR + Decorate 47(gl_RayTminNV) BuiltIn RayTminKHR + Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxKHR + Decorate 53(gl_HitTNV) BuiltIn HitTKHR + Decorate 58(gl_HitKindNV) BuiltIn HitKindKHR + Decorate 64(gl_ObjectToWorldNV) BuiltIn ObjectToWorldKHR + Decorate 67(gl_WorldToObjectNV) BuiltIn WorldToObjectKHR Decorate 71(accNV) DescriptorSet 0 Decorate 71(accNV) Binding 0 Decorate 85(localPayload) Location 0 @@ -98,7 +98,7 @@ spv.ClosestHitShader.rchit 63: TypePointer Input 60 64(gl_ObjectToWorldNV): 63(ptr) Variable Input 67(gl_WorldToObjectNV): 63(ptr) Variable Input - 69: TypeAccelerationStructureNV + 69: TypeAccelerationStructureKHR 70: TypePointer UniformConstant 69 71(accNV): 70(ptr) Variable UniformConstant 73: 6(int) Constant 0 @@ -112,10 +112,10 @@ spv.ClosestHitShader.rchit 81: 28(float) Constant 1061158912 82: 16(int) Constant 1 83: TypeVector 28(float) 4 - 84: TypePointer RayPayloadNV 83(fvec4) -85(localPayload): 84(ptr) Variable RayPayloadNV - 86: TypePointer IncomingRayPayloadNV 83(fvec4) -87(incomingPayload): 86(ptr) Variable IncomingRayPayloadNV + 84: TypePointer RayPayloadKHR 83(fvec4) +85(localPayload): 84(ptr) Variable RayPayloadKHR + 86: TypePointer IncomingRayPayloadKHR 83(fvec4) +87(incomingPayload): 86(ptr) Variable IncomingRayPayloadKHR 4(main): 2 Function None 3 5: Label 9(v0): 8(ptr) Variable Function @@ -164,6 +164,6 @@ spv.ClosestHitShader.rchit 68: 60 Load 67(gl_WorldToObjectNV) Store 66(v14) 68 72: 69 Load 71(accNV) - TraceNV 72 73 74 75 76 73 78 77 80 81 82 + TraceRayKHR 72 73 74 75 76 73 78 77 80 81 82 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out b/core/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out index 4fe4edf04..bf9924184 100644 --- a/core/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out +++ b/core/deps/glslang/Test/baseResults/spv.IntersectShader.rint.out @@ -7,7 +7,7 @@ spv.IntersectShader.rint Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint IntersectionNV 4 "main" 11 14 20 23 26 33 36 39 42 47 50 56 59 + EntryPoint IntersectionKHR 4 "main" 11 14 20 23 26 33 36 39 42 47 50 56 59 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -38,19 +38,19 @@ spv.IntersectShader.rint Name 58 "v12" Name 59 "gl_WorldToObjectNV" Name 63 "iAttr" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId Decorate 23(gl_InstanceID) BuiltIn InstanceId - Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexNV - Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV - Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV - Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV - Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV - Decorate 47(gl_RayTminNV) BuiltIn RayTminNV - Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxNV - Decorate 56(gl_ObjectToWorldNV) BuiltIn ObjectToWorldNV - Decorate 59(gl_WorldToObjectNV) BuiltIn WorldToObjectNV + Decorate 26(gl_InstanceCustomIndexNV) BuiltIn InstanceCustomIndexKHR + Decorate 33(gl_WorldRayOriginNV) BuiltIn WorldRayOriginKHR + Decorate 36(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionKHR + Decorate 39(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginKHR + Decorate 42(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionKHR + Decorate 47(gl_RayTminNV) BuiltIn RayTminKHR + Decorate 50(gl_RayTmaxNV) BuiltIn RayTmaxKHR + Decorate 56(gl_ObjectToWorldNV) BuiltIn ObjectToWorldKHR + Decorate 59(gl_WorldToObjectNV) BuiltIn WorldToObjectKHR 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -83,8 +83,8 @@ spv.IntersectShader.rint 56(gl_ObjectToWorldNV): 55(ptr) Variable Input 59(gl_WorldToObjectNV): 55(ptr) Variable Input 61: TypeVector 28(float) 4 - 62: TypePointer HitAttributeNV 61(fvec4) - 63(iAttr): 62(ptr) Variable HitAttributeNV + 62: TypePointer HitAttributeKHR 61(fvec4) + 63(iAttr): 62(ptr) Variable HitAttributeKHR 64: 28(float) Constant 1056964608 65: 28(float) Constant 0 66: 28(float) Constant 1065353216 @@ -133,6 +133,6 @@ spv.IntersectShader.rint 60: 52 Load 59(gl_WorldToObjectNV) Store 58(v12) 60 Store 63(iAttr) 67 - 70: 69(bool) ReportIntersectionNV 64 68 + 70: 69(bool) ReportIntersectionKHR 64 68 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out b/core/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out index 37fd3bda0..b81104461 100644 --- a/core/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out +++ b/core/deps/glslang/Test/baseResults/spv.MissShader.rmiss.out @@ -7,7 +7,7 @@ spv.MissShader.rmiss Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint MissNV 4 "main" 11 14 21 24 27 30 35 38 + EntryPoint MissKHR 4 "main" 11 14 21 24 27 30 35 38 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -30,14 +30,14 @@ spv.MissShader.rmiss Name 42 "accNV" Name 57 "localPayload" Name 59 "incomingPayload" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV - Decorate 21(gl_WorldRayOriginNV) BuiltIn WorldRayOriginNV - Decorate 24(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionNV - Decorate 27(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginNV - Decorate 30(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionNV - Decorate 35(gl_RayTminNV) BuiltIn RayTminNV - Decorate 38(gl_RayTmaxNV) BuiltIn RayTmaxNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR + Decorate 21(gl_WorldRayOriginNV) BuiltIn WorldRayOriginKHR + Decorate 24(gl_WorldRayDirectionNV) BuiltIn WorldRayDirectionKHR + Decorate 27(gl_ObjectRayOriginNV) BuiltIn ObjectRayOriginKHR + Decorate 30(gl_ObjectRayDirectionNV) BuiltIn ObjectRayDirectionKHR + Decorate 35(gl_RayTminNV) BuiltIn RayTminKHR + Decorate 38(gl_RayTmaxNV) BuiltIn RayTmaxKHR Decorate 42(accNV) DescriptorSet 0 Decorate 42(accNV) Binding 0 Decorate 57(localPayload) Location 0 @@ -62,7 +62,7 @@ spv.MissShader.rmiss 34: TypePointer Input 16(float) 35(gl_RayTminNV): 34(ptr) Variable Input 38(gl_RayTmaxNV): 34(ptr) Variable Input - 40: TypeAccelerationStructureNV + 40: TypeAccelerationStructureKHR 41: TypePointer UniformConstant 40 42(accNV): 41(ptr) Variable UniformConstant 44: 6(int) Constant 0 @@ -77,10 +77,10 @@ spv.MissShader.rmiss 53: TypeInt 32 1 54: 53(int) Constant 1 55: TypeVector 16(float) 4 - 56: TypePointer RayPayloadNV 55(fvec4) -57(localPayload): 56(ptr) Variable RayPayloadNV - 58: TypePointer IncomingRayPayloadNV 55(fvec4) -59(incomingPayload): 58(ptr) Variable IncomingRayPayloadNV + 56: TypePointer RayPayloadKHR 55(fvec4) +57(localPayload): 56(ptr) Variable RayPayloadKHR + 58: TypePointer IncomingRayPayloadKHR 55(fvec4) +59(incomingPayload): 58(ptr) Variable IncomingRayPayloadKHR 4(main): 2 Function None 3 5: Label 9(v0): 8(ptr) Variable Function @@ -108,6 +108,6 @@ spv.MissShader.rmiss 39: 16(float) Load 38(gl_RayTmaxNV) Store 37(v7) 39 43: 40 Load 42(accNV) - TraceNV 43 44 45 46 47 44 49 48 51 52 54 + TraceRayKHR 43 44 45 46 47 44 49 48 51 52 54 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.Operations.frag.out b/core/deps/glslang/Test/baseResults/spv.Operations.frag.out index 22aeecd9c..ad54f6ce5 100644 --- a/core/deps/glslang/Test/baseResults/spv.Operations.frag.out +++ b/core/deps/glslang/Test/baseResults/spv.Operations.frag.out @@ -1,12 +1,12 @@ spv.Operations.frag // Module Version 10000 // Generated by (magic number): 80008 -// Id's are bound by 532 +// Id's are bound by 583 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 11 22 212 288 485 526 531 + EntryPoint Fragment 4 "main" 11 22 220 296 314 539 580 ExecutionMode 4 OriginUpperLeft Source GLSL 450 Name 4 "main" @@ -14,23 +14,29 @@ spv.Operations.frag Name 11 "uv4" Name 20 "i" Name 22 "ui" - Name 181 "ub41" - Name 188 "f" - Name 212 "uf" - Name 285 "u" - Name 288 "uui" - Name 305 "b" - Name 342 "ub42" - Name 485 "FragColor" - Name 503 "m1" - Name 510 "m2" - Name 526 "uiv4" - Name 528 "ub" - Name 531 "uuv4" + Name 155 "swizzleTemp" + Name 189 "ub41" + Name 196 "f" + Name 220 "uf" + Name 293 "u" + Name 296 "uui" + Name 314 "uuv4" + Name 321 "msb" + Name 323 "swizzleTemp" + Name 324 "lsb" + Name 325 "swizzleTemp" + Name 326 "ResType" + Name 359 "b" + Name 396 "ub42" + Name 539 "FragColor" + Name 557 "m1" + Name 564 "m2" + Name 580 "uiv4" + Name 582 "ub" Decorate 22(ui) Flat - Decorate 288(uui) Flat - Decorate 526(uiv4) Flat - Decorate 531(uuv4) Flat + Decorate 296(uui) Flat + Decorate 314(uuv4) Flat + Decorate 580(uiv4) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -45,55 +51,66 @@ spv.Operations.frag 141: TypeInt 32 0 142: 141(int) Constant 0 143: TypePointer Function 6(float) - 178: TypeBool - 179: TypeVector 178(bool) 4 - 180: TypePointer Private 179(bvec4) - 181(ub41): 180(ptr) Variable Private - 211: TypePointer Input 6(float) - 212(uf): 211(ptr) Variable Input - 284: TypePointer Function 141(int) - 287: TypePointer Input 141(int) - 288(uui): 287(ptr) Variable Input - 304: TypePointer Function 178(bool) - 342(ub42): 180(ptr) Variable Private - 398: 18(int) Constant 2 - 405: 18(int) Constant 1 - 435: TypeVector 6(float) 3 - 454: 6(float) Constant 1073741824 - 461: 6(float) Constant 1065353216 - 466: 18(int) Constant 66 - 472: 18(int) Constant 17 - 484: TypePointer Output 7(fvec4) - 485(FragColor): 484(ptr) Variable Output - 501: TypeMatrix 7(fvec4) 4 - 502: TypePointer Function 501 - 504: 6(float) Constant 0 - 505: 7(fvec4) ConstantComposite 461 504 504 504 - 506: 7(fvec4) ConstantComposite 504 461 504 504 - 507: 7(fvec4) ConstantComposite 504 504 461 504 - 508: 7(fvec4) ConstantComposite 504 504 504 461 - 509: 501 ConstantComposite 505 506 507 508 - 511: 7(fvec4) ConstantComposite 504 504 504 504 - 512: 501 ConstantComposite 511 511 511 511 - 524: TypeVector 18(int) 4 - 525: TypePointer Input 524(ivec4) - 526(uiv4): 525(ptr) Variable Input - 527: TypePointer Private 178(bool) - 528(ub): 527(ptr) Variable Private - 529: TypeVector 141(int) 4 - 530: TypePointer Input 529(ivec4) - 531(uuv4): 530(ptr) Variable Input + 186: TypeBool + 187: TypeVector 186(bool) 4 + 188: TypePointer Private 187(bvec4) + 189(ub41): 188(ptr) Variable Private + 219: TypePointer Input 6(float) + 220(uf): 219(ptr) Variable Input + 292: TypePointer Function 141(int) + 295: TypePointer Input 141(int) + 296(uui): 295(ptr) Variable Input + 312: TypeVector 141(int) 4 + 313: TypePointer Input 312(ivec4) + 314(uuv4): 313(ptr) Variable Input + 315: TypeVector 141(int) 3 + 320: TypePointer Function 312(ivec4) + 322: TypePointer Function 315(ivec3) + 326(ResType): TypeStruct 315(ivec3) 315(ivec3) + 338: 141(int) Constant 1 + 342: 141(int) Constant 2 + 358: TypePointer Function 186(bool) + 396(ub42): 188(ptr) Variable Private + 452: 18(int) Constant 2 + 459: 18(int) Constant 1 + 489: TypeVector 6(float) 3 + 508: 6(float) Constant 1073741824 + 515: 6(float) Constant 1065353216 + 520: 18(int) Constant 66 + 526: 18(int) Constant 17 + 538: TypePointer Output 7(fvec4) + 539(FragColor): 538(ptr) Variable Output + 555: TypeMatrix 7(fvec4) 4 + 556: TypePointer Function 555 + 558: 6(float) Constant 0 + 559: 7(fvec4) ConstantComposite 515 558 558 558 + 560: 7(fvec4) ConstantComposite 558 515 558 558 + 561: 7(fvec4) ConstantComposite 558 558 515 558 + 562: 7(fvec4) ConstantComposite 558 558 558 515 + 563: 555 ConstantComposite 559 560 561 562 + 565: 7(fvec4) ConstantComposite 558 558 558 558 + 566: 555 ConstantComposite 565 565 565 565 + 578: TypeVector 18(int) 4 + 579: TypePointer Input 578(ivec4) + 580(uiv4): 579(ptr) Variable Input + 581: TypePointer Private 186(bool) + 582(ub): 581(ptr) Variable Private 4(main): 2 Function None 3 5: Label 9(v): 8(ptr) Variable Function 20(i): 19(ptr) Variable Function - 188(f): 143(ptr) Variable Function - 285(u): 284(ptr) Variable Function - 305(b): 304(ptr) Variable Function - 487: 8(ptr) Variable Function - 503(m1): 502(ptr) Variable Function - 510(m2): 502(ptr) Variable Function - 514: 502(ptr) Variable Function +155(swizzleTemp): 8(ptr) Variable Function + 196(f): 143(ptr) Variable Function + 293(u): 292(ptr) Variable Function + 321(msb): 320(ptr) Variable Function +323(swizzleTemp): 322(ptr) Variable Function + 324(lsb): 320(ptr) Variable Function +325(swizzleTemp): 322(ptr) Variable Function + 359(b): 358(ptr) Variable Function + 541: 8(ptr) Variable Function + 557(m1): 556(ptr) Variable Function + 564(m2): 556(ptr) Variable Function + 568: 556(ptr) Variable Function 12: 7(fvec4) Load 11(uv4) 13: 7(fvec4) ExtInst 1(GLSL.std.450) 11(Radians) 12 Store 9(v) 13 @@ -262,441 +279,489 @@ spv.Operations.frag 153: 7(fvec4) FAdd 152 151 Store 9(v) 153 154: 7(fvec4) Load 9(v) - 155: 7(fvec4) Load 11(uv4) - 156: 7(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 154 155 - 157: 7(fvec4) Load 9(v) - 158: 7(fvec4) FAdd 157 156 - Store 9(v) 158 - 159: 7(fvec4) Load 9(v) - 160: 7(fvec4) Load 11(uv4) - 161: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 159 160 + 156: 7(fvec4) ExtInst 1(GLSL.std.450) 35(Modf) 154 155(swizzleTemp) + 157: 7(fvec4) Load 155(swizzleTemp) + 158: 7(fvec4) Load 9(v) + 159: 7(fvec4) VectorShuffle 158 157 6 4 5 7 + Store 9(v) 159 + 160: 7(fvec4) Load 9(v) + 161: 7(fvec4) FAdd 160 156 + Store 9(v) 161 162: 7(fvec4) Load 9(v) - 163: 7(fvec4) FAdd 162 161 - Store 9(v) 163 - 164: 7(fvec4) Load 9(v) - 165: 7(fvec4) Load 11(uv4) - 166: 7(fvec4) Load 11(uv4) - 167: 7(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 164 165 166 - 168: 7(fvec4) Load 9(v) - 169: 7(fvec4) FAdd 168 167 - Store 9(v) 169 + 163: 7(fvec4) Load 11(uv4) + 164: 7(fvec4) ExtInst 1(GLSL.std.450) 37(FMin) 162 163 + 165: 7(fvec4) Load 9(v) + 166: 7(fvec4) FAdd 165 164 + Store 9(v) 166 + 167: 7(fvec4) Load 9(v) + 168: 7(fvec4) Load 11(uv4) + 169: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 167 168 170: 7(fvec4) Load 9(v) - 171: 7(fvec4) Load 9(v) + 171: 7(fvec4) FAdd 170 169 + Store 9(v) 171 172: 7(fvec4) Load 9(v) - 173: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 170 171 172 - 174: 7(fvec4) Load 9(v) - 175: 7(fvec4) FAdd 174 173 - Store 9(v) 175 + 173: 7(fvec4) Load 11(uv4) + 174: 7(fvec4) Load 11(uv4) + 175: 7(fvec4) ExtInst 1(GLSL.std.450) 43(FClamp) 172 173 174 176: 7(fvec4) Load 9(v) - 177: 7(fvec4) Load 9(v) - 182: 179(bvec4) Load 181(ub41) - 183: 7(fvec4) Select 182 177 176 + 177: 7(fvec4) FAdd 176 175 + Store 9(v) 177 + 178: 7(fvec4) Load 9(v) + 179: 7(fvec4) Load 9(v) + 180: 7(fvec4) Load 9(v) + 181: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 178 179 180 + 182: 7(fvec4) Load 9(v) + 183: 7(fvec4) FAdd 182 181 + Store 9(v) 183 184: 7(fvec4) Load 9(v) - 185: 7(fvec4) FAdd 184 183 - Store 9(v) 185 - 186: 7(fvec4) Load 9(v) - 187: 7(fvec4) Load 9(v) - 189: 6(float) Load 188(f) - 190: 7(fvec4) CompositeConstruct 189 189 189 189 - 191: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 186 187 190 + 185: 7(fvec4) Load 9(v) + 190: 187(bvec4) Load 189(ub41) + 191: 7(fvec4) Select 190 185 184 192: 7(fvec4) Load 9(v) 193: 7(fvec4) FAdd 192 191 Store 9(v) 193 194: 7(fvec4) Load 9(v) - 195: 7(fvec4) Load 11(uv4) - 196: 7(fvec4) Load 9(v) - 197: 7(fvec4) ExtInst 1(GLSL.std.450) 50(Fma) 194 195 196 - 198: 7(fvec4) Load 9(v) - 199: 7(fvec4) FAdd 198 197 - Store 9(v) 199 + 195: 7(fvec4) Load 9(v) + 197: 6(float) Load 196(f) + 198: 7(fvec4) CompositeConstruct 197 197 197 197 + 199: 7(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 194 195 198 200: 7(fvec4) Load 9(v) - 201: 7(fvec4) Load 9(v) - 202: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 200 201 - 203: 7(fvec4) Load 9(v) - 204: 7(fvec4) FAdd 203 202 - Store 9(v) 204 - 205: 7(fvec4) Load 9(v) + 201: 7(fvec4) FAdd 200 199 + Store 9(v) 201 + 202: 7(fvec4) Load 9(v) + 203: 7(fvec4) Load 11(uv4) + 204: 7(fvec4) Load 9(v) + 205: 7(fvec4) ExtInst 1(GLSL.std.450) 50(Fma) 202 203 204 206: 7(fvec4) Load 9(v) - 207: 7(fvec4) Load 9(v) - 208: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 205 206 207 + 207: 7(fvec4) FAdd 206 205 + Store 9(v) 207 + 208: 7(fvec4) Load 9(v) 209: 7(fvec4) Load 9(v) - 210: 7(fvec4) FAdd 209 208 - Store 9(v) 210 - 213: 6(float) Load 212(uf) + 210: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 208 209 + 211: 7(fvec4) Load 9(v) + 212: 7(fvec4) FAdd 211 210 + Store 9(v) 212 + 213: 7(fvec4) Load 9(v) 214: 7(fvec4) Load 9(v) - 215: 7(fvec4) CompositeConstruct 213 213 213 213 - 216: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 215 214 + 215: 7(fvec4) Load 9(v) + 216: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 213 214 215 217: 7(fvec4) Load 9(v) 218: 7(fvec4) FAdd 217 216 Store 9(v) 218 - 219: 6(float) Load 212(uf) - 220: 6(float) Load 212(uf) - 221: 7(fvec4) Load 9(v) - 222: 7(fvec4) CompositeConstruct 219 219 219 219 - 223: 7(fvec4) CompositeConstruct 220 220 220 220 - 224: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 222 223 221 + 221: 6(float) Load 220(uf) + 222: 7(fvec4) Load 9(v) + 223: 7(fvec4) CompositeConstruct 221 221 221 221 + 224: 7(fvec4) ExtInst 1(GLSL.std.450) 48(Step) 223 222 225: 7(fvec4) Load 9(v) 226: 7(fvec4) FAdd 225 224 Store 9(v) 226 - 227: 7(fvec4) Load 9(v) - 228: 7(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 227 + 227: 6(float) Load 220(uf) + 228: 6(float) Load 220(uf) 229: 7(fvec4) Load 9(v) - 230: 7(fvec4) FAdd 229 228 - Store 9(v) 230 - 231: 7(fvec4) Load 9(v) - 232: 7(fvec4) Load 9(v) + 230: 7(fvec4) CompositeConstruct 227 227 227 227 + 231: 7(fvec4) CompositeConstruct 228 228 228 228 + 232: 7(fvec4) ExtInst 1(GLSL.std.450) 49(SmoothStep) 230 231 229 233: 7(fvec4) Load 9(v) - 234: 7(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 231 232 233 + 234: 7(fvec4) FAdd 233 232 + Store 9(v) 234 235: 7(fvec4) Load 9(v) - 236: 7(fvec4) FAdd 235 234 - Store 9(v) 236 + 236: 7(fvec4) ExtInst 1(GLSL.std.450) 69(Normalize) 235 237: 7(fvec4) Load 9(v) - 238: 7(fvec4) Load 9(v) - 239: 7(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 237 238 + 238: 7(fvec4) FAdd 237 236 + Store 9(v) 238 + 239: 7(fvec4) Load 9(v) 240: 7(fvec4) Load 9(v) - 241: 7(fvec4) FAdd 240 239 - Store 9(v) 241 - 242: 7(fvec4) Load 9(v) + 241: 7(fvec4) Load 9(v) + 242: 7(fvec4) ExtInst 1(GLSL.std.450) 70(FaceForward) 239 240 241 243: 7(fvec4) Load 9(v) - 244: 6(float) Load 212(uf) - 245: 7(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 242 243 244 + 244: 7(fvec4) FAdd 243 242 + Store 9(v) 244 + 245: 7(fvec4) Load 9(v) 246: 7(fvec4) Load 9(v) - 247: 7(fvec4) FAdd 246 245 - Store 9(v) 247 + 247: 7(fvec4) ExtInst 1(GLSL.std.450) 71(Reflect) 245 246 248: 7(fvec4) Load 9(v) - 249: 7(fvec4) DPdx 248 + 249: 7(fvec4) FAdd 248 247 + Store 9(v) 249 250: 7(fvec4) Load 9(v) - 251: 7(fvec4) FAdd 250 249 - Store 9(v) 251 - 252: 7(fvec4) Load 9(v) - 253: 7(fvec4) DPdy 252 + 251: 7(fvec4) Load 9(v) + 252: 6(float) Load 220(uf) + 253: 7(fvec4) ExtInst 1(GLSL.std.450) 72(Refract) 250 251 252 254: 7(fvec4) Load 9(v) 255: 7(fvec4) FAdd 254 253 Store 9(v) 255 256: 7(fvec4) Load 9(v) - 257: 7(fvec4) Fwidth 256 + 257: 7(fvec4) DPdx 256 258: 7(fvec4) Load 9(v) 259: 7(fvec4) FAdd 258 257 Store 9(v) 259 - 260: 18(int) Load 22(ui) - 261: 18(int) ExtInst 1(GLSL.std.450) 5(SAbs) 260 - 262: 18(int) Load 20(i) - 263: 18(int) IAdd 262 261 - Store 20(i) 263 - 264: 18(int) Load 20(i) - 265: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 264 - 266: 18(int) Load 20(i) - 267: 18(int) IAdd 266 265 - Store 20(i) 267 - 268: 18(int) Load 20(i) - 269: 18(int) Load 22(ui) - 270: 18(int) ExtInst 1(GLSL.std.450) 39(SMin) 268 269 - 271: 18(int) Load 20(i) - 272: 18(int) IAdd 271 270 - Store 20(i) 272 - 273: 18(int) Load 20(i) - 274: 18(int) Load 22(ui) - 275: 18(int) ExtInst 1(GLSL.std.450) 42(SMax) 273 274 + 260: 7(fvec4) Load 9(v) + 261: 7(fvec4) DPdy 260 + 262: 7(fvec4) Load 9(v) + 263: 7(fvec4) FAdd 262 261 + Store 9(v) 263 + 264: 7(fvec4) Load 9(v) + 265: 7(fvec4) Fwidth 264 + 266: 7(fvec4) Load 9(v) + 267: 7(fvec4) FAdd 266 265 + Store 9(v) 267 + 268: 18(int) Load 22(ui) + 269: 18(int) ExtInst 1(GLSL.std.450) 5(SAbs) 268 + 270: 18(int) Load 20(i) + 271: 18(int) IAdd 270 269 + Store 20(i) 271 + 272: 18(int) Load 20(i) + 273: 18(int) ExtInst 1(GLSL.std.450) 7(SSign) 272 + 274: 18(int) Load 20(i) + 275: 18(int) IAdd 274 273 + Store 20(i) 275 276: 18(int) Load 20(i) - 277: 18(int) IAdd 276 275 - Store 20(i) 277 - 278: 18(int) Load 20(i) - 279: 18(int) Load 22(ui) - 280: 18(int) Load 22(ui) - 281: 18(int) ExtInst 1(GLSL.std.450) 45(SClamp) 278 279 280 - 282: 18(int) Load 20(i) - 283: 18(int) IAdd 282 281 - Store 20(i) 283 - 286: 141(int) Load 285(u) - 289: 141(int) Load 288(uui) - 290: 141(int) ExtInst 1(GLSL.std.450) 38(UMin) 286 289 - 291: 141(int) Load 285(u) - 292: 141(int) IAdd 291 290 - Store 285(u) 292 - 293: 141(int) Load 285(u) - 294: 141(int) Load 288(uui) - 295: 141(int) ExtInst 1(GLSL.std.450) 41(UMax) 293 294 - 296: 141(int) Load 285(u) - 297: 141(int) IAdd 296 295 - Store 285(u) 297 - 298: 141(int) Load 285(u) - 299: 141(int) Load 288(uui) - 300: 141(int) Load 288(uui) - 301: 141(int) ExtInst 1(GLSL.std.450) 44(UClamp) 298 299 300 - 302: 141(int) Load 285(u) - 303: 141(int) IAdd 302 301 - Store 285(u) 303 - 306: 6(float) Load 212(uf) - 307: 178(bool) IsNan 306 - Store 305(b) 307 - 308: 6(float) Load 188(f) - 309: 178(bool) IsInf 308 - Store 305(b) 309 - 310: 7(fvec4) Load 9(v) - 311: 7(fvec4) Load 11(uv4) - 312: 179(bvec4) FOrdLessThan 310 311 - 313: 178(bool) Any 312 - Store 305(b) 313 - 314: 178(bool) Load 305(b) - SelectionMerge 316 None - BranchConditional 314 315 316 - 315: Label - 317: 7(fvec4) Load 9(v) - 318: 7(fvec4) Load 11(uv4) - 319: 179(bvec4) FOrdLessThanEqual 317 318 - 320: 178(bool) Any 319 - Branch 316 - 316: Label - 321: 178(bool) Phi 314 5 320 315 - Store 305(b) 321 - 322: 178(bool) Load 305(b) - SelectionMerge 324 None - BranchConditional 322 323 324 - 323: Label - 325: 7(fvec4) Load 9(v) - 326: 7(fvec4) Load 11(uv4) - 327: 179(bvec4) FOrdGreaterThan 325 326 - 328: 178(bool) Any 327 - Branch 324 - 324: Label - 329: 178(bool) Phi 322 316 328 323 - Store 305(b) 329 - 330: 178(bool) Load 305(b) - SelectionMerge 332 None - BranchConditional 330 331 332 - 331: Label - 333: 7(fvec4) Load 9(v) - 334: 7(fvec4) Load 11(uv4) - 335: 179(bvec4) FOrdGreaterThanEqual 333 334 - 336: 178(bool) Any 335 - Branch 332 - 332: Label - 337: 178(bool) Phi 330 324 336 331 - Store 305(b) 337 - 338: 178(bool) Load 305(b) - SelectionMerge 340 None - BranchConditional 338 339 340 - 339: Label - 341: 179(bvec4) Load 181(ub41) - 343: 179(bvec4) Load 342(ub42) - 344: 179(bvec4) LogicalEqual 341 343 - 345: 178(bool) Any 344 - Branch 340 - 340: Label - 346: 178(bool) Phi 338 332 345 339 - Store 305(b) 346 - 347: 178(bool) Load 305(b) - SelectionMerge 349 None - BranchConditional 347 348 349 - 348: Label - 350: 179(bvec4) Load 181(ub41) - 351: 179(bvec4) Load 342(ub42) - 352: 179(bvec4) LogicalNotEqual 350 351 - 353: 178(bool) Any 352 - Branch 349 - 349: Label - 354: 178(bool) Phi 347 340 353 348 - Store 305(b) 354 - 355: 178(bool) Load 305(b) - 356: 179(bvec4) Load 181(ub41) - 357: 178(bool) Any 356 - 358: 178(bool) LogicalAnd 355 357 - Store 305(b) 358 - 359: 178(bool) Load 305(b) - 360: 179(bvec4) Load 181(ub41) - 361: 178(bool) All 360 - 362: 178(bool) LogicalAnd 359 361 - Store 305(b) 362 - 363: 178(bool) Load 305(b) - SelectionMerge 365 None - BranchConditional 363 364 365 - 364: Label - 366: 179(bvec4) Load 181(ub41) - 367: 179(bvec4) LogicalNot 366 - 368: 178(bool) Any 367 - Branch 365 - 365: Label - 369: 178(bool) Phi 363 349 368 364 - Store 305(b) 369 - 370: 18(int) Load 20(i) - 371: 18(int) Load 22(ui) - 372: 18(int) IAdd 370 371 - 373: 18(int) Load 20(i) - 374: 18(int) IMul 372 373 - 375: 18(int) Load 22(ui) - 376: 18(int) ISub 374 375 - 377: 18(int) Load 20(i) - 378: 18(int) SDiv 376 377 - Store 20(i) 378 - 379: 18(int) Load 20(i) - 380: 18(int) Load 22(ui) - 381: 18(int) SMod 379 380 - Store 20(i) 381 - 382: 18(int) Load 20(i) - 383: 18(int) Load 22(ui) - 384: 178(bool) IEqual 382 383 - 385: 178(bool) LogicalNot 384 - SelectionMerge 387 None - BranchConditional 385 386 387 - 386: Label - 388: 18(int) Load 20(i) - 389: 18(int) Load 22(ui) - 390: 178(bool) INotEqual 388 389 - SelectionMerge 392 None - BranchConditional 390 391 392 - 391: Label - 393: 18(int) Load 20(i) - 394: 18(int) Load 22(ui) - 395: 178(bool) IEqual 393 394 - Branch 392 - 392: Label - 396: 178(bool) Phi 390 386 395 391 - 397: 18(int) Load 20(i) - 399: 178(bool) INotEqual 397 398 - 400: 178(bool) LogicalNotEqual 396 399 - Branch 387 - 387: Label - 401: 178(bool) Phi 384 365 400 392 + 277: 18(int) Load 22(ui) + 278: 18(int) ExtInst 1(GLSL.std.450) 39(SMin) 276 277 + 279: 18(int) Load 20(i) + 280: 18(int) IAdd 279 278 + Store 20(i) 280 + 281: 18(int) Load 20(i) + 282: 18(int) Load 22(ui) + 283: 18(int) ExtInst 1(GLSL.std.450) 42(SMax) 281 282 + 284: 18(int) Load 20(i) + 285: 18(int) IAdd 284 283 + Store 20(i) 285 + 286: 18(int) Load 20(i) + 287: 18(int) Load 22(ui) + 288: 18(int) Load 22(ui) + 289: 18(int) ExtInst 1(GLSL.std.450) 45(SClamp) 286 287 288 + 290: 18(int) Load 20(i) + 291: 18(int) IAdd 290 289 + Store 20(i) 291 + 294: 141(int) Load 293(u) + 297: 141(int) Load 296(uui) + 298: 141(int) ExtInst 1(GLSL.std.450) 38(UMin) 294 297 + 299: 141(int) Load 293(u) + 300: 141(int) IAdd 299 298 + Store 293(u) 300 + 301: 141(int) Load 293(u) + 302: 141(int) Load 296(uui) + 303: 141(int) ExtInst 1(GLSL.std.450) 41(UMax) 301 302 + 304: 141(int) Load 293(u) + 305: 141(int) IAdd 304 303 + Store 293(u) 305 + 306: 141(int) Load 293(u) + 307: 141(int) Load 296(uui) + 308: 141(int) Load 296(uui) + 309: 141(int) ExtInst 1(GLSL.std.450) 44(UClamp) 306 307 308 + 310: 141(int) Load 293(u) + 311: 141(int) IAdd 310 309 + Store 293(u) 311 + 316: 312(ivec4) Load 314(uuv4) + 317: 315(ivec3) VectorShuffle 316 316 0 1 2 + 318: 312(ivec4) Load 314(uuv4) + 319: 315(ivec3) VectorShuffle 318 318 0 1 2 + 327:326(ResType) UMulExtended 317 319 + 328: 315(ivec3) CompositeExtract 327 0 + Store 325(swizzleTemp) 328 + 329: 315(ivec3) CompositeExtract 327 1 + Store 323(swizzleTemp) 329 + 330: 315(ivec3) Load 323(swizzleTemp) + 331: 312(ivec4) Load 321(msb) + 332: 312(ivec4) VectorShuffle 331 330 4 5 6 3 + Store 321(msb) 332 + 333: 315(ivec3) Load 325(swizzleTemp) + 334: 312(ivec4) Load 324(lsb) + 335: 312(ivec4) VectorShuffle 334 333 4 5 6 3 + Store 324(lsb) 335 + 336: 292(ptr) AccessChain 321(msb) 142 + 337: 141(int) Load 336 + 339: 292(ptr) AccessChain 321(msb) 338 + 340: 141(int) Load 339 + 341: 141(int) IAdd 337 340 + 343: 292(ptr) AccessChain 321(msb) 342 + 344: 141(int) Load 343 + 345: 141(int) IAdd 341 344 + 346: 141(int) Load 293(u) + 347: 141(int) IAdd 346 345 + Store 293(u) 347 + 348: 292(ptr) AccessChain 324(lsb) 142 + 349: 141(int) Load 348 + 350: 292(ptr) AccessChain 324(lsb) 338 + 351: 141(int) Load 350 + 352: 141(int) IAdd 349 351 + 353: 292(ptr) AccessChain 324(lsb) 342 + 354: 141(int) Load 353 + 355: 141(int) IAdd 352 354 + 356: 141(int) Load 293(u) + 357: 141(int) IAdd 356 355 + Store 293(u) 357 + 360: 6(float) Load 220(uf) + 361: 186(bool) IsNan 360 + Store 359(b) 361 + 362: 6(float) Load 196(f) + 363: 186(bool) IsInf 362 + Store 359(b) 363 + 364: 7(fvec4) Load 9(v) + 365: 7(fvec4) Load 11(uv4) + 366: 187(bvec4) FOrdLessThan 364 365 + 367: 186(bool) Any 366 + Store 359(b) 367 + 368: 186(bool) Load 359(b) + SelectionMerge 370 None + BranchConditional 368 369 370 + 369: Label + 371: 7(fvec4) Load 9(v) + 372: 7(fvec4) Load 11(uv4) + 373: 187(bvec4) FOrdLessThanEqual 371 372 + 374: 186(bool) Any 373 + Branch 370 + 370: Label + 375: 186(bool) Phi 368 5 374 369 + Store 359(b) 375 + 376: 186(bool) Load 359(b) + SelectionMerge 378 None + BranchConditional 376 377 378 + 377: Label + 379: 7(fvec4) Load 9(v) + 380: 7(fvec4) Load 11(uv4) + 381: 187(bvec4) FOrdGreaterThan 379 380 + 382: 186(bool) Any 381 + Branch 378 + 378: Label + 383: 186(bool) Phi 376 370 382 377 + Store 359(b) 383 + 384: 186(bool) Load 359(b) + SelectionMerge 386 None + BranchConditional 384 385 386 + 385: Label + 387: 7(fvec4) Load 9(v) + 388: 7(fvec4) Load 11(uv4) + 389: 187(bvec4) FOrdGreaterThanEqual 387 388 + 390: 186(bool) Any 389 + Branch 386 + 386: Label + 391: 186(bool) Phi 384 378 390 385 + Store 359(b) 391 + 392: 186(bool) Load 359(b) + SelectionMerge 394 None + BranchConditional 392 393 394 + 393: Label + 395: 187(bvec4) Load 189(ub41) + 397: 187(bvec4) Load 396(ub42) + 398: 187(bvec4) LogicalEqual 395 397 + 399: 186(bool) Any 398 + Branch 394 + 394: Label + 400: 186(bool) Phi 392 386 399 393 + Store 359(b) 400 + 401: 186(bool) Load 359(b) SelectionMerge 403 None BranchConditional 401 402 403 402: Label - 404: 18(int) Load 20(i) - 406: 18(int) IAdd 404 405 - Store 20(i) 406 + 404: 187(bvec4) Load 189(ub41) + 405: 187(bvec4) Load 396(ub42) + 406: 187(bvec4) LogicalNotEqual 404 405 + 407: 186(bool) Any 406 Branch 403 403: Label - 407: 6(float) Load 212(uf) - 408: 6(float) Load 212(uf) - 409: 6(float) FAdd 407 408 - 410: 6(float) Load 212(uf) - 411: 6(float) FMul 409 410 - 412: 6(float) Load 212(uf) - 413: 6(float) FSub 411 412 - 414: 6(float) Load 212(uf) - 415: 6(float) FDiv 413 414 - Store 188(f) 415 - 416: 7(fvec4) Load 9(v) - 417: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 416 - 418: 6(float) Load 188(f) - 419: 6(float) FAdd 418 417 - Store 188(f) 419 - 420: 7(fvec4) Load 9(v) - 421: 7(fvec4) Load 9(v) - 422: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 420 421 - 423: 6(float) Load 188(f) - 424: 6(float) FAdd 423 422 - Store 188(f) 424 - 425: 7(fvec4) Load 9(v) - 426: 7(fvec4) Load 9(v) - 427: 6(float) Dot 425 426 - 428: 6(float) Load 188(f) - 429: 6(float) FAdd 428 427 - Store 188(f) 429 - 430: 6(float) Load 188(f) - 431: 6(float) Load 212(uf) - 432: 6(float) FMul 430 431 - 433: 6(float) Load 188(f) - 434: 6(float) FAdd 433 432 - Store 188(f) 434 - 436: 7(fvec4) Load 9(v) - 437: 435(fvec3) VectorShuffle 436 436 0 1 2 - 438: 7(fvec4) Load 9(v) - 439: 435(fvec3) VectorShuffle 438 438 0 1 2 - 440: 435(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 437 439 - 441: 6(float) CompositeExtract 440 0 - 442: 6(float) Load 188(f) - 443: 6(float) FAdd 442 441 - Store 188(f) 443 - 444: 6(float) Load 188(f) - 445: 6(float) Load 212(uf) - 446: 178(bool) FOrdEqual 444 445 - 447: 178(bool) LogicalNot 446 - SelectionMerge 449 None - BranchConditional 447 448 449 - 448: Label - 450: 6(float) Load 188(f) - 451: 6(float) Load 212(uf) - 452: 178(bool) FOrdNotEqual 450 451 - 453: 6(float) Load 188(f) - 455: 178(bool) FOrdNotEqual 453 454 - 456: 178(bool) LogicalAnd 452 455 - Branch 449 - 449: Label - 457: 178(bool) Phi 446 403 456 448 - SelectionMerge 459 None - BranchConditional 457 458 459 - 458: Label - 460: 6(float) Load 188(f) - 462: 6(float) FAdd 460 461 - Store 188(f) 462 - Branch 459 - 459: Label - 463: 18(int) Load 22(ui) - 464: 18(int) Load 20(i) - 465: 18(int) BitwiseAnd 464 463 - Store 20(i) 465 - 467: 18(int) Load 20(i) - 468: 18(int) BitwiseOr 467 466 - Store 20(i) 468 - 469: 18(int) Load 22(ui) - 470: 18(int) Load 20(i) - 471: 18(int) BitwiseXor 470 469 - Store 20(i) 471 - 473: 18(int) Load 20(i) - 474: 18(int) SMod 473 472 - Store 20(i) 474 - 475: 18(int) Load 20(i) - 476: 18(int) ShiftRightArithmetic 475 398 - Store 20(i) 476 - 477: 18(int) Load 22(ui) - 478: 18(int) Load 20(i) - 479: 18(int) ShiftLeftLogical 478 477 - Store 20(i) 479 - 480: 18(int) Load 20(i) - 481: 18(int) Not 480 - Store 20(i) 481 - 482: 178(bool) Load 305(b) - 483: 178(bool) LogicalNot 482 - Store 305(b) 483 - 486: 178(bool) Load 305(b) - SelectionMerge 489 None - BranchConditional 486 488 498 - 488: Label - 490: 18(int) Load 20(i) - 491: 6(float) ConvertSToF 490 - 492: 7(fvec4) CompositeConstruct 491 491 491 491 - 493: 6(float) Load 188(f) - 494: 7(fvec4) CompositeConstruct 493 493 493 493 - 495: 7(fvec4) FAdd 492 494 - 496: 7(fvec4) Load 9(v) - 497: 7(fvec4) FAdd 495 496 - Store 487 497 - Branch 489 - 498: Label - 499: 7(fvec4) Load 9(v) - Store 487 499 - Branch 489 - 489: Label - 500: 7(fvec4) Load 487 - Store 485(FragColor) 500 - Store 503(m1) 509 - Store 510(m2) 512 - 513: 178(bool) Load 305(b) - SelectionMerge 516 None - BranchConditional 513 515 518 - 515: Label - 517: 501 Load 503(m1) - Store 514 517 - Branch 516 - 518: Label - 519: 501 Load 510(m2) - Store 514 519 - Branch 516 - 516: Label - 520: 8(ptr) AccessChain 514 405 - 521: 7(fvec4) Load 520 - 522: 7(fvec4) Load 485(FragColor) - 523: 7(fvec4) FAdd 522 521 - Store 485(FragColor) 523 + 408: 186(bool) Phi 401 394 407 402 + Store 359(b) 408 + 409: 186(bool) Load 359(b) + 410: 187(bvec4) Load 189(ub41) + 411: 186(bool) Any 410 + 412: 186(bool) LogicalAnd 409 411 + Store 359(b) 412 + 413: 186(bool) Load 359(b) + 414: 187(bvec4) Load 189(ub41) + 415: 186(bool) All 414 + 416: 186(bool) LogicalAnd 413 415 + Store 359(b) 416 + 417: 186(bool) Load 359(b) + SelectionMerge 419 None + BranchConditional 417 418 419 + 418: Label + 420: 187(bvec4) Load 189(ub41) + 421: 187(bvec4) LogicalNot 420 + 422: 186(bool) Any 421 + Branch 419 + 419: Label + 423: 186(bool) Phi 417 403 422 418 + Store 359(b) 423 + 424: 18(int) Load 20(i) + 425: 18(int) Load 22(ui) + 426: 18(int) IAdd 424 425 + 427: 18(int) Load 20(i) + 428: 18(int) IMul 426 427 + 429: 18(int) Load 22(ui) + 430: 18(int) ISub 428 429 + 431: 18(int) Load 20(i) + 432: 18(int) SDiv 430 431 + Store 20(i) 432 + 433: 18(int) Load 20(i) + 434: 18(int) Load 22(ui) + 435: 18(int) SMod 433 434 + Store 20(i) 435 + 436: 18(int) Load 20(i) + 437: 18(int) Load 22(ui) + 438: 186(bool) IEqual 436 437 + 439: 186(bool) LogicalNot 438 + SelectionMerge 441 None + BranchConditional 439 440 441 + 440: Label + 442: 18(int) Load 20(i) + 443: 18(int) Load 22(ui) + 444: 186(bool) INotEqual 442 443 + SelectionMerge 446 None + BranchConditional 444 445 446 + 445: Label + 447: 18(int) Load 20(i) + 448: 18(int) Load 22(ui) + 449: 186(bool) IEqual 447 448 + Branch 446 + 446: Label + 450: 186(bool) Phi 444 440 449 445 + 451: 18(int) Load 20(i) + 453: 186(bool) INotEqual 451 452 + 454: 186(bool) LogicalNotEqual 450 453 + Branch 441 + 441: Label + 455: 186(bool) Phi 438 419 454 446 + SelectionMerge 457 None + BranchConditional 455 456 457 + 456: Label + 458: 18(int) Load 20(i) + 460: 18(int) IAdd 458 459 + Store 20(i) 460 + Branch 457 + 457: Label + 461: 6(float) Load 220(uf) + 462: 6(float) Load 220(uf) + 463: 6(float) FAdd 461 462 + 464: 6(float) Load 220(uf) + 465: 6(float) FMul 463 464 + 466: 6(float) Load 220(uf) + 467: 6(float) FSub 465 466 + 468: 6(float) Load 220(uf) + 469: 6(float) FDiv 467 468 + Store 196(f) 469 + 470: 7(fvec4) Load 9(v) + 471: 6(float) ExtInst 1(GLSL.std.450) 66(Length) 470 + 472: 6(float) Load 196(f) + 473: 6(float) FAdd 472 471 + Store 196(f) 473 + 474: 7(fvec4) Load 9(v) + 475: 7(fvec4) Load 9(v) + 476: 6(float) ExtInst 1(GLSL.std.450) 67(Distance) 474 475 + 477: 6(float) Load 196(f) + 478: 6(float) FAdd 477 476 + Store 196(f) 478 + 479: 7(fvec4) Load 9(v) + 480: 7(fvec4) Load 9(v) + 481: 6(float) Dot 479 480 + 482: 6(float) Load 196(f) + 483: 6(float) FAdd 482 481 + Store 196(f) 483 + 484: 6(float) Load 196(f) + 485: 6(float) Load 220(uf) + 486: 6(float) FMul 484 485 + 487: 6(float) Load 196(f) + 488: 6(float) FAdd 487 486 + Store 196(f) 488 + 490: 7(fvec4) Load 9(v) + 491: 489(fvec3) VectorShuffle 490 490 0 1 2 + 492: 7(fvec4) Load 9(v) + 493: 489(fvec3) VectorShuffle 492 492 0 1 2 + 494: 489(fvec3) ExtInst 1(GLSL.std.450) 68(Cross) 491 493 + 495: 6(float) CompositeExtract 494 0 + 496: 6(float) Load 196(f) + 497: 6(float) FAdd 496 495 + Store 196(f) 497 + 498: 6(float) Load 196(f) + 499: 6(float) Load 220(uf) + 500: 186(bool) FOrdEqual 498 499 + 501: 186(bool) LogicalNot 500 + SelectionMerge 503 None + BranchConditional 501 502 503 + 502: Label + 504: 6(float) Load 196(f) + 505: 6(float) Load 220(uf) + 506: 186(bool) FOrdNotEqual 504 505 + 507: 6(float) Load 196(f) + 509: 186(bool) FOrdNotEqual 507 508 + 510: 186(bool) LogicalAnd 506 509 + Branch 503 + 503: Label + 511: 186(bool) Phi 500 457 510 502 + SelectionMerge 513 None + BranchConditional 511 512 513 + 512: Label + 514: 6(float) Load 196(f) + 516: 6(float) FAdd 514 515 + Store 196(f) 516 + Branch 513 + 513: Label + 517: 18(int) Load 22(ui) + 518: 18(int) Load 20(i) + 519: 18(int) BitwiseAnd 518 517 + Store 20(i) 519 + 521: 18(int) Load 20(i) + 522: 18(int) BitwiseOr 521 520 + Store 20(i) 522 + 523: 18(int) Load 22(ui) + 524: 18(int) Load 20(i) + 525: 18(int) BitwiseXor 524 523 + Store 20(i) 525 + 527: 18(int) Load 20(i) + 528: 18(int) SMod 527 526 + Store 20(i) 528 + 529: 18(int) Load 20(i) + 530: 18(int) ShiftRightArithmetic 529 452 + Store 20(i) 530 + 531: 18(int) Load 22(ui) + 532: 18(int) Load 20(i) + 533: 18(int) ShiftLeftLogical 532 531 + Store 20(i) 533 + 534: 18(int) Load 20(i) + 535: 18(int) Not 534 + Store 20(i) 535 + 536: 186(bool) Load 359(b) + 537: 186(bool) LogicalNot 536 + Store 359(b) 537 + 540: 186(bool) Load 359(b) + SelectionMerge 543 None + BranchConditional 540 542 552 + 542: Label + 544: 18(int) Load 20(i) + 545: 6(float) ConvertSToF 544 + 546: 7(fvec4) CompositeConstruct 545 545 545 545 + 547: 6(float) Load 196(f) + 548: 7(fvec4) CompositeConstruct 547 547 547 547 + 549: 7(fvec4) FAdd 546 548 + 550: 7(fvec4) Load 9(v) + 551: 7(fvec4) FAdd 549 550 + Store 541 551 + Branch 543 + 552: Label + 553: 7(fvec4) Load 9(v) + Store 541 553 + Branch 543 + 543: Label + 554: 7(fvec4) Load 541 + Store 539(FragColor) 554 + Store 557(m1) 563 + Store 564(m2) 566 + 567: 186(bool) Load 359(b) + SelectionMerge 570 None + BranchConditional 567 569 572 + 569: Label + 571: 555 Load 557(m1) + Store 568 571 + Branch 570 + 572: Label + 573: 555 Load 564(m2) + Store 568 573 + Branch 570 + 570: Label + 574: 8(ptr) AccessChain 568 459 + 575: 7(fvec4) Load 574 + 576: 7(fvec4) Load 539(FragColor) + 577: 7(fvec4) FAdd 576 575 + Store 539(FragColor) 577 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out b/core/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out index 31df5d1b1..b5e25bef5 100644 --- a/core/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out +++ b/core/deps/glslang/Test/baseResults/spv.RayCallable.rcall.out @@ -7,7 +7,7 @@ spv.RayCallable.rcall Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint CallableNV 4 "main" 11 14 + EntryPoint CallableKHR 4 "main" 11 14 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -19,8 +19,8 @@ spv.RayCallable.rcall MemberName 16(dataBlock) 0 "data1" Name 18 "" Name 29 "data0" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 16(dataBlock) Block Decorate 18 Location 1 Decorate 29(data0) Location 0 @@ -33,18 +33,18 @@ spv.RayCallable.rcall 11(gl_LaunchIDNV): 10(ptr) Variable Input 14(gl_LaunchSizeNV): 10(ptr) Variable Input 16(dataBlock): TypeStruct 6(int) - 17: TypePointer IncomingCallableDataNV 16(dataBlock) - 18: 17(ptr) Variable IncomingCallableDataNV + 17: TypePointer IncomingCallableDataKHR 16(dataBlock) + 18: 17(ptr) Variable IncomingCallableDataKHR 19: TypeInt 32 1 20: 19(int) Constant 0 21: 6(int) Constant 256 - 22: TypePointer IncomingCallableDataNV 6(int) + 22: TypePointer IncomingCallableDataKHR 6(int) 24: 6(int) Constant 2 25: 19(int) Constant 1 26: TypeFloat 32 27: TypeVector 26(float) 4 - 28: TypePointer CallableDataNV 27(fvec4) - 29(data0): 28(ptr) Variable CallableDataNV + 28: TypePointer CallableDataKHR 27(fvec4) + 29(data0): 28(ptr) Variable CallableDataKHR 4(main): 2 Function None 3 5: Label 9(id): 8(ptr) Variable Function @@ -55,6 +55,6 @@ spv.RayCallable.rcall Store 13(size) 15 23: 22(ptr) AccessChain 18 20 Store 23 21 - ExecuteCallableNV 24 25 + ExecuteCallableKHR 24 25 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out b/core/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out index 033e54551..97b47b737 100644 --- a/core/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out +++ b/core/deps/glslang/Test/baseResults/spv.RayConstants.rgen.out @@ -7,7 +7,7 @@ spv.RayConstants.rgen Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint RayGenerationNV 4 "main" + EntryPoint RayGenerationKHR 4 "main" Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -18,7 +18,7 @@ spv.RayConstants.rgen Decorate 26(payload) Location 0 2: TypeVoid 3: TypeFunction 2 - 6: TypeAccelerationStructureNV + 6: TypeAccelerationStructureKHR 7: TypePointer UniformConstant 6 8(accNV): 7(ptr) Variable UniformConstant 10: TypeInt 32 0 @@ -36,11 +36,11 @@ spv.RayConstants.rgen 22: TypeInt 32 1 23: 22(int) Constant 1 24: TypeVector 14(float) 4 - 25: TypePointer RayPayloadNV 24(fvec4) - 26(payload): 25(ptr) Variable RayPayloadNV + 25: TypePointer RayPayloadKHR 24(fvec4) + 26(payload): 25(ptr) Variable RayPayloadKHR 4(main): 2 Function None 3 5: Label 9: 6 Load 8(accNV) - TraceNV 9 11 12 13 13 12 17 18 20 21 23 + TraceRayKHR 9 11 12 13 13 12 17 18 20 21 23 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out b/core/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out index 59eabd0dc..47b7c92ce 100644 --- a/core/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out +++ b/core/deps/glslang/Test/baseResults/spv.RayGenShader.rgen.out @@ -7,7 +7,7 @@ spv.RayGenShader.rgen Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint RayGenerationNV 4 "main" 11 21 + EntryPoint RayGenerationKHR 4 "main" 11 21 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -24,8 +24,8 @@ spv.RayGenShader.rgen Name 39 "" Name 50 "accNV1" Name 53 "payload" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 29(accNV0) DescriptorSet 0 Decorate 29(accNV0) Binding 0 MemberDecorate 37(block) 0 Offset 0 @@ -45,24 +45,24 @@ spv.RayGenShader.rgen 13: TypePointer Input 6(int) 17: 6(int) Constant 1 21(gl_LaunchSizeNV): 10(ptr) Variable Input - 27: TypeAccelerationStructureNV + 27: TypeAccelerationStructureKHR 28: TypePointer UniformConstant 27 29(accNV0): 28(ptr) Variable UniformConstant 35: TypeFloat 32 36: TypeVector 35(float) 3 37(block): TypeStruct 36(fvec3) 36(fvec3) - 38: TypePointer ShaderRecordBufferNV 37(block) - 39: 38(ptr) Variable ShaderRecordBufferNV + 38: TypePointer ShaderRecordBufferKHR 37(block) + 39: 38(ptr) Variable ShaderRecordBufferKHR 40: TypeInt 32 1 41: 40(int) Constant 1 - 42: TypePointer ShaderRecordBufferNV 36(fvec3) + 42: TypePointer ShaderRecordBufferKHR 36(fvec3) 45: 35(float) Constant 1056964608 46: 40(int) Constant 0 49: 35(float) Constant 1061158912 50(accNV1): 28(ptr) Variable UniformConstant 51: TypeVector 35(float) 4 - 52: TypePointer RayPayloadNV 51(fvec4) - 53(payload): 52(ptr) Variable RayPayloadNV + 52: TypePointer RayPayloadKHR 51(fvec4) + 53(payload): 52(ptr) Variable RayPayloadKHR 4(main): 2 Function None 3 5: Label 8(lx): 7(ptr) Variable Function @@ -90,6 +90,6 @@ spv.RayGenShader.rgen 44: 36(fvec3) Load 43 47: 42(ptr) AccessChain 39 46 48: 36(fvec3) Load 47 - TraceNV 30 31 32 33 34 12 44 45 48 49 41 + TraceRayKHR 30 31 32 33 34 12 44 45 48 49 41 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out b/core/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out index 2d49b0fc7..0bbcab95f 100755 --- a/core/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out +++ b/core/deps/glslang/Test/baseResults/spv.RayGenShader11.rgen.out @@ -7,7 +7,7 @@ spv.RayGenShader11.rgen Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint RayGenerationNV 4 "main" 11 21 + EntryPoint RayGenerationKHR 4 "main" 11 21 Source GLSL 460 SourceExtension "GL_NV_ray_tracing" Name 4 "main" @@ -23,8 +23,8 @@ spv.RayGenShader11.rgen MemberName 37(block) 1 "origin" Name 39 "" Name 52 "payload" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 29(accNV) DescriptorSet 0 Decorate 29(accNV) Binding 0 MemberDecorate 37(block) 0 Offset 0 @@ -42,23 +42,23 @@ spv.RayGenShader11.rgen 13: TypePointer Input 6(int) 17: 6(int) Constant 1 21(gl_LaunchSizeNV): 10(ptr) Variable Input - 27: TypeAccelerationStructureNV + 27: TypeAccelerationStructureKHR 28: TypePointer UniformConstant 27 29(accNV): 28(ptr) Variable UniformConstant 35: TypeFloat 32 36: TypeVector 35(float) 3 37(block): TypeStruct 36(fvec3) 36(fvec3) - 38: TypePointer ShaderRecordBufferNV 37(block) - 39: 38(ptr) Variable ShaderRecordBufferNV + 38: TypePointer ShaderRecordBufferKHR 37(block) + 39: 38(ptr) Variable ShaderRecordBufferKHR 40: TypeInt 32 1 41: 40(int) Constant 1 - 42: TypePointer ShaderRecordBufferNV 36(fvec3) + 42: TypePointer ShaderRecordBufferKHR 36(fvec3) 45: 35(float) Constant 1056964608 46: 40(int) Constant 0 49: 35(float) Constant 1061158912 50: TypeVector 35(float) 4 - 51: TypePointer RayPayloadNV 50(fvec4) - 52(payload): 51(ptr) Variable RayPayloadNV + 51: TypePointer RayPayloadKHR 50(fvec4) + 52(payload): 51(ptr) Variable RayPayloadKHR 4(main): 2 Function None 3 5: Label 8(lx): 7(ptr) Variable Function @@ -86,6 +86,6 @@ spv.RayGenShader11.rgen 44: 36(fvec3) Load 43 47: 42(ptr) AccessChain 39 46 48: 36(fvec3) Load 47 - TraceNV 30 31 32 33 34 12 44 45 48 49 41 + TraceRayKHR 30 31 32 33 34 12 44 45 48 49 41 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out b/core/deps/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out index e9143049d..ce5f01692 100644 --- a/core/deps/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out +++ b/core/deps/glslang/Test/baseResults/spv.RayGenShaderArray.rgen.out @@ -10,7 +10,7 @@ spv.RayGenShaderArray.rgen Extension "SPV_NV_ray_tracing" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint RayGenerationNV 4 "main" 11 21 + EntryPoint RayGenerationKHR 4 "main" 11 21 Source GLSL 460 SourceExtension "GL_EXT_nonuniform_qualifier" SourceExtension "GL_NV_ray_tracing" @@ -29,8 +29,8 @@ spv.RayGenShaderArray.rgen Name 36 "" Name 60 "accNV1" Name 88 "payload" - Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdNV - Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeNV + Decorate 11(gl_LaunchIDNV) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeNV) BuiltIn LaunchSizeKHR Decorate 30(accNV0) DescriptorSet 0 Decorate 30(accNV0) Binding 0 MemberDecorate 34(block) 0 Offset 0 @@ -40,6 +40,7 @@ spv.RayGenShaderArray.rgen Decorate 60(accNV1) DescriptorSet 0 Decorate 60(accNV1) Binding 1 Decorate 75 DecorationNonUniformEXT + Decorate 76 DecorationNonUniformEXT Decorate 77 DecorationNonUniformEXT Decorate 88(payload) Location 0 2: TypeVoid @@ -53,7 +54,7 @@ spv.RayGenShaderArray.rgen 13: TypePointer Input 6(int) 17: 6(int) Constant 1 21(gl_LaunchSizeNV): 10(ptr) Variable Input - 27: TypeAccelerationStructureNV + 27: TypeAccelerationStructureKHR 28: TypeRuntimeArray 27 29: TypePointer UniformConstant 28 30(accNV0): 29(ptr) Variable UniformConstant @@ -61,13 +62,13 @@ spv.RayGenShaderArray.rgen 32: TypeVector 31(float) 3 33: TypeInt 32 1 34(block): TypeStruct 32(fvec3) 32(fvec3) 33(int) - 35: TypePointer ShaderRecordBufferNV 34(block) - 36: 35(ptr) Variable ShaderRecordBufferNV + 35: TypePointer ShaderRecordBufferKHR 34(block) + 36: 35(ptr) Variable ShaderRecordBufferKHR 37: 33(int) Constant 2 - 38: TypePointer ShaderRecordBufferNV 33(int) + 38: TypePointer ShaderRecordBufferKHR 33(int) 41: TypePointer UniformConstant 27 48: 33(int) Constant 1 - 49: TypePointer ShaderRecordBufferNV 32(fvec3) + 49: TypePointer ShaderRecordBufferKHR 32(fvec3) 52: 31(float) Constant 1056964608 53: 33(int) Constant 0 56: 31(float) Constant 1061158912 @@ -76,8 +77,8 @@ spv.RayGenShaderArray.rgen 59: TypePointer UniformConstant 58 60(accNV1): 59(ptr) Variable UniformConstant 86: TypeVector 31(float) 4 - 87: TypePointer RayPayloadNV 86(fvec4) - 88(payload): 87(ptr) Variable RayPayloadNV + 87: TypePointer RayPayloadKHR 86(fvec4) + 88(payload): 87(ptr) Variable RayPayloadKHR 4(main): 2 Function None 3 5: Label 8(lx): 7(ptr) Variable Function @@ -108,7 +109,7 @@ spv.RayGenShaderArray.rgen 51: 32(fvec3) Load 50 54: 49(ptr) AccessChain 36 53 55: 32(fvec3) Load 54 - TraceNV 43 44 45 46 47 12 51 52 55 56 48 + TraceRayKHR 43 44 45 46 47 12 51 52 55 56 48 61: 38(ptr) AccessChain 36 37 62: 33(int) Load 61 63: 41(ptr) AccessChain 60(accNV1) 62 @@ -121,7 +122,7 @@ spv.RayGenShaderArray.rgen 70: 32(fvec3) Load 69 71: 49(ptr) AccessChain 36 53 72: 32(fvec3) Load 71 - TraceNV 64 65 66 67 68 12 70 52 72 56 48 + TraceRayKHR 64 65 66 67 68 12 70 52 72 56 48 73: 38(ptr) AccessChain 36 37 74: 33(int) Load 73 75: 33(int) CopyObject 74 @@ -135,6 +136,6 @@ spv.RayGenShaderArray.rgen 83: 32(fvec3) Load 82 84: 49(ptr) AccessChain 36 53 85: 32(fvec3) Load 84 - TraceNV 77 78 79 80 81 12 83 52 85 56 48 + TraceRayKHR 77 78 79 80 81 12 83 52 85 56 48 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.atomicCounter.comp.out b/core/deps/glslang/Test/baseResults/spv.atomicCounter.comp.out new file mode 100644 index 000000000..46cccc03f --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.atomicCounter.comp.out @@ -0,0 +1,15 @@ +spv.atomicCounter.comp +ERROR: 0:5: 'atomic counter types' : not allowed when using GLSL for Vulkan +ERROR: 0:7: 'atomic counter types' : not allowed when using GLSL for Vulkan +ERROR: 0:14: 'atomic counter types' : not allowed when using GLSL for Vulkan +ERROR: 0:16: 'atomicCounterIncrement' : no matching overloaded function found +ERROR: 0:16: 'return' : type does not match, or is not convertible to, the function's return type +ERROR: 0:21: 'memoryBarrierAtomicCounter' : no matching overloaded function found +ERROR: 0:23: 'atomicCounter' : no matching overloaded function found +ERROR: 0:23: '=' : cannot convert from ' const float' to ' temp highp uint' +ERROR: 0:24: 'atomicCounterDecrement' : no matching overloaded function found +ERROR: 0:25: 'atomicCounterIncrement' : no matching overloaded function found +ERROR: 10 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.debugPrintf.frag.out b/core/deps/glslang/Test/baseResults/spv.debugPrintf.frag.out new file mode 100644 index 000000000..dbd0b4ed8 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.debugPrintf.frag.out @@ -0,0 +1,31 @@ +spv.debugPrintf.frag +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 17 + + Capability Shader + Extension "SPV_KHR_non_semantic_info" + 1: ExtInstImport "GLSL.std.450" + 11: ExtInstImport "NonSemantic.DebugPrintf" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + 6: String "ASDF \ ? \ %d %d %d" + 13: String "ABAZ" + 15: String "B#$B1Z" + Source GLSL 450 + SourceExtension "GL_EXT_debug_printf" + Name 4 "main" + 2: TypeVoid + 3: TypeFunction 2 + 7: TypeInt 32 1 + 8: 7(int) Constant 1 + 9: 7(int) Constant 2 + 10: 7(int) Constant 3 + 4(main): 2 Function None 3 + 5: Label + 12: 2 ExtInst 11(NonSemantic.DebugPrintf) 1(DebugPrintf) 6 8 9 10 + 14: 2 ExtInst 11(NonSemantic.DebugPrintf) 1(DebugPrintf) 13 + 16: 2 ExtInst 11(NonSemantic.DebugPrintf) 1(DebugPrintf) 15 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.debugPrintf_Error.frag.out b/core/deps/glslang/Test/baseResults/spv.debugPrintf_Error.frag.out new file mode 100644 index 000000000..31ddd9d08 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.debugPrintf_Error.frag.out @@ -0,0 +1,7 @@ +spv.debugPrintf_Error.frag +ERROR: 0:7: 'string' : Expected hex value in escape sequence +ERROR: 0:10: 'string' : Invalid escape sequence +ERROR: 2 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader.rahit.out b/core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader.rahit.out new file mode 100644 index 000000000..3cd60c781 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader.rahit.out @@ -0,0 +1,188 @@ +spv.ext.AnyHitShader.rahit +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 94 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint AnyHitKHR 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 70 76 80 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDEXT" + Name 13 "v1" + Name 14 "gl_LaunchSizeEXT" + Name 18 "v2" + Name 20 "gl_PrimitiveID" + Name 22 "v3" + Name 23 "gl_InstanceID" + Name 25 "v4" + Name 26 "gl_InstanceCustomIndexEXT" + Name 31 "v5" + Name 33 "gl_WorldRayOriginEXT" + Name 35 "v6" + Name 36 "gl_WorldRayDirectionEXT" + Name 38 "v7" + Name 39 "gl_ObjectRayOriginEXT" + Name 41 "v8" + Name 42 "gl_ObjectRayDirectionEXT" + Name 45 "v9" + Name 47 "gl_RayTminEXT" + Name 49 "v10" + Name 50 "gl_RayTmaxEXT" + Name 52 "v11" + Name 53 "gl_HitTEXT" + Name 56 "v12" + Name 58 "gl_HitKindEXT" + Name 62 "v13" + Name 64 "gl_ObjectToWorldEXT" + Name 66 "v14" + Name 67 "gl_WorldToObjectEXT" + Name 69 "v15" + Name 70 "gl_GeometryIndexEXT" + Name 75 "v16" + Name 76 "gl_ObjectToWorld3x4EXT" + Name 79 "v17" + Name 80 "gl_WorldToObject3x4EXT" + Name 84 "incomingPayload" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + Decorate 26(gl_InstanceCustomIndexEXT) BuiltIn InstanceCustomIndexKHR + Decorate 33(gl_WorldRayOriginEXT) BuiltIn WorldRayOriginKHR + Decorate 36(gl_WorldRayDirectionEXT) BuiltIn WorldRayDirectionKHR + Decorate 39(gl_ObjectRayOriginEXT) BuiltIn ObjectRayOriginKHR + Decorate 42(gl_ObjectRayDirectionEXT) BuiltIn ObjectRayDirectionKHR + Decorate 47(gl_RayTminEXT) BuiltIn RayTminKHR + Decorate 50(gl_RayTmaxEXT) BuiltIn RayTmaxKHR + Decorate 53(gl_HitTEXT) BuiltIn HitTKHR + Decorate 58(gl_HitKindEXT) BuiltIn HitKindKHR + Decorate 64(gl_ObjectToWorldEXT) BuiltIn ObjectToWorldKHR + Decorate 67(gl_WorldToObjectEXT) BuiltIn WorldToObjectKHR + Decorate 70(gl_GeometryIndexEXT) BuiltIn RayGeometryIndexKHR + Decorate 76(gl_ObjectToWorld3x4EXT) BuiltIn ObjectToWorldKHR + Decorate 80(gl_WorldToObject3x4EXT) BuiltIn WorldToObjectKHR + Decorate 84(incomingPayload) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input +14(gl_LaunchSizeEXT): 10(ptr) Variable Input + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: TypePointer Input 16(int) +20(gl_PrimitiveID): 19(ptr) Variable Input +23(gl_InstanceID): 19(ptr) Variable Input +26(gl_InstanceCustomIndexEXT): 19(ptr) Variable Input + 28: TypeFloat 32 + 29: TypeVector 28(float) 3 + 30: TypePointer Function 29(fvec3) + 32: TypePointer Input 29(fvec3) +33(gl_WorldRayOriginEXT): 32(ptr) Variable Input +36(gl_WorldRayDirectionEXT): 32(ptr) Variable Input +39(gl_ObjectRayOriginEXT): 32(ptr) Variable Input +42(gl_ObjectRayDirectionEXT): 32(ptr) Variable Input + 44: TypePointer Function 28(float) + 46: TypePointer Input 28(float) +47(gl_RayTminEXT): 46(ptr) Variable Input +50(gl_RayTmaxEXT): 46(ptr) Variable Input + 53(gl_HitTEXT): 46(ptr) Variable Input + 55: TypePointer Function 6(int) + 57: TypePointer Input 6(int) +58(gl_HitKindEXT): 57(ptr) Variable Input + 60: TypeMatrix 29(fvec3) 4 + 61: TypePointer Function 60 + 63: TypePointer Input 60 +64(gl_ObjectToWorldEXT): 63(ptr) Variable Input +67(gl_WorldToObjectEXT): 63(ptr) Variable Input +70(gl_GeometryIndexEXT): 19(ptr) Variable Input + 72: TypeVector 28(float) 4 + 73: TypeMatrix 72(fvec4) 3 + 74: TypePointer Function 73 +76(gl_ObjectToWorld3x4EXT): 63(ptr) Variable Input +80(gl_WorldToObject3x4EXT): 63(ptr) Variable Input + 83: TypePointer IncomingRayPayloadKHR 72(fvec4) +84(incomingPayload): 83(ptr) Variable IncomingRayPayloadKHR + 85: 28(float) Constant 1056964608 + 86: 72(fvec4) ConstantComposite 85 85 85 85 + 88: 16(int) Constant 1 + 89: TypeBool + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 18(v2): 17(ptr) Variable Function + 22(v3): 17(ptr) Variable Function + 25(v4): 17(ptr) Variable Function + 31(v5): 30(ptr) Variable Function + 35(v6): 30(ptr) Variable Function + 38(v7): 30(ptr) Variable Function + 41(v8): 30(ptr) Variable Function + 45(v9): 44(ptr) Variable Function + 49(v10): 44(ptr) Variable Function + 52(v11): 44(ptr) Variable Function + 56(v12): 55(ptr) Variable Function + 62(v13): 61(ptr) Variable Function + 66(v14): 61(ptr) Variable Function + 69(v15): 17(ptr) Variable Function + 75(v16): 74(ptr) Variable Function + 79(v17): 74(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDEXT) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeEXT) + Store 13(v1) 15 + 21: 16(int) Load 20(gl_PrimitiveID) + Store 18(v2) 21 + 24: 16(int) Load 23(gl_InstanceID) + Store 22(v3) 24 + 27: 16(int) Load 26(gl_InstanceCustomIndexEXT) + Store 25(v4) 27 + 34: 29(fvec3) Load 33(gl_WorldRayOriginEXT) + Store 31(v5) 34 + 37: 29(fvec3) Load 36(gl_WorldRayDirectionEXT) + Store 35(v6) 37 + 40: 29(fvec3) Load 39(gl_ObjectRayOriginEXT) + Store 38(v7) 40 + 43: 29(fvec3) Load 42(gl_ObjectRayDirectionEXT) + Store 41(v8) 43 + 48: 28(float) Load 47(gl_RayTminEXT) + Store 45(v9) 48 + 51: 28(float) Load 50(gl_RayTmaxEXT) + Store 49(v10) 51 + 54: 28(float) Load 53(gl_HitTEXT) + Store 52(v11) 54 + 59: 6(int) Load 58(gl_HitKindEXT) + Store 56(v12) 59 + 65: 60 Load 64(gl_ObjectToWorldEXT) + Store 62(v13) 65 + 68: 60 Load 67(gl_WorldToObjectEXT) + Store 66(v14) 68 + 71: 16(int) Load 70(gl_GeometryIndexEXT) + Store 69(v15) 71 + 77: 60 Load 76(gl_ObjectToWorld3x4EXT) + 78: 73 Transpose 77 + Store 75(v16) 78 + 81: 60 Load 80(gl_WorldToObject3x4EXT) + 82: 73 Transpose 81 + Store 79(v17) 82 + Store 84(incomingPayload) 86 + 87: 16(int) Load 18(v2) + 90: 89(bool) IEqual 87 88 + SelectionMerge 92 None + BranchConditional 90 91 93 + 91: Label + IgnoreIntersectionKHR + Branch 92 + 93: Label + TerminateRayKHR + Branch 92 + 92: Label + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader_Errors.rahit.out b/core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader_Errors.rahit.out new file mode 100644 index 000000000..8c474293f --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.AnyHitShader_Errors.rahit.out @@ -0,0 +1,8 @@ +spv.ext.AnyHitShader_Errors.rahit +ERROR: 0:8: 'assign' : l-value required "payload" (cannot modify hitAttributeNV in this stage) +ERROR: 0:9: 'reportIntersectionEXT' : no matching overloaded function found +ERROR: 0:10: 'traceRayEXT' : no matching overloaded function found +ERROR: 3 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader.rchit.out b/core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader.rchit.out new file mode 100644 index 000000000..278b5c162 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader.rchit.out @@ -0,0 +1,194 @@ +spv.ext.ClosestHitShader.rchit +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 101 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint ClosestHitKHR 4 "main" 11 14 20 23 26 33 36 39 42 47 50 53 58 64 67 70 76 80 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDEXT" + Name 13 "v1" + Name 14 "gl_LaunchSizeEXT" + Name 18 "v2" + Name 20 "gl_PrimitiveID" + Name 22 "v3" + Name 23 "gl_InstanceID" + Name 25 "v4" + Name 26 "gl_InstanceCustomIndexEXT" + Name 31 "v5" + Name 33 "gl_WorldRayOriginEXT" + Name 35 "v6" + Name 36 "gl_WorldRayDirectionEXT" + Name 38 "v7" + Name 39 "gl_ObjectRayOriginEXT" + Name 41 "v8" + Name 42 "gl_ObjectRayDirectionEXT" + Name 45 "v9" + Name 47 "gl_RayTminEXT" + Name 49 "v10" + Name 50 "gl_RayTmaxEXT" + Name 52 "v11" + Name 53 "gl_HitTEXT" + Name 56 "v12" + Name 58 "gl_HitKindEXT" + Name 62 "v13" + Name 64 "gl_ObjectToWorldEXT" + Name 66 "v14" + Name 67 "gl_WorldToObjectEXT" + Name 69 "v15" + Name 70 "gl_GeometryIndexEXT" + Name 75 "v16" + Name 76 "gl_ObjectToWorld3x4EXT" + Name 79 "v17" + Name 80 "gl_WorldToObject3x4EXT" + Name 85 "accEXT" + Name 98 "localPayload" + Name 100 "incomingPayload" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + Decorate 26(gl_InstanceCustomIndexEXT) BuiltIn InstanceCustomIndexKHR + Decorate 33(gl_WorldRayOriginEXT) BuiltIn WorldRayOriginKHR + Decorate 36(gl_WorldRayDirectionEXT) BuiltIn WorldRayDirectionKHR + Decorate 39(gl_ObjectRayOriginEXT) BuiltIn ObjectRayOriginKHR + Decorate 42(gl_ObjectRayDirectionEXT) BuiltIn ObjectRayDirectionKHR + Decorate 47(gl_RayTminEXT) BuiltIn RayTminKHR + Decorate 50(gl_RayTmaxEXT) BuiltIn RayTmaxKHR + Decorate 53(gl_HitTEXT) BuiltIn HitTKHR + Decorate 58(gl_HitKindEXT) BuiltIn HitKindKHR + Decorate 64(gl_ObjectToWorldEXT) BuiltIn ObjectToWorldKHR + Decorate 67(gl_WorldToObjectEXT) BuiltIn WorldToObjectKHR + Decorate 70(gl_GeometryIndexEXT) BuiltIn RayGeometryIndexKHR + Decorate 76(gl_ObjectToWorld3x4EXT) BuiltIn ObjectToWorldKHR + Decorate 80(gl_WorldToObject3x4EXT) BuiltIn WorldToObjectKHR + Decorate 85(accEXT) DescriptorSet 0 + Decorate 85(accEXT) Binding 0 + Decorate 98(localPayload) Location 0 + Decorate 100(incomingPayload) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input +14(gl_LaunchSizeEXT): 10(ptr) Variable Input + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: TypePointer Input 16(int) +20(gl_PrimitiveID): 19(ptr) Variable Input +23(gl_InstanceID): 19(ptr) Variable Input +26(gl_InstanceCustomIndexEXT): 19(ptr) Variable Input + 28: TypeFloat 32 + 29: TypeVector 28(float) 3 + 30: TypePointer Function 29(fvec3) + 32: TypePointer Input 29(fvec3) +33(gl_WorldRayOriginEXT): 32(ptr) Variable Input +36(gl_WorldRayDirectionEXT): 32(ptr) Variable Input +39(gl_ObjectRayOriginEXT): 32(ptr) Variable Input +42(gl_ObjectRayDirectionEXT): 32(ptr) Variable Input + 44: TypePointer Function 28(float) + 46: TypePointer Input 28(float) +47(gl_RayTminEXT): 46(ptr) Variable Input +50(gl_RayTmaxEXT): 46(ptr) Variable Input + 53(gl_HitTEXT): 46(ptr) Variable Input + 55: TypePointer Function 6(int) + 57: TypePointer Input 6(int) +58(gl_HitKindEXT): 57(ptr) Variable Input + 60: TypeMatrix 29(fvec3) 4 + 61: TypePointer Function 60 + 63: TypePointer Input 60 +64(gl_ObjectToWorldEXT): 63(ptr) Variable Input +67(gl_WorldToObjectEXT): 63(ptr) Variable Input +70(gl_GeometryIndexEXT): 19(ptr) Variable Input + 72: TypeVector 28(float) 4 + 73: TypeMatrix 72(fvec4) 3 + 74: TypePointer Function 73 +76(gl_ObjectToWorld3x4EXT): 63(ptr) Variable Input +80(gl_WorldToObject3x4EXT): 63(ptr) Variable Input + 83: TypeAccelerationStructureKHR + 84: TypePointer UniformConstant 83 + 85(accEXT): 84(ptr) Variable UniformConstant + 87: 6(int) Constant 0 + 88: 6(int) Constant 1 + 89: 6(int) Constant 2 + 90: 6(int) Constant 3 + 91: 28(float) Constant 1056964608 + 92: 29(fvec3) ConstantComposite 91 91 91 + 93: 28(float) Constant 1065353216 + 94: 29(fvec3) ConstantComposite 93 93 93 + 95: 28(float) Constant 1061158912 + 96: 16(int) Constant 1 + 97: TypePointer RayPayloadKHR 72(fvec4) +98(localPayload): 97(ptr) Variable RayPayloadKHR + 99: TypePointer IncomingRayPayloadKHR 72(fvec4) +100(incomingPayload): 99(ptr) Variable IncomingRayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 18(v2): 17(ptr) Variable Function + 22(v3): 17(ptr) Variable Function + 25(v4): 17(ptr) Variable Function + 31(v5): 30(ptr) Variable Function + 35(v6): 30(ptr) Variable Function + 38(v7): 30(ptr) Variable Function + 41(v8): 30(ptr) Variable Function + 45(v9): 44(ptr) Variable Function + 49(v10): 44(ptr) Variable Function + 52(v11): 44(ptr) Variable Function + 56(v12): 55(ptr) Variable Function + 62(v13): 61(ptr) Variable Function + 66(v14): 61(ptr) Variable Function + 69(v15): 17(ptr) Variable Function + 75(v16): 74(ptr) Variable Function + 79(v17): 74(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDEXT) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeEXT) + Store 13(v1) 15 + 21: 16(int) Load 20(gl_PrimitiveID) + Store 18(v2) 21 + 24: 16(int) Load 23(gl_InstanceID) + Store 22(v3) 24 + 27: 16(int) Load 26(gl_InstanceCustomIndexEXT) + Store 25(v4) 27 + 34: 29(fvec3) Load 33(gl_WorldRayOriginEXT) + Store 31(v5) 34 + 37: 29(fvec3) Load 36(gl_WorldRayDirectionEXT) + Store 35(v6) 37 + 40: 29(fvec3) Load 39(gl_ObjectRayOriginEXT) + Store 38(v7) 40 + 43: 29(fvec3) Load 42(gl_ObjectRayDirectionEXT) + Store 41(v8) 43 + 48: 28(float) Load 47(gl_RayTminEXT) + Store 45(v9) 48 + 51: 28(float) Load 50(gl_RayTmaxEXT) + Store 49(v10) 51 + 54: 28(float) Load 53(gl_HitTEXT) + Store 52(v11) 54 + 59: 6(int) Load 58(gl_HitKindEXT) + Store 56(v12) 59 + 65: 60 Load 64(gl_ObjectToWorldEXT) + Store 62(v13) 65 + 68: 60 Load 67(gl_WorldToObjectEXT) + Store 66(v14) 68 + 71: 16(int) Load 70(gl_GeometryIndexEXT) + Store 69(v15) 71 + 77: 60 Load 76(gl_ObjectToWorld3x4EXT) + 78: 73 Transpose 77 + Store 75(v16) 78 + 81: 60 Load 80(gl_WorldToObject3x4EXT) + 82: 73 Transpose 81 + Store 79(v17) 82 + 86: 83 Load 85(accEXT) + TraceRayKHR 86 87 88 89 90 87 92 91 94 95 96 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader_Errors.rchit.out b/core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader_Errors.rchit.out new file mode 100644 index 000000000..6c87d1cad --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.ClosestHitShader_Errors.rchit.out @@ -0,0 +1,10 @@ +spv.ext.ClosestHitShader_Errors.rchit +ERROR: 0:8: 'assign' : l-value required "payload" (cannot modify hitAttributeNV in this stage) +ERROR: 0:9: 'reportIntersectionEXT' : no matching overloaded function found +ERROR: 0:10: 'terminateRayEXT' : no matching overloaded function found +ERROR: 0:11: 'ignoreIntersectionEXT' : no matching overloaded function found +ERROR: 0:12: 'gl_RayFlagsSkipAABBEXT' : required extension not requested: GL_EXT_ray_flags_primitive_culling +ERROR: 5 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.ext.IntersectShader.rint.out b/core/deps/glslang/Test/baseResults/spv.ext.IntersectShader.rint.out new file mode 100644 index 000000000..b8b8de225 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.IntersectShader.rint.out @@ -0,0 +1,156 @@ +spv.ext.IntersectShader.rint +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 81 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint IntersectionKHR 4 "main" 11 14 20 23 26 33 36 39 42 47 50 56 59 65 69 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDEXT" + Name 13 "v1" + Name 14 "gl_LaunchSizeEXT" + Name 18 "v2" + Name 20 "gl_PrimitiveID" + Name 22 "v3" + Name 23 "gl_InstanceID" + Name 25 "v4" + Name 26 "gl_InstanceCustomIndexEXT" + Name 31 "v5" + Name 33 "gl_WorldRayOriginEXT" + Name 35 "v6" + Name 36 "gl_WorldRayDirectionEXT" + Name 38 "v7" + Name 39 "gl_ObjectRayOriginEXT" + Name 41 "v8" + Name 42 "gl_ObjectRayDirectionEXT" + Name 45 "v9" + Name 47 "gl_RayTminEXT" + Name 49 "v10" + Name 50 "gl_RayTmaxEXT" + Name 54 "v11" + Name 56 "gl_ObjectToWorldEXT" + Name 58 "v12" + Name 59 "gl_WorldToObjectEXT" + Name 64 "v13" + Name 65 "gl_ObjectToWorld3x4EXT" + Name 68 "v14" + Name 69 "gl_WorldToObject3x4EXT" + Name 73 "iAttr" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 20(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 23(gl_InstanceID) BuiltIn InstanceId + Decorate 26(gl_InstanceCustomIndexEXT) BuiltIn InstanceCustomIndexKHR + Decorate 33(gl_WorldRayOriginEXT) BuiltIn WorldRayOriginKHR + Decorate 36(gl_WorldRayDirectionEXT) BuiltIn WorldRayDirectionKHR + Decorate 39(gl_ObjectRayOriginEXT) BuiltIn ObjectRayOriginKHR + Decorate 42(gl_ObjectRayDirectionEXT) BuiltIn ObjectRayDirectionKHR + Decorate 47(gl_RayTminEXT) BuiltIn RayTminKHR + Decorate 50(gl_RayTmaxEXT) BuiltIn RayTmaxKHR + Decorate 56(gl_ObjectToWorldEXT) BuiltIn ObjectToWorldKHR + Decorate 59(gl_WorldToObjectEXT) BuiltIn WorldToObjectKHR + Decorate 65(gl_ObjectToWorld3x4EXT) BuiltIn ObjectToWorldKHR + Decorate 69(gl_WorldToObject3x4EXT) BuiltIn WorldToObjectKHR + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input +14(gl_LaunchSizeEXT): 10(ptr) Variable Input + 16: TypeInt 32 1 + 17: TypePointer Function 16(int) + 19: TypePointer Input 16(int) +20(gl_PrimitiveID): 19(ptr) Variable Input +23(gl_InstanceID): 19(ptr) Variable Input +26(gl_InstanceCustomIndexEXT): 19(ptr) Variable Input + 28: TypeFloat 32 + 29: TypeVector 28(float) 3 + 30: TypePointer Function 29(fvec3) + 32: TypePointer Input 29(fvec3) +33(gl_WorldRayOriginEXT): 32(ptr) Variable Input +36(gl_WorldRayDirectionEXT): 32(ptr) Variable Input +39(gl_ObjectRayOriginEXT): 32(ptr) Variable Input +42(gl_ObjectRayDirectionEXT): 32(ptr) Variable Input + 44: TypePointer Function 28(float) + 46: TypePointer Input 28(float) +47(gl_RayTminEXT): 46(ptr) Variable Input +50(gl_RayTmaxEXT): 46(ptr) Variable Input + 52: TypeMatrix 29(fvec3) 4 + 53: TypePointer Function 52 + 55: TypePointer Input 52 +56(gl_ObjectToWorldEXT): 55(ptr) Variable Input +59(gl_WorldToObjectEXT): 55(ptr) Variable Input + 61: TypeVector 28(float) 4 + 62: TypeMatrix 61(fvec4) 3 + 63: TypePointer Function 62 +65(gl_ObjectToWorld3x4EXT): 55(ptr) Variable Input +69(gl_WorldToObject3x4EXT): 55(ptr) Variable Input + 72: TypePointer HitAttributeKHR 61(fvec4) + 73(iAttr): 72(ptr) Variable HitAttributeKHR + 74: 28(float) Constant 1056964608 + 75: 28(float) Constant 0 + 76: 28(float) Constant 1065353216 + 77: 61(fvec4) ConstantComposite 74 74 75 76 + 78: 6(int) Constant 1 + 79: TypeBool + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 18(v2): 17(ptr) Variable Function + 22(v3): 17(ptr) Variable Function + 25(v4): 17(ptr) Variable Function + 31(v5): 30(ptr) Variable Function + 35(v6): 30(ptr) Variable Function + 38(v7): 30(ptr) Variable Function + 41(v8): 30(ptr) Variable Function + 45(v9): 44(ptr) Variable Function + 49(v10): 44(ptr) Variable Function + 54(v11): 53(ptr) Variable Function + 58(v12): 53(ptr) Variable Function + 64(v13): 63(ptr) Variable Function + 68(v14): 63(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDEXT) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeEXT) + Store 13(v1) 15 + 21: 16(int) Load 20(gl_PrimitiveID) + Store 18(v2) 21 + 24: 16(int) Load 23(gl_InstanceID) + Store 22(v3) 24 + 27: 16(int) Load 26(gl_InstanceCustomIndexEXT) + Store 25(v4) 27 + 34: 29(fvec3) Load 33(gl_WorldRayOriginEXT) + Store 31(v5) 34 + 37: 29(fvec3) Load 36(gl_WorldRayDirectionEXT) + Store 35(v6) 37 + 40: 29(fvec3) Load 39(gl_ObjectRayOriginEXT) + Store 38(v7) 40 + 43: 29(fvec3) Load 42(gl_ObjectRayDirectionEXT) + Store 41(v8) 43 + 48: 28(float) Load 47(gl_RayTminEXT) + Store 45(v9) 48 + 51: 28(float) Load 50(gl_RayTmaxEXT) + Store 49(v10) 51 + 57: 52 Load 56(gl_ObjectToWorldEXT) + Store 54(v11) 57 + 60: 52 Load 59(gl_WorldToObjectEXT) + Store 58(v12) 60 + 66: 52 Load 65(gl_ObjectToWorld3x4EXT) + 67: 62 Transpose 66 + Store 64(v13) 67 + 70: 52 Load 69(gl_WorldToObject3x4EXT) + 71: 62 Transpose 70 + Store 68(v14) 71 + Store 73(iAttr) 77 + 80: 79(bool) ReportIntersectionKHR 74 78 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.IntersectShader_Errors.rint.out b/core/deps/glslang/Test/baseResults/spv.ext.IntersectShader_Errors.rint.out new file mode 100644 index 000000000..03f9b275c --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.IntersectShader_Errors.rint.out @@ -0,0 +1,10 @@ +spv.ext.IntersectShader_Errors.rint +ERROR: 0:3: 'rayPayloadInEXT' : not supported in this stage: intersection +ERROR: 0:4: 'rayPayloadEXT' : not supported in this stage: intersection +ERROR: 0:8: 'gl_HitTEXT' : undeclared identifier +ERROR: 0:9: 'gl_HitKindEXT' : undeclared identifier +ERROR: 0:10: 'traceRayEXT' : no matching overloaded function found +ERROR: 5 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.ext.MissShader.rmiss.out b/core/deps/glslang/Test/baseResults/spv.ext.MissShader.rmiss.out new file mode 100644 index 000000000..dd3f15f1c --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.MissShader.rmiss.out @@ -0,0 +1,99 @@ +spv.ext.MissShader.rmiss +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 54 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MissKHR 4 "main" 11 14 21 24 29 32 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 9 "v0" + Name 11 "gl_LaunchIDEXT" + Name 13 "v1" + Name 14 "gl_LaunchSizeEXT" + Name 19 "v2" + Name 21 "gl_WorldRayOriginEXT" + Name 23 "v3" + Name 24 "gl_WorldRayDirectionEXT" + Name 27 "v4" + Name 29 "gl_RayTminEXT" + Name 31 "v5" + Name 32 "gl_RayTmaxEXT" + Name 36 "accEXT" + Name 51 "localPayload" + Name 53 "incomingPayload" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 21(gl_WorldRayOriginEXT) BuiltIn WorldRayOriginKHR + Decorate 24(gl_WorldRayDirectionEXT) BuiltIn WorldRayDirectionKHR + Decorate 29(gl_RayTminEXT) BuiltIn RayTminKHR + Decorate 32(gl_RayTmaxEXT) BuiltIn RayTmaxKHR + Decorate 36(accEXT) DescriptorSet 0 + Decorate 36(accEXT) Binding 0 + Decorate 51(localPayload) Location 0 + Decorate 53(incomingPayload) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input +14(gl_LaunchSizeEXT): 10(ptr) Variable Input + 16: TypeFloat 32 + 17: TypeVector 16(float) 3 + 18: TypePointer Function 17(fvec3) + 20: TypePointer Input 17(fvec3) +21(gl_WorldRayOriginEXT): 20(ptr) Variable Input +24(gl_WorldRayDirectionEXT): 20(ptr) Variable Input + 26: TypePointer Function 16(float) + 28: TypePointer Input 16(float) +29(gl_RayTminEXT): 28(ptr) Variable Input +32(gl_RayTmaxEXT): 28(ptr) Variable Input + 34: TypeAccelerationStructureKHR + 35: TypePointer UniformConstant 34 + 36(accEXT): 35(ptr) Variable UniformConstant + 38: 6(int) Constant 0 + 39: 6(int) Constant 1 + 40: 6(int) Constant 2 + 41: 6(int) Constant 3 + 42: 16(float) Constant 1056964608 + 43: 17(fvec3) ConstantComposite 42 42 42 + 44: 16(float) Constant 1065353216 + 45: 17(fvec3) ConstantComposite 44 44 44 + 46: 16(float) Constant 1061158912 + 47: TypeInt 32 1 + 48: 47(int) Constant 1 + 49: TypeVector 16(float) 4 + 50: TypePointer RayPayloadKHR 49(fvec4) +51(localPayload): 50(ptr) Variable RayPayloadKHR + 52: TypePointer IncomingRayPayloadKHR 49(fvec4) +53(incomingPayload): 52(ptr) Variable IncomingRayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 9(v0): 8(ptr) Variable Function + 13(v1): 8(ptr) Variable Function + 19(v2): 18(ptr) Variable Function + 23(v3): 18(ptr) Variable Function + 27(v4): 26(ptr) Variable Function + 31(v5): 26(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDEXT) + Store 9(v0) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeEXT) + Store 13(v1) 15 + 22: 17(fvec3) Load 21(gl_WorldRayOriginEXT) + Store 19(v2) 22 + 25: 17(fvec3) Load 24(gl_WorldRayDirectionEXT) + Store 23(v3) 25 + 30: 16(float) Load 29(gl_RayTminEXT) + Store 27(v4) 30 + 33: 16(float) Load 32(gl_RayTmaxEXT) + Store 31(v5) 33 + 37: 34 Load 36(accEXT) + TraceRayKHR 37 38 39 40 41 38 43 42 45 46 48 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.MissShader_Errors.rmiss.out b/core/deps/glslang/Test/baseResults/spv.ext.MissShader_Errors.rmiss.out new file mode 100644 index 000000000..929a2a7ea --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.MissShader_Errors.rmiss.out @@ -0,0 +1,21 @@ +spv.ext.MissShader_Errors.rmiss +ERROR: 0:3: 'hitAttributeEXT' : not supported in this stage: miss +ERROR: 0:6: 'gl_PrimitiveID' : undeclared identifier +ERROR: 0:6: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:7: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?) +ERROR: 0:7: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:8: 'gl_InstanceCustomIndexEXT' : undeclared identifier +ERROR: 0:8: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:9: 'gl_ObjectToWorldEXT' : undeclared identifier +ERROR: 0:9: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:10: 'gl_WorldToObjectEXT' : undeclared identifier +ERROR: 0:10: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:11: 'gl_HitTEXT' : undeclared identifier +ERROR: 0:12: 'gl_HitKindEXT' : undeclared identifier +ERROR: 0:13: 'reportIntersectionEXT' : no matching overloaded function found +ERROR: 0:14: 'ignoreIntersectionEXT' : no matching overloaded function found +ERROR: 0:15: 'terminateRayEXT' : no matching overloaded function found +ERROR: 16 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayCallable.rcall.out b/core/deps/glslang/Test/baseResults/spv.ext.RayCallable.rcall.out new file mode 100644 index 000000000..ac3b2b537 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayCallable.rcall.out @@ -0,0 +1,60 @@ +spv.ext.RayCallable.rcall +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 30 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint CallableKHR 4 "main" 11 14 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 9 "id" + Name 11 "gl_LaunchIDEXT" + Name 13 "size" + Name 14 "gl_LaunchSizeEXT" + Name 16 "dataBlock" + MemberName 16(dataBlock) 0 "data1" + Name 18 "" + Name 29 "data0" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 14(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 16(dataBlock) Block + Decorate 18 Location 1 + Decorate 29(data0) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeVector 6(int) 3 + 8: TypePointer Function 7(ivec3) + 10: TypePointer Input 7(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input +14(gl_LaunchSizeEXT): 10(ptr) Variable Input + 16(dataBlock): TypeStruct 6(int) + 17: TypePointer IncomingCallableDataKHR 16(dataBlock) + 18: 17(ptr) Variable IncomingCallableDataKHR + 19: TypeInt 32 1 + 20: 19(int) Constant 0 + 21: 6(int) Constant 256 + 22: TypePointer IncomingCallableDataKHR 6(int) + 24: 6(int) Constant 2 + 25: 19(int) Constant 1 + 26: TypeFloat 32 + 27: TypeVector 26(float) 4 + 28: TypePointer CallableDataKHR 27(fvec4) + 29(data0): 28(ptr) Variable CallableDataKHR + 4(main): 2 Function None 3 + 5: Label + 9(id): 8(ptr) Variable Function + 13(size): 8(ptr) Variable Function + 12: 7(ivec3) Load 11(gl_LaunchIDEXT) + Store 9(id) 12 + 15: 7(ivec3) Load 14(gl_LaunchSizeEXT) + Store 13(size) 15 + 23: 22(ptr) AccessChain 18 20 + Store 23 21 + ExecuteCallableKHR 24 25 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayCallable_Errors.rcall.out b/core/deps/glslang/Test/baseResults/spv.ext.RayCallable_Errors.rcall.out new file mode 100644 index 000000000..469934263 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayCallable_Errors.rcall.out @@ -0,0 +1,35 @@ +spv.ext.RayCallable_Errors.rcall +ERROR: 0:3: 'hitAttributeEXT' : not supported in this stage: callable +ERROR: 0:4: 'rayPayloadEXT' : not supported in this stage: callable +ERROR: 0:5: 'rayPayloadInEXT' : not supported in this stage: callable +ERROR: 0:9: 'gl_PrimitiveID' : undeclared identifier +ERROR: 0:9: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:10: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?) +ERROR: 0:10: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:11: 'gl_InstanceCustomIndexEXT' : undeclared identifier +ERROR: 0:11: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:12: 'gl_WorldRayOriginEXT' : undeclared identifier +ERROR: 0:12: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:13: 'gl_WorldRayDirectionEXT' : undeclared identifier +ERROR: 0:13: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:14: 'gl_ObjectRayOriginEXT' : undeclared identifier +ERROR: 0:14: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:15: 'gl_ObjectRayDirectionEXT' : undeclared identifier +ERROR: 0:15: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:16: 'gl_RayTminEXT' : undeclared identifier +ERROR: 0:17: 'gl_RayTmaxEXT' : undeclared identifier +ERROR: 0:18: 'gl_ObjectToWorldEXT' : undeclared identifier +ERROR: 0:18: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:19: 'gl_WorldToObjectEXT' : undeclared identifier +ERROR: 0:19: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:20: 'gl_HitTEXT' : undeclared identifier +ERROR: 0:21: 'gl_HitKindEXT' : undeclared identifier +ERROR: 0:22: 'gl_IncomingRayFlagsEXT' : undeclared identifier +ERROR: 0:22: '=' : cannot convert from ' temp float' to ' temp highp uint' +ERROR: 0:23: 'reportIntersectionEXT' : no matching overloaded function found +ERROR: 0:24: 'ignoreIntersectionEXT' : no matching overloaded function found +ERROR: 0:25: 'terminateRayEXT' : no matching overloaded function found +ERROR: 30 compilation errors. No code generated. + + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayConstants.rgen.out b/core/deps/glslang/Test/baseResults/spv.ext.RayConstants.rgen.out new file mode 100644 index 000000000..5903ec937 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayConstants.rgen.out @@ -0,0 +1,46 @@ +spv.ext.RayConstants.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 27 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 8 "accEXT" + Name 26 "payload" + Decorate 8(accEXT) DescriptorSet 0 + Decorate 8(accEXT) Binding 0 + Decorate 26(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeAccelerationStructureKHR + 7: TypePointer UniformConstant 6 + 8(accEXT): 7(ptr) Variable UniformConstant + 10: TypeInt 32 0 + 11: 10(int) Constant 255 + 12: 10(int) Constant 0 + 13: 10(int) Constant 1 + 14: TypeFloat 32 + 15: TypeVector 14(float) 3 + 16: 14(float) Constant 0 + 17: 15(fvec3) ConstantComposite 16 16 16 + 18: 14(float) Constant 1056964608 + 19: 14(float) Constant 1065353216 + 20: 15(fvec3) ConstantComposite 19 19 19 + 21: 14(float) Constant 1061158912 + 22: TypeInt 32 1 + 23: 22(int) Constant 1 + 24: TypeVector 14(float) 4 + 25: TypePointer RayPayloadKHR 24(fvec4) + 26(payload): 25(ptr) Variable RayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 9: 6 Load 8(accEXT) + TraceRayKHR 9 11 12 13 13 12 17 18 20 21 23 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader.rgen.out b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader.rgen.out new file mode 100644 index 000000000..da16fa453 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader.rgen.out @@ -0,0 +1,104 @@ +spv.ext.RayGenShader.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 58 + + Capability RayTraversalPrimitiveCullingProvisionalKHR + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" 11 21 + Source GLSL 460 + SourceExtension "GL_EXT_ray_flags_primitive_culling" + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 8 "lx" + Name 11 "gl_LaunchIDEXT" + Name 16 "ly" + Name 20 "sx" + Name 21 "gl_LaunchSizeEXT" + Name 24 "sy" + Name 29 "accEXT0" + Name 38 "block" + MemberName 38(block) 0 "dir" + MemberName 38(block) 1 "origin" + Name 40 "" + Name 51 "accEXT1" + Name 54 "imageu" + Name 57 "payload" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 29(accEXT0) DescriptorSet 0 + Decorate 29(accEXT0) Binding 0 + MemberDecorate 38(block) 0 Offset 0 + MemberDecorate 38(block) 1 Offset 16 + Decorate 38(block) BufferBlock + Decorate 51(accEXT1) DescriptorSet 0 + Decorate 51(accEXT1) Binding 1 + Decorate 54(imageu) DescriptorSet 0 + Decorate 54(imageu) Binding 2 + Decorate 57(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 1 +21(gl_LaunchSizeEXT): 10(ptr) Variable Input + 27: TypeAccelerationStructureKHR + 28: TypePointer UniformConstant 27 + 29(accEXT0): 28(ptr) Variable UniformConstant + 35: 6(int) Constant 768 + 36: TypeFloat 32 + 37: TypeVector 36(float) 3 + 38(block): TypeStruct 37(fvec3) 37(fvec3) + 39: TypePointer ShaderRecordBufferKHR 38(block) + 40: 39(ptr) Variable ShaderRecordBufferKHR + 41: TypeInt 32 1 + 42: 41(int) Constant 1 + 43: TypePointer ShaderRecordBufferKHR 37(fvec3) + 46: 36(float) Constant 1056964608 + 47: 41(int) Constant 0 + 50: 36(float) Constant 1061158912 + 51(accEXT1): 28(ptr) Variable UniformConstant + 52: TypeImage 6(int) 2D nonsampled format:R32ui + 53: TypePointer UniformConstant 52 + 54(imageu): 53(ptr) Variable UniformConstant + 55: TypeVector 36(float) 4 + 56: TypePointer RayPayloadKHR 55(fvec4) + 57(payload): 56(ptr) Variable RayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 8(lx): 7(ptr) Variable Function + 16(ly): 7(ptr) Variable Function + 20(sx): 7(ptr) Variable Function + 24(sy): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 12 + 15: 6(int) Load 14 + Store 8(lx) 15 + 18: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 17 + 19: 6(int) Load 18 + Store 16(ly) 19 + 22: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 12 + 23: 6(int) Load 22 + Store 20(sx) 23 + 25: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 17 + 26: 6(int) Load 25 + Store 24(sy) 26 + 30: 27 Load 29(accEXT0) + 31: 6(int) Load 8(lx) + 32: 6(int) Load 16(ly) + 33: 6(int) Load 20(sx) + 34: 6(int) Load 24(sy) + 44: 43(ptr) AccessChain 40 42 + 45: 37(fvec3) Load 44 + 48: 43(ptr) AccessChain 40 47 + 49: 37(fvec3) Load 48 + TraceRayKHR 30 31 32 33 34 35 45 46 49 50 42 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader11.rgen.out b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader11.rgen.out new file mode 100644 index 000000000..30ed902b1 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader11.rgen.out @@ -0,0 +1,91 @@ +spv.ext.RayGenShader11.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 53 + + Capability RayTracingProvisionalKHR + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" 11 21 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 8 "lx" + Name 11 "gl_LaunchIDEXT" + Name 16 "ly" + Name 20 "sx" + Name 21 "gl_LaunchSizeEXT" + Name 24 "sy" + Name 29 "accEXT" + Name 37 "block" + MemberName 37(block) 0 "dir" + MemberName 37(block) 1 "origin" + Name 39 "" + Name 52 "payload" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 29(accEXT) DescriptorSet 0 + Decorate 29(accEXT) Binding 0 + MemberDecorate 37(block) 0 Offset 0 + MemberDecorate 37(block) 1 Offset 16 + Decorate 37(block) BufferBlock + Decorate 52(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 1 +21(gl_LaunchSizeEXT): 10(ptr) Variable Input + 27: TypeAccelerationStructureKHR + 28: TypePointer UniformConstant 27 + 29(accEXT): 28(ptr) Variable UniformConstant + 35: TypeFloat 32 + 36: TypeVector 35(float) 3 + 37(block): TypeStruct 36(fvec3) 36(fvec3) + 38: TypePointer ShaderRecordBufferKHR 37(block) + 39: 38(ptr) Variable ShaderRecordBufferKHR + 40: TypeInt 32 1 + 41: 40(int) Constant 1 + 42: TypePointer ShaderRecordBufferKHR 36(fvec3) + 45: 35(float) Constant 1056964608 + 46: 40(int) Constant 0 + 49: 35(float) Constant 1061158912 + 50: TypeVector 35(float) 4 + 51: TypePointer RayPayloadKHR 50(fvec4) + 52(payload): 51(ptr) Variable RayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 8(lx): 7(ptr) Variable Function + 16(ly): 7(ptr) Variable Function + 20(sx): 7(ptr) Variable Function + 24(sy): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 12 + 15: 6(int) Load 14 + Store 8(lx) 15 + 18: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 17 + 19: 6(int) Load 18 + Store 16(ly) 19 + 22: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 12 + 23: 6(int) Load 22 + Store 20(sx) 23 + 25: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 17 + 26: 6(int) Load 25 + Store 24(sy) 26 + 30: 27 Load 29(accEXT) + 31: 6(int) Load 8(lx) + 32: 6(int) Load 16(ly) + 33: 6(int) Load 20(sx) + 34: 6(int) Load 24(sy) + 43: 42(ptr) AccessChain 39 41 + 44: 36(fvec3) Load 43 + 47: 42(ptr) AccessChain 39 46 + 48: 36(fvec3) Load 47 + TraceRayKHR 30 31 32 33 34 12 44 45 48 49 41 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out new file mode 100644 index 000000000..3962bcb8d --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out @@ -0,0 +1,141 @@ +spv.ext.RayGenShaderArray.rgen +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 89 + + Capability ShaderNonUniformEXT + Capability RuntimeDescriptorArrayEXT + Capability RayTracingProvisionalKHR + Extension "SPV_EXT_descriptor_indexing" + Extension "SPV_KHR_ray_tracing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" 11 21 + Source GLSL 460 + SourceExtension "GL_EXT_nonuniform_qualifier" + SourceExtension "GL_EXT_ray_tracing" + Name 4 "main" + Name 8 "lx" + Name 11 "gl_LaunchIDEXT" + Name 16 "ly" + Name 20 "sx" + Name 21 "gl_LaunchSizeEXT" + Name 24 "sy" + Name 30 "accEXT0" + Name 34 "block" + MemberName 34(block) 0 "dir" + MemberName 34(block) 1 "origin" + MemberName 34(block) 2 "i" + Name 36 "" + Name 60 "accEXT1" + Name 88 "payload" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 30(accEXT0) DescriptorSet 0 + Decorate 30(accEXT0) Binding 0 + MemberDecorate 34(block) 0 Offset 0 + MemberDecorate 34(block) 1 Offset 16 + MemberDecorate 34(block) 2 Offset 28 + Decorate 34(block) BufferBlock + Decorate 60(accEXT1) DescriptorSet 0 + Decorate 60(accEXT1) Binding 1 + Decorate 75 DecorationNonUniformEXT + Decorate 76 DecorationNonUniformEXT + Decorate 77 DecorationNonUniformEXT + Decorate 88(payload) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 1 +21(gl_LaunchSizeEXT): 10(ptr) Variable Input + 27: TypeAccelerationStructureKHR + 28: TypeRuntimeArray 27 + 29: TypePointer UniformConstant 28 + 30(accEXT0): 29(ptr) Variable UniformConstant + 31: TypeFloat 32 + 32: TypeVector 31(float) 3 + 33: TypeInt 32 1 + 34(block): TypeStruct 32(fvec3) 32(fvec3) 33(int) + 35: TypePointer ShaderRecordBufferKHR 34(block) + 36: 35(ptr) Variable ShaderRecordBufferKHR + 37: 33(int) Constant 2 + 38: TypePointer ShaderRecordBufferKHR 33(int) + 41: TypePointer UniformConstant 27 + 48: 33(int) Constant 1 + 49: TypePointer ShaderRecordBufferKHR 32(fvec3) + 52: 31(float) Constant 1056964608 + 53: 33(int) Constant 0 + 56: 31(float) Constant 1061158912 + 57: 6(int) Constant 2 + 58: TypeArray 27 57 + 59: TypePointer UniformConstant 58 + 60(accEXT1): 59(ptr) Variable UniformConstant + 86: TypeVector 31(float) 4 + 87: TypePointer RayPayloadKHR 86(fvec4) + 88(payload): 87(ptr) Variable RayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 8(lx): 7(ptr) Variable Function + 16(ly): 7(ptr) Variable Function + 20(sx): 7(ptr) Variable Function + 24(sy): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 12 + 15: 6(int) Load 14 + Store 8(lx) 15 + 18: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 17 + 19: 6(int) Load 18 + Store 16(ly) 19 + 22: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 12 + 23: 6(int) Load 22 + Store 20(sx) 23 + 25: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 17 + 26: 6(int) Load 25 + Store 24(sy) 26 + 39: 38(ptr) AccessChain 36 37 + 40: 33(int) Load 39 + 42: 41(ptr) AccessChain 30(accEXT0) 40 + 43: 27 Load 42 + 44: 6(int) Load 8(lx) + 45: 6(int) Load 16(ly) + 46: 6(int) Load 20(sx) + 47: 6(int) Load 24(sy) + 50: 49(ptr) AccessChain 36 48 + 51: 32(fvec3) Load 50 + 54: 49(ptr) AccessChain 36 53 + 55: 32(fvec3) Load 54 + TraceRayKHR 43 44 45 46 47 12 51 52 55 56 48 + 61: 38(ptr) AccessChain 36 37 + 62: 33(int) Load 61 + 63: 41(ptr) AccessChain 60(accEXT1) 62 + 64: 27 Load 63 + 65: 6(int) Load 8(lx) + 66: 6(int) Load 16(ly) + 67: 6(int) Load 20(sx) + 68: 6(int) Load 24(sy) + 69: 49(ptr) AccessChain 36 48 + 70: 32(fvec3) Load 69 + 71: 49(ptr) AccessChain 36 53 + 72: 32(fvec3) Load 71 + TraceRayKHR 64 65 66 67 68 12 70 52 72 56 48 + 73: 38(ptr) AccessChain 36 37 + 74: 33(int) Load 73 + 75: 33(int) CopyObject 74 + 76: 41(ptr) AccessChain 30(accEXT0) 75 + 77: 27 Load 76 + 78: 6(int) Load 8(lx) + 79: 6(int) Load 16(ly) + 80: 6(int) Load 20(sx) + 81: 6(int) Load 24(sy) + 82: 49(ptr) AccessChain 36 48 + 83: 32(fvec3) Load 82 + 84: 49(ptr) AccessChain 36 53 + 85: 32(fvec3) Load 84 + TraceRayKHR 77 78 79 80 81 12 83 52 85 56 48 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader_Errors.rgen.out b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader_Errors.rgen.out new file mode 100644 index 000000000..6dc7480b5 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.ext.RayGenShader_Errors.rgen.out @@ -0,0 +1,40 @@ +spv.ext.RayGenShader_Errors.rgen +ERROR: 0:3: 'hitAttributeEXT' : not supported in this stage: ray-generation +ERROR: 0:4: 'rayPayloadInEXT' : not supported in this stage: ray-generation +ERROR: 0:5: 'shaderRecordNV' : can only be used with a buffer +ERROR: 0:9: 'binding' : cannot be used with shaderRecordNV +ERROR: 0:12: 'set' : cannot be used with shaderRecordNV +ERROR: 0:23: 'accelerationStructureNV' : accelerationStructureNV can only be used in uniform variables or function parameters: a +ERROR: 0:23: '=' : cannot convert from ' const int' to ' temp accelerationStructureNV' +ERROR: 0:24: 'gl_PrimitiveID' : undeclared identifier +ERROR: 0:24: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:25: 'gl_InstanceID' : undeclared identifier (Did you mean gl_InstanceIndex?) +ERROR: 0:25: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:26: 'gl_InstanceCustomIndexEXT' : undeclared identifier +ERROR: 0:26: '=' : cannot convert from ' temp float' to ' temp highp int' +ERROR: 0:27: 'gl_WorldRayOriginEXT' : undeclared identifier +ERROR: 0:27: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:28: 'gl_WorldRayDirectionEXT' : undeclared identifier +ERROR: 0:28: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:29: 'gl_ObjectRayOriginEXT' : undeclared identifier +ERROR: 0:29: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:30: 'gl_ObjectRayDirectionEXT' : undeclared identifier +ERROR: 0:30: '=' : cannot convert from ' temp float' to ' temp highp 3-component vector of float' +ERROR: 0:31: 'gl_RayTminEXT' : undeclared identifier +ERROR: 0:32: 'gl_RayTmaxEXT' : undeclared identifier +ERROR: 0:33: 'gl_ObjectToWorldEXT' : undeclared identifier +ERROR: 0:33: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:34: 'gl_WorldToObjectEXT' : undeclared identifier +ERROR: 0:34: '=' : cannot convert from ' temp float' to ' temp highp 4X3 matrix of float' +ERROR: 0:35: 'gl_HitTEXT' : undeclared identifier +ERROR: 0:36: 'gl_HitKindEXT' : undeclared identifier +ERROR: 0:37: 'reportIntersectionEXT' : no matching overloaded function found +ERROR: 0:38: 'ignoreIntersectionEXT' : no matching overloaded function found +ERROR: 0:39: 'terminateRayEXT' : no matching overloaded function found +ERROR: 0:40: 'assign' : l-value required "anon@3" (can't modify a shaderrecordnv qualified buffer) +ERROR: 33 compilation errors. No code generated. + + +ERROR: Linking ray-generation stage: Only one shaderRecordNV buffer block is allowed per stage + +SPIR-V is not generated for failed compile or link diff --git a/core/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out b/core/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out index 526d73924..ec16d9069 100644 --- a/core/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out +++ b/core/deps/glslang/Test/baseResults/spv.imageLoadStoreLod.frag.out @@ -1,5 +1,4 @@ spv.imageLoadStoreLod.frag -Validation failed // Module Version 10000 // Generated by (magic number): 80008 // Id's are bound by 82 diff --git a/core/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out b/core/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out index 29675915c..b8721f234 100644 --- a/core/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out +++ b/core/deps/glslang/Test/baseResults/spv.memoryScopeSemantics.comp.out @@ -1,11 +1,12 @@ spv.memoryScopeSemantics.comp // Module Version 10300 // Generated by (magic number): 80008 -// Id's are bound by 163 +// Id's are bound by 169 Capability Shader Capability Int64 Capability Int64Atomics + Capability StorageImageMultisample Capability VulkanMemoryModelKHR Capability VulkanMemoryModelDeviceScopeKHR Extension "SPV_KHR_vulkan_memory_model" @@ -49,6 +50,7 @@ spv.memoryScopeSemantics.comp Name 151 "BufferM" MemberName 151(BufferM) 0 "x" Name 153 "bufferm" + Name 165 "imageMS" Decorate 36(imagei) DescriptorSet 0 Decorate 36(imagei) Binding 1 Decorate 46(imageu) DescriptorSet 0 @@ -83,6 +85,8 @@ spv.memoryScopeSemantics.comp Decorate 151(BufferM) Block Decorate 153(bufferm) DescriptorSet 0 Decorate 153(bufferm) Binding 9 + Decorate 165(imageMS) DescriptorSet 0 + Decorate 165(imageMS) Binding 10 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -174,6 +178,10 @@ spv.memoryScopeSemantics.comp 152: TypePointer StorageBuffer 151(BufferM) 153(bufferm): 152(ptr) Variable StorageBuffer 161: 6(int) Constant 32768 + 163: TypeImage 6(int) 2D multi-sampled nonsampled format:R32i + 164: TypePointer UniformConstant 163 + 165(imageMS): 164(ptr) Variable UniformConstant + 167: 6(int) Constant 4294967289 4(main): 2 Function None 3 5: Label 8(origi): 7(ptr) Variable Function @@ -271,5 +279,9 @@ spv.memoryScopeSemantics.comp 159: 15(int) AtomicIAdd 158 12 17 51 160: 69(ptr) AccessChain 68(bufferu) 38 162: 15(int) AtomicIAdd 160 12 42 16 + 166: 40(ptr) ImageTexelPointer 165(imageMS) 39 12 + AtomicStore 166 12 33 14 + 168: 40(ptr) ImageTexelPointer 36(imagei) 39 17 + AtomicStore 168 12 33 167 Return FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.nonuniform.frag.out b/core/deps/glslang/Test/baseResults/spv.nonuniform.frag.out index 32b64662a..6b7d4073b 100644 --- a/core/deps/glslang/Test/baseResults/spv.nonuniform.frag.out +++ b/core/deps/glslang/Test/baseResults/spv.nonuniform.frag.out @@ -59,16 +59,20 @@ spv.nonuniform.frag Name 203 "S" MemberName 203(S) 0 "a" Name 205 "s" + Decorate 9(nupi) DecorationNonUniformEXT Decorate 13 DecorationNonUniformEXT Decorate 17(nu_li) DecorationNonUniformEXT + Decorate 17(nu_li) DecorationNonUniformEXT Decorate 19 DecorationNonUniformEXT Decorate 24 DecorationNonUniformEXT Decorate 28 DecorationNonUniformEXT Decorate 29 DecorationNonUniformEXT Decorate 35(nu_inv4) Location 0 Decorate 35(nu_inv4) DecorationNonUniformEXT + Decorate 39 DecorationNonUniformEXT Decorate 40 DecorationNonUniformEXT Decorate 41(nu_gf) DecorationNonUniformEXT + Decorate 41(nu_gf) DecorationNonUniformEXT Decorate 42 DecorationNonUniformEXT Decorate 43 DecorationNonUniformEXT Decorate 47(inputAttachmentDyn) DescriptorSet 0 @@ -85,47 +89,71 @@ spv.nonuniform.frag Decorate 92(nu_ii) Flat Decorate 92(nu_ii) Location 1 Decorate 92(nu_ii) DecorationNonUniformEXT + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 93 DecorationNonUniformEXT + Decorate 95 DecorationNonUniformEXT Decorate 96 DecorationNonUniformEXT MemberDecorate 99(bname) 0 Offset 0 Decorate 99(bname) BufferBlock Decorate 102(storageBuffer) DescriptorSet 0 Decorate 102(storageBuffer) Binding 4 + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 103 DecorationNonUniformEXT + Decorate 104 DecorationNonUniformEXT Decorate 105 DecorationNonUniformEXT Decorate 112(sampledImage) DescriptorSet 0 Decorate 112(sampledImage) Binding 5 + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 113 DecorationNonUniformEXT + Decorate 115 DecorationNonUniformEXT Decorate 116 DecorationNonUniformEXT Decorate 127(storageImage) DescriptorSet 0 Decorate 127(storageImage) Binding 6 + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 128 DecorationNonUniformEXT + Decorate 130 DecorationNonUniformEXT Decorate 131 DecorationNonUniformEXT Decorate 139(inputAttachment) DescriptorSet 0 Decorate 139(inputAttachment) Binding 7 Decorate 139(inputAttachment) InputAttachmentIndex 1 + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 140 DecorationNonUniformEXT + Decorate 141 DecorationNonUniformEXT Decorate 142 DecorationNonUniformEXT Decorate 149(uniformTexelBuffer) DescriptorSet 0 Decorate 149(uniformTexelBuffer) Binding 8 + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 150 DecorationNonUniformEXT + Decorate 151 DecorationNonUniformEXT Decorate 152 DecorationNonUniformEXT Decorate 160(storageTexelBuffer) DescriptorSet 0 Decorate 160(storageTexelBuffer) Binding 9 + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 161 DecorationNonUniformEXT + Decorate 162 DecorationNonUniformEXT Decorate 163 DecorationNonUniformEXT Decorate 170(v) DecorationNonUniformEXT + Decorate 172 DecorationNonUniformEXT Decorate 173 DecorationNonUniformEXT + Decorate 174 DecorationNonUniformEXT Decorate 175 DecorationNonUniformEXT + Decorate 179 DecorationNonUniformEXT Decorate 180 DecorationNonUniformEXT + Decorate 181 DecorationNonUniformEXT Decorate 182 DecorationNonUniformEXT + Decorate 92(nu_ii) DecorationNonUniformEXT Decorate 186 DecorationNonUniformEXT + Decorate 187 DecorationNonUniformEXT Decorate 188 DecorationNonUniformEXT + Decorate 189 DecorationNonUniformEXT Decorate 190 DecorationNonUniformEXT Decorate 195(m) DecorationNonUniformEXT + Decorate 196 DecorationNonUniformEXT Decorate 197 DecorationNonUniformEXT Decorate 205(s) DecorationNonUniformEXT + Decorate 206 DecorationNonUniformEXT Decorate 207 DecorationNonUniformEXT + Decorate 208 DecorationNonUniformEXT Decorate 209 DecorationNonUniformEXT 2: TypeVoid 3: TypeFunction 2 diff --git a/core/deps/glslang/Test/baseResults/spv.nonuniform2.frag.out b/core/deps/glslang/Test/baseResults/spv.nonuniform2.frag.out index db24f4177..759f4c4ea 100644 --- a/core/deps/glslang/Test/baseResults/spv.nonuniform2.frag.out +++ b/core/deps/glslang/Test/baseResults/spv.nonuniform2.frag.out @@ -25,6 +25,7 @@ spv.nonuniform2.frag Decorate 16(rIndex) Flat Decorate 16(rIndex) Location 3 Decorate 18 DecorationNonUniformEXT + Decorate 20 DecorationNonUniformEXT Decorate 21 DecorationNonUniformEXT 2: TypeVoid 3: TypeFunction 2 diff --git a/core/deps/glslang/Test/baseResults/spv.nonuniform3.frag.out b/core/deps/glslang/Test/baseResults/spv.nonuniform3.frag.out new file mode 100644 index 000000000..93142619c --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.nonuniform3.frag.out @@ -0,0 +1,61 @@ +spv.nonuniform3.frag +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 32 + + Capability Shader + Capability ShaderNonUniformEXT + Capability RuntimeDescriptorArrayEXT + Extension "SPV_EXT_descriptor_indexing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 16 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_nonuniform_qualifier" + Name 4 "main" + Name 9 "FragColor" + Name 13 "uTex" + Name 16 "Index" + Name 23 "uSamp" + Decorate 9(FragColor) Location 0 + Decorate 13(uTex) DescriptorSet 0 + Decorate 13(uTex) Binding 0 + Decorate 16(Index) Flat + Decorate 16(Index) Location 0 + Decorate 23(uSamp) DescriptorSet 1 + Decorate 23(uSamp) Binding 0 + Decorate 27 DecorationNonUniformEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(FragColor): 8(ptr) Variable Output + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeRuntimeArray 10 + 12: TypePointer UniformConstant 11 + 13(uTex): 12(ptr) Variable UniformConstant + 14: TypeInt 32 1 + 15: TypePointer Input 14(int) + 16(Index): 15(ptr) Variable Input + 18: TypePointer UniformConstant 10 + 21: TypeSampler + 22: TypePointer UniformConstant 21 + 23(uSamp): 22(ptr) Variable UniformConstant + 25: TypeSampledImage 10 + 28: TypeVector 6(float) 2 + 29: 6(float) Constant 1056964608 + 30: 28(fvec2) ConstantComposite 29 29 + 4(main): 2 Function None 3 + 5: Label + 17: 14(int) Load 16(Index) + 19: 18(ptr) AccessChain 13(uTex) 17 + 20: 10 Load 19 + 24: 21 Load 23(uSamp) + 26: 25 SampledImage 20 24 + 27: 25 CopyObject 26 + 31: 7(fvec4) ImageSampleImplicitLod 27 30 + Store 9(FragColor) 31 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.nonuniform4.frag.out b/core/deps/glslang/Test/baseResults/spv.nonuniform4.frag.out new file mode 100644 index 000000000..a9dd52080 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.nonuniform4.frag.out @@ -0,0 +1,50 @@ +spv.nonuniform4.frag +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 24 + + Capability Shader + Capability ImageBuffer + Capability ShaderNonUniformEXT + Capability RuntimeDescriptorArrayEXT + Capability StorageTexelBufferArrayNonUniformIndexingEXT + Extension "SPV_EXT_descriptor_indexing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 13 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_nonuniform_qualifier" + Name 4 "main" + Name 10 "data" + Name 13 "rIndex" + Decorate 10(data) DescriptorSet 0 + Decorate 10(data) Binding 4 + Decorate 13(rIndex) Flat + Decorate 13(rIndex) Location 3 + Decorate 15 DecorationNonUniformEXT + Decorate 21 DecorationNonUniformEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypeImage 6(int) Buffer nonsampled format:R32ui + 8: TypeRuntimeArray 7 + 9: TypePointer UniformConstant 8 + 10(data): 9(ptr) Variable UniformConstant + 11: TypeInt 32 1 + 12: TypePointer Input 11(int) + 13(rIndex): 12(ptr) Variable Input + 16: TypePointer UniformConstant 7 + 18: 11(int) Constant 0 + 19: 6(int) Constant 0 + 20: TypePointer Image 6(int) + 22: 6(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 14: 11(int) Load 13(rIndex) + 15: 11(int) CopyObject 14 + 17: 16(ptr) AccessChain 10(data) 15 + 21: 20(ptr) ImageTexelPointer 17 18 19 + 23: 6(int) AtomicIAdd 21 22 19 19 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.nonuniform5.frag.out b/core/deps/glslang/Test/baseResults/spv.nonuniform5.frag.out new file mode 100644 index 000000000..8ce131a84 --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.nonuniform5.frag.out @@ -0,0 +1,56 @@ +spv.nonuniform5.frag +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 23 + + Capability Shader + Capability ShaderNonUniformEXT + Capability RuntimeDescriptorArrayEXT + Capability UniformBufferArrayNonUniformIndexingEXT + Extension "SPV_EXT_descriptor_indexing" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 16 + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_EXT_nonuniform_qualifier" + Name 4 "main" + Name 9 "FragColor" + Name 10 "UBO" + MemberName 10(UBO) 0 "v" + Name 13 "ubos" + Name 16 "Index" + Decorate 9(FragColor) Location 0 + MemberDecorate 10(UBO) 0 Offset 0 + Decorate 10(UBO) Block + Decorate 13(ubos) DescriptorSet 0 + Decorate 13(ubos) Binding 0 + Decorate 16(Index) Flat + Decorate 16(Index) Location 0 + Decorate 18 DecorationNonUniformEXT + Decorate 21 DecorationNonUniformEXT + Decorate 22 DecorationNonUniformEXT + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(FragColor): 8(ptr) Variable Output + 10(UBO): TypeStruct 7(fvec4) + 11: TypeRuntimeArray 10(UBO) + 12: TypePointer Uniform 11 + 13(ubos): 12(ptr) Variable Uniform + 14: TypeInt 32 1 + 15: TypePointer Input 14(int) + 16(Index): 15(ptr) Variable Input + 19: 14(int) Constant 0 + 20: TypePointer Uniform 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 17: 14(int) Load 16(Index) + 18: 14(int) CopyObject 17 + 21: 20(ptr) AccessChain 13(ubos) 18 19 + 22: 7(fvec4) Load 21 + Store 9(FragColor) 22 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/spv.specConstant.vert.out b/core/deps/glslang/Test/baseResults/spv.specConstant.vert.out index 3b04e7cc0..77317ae66 100644 --- a/core/deps/glslang/Test/baseResults/spv.specConstant.vert.out +++ b/core/deps/glslang/Test/baseResults/spv.specConstant.vert.out @@ -11,7 +11,7 @@ spv.specConstant.vert Source GLSL 400 Name 4 "main" Name 9 "arraySize" - Name 14 "foo(vf4[s4529];" + Name 14 "foo(vf4[s4530];" Name 13 "p" Name 17 "builtin_spec_constant(" Name 20 "color" @@ -102,10 +102,10 @@ spv.specConstant.vert Store 20(color) 46 48: 10 Load 22(ucol) Store 47(param) 48 - 49: 2 FunctionCall 14(foo(vf4[s4529];) 47(param) + 49: 2 FunctionCall 14(foo(vf4[s4530];) 47(param) Return FunctionEnd -14(foo(vf4[s4529];): 2 Function None 12 +14(foo(vf4[s4530];): 2 Function None 12 13(p): 11(ptr) FunctionParameter 15: Label 54: 24(ptr) AccessChain 53(dupUcol) 23 diff --git a/core/deps/glslang/Test/baseResults/spv.specTexture.frag.out b/core/deps/glslang/Test/baseResults/spv.specTexture.frag.out new file mode 100755 index 000000000..a4cf47d1d --- /dev/null +++ b/core/deps/glslang/Test/baseResults/spv.specTexture.frag.out @@ -0,0 +1,43 @@ +spv.specTexture.frag +// Module Version 10000 +// Generated by (magic number): 80008 +// Id's are bound by 23 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 + ExecutionMode 4 OriginLowerLeft + Source GLSL 450 + Name 4 "main" + Name 9 "color_out" + Name 13 "tex" + Name 19 "offs" + Decorate 9(color_out) Location 0 + Decorate 13(tex) DescriptorSet 0 + Decorate 13(tex) Binding 0 + Decorate 19(offs) SpecId 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color_out): 8(ptr) Variable Output + 10: TypeImage 6(float) 2D sampled format:Unknown + 11: TypeSampledImage 10 + 12: TypePointer UniformConstant 11 + 13(tex): 12(ptr) Variable UniformConstant + 15: TypeVector 6(float) 2 + 16: 6(float) Constant 0 + 17: 15(fvec2) ConstantComposite 16 16 + 18: TypeInt 32 1 + 19(offs): 18(int) SpecConstant 0 + 20: TypeVector 18(int) 2 + 21: 20(ivec2) SpecConstantComposite 19(offs) 19(offs) + 4(main): 2 Function None 3 + 5: Label + 14: 11 Load 13(tex) + 22: 7(fvec4) ImageSampleExplicitLod 14 17 Lod ConstOffset 16 21 + Store 9(color_out) 22 + Return + FunctionEnd diff --git a/core/deps/glslang/Test/baseResults/vulkan.frag.out b/core/deps/glslang/Test/baseResults/vulkan.frag.out index c81ed25a6..e62089802 100644 --- a/core/deps/glslang/Test/baseResults/vulkan.frag.out +++ b/core/deps/glslang/Test/baseResults/vulkan.frag.out @@ -7,14 +7,14 @@ ERROR: 0:8: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:9: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:10: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:14: 'sampler2D' : sampler-constructor requires two arguments -ERROR: 0:15: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type -ERROR: 0:16: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type -ERROR: 0:17: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' -ERROR: 0:18: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' -ERROR: 0:19: 'sampler2D' : sampler-constructor second argument must be a scalar type 'sampler' +ERROR: 0:15: 'sampler2D' : sampler-constructor first argument must be a scalar *texture* type +ERROR: 0:16: 'sampler2D' : sampler-constructor first argument must be a scalar *texture* type +ERROR: 0:17: 'sampler2D' : sampler-constructor second argument must be a scalar sampler or samplerShadow +ERROR: 0:18: 'sampler2D' : sampler-constructor second argument must be a scalar sampler or samplerShadow +ERROR: 0:19: 'sampler2D' : sampler-constructor second argument must be a scalar sampler or samplerShadow ERROR: 0:21: 'sampler3D' : sampler-constructor cannot make an array of samplers -ERROR: 0:22: 'sampler2D' : sampler-constructor first argument must be a scalar textureXXX type -ERROR: 0:23: 'sampler2D' : sampler-constructor first argument must match type and dimensionality of constructor type +ERROR: 0:22: 'sampler2D' : sampler-constructor first argument must be a scalar *texture* type +ERROR: 0:23: 'sampler2D' : sampler-constructor first argument must be a *texture* type matching the dimensionality and sampled type of the constructor ERROR: 0:28: 'sampler2D' : sampler/image types can only be used in uniform variables or function parameters: s2D ERROR: 0:29: 'sampler3D' : sampler-constructor cannot make an array of samplers ERROR: 0:29: 'sampler3D' : sampler/image types can only be used in uniform variables or function parameters: s3d diff --git a/core/deps/glslang/Test/compoundsuffix.frag.hlsl b/core/deps/glslang/Test/compoundsuffix.frag.hlsl index 87e0724e0..59322acda 100644 --- a/core/deps/glslang/Test/compoundsuffix.frag.hlsl +++ b/core/deps/glslang/Test/compoundsuffix.frag.hlsl @@ -1,6 +1,6 @@ -void main(out float4 fragColor : SV_TARGET0) -{ - fragColor = 1; -} - - +void main(out float4 fragColor : SV_TARGET0) +{ + fragColor = 1; +} + + diff --git a/core/deps/glslang/Test/compoundsuffix.vert.glsl b/core/deps/glslang/Test/compoundsuffix.vert.glsl index 4da53b77e..26862fff1 100644 --- a/core/deps/glslang/Test/compoundsuffix.vert.glsl +++ b/core/deps/glslang/Test/compoundsuffix.vert.glsl @@ -1,4 +1,4 @@ -void main() -{ - gl_Position = vec4(1.0); +void main() +{ + gl_Position = vec4(1.0); } \ No newline at end of file diff --git a/core/deps/glslang/Test/conditionalDiscard.frag b/core/deps/glslang/Test/conditionalDiscard.frag index ebc82fc61..58e6fa5d5 100644 --- a/core/deps/glslang/Test/conditionalDiscard.frag +++ b/core/deps/glslang/Test/conditionalDiscard.frag @@ -1,14 +1,14 @@ -#version 110 - -uniform sampler2D tex; -varying vec2 coord; - -void main (void) -{ - vec4 v = texture2D(tex, coord); - - if (v == vec4(0.1,0.2,0.3,0.4)) - discard; - - gl_FragColor = v; -} +#version 110 + +uniform sampler2D tex; +varying vec2 coord; + +void main (void) +{ + vec4 v = texture2D(tex, coord); + + if (v == vec4(0.1,0.2,0.3,0.4)) + discard; + + gl_FragColor = v; +} diff --git a/core/deps/glslang/Test/constFold.frag b/core/deps/glslang/Test/constFold.frag index 0a54ec085..49373e6c9 100644 --- a/core/deps/glslang/Test/constFold.frag +++ b/core/deps/glslang/Test/constFold.frag @@ -120,29 +120,32 @@ void foo2() f = vec4(inv.x < 2.4 ? -1.0 : 1.0).a; // not folded, ensuring no propagation } -const mat2 mm2 = mat2(1.0, 2.0, 3.0, 4.0); -const mat3x2 mm32 = mat3x2(10.0, 11.0, 12.0, 13.0, 14.0, 15.0); - -void foo3() -{ - mat3x2 r32 = mm2 * mm32; -} - -struct cag { - int i; - float f; - bool b; -}; -const cag a0[3] = cag[3](cag(3, 2.0, true), cag(1, 5.0, true), cag(1, 9.0, false)); - -void foo4() -{ - int a = int(a0[2].f); -} - -const bool cval1 = all(bvec4(true, true, true, true)); -const bool cval2 = all(bvec4(false, false, false, false)); -const bool cval3 = all(bvec4(true, true, false, true)); -const bool cval4 = any(bvec4(true, true, true, true)); -const bool cval5 = any(bvec4(false, false, false, false)); -const bool cval6 = any(bvec4(false, true, false, false)); +const mat2 mm2 = mat2(1.0, 2.0, 3.0, 4.0); +const mat3x2 mm32 = mat3x2(10.0, 11.0, 12.0, 13.0, 14.0, 15.0); +const mat2 m22 = mat2(vec4(1.0, 2.0, 3.0, 4.0)); +const mat3x4 mm34 = mat3x4(7.0); +const vec4 mv4 = vec4(m22); + +void foo3() +{ + mat3x2 r32 = mm2 * mm32; +} + +struct cag { + int i; + float f; + bool b; +}; +const cag a0[3] = cag[3](cag(3, 2.0, true), cag(1, 5.0, true), cag(1, 9.0, false)); + +void foo4() +{ + int a = int(a0[2].f); +} + +const bool cval1 = all(bvec4(true, true, true, true)); +const bool cval2 = all(bvec4(false, false, false, false)); +const bool cval3 = all(bvec4(true, true, false, true)); +const bool cval4 = any(bvec4(true, true, true, true)); +const bool cval5 = any(bvec4(false, false, false, false)); +const bool cval6 = any(bvec4(false, true, false, false)); diff --git a/core/deps/glslang/Test/constantUnaryConversion.comp b/core/deps/glslang/Test/constantUnaryConversion.comp index c1c364ea8..3c479ae67 100644 --- a/core/deps/glslang/Test/constantUnaryConversion.comp +++ b/core/deps/glslang/Test/constantUnaryConversion.comp @@ -1,48 +1,48 @@ -#version 450 - -#extension GL_EXT_shader_explicit_arithmetic_types : require - -const bool bool_init = true; -const int8_t int8_t_init = int8_t(-1); -const int16_t int16_t_init = int16_t(-2); -const int32_t int32_t_init = int32_t(-3); -const int64_t int64_t_init = int64_t(-4); -const uint8_t uint8_t_init = uint8_t(1); -const uint16_t uint16_t_init = uint16_t(2); -const uint32_t uint32_t_init = uint32_t(3); -const uint64_t uint64_t_init = uint64_t(4); -const float16_t float16_t_init = float16_t(42.0); -const float32_t float32_t_init = float32_t(13.0); -const float64_t float64_t_init = float64_t(-4.0); - -#define TYPE_TO_TYPE(x, y) \ - const x y##_to_##x = x(y##_init) - -#define TYPE_TO(x) \ - TYPE_TO_TYPE(x, bool); \ - TYPE_TO_TYPE(x, int8_t); \ - TYPE_TO_TYPE(x, int16_t); \ - TYPE_TO_TYPE(x, int32_t); \ - TYPE_TO_TYPE(x, int64_t); \ - TYPE_TO_TYPE(x, uint8_t); \ - TYPE_TO_TYPE(x, uint16_t); \ - TYPE_TO_TYPE(x, uint32_t); \ - TYPE_TO_TYPE(x, uint64_t); \ - TYPE_TO_TYPE(x, float16_t); \ - TYPE_TO_TYPE(x, float32_t); \ - TYPE_TO_TYPE(x, float64_t) - -TYPE_TO(bool); -TYPE_TO(int8_t); -TYPE_TO(int16_t); -TYPE_TO(int32_t); -TYPE_TO(int64_t); -TYPE_TO(uint8_t); -TYPE_TO(uint16_t); -TYPE_TO(uint32_t); -TYPE_TO(uint64_t); -TYPE_TO(float16_t); -TYPE_TO(float32_t); -TYPE_TO(float64_t); - -void main() {} +#version 450 + +#extension GL_EXT_shader_explicit_arithmetic_types : require + +const bool bool_init = true; +const int8_t int8_t_init = int8_t(-1); +const int16_t int16_t_init = int16_t(-2); +const int32_t int32_t_init = int32_t(-3); +const int64_t int64_t_init = int64_t(-4); +const uint8_t uint8_t_init = uint8_t(1); +const uint16_t uint16_t_init = uint16_t(2); +const uint32_t uint32_t_init = uint32_t(3); +const uint64_t uint64_t_init = uint64_t(4); +const float16_t float16_t_init = float16_t(42.0); +const float32_t float32_t_init = float32_t(13.0); +const float64_t float64_t_init = float64_t(-4.0); + +#define TYPE_TO_TYPE(x, y) \ + const x y##_to_##x = x(y##_init) + +#define TYPE_TO(x) \ + TYPE_TO_TYPE(x, bool); \ + TYPE_TO_TYPE(x, int8_t); \ + TYPE_TO_TYPE(x, int16_t); \ + TYPE_TO_TYPE(x, int32_t); \ + TYPE_TO_TYPE(x, int64_t); \ + TYPE_TO_TYPE(x, uint8_t); \ + TYPE_TO_TYPE(x, uint16_t); \ + TYPE_TO_TYPE(x, uint32_t); \ + TYPE_TO_TYPE(x, uint64_t); \ + TYPE_TO_TYPE(x, float16_t); \ + TYPE_TO_TYPE(x, float32_t); \ + TYPE_TO_TYPE(x, float64_t) + +TYPE_TO(bool); +TYPE_TO(int8_t); +TYPE_TO(int16_t); +TYPE_TO(int32_t); +TYPE_TO(int64_t); +TYPE_TO(uint8_t); +TYPE_TO(uint16_t); +TYPE_TO(uint32_t); +TYPE_TO(uint64_t); +TYPE_TO(float16_t); +TYPE_TO(float32_t); +TYPE_TO(float64_t); + +void main() {} diff --git a/core/deps/glslang/Test/conversion.frag b/core/deps/glslang/Test/conversion.frag index 3931f5a29..f17293b89 100644 --- a/core/deps/glslang/Test/conversion.frag +++ b/core/deps/glslang/Test/conversion.frag @@ -1,112 +1,112 @@ -#version 130 - -uniform bool u_b; -uniform bvec2 u_b2; -uniform bvec3 u_b3; -uniform bvec4 u_b4; - -uniform int u_i; -uniform ivec2 u_i2; -uniform ivec3 u_i3; -uniform ivec4 u_i4; - -uniform float u_f; -uniform vec2 u_f2; -uniform vec3 u_f3; -uniform vec4 u_f4; - -uniform bool i_b; -uniform bvec2 i_b2; -uniform bvec3 i_b3; -uniform bvec4 i_b4; - -flat in int i_i; -flat in ivec2 i_i2; -flat in ivec3 i_i3; -flat in ivec4 i_i4; - -in float i_f; -in vec2 i_f2; -in vec3 i_f3; -in vec4 i_f4; - -void main() -{ - bool b = bool(u_i) ^^ bool(u_f); - bvec2 b2 = bvec2(u_i, u_f); - bvec3 b3 = bvec3(u_i, u_f, i_i); - bvec4 b4 = bvec4(u_i, u_f, i_i, i_f); - - int i = int(u_f) + int(b); - ivec2 i2 = ivec2(u_f2) + ivec2(b2); - ivec3 i3 = ivec3(u_f3) + ivec3(b3); - ivec4 i4 = ivec4(u_f4) + ivec4(b4); - - float f = i; - vec2 f2 = i2; - vec3 f3 = i3; - vec4 f4 = i4; - - f += (float(i) + float(b)); - f2 -= vec2(i2) + vec2(b2); - f3 /= vec3(i3) + vec3(b3); - f4 += vec4(i4) + vec4(b4); - - f4 += vec4(bvec4(i_i4)); - f4 += vec4(bvec4(u_f4)); - - f += f - i; - f2 += vec2(f, i) + i2; - f3 += i3 + vec3(f, i, f); - f4 += vec4(b, i, f, i) + i4; - - f2 += vec2(f, i) * i; - f3 += vec3(f, i, f) + i; - f4 += i - vec4(b, i, f, i); - - i2 += ivec2(f, i); - i3 += ivec3(f, i, f); - i4 += ivec4(b, i, f, i); - - if (f < i || i < f || - f2 == i2 || - i3 != f3) - f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y); - - gl_FragColor = - b || - b2.x || - b2.y || - b3.x || - b3.y || - b3.z || - b4.x || - b4.y || - b4.z || - b4.w ? vec4( - i + - i2.x + - i2.y + - i3.x + - i3.y + - i3.z + - i4.x + - i4.y + - i4.z + - i4.w + - f + - f2.x + - f2.y + - f3.x + - f3.y + - f3.z + - f4.x + - f4.y + - f4.z + - f4.w) : vec4(1.0); - - // with constants... - ivec4 cv2 = ivec4(1.0); - bvec4 cv5 = bvec4(cv2); - gl_FragColor += float(cv5); -} +#version 130 + +uniform bool u_b; +uniform bvec2 u_b2; +uniform bvec3 u_b3; +uniform bvec4 u_b4; + +uniform int u_i; +uniform ivec2 u_i2; +uniform ivec3 u_i3; +uniform ivec4 u_i4; + +uniform float u_f; +uniform vec2 u_f2; +uniform vec3 u_f3; +uniform vec4 u_f4; + +uniform bool i_b; +uniform bvec2 i_b2; +uniform bvec3 i_b3; +uniform bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = bool(u_i) ^^ bool(u_f); + bvec2 b2 = bvec2(u_i, u_f); + bvec3 b3 = bvec3(u_i, u_f, i_i); + bvec4 b4 = bvec4(u_i, u_f, i_i, i_f); + + int i = int(u_f) + int(b); + ivec2 i2 = ivec2(u_f2) + ivec2(b2); + ivec3 i3 = ivec3(u_f3) + ivec3(b3); + ivec4 i4 = ivec4(u_f4) + ivec4(b4); + + float f = i; + vec2 f2 = i2; + vec3 f3 = i3; + vec4 f4 = i4; + + f += (float(i) + float(b)); + f2 -= vec2(i2) + vec2(b2); + f3 /= vec3(i3) + vec3(b3); + f4 += vec4(i4) + vec4(b4); + + f4 += vec4(bvec4(i_i4)); + f4 += vec4(bvec4(u_f4)); + + f += f - i; + f2 += vec2(f, i) + i2; + f3 += i3 + vec3(f, i, f); + f4 += vec4(b, i, f, i) + i4; + + f2 += vec2(f, i) * i; + f3 += vec3(f, i, f) + i; + f4 += i - vec4(b, i, f, i); + + i2 += ivec2(f, i); + i3 += ivec3(f, i, f); + i4 += ivec4(b, i, f, i); + + if (f < i || i < f || + f2 == i2 || + i3 != f3) + f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y); + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); + + // with constants... + ivec4 cv2 = ivec4(1.0); + bvec4 cv5 = bvec4(cv2); + gl_FragColor += float(cv5); +} diff --git a/core/deps/glslang/Test/cppBad.vert b/core/deps/glslang/Test/cppBad.vert index d4da01253..c1548c834 100644 --- a/core/deps/glslang/Test/cppBad.vert +++ b/core/deps/glslang/Test/cppBad.vert @@ -1,6 +1,6 @@ -#define n#0# -#define m #0# -#if m -#endif -#define n() +#define n#0# +#define m #0# +#if m +#endif +#define n() int n" \ No newline at end of file diff --git a/core/deps/glslang/Test/cppBad2.vert b/core/deps/glslang/Test/cppBad2.vert index 9f8a4f345..5e61b49ef 100644 --- a/core/deps/glslang/Test/cppBad2.vert +++ b/core/deps/glslang/Test/cppBad2.vert @@ -1,3 +1,3 @@ -#define a b( -#define b(x) +#define a b( +#define b(x) b(a) \ No newline at end of file diff --git a/core/deps/glslang/Test/cppDeepNest.frag b/core/deps/glslang/Test/cppDeepNest.frag index edb0e7267..51c436e4f 100644 --- a/core/deps/glslang/Test/cppDeepNest.frag +++ b/core/deps/glslang/Test/cppDeepNest.frag @@ -1,117 +1,117 @@ -#ifdef O -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#if -#endif +#ifdef O +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#if +#endif diff --git a/core/deps/glslang/Test/cppRelaxSkipTokensErrors.vert b/core/deps/glslang/Test/cppRelaxSkipTokensErrors.vert index 892324019..b30af0c9f 100644 --- a/core/deps/glslang/Test/cppRelaxSkipTokensErrors.vert +++ b/core/deps/glslang/Test/cppRelaxSkipTokensErrors.vert @@ -1,14 +1,14 @@ -#version 110 - -#if 0 -3.5L -3.5h -2034h -1.#INF -0x1234567812345L -12323394203923879234L -0123s; -123s; -0123456712345671234L -"string" -#endif +#version 110 + +#if 0 +3.5L +3.5h +2034h +1.#INF +0x1234567812345L +12323394203923879234L +0123s; +123s; +0123456712345671234L +"string" +#endif diff --git a/core/deps/glslang/Test/dataOut.frag b/core/deps/glslang/Test/dataOut.frag index 6aaa7cfbb..258f534ea 100644 --- a/core/deps/glslang/Test/dataOut.frag +++ b/core/deps/glslang/Test/dataOut.frag @@ -1,8 +1,8 @@ -#version 130 - -varying vec4 Color; - -void main() -{ - gl_FragData[1] = Color; -} +#version 130 + +varying vec4 Color; + +void main() +{ + gl_FragData[1] = Color; +} diff --git a/core/deps/glslang/Test/dataOutIndirect.frag b/core/deps/glslang/Test/dataOutIndirect.frag index 0dc3494a5..d6b8667d7 100644 --- a/core/deps/glslang/Test/dataOutIndirect.frag +++ b/core/deps/glslang/Test/dataOutIndirect.frag @@ -1,10 +1,10 @@ -#version 130 - -varying vec4 Color; - -uniform int i; - -void main() -{ - gl_FragData[i] = Color; -} +#version 130 + +varying vec4 Color; + +uniform int i; + +void main() +{ + gl_FragData[i] = Color; +} diff --git a/core/deps/glslang/Test/dce.frag b/core/deps/glslang/Test/dce.frag index df62fc571..119a98ddf 100644 --- a/core/deps/glslang/Test/dce.frag +++ b/core/deps/glslang/Test/dce.frag @@ -1,56 +1,56 @@ -#version 400 - -const bool flag = false; - -int c = 0; - -void bar() -{ - if (flag) - ++c; // should still show up in AST - else - ++c; - - flag ? ++c : ++c; // both should still show up in AST - - switch (c) { - case 1: - ++c; - break; - ++c; // should still show up in AST - case 2: - break; - ++c; // should still show up in AST - default: - break; - } - - for (int i = 0; i < 0; ++i) - ++c; // should still show up in AST - - for (int i = 0; i < 10; ++i) { - if (c < 3) { - break; - ++c; // should still show up in AST - } else { - continue; - ++c; // should still show up in AST - } - } - - return; - - ++c; // should still show up in AST -} - -int foo() // not called, but should still show up in AST -{ - if (c > 4) { - return 4; - ++c; // should still show up in AST - } - - return 5; - - ++c; // should still show up in AST -} +#version 400 + +const bool flag = false; + +int c = 0; + +void bar() +{ + if (flag) + ++c; // should still show up in AST + else + ++c; + + flag ? ++c : ++c; // both should still show up in AST + + switch (c) { + case 1: + ++c; + break; + ++c; // should still show up in AST + case 2: + break; + ++c; // should still show up in AST + default: + break; + } + + for (int i = 0; i < 0; ++i) + ++c; // should still show up in AST + + for (int i = 0; i < 10; ++i) { + if (c < 3) { + break; + ++c; // should still show up in AST + } else { + continue; + ++c; // should still show up in AST + } + } + + return; + + ++c; // should still show up in AST +} + +int foo() // not called, but should still show up in AST +{ + if (c > 4) { + return 4; + ++c; // should still show up in AST + } + + return 5; + + ++c; // should still show up in AST +} diff --git a/core/deps/glslang/Test/decls.frag b/core/deps/glslang/Test/decls.frag index 5d2683448..486e79632 100644 --- a/core/deps/glslang/Test/decls.frag +++ b/core/deps/glslang/Test/decls.frag @@ -1,49 +1,49 @@ -#version 120 - -int a; -int b, c; -int d1 = 1; -int e2 = 2, f; -int g, h3 = 3; - -int i4[4]; -int j, k5[5]; -int m6[6], m7[7]; -int n8[8], p; - -int ii4[4] = int[](1, 2, 3, 4); -int ij, ik5[5] = int[](5, 6, 7, 8, 9); -int im2[2] = int[](10, 11), im3[3] = int[](12, 13, 14); -int in8[4] = int[](21, 22, 23, 24), ip; - -void vi4[4] = int[](1, 2, 3, 4); -void vj, vk5[5] = int[](5, 6, 7, 8, 9); -void vm2[2] = int[](10, 11), vm3[3] = int[](12, 13, 14); -void vn8[4] = int[](21, 22, 23, 24), vp; - -const int cii4[4] = int[](1, 2, 3, 4); -const int cij, cik5[5] = int[](5, 6, 7, 8, 9); -const int cim2[2] = int[](10, 11), cim3[3] = int[](12, 13, 14); -const int cin8[4] = int[](21, 22, 23, 24), cip; - -uniform int uii4[4] = int[](1, 2, 3, 4); -uniform int uij, uik5[5] = int[](5, 6, 7, 8, 9); -uniform int uim2[2] = int[](10, 11), uim3[3] = int[](12, 13, 14); -uniform int uin8[4] = int[](21, 22, 23, 24), uip; - -int gl_vi4[4] = int[](1, 2, 3, 4); -int gl_vj, gl_vk5[5] = int[](5, 6, 7, 8, 9); -int gl_vm2[2] = int[](10, 11), gl_vm3[3] = int[](12, 13, 14); -int gl_vn8[4] = int[](21, 22, 23, 24), gl_vp; - -void main() -{ - while (bool cond = b < c); - while (int icond = b); - while (bool gl_cond = b < c); -} - -int foob__vi4[4] = int[](1, 2, 3, 4); -int foob__vj, foob__vk5[5] = int[](5, 6, 7, 8, 9); -int __foobvm2[2] = int[](10, 11), __foobvm3[3] = int[](12, 13, 14); -int foob__vn8[4] = int[](21, 22, 23, 24), foob__vp; +#version 120 + +int a; +int b, c; +int d1 = 1; +int e2 = 2, f; +int g, h3 = 3; + +int i4[4]; +int j, k5[5]; +int m6[6], m7[7]; +int n8[8], p; + +int ii4[4] = int[](1, 2, 3, 4); +int ij, ik5[5] = int[](5, 6, 7, 8, 9); +int im2[2] = int[](10, 11), im3[3] = int[](12, 13, 14); +int in8[4] = int[](21, 22, 23, 24), ip; + +void vi4[4] = int[](1, 2, 3, 4); +void vj, vk5[5] = int[](5, 6, 7, 8, 9); +void vm2[2] = int[](10, 11), vm3[3] = int[](12, 13, 14); +void vn8[4] = int[](21, 22, 23, 24), vp; + +const int cii4[4] = int[](1, 2, 3, 4); +const int cij, cik5[5] = int[](5, 6, 7, 8, 9); +const int cim2[2] = int[](10, 11), cim3[3] = int[](12, 13, 14); +const int cin8[4] = int[](21, 22, 23, 24), cip; + +uniform int uii4[4] = int[](1, 2, 3, 4); +uniform int uij, uik5[5] = int[](5, 6, 7, 8, 9); +uniform int uim2[2] = int[](10, 11), uim3[3] = int[](12, 13, 14); +uniform int uin8[4] = int[](21, 22, 23, 24), uip; + +int gl_vi4[4] = int[](1, 2, 3, 4); +int gl_vj, gl_vk5[5] = int[](5, 6, 7, 8, 9); +int gl_vm2[2] = int[](10, 11), gl_vm3[3] = int[](12, 13, 14); +int gl_vn8[4] = int[](21, 22, 23, 24), gl_vp; + +void main() +{ + while (bool cond = b < c); + while (int icond = b); + while (bool gl_cond = b < c); +} + +int foob__vi4[4] = int[](1, 2, 3, 4); +int foob__vj, foob__vk5[5] = int[](5, 6, 7, 8, 9); +int __foobvm2[2] = int[](10, 11), __foobvm3[3] = int[](12, 13, 14); +int foob__vn8[4] = int[](21, 22, 23, 24), foob__vp; diff --git a/core/deps/glslang/Test/deepRvalue.frag b/core/deps/glslang/Test/deepRvalue.frag index 71e9cdb3c..4d8808667 100644 --- a/core/deps/glslang/Test/deepRvalue.frag +++ b/core/deps/glslang/Test/deepRvalue.frag @@ -1,36 +1,36 @@ -#version 120 - -uniform sampler2D sampler; - -vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); -vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); -vec4 v3 = vec4(23.0, 29.0, 31.0, 37.0); -vec4 v4 = vec4(41.0, 43.0, 47.0, 53.0); - -struct str { - int a; - vec2 b[3]; - bool c; -}; - -void main() -{ - mat4 m = mat4(v1, v2, v3, v4); - - mat4 mm = matrixCompMult(m, m); - float f = mm[1].w; // should be 19 * 19 = 361 - - // do a deep access to a spontaneous r-value - float g = matrixCompMult(m, m)[2].y; // should be 29 * 29 = 841 - - float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 - - float i = texture2D(sampler, vec2(0.5,0.5)).y; - - i += (i > 0.1 ? v1 : v2)[3]; - - str t; - i += (t = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true)).b[2].y; // should be 7.0 - - gl_FragColor = vec4(f, g, h, i); -} +#version 120 + +uniform sampler2D sampler; + +vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); +vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); +vec4 v3 = vec4(23.0, 29.0, 31.0, 37.0); +vec4 v4 = vec4(41.0, 43.0, 47.0, 53.0); + +struct str { + int a; + vec2 b[3]; + bool c; +}; + +void main() +{ + mat4 m = mat4(v1, v2, v3, v4); + + mat4 mm = matrixCompMult(m, m); + float f = mm[1].w; // should be 19 * 19 = 361 + + // do a deep access to a spontaneous r-value + float g = matrixCompMult(m, m)[2].y; // should be 29 * 29 = 841 + + float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 + + float i = texture2D(sampler, vec2(0.5,0.5)).y; + + i += (i > 0.1 ? v1 : v2)[3]; + + str t; + i += (t = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true)).b[2].y; // should be 7.0 + + gl_FragColor = vec4(f, g, h, i); +} diff --git a/core/deps/glslang/Test/depthOut.frag b/core/deps/glslang/Test/depthOut.frag index 9b08962ee..5a8927101 100644 --- a/core/deps/glslang/Test/depthOut.frag +++ b/core/deps/glslang/Test/depthOut.frag @@ -1,10 +1,10 @@ -#version 130 - -varying vec4 Color; -varying float Depth; - -void main() -{ - gl_FragDepth = Depth; - gl_FragColor = Color; -} +#version 130 + +varying vec4 Color; +varying float Depth; + +void main() +{ + gl_FragDepth = Depth; + gl_FragColor = Color; +} diff --git a/core/deps/glslang/Test/discard-dce.frag b/core/deps/glslang/Test/discard-dce.frag index dbdcee679..f2fef4d11 100644 --- a/core/deps/glslang/Test/discard-dce.frag +++ b/core/deps/glslang/Test/discard-dce.frag @@ -1,35 +1,35 @@ -#version 110 -varying vec2 tex_coord; - -void main (void) -{ - vec4 white = vec4(1.0); - vec4 black = vec4(0.2); - vec4 color = white; - - // First, cut out our circle - float x = tex_coord.x*2.0 - 1.0; - float y = tex_coord.y*2.0 - 1.0; - - float radius = sqrt(x*x + y*y); - if (radius > 1.0) { - if (radius > 1.1) { - ++color; - } - - gl_FragColor = color; - - if (radius > 1.2) { - ++color; - } - - discard; - } - - // If we're near an edge, darken us a tiny bit - if (radius >= 0.75) - color -= abs(pow(radius, 16.0)/2.0); - - gl_FragColor = color; - -} +#version 110 +varying vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + discard; + } + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/core/deps/glslang/Test/doWhileLoop.frag b/core/deps/glslang/Test/doWhileLoop.frag index eaacaba21..3d6f93c51 100644 --- a/core/deps/glslang/Test/doWhileLoop.frag +++ b/core/deps/glslang/Test/doWhileLoop.frag @@ -1,16 +1,16 @@ -#version 110 - -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; - -void main() -{ - vec4 color = BaseColor; - - do { - color += bigColor; - } while (color.x < d); - - gl_FragColor = color; -} +#version 110 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void main() +{ + vec4 color = BaseColor; + + do { + color += bigColor; + } while (color.x < d); + + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/earlyReturnDiscard.frag b/core/deps/glslang/Test/earlyReturnDiscard.frag index ecd559465..718ea72f3 100644 --- a/core/deps/glslang/Test/earlyReturnDiscard.frag +++ b/core/deps/glslang/Test/earlyReturnDiscard.frag @@ -1,102 +1,102 @@ -#version 110 - -uniform float d; -uniform vec4 bigColor, smallColor; -uniform vec4 otherColor; - -varying float c; - -uniform float threshhold; -uniform float threshhold2; -uniform float threshhold3; - -uniform float minimum; - -varying vec4 BaseColor; - -uniform bool b; - -void main() -{ - vec4 color = BaseColor; - vec4 color2; - - color2 = otherColor; - - if (c > d) - color += bigColor; - else - color += smallColor; - - if (color.z < minimum) - return; - - color.z++; - - if (color.z > threshhold) - discard; - - color++; - - // Two path, different rest - if (color.w > threshhold2) { - if (color.z > threshhold2) - return; - else if (b) - color.z++; - else { - if (color.x < minimum) { - discard; - } else { - color++; - } - } - } else { - if (b) - discard; - else - return; - } - - - // // Two path, shared rest - // if (color.w > threshhold2) { - // if (color.z > threshhold2) - // return; - // else if (b) - // color++; - // else { - // if (color.x < minimum) { - // discard; - // } else { - // color++; - // } - // } - // } else { - // if (b) - // discard; - // else - // return; - // } - - - // // One path - // if (color.w > threshhold2) { - // if (color.z > threshhold2) - // return; - // else { - // if (color.x < minimum) { - // discard; - // } else { - // color++; - // } - // } - // } else { - // if (b) - // discard; - // else - // return; - // } - - gl_FragColor = color * color2; -} +#version 110 + +uniform float d; +uniform vec4 bigColor, smallColor; +uniform vec4 otherColor; + +varying float c; + +uniform float threshhold; +uniform float threshhold2; +uniform float threshhold3; + +uniform float minimum; + +varying vec4 BaseColor; + +uniform bool b; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + if (color.z < minimum) + return; + + color.z++; + + if (color.z > threshhold) + discard; + + color++; + + // Two path, different rest + if (color.w > threshhold2) { + if (color.z > threshhold2) + return; + else if (b) + color.z++; + else { + if (color.x < minimum) { + discard; + } else { + color++; + } + } + } else { + if (b) + discard; + else + return; + } + + + // // Two path, shared rest + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else if (b) + // color++; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + + // // One path + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + gl_FragColor = color * color2; +} diff --git a/core/deps/glslang/Test/flowControl.frag b/core/deps/glslang/Test/flowControl.frag index a6ef419d2..eaa6fb1da 100644 --- a/core/deps/glslang/Test/flowControl.frag +++ b/core/deps/glslang/Test/flowControl.frag @@ -1,23 +1,23 @@ -#version 120 - -uniform float d; -uniform vec4 bigColor, smallColor; -uniform vec4 otherColor; - -varying float c; -varying vec4 BaseColor; - -void main() -{ - vec4 color = BaseColor; - vec4 color2; - - color2 = otherColor; - - if (c > d) - color += bigColor; - else - color += smallColor; - - gl_FragColor = color * color2; -} +#version 120 + +uniform float d; +uniform vec4 bigColor, smallColor; +uniform vec4 otherColor; + +varying float c; +varying vec4 BaseColor; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + gl_FragColor = color * color2; +} diff --git a/core/deps/glslang/Test/foo.h b/core/deps/glslang/Test/foo.h index 7f79340b6..236277c3f 100644 --- a/core/deps/glslang/Test/foo.h +++ b/core/deps/glslang/Test/foo.h @@ -1 +1 @@ -#error should not be included \ No newline at end of file +#error should not be included diff --git a/core/deps/glslang/Test/forLoop.frag b/core/deps/glslang/Test/forLoop.frag index c26700aeb..117ecad15 100644 --- a/core/deps/glslang/Test/forLoop.frag +++ b/core/deps/glslang/Test/forLoop.frag @@ -1,41 +1,41 @@ -#version 130 - -uniform vec4 bigColor; -in vec4 BaseColor; -in float f; - -uniform int Count; -uniform uvec4 v4; - -void main() -{ - vec4 color = BaseColor; - - for (int i = 0; i < Count; ++i) { - color += bigColor; - } - - gl_FragColor = color; - - float sum = 0.0; - for (int i = 0; i < 4; ++i) - sum += v4[i]; - - vec4 tv4; - - for (int i = 0; i < 4; ++i) - tv4[i] = v4[i] * 4u; - - gl_FragColor += vec4(sum) + tv4; - - vec4 r; - r.xyz = BaseColor.xyz; - - for (int i = 0; i < Count; ++i) - r.w = f; - - gl_FragColor.xyz += r.xyz; - - for (int i = 0; i < 16; i += 4) - gl_FragColor *= f; -} +#version 130 + +uniform vec4 bigColor; +in vec4 BaseColor; +in float f; + +uniform int Count; +uniform uvec4 v4; + +void main() +{ + vec4 color = BaseColor; + + for (int i = 0; i < Count; ++i) { + color += bigColor; + } + + gl_FragColor = color; + + float sum = 0.0; + for (int i = 0; i < 4; ++i) + sum += v4[i]; + + vec4 tv4; + + for (int i = 0; i < 4; ++i) + tv4[i] = v4[i] * 4u; + + gl_FragColor += vec4(sum) + tv4; + + vec4 r; + r.xyz = BaseColor.xyz; + + for (int i = 0; i < Count; ++i) + r.w = f; + + gl_FragColor.xyz += r.xyz; + + for (int i = 0; i < 16; i += 4) + gl_FragColor *= f; +} diff --git a/core/deps/glslang/Test/functionCall.frag b/core/deps/glslang/Test/functionCall.frag index ca2866271..e1fc0e07f 100644 --- a/core/deps/glslang/Test/functionCall.frag +++ b/core/deps/glslang/Test/functionCall.frag @@ -1,44 +1,44 @@ -#version 130 - -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; - -float h = 0.0; - -float foo(vec4 bar) -{ - return bar.x + bar.y; -} - -void bar() -{ -} - -float unreachableReturn() -{ - if (d < 4.2) - return 1.2; - else - return 4.5; - // might be another return inserted here by builders, has to be correct type -} - -float missingReturn() -{ - if (d < 4.5) { - h = d; - return 3.9; - } -} - -void main() -{ - vec4 color = vec4(foo(BaseColor)); - - bar(); - float f = unreachableReturn(); - float g = missingReturn(); - - gl_FragColor = color * f * h; -} +#version 130 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +float h = 0.0; + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} + +void bar() +{ +} + +float unreachableReturn() +{ + if (d < 4.2) + return 1.2; + else + return 4.5; + // might be another return inserted here by builders, has to be correct type +} + +float missingReturn() +{ + if (d < 4.5) { + h = d; + return 3.9; + } +} + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + float g = missingReturn(); + + gl_FragColor = color * f * h; +} diff --git a/core/deps/glslang/Test/functionSemantics.frag b/core/deps/glslang/Test/functionSemantics.frag index 7bb95e6f1..e5c3ed00e 100644 --- a/core/deps/glslang/Test/functionSemantics.frag +++ b/core/deps/glslang/Test/functionSemantics.frag @@ -1,75 +1,75 @@ -#version 400 - -uniform float u; - -int foo(int a, const int b, in int c, const in int d, out int e, inout int f) -{ - int sum = a + b + c + d + f; // no e, it is out only - // sum should be 47 now - - a *= 64; - // no b, it is read only - c *= 64; - // no d, it is read only - e = 64 * 16; // e starts undefined - f *= 64; - - sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032 - // sum should be 4032 + 47 = 4079 - - return sum; -} - -int foo2(float a, vec3 b, out int r) -{ - r = int(3.0 * a); - return int(5.0 * b.y); -} - -int foo3() -{ - if (u > 3.2) { - discard; - return 1000000; - } - - return 2000000; -} - -void main() -{ - int e; - int t = 2; - struct s { - ivec4 t; - } f; - f.t.y = 32; - - // test the different qualifers - int color = foo(1, 2, t+t, 8, e, f.t.y); - - color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216 - // sum should be 4079 + 393216 = 397295 - - // test conversions - float arg; - float ret; - ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0 - color += int(ret + arg); // adds 22, for total of 397317 - - color += foo3(); // theoretically, add 2000000, for total of 2397317 - - gl_FragColor = vec4(color); -} - -vec3 m(vec2); -void aggCall() -{ - float F; - m(ivec2(F)); // test input conversion of single argument that's an aggregate; other function tests in 120.vert -} - -vec4 badConv() -{ - return u; // ERROR, can change scalar to vector +#version 400 + +uniform float u; + +int foo(int a, const int b, in int c, const in int d, out int e, inout int f) +{ + int sum = a + b + c + d + f; // no e, it is out only + // sum should be 47 now + + a *= 64; + // no b, it is read only + c *= 64; + // no d, it is read only + e = 64 * 16; // e starts undefined + f *= 64; + + sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032 + // sum should be 4032 + 47 = 4079 + + return sum; +} + +int foo2(float a, vec3 b, out int r) +{ + r = int(3.0 * a); + return int(5.0 * b.y); +} + +int foo3() +{ + if (u > 3.2) { + discard; + return 1000000; + } + + return 2000000; +} + +void main() +{ + int e; + int t = 2; + struct s { + ivec4 t; + } f; + f.t.y = 32; + + // test the different qualifers + int color = foo(1, 2, t+t, 8, e, f.t.y); + + color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216 + // sum should be 4079 + 393216 = 397295 + + // test conversions + float arg; + float ret; + ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0 + color += int(ret + arg); // adds 22, for total of 397317 + + color += foo3(); // theoretically, add 2000000, for total of 2397317 + + gl_FragColor = vec4(color); +} + +vec3 m(vec2); +void aggCall() +{ + float F; + m(ivec2(F)); // test input conversion of single argument that's an aggregate; other function tests in 120.vert +} + +vec4 badConv() +{ + return u; // ERROR, can change scalar to vector } \ No newline at end of file diff --git a/core/deps/glslang/Test/glsl.450.subgroup.frag b/core/deps/glslang/Test/glsl.450.subgroup.frag index 70bee79fa..d0b95737a 100644 --- a/core/deps/glslang/Test/glsl.450.subgroup.frag +++ b/core/deps/glslang/Test/glsl.450.subgroup.frag @@ -1,252 +1,252 @@ -#version 450 - -vec4 undeclared_errors(vec4 f4) -{ - vec4 result; - gl_SubgroupSize; // ERROR, extension not enabled (basic) - gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) - subgroupBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) - subgroupElect(); // ERROR, extension not enabled (basic) - gl_NumSubgroups; // ERROR, only defined in compute - gl_SubgroupID; // ERROR, only defined in compute - subgroupMemoryBarrierShared(); // ERROR, only defined in compute - - subgroupAll(true); // ERROR extension not enabled (vote) - subgroupAny(false); // ERROR extension not enabled (vote) - subgroupAllEqual(f4); // ERROR extension not enabled (vote) - - gl_SubgroupEqMask; // ERROR extension not enabled (ballot) - gl_SubgroupGeMask; // ERROR extension not enabled (ballot) - gl_SubgroupGtMask; // ERROR extension not enabled (ballot) - gl_SubgroupLeMask; // ERROR extension not enabled (ballot) - gl_SubgroupLtMask; // ERROR extension not enabled (ballot) - subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) - subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) - uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) - subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) - subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) - subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) - - subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) - subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) - subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) - subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) - - result = subgroupAdd(f4); // ERROR, extension not enabled (arith) - subgroupMul(f4); // ERROR, extension not enabled (arith) - subgroupMin(f4); // ERROR, extension not enabled (arith) - subgroupMax(f4); // ERROR, extension not enabled (arith) - subgroupAnd(ballot); // ERROR, extension not enabled (arith) - subgroupOr(ballot); // ERROR, extension not enabled (arith) - subgroupXor(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) - - subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) - - subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) - subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) - - uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - - return result; -} - -#extension GL_KHR_shader_subgroup_basic: enable -layout(location = 0) out uvec4 data; -void main (void) -{ - data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierImage(); - subgroupElect(); -} - -#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)); - subgroupBallotBitExtract(ballot, 0); - subgroupBallotBitCount(ballot); - subgroupBallotInclusiveBitCount(ballot); - subgroupBallotExclusiveBitCount(ballot); - subgroupBallotFindLSB(ballot); - subgroupBallotFindMSB(ballot); -} - -#extension GL_KHR_shader_subgroup_vote: enable -void vote_works(vec4 f4) -{ - subgroupAll(true); - subgroupAny(false); - subgroupAllEqual(f4); -} - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -void shuffle_works(vec4 f4) -{ - subgroupShuffle(f4, 0); - subgroupShuffleXor(f4, 0x1); - subgroupShuffleUp(f4, 1); - subgroupShuffleDown(f4, 1); -} - -#extension GL_KHR_shader_subgroup_arithmetic: enable -void arith_works(vec4 f4) -{ - uvec4 ballot; - subgroupAdd(f4); - subgroupMul(f4); - subgroupMin(f4); - subgroupMax(f4); - subgroupAnd(ballot); - subgroupOr(ballot); - subgroupXor(ballot); - subgroupInclusiveAdd(f4); - subgroupInclusiveMul(f4); - subgroupInclusiveMin(f4); - subgroupInclusiveMax(f4); - subgroupInclusiveAnd(ballot); - subgroupInclusiveOr(ballot); - subgroupInclusiveXor(ballot); - subgroupExclusiveAdd(f4); - subgroupExclusiveMul(f4); - subgroupExclusiveMin(f4); - subgroupExclusiveMax(f4); - subgroupExclusiveAnd(ballot); - subgroupExclusiveOr(ballot); - subgroupExclusiveXor(ballot); -} - -#extension GL_KHR_shader_subgroup_clustered: enable -void clustered_works(vec4 f4) -{ - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupClusteredAdd(f4, 2); - subgroupClusteredMul(f4, 2); - subgroupClusteredMin(f4, 2); - subgroupClusteredMax(f4, 2); - subgroupClusteredAnd(ballot, 2); - subgroupClusteredOr(ballot, 2); - subgroupClusteredXor(ballot, 2); -} - -#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); -} - -#extension GL_NV_shader_subgroup_partitioned: enable -void partitioned_works(vec4 f4) -{ - uvec4 parti = subgroupPartitionNV(f4); - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupPartitionedAddNV(f4, parti); - subgroupPartitionedMulNV(f4, parti); - subgroupPartitionedMinNV(f4, parti); - subgroupPartitionedMaxNV(f4, parti); - subgroupPartitionedAndNV(ballot, parti); - subgroupPartitionedOrNV(ballot, parti); - subgroupPartitionedXorNV(ballot, parti); - subgroupPartitionedInclusiveAddNV(f4, parti); - subgroupPartitionedInclusiveMulNV(f4, parti); - subgroupPartitionedInclusiveMinNV(f4, parti); - subgroupPartitionedInclusiveMaxNV(f4, parti); - subgroupPartitionedInclusiveAndNV(ballot, parti); - subgroupPartitionedInclusiveOrNV(ballot, parti); - subgroupPartitionedInclusiveXorNV(ballot, parti); - subgroupPartitionedExclusiveAddNV(f4, parti); - subgroupPartitionedExclusiveMulNV(f4, parti); - subgroupPartitionedExclusiveMinNV(f4, parti); - subgroupPartitionedExclusiveMaxNV(f4, parti); - subgroupPartitionedExclusiveAndNV(ballot, parti); - subgroupPartitionedExclusiveOrNV(ballot, parti); - subgroupPartitionedExclusiveXorNV(ballot, parti); -} - -// tests for NV_shader_sm_builtins -void sm_builtins_err() -{ - gl_WarpsPerSMNV; // ERROR, no extension - gl_SMCountNV; // ERROR, no extension - gl_WarpIDNV; // ERROR, no extension - gl_SMIDNV; // ERROR, no extension -} - -#ifdef GL_NV_shader_sm_builtins -#extension GL_NV_shader_sm_builtins : enable -#endif - -void sm_builtins() -{ - gl_WarpsPerSMNV; - gl_SMCountNV; - gl_WarpIDNV; - gl_SMIDNV; -} +#version 450 + +vec4 undeclared_errors(vec4 f4) +{ + vec4 result; + gl_SubgroupSize; // ERROR, extension not enabled (basic) + gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) + subgroupBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) + subgroupElect(); // ERROR, extension not enabled (basic) + gl_NumSubgroups; // ERROR, only defined in compute + gl_SubgroupID; // ERROR, only defined in compute + subgroupMemoryBarrierShared(); // ERROR, only defined in compute + + subgroupAll(true); // ERROR extension not enabled (vote) + subgroupAny(false); // ERROR extension not enabled (vote) + subgroupAllEqual(f4); // ERROR extension not enabled (vote) + + gl_SubgroupEqMask; // ERROR extension not enabled (ballot) + gl_SubgroupGeMask; // ERROR extension not enabled (ballot) + gl_SubgroupGtMask; // ERROR extension not enabled (ballot) + gl_SubgroupLeMask; // ERROR extension not enabled (ballot) + gl_SubgroupLtMask; // ERROR extension not enabled (ballot) + subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) + subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) + uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) + subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) + subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) + subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) + + subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) + subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) + subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) + subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) + + result = subgroupAdd(f4); // ERROR, extension not enabled (arith) + subgroupMul(f4); // ERROR, extension not enabled (arith) + subgroupMin(f4); // ERROR, extension not enabled (arith) + subgroupMax(f4); // ERROR, extension not enabled (arith) + subgroupAnd(ballot); // ERROR, extension not enabled (arith) + subgroupOr(ballot); // ERROR, extension not enabled (arith) + subgroupXor(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) + + subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) + + subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) + subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) + + uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + + return result; +} + +#extension GL_KHR_shader_subgroup_basic: enable +layout(location = 0) out uvec4 data; +void main (void) +{ + data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierImage(); + subgroupElect(); +} + +#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)); + subgroupBallotBitExtract(ballot, 0); + subgroupBallotBitCount(ballot); + subgroupBallotInclusiveBitCount(ballot); + subgroupBallotExclusiveBitCount(ballot); + subgroupBallotFindLSB(ballot); + subgroupBallotFindMSB(ballot); +} + +#extension GL_KHR_shader_subgroup_vote: enable +void vote_works(vec4 f4) +{ + subgroupAll(true); + subgroupAny(false); + subgroupAllEqual(f4); +} + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +void shuffle_works(vec4 f4) +{ + subgroupShuffle(f4, 0); + subgroupShuffleXor(f4, 0x1); + subgroupShuffleUp(f4, 1); + subgroupShuffleDown(f4, 1); +} + +#extension GL_KHR_shader_subgroup_arithmetic: enable +void arith_works(vec4 f4) +{ + uvec4 ballot; + subgroupAdd(f4); + subgroupMul(f4); + subgroupMin(f4); + subgroupMax(f4); + subgroupAnd(ballot); + subgroupOr(ballot); + subgroupXor(ballot); + subgroupInclusiveAdd(f4); + subgroupInclusiveMul(f4); + subgroupInclusiveMin(f4); + subgroupInclusiveMax(f4); + subgroupInclusiveAnd(ballot); + subgroupInclusiveOr(ballot); + subgroupInclusiveXor(ballot); + subgroupExclusiveAdd(f4); + subgroupExclusiveMul(f4); + subgroupExclusiveMin(f4); + subgroupExclusiveMax(f4); + subgroupExclusiveAnd(ballot); + subgroupExclusiveOr(ballot); + subgroupExclusiveXor(ballot); +} + +#extension GL_KHR_shader_subgroup_clustered: enable +void clustered_works(vec4 f4) +{ + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupClusteredAdd(f4, 2); + subgroupClusteredMul(f4, 2); + subgroupClusteredMin(f4, 2); + subgroupClusteredMax(f4, 2); + subgroupClusteredAnd(ballot, 2); + subgroupClusteredOr(ballot, 2); + subgroupClusteredXor(ballot, 2); +} + +#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); +} + +#extension GL_NV_shader_subgroup_partitioned: enable +void partitioned_works(vec4 f4) +{ + uvec4 parti = subgroupPartitionNV(f4); + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupPartitionedAddNV(f4, parti); + subgroupPartitionedMulNV(f4, parti); + subgroupPartitionedMinNV(f4, parti); + subgroupPartitionedMaxNV(f4, parti); + subgroupPartitionedAndNV(ballot, parti); + subgroupPartitionedOrNV(ballot, parti); + subgroupPartitionedXorNV(ballot, parti); + subgroupPartitionedInclusiveAddNV(f4, parti); + subgroupPartitionedInclusiveMulNV(f4, parti); + subgroupPartitionedInclusiveMinNV(f4, parti); + subgroupPartitionedInclusiveMaxNV(f4, parti); + subgroupPartitionedInclusiveAndNV(ballot, parti); + subgroupPartitionedInclusiveOrNV(ballot, parti); + subgroupPartitionedInclusiveXorNV(ballot, parti); + subgroupPartitionedExclusiveAddNV(f4, parti); + subgroupPartitionedExclusiveMulNV(f4, parti); + subgroupPartitionedExclusiveMinNV(f4, parti); + subgroupPartitionedExclusiveMaxNV(f4, parti); + subgroupPartitionedExclusiveAndNV(ballot, parti); + subgroupPartitionedExclusiveOrNV(ballot, parti); + subgroupPartitionedExclusiveXorNV(ballot, parti); +} + +// tests for NV_shader_sm_builtins +void sm_builtins_err() +{ + gl_WarpsPerSMNV; // ERROR, no extension + gl_SMCountNV; // ERROR, no extension + gl_WarpIDNV; // ERROR, no extension + gl_SMIDNV; // ERROR, no extension +} + +#ifdef GL_NV_shader_sm_builtins +#extension GL_NV_shader_sm_builtins : enable +#endif + +void sm_builtins() +{ + gl_WarpsPerSMNV; + gl_SMCountNV; + gl_WarpIDNV; + gl_SMIDNV; +} diff --git a/core/deps/glslang/Test/glsl.450.subgroup.geom b/core/deps/glslang/Test/glsl.450.subgroup.geom index ed4c651ee..d5d2f25f6 100644 --- a/core/deps/glslang/Test/glsl.450.subgroup.geom +++ b/core/deps/glslang/Test/glsl.450.subgroup.geom @@ -1,254 +1,254 @@ -#version 450 - -vec4 undeclared_errors(vec4 f4) -{ - vec4 result; - gl_SubgroupSize; // ERROR, extension not enabled (basic) - gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) - subgroupBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) - subgroupElect(); // ERROR, extension not enabled (basic) - gl_NumSubgroups; // ERROR, only defined in compute - gl_SubgroupID; // ERROR, only defined in compute - subgroupMemoryBarrierShared(); // ERROR, only defined in compute - - subgroupAll(true); // ERROR extension not enabled (vote) - subgroupAny(false); // ERROR extension not enabled (vote) - subgroupAllEqual(f4); // ERROR extension not enabled (vote) - - gl_SubgroupEqMask; // ERROR extension not enabled (ballot) - gl_SubgroupGeMask; // ERROR extension not enabled (ballot) - gl_SubgroupGtMask; // ERROR extension not enabled (ballot) - gl_SubgroupLeMask; // ERROR extension not enabled (ballot) - gl_SubgroupLtMask; // ERROR extension not enabled (ballot) - subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) - subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) - uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) - subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) - subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) - subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) - - subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) - subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) - subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) - subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) - - result = subgroupAdd(f4); // ERROR, extension not enabled (arith) - subgroupMul(f4); // ERROR, extension not enabled (arith) - subgroupMin(f4); // ERROR, extension not enabled (arith) - subgroupMax(f4); // ERROR, extension not enabled (arith) - subgroupAnd(ballot); // ERROR, extension not enabled (arith) - subgroupOr(ballot); // ERROR, extension not enabled (arith) - subgroupXor(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) - - subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) - - subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) - subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) - - uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - - return result; -} - -#extension GL_KHR_shader_subgroup_basic: enable -layout(points) in; -layout(points, max_vertices = 1) out; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierImage(); - subgroupElect(); -} - -#extension GL_KHR_shader_subgroup_ballot: enable -void ballot_works(vec4 f4) { - gl_SubgroupEqMask; - gl_SubgroupGeMask; - gl_SubgroupGtMask; - gl_SubgroupLeMask; - gl_SubgroupLtMask; - subgroupBroadcast(f4, 0); - subgroupBroadcastFirst(f4); - uvec4 ballot = subgroupBallot(false); - subgroupInverseBallot(uvec4(0x1)); - subgroupBallotBitExtract(ballot, 0); - subgroupBallotBitCount(ballot); - subgroupBallotInclusiveBitCount(ballot); - subgroupBallotExclusiveBitCount(ballot); - subgroupBallotFindLSB(ballot); - subgroupBallotFindMSB(ballot); -} - -#extension GL_KHR_shader_subgroup_vote: enable -void vote_works(vec4 f4) -{ - subgroupAll(true); - subgroupAny(false); - subgroupAllEqual(f4); -} - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -void shuffle_works(vec4 f4) -{ - subgroupShuffle(f4, 0); - subgroupShuffleXor(f4, 0x1); - subgroupShuffleUp(f4, 1); - subgroupShuffleDown(f4, 1); -} - -#extension GL_KHR_shader_subgroup_arithmetic: enable -void arith_works(vec4 f4) -{ - uvec4 ballot; - subgroupAdd(f4); - subgroupMul(f4); - subgroupMin(f4); - subgroupMax(f4); - subgroupAnd(ballot); - subgroupOr(ballot); - subgroupXor(ballot); - subgroupInclusiveAdd(f4); - subgroupInclusiveMul(f4); - subgroupInclusiveMin(f4); - subgroupInclusiveMax(f4); - subgroupInclusiveAnd(ballot); - subgroupInclusiveOr(ballot); - subgroupInclusiveXor(ballot); - subgroupExclusiveAdd(f4); - subgroupExclusiveMul(f4); - subgroupExclusiveMin(f4); - subgroupExclusiveMax(f4); - subgroupExclusiveAnd(ballot); - subgroupExclusiveOr(ballot); - subgroupExclusiveXor(ballot); -} - -#extension GL_KHR_shader_subgroup_clustered: enable -void clustered_works(vec4 f4) -{ - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupClusteredAdd(f4, 2); - subgroupClusteredMul(f4, 2); - subgroupClusteredMin(f4, 2); - subgroupClusteredMax(f4, 2); - subgroupClusteredAnd(ballot, 2); - subgroupClusteredOr(ballot, 2); - subgroupClusteredXor(ballot, 2); -} - -#extension GL_KHR_shader_subgroup_quad: enable -void quad_works(vec4 f4) -{ - subgroupQuadBroadcast(f4, 0); - subgroupQuadSwapHorizontal(f4); - subgroupQuadSwapVertical(f4); - subgroupQuadSwapDiagonal(f4); -} - -#extension GL_NV_shader_subgroup_partitioned: enable -void partitioned_works(vec4 f4) -{ - uvec4 parti = subgroupPartitionNV(f4); - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupPartitionedAddNV(f4, parti); - subgroupPartitionedMulNV(f4, parti); - subgroupPartitionedMinNV(f4, parti); - subgroupPartitionedMaxNV(f4, parti); - subgroupPartitionedAndNV(ballot, parti); - subgroupPartitionedOrNV(ballot, parti); - subgroupPartitionedXorNV(ballot, parti); - subgroupPartitionedInclusiveAddNV(f4, parti); - subgroupPartitionedInclusiveMulNV(f4, parti); - subgroupPartitionedInclusiveMinNV(f4, parti); - subgroupPartitionedInclusiveMaxNV(f4, parti); - subgroupPartitionedInclusiveAndNV(ballot, parti); - subgroupPartitionedInclusiveOrNV(ballot, parti); - subgroupPartitionedInclusiveXorNV(ballot, parti); - subgroupPartitionedExclusiveAddNV(f4, parti); - subgroupPartitionedExclusiveMulNV(f4, parti); - subgroupPartitionedExclusiveMinNV(f4, parti); - subgroupPartitionedExclusiveMaxNV(f4, parti); - subgroupPartitionedExclusiveAndNV(ballot, parti); - subgroupPartitionedExclusiveOrNV(ballot, parti); - subgroupPartitionedExclusiveXorNV(ballot, parti); -} - -// tests for NV_shader_sm_builtins -void sm_builtins_err() -{ - gl_WarpsPerSMNV; // ERROR, no extension - gl_SMCountNV; // ERROR, no extension - gl_WarpIDNV; // ERROR, no extension - gl_SMIDNV; // ERROR, no extension -} - -#ifdef GL_NV_shader_sm_builtins -#extension GL_NV_shader_sm_builtins : enable -#endif - -void sm_builtins() -{ - gl_WarpsPerSMNV; - gl_SMCountNV; - gl_WarpIDNV; - gl_SMIDNV; -} +#version 450 + +vec4 undeclared_errors(vec4 f4) +{ + vec4 result; + gl_SubgroupSize; // ERROR, extension not enabled (basic) + gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) + subgroupBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) + subgroupElect(); // ERROR, extension not enabled (basic) + gl_NumSubgroups; // ERROR, only defined in compute + gl_SubgroupID; // ERROR, only defined in compute + subgroupMemoryBarrierShared(); // ERROR, only defined in compute + + subgroupAll(true); // ERROR extension not enabled (vote) + subgroupAny(false); // ERROR extension not enabled (vote) + subgroupAllEqual(f4); // ERROR extension not enabled (vote) + + gl_SubgroupEqMask; // ERROR extension not enabled (ballot) + gl_SubgroupGeMask; // ERROR extension not enabled (ballot) + gl_SubgroupGtMask; // ERROR extension not enabled (ballot) + gl_SubgroupLeMask; // ERROR extension not enabled (ballot) + gl_SubgroupLtMask; // ERROR extension not enabled (ballot) + subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) + subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) + uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) + subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) + subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) + subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) + + subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) + subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) + subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) + subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) + + result = subgroupAdd(f4); // ERROR, extension not enabled (arith) + subgroupMul(f4); // ERROR, extension not enabled (arith) + subgroupMin(f4); // ERROR, extension not enabled (arith) + subgroupMax(f4); // ERROR, extension not enabled (arith) + subgroupAnd(ballot); // ERROR, extension not enabled (arith) + subgroupOr(ballot); // ERROR, extension not enabled (arith) + subgroupXor(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) + + subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) + + subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) + subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) + + uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + + return result; +} + +#extension GL_KHR_shader_subgroup_basic: enable +layout(points) in; +layout(points, max_vertices = 1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierImage(); + subgroupElect(); +} + +#extension GL_KHR_shader_subgroup_ballot: enable +void ballot_works(vec4 f4) { + gl_SubgroupEqMask; + gl_SubgroupGeMask; + gl_SubgroupGtMask; + gl_SubgroupLeMask; + gl_SubgroupLtMask; + subgroupBroadcast(f4, 0); + subgroupBroadcastFirst(f4); + uvec4 ballot = subgroupBallot(false); + subgroupInverseBallot(uvec4(0x1)); + subgroupBallotBitExtract(ballot, 0); + subgroupBallotBitCount(ballot); + subgroupBallotInclusiveBitCount(ballot); + subgroupBallotExclusiveBitCount(ballot); + subgroupBallotFindLSB(ballot); + subgroupBallotFindMSB(ballot); +} + +#extension GL_KHR_shader_subgroup_vote: enable +void vote_works(vec4 f4) +{ + subgroupAll(true); + subgroupAny(false); + subgroupAllEqual(f4); +} + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +void shuffle_works(vec4 f4) +{ + subgroupShuffle(f4, 0); + subgroupShuffleXor(f4, 0x1); + subgroupShuffleUp(f4, 1); + subgroupShuffleDown(f4, 1); +} + +#extension GL_KHR_shader_subgroup_arithmetic: enable +void arith_works(vec4 f4) +{ + uvec4 ballot; + subgroupAdd(f4); + subgroupMul(f4); + subgroupMin(f4); + subgroupMax(f4); + subgroupAnd(ballot); + subgroupOr(ballot); + subgroupXor(ballot); + subgroupInclusiveAdd(f4); + subgroupInclusiveMul(f4); + subgroupInclusiveMin(f4); + subgroupInclusiveMax(f4); + subgroupInclusiveAnd(ballot); + subgroupInclusiveOr(ballot); + subgroupInclusiveXor(ballot); + subgroupExclusiveAdd(f4); + subgroupExclusiveMul(f4); + subgroupExclusiveMin(f4); + subgroupExclusiveMax(f4); + subgroupExclusiveAnd(ballot); + subgroupExclusiveOr(ballot); + subgroupExclusiveXor(ballot); +} + +#extension GL_KHR_shader_subgroup_clustered: enable +void clustered_works(vec4 f4) +{ + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupClusteredAdd(f4, 2); + subgroupClusteredMul(f4, 2); + subgroupClusteredMin(f4, 2); + subgroupClusteredMax(f4, 2); + subgroupClusteredAnd(ballot, 2); + subgroupClusteredOr(ballot, 2); + subgroupClusteredXor(ballot, 2); +} + +#extension GL_KHR_shader_subgroup_quad: enable +void quad_works(vec4 f4) +{ + subgroupQuadBroadcast(f4, 0); + subgroupQuadSwapHorizontal(f4); + subgroupQuadSwapVertical(f4); + subgroupQuadSwapDiagonal(f4); +} + +#extension GL_NV_shader_subgroup_partitioned: enable +void partitioned_works(vec4 f4) +{ + uvec4 parti = subgroupPartitionNV(f4); + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupPartitionedAddNV(f4, parti); + subgroupPartitionedMulNV(f4, parti); + subgroupPartitionedMinNV(f4, parti); + subgroupPartitionedMaxNV(f4, parti); + subgroupPartitionedAndNV(ballot, parti); + subgroupPartitionedOrNV(ballot, parti); + subgroupPartitionedXorNV(ballot, parti); + subgroupPartitionedInclusiveAddNV(f4, parti); + subgroupPartitionedInclusiveMulNV(f4, parti); + subgroupPartitionedInclusiveMinNV(f4, parti); + subgroupPartitionedInclusiveMaxNV(f4, parti); + subgroupPartitionedInclusiveAndNV(ballot, parti); + subgroupPartitionedInclusiveOrNV(ballot, parti); + subgroupPartitionedInclusiveXorNV(ballot, parti); + subgroupPartitionedExclusiveAddNV(f4, parti); + subgroupPartitionedExclusiveMulNV(f4, parti); + subgroupPartitionedExclusiveMinNV(f4, parti); + subgroupPartitionedExclusiveMaxNV(f4, parti); + subgroupPartitionedExclusiveAndNV(ballot, parti); + subgroupPartitionedExclusiveOrNV(ballot, parti); + subgroupPartitionedExclusiveXorNV(ballot, parti); +} + +// tests for NV_shader_sm_builtins +void sm_builtins_err() +{ + gl_WarpsPerSMNV; // ERROR, no extension + gl_SMCountNV; // ERROR, no extension + gl_WarpIDNV; // ERROR, no extension + gl_SMIDNV; // ERROR, no extension +} + +#ifdef GL_NV_shader_sm_builtins +#extension GL_NV_shader_sm_builtins : enable +#endif + +void sm_builtins() +{ + gl_WarpsPerSMNV; + gl_SMCountNV; + gl_WarpIDNV; + gl_SMIDNV; +} diff --git a/core/deps/glslang/Test/glsl.450.subgroup.tesc b/core/deps/glslang/Test/glsl.450.subgroup.tesc index bd4adce73..92cb1aef1 100644 --- a/core/deps/glslang/Test/glsl.450.subgroup.tesc +++ b/core/deps/glslang/Test/glsl.450.subgroup.tesc @@ -1,253 +1,253 @@ -#version 450 - -vec4 undeclared_errors(vec4 f4) -{ - vec4 result; - gl_SubgroupSize; // ERROR, extension not enabled (basic) - gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) - subgroupBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) - subgroupElect(); // ERROR, extension not enabled (basic) - gl_NumSubgroups; // ERROR, only defined in compute - gl_SubgroupID; // ERROR, only defined in compute - subgroupMemoryBarrierShared(); // ERROR, only defined in compute - - subgroupAll(true); // ERROR extension not enabled (vote) - subgroupAny(false); // ERROR extension not enabled (vote) - subgroupAllEqual(f4); // ERROR extension not enabled (vote) - - gl_SubgroupEqMask; // ERROR extension not enabled (ballot) - gl_SubgroupGeMask; // ERROR extension not enabled (ballot) - gl_SubgroupGtMask; // ERROR extension not enabled (ballot) - gl_SubgroupLeMask; // ERROR extension not enabled (ballot) - gl_SubgroupLtMask; // ERROR extension not enabled (ballot) - subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) - subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) - uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) - subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) - subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) - subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) - - subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) - subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) - subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) - subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) - - result = subgroupAdd(f4); // ERROR, extension not enabled (arith) - subgroupMul(f4); // ERROR, extension not enabled (arith) - subgroupMin(f4); // ERROR, extension not enabled (arith) - subgroupMax(f4); // ERROR, extension not enabled (arith) - subgroupAnd(ballot); // ERROR, extension not enabled (arith) - subgroupOr(ballot); // ERROR, extension not enabled (arith) - subgroupXor(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) - - subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) - - subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) - subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) - - uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - - return result; -} - -#extension GL_KHR_shader_subgroup_basic: enable -layout(vertices=1) out; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierImage(); - subgroupElect(); -} - -#extension GL_KHR_shader_subgroup_ballot: enable -void ballot_works(vec4 f4) { - gl_SubgroupEqMask; - gl_SubgroupGeMask; - gl_SubgroupGtMask; - gl_SubgroupLeMask; - gl_SubgroupLtMask; - subgroupBroadcast(f4, 0); - subgroupBroadcastFirst(f4); - uvec4 ballot = subgroupBallot(false); - subgroupInverseBallot(uvec4(0x1)); - subgroupBallotBitExtract(ballot, 0); - subgroupBallotBitCount(ballot); - subgroupBallotInclusiveBitCount(ballot); - subgroupBallotExclusiveBitCount(ballot); - subgroupBallotFindLSB(ballot); - subgroupBallotFindMSB(ballot); -} - -#extension GL_KHR_shader_subgroup_vote: enable -void vote_works(vec4 f4) -{ - subgroupAll(true); - subgroupAny(false); - subgroupAllEqual(f4); -} - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -void shuffle_works(vec4 f4) -{ - subgroupShuffle(f4, 0); - subgroupShuffleXor(f4, 0x1); - subgroupShuffleUp(f4, 1); - subgroupShuffleDown(f4, 1); -} - -#extension GL_KHR_shader_subgroup_arithmetic: enable -void arith_works(vec4 f4) -{ - uvec4 ballot; - subgroupAdd(f4); - subgroupMul(f4); - subgroupMin(f4); - subgroupMax(f4); - subgroupAnd(ballot); - subgroupOr(ballot); - subgroupXor(ballot); - subgroupInclusiveAdd(f4); - subgroupInclusiveMul(f4); - subgroupInclusiveMin(f4); - subgroupInclusiveMax(f4); - subgroupInclusiveAnd(ballot); - subgroupInclusiveOr(ballot); - subgroupInclusiveXor(ballot); - subgroupExclusiveAdd(f4); - subgroupExclusiveMul(f4); - subgroupExclusiveMin(f4); - subgroupExclusiveMax(f4); - subgroupExclusiveAnd(ballot); - subgroupExclusiveOr(ballot); - subgroupExclusiveXor(ballot); -} - -#extension GL_KHR_shader_subgroup_clustered: enable -void clustered_works(vec4 f4) -{ - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupClusteredAdd(f4, 2); - subgroupClusteredMul(f4, 2); - subgroupClusteredMin(f4, 2); - subgroupClusteredMax(f4, 2); - subgroupClusteredAnd(ballot, 2); - subgroupClusteredOr(ballot, 2); - subgroupClusteredXor(ballot, 2); -} - -#extension GL_KHR_shader_subgroup_quad: enable -void quad_works(vec4 f4) -{ - subgroupQuadBroadcast(f4, 0); - subgroupQuadSwapHorizontal(f4); - subgroupQuadSwapVertical(f4); - subgroupQuadSwapDiagonal(f4); -} - -#extension GL_NV_shader_subgroup_partitioned: enable -void partitioned_works(vec4 f4) -{ - uvec4 parti = subgroupPartitionNV(f4); - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupPartitionedAddNV(f4, parti); - subgroupPartitionedMulNV(f4, parti); - subgroupPartitionedMinNV(f4, parti); - subgroupPartitionedMaxNV(f4, parti); - subgroupPartitionedAndNV(ballot, parti); - subgroupPartitionedOrNV(ballot, parti); - subgroupPartitionedXorNV(ballot, parti); - subgroupPartitionedInclusiveAddNV(f4, parti); - subgroupPartitionedInclusiveMulNV(f4, parti); - subgroupPartitionedInclusiveMinNV(f4, parti); - subgroupPartitionedInclusiveMaxNV(f4, parti); - subgroupPartitionedInclusiveAndNV(ballot, parti); - subgroupPartitionedInclusiveOrNV(ballot, parti); - subgroupPartitionedInclusiveXorNV(ballot, parti); - subgroupPartitionedExclusiveAddNV(f4, parti); - subgroupPartitionedExclusiveMulNV(f4, parti); - subgroupPartitionedExclusiveMinNV(f4, parti); - subgroupPartitionedExclusiveMaxNV(f4, parti); - subgroupPartitionedExclusiveAndNV(ballot, parti); - subgroupPartitionedExclusiveOrNV(ballot, parti); - subgroupPartitionedExclusiveXorNV(ballot, parti); -} - -// tests for NV_shader_sm_builtins -void sm_builtins_err() -{ - gl_WarpsPerSMNV; // ERROR, no extension - gl_SMCountNV; // ERROR, no extension - gl_WarpIDNV; // ERROR, no extension - gl_SMIDNV; // ERROR, no extension -} - -#ifdef GL_NV_shader_sm_builtins -#extension GL_NV_shader_sm_builtins : enable -#endif - -void sm_builtins() -{ - gl_WarpsPerSMNV; - gl_SMCountNV; - gl_WarpIDNV; - gl_SMIDNV; -} +#version 450 + +vec4 undeclared_errors(vec4 f4) +{ + vec4 result; + gl_SubgroupSize; // ERROR, extension not enabled (basic) + gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) + subgroupBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) + subgroupElect(); // ERROR, extension not enabled (basic) + gl_NumSubgroups; // ERROR, only defined in compute + gl_SubgroupID; // ERROR, only defined in compute + subgroupMemoryBarrierShared(); // ERROR, only defined in compute + + subgroupAll(true); // ERROR extension not enabled (vote) + subgroupAny(false); // ERROR extension not enabled (vote) + subgroupAllEqual(f4); // ERROR extension not enabled (vote) + + gl_SubgroupEqMask; // ERROR extension not enabled (ballot) + gl_SubgroupGeMask; // ERROR extension not enabled (ballot) + gl_SubgroupGtMask; // ERROR extension not enabled (ballot) + gl_SubgroupLeMask; // ERROR extension not enabled (ballot) + gl_SubgroupLtMask; // ERROR extension not enabled (ballot) + subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) + subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) + uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) + subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) + subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) + subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) + + subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) + subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) + subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) + subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) + + result = subgroupAdd(f4); // ERROR, extension not enabled (arith) + subgroupMul(f4); // ERROR, extension not enabled (arith) + subgroupMin(f4); // ERROR, extension not enabled (arith) + subgroupMax(f4); // ERROR, extension not enabled (arith) + subgroupAnd(ballot); // ERROR, extension not enabled (arith) + subgroupOr(ballot); // ERROR, extension not enabled (arith) + subgroupXor(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) + + subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) + + subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) + subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) + + uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + + return result; +} + +#extension GL_KHR_shader_subgroup_basic: enable +layout(vertices=1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierImage(); + subgroupElect(); +} + +#extension GL_KHR_shader_subgroup_ballot: enable +void ballot_works(vec4 f4) { + gl_SubgroupEqMask; + gl_SubgroupGeMask; + gl_SubgroupGtMask; + gl_SubgroupLeMask; + gl_SubgroupLtMask; + subgroupBroadcast(f4, 0); + subgroupBroadcastFirst(f4); + uvec4 ballot = subgroupBallot(false); + subgroupInverseBallot(uvec4(0x1)); + subgroupBallotBitExtract(ballot, 0); + subgroupBallotBitCount(ballot); + subgroupBallotInclusiveBitCount(ballot); + subgroupBallotExclusiveBitCount(ballot); + subgroupBallotFindLSB(ballot); + subgroupBallotFindMSB(ballot); +} + +#extension GL_KHR_shader_subgroup_vote: enable +void vote_works(vec4 f4) +{ + subgroupAll(true); + subgroupAny(false); + subgroupAllEqual(f4); +} + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +void shuffle_works(vec4 f4) +{ + subgroupShuffle(f4, 0); + subgroupShuffleXor(f4, 0x1); + subgroupShuffleUp(f4, 1); + subgroupShuffleDown(f4, 1); +} + +#extension GL_KHR_shader_subgroup_arithmetic: enable +void arith_works(vec4 f4) +{ + uvec4 ballot; + subgroupAdd(f4); + subgroupMul(f4); + subgroupMin(f4); + subgroupMax(f4); + subgroupAnd(ballot); + subgroupOr(ballot); + subgroupXor(ballot); + subgroupInclusiveAdd(f4); + subgroupInclusiveMul(f4); + subgroupInclusiveMin(f4); + subgroupInclusiveMax(f4); + subgroupInclusiveAnd(ballot); + subgroupInclusiveOr(ballot); + subgroupInclusiveXor(ballot); + subgroupExclusiveAdd(f4); + subgroupExclusiveMul(f4); + subgroupExclusiveMin(f4); + subgroupExclusiveMax(f4); + subgroupExclusiveAnd(ballot); + subgroupExclusiveOr(ballot); + subgroupExclusiveXor(ballot); +} + +#extension GL_KHR_shader_subgroup_clustered: enable +void clustered_works(vec4 f4) +{ + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupClusteredAdd(f4, 2); + subgroupClusteredMul(f4, 2); + subgroupClusteredMin(f4, 2); + subgroupClusteredMax(f4, 2); + subgroupClusteredAnd(ballot, 2); + subgroupClusteredOr(ballot, 2); + subgroupClusteredXor(ballot, 2); +} + +#extension GL_KHR_shader_subgroup_quad: enable +void quad_works(vec4 f4) +{ + subgroupQuadBroadcast(f4, 0); + subgroupQuadSwapHorizontal(f4); + subgroupQuadSwapVertical(f4); + subgroupQuadSwapDiagonal(f4); +} + +#extension GL_NV_shader_subgroup_partitioned: enable +void partitioned_works(vec4 f4) +{ + uvec4 parti = subgroupPartitionNV(f4); + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupPartitionedAddNV(f4, parti); + subgroupPartitionedMulNV(f4, parti); + subgroupPartitionedMinNV(f4, parti); + subgroupPartitionedMaxNV(f4, parti); + subgroupPartitionedAndNV(ballot, parti); + subgroupPartitionedOrNV(ballot, parti); + subgroupPartitionedXorNV(ballot, parti); + subgroupPartitionedInclusiveAddNV(f4, parti); + subgroupPartitionedInclusiveMulNV(f4, parti); + subgroupPartitionedInclusiveMinNV(f4, parti); + subgroupPartitionedInclusiveMaxNV(f4, parti); + subgroupPartitionedInclusiveAndNV(ballot, parti); + subgroupPartitionedInclusiveOrNV(ballot, parti); + subgroupPartitionedInclusiveXorNV(ballot, parti); + subgroupPartitionedExclusiveAddNV(f4, parti); + subgroupPartitionedExclusiveMulNV(f4, parti); + subgroupPartitionedExclusiveMinNV(f4, parti); + subgroupPartitionedExclusiveMaxNV(f4, parti); + subgroupPartitionedExclusiveAndNV(ballot, parti); + subgroupPartitionedExclusiveOrNV(ballot, parti); + subgroupPartitionedExclusiveXorNV(ballot, parti); +} + +// tests for NV_shader_sm_builtins +void sm_builtins_err() +{ + gl_WarpsPerSMNV; // ERROR, no extension + gl_SMCountNV; // ERROR, no extension + gl_WarpIDNV; // ERROR, no extension + gl_SMIDNV; // ERROR, no extension +} + +#ifdef GL_NV_shader_sm_builtins +#extension GL_NV_shader_sm_builtins : enable +#endif + +void sm_builtins() +{ + gl_WarpsPerSMNV; + gl_SMCountNV; + gl_WarpIDNV; + gl_SMIDNV; +} diff --git a/core/deps/glslang/Test/glsl.450.subgroup.tese b/core/deps/glslang/Test/glsl.450.subgroup.tese index 4cb6f263f..bfb2b72f2 100644 --- a/core/deps/glslang/Test/glsl.450.subgroup.tese +++ b/core/deps/glslang/Test/glsl.450.subgroup.tese @@ -1,253 +1,253 @@ -#version 450 - -vec4 undeclared_errors(vec4 f4) -{ - vec4 result; - gl_SubgroupSize; // ERROR, extension not enabled (basic) - gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) - subgroupBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) - subgroupElect(); // ERROR, extension not enabled (basic) - gl_NumSubgroups; // ERROR, only defined in compute - gl_SubgroupID; // ERROR, only defined in compute - subgroupMemoryBarrierShared(); // ERROR, only defined in compute - - subgroupAll(true); // ERROR extension not enabled (vote) - subgroupAny(false); // ERROR extension not enabled (vote) - subgroupAllEqual(f4); // ERROR extension not enabled (vote) - - gl_SubgroupEqMask; // ERROR extension not enabled (ballot) - gl_SubgroupGeMask; // ERROR extension not enabled (ballot) - gl_SubgroupGtMask; // ERROR extension not enabled (ballot) - gl_SubgroupLeMask; // ERROR extension not enabled (ballot) - gl_SubgroupLtMask; // ERROR extension not enabled (ballot) - subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) - subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) - uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) - subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) - subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) - subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) - - subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) - subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) - subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) - subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) - - result = subgroupAdd(f4); // ERROR, extension not enabled (arith) - subgroupMul(f4); // ERROR, extension not enabled (arith) - subgroupMin(f4); // ERROR, extension not enabled (arith) - subgroupMax(f4); // ERROR, extension not enabled (arith) - subgroupAnd(ballot); // ERROR, extension not enabled (arith) - subgroupOr(ballot); // ERROR, extension not enabled (arith) - subgroupXor(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) - - subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) - - subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) - subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) - - uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - - return result; -} - -#extension GL_KHR_shader_subgroup_basic: enable -layout(isolines) in; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierImage(); - subgroupElect(); -} - -#extension GL_KHR_shader_subgroup_ballot: enable -void ballot_works(vec4 f4) { - gl_SubgroupEqMask; - gl_SubgroupGeMask; - gl_SubgroupGtMask; - gl_SubgroupLeMask; - gl_SubgroupLtMask; - subgroupBroadcast(f4, 0); - subgroupBroadcastFirst(f4); - uvec4 ballot = subgroupBallot(false); - subgroupInverseBallot(uvec4(0x1)); - subgroupBallotBitExtract(ballot, 0); - subgroupBallotBitCount(ballot); - subgroupBallotInclusiveBitCount(ballot); - subgroupBallotExclusiveBitCount(ballot); - subgroupBallotFindLSB(ballot); - subgroupBallotFindMSB(ballot); -} - -#extension GL_KHR_shader_subgroup_vote: enable -void vote_works(vec4 f4) -{ - subgroupAll(true); - subgroupAny(false); - subgroupAllEqual(f4); -} - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -void shuffle_works(vec4 f4) -{ - subgroupShuffle(f4, 0); - subgroupShuffleXor(f4, 0x1); - subgroupShuffleUp(f4, 1); - subgroupShuffleDown(f4, 1); -} - -#extension GL_KHR_shader_subgroup_arithmetic: enable -void arith_works(vec4 f4) -{ - uvec4 ballot; - subgroupAdd(f4); - subgroupMul(f4); - subgroupMin(f4); - subgroupMax(f4); - subgroupAnd(ballot); - subgroupOr(ballot); - subgroupXor(ballot); - subgroupInclusiveAdd(f4); - subgroupInclusiveMul(f4); - subgroupInclusiveMin(f4); - subgroupInclusiveMax(f4); - subgroupInclusiveAnd(ballot); - subgroupInclusiveOr(ballot); - subgroupInclusiveXor(ballot); - subgroupExclusiveAdd(f4); - subgroupExclusiveMul(f4); - subgroupExclusiveMin(f4); - subgroupExclusiveMax(f4); - subgroupExclusiveAnd(ballot); - subgroupExclusiveOr(ballot); - subgroupExclusiveXor(ballot); -} - -#extension GL_KHR_shader_subgroup_clustered: enable -void clustered_works(vec4 f4) -{ - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupClusteredAdd(f4, 2); - subgroupClusteredMul(f4, 2); - subgroupClusteredMin(f4, 2); - subgroupClusteredMax(f4, 2); - subgroupClusteredAnd(ballot, 2); - subgroupClusteredOr(ballot, 2); - subgroupClusteredXor(ballot, 2); -} - -#extension GL_KHR_shader_subgroup_quad: enable -void quad_works(vec4 f4) -{ - subgroupQuadBroadcast(f4, 0); - subgroupQuadSwapHorizontal(f4); - subgroupQuadSwapVertical(f4); - subgroupQuadSwapDiagonal(f4); -} - -#extension GL_NV_shader_subgroup_partitioned: enable -void partitioned_works(vec4 f4) -{ - uvec4 parti = subgroupPartitionNV(f4); - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupPartitionedAddNV(f4, parti); - subgroupPartitionedMulNV(f4, parti); - subgroupPartitionedMinNV(f4, parti); - subgroupPartitionedMaxNV(f4, parti); - subgroupPartitionedAndNV(ballot, parti); - subgroupPartitionedOrNV(ballot, parti); - subgroupPartitionedXorNV(ballot, parti); - subgroupPartitionedInclusiveAddNV(f4, parti); - subgroupPartitionedInclusiveMulNV(f4, parti); - subgroupPartitionedInclusiveMinNV(f4, parti); - subgroupPartitionedInclusiveMaxNV(f4, parti); - subgroupPartitionedInclusiveAndNV(ballot, parti); - subgroupPartitionedInclusiveOrNV(ballot, parti); - subgroupPartitionedInclusiveXorNV(ballot, parti); - subgroupPartitionedExclusiveAddNV(f4, parti); - subgroupPartitionedExclusiveMulNV(f4, parti); - subgroupPartitionedExclusiveMinNV(f4, parti); - subgroupPartitionedExclusiveMaxNV(f4, parti); - subgroupPartitionedExclusiveAndNV(ballot, parti); - subgroupPartitionedExclusiveOrNV(ballot, parti); - subgroupPartitionedExclusiveXorNV(ballot, parti); -} - -// tests for NV_shader_sm_builtins -void sm_builtins_err() -{ - gl_WarpsPerSMNV; // ERROR, no extension - gl_SMCountNV; // ERROR, no extension - gl_WarpIDNV; // ERROR, no extension - gl_SMIDNV; // ERROR, no extension -} - -#ifdef GL_NV_shader_sm_builtins -#extension GL_NV_shader_sm_builtins : enable -#endif - -void sm_builtins() -{ - gl_WarpsPerSMNV; - gl_SMCountNV; - gl_WarpIDNV; - gl_SMIDNV; -} +#version 450 + +vec4 undeclared_errors(vec4 f4) +{ + vec4 result; + gl_SubgroupSize; // ERROR, extension not enabled (basic) + gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) + subgroupBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) + subgroupElect(); // ERROR, extension not enabled (basic) + gl_NumSubgroups; // ERROR, only defined in compute + gl_SubgroupID; // ERROR, only defined in compute + subgroupMemoryBarrierShared(); // ERROR, only defined in compute + + subgroupAll(true); // ERROR extension not enabled (vote) + subgroupAny(false); // ERROR extension not enabled (vote) + subgroupAllEqual(f4); // ERROR extension not enabled (vote) + + gl_SubgroupEqMask; // ERROR extension not enabled (ballot) + gl_SubgroupGeMask; // ERROR extension not enabled (ballot) + gl_SubgroupGtMask; // ERROR extension not enabled (ballot) + gl_SubgroupLeMask; // ERROR extension not enabled (ballot) + gl_SubgroupLtMask; // ERROR extension not enabled (ballot) + subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) + subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) + uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) + subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) + subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) + subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) + + subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) + subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) + subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) + subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) + + result = subgroupAdd(f4); // ERROR, extension not enabled (arith) + subgroupMul(f4); // ERROR, extension not enabled (arith) + subgroupMin(f4); // ERROR, extension not enabled (arith) + subgroupMax(f4); // ERROR, extension not enabled (arith) + subgroupAnd(ballot); // ERROR, extension not enabled (arith) + subgroupOr(ballot); // ERROR, extension not enabled (arith) + subgroupXor(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) + + subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) + + subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) + subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) + + uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + + return result; +} + +#extension GL_KHR_shader_subgroup_basic: enable +layout(isolines) in; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierImage(); + subgroupElect(); +} + +#extension GL_KHR_shader_subgroup_ballot: enable +void ballot_works(vec4 f4) { + gl_SubgroupEqMask; + gl_SubgroupGeMask; + gl_SubgroupGtMask; + gl_SubgroupLeMask; + gl_SubgroupLtMask; + subgroupBroadcast(f4, 0); + subgroupBroadcastFirst(f4); + uvec4 ballot = subgroupBallot(false); + subgroupInverseBallot(uvec4(0x1)); + subgroupBallotBitExtract(ballot, 0); + subgroupBallotBitCount(ballot); + subgroupBallotInclusiveBitCount(ballot); + subgroupBallotExclusiveBitCount(ballot); + subgroupBallotFindLSB(ballot); + subgroupBallotFindMSB(ballot); +} + +#extension GL_KHR_shader_subgroup_vote: enable +void vote_works(vec4 f4) +{ + subgroupAll(true); + subgroupAny(false); + subgroupAllEqual(f4); +} + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +void shuffle_works(vec4 f4) +{ + subgroupShuffle(f4, 0); + subgroupShuffleXor(f4, 0x1); + subgroupShuffleUp(f4, 1); + subgroupShuffleDown(f4, 1); +} + +#extension GL_KHR_shader_subgroup_arithmetic: enable +void arith_works(vec4 f4) +{ + uvec4 ballot; + subgroupAdd(f4); + subgroupMul(f4); + subgroupMin(f4); + subgroupMax(f4); + subgroupAnd(ballot); + subgroupOr(ballot); + subgroupXor(ballot); + subgroupInclusiveAdd(f4); + subgroupInclusiveMul(f4); + subgroupInclusiveMin(f4); + subgroupInclusiveMax(f4); + subgroupInclusiveAnd(ballot); + subgroupInclusiveOr(ballot); + subgroupInclusiveXor(ballot); + subgroupExclusiveAdd(f4); + subgroupExclusiveMul(f4); + subgroupExclusiveMin(f4); + subgroupExclusiveMax(f4); + subgroupExclusiveAnd(ballot); + subgroupExclusiveOr(ballot); + subgroupExclusiveXor(ballot); +} + +#extension GL_KHR_shader_subgroup_clustered: enable +void clustered_works(vec4 f4) +{ + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupClusteredAdd(f4, 2); + subgroupClusteredMul(f4, 2); + subgroupClusteredMin(f4, 2); + subgroupClusteredMax(f4, 2); + subgroupClusteredAnd(ballot, 2); + subgroupClusteredOr(ballot, 2); + subgroupClusteredXor(ballot, 2); +} + +#extension GL_KHR_shader_subgroup_quad: enable +void quad_works(vec4 f4) +{ + subgroupQuadBroadcast(f4, 0); + subgroupQuadSwapHorizontal(f4); + subgroupQuadSwapVertical(f4); + subgroupQuadSwapDiagonal(f4); +} + +#extension GL_NV_shader_subgroup_partitioned: enable +void partitioned_works(vec4 f4) +{ + uvec4 parti = subgroupPartitionNV(f4); + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupPartitionedAddNV(f4, parti); + subgroupPartitionedMulNV(f4, parti); + subgroupPartitionedMinNV(f4, parti); + subgroupPartitionedMaxNV(f4, parti); + subgroupPartitionedAndNV(ballot, parti); + subgroupPartitionedOrNV(ballot, parti); + subgroupPartitionedXorNV(ballot, parti); + subgroupPartitionedInclusiveAddNV(f4, parti); + subgroupPartitionedInclusiveMulNV(f4, parti); + subgroupPartitionedInclusiveMinNV(f4, parti); + subgroupPartitionedInclusiveMaxNV(f4, parti); + subgroupPartitionedInclusiveAndNV(ballot, parti); + subgroupPartitionedInclusiveOrNV(ballot, parti); + subgroupPartitionedInclusiveXorNV(ballot, parti); + subgroupPartitionedExclusiveAddNV(f4, parti); + subgroupPartitionedExclusiveMulNV(f4, parti); + subgroupPartitionedExclusiveMinNV(f4, parti); + subgroupPartitionedExclusiveMaxNV(f4, parti); + subgroupPartitionedExclusiveAndNV(ballot, parti); + subgroupPartitionedExclusiveOrNV(ballot, parti); + subgroupPartitionedExclusiveXorNV(ballot, parti); +} + +// tests for NV_shader_sm_builtins +void sm_builtins_err() +{ + gl_WarpsPerSMNV; // ERROR, no extension + gl_SMCountNV; // ERROR, no extension + gl_WarpIDNV; // ERROR, no extension + gl_SMIDNV; // ERROR, no extension +} + +#ifdef GL_NV_shader_sm_builtins +#extension GL_NV_shader_sm_builtins : enable +#endif + +void sm_builtins() +{ + gl_WarpsPerSMNV; + gl_SMCountNV; + gl_WarpIDNV; + gl_SMIDNV; +} diff --git a/core/deps/glslang/Test/glsl.450.subgroup.vert b/core/deps/glslang/Test/glsl.450.subgroup.vert index 46af7f096..110b1d0da 100644 --- a/core/deps/glslang/Test/glsl.450.subgroup.vert +++ b/core/deps/glslang/Test/glsl.450.subgroup.vert @@ -1,253 +1,253 @@ -#version 450 - -vec4 undeclared_errors(vec4 f4) -{ - vec4 result; - gl_SubgroupSize; // ERROR, extension not enabled (basic) - gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) - subgroupBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) - subgroupElect(); // ERROR, extension not enabled (basic) - gl_NumSubgroups; // ERROR, only defined in compute - gl_SubgroupID; // ERROR, only defined in compute - subgroupMemoryBarrierShared(); // ERROR, only defined in compute - - subgroupAll(true); // ERROR extension not enabled (vote) - subgroupAny(false); // ERROR extension not enabled (vote) - subgroupAllEqual(f4); // ERROR extension not enabled (vote) - - gl_SubgroupEqMask; // ERROR extension not enabled (ballot) - gl_SubgroupGeMask; // ERROR extension not enabled (ballot) - gl_SubgroupGtMask; // ERROR extension not enabled (ballot) - gl_SubgroupLeMask; // ERROR extension not enabled (ballot) - gl_SubgroupLtMask; // ERROR extension not enabled (ballot) - subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) - subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) - uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) - subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) - subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) - subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) - - subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) - subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) - subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) - subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) - - result = subgroupAdd(f4); // ERROR, extension not enabled (arith) - subgroupMul(f4); // ERROR, extension not enabled (arith) - subgroupMin(f4); // ERROR, extension not enabled (arith) - subgroupMax(f4); // ERROR, extension not enabled (arith) - subgroupAnd(ballot); // ERROR, extension not enabled (arith) - subgroupOr(ballot); // ERROR, extension not enabled (arith) - subgroupXor(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) - - subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) - - subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) - subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) - - uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - - return result; -} - -#extension GL_KHR_shader_subgroup_basic: enable -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_VertexID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierImage(); - subgroupElect(); -} - -#extension GL_KHR_shader_subgroup_ballot: enable -void ballot_works(vec4 f4) { - gl_SubgroupEqMask; - gl_SubgroupGeMask; - gl_SubgroupGtMask; - gl_SubgroupLeMask; - gl_SubgroupLtMask; - subgroupBroadcast(f4, 0); - subgroupBroadcastFirst(f4); - uvec4 ballot = subgroupBallot(false); - subgroupInverseBallot(uvec4(0x1)); - subgroupBallotBitExtract(ballot, 0); - subgroupBallotBitCount(ballot); - subgroupBallotInclusiveBitCount(ballot); - subgroupBallotExclusiveBitCount(ballot); - subgroupBallotFindLSB(ballot); - subgroupBallotFindMSB(ballot); -} - -#extension GL_KHR_shader_subgroup_vote: enable -void vote_works(vec4 f4) -{ - subgroupAll(true); - subgroupAny(false); - subgroupAllEqual(f4); -} - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -void shuffle_works(vec4 f4) -{ - subgroupShuffle(f4, 0); - subgroupShuffleXor(f4, 0x1); - subgroupShuffleUp(f4, 1); - subgroupShuffleDown(f4, 1); -} - -#extension GL_KHR_shader_subgroup_arithmetic: enable -void arith_works(vec4 f4) -{ - uvec4 ballot; - subgroupAdd(f4); - subgroupMul(f4); - subgroupMin(f4); - subgroupMax(f4); - subgroupAnd(ballot); - subgroupOr(ballot); - subgroupXor(ballot); - subgroupInclusiveAdd(f4); - subgroupInclusiveMul(f4); - subgroupInclusiveMin(f4); - subgroupInclusiveMax(f4); - subgroupInclusiveAnd(ballot); - subgroupInclusiveOr(ballot); - subgroupInclusiveXor(ballot); - subgroupExclusiveAdd(f4); - subgroupExclusiveMul(f4); - subgroupExclusiveMin(f4); - subgroupExclusiveMax(f4); - subgroupExclusiveAnd(ballot); - subgroupExclusiveOr(ballot); - subgroupExclusiveXor(ballot); -} - -#extension GL_KHR_shader_subgroup_clustered: enable -void clustered_works(vec4 f4) -{ - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupClusteredAdd(f4, 2); - subgroupClusteredMul(f4, 2); - subgroupClusteredMin(f4, 2); - subgroupClusteredMax(f4, 2); - subgroupClusteredAnd(ballot, 2); - subgroupClusteredOr(ballot, 2); - subgroupClusteredXor(ballot, 2); -} - -#extension GL_KHR_shader_subgroup_quad: enable -void quad_works(vec4 f4) -{ - subgroupQuadBroadcast(f4, 0); - subgroupQuadSwapHorizontal(f4); - subgroupQuadSwapVertical(f4); - subgroupQuadSwapDiagonal(f4); -} - -#extension GL_NV_shader_subgroup_partitioned: enable -void partitioned_works(vec4 f4) -{ - uvec4 parti = subgroupPartitionNV(f4); - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupPartitionedAddNV(f4, parti); - subgroupPartitionedMulNV(f4, parti); - subgroupPartitionedMinNV(f4, parti); - subgroupPartitionedMaxNV(f4, parti); - subgroupPartitionedAndNV(ballot, parti); - subgroupPartitionedOrNV(ballot, parti); - subgroupPartitionedXorNV(ballot, parti); - subgroupPartitionedInclusiveAddNV(f4, parti); - subgroupPartitionedInclusiveMulNV(f4, parti); - subgroupPartitionedInclusiveMinNV(f4, parti); - subgroupPartitionedInclusiveMaxNV(f4, parti); - subgroupPartitionedInclusiveAndNV(ballot, parti); - subgroupPartitionedInclusiveOrNV(ballot, parti); - subgroupPartitionedInclusiveXorNV(ballot, parti); - subgroupPartitionedExclusiveAddNV(f4, parti); - subgroupPartitionedExclusiveMulNV(f4, parti); - subgroupPartitionedExclusiveMinNV(f4, parti); - subgroupPartitionedExclusiveMaxNV(f4, parti); - subgroupPartitionedExclusiveAndNV(ballot, parti); - subgroupPartitionedExclusiveOrNV(ballot, parti); - subgroupPartitionedExclusiveXorNV(ballot, parti); -} - -// tests for NV_shader_sm_builtins -void sm_builtins_err() -{ - gl_WarpsPerSMNV; // ERROR, no extension - gl_SMCountNV; // ERROR, no extension - gl_WarpIDNV; // ERROR, no extension - gl_SMIDNV; // ERROR, no extension -} - -#ifdef GL_NV_shader_sm_builtins -#extension GL_NV_shader_sm_builtins : enable -#endif - -void sm_builtins() -{ - gl_WarpsPerSMNV; - gl_SMCountNV; - gl_WarpIDNV; - gl_SMIDNV; -} - +#version 450 + +vec4 undeclared_errors(vec4 f4) +{ + vec4 result; + gl_SubgroupSize; // ERROR, extension not enabled (basic) + gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) + subgroupBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) + subgroupElect(); // ERROR, extension not enabled (basic) + gl_NumSubgroups; // ERROR, only defined in compute + gl_SubgroupID; // ERROR, only defined in compute + subgroupMemoryBarrierShared(); // ERROR, only defined in compute + + subgroupAll(true); // ERROR extension not enabled (vote) + subgroupAny(false); // ERROR extension not enabled (vote) + subgroupAllEqual(f4); // ERROR extension not enabled (vote) + + gl_SubgroupEqMask; // ERROR extension not enabled (ballot) + gl_SubgroupGeMask; // ERROR extension not enabled (ballot) + gl_SubgroupGtMask; // ERROR extension not enabled (ballot) + gl_SubgroupLeMask; // ERROR extension not enabled (ballot) + gl_SubgroupLtMask; // ERROR extension not enabled (ballot) + subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) + subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) + uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) + subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) + subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) + subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) + + subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) + subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) + subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) + subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) + + result = subgroupAdd(f4); // ERROR, extension not enabled (arith) + subgroupMul(f4); // ERROR, extension not enabled (arith) + subgroupMin(f4); // ERROR, extension not enabled (arith) + subgroupMax(f4); // ERROR, extension not enabled (arith) + subgroupAnd(ballot); // ERROR, extension not enabled (arith) + subgroupOr(ballot); // ERROR, extension not enabled (arith) + subgroupXor(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) + + subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) + + subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) + subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) + + uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + + return result; +} + +#extension GL_KHR_shader_subgroup_basic: enable +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_VertexID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierImage(); + subgroupElect(); +} + +#extension GL_KHR_shader_subgroup_ballot: enable +void ballot_works(vec4 f4) { + gl_SubgroupEqMask; + gl_SubgroupGeMask; + gl_SubgroupGtMask; + gl_SubgroupLeMask; + gl_SubgroupLtMask; + subgroupBroadcast(f4, 0); + subgroupBroadcastFirst(f4); + uvec4 ballot = subgroupBallot(false); + subgroupInverseBallot(uvec4(0x1)); + subgroupBallotBitExtract(ballot, 0); + subgroupBallotBitCount(ballot); + subgroupBallotInclusiveBitCount(ballot); + subgroupBallotExclusiveBitCount(ballot); + subgroupBallotFindLSB(ballot); + subgroupBallotFindMSB(ballot); +} + +#extension GL_KHR_shader_subgroup_vote: enable +void vote_works(vec4 f4) +{ + subgroupAll(true); + subgroupAny(false); + subgroupAllEqual(f4); +} + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +void shuffle_works(vec4 f4) +{ + subgroupShuffle(f4, 0); + subgroupShuffleXor(f4, 0x1); + subgroupShuffleUp(f4, 1); + subgroupShuffleDown(f4, 1); +} + +#extension GL_KHR_shader_subgroup_arithmetic: enable +void arith_works(vec4 f4) +{ + uvec4 ballot; + subgroupAdd(f4); + subgroupMul(f4); + subgroupMin(f4); + subgroupMax(f4); + subgroupAnd(ballot); + subgroupOr(ballot); + subgroupXor(ballot); + subgroupInclusiveAdd(f4); + subgroupInclusiveMul(f4); + subgroupInclusiveMin(f4); + subgroupInclusiveMax(f4); + subgroupInclusiveAnd(ballot); + subgroupInclusiveOr(ballot); + subgroupInclusiveXor(ballot); + subgroupExclusiveAdd(f4); + subgroupExclusiveMul(f4); + subgroupExclusiveMin(f4); + subgroupExclusiveMax(f4); + subgroupExclusiveAnd(ballot); + subgroupExclusiveOr(ballot); + subgroupExclusiveXor(ballot); +} + +#extension GL_KHR_shader_subgroup_clustered: enable +void clustered_works(vec4 f4) +{ + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupClusteredAdd(f4, 2); + subgroupClusteredMul(f4, 2); + subgroupClusteredMin(f4, 2); + subgroupClusteredMax(f4, 2); + subgroupClusteredAnd(ballot, 2); + subgroupClusteredOr(ballot, 2); + subgroupClusteredXor(ballot, 2); +} + +#extension GL_KHR_shader_subgroup_quad: enable +void quad_works(vec4 f4) +{ + subgroupQuadBroadcast(f4, 0); + subgroupQuadSwapHorizontal(f4); + subgroupQuadSwapVertical(f4); + subgroupQuadSwapDiagonal(f4); +} + +#extension GL_NV_shader_subgroup_partitioned: enable +void partitioned_works(vec4 f4) +{ + uvec4 parti = subgroupPartitionNV(f4); + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupPartitionedAddNV(f4, parti); + subgroupPartitionedMulNV(f4, parti); + subgroupPartitionedMinNV(f4, parti); + subgroupPartitionedMaxNV(f4, parti); + subgroupPartitionedAndNV(ballot, parti); + subgroupPartitionedOrNV(ballot, parti); + subgroupPartitionedXorNV(ballot, parti); + subgroupPartitionedInclusiveAddNV(f4, parti); + subgroupPartitionedInclusiveMulNV(f4, parti); + subgroupPartitionedInclusiveMinNV(f4, parti); + subgroupPartitionedInclusiveMaxNV(f4, parti); + subgroupPartitionedInclusiveAndNV(ballot, parti); + subgroupPartitionedInclusiveOrNV(ballot, parti); + subgroupPartitionedInclusiveXorNV(ballot, parti); + subgroupPartitionedExclusiveAddNV(f4, parti); + subgroupPartitionedExclusiveMulNV(f4, parti); + subgroupPartitionedExclusiveMinNV(f4, parti); + subgroupPartitionedExclusiveMaxNV(f4, parti); + subgroupPartitionedExclusiveAndNV(ballot, parti); + subgroupPartitionedExclusiveOrNV(ballot, parti); + subgroupPartitionedExclusiveXorNV(ballot, parti); +} + +// tests for NV_shader_sm_builtins +void sm_builtins_err() +{ + gl_WarpsPerSMNV; // ERROR, no extension + gl_SMCountNV; // ERROR, no extension + gl_WarpIDNV; // ERROR, no extension + gl_SMIDNV; // ERROR, no extension +} + +#ifdef GL_NV_shader_sm_builtins +#extension GL_NV_shader_sm_builtins : enable +#endif + +void sm_builtins() +{ + gl_WarpsPerSMNV; + gl_SMCountNV; + gl_WarpIDNV; + gl_SMIDNV; +} + diff --git a/core/deps/glslang/Test/glsl.450.subgroupArithmetic.comp b/core/deps/glslang/Test/glsl.450.subgroupArithmetic.comp index c17a2592f..6cc9337b6 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupArithmetic.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupArithmetic.comp @@ -1,393 +1,393 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_arithmetic: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupAdd(data[3].f4); - - data[invocation].i4.x = subgroupAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupAdd(data[3].i4); - - data[invocation].u4.x = subgroupAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupAdd(data[3].u4); - - data[invocation].d4.x = subgroupAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupAdd(data[3].d4); - - data[invocation].f4.x = subgroupMul(data[0].f4.x); - data[invocation].f4.xy = subgroupMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); - data[invocation].f4 = subgroupMul(data[3].f4); - - data[invocation].i4.x = subgroupMul(data[0].i4.x); - data[invocation].i4.xy = subgroupMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); - data[invocation].i4 = subgroupMul(data[3].i4); - - data[invocation].u4.x = subgroupMul(data[0].u4.x); - data[invocation].u4.xy = subgroupMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); - data[invocation].u4 = subgroupMul(data[3].u4); - - data[invocation].d4.x = subgroupMul(data[0].d4.x); - data[invocation].d4.xy = subgroupMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); - data[invocation].d4 = subgroupMul(data[3].d4); - - data[invocation].f4.x = subgroupMin(data[0].f4.x); - data[invocation].f4.xy = subgroupMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); - data[invocation].f4 = subgroupMin(data[3].f4); - - data[invocation].i4.x = subgroupMin(data[0].i4.x); - data[invocation].i4.xy = subgroupMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); - data[invocation].i4 = subgroupMin(data[3].i4); - - data[invocation].u4.x = subgroupMin(data[0].u4.x); - data[invocation].u4.xy = subgroupMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); - data[invocation].u4 = subgroupMin(data[3].u4); - - data[invocation].d4.x = subgroupMin(data[0].d4.x); - data[invocation].d4.xy = subgroupMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); - data[invocation].d4 = subgroupMin(data[3].d4); - - data[invocation].f4.x = subgroupMax(data[0].f4.x); - data[invocation].f4.xy = subgroupMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); - data[invocation].f4 = subgroupMax(data[3].f4); - - data[invocation].i4.x = subgroupMax(data[0].i4.x); - data[invocation].i4.xy = subgroupMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); - data[invocation].i4 = subgroupMax(data[3].i4); - - data[invocation].u4.x = subgroupMax(data[0].u4.x); - data[invocation].u4.xy = subgroupMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); - data[invocation].u4 = subgroupMax(data[3].u4); - - data[invocation].d4.x = subgroupMax(data[0].d4.x); - data[invocation].d4.xy = subgroupMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); - data[invocation].d4 = subgroupMax(data[3].d4); - - data[invocation].i4.x = subgroupAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupAnd(data[3].i4); - - data[invocation].u4.x = subgroupAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupOr(data[0].i4.x); - data[invocation].i4.xy = subgroupOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); - data[invocation].i4 = subgroupOr(data[3].i4); - - data[invocation].u4.x = subgroupOr(data[0].u4.x); - data[invocation].u4.xy = subgroupOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); - data[invocation].u4 = subgroupOr(data[3].u4); - - data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupXor(data[0].i4.x); - data[invocation].i4.xy = subgroupXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); - data[invocation].i4 = subgroupXor(data[3].i4); - - data[invocation].u4.x = subgroupXor(data[0].u4.x); - data[invocation].u4.xy = subgroupXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); - data[invocation].u4 = subgroupXor(data[3].u4); - - data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMul(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMul(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMul(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMul(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMin(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMin(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMin(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMin(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMax(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMax(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMax(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMax(data[3].d4); - - data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveOr(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveOr(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveXor(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveXor(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMul(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMul(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMul(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMul(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMin(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMin(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMin(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMin(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMax(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMax(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMax(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMax(data[3].d4); - - data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveOr(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveOr(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveXor(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveXor(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); -} +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupBallot.comp b/core/deps/glslang/Test/glsl.450.subgroupBallot.comp index 94e099dc4..bb9dc3e4d 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupBallot.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupBallot.comp @@ -1,86 +1,86 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 relMask = gl_SubgroupEqMask + - gl_SubgroupGeMask + - gl_SubgroupGtMask + - gl_SubgroupLeMask + - gl_SubgroupLtMask; - - uvec4 result = subgroupBallot(true); - - data[invocation].u4.x = subgroupBallotBitCount(result); - data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; - data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); - data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); - - if ((relMask == result) && subgroupInverseBallot(data[0].u4)) - { - data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, 3); - data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, 3); - data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3); - data[invocation].f4 = subgroupBroadcast(data[3].f4, 3); - - data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, 2); - data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, 2); - data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2); - data[invocation].i4 = subgroupBroadcast(data[3].i4, 2); - - data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupBroadcast(data[3].u4, 1); - - data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, 0); - data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, 0); - data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, 0); - data[invocation].d4 = subgroupBroadcast(data[3].d4, 0); - - data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); - } - else - { - data[invocation].f4.x = subgroupBroadcastFirst(data[0].f4.x); - data[invocation].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); - data[invocation].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); - data[invocation].f4 = subgroupBroadcastFirst(data[3].f4); - - data[invocation].i4.x = subgroupBroadcastFirst(data[0].i4.x); - data[invocation].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); - data[invocation].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); - data[invocation].i4 = subgroupBroadcastFirst(data[3].i4); - - data[invocation].u4.x = subgroupBroadcastFirst(data[0].u4.x); - data[invocation].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); - data[invocation].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); - data[invocation].u4 = subgroupBroadcastFirst(data[3].u4); - - data[invocation].d4.x = subgroupBroadcastFirst(data[0].d4.x); - data[invocation].d4.xy = subgroupBroadcastFirst(data[1].d4.xy); - data[invocation].d4.xyz = subgroupBroadcastFirst(data[2].d4.xyz); - data[invocation].d4 = subgroupBroadcastFirst(data[3].d4); - - data[invocation].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); - } -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + if ((relMask == result) && subgroupInverseBallot(data[0].u4)) + { + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, 3); + data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, 3); + data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3); + data[invocation].f4 = subgroupBroadcast(data[3].f4, 3); + + data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, 2); + data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, 2); + data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2); + data[invocation].i4 = subgroupBroadcast(data[3].i4, 2); + + data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, 0); + data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, 0); + data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, 0); + data[invocation].d4 = subgroupBroadcast(data[3].d4, 0); + + data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); + } + else + { + data[invocation].f4.x = subgroupBroadcastFirst(data[0].f4.x); + data[invocation].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); + data[invocation].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); + data[invocation].f4 = subgroupBroadcastFirst(data[3].f4); + + data[invocation].i4.x = subgroupBroadcastFirst(data[0].i4.x); + data[invocation].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); + data[invocation].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); + data[invocation].i4 = subgroupBroadcastFirst(data[3].i4); + + data[invocation].u4.x = subgroupBroadcastFirst(data[0].u4.x); + data[invocation].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); + data[invocation].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); + data[invocation].u4 = subgroupBroadcastFirst(data[3].u4); + + data[invocation].d4.x = subgroupBroadcastFirst(data[0].d4.x); + data[invocation].d4.xy = subgroupBroadcastFirst(data[1].d4.xy); + data[invocation].d4.xyz = subgroupBroadcastFirst(data[2].d4.xyz); + data[invocation].d4 = subgroupBroadcastFirst(data[3].d4); + + data[invocation].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); + } +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupBallotNeg.comp b/core/deps/glslang/Test/glsl.450.subgroupBallotNeg.comp index f6836e22a..4020adf11 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupBallotNeg.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupBallotNeg.comp @@ -1,33 +1,33 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 relMask = gl_SubgroupEqMask + - gl_SubgroupGeMask + - gl_SubgroupGtMask + - gl_SubgroupLeMask + - gl_SubgroupLtMask; - - uvec4 result = subgroupBallot(true); - - data[invocation].u4.x = subgroupBallotBitCount(result); - data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; - data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); - data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); - - data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupBasic.comp b/core/deps/glslang/Test/glsl.450.subgroupBasic.comp index 99b57f9d4..7b428789b 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupBasic.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupBasic.comp @@ -1,258 +1,258 @@ -#version 450 - -vec4 undeclared_errors(vec4 f4) -{ - vec4 result; - gl_SubgroupSize; // ERROR, extension not enabled (basic) - gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) - subgroupBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) - subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) - subgroupElect(); // ERROR, extension not enabled (basic) - gl_NumSubgroups; // ERROR, extension not enabled (basic) - gl_SubgroupID; // ERROR, extension not enabled (basic) - subgroupMemoryBarrierShared(); // ERROR, extension not enabled (basic) - - subgroupAll(true); // ERROR extension not enabled (vote) - subgroupAny(false); // ERROR extension not enabled (vote) - subgroupAllEqual(f4); // ERROR extension not enabled (vote) - - gl_SubgroupEqMask; // ERROR extension not enabled (ballot) - gl_SubgroupGeMask; // ERROR extension not enabled (ballot) - gl_SubgroupGtMask; // ERROR extension not enabled (ballot) - gl_SubgroupLeMask; // ERROR extension not enabled (ballot) - gl_SubgroupLtMask; // ERROR extension not enabled (ballot) - subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) - subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) - uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) - subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) - subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) - subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) - subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) - - subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) - subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) - subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) - subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) - - result = subgroupAdd(f4); // ERROR, extension not enabled (arith) - subgroupMul(f4); // ERROR, extension not enabled (arith) - subgroupMin(f4); // ERROR, extension not enabled (arith) - subgroupMax(f4); // ERROR, extension not enabled (arith) - subgroupAnd(ballot); // ERROR, extension not enabled (arith) - subgroupOr(ballot); // ERROR, extension not enabled (arith) - subgroupXor(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) - subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) - subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) - - subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) - subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) - - subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) - subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) - subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) - - uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) - subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) - - return result; -} - -#extension GL_KHR_shader_subgroup_basic: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffer -{ - int a[]; -} data; - -void main() -{ - data.a[gl_SubgroupSize] = 1; - data.a[gl_SubgroupInvocationID] = 1; - data.a[gl_NumSubgroups] = 1; - data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierShared(); - subgroupMemoryBarrierImage(); -} - -#extension GL_KHR_shader_subgroup_ballot: enable -void ballot_works(vec4 f4) { - gl_SubgroupEqMask; - gl_SubgroupGeMask; - gl_SubgroupGtMask; - gl_SubgroupLeMask; - gl_SubgroupLtMask; - subgroupBroadcast(f4, 0); - subgroupBroadcastFirst(f4); - uvec4 ballot = subgroupBallot(false); - subgroupInverseBallot(uvec4(0x1)); - subgroupBallotBitExtract(ballot, 0); - subgroupBallotBitCount(ballot); - subgroupBallotInclusiveBitCount(ballot); - subgroupBallotExclusiveBitCount(ballot); - subgroupBallotFindLSB(ballot); - subgroupBallotFindMSB(ballot); -} - -#extension GL_KHR_shader_subgroup_vote: enable -void vote_works(vec4 f4) -{ - subgroupAll(true); - subgroupAny(false); - subgroupAllEqual(f4); -} - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -void shuffle_works(vec4 f4) -{ - subgroupShuffle(f4, 0); - subgroupShuffleXor(f4, 0x1); - subgroupShuffleUp(f4, 1); - subgroupShuffleDown(f4, 1); -} - -#extension GL_KHR_shader_subgroup_arithmetic: enable -void arith_works(vec4 f4) -{ - uvec4 ballot; - subgroupAdd(f4); - subgroupMul(f4); - subgroupMin(f4); - subgroupMax(f4); - subgroupAnd(ballot); - subgroupOr(ballot); - subgroupXor(ballot); - subgroupInclusiveAdd(f4); - subgroupInclusiveMul(f4); - subgroupInclusiveMin(f4); - subgroupInclusiveMax(f4); - subgroupInclusiveAnd(ballot); - subgroupInclusiveOr(ballot); - subgroupInclusiveXor(ballot); - subgroupExclusiveAdd(f4); - subgroupExclusiveMul(f4); - subgroupExclusiveMin(f4); - subgroupExclusiveMax(f4); - subgroupExclusiveAnd(ballot); - subgroupExclusiveOr(ballot); - subgroupExclusiveXor(ballot); -} - -#extension GL_KHR_shader_subgroup_clustered: enable -void clustered_works(vec4 f4) -{ - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupClusteredAdd(f4, 2); - subgroupClusteredMul(f4, 2); - subgroupClusteredMin(f4, 2); - subgroupClusteredMax(f4, 2); - subgroupClusteredAnd(ballot, 2); - subgroupClusteredOr(ballot, 2); - subgroupClusteredXor(ballot, 2); -} - -#extension GL_KHR_shader_subgroup_quad: enable -void quad_works(vec4 f4) -{ - subgroupQuadBroadcast(f4, 0); - subgroupQuadSwapHorizontal(f4); - subgroupQuadSwapVertical(f4); - subgroupQuadSwapDiagonal(f4); -} - -#extension GL_NV_shader_subgroup_partitioned: enable -void partitioned_works(vec4 f4) -{ - uvec4 parti = subgroupPartitionNV(f4); - uvec4 ballot = uvec4(0x55,0,0,0); - subgroupPartitionedAddNV(f4, parti); - subgroupPartitionedMulNV(f4, parti); - subgroupPartitionedMinNV(f4, parti); - subgroupPartitionedMaxNV(f4, parti); - subgroupPartitionedAndNV(ballot, parti); - subgroupPartitionedOrNV(ballot, parti); - subgroupPartitionedXorNV(ballot, parti); - subgroupPartitionedInclusiveAddNV(f4, parti); - subgroupPartitionedInclusiveMulNV(f4, parti); - subgroupPartitionedInclusiveMinNV(f4, parti); - subgroupPartitionedInclusiveMaxNV(f4, parti); - subgroupPartitionedInclusiveAndNV(ballot, parti); - subgroupPartitionedInclusiveOrNV(ballot, parti); - subgroupPartitionedInclusiveXorNV(ballot, parti); - subgroupPartitionedExclusiveAddNV(f4, parti); - subgroupPartitionedExclusiveMulNV(f4, parti); - subgroupPartitionedExclusiveMinNV(f4, parti); - subgroupPartitionedExclusiveMaxNV(f4, parti); - subgroupPartitionedExclusiveAndNV(ballot, parti); - subgroupPartitionedExclusiveOrNV(ballot, parti); - subgroupPartitionedExclusiveXorNV(ballot, parti); -} - -// tests for NV_shader_sm_builtins -void sm_builtins_err() -{ - gl_WarpsPerSMNV; // ERROR, no extension - gl_SMCountNV; // ERROR, no extension - gl_WarpIDNV; // ERROR, no extension - gl_SMIDNV; // ERROR, no extension -} - -#ifdef GL_NV_shader_sm_builtins -#extension GL_NV_shader_sm_builtins : enable -#endif - -void sm_builtins() -{ - gl_WarpsPerSMNV; - gl_SMCountNV; - gl_WarpIDNV; - gl_SMIDNV; -} +#version 450 + +vec4 undeclared_errors(vec4 f4) +{ + vec4 result; + gl_SubgroupSize; // ERROR, extension not enabled (basic) + gl_SubgroupInvocationID; // ERROR, extension not enabled (basic) + subgroupBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrier(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierBuffer(); // ERROR, extension not enabled (basic) + subgroupMemoryBarrierImage(); // ERROR, extension not enabled (basic) + subgroupElect(); // ERROR, extension not enabled (basic) + gl_NumSubgroups; // ERROR, extension not enabled (basic) + gl_SubgroupID; // ERROR, extension not enabled (basic) + subgroupMemoryBarrierShared(); // ERROR, extension not enabled (basic) + + subgroupAll(true); // ERROR extension not enabled (vote) + subgroupAny(false); // ERROR extension not enabled (vote) + subgroupAllEqual(f4); // ERROR extension not enabled (vote) + + gl_SubgroupEqMask; // ERROR extension not enabled (ballot) + gl_SubgroupGeMask; // ERROR extension not enabled (ballot) + gl_SubgroupGtMask; // ERROR extension not enabled (ballot) + gl_SubgroupLeMask; // ERROR extension not enabled (ballot) + gl_SubgroupLtMask; // ERROR extension not enabled (ballot) + subgroupBroadcast(f4, 0); // ERROR extension not enabled (ballot) + subgroupBroadcastFirst(f4); // ERROR extension not enabled (ballot) + uvec4 ballot = subgroupBallot(false); // ERROR extension not enabled (ballot) + subgroupInverseBallot(uvec4(0x1)); // ERROR extension not enabled (ballot) + subgroupBallotBitExtract(ballot, 0); // ERROR extension not enabled (ballot) + subgroupBallotBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotInclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotExclusiveBitCount(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindLSB(ballot); // ERROR extension not enabled (ballot) + subgroupBallotFindMSB(ballot); // ERROR extension not enabled (ballot) + + subgroupShuffle(f4, 0); // ERROR extension not enabled (shuffle) + subgroupShuffleXor(f4, 0x1); // ERROR extension not enabled (shuffle) + subgroupShuffleUp(f4, 1); // ERROR extension not enabled (shuffle_relative) + subgroupShuffleDown(f4, 1); // ERROR extension not enabled (shuffle_relative) + + result = subgroupAdd(f4); // ERROR, extension not enabled (arith) + subgroupMul(f4); // ERROR, extension not enabled (arith) + subgroupMin(f4); // ERROR, extension not enabled (arith) + subgroupMax(f4); // ERROR, extension not enabled (arith) + subgroupAnd(ballot); // ERROR, extension not enabled (arith) + subgroupOr(ballot); // ERROR, extension not enabled (arith) + subgroupXor(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupInclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupInclusiveXor(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveAdd(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMul(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMin(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveMax(f4); // ERROR, extension not enabled (arith) + subgroupExclusiveAnd(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveOr(ballot); // ERROR, extension not enabled (arith) + subgroupExclusiveXor(ballot); // ERROR, extension not enabled (arith) + + subgroupClusteredAdd(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMul(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMin(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredMax(f4, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredAnd(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredOr(ballot, 2); // ERROR, extension not enabled (clustered) + subgroupClusteredXor(ballot, 2); // ERROR, extension not enabled (clustered) + + subgroupQuadBroadcast(f4, 0); // ERROR, extension not enabled (quad) + subgroupQuadSwapHorizontal(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapVertical(f4); // ERROR, extension not enabled (quad) + subgroupQuadSwapDiagonal(f4); // ERROR, extension not enabled (quad) + + uvec4 parti = subgroupPartitionNV(f4); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedInclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAddNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMulNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMinNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveMaxNV(f4, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveAndNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveOrNV(ballot, parti); // ERROR, extension not enabled (partitioned) + subgroupPartitionedExclusiveXorNV(ballot, parti); // ERROR, extension not enabled (partitioned) + + return result; +} + +#extension GL_KHR_shader_subgroup_basic: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffer +{ + int a[]; +} data; + +void main() +{ + data.a[gl_SubgroupSize] = 1; + data.a[gl_SubgroupInvocationID] = 1; + data.a[gl_NumSubgroups] = 1; + data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); +} + +#extension GL_KHR_shader_subgroup_ballot: enable +void ballot_works(vec4 f4) { + gl_SubgroupEqMask; + gl_SubgroupGeMask; + gl_SubgroupGtMask; + gl_SubgroupLeMask; + gl_SubgroupLtMask; + subgroupBroadcast(f4, 0); + subgroupBroadcastFirst(f4); + uvec4 ballot = subgroupBallot(false); + subgroupInverseBallot(uvec4(0x1)); + subgroupBallotBitExtract(ballot, 0); + subgroupBallotBitCount(ballot); + subgroupBallotInclusiveBitCount(ballot); + subgroupBallotExclusiveBitCount(ballot); + subgroupBallotFindLSB(ballot); + subgroupBallotFindMSB(ballot); +} + +#extension GL_KHR_shader_subgroup_vote: enable +void vote_works(vec4 f4) +{ + subgroupAll(true); + subgroupAny(false); + subgroupAllEqual(f4); +} + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +void shuffle_works(vec4 f4) +{ + subgroupShuffle(f4, 0); + subgroupShuffleXor(f4, 0x1); + subgroupShuffleUp(f4, 1); + subgroupShuffleDown(f4, 1); +} + +#extension GL_KHR_shader_subgroup_arithmetic: enable +void arith_works(vec4 f4) +{ + uvec4 ballot; + subgroupAdd(f4); + subgroupMul(f4); + subgroupMin(f4); + subgroupMax(f4); + subgroupAnd(ballot); + subgroupOr(ballot); + subgroupXor(ballot); + subgroupInclusiveAdd(f4); + subgroupInclusiveMul(f4); + subgroupInclusiveMin(f4); + subgroupInclusiveMax(f4); + subgroupInclusiveAnd(ballot); + subgroupInclusiveOr(ballot); + subgroupInclusiveXor(ballot); + subgroupExclusiveAdd(f4); + subgroupExclusiveMul(f4); + subgroupExclusiveMin(f4); + subgroupExclusiveMax(f4); + subgroupExclusiveAnd(ballot); + subgroupExclusiveOr(ballot); + subgroupExclusiveXor(ballot); +} + +#extension GL_KHR_shader_subgroup_clustered: enable +void clustered_works(vec4 f4) +{ + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupClusteredAdd(f4, 2); + subgroupClusteredMul(f4, 2); + subgroupClusteredMin(f4, 2); + subgroupClusteredMax(f4, 2); + subgroupClusteredAnd(ballot, 2); + subgroupClusteredOr(ballot, 2); + subgroupClusteredXor(ballot, 2); +} + +#extension GL_KHR_shader_subgroup_quad: enable +void quad_works(vec4 f4) +{ + subgroupQuadBroadcast(f4, 0); + subgroupQuadSwapHorizontal(f4); + subgroupQuadSwapVertical(f4); + subgroupQuadSwapDiagonal(f4); +} + +#extension GL_NV_shader_subgroup_partitioned: enable +void partitioned_works(vec4 f4) +{ + uvec4 parti = subgroupPartitionNV(f4); + uvec4 ballot = uvec4(0x55,0,0,0); + subgroupPartitionedAddNV(f4, parti); + subgroupPartitionedMulNV(f4, parti); + subgroupPartitionedMinNV(f4, parti); + subgroupPartitionedMaxNV(f4, parti); + subgroupPartitionedAndNV(ballot, parti); + subgroupPartitionedOrNV(ballot, parti); + subgroupPartitionedXorNV(ballot, parti); + subgroupPartitionedInclusiveAddNV(f4, parti); + subgroupPartitionedInclusiveMulNV(f4, parti); + subgroupPartitionedInclusiveMinNV(f4, parti); + subgroupPartitionedInclusiveMaxNV(f4, parti); + subgroupPartitionedInclusiveAndNV(ballot, parti); + subgroupPartitionedInclusiveOrNV(ballot, parti); + subgroupPartitionedInclusiveXorNV(ballot, parti); + subgroupPartitionedExclusiveAddNV(f4, parti); + subgroupPartitionedExclusiveMulNV(f4, parti); + subgroupPartitionedExclusiveMinNV(f4, parti); + subgroupPartitionedExclusiveMaxNV(f4, parti); + subgroupPartitionedExclusiveAndNV(ballot, parti); + subgroupPartitionedExclusiveOrNV(ballot, parti); + subgroupPartitionedExclusiveXorNV(ballot, parti); +} + +// tests for NV_shader_sm_builtins +void sm_builtins_err() +{ + gl_WarpsPerSMNV; // ERROR, no extension + gl_SMCountNV; // ERROR, no extension + gl_WarpIDNV; // ERROR, no extension + gl_SMIDNV; // ERROR, no extension +} + +#ifdef GL_NV_shader_sm_builtins +#extension GL_NV_shader_sm_builtins : enable +#endif + +void sm_builtins() +{ + gl_WarpsPerSMNV; + gl_SMCountNV; + gl_WarpIDNV; + gl_SMIDNV; +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupClustered.comp b/core/deps/glslang/Test/glsl.450.subgroupClustered.comp index dc63ed969..128a24c88 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupClustered.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupClustered.comp @@ -1,143 +1,143 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_clustered: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupClusteredAdd(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredAdd(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredAdd(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredAdd(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredAdd(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredAdd(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredAdd(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredAdd(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredAdd(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredAdd(data[3].d4, 1); - - data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredMul(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredMul(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredMul(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredMul(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredMul(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredMul(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredMul(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredMul(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredMul(data[3].d4, 1); - - data[invocation].f4.x = subgroupClusteredMin(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredMin(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredMin(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredMin(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredMin(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredMin(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredMin(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredMin(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredMin(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredMin(data[3].d4, 1); - - data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredMax(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredMax(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredMax(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredMax(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredMax(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredMax(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredMax(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredMax(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredMax(data[3].d4, 1); - - data[invocation].i4.x = subgroupClusteredAnd(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredAnd(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredAnd(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredAnd(data[3].u4, 1); - - data[invocation].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1)); - - data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredOr(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredOr(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredOr(data[3].u4, 1); - - data[invocation].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1)); - - data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredXor(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredXor(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredXor(data[3].u4, 1); - - data[invocation].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1)); -} +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupClusteredAdd(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredAdd(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredAdd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAdd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAdd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAdd(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredAdd(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredAdd(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredAdd(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredAdd(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMul(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMul(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMul(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMul(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMul(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMul(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMul(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMul(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMul(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMin(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMin(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMin(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMin(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMin(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMin(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMin(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMin(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMin(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMin(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMax(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMax(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMax(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMax(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMax(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMax(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMax(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMax(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMax(data[3].d4, 1); + + data[invocation].i4.x = subgroupClusteredAnd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAnd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAnd(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredOr(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredOr(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredOr(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredXor(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredXor(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredXor(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1)); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupClusteredNeg.comp b/core/deps/glslang/Test/glsl.450.subgroupClusteredNeg.comp index d6169c9b5..ec15413e3 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupClusteredNeg.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupClusteredNeg.comp @@ -1,39 +1,39 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_clustered: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - int a = 1; - const int aConst = 1; - - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1 - - data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2 - - data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8); - data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2 - - data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1 - - data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1 - - data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant - data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst); - - data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant - data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant - data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst); -} +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + int a = 1; + const int aConst = 1; + + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1 + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2 + + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2 + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1 + + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1 + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupPartitioned.comp b/core/deps/glslang/Test/glsl.450.subgroupPartitioned.comp index 88e247b93..604833e05 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupPartitioned.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupPartitioned.comp @@ -1,420 +1,420 @@ -#version 450 - -#extension GL_NV_shader_subgroup_partitioned: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 ballot = subgroupPartitionNV(invocation); - - data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].f4); - - data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].i4); - - data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].u4); - - data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].d4); - - data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); - data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); - data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); - data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); - - data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); -} +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupQuad.comp b/core/deps/glslang/Test/glsl.450.subgroupQuad.comp index f7b177f78..223a7cdac 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupQuad.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupQuad.comp @@ -1,118 +1,118 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_quad: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupQuadBroadcast(data[3].f4, 1); - - data[invocation].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupQuadBroadcast(data[3].i4, 1); - - data[invocation].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupQuadBroadcast(data[3].u4, 1); - - data[invocation].d4.x = subgroupQuadBroadcast(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupQuadBroadcast(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupQuadBroadcast(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupQuadBroadcast(data[3].d4, 1); - - data[invocation].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); - - data[invocation].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); - data[invocation].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); - data[invocation].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); - data[invocation].f4 = subgroupQuadSwapHorizontal(data[3].f4); - - data[invocation].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); - data[invocation].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); - data[invocation].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); - data[invocation].i4 = subgroupQuadSwapHorizontal(data[3].i4); - - data[invocation].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); - data[invocation].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); - data[invocation].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); - data[invocation].u4 = subgroupQuadSwapHorizontal(data[3].u4); - - data[invocation].d4.x = subgroupQuadSwapHorizontal(data[0].d4.x); - data[invocation].d4.xy = subgroupQuadSwapHorizontal(data[1].d4.xy); - data[invocation].d4.xyz = subgroupQuadSwapHorizontal(data[2].d4.xyz); - data[invocation].d4 = subgroupQuadSwapHorizontal(data[3].d4); - - data[invocation].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupQuadSwapVertical(data[0].f4.x); - data[invocation].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); - data[invocation].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); - data[invocation].f4 = subgroupQuadSwapVertical(data[3].f4); - - data[invocation].i4.x = subgroupQuadSwapVertical(data[0].i4.x); - data[invocation].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); - data[invocation].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); - data[invocation].i4 = subgroupQuadSwapVertical(data[3].i4); - - data[invocation].u4.x = subgroupQuadSwapVertical(data[0].u4.x); - data[invocation].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); - data[invocation].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); - data[invocation].u4 = subgroupQuadSwapVertical(data[3].u4); - - data[invocation].d4.x = subgroupQuadSwapVertical(data[0].d4.x); - data[invocation].d4.xy = subgroupQuadSwapVertical(data[1].d4.xy); - data[invocation].d4.xyz = subgroupQuadSwapVertical(data[2].d4.xyz); - data[invocation].d4 = subgroupQuadSwapVertical(data[3].d4); - - data[invocation].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); - data[invocation].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); - data[invocation].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); - data[invocation].f4 = subgroupQuadSwapDiagonal(data[3].f4); - - data[invocation].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); - data[invocation].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); - data[invocation].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); - data[invocation].i4 = subgroupQuadSwapDiagonal(data[3].i4); - - data[invocation].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); - data[invocation].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); - data[invocation].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); - data[invocation].u4 = subgroupQuadSwapDiagonal(data[3].u4); - - data[invocation].d4.x = subgroupQuadSwapDiagonal(data[0].d4.x); - data[invocation].d4.xy = subgroupQuadSwapDiagonal(data[1].d4.xy); - data[invocation].d4.xyz = subgroupQuadSwapDiagonal(data[2].d4.xyz); - data[invocation].d4 = subgroupQuadSwapDiagonal(data[3].d4); - - data[invocation].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); -} +#version 450 + +#extension GL_KHR_shader_subgroup_quad: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupQuadBroadcast(data[3].f4, 1); + + data[invocation].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupQuadBroadcast(data[3].i4, 1); + + data[invocation].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupQuadBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupQuadBroadcast(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupQuadBroadcast(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupQuadBroadcast(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupQuadBroadcast(data[3].d4, 1); + + data[invocation].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapHorizontal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapHorizontal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapHorizontal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapHorizontal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapHorizontal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapHorizontal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapHorizontal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapVertical(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapVertical(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapVertical(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapVertical(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapVertical(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapVertical(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapVertical(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapVertical(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapVertical(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapVertical(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapDiagonal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapDiagonal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapDiagonal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapDiagonal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapDiagonal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapDiagonal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapDiagonal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupShuffle.comp b/core/deps/glslang/Test/glsl.450.subgroupShuffle.comp index f48f4c514..6d264882a 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupShuffle.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupShuffle.comp @@ -1,68 +1,68 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupShuffle(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffle(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffle(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffle(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffle(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffle(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffle(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffle(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffle(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffle(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); - - data[invocation].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffleXor(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffleXor(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffleXor(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffleXor(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffleXor(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffleXor(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffleXor(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffle(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffle(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffle(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffle(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffle(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffle(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffle(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffle(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffle(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffle(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleXor(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleXor(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleXor(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleXor(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleXor(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleXor(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleXor(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupShuffleRelative.comp b/core/deps/glslang/Test/glsl.450.subgroupShuffleRelative.comp index 30c6e430e..1864de10a 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupShuffleRelative.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupShuffleRelative.comp @@ -1,68 +1,68 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle_relative: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffleUp(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffleUp(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffleUp(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffleUp(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffleUp(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffleUp(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffleUp(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); - - data[invocation].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffleDown(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffleDown(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffleDown(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffleDown(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffleDown(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffleDown(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffleDown(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleUp(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleUp(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleUp(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleUp(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleUp(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleUp(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleUp(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleDown(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleDown(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleDown(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleDown(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleDown(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleDown(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleDown(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/core/deps/glslang/Test/glsl.450.subgroupVote.comp b/core/deps/glslang/Test/glsl.450.subgroupVote.comp index 18348fd95..c1c877af3 100644 --- a/core/deps/glslang/Test/glsl.450.subgroupVote.comp +++ b/core/deps/glslang/Test/glsl.450.subgroupVote.comp @@ -1,49 +1,49 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_vote: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; - int r; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - if (subgroupAll(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].f4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].f4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].f4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].f4)); - - data[invocation].r = int(subgroupAllEqual(data[0].i4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i4)); - - data[invocation].r = int(subgroupAllEqual(data[0].u4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u4)); - } - else if (subgroupAny(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].d4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].d4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].d4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].d4)); - - data[invocation].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); - data[invocation].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); - data[invocation].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); - data[invocation].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); - } -} +#version 450 + +#extension GL_KHR_shader_subgroup_vote: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + if (subgroupAll(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].f4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].f4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].f4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].f4)); + + data[invocation].r = int(subgroupAllEqual(data[0].i4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i4)); + + data[invocation].r = int(subgroupAllEqual(data[0].u4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u4)); + } + else if (subgroupAny(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].d4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].d4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].d4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].d4)); + + data[invocation].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); + data[invocation].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); + data[invocation].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); + data[invocation].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); + } +} diff --git a/core/deps/glslang/Test/glsl.entryPointRename.vert b/core/deps/glslang/Test/glsl.entryPointRename.vert index d1e828a15..7fc6b7a1b 100644 --- a/core/deps/glslang/Test/glsl.entryPointRename.vert +++ b/core/deps/glslang/Test/glsl.entryPointRename.vert @@ -1,11 +1,11 @@ -#version 460 - -void bar() -{ - gl_Position = vec4(1); -} - -void main() -{ - gl_Position = vec4(1); -} +#version 460 + +void bar() +{ + gl_Position = vec4(1); +} + +void main() +{ + gl_Position = vec4(1); +} diff --git a/core/deps/glslang/Test/glsl.entryPointRename2.vert b/core/deps/glslang/Test/glsl.entryPointRename2.vert index cfa3f03c1..0473e9bc4 100644 --- a/core/deps/glslang/Test/glsl.entryPointRename2.vert +++ b/core/deps/glslang/Test/glsl.entryPointRename2.vert @@ -1,6 +1,6 @@ -#version 460 - -void bar() -{ - gl_Position = vec4(1); -} +#version 460 + +void bar() +{ + gl_Position = vec4(1); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroup.frag b/core/deps/glslang/Test/glsl.es320.subgroup.frag index f0b1eb9af..baf59fb1b 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroup.frag +++ b/core/deps/glslang/Test/glsl.es320.subgroup.frag @@ -1,7 +1,7 @@ -#version 320 es -#extension GL_KHR_shader_subgroup_basic: enable -layout(location = 0) out uvec4 data; -void main (void) -{ - data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 320 es +#extension GL_KHR_shader_subgroup_basic: enable +layout(location = 0) out uvec4 data; +void main (void) +{ + data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroup.geom b/core/deps/glslang/Test/glsl.es320.subgroup.geom index 9c9cb4998..d07151005 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroup.geom +++ b/core/deps/glslang/Test/glsl.es320.subgroup.geom @@ -1,13 +1,13 @@ -#version 320 es -#extension GL_KHR_shader_subgroup_basic: enable -layout(points) in; -layout(points, max_vertices = 1) out; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 320 es +#extension GL_KHR_shader_subgroup_basic: enable +layout(points) in; +layout(points, max_vertices = 1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroup.tesc b/core/deps/glslang/Test/glsl.es320.subgroup.tesc index 12a0f5124..c356d7ff9 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroup.tesc +++ b/core/deps/glslang/Test/glsl.es320.subgroup.tesc @@ -1,12 +1,12 @@ -#version 320 es -#extension GL_KHR_shader_subgroup_basic: enable -layout(vertices=1) out; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 320 es +#extension GL_KHR_shader_subgroup_basic: enable +layout(vertices=1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroup.tese b/core/deps/glslang/Test/glsl.es320.subgroup.tese index 0cedb0371..29a9748b1 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroup.tese +++ b/core/deps/glslang/Test/glsl.es320.subgroup.tese @@ -1,12 +1,12 @@ -#version 320 es -#extension GL_KHR_shader_subgroup_basic: enable -layout(isolines) in; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 320 es +#extension GL_KHR_shader_subgroup_basic: enable +layout(isolines) in; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroup.vert b/core/deps/glslang/Test/glsl.es320.subgroup.vert index 9c7271359..3d8bd9a88 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroup.vert +++ b/core/deps/glslang/Test/glsl.es320.subgroup.vert @@ -1,11 +1,11 @@ -#version 320 es -#extension GL_KHR_shader_subgroup_basic: enable -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_VertexID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 320 es +#extension GL_KHR_shader_subgroup_basic: enable +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_VertexID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupArithmetic.comp b/core/deps/glslang/Test/glsl.es320.subgroupArithmetic.comp index b5bf1afb7..4db7db35e 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupArithmetic.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupArithmetic.comp @@ -1,332 +1,332 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_arithmetic: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - data[0].f4.x = subgroupAdd(data[0].f4.x); - data[0].f4.xy = subgroupAdd(data[1].f4.xy); - data[0].f4.xyz = subgroupAdd(data[2].f4.xyz); - data[0].f4 = subgroupAdd(data[3].f4); - - data[1].i4.x = subgroupAdd(data[0].i4.x); - data[1].i4.xy = subgroupAdd(data[1].i4.xy); - data[1].i4.xyz = subgroupAdd(data[2].i4.xyz); - data[1].i4 = subgroupAdd(data[3].i4); - - data[2].u4.x = subgroupAdd(data[0].u4.x); - data[2].u4.xy = subgroupAdd(data[1].u4.xy); - data[2].u4.xyz = subgroupAdd(data[2].u4.xyz); - data[2].u4 = subgroupAdd(data[3].u4); - - data[3].f4.x = subgroupMul(data[0].f4.x); - data[3].f4.xy = subgroupMul(data[1].f4.xy); - data[3].f4.xyz = subgroupMul(data[2].f4.xyz); - data[3].f4 = subgroupMul(data[3].f4); - - data[0].i4.x = subgroupMul(data[0].i4.x); - data[0].i4.xy = subgroupMul(data[1].i4.xy); - data[0].i4.xyz = subgroupMul(data[2].i4.xyz); - data[0].i4 = subgroupMul(data[3].i4); - - data[1].u4.x = subgroupMul(data[0].u4.x); - data[1].u4.xy = subgroupMul(data[1].u4.xy); - data[1].u4.xyz = subgroupMul(data[2].u4.xyz); - data[1].u4 = subgroupMul(data[3].u4); - - data[2].f4.x = subgroupMin(data[0].f4.x); - data[2].f4.xy = subgroupMin(data[1].f4.xy); - data[2].f4.xyz = subgroupMin(data[2].f4.xyz); - data[2].f4 = subgroupMin(data[3].f4); - - data[3].i4.x = subgroupMin(data[0].i4.x); - data[3].i4.xy = subgroupMin(data[1].i4.xy); - data[3].i4.xyz = subgroupMin(data[2].i4.xyz); - data[3].i4 = subgroupMin(data[3].i4); - - data[0].u4.x = subgroupMin(data[0].u4.x); - data[0].u4.xy = subgroupMin(data[1].u4.xy); - data[0].u4.xyz = subgroupMin(data[2].u4.xyz); - data[0].u4 = subgroupMin(data[3].u4); - - data[1].f4.x = subgroupMax(data[0].f4.x); - data[1].f4.xy = subgroupMax(data[1].f4.xy); - data[1].f4.xyz = subgroupMax(data[2].f4.xyz); - data[1].f4 = subgroupMax(data[3].f4); - - data[2].i4.x = subgroupMax(data[0].i4.x); - data[2].i4.xy = subgroupMax(data[1].i4.xy); - data[2].i4.xyz = subgroupMax(data[2].i4.xyz); - data[2].i4 = subgroupMax(data[3].i4); - - data[3].u4.x = subgroupMax(data[0].u4.x); - data[3].u4.xy = subgroupMax(data[1].u4.xy); - data[3].u4.xyz = subgroupMax(data[2].u4.xyz); - data[3].u4 = subgroupMax(data[3].u4); - - data[0].i4.x = subgroupAnd(data[0].i4.x); - data[0].i4.xy = subgroupAnd(data[1].i4.xy); - data[0].i4.xyz = subgroupAnd(data[2].i4.xyz); - data[0].i4 = subgroupAnd(data[3].i4); - - data[1].u4.x = subgroupAnd(data[0].u4.x); - data[1].u4.xy = subgroupAnd(data[1].u4.xy); - data[1].u4.xyz = subgroupAnd(data[2].u4.xyz); - data[1].u4 = subgroupAnd(data[3].u4); - - data[2].i4.x = int(subgroupAnd(data[0].i4.x < 0)); - data[2].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[2].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[2].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); - - data[3].i4.x = subgroupOr(data[0].i4.x); - data[3].i4.xy = subgroupOr(data[1].i4.xy); - data[3].i4.xyz = subgroupOr(data[2].i4.xyz); - data[3].i4 = subgroupOr(data[3].i4); - - data[0].u4.x = subgroupOr(data[0].u4.x); - data[0].u4.xy = subgroupOr(data[1].u4.xy); - data[0].u4.xyz = subgroupOr(data[2].u4.xyz); - data[0].u4 = subgroupOr(data[3].u4); - - data[1].i4.x = int(subgroupOr(data[0].i4.x < 0)); - data[1].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[1].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[1].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); - - data[2].i4.x = subgroupXor(data[0].i4.x); - data[2].i4.xy = subgroupXor(data[1].i4.xy); - data[2].i4.xyz = subgroupXor(data[2].i4.xyz); - data[2].i4 = subgroupXor(data[3].i4); - - data[3].u4.x = subgroupXor(data[0].u4.x); - data[3].u4.xy = subgroupXor(data[1].u4.xy); - data[3].u4.xyz = subgroupXor(data[2].u4.xyz); - data[3].u4 = subgroupXor(data[3].u4); - - data[0].i4.x = int(subgroupXor(data[0].i4.x < 0)); - data[0].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[0].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[0].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); - - data[1].f4.x = subgroupInclusiveAdd(data[0].f4.x); - data[1].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); - data[1].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); - data[1].f4 = subgroupInclusiveAdd(data[3].f4); - - data[2].i4.x = subgroupInclusiveAdd(data[0].i4.x); - data[2].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); - data[2].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); - data[2].i4 = subgroupInclusiveAdd(data[3].i4); - - data[3].u4.x = subgroupInclusiveAdd(data[0].u4.x); - data[3].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); - data[3].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); - data[3].u4 = subgroupInclusiveAdd(data[3].u4); - - data[0].f4.x = subgroupInclusiveMul(data[0].f4.x); - data[0].f4.xy = subgroupInclusiveMul(data[1].f4.xy); - data[0].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); - data[0].f4 = subgroupInclusiveMul(data[3].f4); - - data[1].i4.x = subgroupInclusiveMul(data[0].i4.x); - data[1].i4.xy = subgroupInclusiveMul(data[1].i4.xy); - data[1].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); - data[1].i4 = subgroupInclusiveMul(data[3].i4); - - data[2].u4.x = subgroupInclusiveMul(data[0].u4.x); - data[2].u4.xy = subgroupInclusiveMul(data[1].u4.xy); - data[2].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); - data[2].u4 = subgroupInclusiveMul(data[3].u4); - - data[3].f4.x = subgroupInclusiveMin(data[0].f4.x); - data[3].f4.xy = subgroupInclusiveMin(data[1].f4.xy); - data[3].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); - data[3].f4 = subgroupInclusiveMin(data[3].f4); - - data[0].i4.x = subgroupInclusiveMin(data[0].i4.x); - data[0].i4.xy = subgroupInclusiveMin(data[1].i4.xy); - data[0].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); - data[0].i4 = subgroupInclusiveMin(data[3].i4); - - data[1].u4.x = subgroupInclusiveMin(data[0].u4.x); - data[1].u4.xy = subgroupInclusiveMin(data[1].u4.xy); - data[1].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); - data[1].u4 = subgroupInclusiveMin(data[3].u4); - - data[2].f4.x = subgroupInclusiveMax(data[0].f4.x); - data[2].f4.xy = subgroupInclusiveMax(data[1].f4.xy); - data[2].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); - data[2].f4 = subgroupInclusiveMax(data[3].f4); - - data[3].i4.x = subgroupInclusiveMax(data[0].i4.x); - data[3].i4.xy = subgroupInclusiveMax(data[1].i4.xy); - data[3].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); - data[3].i4 = subgroupInclusiveMax(data[3].i4); - - data[0].u4.x = subgroupInclusiveMax(data[0].u4.x); - data[0].u4.xy = subgroupInclusiveMax(data[1].u4.xy); - data[0].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); - data[0].u4 = subgroupInclusiveMax(data[3].u4); - - data[1].i4.x = subgroupInclusiveAnd(data[0].i4.x); - data[1].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); - data[1].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); - data[1].i4 = subgroupInclusiveAnd(data[3].i4); - - data[2].u4.x = subgroupInclusiveAnd(data[0].u4.x); - data[2].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); - data[2].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); - data[2].u4 = subgroupInclusiveAnd(data[3].u4); - - data[3].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); - data[3].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[3].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[3].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[0].i4.x = subgroupInclusiveOr(data[0].i4.x); - data[0].i4.xy = subgroupInclusiveOr(data[1].i4.xy); - data[0].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); - data[0].i4 = subgroupInclusiveOr(data[3].i4); - - data[1].u4.x = subgroupInclusiveOr(data[0].u4.x); - data[1].u4.xy = subgroupInclusiveOr(data[1].u4.xy); - data[1].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); - data[1].u4 = subgroupInclusiveOr(data[3].u4); - - data[2].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); - data[2].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[2].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[2].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[3].i4.x = subgroupInclusiveXor(data[0].i4.x); - data[3].i4.xy = subgroupInclusiveXor(data[1].i4.xy); - data[3].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); - data[3].i4 = subgroupInclusiveXor(data[3].i4); - - data[0].u4.x = subgroupInclusiveXor(data[0].u4.x); - data[0].u4.xy = subgroupInclusiveXor(data[1].u4.xy); - data[0].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); - data[0].u4 = subgroupInclusiveXor(data[3].u4); - - data[1].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); - data[1].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[1].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[1].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); - - data[2].f4.x = subgroupExclusiveAdd(data[0].f4.x); - data[2].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); - data[2].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); - data[2].f4 = subgroupExclusiveAdd(data[3].f4); - - data[3].i4.x = subgroupExclusiveAdd(data[0].i4.x); - data[3].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); - data[3].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); - data[3].i4 = subgroupExclusiveAdd(data[3].i4); - - data[0].u4.x = subgroupExclusiveAdd(data[0].u4.x); - data[0].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); - data[0].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); - data[0].u4 = subgroupExclusiveAdd(data[3].u4); - - data[1].f4.x = subgroupExclusiveMul(data[0].f4.x); - data[1].f4.xy = subgroupExclusiveMul(data[1].f4.xy); - data[1].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); - data[1].f4 = subgroupExclusiveMul(data[3].f4); - - data[2].i4.x = subgroupExclusiveMul(data[0].i4.x); - data[2].i4.xy = subgroupExclusiveMul(data[1].i4.xy); - data[2].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); - data[2].i4 = subgroupExclusiveMul(data[3].i4); - - data[3].u4.x = subgroupExclusiveMul(data[0].u4.x); - data[3].u4.xy = subgroupExclusiveMul(data[1].u4.xy); - data[3].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); - data[3].u4 = subgroupExclusiveMul(data[3].u4); - - data[0].f4.x = subgroupExclusiveMin(data[0].f4.x); - data[0].f4.xy = subgroupExclusiveMin(data[1].f4.xy); - data[0].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); - data[0].f4 = subgroupExclusiveMin(data[3].f4); - - data[1].i4.x = subgroupExclusiveMin(data[0].i4.x); - data[1].i4.xy = subgroupExclusiveMin(data[1].i4.xy); - data[1].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); - data[1].i4 = subgroupExclusiveMin(data[3].i4); - - data[2].u4.x = subgroupExclusiveMin(data[0].u4.x); - data[2].u4.xy = subgroupExclusiveMin(data[1].u4.xy); - data[2].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); - data[2].u4 = subgroupExclusiveMin(data[3].u4); - - data[3].f4.x = subgroupExclusiveMax(data[0].f4.x); - data[3].f4.xy = subgroupExclusiveMax(data[1].f4.xy); - data[3].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); - data[3].f4 = subgroupExclusiveMax(data[3].f4); - - data[0].i4.x = subgroupExclusiveMax(data[0].i4.x); - data[0].i4.xy = subgroupExclusiveMax(data[1].i4.xy); - data[0].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); - data[0].i4 = subgroupExclusiveMax(data[3].i4); - - data[1].u4.x = subgroupExclusiveMax(data[0].u4.x); - data[1].u4.xy = subgroupExclusiveMax(data[1].u4.xy); - data[1].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); - data[1].u4 = subgroupExclusiveMax(data[3].u4); - - data[2].i4.x = subgroupExclusiveAnd(data[0].i4.x); - data[2].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); - data[2].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); - data[2].i4 = subgroupExclusiveAnd(data[3].i4); - - data[3].u4.x = subgroupExclusiveAnd(data[0].u4.x); - data[3].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); - data[3].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); - data[3].u4 = subgroupExclusiveAnd(data[3].u4); - - data[0].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); - data[0].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[0].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[0].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[1].i4.x = subgroupExclusiveOr(data[0].i4.x); - data[1].i4.xy = subgroupExclusiveOr(data[1].i4.xy); - data[1].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); - data[1].i4 = subgroupExclusiveOr(data[3].i4); - - data[2].u4.x = subgroupExclusiveOr(data[0].u4.x); - data[2].u4.xy = subgroupExclusiveOr(data[1].u4.xy); - data[2].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); - data[2].u4 = subgroupExclusiveOr(data[3].u4); - - data[3].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); - data[3].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[3].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[3].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[0].i4.x = subgroupExclusiveXor(data[0].i4.x); - data[0].i4.xy = subgroupExclusiveXor(data[1].i4.xy); - data[0].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); - data[0].i4 = subgroupExclusiveXor(data[3].i4); - - data[1].u4.x = subgroupExclusiveXor(data[0].u4.x); - data[1].u4.xy = subgroupExclusiveXor(data[1].u4.xy); - data[1].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); - data[1].u4 = subgroupExclusiveXor(data[3].u4); - - data[2].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); - data[2].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[2].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[2].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + data[0].f4.x = subgroupAdd(data[0].f4.x); + data[0].f4.xy = subgroupAdd(data[1].f4.xy); + data[0].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[0].f4 = subgroupAdd(data[3].f4); + + data[1].i4.x = subgroupAdd(data[0].i4.x); + data[1].i4.xy = subgroupAdd(data[1].i4.xy); + data[1].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[1].i4 = subgroupAdd(data[3].i4); + + data[2].u4.x = subgroupAdd(data[0].u4.x); + data[2].u4.xy = subgroupAdd(data[1].u4.xy); + data[2].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[2].u4 = subgroupAdd(data[3].u4); + + data[3].f4.x = subgroupMul(data[0].f4.x); + data[3].f4.xy = subgroupMul(data[1].f4.xy); + data[3].f4.xyz = subgroupMul(data[2].f4.xyz); + data[3].f4 = subgroupMul(data[3].f4); + + data[0].i4.x = subgroupMul(data[0].i4.x); + data[0].i4.xy = subgroupMul(data[1].i4.xy); + data[0].i4.xyz = subgroupMul(data[2].i4.xyz); + data[0].i4 = subgroupMul(data[3].i4); + + data[1].u4.x = subgroupMul(data[0].u4.x); + data[1].u4.xy = subgroupMul(data[1].u4.xy); + data[1].u4.xyz = subgroupMul(data[2].u4.xyz); + data[1].u4 = subgroupMul(data[3].u4); + + data[2].f4.x = subgroupMin(data[0].f4.x); + data[2].f4.xy = subgroupMin(data[1].f4.xy); + data[2].f4.xyz = subgroupMin(data[2].f4.xyz); + data[2].f4 = subgroupMin(data[3].f4); + + data[3].i4.x = subgroupMin(data[0].i4.x); + data[3].i4.xy = subgroupMin(data[1].i4.xy); + data[3].i4.xyz = subgroupMin(data[2].i4.xyz); + data[3].i4 = subgroupMin(data[3].i4); + + data[0].u4.x = subgroupMin(data[0].u4.x); + data[0].u4.xy = subgroupMin(data[1].u4.xy); + data[0].u4.xyz = subgroupMin(data[2].u4.xyz); + data[0].u4 = subgroupMin(data[3].u4); + + data[1].f4.x = subgroupMax(data[0].f4.x); + data[1].f4.xy = subgroupMax(data[1].f4.xy); + data[1].f4.xyz = subgroupMax(data[2].f4.xyz); + data[1].f4 = subgroupMax(data[3].f4); + + data[2].i4.x = subgroupMax(data[0].i4.x); + data[2].i4.xy = subgroupMax(data[1].i4.xy); + data[2].i4.xyz = subgroupMax(data[2].i4.xyz); + data[2].i4 = subgroupMax(data[3].i4); + + data[3].u4.x = subgroupMax(data[0].u4.x); + data[3].u4.xy = subgroupMax(data[1].u4.xy); + data[3].u4.xyz = subgroupMax(data[2].u4.xyz); + data[3].u4 = subgroupMax(data[3].u4); + + data[0].i4.x = subgroupAnd(data[0].i4.x); + data[0].i4.xy = subgroupAnd(data[1].i4.xy); + data[0].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[0].i4 = subgroupAnd(data[3].i4); + + data[1].u4.x = subgroupAnd(data[0].u4.x); + data[1].u4.xy = subgroupAnd(data[1].u4.xy); + data[1].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[1].u4 = subgroupAnd(data[3].u4); + + data[2].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[2].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[2].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[2].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[3].i4.x = subgroupOr(data[0].i4.x); + data[3].i4.xy = subgroupOr(data[1].i4.xy); + data[3].i4.xyz = subgroupOr(data[2].i4.xyz); + data[3].i4 = subgroupOr(data[3].i4); + + data[0].u4.x = subgroupOr(data[0].u4.x); + data[0].u4.xy = subgroupOr(data[1].u4.xy); + data[0].u4.xyz = subgroupOr(data[2].u4.xyz); + data[0].u4 = subgroupOr(data[3].u4); + + data[1].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[1].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[1].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[1].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[2].i4.x = subgroupXor(data[0].i4.x); + data[2].i4.xy = subgroupXor(data[1].i4.xy); + data[2].i4.xyz = subgroupXor(data[2].i4.xyz); + data[2].i4 = subgroupXor(data[3].i4); + + data[3].u4.x = subgroupXor(data[0].u4.x); + data[3].u4.xy = subgroupXor(data[1].u4.xy); + data[3].u4.xyz = subgroupXor(data[2].u4.xyz); + data[3].u4 = subgroupXor(data[3].u4); + + data[0].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[0].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[0].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[0].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[1].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[1].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[1].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[1].f4 = subgroupInclusiveAdd(data[3].f4); + + data[2].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[2].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[2].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[2].i4 = subgroupInclusiveAdd(data[3].i4); + + data[3].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[3].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[3].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[3].u4 = subgroupInclusiveAdd(data[3].u4); + + data[0].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[0].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[0].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[0].f4 = subgroupInclusiveMul(data[3].f4); + + data[1].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[1].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[1].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[1].i4 = subgroupInclusiveMul(data[3].i4); + + data[2].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[2].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[2].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[2].u4 = subgroupInclusiveMul(data[3].u4); + + data[3].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[3].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[3].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[3].f4 = subgroupInclusiveMin(data[3].f4); + + data[0].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[0].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[0].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[0].i4 = subgroupInclusiveMin(data[3].i4); + + data[1].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[1].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[1].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[1].u4 = subgroupInclusiveMin(data[3].u4); + + data[2].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[2].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[2].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[2].f4 = subgroupInclusiveMax(data[3].f4); + + data[3].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[3].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[3].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[3].i4 = subgroupInclusiveMax(data[3].i4); + + data[0].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[0].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[0].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[0].u4 = subgroupInclusiveMax(data[3].u4); + + data[1].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[1].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[1].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[1].i4 = subgroupInclusiveAnd(data[3].i4); + + data[2].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[2].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[2].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[2].u4 = subgroupInclusiveAnd(data[3].u4); + + data[3].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[3].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[3].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[3].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[0].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[0].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[0].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[0].i4 = subgroupInclusiveOr(data[3].i4); + + data[1].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[1].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[1].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[1].u4 = subgroupInclusiveOr(data[3].u4); + + data[2].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[2].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[2].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[2].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[3].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[3].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[3].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[3].i4 = subgroupInclusiveXor(data[3].i4); + + data[0].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[0].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[0].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[0].u4 = subgroupInclusiveXor(data[3].u4); + + data[1].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[1].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[1].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[1].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[2].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[2].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[2].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[2].f4 = subgroupExclusiveAdd(data[3].f4); + + data[3].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[3].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[3].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[3].i4 = subgroupExclusiveAdd(data[3].i4); + + data[0].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[0].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[0].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[0].u4 = subgroupExclusiveAdd(data[3].u4); + + data[1].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[1].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[1].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[1].f4 = subgroupExclusiveMul(data[3].f4); + + data[2].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[2].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[2].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[2].i4 = subgroupExclusiveMul(data[3].i4); + + data[3].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[3].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[3].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[3].u4 = subgroupExclusiveMul(data[3].u4); + + data[0].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[0].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[0].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[0].f4 = subgroupExclusiveMin(data[3].f4); + + data[1].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[1].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[1].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[1].i4 = subgroupExclusiveMin(data[3].i4); + + data[2].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[2].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[2].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[2].u4 = subgroupExclusiveMin(data[3].u4); + + data[3].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[3].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[3].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[3].f4 = subgroupExclusiveMax(data[3].f4); + + data[0].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[0].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[0].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[0].i4 = subgroupExclusiveMax(data[3].i4); + + data[1].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[1].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[1].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[1].u4 = subgroupExclusiveMax(data[3].u4); + + data[2].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[2].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[2].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[2].i4 = subgroupExclusiveAnd(data[3].i4); + + data[3].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[3].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[3].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[3].u4 = subgroupExclusiveAnd(data[3].u4); + + data[0].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[0].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[0].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[0].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[1].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[1].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[1].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[1].i4 = subgroupExclusiveOr(data[3].i4); + + data[2].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[2].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[2].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[2].u4 = subgroupExclusiveOr(data[3].u4); + + data[3].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[3].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[3].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[3].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[0].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[0].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[0].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[0].i4 = subgroupExclusiveXor(data[3].i4); + + data[1].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[1].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[1].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[1].u4 = subgroupExclusiveXor(data[3].u4); + + data[2].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[2].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[2].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[2].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupBallot.comp b/core/deps/glslang/Test/glsl.es320.subgroupBallot.comp index 57b9df919..1764c2357 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupBallot.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupBallot.comp @@ -1,75 +1,75 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - uvec4 relMask = gl_SubgroupEqMask + - gl_SubgroupGeMask + - gl_SubgroupGtMask + - gl_SubgroupLeMask + - gl_SubgroupLtMask; - - uvec4 result = subgroupBallot(true); - - data[0].u4.x = subgroupBallotBitCount(result); - data[0].u4.y = subgroupBallotBitExtract(result, 0u) ? 1u : 0u; - data[0].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); - data[0].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); - - if ((relMask == result) && subgroupInverseBallot(data[0].u4)) - { - data[1].f4.x = subgroupBroadcast(data[0].f4.x, 3u); - data[1].f4.xy = subgroupBroadcast(data[1].f4.xy, 3u); - data[1].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3u); - data[1].f4 = subgroupBroadcast(data[3].f4, 3u); - - data[2].i4.x = subgroupBroadcast(data[0].i4.x, 2u); - data[2].i4.xy = subgroupBroadcast(data[1].i4.xy, 2u); - data[2].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2u); - data[2].i4 = subgroupBroadcast(data[3].i4, 2u); - - data[3].u4.x = subgroupBroadcast(data[0].u4.x, 1u); - data[3].u4.xy = subgroupBroadcast(data[1].u4.xy, 1u); - data[3].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1u); - data[3].u4 = subgroupBroadcast(data[3].u4, 1u); - - data[0].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1u)); - data[0].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1u)); - data[0].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); - data[0].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1u)); - } - else - { - data[1].f4.x = subgroupBroadcastFirst(data[0].f4.x); - data[1].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); - data[1].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); - data[1].f4 = subgroupBroadcastFirst(data[3].f4); - - data[2].i4.x = subgroupBroadcastFirst(data[0].i4.x); - data[2].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); - data[2].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); - data[2].i4 = subgroupBroadcastFirst(data[3].i4); - - data[3].u4.x = subgroupBroadcastFirst(data[0].u4.x); - data[3].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); - data[3].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); - data[3].u4 = subgroupBroadcastFirst(data[3].u4); - - data[0].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); - data[0].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); - data[0].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); - data[0].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); - } -} +#version 320 es + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[0].u4.x = subgroupBallotBitCount(result); + data[0].u4.y = subgroupBallotBitExtract(result, 0u) ? 1u : 0u; + data[0].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[0].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + if ((relMask == result) && subgroupInverseBallot(data[0].u4)) + { + data[1].f4.x = subgroupBroadcast(data[0].f4.x, 3u); + data[1].f4.xy = subgroupBroadcast(data[1].f4.xy, 3u); + data[1].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3u); + data[1].f4 = subgroupBroadcast(data[3].f4, 3u); + + data[2].i4.x = subgroupBroadcast(data[0].i4.x, 2u); + data[2].i4.xy = subgroupBroadcast(data[1].i4.xy, 2u); + data[2].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2u); + data[2].i4 = subgroupBroadcast(data[3].i4, 2u); + + data[3].u4.x = subgroupBroadcast(data[0].u4.x, 1u); + data[3].u4.xy = subgroupBroadcast(data[1].u4.xy, 1u); + data[3].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1u); + data[3].u4 = subgroupBroadcast(data[3].u4, 1u); + + data[0].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1u)); + data[0].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1u)); + data[0].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); + data[0].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1u)); + } + else + { + data[1].f4.x = subgroupBroadcastFirst(data[0].f4.x); + data[1].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); + data[1].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); + data[1].f4 = subgroupBroadcastFirst(data[3].f4); + + data[2].i4.x = subgroupBroadcastFirst(data[0].i4.x); + data[2].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); + data[2].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); + data[2].i4 = subgroupBroadcastFirst(data[3].i4); + + data[3].u4.x = subgroupBroadcastFirst(data[0].u4.x); + data[3].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); + data[3].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); + data[3].u4 = subgroupBroadcastFirst(data[3].u4); + + data[0].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); + data[0].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); + data[0].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); + data[0].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); + } +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupBallotNeg.comp b/core/deps/glslang/Test/glsl.es320.subgroupBallotNeg.comp index bab5fe3e2..80ee6f815 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupBallotNeg.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupBallotNeg.comp @@ -1,32 +1,32 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - uvec4 relMask = gl_SubgroupEqMask + - gl_SubgroupGeMask + - gl_SubgroupGtMask + - gl_SubgroupLeMask + - gl_SubgroupLtMask; - - uvec4 result = subgroupBallot(true); - - data[0].u4.x = subgroupBallotBitCount(result); - data[0].u4.y = subgroupBallotBitExtract(result, 0) ? 1u : 0u; - data[0].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); - data[0].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); - - data[1].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[0].u4.x = subgroupBallotBitCount(result); + data[0].u4.y = subgroupBallotBitExtract(result, 0) ? 1u : 0u; + data[0].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[0].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + data[1].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupBasic.comp b/core/deps/glslang/Test/glsl.es320.subgroupBasic.comp index 164a1422d..7dc7458c1 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupBasic.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupBasic.comp @@ -1,23 +1,23 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_basic: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffer -{ - int a[]; -} data; - -void main() -{ - data.a[gl_SubgroupSize] = 1; - data.a[gl_SubgroupInvocationID] = 1; - data.a[gl_NumSubgroups] = 1; - data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierShared(); - subgroupMemoryBarrierImage(); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_basic: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffer +{ + int a[]; +} data; + +void main() +{ + data.a[gl_SubgroupSize] = 1; + data.a[gl_SubgroupInvocationID] = 1; + data.a[gl_NumSubgroups] = 1; + data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupClustered.comp b/core/deps/glslang/Test/glsl.es320.subgroupClustered.comp index 428b3a672..61764e562 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupClustered.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupClustered.comp @@ -1,122 +1,122 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_clustered: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - data[0].f4.x = subgroupClusteredAdd(data[0].f4.x, 1u); - data[0].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1u); - data[0].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1u); - data[0].f4 = subgroupClusteredAdd(data[3].f4, 1u); - - data[1].i4.x = subgroupClusteredAdd(data[0].i4.x, 1u); - data[1].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1u); - data[1].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1u); - data[1].i4 = subgroupClusteredAdd(data[3].i4, 1u); - - data[2].u4.x = subgroupClusteredAdd(data[0].u4.x, 1u); - data[2].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1u); - data[2].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1u); - data[2].u4 = subgroupClusteredAdd(data[3].u4, 1u); - - data[3].f4.x = subgroupClusteredMul(data[0].f4.x, 1u); - data[3].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1u); - data[3].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1u); - data[3].f4 = subgroupClusteredMul(data[3].f4, 1u); - - data[0].i4.x = subgroupClusteredMul(data[0].i4.x, 1u); - data[0].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1u); - data[0].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1u); - data[0].i4 = subgroupClusteredMul(data[3].i4, 1u); - - data[1].u4.x = subgroupClusteredMul(data[0].u4.x, 1u); - data[1].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1u); - data[1].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1u); - data[1].u4 = subgroupClusteredMul(data[3].u4, 1u); - - data[2].f4.x = subgroupClusteredMin(data[0].f4.x, 1u); - data[2].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1u); - data[2].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1u); - data[2].f4 = subgroupClusteredMin(data[3].f4, 1u); - - data[3].i4.x = subgroupClusteredMin(data[0].i4.x, 1u); - data[3].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1u); - data[3].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1u); - data[3].i4 = subgroupClusteredMin(data[3].i4, 1u); - - data[0].u4.x = subgroupClusteredMin(data[0].u4.x, 1u); - data[0].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1u); - data[0].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1u); - data[0].u4 = subgroupClusteredMin(data[3].u4, 1u); - - data[1].f4.x = subgroupClusteredMax(data[0].f4.x, 1u); - data[1].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1u); - data[1].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1u); - data[1].f4 = subgroupClusteredMax(data[3].f4, 1u); - - data[2].i4.x = subgroupClusteredMax(data[0].i4.x, 1u); - data[2].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1u); - data[2].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1u); - data[2].i4 = subgroupClusteredMax(data[3].i4, 1u); - - data[3].u4.x = subgroupClusteredMax(data[0].u4.x, 1u); - data[3].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1u); - data[3].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1u); - data[3].u4 = subgroupClusteredMax(data[3].u4, 1u); - - data[0].i4.x = subgroupClusteredAnd(data[0].i4.x, 1u); - data[0].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1u); - data[0].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1u); - data[0].i4 = subgroupClusteredAnd(data[3].i4, 1u); - - data[1].u4.x = subgroupClusteredAnd(data[0].u4.x, 1u); - data[1].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1u); - data[1].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1u); - data[1].u4 = subgroupClusteredAnd(data[3].u4, 1u); - - data[2].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1u)); - data[2].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1u)); - data[2].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); - data[2].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1u)); - - data[3].i4.x = subgroupClusteredOr(data[0].i4.x, 1u); - data[3].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1u); - data[3].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1u); - data[3].i4 = subgroupClusteredOr(data[3].i4, 1u); - - data[0].u4.x = subgroupClusteredOr(data[0].u4.x, 1u); - data[0].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1u); - data[0].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1u); - data[0].u4 = subgroupClusteredOr(data[3].u4, 1u); - - data[1].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1u)); - data[1].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1u)); - data[1].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); - data[1].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1u)); - - data[2].i4.x = subgroupClusteredXor(data[0].i4.x, 1u); - data[2].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1u); - data[2].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1u); - data[2].i4 = subgroupClusteredXor(data[3].i4, 1u); - - data[3].u4.x = subgroupClusteredXor(data[0].u4.x, 1u); - data[3].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1u); - data[3].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1u); - data[3].u4 = subgroupClusteredXor(data[3].u4, 1u); - - data[0].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1u)); - data[0].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1u)); - data[0].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); - data[0].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1u)); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + data[0].f4.x = subgroupClusteredAdd(data[0].f4.x, 1u); + data[0].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1u); + data[0].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1u); + data[0].f4 = subgroupClusteredAdd(data[3].f4, 1u); + + data[1].i4.x = subgroupClusteredAdd(data[0].i4.x, 1u); + data[1].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1u); + data[1].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1u); + data[1].i4 = subgroupClusteredAdd(data[3].i4, 1u); + + data[2].u4.x = subgroupClusteredAdd(data[0].u4.x, 1u); + data[2].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1u); + data[2].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1u); + data[2].u4 = subgroupClusteredAdd(data[3].u4, 1u); + + data[3].f4.x = subgroupClusteredMul(data[0].f4.x, 1u); + data[3].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1u); + data[3].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1u); + data[3].f4 = subgroupClusteredMul(data[3].f4, 1u); + + data[0].i4.x = subgroupClusteredMul(data[0].i4.x, 1u); + data[0].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1u); + data[0].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1u); + data[0].i4 = subgroupClusteredMul(data[3].i4, 1u); + + data[1].u4.x = subgroupClusteredMul(data[0].u4.x, 1u); + data[1].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1u); + data[1].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1u); + data[1].u4 = subgroupClusteredMul(data[3].u4, 1u); + + data[2].f4.x = subgroupClusteredMin(data[0].f4.x, 1u); + data[2].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1u); + data[2].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1u); + data[2].f4 = subgroupClusteredMin(data[3].f4, 1u); + + data[3].i4.x = subgroupClusteredMin(data[0].i4.x, 1u); + data[3].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1u); + data[3].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1u); + data[3].i4 = subgroupClusteredMin(data[3].i4, 1u); + + data[0].u4.x = subgroupClusteredMin(data[0].u4.x, 1u); + data[0].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1u); + data[0].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1u); + data[0].u4 = subgroupClusteredMin(data[3].u4, 1u); + + data[1].f4.x = subgroupClusteredMax(data[0].f4.x, 1u); + data[1].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1u); + data[1].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1u); + data[1].f4 = subgroupClusteredMax(data[3].f4, 1u); + + data[2].i4.x = subgroupClusteredMax(data[0].i4.x, 1u); + data[2].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1u); + data[2].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1u); + data[2].i4 = subgroupClusteredMax(data[3].i4, 1u); + + data[3].u4.x = subgroupClusteredMax(data[0].u4.x, 1u); + data[3].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1u); + data[3].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1u); + data[3].u4 = subgroupClusteredMax(data[3].u4, 1u); + + data[0].i4.x = subgroupClusteredAnd(data[0].i4.x, 1u); + data[0].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1u); + data[0].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1u); + data[0].i4 = subgroupClusteredAnd(data[3].i4, 1u); + + data[1].u4.x = subgroupClusteredAnd(data[0].u4.x, 1u); + data[1].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1u); + data[1].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1u); + data[1].u4 = subgroupClusteredAnd(data[3].u4, 1u); + + data[2].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1u)); + data[2].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1u)); + data[2].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); + data[2].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1u)); + + data[3].i4.x = subgroupClusteredOr(data[0].i4.x, 1u); + data[3].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1u); + data[3].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1u); + data[3].i4 = subgroupClusteredOr(data[3].i4, 1u); + + data[0].u4.x = subgroupClusteredOr(data[0].u4.x, 1u); + data[0].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1u); + data[0].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1u); + data[0].u4 = subgroupClusteredOr(data[3].u4, 1u); + + data[1].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1u)); + data[1].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1u)); + data[1].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); + data[1].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1u)); + + data[2].i4.x = subgroupClusteredXor(data[0].i4.x, 1u); + data[2].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1u); + data[2].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1u); + data[2].i4 = subgroupClusteredXor(data[3].i4, 1u); + + data[3].u4.x = subgroupClusteredXor(data[0].u4.x, 1u); + data[3].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1u); + data[3].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1u); + data[3].u4 = subgroupClusteredXor(data[3].u4, 1u); + + data[0].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1u)); + data[0].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1u)); + data[0].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); + data[0].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1u)); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupClusteredNeg.comp b/core/deps/glslang/Test/glsl.es320.subgroupClusteredNeg.comp index eb33385b3..0eb50d828 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupClusteredNeg.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupClusteredNeg.comp @@ -1,34 +1,34 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_clustered: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - int a = 1; - const int aConst = 1; - - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - data[0].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0u); // ERROR, less than 1 - - data[0].f4.x = subgroupClusteredMul(data[0].f4.x, 3u); // ERROR, not a power of 2 - - data[1].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8u); - data[1].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6u); // ERROR, not a power of 2 - - data[3].i4.x = subgroupClusteredOr(data[0].i4.x, uint(a)); // ERROR, not constant - data[3].i4.xy = subgroupClusteredOr(data[1].i4.xy, uint(aConst)); - - data[0].i4.x = subgroupClusteredXor(data[0].i4.x, uint(1 + a)); // ERROR, not constant - data[0].i4.xy = subgroupClusteredXor(data[1].i4.xy, uint(aConst + a)); // ERROR, not constant - data[0].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, uint(1 + aConst)); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + int a = 1; + const int aConst = 1; + + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + data[0].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0u); // ERROR, less than 1 + + data[0].f4.x = subgroupClusteredMul(data[0].f4.x, 3u); // ERROR, not a power of 2 + + data[1].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8u); + data[1].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6u); // ERROR, not a power of 2 + + data[3].i4.x = subgroupClusteredOr(data[0].i4.x, uint(a)); // ERROR, not constant + data[3].i4.xy = subgroupClusteredOr(data[1].i4.xy, uint(aConst)); + + data[0].i4.x = subgroupClusteredXor(data[0].i4.x, uint(1 + a)); // ERROR, not constant + data[0].i4.xy = subgroupClusteredXor(data[1].i4.xy, uint(aConst + a)); // ERROR, not constant + data[0].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, uint(1 + aConst)); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupPartitioned.comp b/core/deps/glslang/Test/glsl.es320.subgroupPartitioned.comp index 4f770caa0..15f13a0e8 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupPartitioned.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupPartitioned.comp @@ -1,354 +1,354 @@ -#version 320 es - -#extension GL_NV_shader_subgroup_partitioned: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - uvec4 ballot = subgroupPartitionNV(invocation); - - data[0].u4 = subgroupPartitionNV(data[0].f4.x); - data[0].u4 = subgroupPartitionNV(data[0].f4.xy); - data[0].u4 = subgroupPartitionNV(data[0].f4.xyz); - data[0].u4 = subgroupPartitionNV(data[0].f4); - - data[0].u4 = subgroupPartitionNV(data[0].i4.x); - data[0].u4 = subgroupPartitionNV(data[0].i4.xy); - data[0].u4 = subgroupPartitionNV(data[0].i4.xyz); - data[0].u4 = subgroupPartitionNV(data[0].i4); - - data[0].u4 = subgroupPartitionNV(data[0].u4.x); - data[0].u4 = subgroupPartitionNV(data[0].u4.xy); - data[0].u4 = subgroupPartitionNV(data[0].u4.xyz); - data[0].u4 = subgroupPartitionNV(data[0].u4); - - data[1].u4 = subgroupPartitionNV(bool(data[0].i4.x)); - data[1].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); - data[1].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); - data[1].u4 = subgroupPartitionNV(bvec4(data[0].i4)); - - data[1].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); - data[1].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); - data[1].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); - data[1].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); - - data[1].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); - data[1].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); - data[1].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); - data[1].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); - - data[1].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); - data[1].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); - data[1].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); - data[1].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); - - data[2].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); - data[2].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); - data[2].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); - data[2].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); - - data[2].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); - data[2].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); - data[2].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); - data[2].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); - - data[2].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); - data[2].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); - data[2].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); - data[2].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); - - data[3].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); - data[3].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); - data[3].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); - data[3].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); - - data[3].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); - data[3].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); - data[3].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); - data[3].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); - - data[3].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); - data[3].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); - data[3].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); - data[3].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); - - data[0].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); - data[0].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); - data[0].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); - data[0].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); - - data[0].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); - data[0].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); - data[0].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); - data[0].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); - - data[0].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); - data[0].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); - data[0].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); - data[0].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); - - data[1].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); - data[1].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); - data[1].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); - data[1].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); - - data[1].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); - data[1].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[1].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[1].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[1].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); - data[1].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); - data[1].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); - data[1].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); - - data[2].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); - data[2].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[2].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[2].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[2].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); - data[2].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); - data[2].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); - data[2].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); - - data[3].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); - data[3].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[3].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[3].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[3].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); - data[3].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); - data[3].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); - data[3].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); - - data[3].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); - data[3].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); - data[3].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); - data[3].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); - - data[3].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); - data[3].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); - data[3].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); - data[3].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); - - data[3].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); - data[3].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); - data[3].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); - data[3].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); - - data[3].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); - data[3].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); - data[3].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); - data[3].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); - - data[0].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); - data[0].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); - data[0].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); - data[0].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); - - data[0].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); - data[0].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); - data[0].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); - data[0].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); - - data[0].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); - data[0].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); - data[0].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); - data[0].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); - - data[0].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); - data[0].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); - data[0].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); - data[0].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); - - data[1].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); - data[1].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); - data[1].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); - data[1].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); - - data[1].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); - data[1].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); - data[1].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); - data[1].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); - - data[1].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); - data[1].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); - data[1].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); - data[1].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); - - data[1].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); - data[1].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); - data[1].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); - data[1].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); - - data[2].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); - data[2].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[2].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[2].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[2].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); - data[2].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); - data[2].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); - data[2].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); - - data[3].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); - data[3].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[3].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[3].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[3].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); - data[3].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); - data[3].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); - data[3].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); - - data[3].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); - data[3].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); - data[3].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); - data[3].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); - - data[3].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); - data[3].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[3].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[3].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[0].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); - data[0].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); - data[0].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); - data[0].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); - - data[0].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); - data[0].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); - data[0].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); - data[0].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); - - data[0].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); - data[0].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); - data[0].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); - data[0].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); - - data[0].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); - data[0].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); - data[0].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); - data[0].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); - - data[1].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); - data[1].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); - data[1].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); - data[1].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); - - data[1].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); - data[1].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); - data[1].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); - data[1].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); - - data[1].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); - data[1].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); - data[1].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); - data[1].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); - - data[1].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); - data[1].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); - data[1].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); - data[1].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); - - data[2].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); - data[2].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); - data[2].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); - data[2].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); - - data[2].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); - data[2].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); - data[2].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); - data[2].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); - - data[2].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); - data[2].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); - data[2].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); - data[2].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); - - data[2].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); - data[2].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); - data[2].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); - data[2].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); - - data[3].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); - data[3].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[3].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[3].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[3].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); - data[3].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); - data[3].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); - data[3].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); - - data[3].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); - data[3].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); - data[3].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); - data[3].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); - - data[3].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); - data[3].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[3].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[3].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[3].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); - data[3].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); - data[3].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); - data[3].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); - - data[0].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); - data[0].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); - data[0].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); - data[0].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); - - data[0].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); - data[0].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[0].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[0].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); -} +#version 320 es + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[0].u4 = subgroupPartitionNV(data[0].f4.x); + data[0].u4 = subgroupPartitionNV(data[0].f4.xy); + data[0].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[0].u4 = subgroupPartitionNV(data[0].f4); + + data[0].u4 = subgroupPartitionNV(data[0].i4.x); + data[0].u4 = subgroupPartitionNV(data[0].i4.xy); + data[0].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[0].u4 = subgroupPartitionNV(data[0].i4); + + data[0].u4 = subgroupPartitionNV(data[0].u4.x); + data[0].u4 = subgroupPartitionNV(data[0].u4.xy); + data[0].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[0].u4 = subgroupPartitionNV(data[0].u4); + + data[1].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[1].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[1].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[1].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[1].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[1].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[1].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[1].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[1].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[1].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[1].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[1].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[1].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[1].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[1].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[1].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[2].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[2].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[2].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[2].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[2].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[2].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[2].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[2].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[2].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[2].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[2].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[2].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[3].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[3].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[3].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[3].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[3].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[3].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[3].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[3].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[3].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[3].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[3].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[3].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[0].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[0].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[0].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[0].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[0].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[0].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[0].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[0].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[0].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[0].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[0].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[0].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[1].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[1].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[1].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[1].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[1].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[1].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[1].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[1].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[1].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[1].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[1].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[1].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[2].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[2].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[2].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[2].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[2].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[2].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[2].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[2].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[3].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[3].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[3].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[3].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[3].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[3].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[3].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[3].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[3].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[3].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[3].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[3].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[3].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[3].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[3].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[3].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[3].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[3].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[3].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[3].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[3].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[3].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[3].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[3].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[0].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[0].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[0].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[0].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[0].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[0].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[0].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[0].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[0].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[0].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[0].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[0].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[0].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[0].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[0].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[0].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[1].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[1].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[1].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[1].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[1].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[1].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[1].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[1].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[1].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[1].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[1].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[1].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[1].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[1].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[1].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[1].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[2].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[2].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[2].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[2].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[2].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[2].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[2].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[2].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[3].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[3].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[3].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[3].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[3].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[3].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[3].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[3].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[3].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[3].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[3].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[3].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[3].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[3].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[3].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[3].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[0].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[0].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[0].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[0].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[0].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[0].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[0].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[0].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[0].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[0].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[0].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[0].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[0].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[0].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[0].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[0].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[1].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[1].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[1].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[1].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[1].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[1].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[1].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[1].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[1].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[1].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[1].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[1].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[1].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[1].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[1].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[1].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[2].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[2].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[2].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[2].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[2].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[2].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[2].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[2].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[2].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[2].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[2].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[2].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[2].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[2].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[2].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[2].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[3].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[3].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[3].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[3].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[3].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[3].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[3].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[3].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[3].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[3].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[3].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[3].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[3].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[3].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[3].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[3].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[3].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[3].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[3].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[3].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[0].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[0].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[0].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[0].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[0].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[0].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[0].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[0].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupQuad.comp b/core/deps/glslang/Test/glsl.es320.subgroupQuad.comp index f2c6cbf3d..5394999e6 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupQuad.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupQuad.comp @@ -1,97 +1,97 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_quad: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - data[0].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1u); - data[0].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1u); - data[0].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1u); - data[0].f4 = subgroupQuadBroadcast(data[3].f4, 1u); - - data[0].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1u); - data[0].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1u); - data[0].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1u); - data[0].i4 = subgroupQuadBroadcast(data[3].i4, 1u); - - data[0].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1u); - data[0].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1u); - data[0].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1u); - data[0].u4 = subgroupQuadBroadcast(data[3].u4, 1u); - - data[1].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1u)); - data[1].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1u)); - data[1].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); - data[1].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1u)); - - data[1].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); - data[1].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); - data[1].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); - data[1].f4 = subgroupQuadSwapHorizontal(data[3].f4); - - data[1].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); - data[1].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); - data[1].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); - data[1].i4 = subgroupQuadSwapHorizontal(data[3].i4); - - data[1].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); - data[1].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); - data[1].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); - data[1].u4 = subgroupQuadSwapHorizontal(data[3].u4); - - data[2].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); - data[2].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); - data[2].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); - data[2].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); - - data[2].f4.x = subgroupQuadSwapVertical(data[0].f4.x); - data[2].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); - data[2].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); - data[2].f4 = subgroupQuadSwapVertical(data[3].f4); - - data[2].i4.x = subgroupQuadSwapVertical(data[0].i4.x); - data[2].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); - data[2].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); - data[2].i4 = subgroupQuadSwapVertical(data[3].i4); - - data[2].u4.x = subgroupQuadSwapVertical(data[0].u4.x); - data[2].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); - data[2].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); - data[2].u4 = subgroupQuadSwapVertical(data[3].u4); - - data[3].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); - data[3].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); - data[3].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); - data[3].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); - - data[3].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); - data[3].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); - data[3].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); - data[3].f4 = subgroupQuadSwapDiagonal(data[3].f4); - - data[3].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); - data[3].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); - data[3].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); - data[3].i4 = subgroupQuadSwapDiagonal(data[3].i4); - - data[3].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); - data[3].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); - data[3].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); - data[3].u4 = subgroupQuadSwapDiagonal(data[3].u4); - - data[3].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); - data[3].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); - data[3].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); - data[3].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_quad: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + data[0].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1u); + data[0].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1u); + data[0].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1u); + data[0].f4 = subgroupQuadBroadcast(data[3].f4, 1u); + + data[0].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1u); + data[0].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1u); + data[0].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1u); + data[0].i4 = subgroupQuadBroadcast(data[3].i4, 1u); + + data[0].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1u); + data[0].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1u); + data[0].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1u); + data[0].u4 = subgroupQuadBroadcast(data[3].u4, 1u); + + data[1].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1u)); + data[1].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1u)); + data[1].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1u)); + data[1].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1u)); + + data[1].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); + data[1].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); + data[1].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); + data[1].f4 = subgroupQuadSwapHorizontal(data[3].f4); + + data[1].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); + data[1].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); + data[1].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); + data[1].i4 = subgroupQuadSwapHorizontal(data[3].i4); + + data[1].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); + data[1].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); + data[1].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); + data[1].u4 = subgroupQuadSwapHorizontal(data[3].u4); + + data[2].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); + data[2].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); + data[2].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[2].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); + + data[2].f4.x = subgroupQuadSwapVertical(data[0].f4.x); + data[2].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); + data[2].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); + data[2].f4 = subgroupQuadSwapVertical(data[3].f4); + + data[2].i4.x = subgroupQuadSwapVertical(data[0].i4.x); + data[2].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); + data[2].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); + data[2].i4 = subgroupQuadSwapVertical(data[3].i4); + + data[2].u4.x = subgroupQuadSwapVertical(data[0].u4.x); + data[2].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); + data[2].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); + data[2].u4 = subgroupQuadSwapVertical(data[3].u4); + + data[3].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); + data[3].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); + data[3].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); + data[3].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); + + data[3].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); + data[3].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); + data[3].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); + data[3].f4 = subgroupQuadSwapDiagonal(data[3].f4); + + data[3].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); + data[3].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); + data[3].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); + data[3].i4 = subgroupQuadSwapDiagonal(data[3].i4); + + data[3].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); + data[3].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); + data[3].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); + data[3].u4 = subgroupQuadSwapDiagonal(data[3].u4); + + data[3].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); + data[3].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); + data[3].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[3].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupShuffle.comp b/core/deps/glslang/Test/glsl.es320.subgroupShuffle.comp index fdecb3d9d..1ad480d6f 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupShuffle.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupShuffle.comp @@ -1,57 +1,57 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_shuffle: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - data[0].f4.x = subgroupShuffle(data[0].f4.x, invocation); - data[0].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); - data[0].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); - data[0].f4 = subgroupShuffle(data[3].f4, invocation); - - data[0].i4.x = subgroupShuffle(data[0].i4.x, invocation); - data[0].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); - data[0].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); - data[0].i4 = subgroupShuffle(data[3].i4, invocation); - - data[1].u4.x = subgroupShuffle(data[0].u4.x, invocation); - data[1].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); - data[1].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); - data[1].u4 = subgroupShuffle(data[3].u4, invocation); - - data[1].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); - data[1].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[1].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[1].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); - - data[2].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); - data[2].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); - data[2].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); - data[2].f4 = subgroupShuffleXor(data[3].f4, invocation); - - data[2].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); - data[2].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); - data[2].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); - data[2].i4 = subgroupShuffleXor(data[3].i4, invocation); - - data[3].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); - data[3].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); - data[3].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); - data[3].u4 = subgroupShuffleXor(data[3].u4, invocation); - - data[3].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); - data[3].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[3].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[3].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_shuffle: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + data[0].f4.x = subgroupShuffle(data[0].f4.x, invocation); + data[0].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); + data[0].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); + data[0].f4 = subgroupShuffle(data[3].f4, invocation); + + data[0].i4.x = subgroupShuffle(data[0].i4.x, invocation); + data[0].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); + data[0].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); + data[0].i4 = subgroupShuffle(data[3].i4, invocation); + + data[1].u4.x = subgroupShuffle(data[0].u4.x, invocation); + data[1].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); + data[1].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); + data[1].u4 = subgroupShuffle(data[3].u4, invocation); + + data[1].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); + data[1].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[1].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[1].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[2].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); + data[2].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); + data[2].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); + data[2].f4 = subgroupShuffleXor(data[3].f4, invocation); + + data[2].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); + data[2].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); + data[2].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); + data[2].i4 = subgroupShuffleXor(data[3].i4, invocation); + + data[3].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); + data[3].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); + data[3].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); + data[3].u4 = subgroupShuffleXor(data[3].u4, invocation); + + data[3].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); + data[3].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[3].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[3].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupShuffleRelative.comp b/core/deps/glslang/Test/glsl.es320.subgroupShuffleRelative.comp index 32c19ead4..7c94ec7f0 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupShuffleRelative.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupShuffleRelative.comp @@ -1,57 +1,57 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_shuffle_relative: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - data[0].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); - data[0].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); - data[0].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); - data[0].f4 = subgroupShuffleUp(data[3].f4, invocation); - - data[0].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); - data[0].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); - data[0].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); - data[0].i4 = subgroupShuffleUp(data[3].i4, invocation); - - data[1].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); - data[1].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); - data[1].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); - data[1].u4 = subgroupShuffleUp(data[3].u4, invocation); - - data[1].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); - data[1].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[1].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[1].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); - - data[2].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); - data[2].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); - data[2].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); - data[2].f4 = subgroupShuffleDown(data[3].f4, invocation); - - data[2].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); - data[2].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); - data[2].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); - data[2].i4 = subgroupShuffleDown(data[3].i4, invocation); - - data[3].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); - data[3].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); - data[3].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); - data[3].u4 = subgroupShuffleDown(data[3].u4, invocation); - - data[3].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); - data[3].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[3].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[3].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); -} +#version 320 es + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + data[0].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); + data[0].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); + data[0].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); + data[0].f4 = subgroupShuffleUp(data[3].f4, invocation); + + data[0].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); + data[0].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); + data[0].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); + data[0].i4 = subgroupShuffleUp(data[3].i4, invocation); + + data[1].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); + data[1].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); + data[1].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); + data[1].u4 = subgroupShuffleUp(data[3].u4, invocation); + + data[1].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); + data[1].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[1].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[1].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[2].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); + data[2].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); + data[2].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); + data[2].f4 = subgroupShuffleDown(data[3].f4, invocation); + + data[2].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); + data[2].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); + data[2].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); + data[2].i4 = subgroupShuffleDown(data[3].i4, invocation); + + data[3].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); + data[3].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); + data[3].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); + data[3].u4 = subgroupShuffleDown(data[3].u4, invocation); + + data[3].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); + data[3].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[3].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[3].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/core/deps/glslang/Test/glsl.es320.subgroupVote.comp b/core/deps/glslang/Test/glsl.es320.subgroupVote.comp index 45d878743..3c44ba464 100644 --- a/core/deps/glslang/Test/glsl.es320.subgroupVote.comp +++ b/core/deps/glslang/Test/glsl.es320.subgroupVote.comp @@ -1,43 +1,43 @@ -#version 320 es - -#extension GL_KHR_shader_subgroup_vote: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - int r; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; - - if (subgroupAll(data[0].r < 0)) - { - data[0].r = int(subgroupAllEqual(data[0].f4.x)); - data[0].r = int(subgroupAllEqual(data[1].f4.xy)); - data[0].r = int(subgroupAllEqual(data[2].f4.xyz)); - data[0].r = int(subgroupAllEqual(data[3].f4)); - - data[0].r = int(subgroupAllEqual(data[0].i4.x)); - data[0].r = int(subgroupAllEqual(data[1].i4.xy)); - data[0].r = int(subgroupAllEqual(data[2].i4.xyz)); - data[0].r = int(subgroupAllEqual(data[3].i4)); - - data[0].r = int(subgroupAllEqual(data[0].u4.x)); - data[0].r = int(subgroupAllEqual(data[1].u4.xy)); - data[0].r = int(subgroupAllEqual(data[2].u4.xyz)); - data[0].r = int(subgroupAllEqual(data[3].u4)); - } - else if (subgroupAny(data[1].r < 0)) - { - data[1].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); - data[1].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); - data[1].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); - data[1].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); - } -} +#version 320 es + +#extension GL_KHR_shader_subgroup_vote: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4u; + + if (subgroupAll(data[0].r < 0)) + { + data[0].r = int(subgroupAllEqual(data[0].f4.x)); + data[0].r = int(subgroupAllEqual(data[1].f4.xy)); + data[0].r = int(subgroupAllEqual(data[2].f4.xyz)); + data[0].r = int(subgroupAllEqual(data[3].f4)); + + data[0].r = int(subgroupAllEqual(data[0].i4.x)); + data[0].r = int(subgroupAllEqual(data[1].i4.xy)); + data[0].r = int(subgroupAllEqual(data[2].i4.xyz)); + data[0].r = int(subgroupAllEqual(data[3].i4)); + + data[0].r = int(subgroupAllEqual(data[0].u4.x)); + data[0].r = int(subgroupAllEqual(data[1].u4.xy)); + data[0].r = int(subgroupAllEqual(data[2].u4.xyz)); + data[0].r = int(subgroupAllEqual(data[3].u4)); + } + else if (subgroupAny(data[1].r < 0)) + { + data[1].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); + data[1].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); + data[1].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); + data[1].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); + } +} diff --git a/core/deps/glslang/Test/glspv.esversion.vert b/core/deps/glslang/Test/glspv.esversion.vert index f0ef8702c..23501bf62 100644 --- a/core/deps/glslang/Test/glspv.esversion.vert +++ b/core/deps/glslang/Test/glspv.esversion.vert @@ -1,5 +1,5 @@ -#version 310 es - -void main() -{ -} +#version 310 es + +void main() +{ +} diff --git a/core/deps/glslang/Test/glspv.frag b/core/deps/glslang/Test/glspv.frag index 855eb8c7c..7a73cb8d9 100644 --- a/core/deps/glslang/Test/glspv.frag +++ b/core/deps/glslang/Test/glspv.frag @@ -1,28 +1,28 @@ -#version 450 - -#ifdef GL_SPIRV -#error GL_SPIRV is set ( correct, not an error ) -#if GL_SPIRV == 100 -#error GL_SPIR is 100 -#endif -#endif - -void main() -{ -} - -uniform float f; // ERROR, no location -layout(location = 2) uniform float g; -uniform sampler2D s1; // ERROR, no binding -layout(location = 3) uniform sampler2D s2; // ERROR, no binding - -void noise() -{ - noise1(vec4(1)); - noise2(4.0); - noise3(vec2(3)); - noise4(1); -} - -uniform atomic_uint atomic; // ERROR, no binding -layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs +#version 450 + +#ifdef GL_SPIRV +#error GL_SPIRV is set ( correct, not an error ) +#if GL_SPIRV == 100 +#error GL_SPIR is 100 +#endif +#endif + +void main() +{ +} + +uniform float f; // ERROR, no location +layout(location = 2) uniform float g; +uniform sampler2D s1; // ERROR, no binding +layout(location = 3) uniform sampler2D s2; // ERROR, no binding + +void noise() +{ + noise1(vec4(1)); + noise2(4.0); + noise3(vec2(3)); + noise4(1); +} + +uniform atomic_uint atomic; // ERROR, no binding +layout(input_attachment_index = 1) uniform subpassInput sub; // ERROR, no inputs diff --git a/core/deps/glslang/Test/glspv.version.frag b/core/deps/glslang/Test/glspv.version.frag index 3764a63ab..c9c6779e8 100644 --- a/core/deps/glslang/Test/glspv.version.frag +++ b/core/deps/glslang/Test/glspv.version.frag @@ -1,5 +1,5 @@ -#version 330 compatibility - -void main() -{ -} +#version 330 compatibility + +void main() +{ +} diff --git a/core/deps/glslang/Test/glspv.version.vert b/core/deps/glslang/Test/glspv.version.vert index 676cee794..c8573b7bb 100644 --- a/core/deps/glslang/Test/glspv.version.vert +++ b/core/deps/glslang/Test/glspv.version.vert @@ -1,5 +1,5 @@ -#version 150 - -void main() -{ -} +#version 150 + +void main() +{ +} diff --git a/core/deps/glslang/Test/glspv.vert b/core/deps/glslang/Test/glspv.vert index 833c17ace..b44814653 100644 --- a/core/deps/glslang/Test/glspv.vert +++ b/core/deps/glslang/Test/glspv.vert @@ -1,20 +1,20 @@ -#version 450 - -layout(push_constant) uniform Material { int a; } mat; // ERROR, can't use push_constant - -layout(set = 0, binding = 0, std140) uniform Bt1 { int a; } bt1; -layout(set = 1, binding = 0, std140) uniform Bt2 { int a; } bt2; // ERROR, set has to be 0 - -layout(shared) uniform Bt3 { int a; } bt3; // ERROR, no shared, no binding -layout(packed) uniform Bt4 { int a; } bt4; // ERROR, no shared, no binding - -void main() -{ - gl_VertexIndex; // ERROR, not preset - gl_InstanceIndex; // ERROR, not present - gl_VertexID; - gl_InstanceID; - gl_DepthRangeParameters; // ERROR, not present -} - -uniform sampler s; // ERROR, no sampler +#version 450 + +layout(push_constant) uniform Material { int a; } mat; // ERROR, can't use push_constant + +layout(set = 0, binding = 0, std140) uniform Bt1 { int a; } bt1; +layout(set = 1, binding = 0, std140) uniform Bt2 { int a; } bt2; // ERROR, set has to be 0 + +layout(shared) uniform Bt3 { int a; } bt3; // ERROR, no shared, no binding +layout(packed) uniform Bt4 { int a; } bt4; // ERROR, no shared, no binding + +void main() +{ + gl_VertexIndex; // ERROR, not preset + gl_InstanceIndex; // ERROR, not present + gl_VertexID; + gl_InstanceID; + gl_DepthRangeParameters; // ERROR, not present +} + +uniform sampler s; // ERROR, no sampler diff --git a/core/deps/glslang/Test/hlsl.PointSize.vert b/core/deps/glslang/Test/hlsl.PointSize.vert index 8c5c75e10..4b357e073 100644 --- a/core/deps/glslang/Test/hlsl.PointSize.vert +++ b/core/deps/glslang/Test/hlsl.PointSize.vert @@ -1,4 +1,4 @@ -[[vk::builtin("PointSize")]] float main() -{ - return 2.3; +[[vk::builtin("PointSize")]] float main() +{ + return 2.3; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.aliasOpaque.frag b/core/deps/glslang/Test/hlsl.aliasOpaque.frag index 499a61878..8b1cceff9 100644 --- a/core/deps/glslang/Test/hlsl.aliasOpaque.frag +++ b/core/deps/glslang/Test/hlsl.aliasOpaque.frag @@ -1,29 +1,29 @@ -struct OS { - SamplerState ss; - float a; - Texture2D tex; -}; - -SamplerState gss; -SamplerState gss2; -Texture2D gtex; - -float4 osCall(OS s) -{ - return s.a * s.tex.Sample(s.ss, float2(0.2, 0.3)); -} - -float4 main() : SV_TARGET0 -{ - OS os; - os.ss = gss2; - os.ss = gss; - os.tex = gtex; - os.a = 3.0; - - // this should give an error - //SamplerState localss; - //localss = gss2; - - return osCall(os); -} +struct OS { + SamplerState ss; + float a; + Texture2D tex; +}; + +SamplerState gss; +SamplerState gss2; +Texture2D gtex; + +float4 osCall(OS s) +{ + return s.a * s.tex.Sample(s.ss, float2(0.2, 0.3)); +} + +float4 main() : SV_TARGET0 +{ + OS os; + os.ss = gss2; + os.ss = gss; + os.tex = gtex; + os.a = 3.0; + + // this should give an error + //SamplerState localss; + //localss = gss2; + + return osCall(os); +} diff --git a/core/deps/glslang/Test/hlsl.attributeC11.frag b/core/deps/glslang/Test/hlsl.attributeC11.frag index c76dddbf1..336511f92 100644 --- a/core/deps/glslang/Test/hlsl.attributeC11.frag +++ b/core/deps/glslang/Test/hlsl.attributeC11.frag @@ -1,22 +1,22 @@ -struct S { - float2 f; -}; - -[[vk::binding(1)]] -StructuredBuffer buffer1; - -[[vk::binding(3, 2)]] -StructuredBuffer buffer3; - -[[vk::input_attachment_index(4)]] -Texture2D attach; - -[[vk::constant_id(13)]] const int ci = 11; - -[[vk::push_constant]] cbuffer pcBuf { int a; }; - -[[vk::location(7)]] float4 -main([[vk::location(8)]] float4 input: A) : B -{ - return input + attach.Load(float2(0.5));// * a; -} +struct S { + float2 f; +}; + +[[vk::binding(1)]] +StructuredBuffer buffer1; + +[[vk::binding(3, 2)]] +StructuredBuffer buffer3; + +[[vk::input_attachment_index(4)]] +Texture2D attach; + +[[vk::constant_id(13)]] const int ci = 11; + +[[vk::push_constant]] cbuffer pcBuf { int a; }; + +[[vk::location(7)]] float4 +main([[vk::location(8)]] float4 input: A) : B +{ + return input + attach.Load(float2(0.5));// * a; +} diff --git a/core/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag b/core/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag index 6f3ef9ed2..a1177dab2 100644 --- a/core/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag +++ b/core/deps/glslang/Test/hlsl.attributeGlobalBuffer.frag @@ -1,8 +1,8 @@ -[[vk::global_cbuffer_binding(5, 2)]] -float4 u1; -float4 u2; - -float4 main() : SV_Target0 -{ - return u1 + u2; +[[vk::global_cbuffer_binding(5, 2)]] +float4 u1; +float4 u2; + +float4 main() : SV_Target0 +{ + return u1 + u2; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.basic.comp b/core/deps/glslang/Test/hlsl.basic.comp index f616c731a..1d95239ed 100644 --- a/core/deps/glslang/Test/hlsl.basic.comp +++ b/core/deps/glslang/Test/hlsl.basic.comp @@ -1,6 +1,6 @@ -groupshared float4 a[100]; - -void main(int dti : SV_DispatchThreadID, int gti : SV_GroupThreadID) -{ - dti - gti; -} +groupshared float4 a[100]; + +void main(int dti : SV_DispatchThreadID, int gti : SV_GroupThreadID) +{ + dti - gti; +} diff --git a/core/deps/glslang/Test/hlsl.charLit.vert b/core/deps/glslang/Test/hlsl.charLit.vert index f8dea56b5..36c4a1e5e 100644 --- a/core/deps/glslang/Test/hlsl.charLit.vert +++ b/core/deps/glslang/Test/hlsl.charLit.vert @@ -1,17 +1,17 @@ -float4 main() : SV_Position -{ - uint a1 = 'A'; - int a2 = '0'; - - int a3 = '\a'; - a3 += '\b'; - a3 += '\t'; - a3 += '\n'; - a3 += '\v'; - a3 += '\f'; - a3 += '\r'; - - int a10 = '\c'; - - return a1 + a2 + a3 + a10; -} +float4 main() : SV_Position +{ + uint a1 = 'A'; + int a2 = '0'; + + int a3 = '\a'; + a3 += '\b'; + a3 += '\t'; + a3 += '\n'; + a3 += '\v'; + a3 += '\f'; + a3 += '\r'; + + int a10 = '\c'; + + return a1 + a2 + a3 + a10; +} diff --git a/core/deps/glslang/Test/hlsl.conditional.frag b/core/deps/glslang/Test/hlsl.conditional.frag index 2699484c6..91f75eec7 100644 --- a/core/deps/glslang/Test/hlsl.conditional.frag +++ b/core/deps/glslang/Test/hlsl.conditional.frag @@ -1,8 +1,8 @@ -float4 c4; -float4 t4; -float4 f4; -float t; -float f; +float4 c4; +float4 t4; +float4 f4; +float t; +float f; float4 vectorCond() { @@ -18,9 +18,9 @@ float4 scalarCond() return ret; } -float2 fbSelect(bool2 cnd, float2 src0, float2 src1) -{ - return cnd ? src0 : src1; +float2 fbSelect(bool2 cnd, float2 src0, float2 src1) +{ + return cnd ? src0 : src1; } float4 PixelShaderFunction(float4 input) : COLOR0 diff --git a/core/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert b/core/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert index 2cc58ee51..a5f965abc 100644 --- a/core/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert +++ b/core/deps/glslang/Test/hlsl.deadFunctionMissingBody.vert @@ -1,8 +1,8 @@ -float4 main(): SV_Target0 { return 0; } -struct Surface { float3 albedo; }; -Surface surfaceShader(float fade); -Surface surfaceShaderExec() -{ - float fade = 0; - return surfaceShader(0); -} +float4 main(): SV_Target0 { return 0; } +struct Surface { float3 albedo; }; +Surface surfaceShader(float fade); +Surface surfaceShaderExec() +{ + float fade = 0; + return surfaceShader(0); +} diff --git a/core/deps/glslang/Test/hlsl.earlydepthstencil.frag b/core/deps/glslang/Test/hlsl.earlydepthstencil.frag index c80dcae76..268baaecd 100644 --- a/core/deps/glslang/Test/hlsl.earlydepthstencil.frag +++ b/core/deps/glslang/Test/hlsl.earlydepthstencil.frag @@ -1,12 +1,12 @@ -RWTexture2D Values; - -struct InputStruct { - float4 Position : SV_POSITION; -}; - -[earlydepthstencil] -uint main(InputStruct input) : SV_Target { - uint oldVal; - InterlockedExchange(Values[uint2(input.Position.x, input.Position.y)], 1.0, oldVal); - return oldVal; -} +RWTexture2D Values; + +struct InputStruct { + float4 Position : SV_POSITION; +}; + +[earlydepthstencil] +uint main(InputStruct input) : SV_Target { + uint oldVal; + InterlockedExchange(Values[uint2(input.Position.x, input.Position.y)], 1.0, oldVal); + return oldVal; +} diff --git a/core/deps/glslang/Test/hlsl.emptystructreturn.frag b/core/deps/glslang/Test/hlsl.emptystructreturn.frag index 5ac6ac655..f6a772a32 100644 --- a/core/deps/glslang/Test/hlsl.emptystructreturn.frag +++ b/core/deps/glslang/Test/hlsl.emptystructreturn.frag @@ -1,13 +1,13 @@ -struct ps_in -{ -}; - -struct ps_out -{ -}; - -ps_out main (ps_in i) -{ - ps_out o; - return o; -} +struct ps_in +{ +}; + +struct ps_out +{ +}; + +ps_out main (ps_in i) +{ + ps_out o; + return o; +} diff --git a/core/deps/glslang/Test/hlsl.flattenOpaque.frag b/core/deps/glslang/Test/hlsl.flattenOpaque.frag index 0d8039523..279be8a0b 100644 --- a/core/deps/glslang/Test/hlsl.flattenOpaque.frag +++ b/core/deps/glslang/Test/hlsl.flattenOpaque.frag @@ -1,40 +1,40 @@ -struct os { - sampler2D s2D; -}; - -struct os2 { - sampler2D s2D; - Texture2D tex; -}; - -Texture2D tex; -os s; -os2 s2; - -float4 osCall1(os s) -{ - return tex.Sample(s.s2D, float2(0.2, 0.3)); -} - -float4 osCall2(os s, float2 f2) -{ - return tex.Sample(s.s2D, f2); -} - -float4 os2Call1(os2 s) -{ - return s.tex.Sample(s.s2D, float2(0.2, 0.3)); -} - -float4 os2Call2(os2 s, float2 f2) -{ - return s.tex.Sample(s.s2D, f2); -} - -float4 main() : SV_TARGET0 -{ - return osCall1(s) + - osCall2(s, float2(0.2, 0.3)) + - os2Call1(s2) + - os2Call2(s2, float2(0.2, 0.3)); -} +struct os { + sampler2D s2D; +}; + +struct os2 { + sampler2D s2D; + Texture2D tex; +}; + +Texture2D tex; +os s; +os2 s2; + +float4 osCall1(os s) +{ + return tex.Sample(s.s2D, float2(0.2, 0.3)); +} + +float4 osCall2(os s, float2 f2) +{ + return tex.Sample(s.s2D, f2); +} + +float4 os2Call1(os2 s) +{ + return s.tex.Sample(s.s2D, float2(0.2, 0.3)); +} + +float4 os2Call2(os2 s, float2 f2) +{ + return s.tex.Sample(s.s2D, f2); +} + +float4 main() : SV_TARGET0 +{ + return osCall1(s) + + osCall2(s, float2(0.2, 0.3)) + + os2Call1(s2) + + os2Call2(s2, float2(0.2, 0.3)); +} diff --git a/core/deps/glslang/Test/hlsl.flattenOpaqueInit.vert b/core/deps/glslang/Test/hlsl.flattenOpaqueInit.vert index 797a90f78..9ed8bc7a2 100644 --- a/core/deps/glslang/Test/hlsl.flattenOpaqueInit.vert +++ b/core/deps/glslang/Test/hlsl.flattenOpaqueInit.vert @@ -1,27 +1,27 @@ -struct FxaaTex { SamplerState smpl; Texture2D tex; }; -SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; - -float4 lookUp(FxaaTex tex) -{ - return tex.tex.Sample(tex.smpl, float2(0.3, 0.4)); -} - -FxaaTex fillOpaque() -{ - FxaaTex t; - t.smpl = g_tInputTexture_sampler; - t.tex = g_tInputTexture; - return t; -} - -float4 main() : SV_TARGET0 -{ - FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture }; - float4 res = lookUp(tex1); - FxaaTex tex2 = fillOpaque(); - res += lookUp(tex2); +struct FxaaTex { SamplerState smpl; Texture2D tex; }; +SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; + +float4 lookUp(FxaaTex tex) +{ + return tex.tex.Sample(tex.smpl, float2(0.3, 0.4)); +} + +FxaaTex fillOpaque() +{ + FxaaTex t; + t.smpl = g_tInputTexture_sampler; + t.tex = g_tInputTexture; + return t; +} + +float4 main() : SV_TARGET0 +{ + FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture }; + float4 res = lookUp(tex1); + FxaaTex tex2 = fillOpaque(); + res += lookUp(tex2); FxaaTex tex3 = tex1; res += lookUp(tex3); - - return res; + + return res; } diff --git a/core/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert b/core/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert index 287a26cf5..2e712ee5b 100644 --- a/core/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert +++ b/core/deps/glslang/Test/hlsl.flattenOpaqueInitMix.vert @@ -1,13 +1,13 @@ -struct FxaaTex { SamplerState smpl; Texture2D tex; float f; }; -SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; - -float4 lookUp(FxaaTex tex) -{ - return tex.tex.Sample(tex.smpl, float2(tex.f, tex.f)); -} - -float4 main() : SV_TARGET0 -{ - FxaaTex tex = { g_tInputTexture_sampler, g_tInputTexture, 0.5 }; - return lookUp(tex); +struct FxaaTex { SamplerState smpl; Texture2D tex; float f; }; +SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; + +float4 lookUp(FxaaTex tex) +{ + return tex.tex.Sample(tex.smpl, float2(tex.f, tex.f)); +} + +float4 main() : SV_TARGET0 +{ + FxaaTex tex = { g_tInputTexture_sampler, g_tInputTexture, 0.5 }; + return lookUp(tex); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.flattenSubset.frag b/core/deps/glslang/Test/hlsl.flattenSubset.frag index 5d7c2b8d0..c80e093c8 100644 --- a/core/deps/glslang/Test/hlsl.flattenSubset.frag +++ b/core/deps/glslang/Test/hlsl.flattenSubset.frag @@ -1,36 +1,36 @@ -struct S0 -{ - int x; - int y; - SamplerState ss; -}; - -struct S1 -{ - float b; - SamplerState samplerState; - S0 s0; - int a; -}; - -struct S2 -{ - int a1; - int a2; - int a3; - int a4; - int a5; - S1 resources; -}; - -SamplerState samp; -Texture2D tex; - -float4 main(float4 vpos : VPOS) : COLOR0 -{ - S1 s1; - S2 s2; - s1.s0.ss = samp; - s2.resources = s1; - return tex.Sample(s2.resources.s0.ss, float2(0.5)); -} +struct S0 +{ + int x; + int y; + SamplerState ss; +}; + +struct S1 +{ + float b; + SamplerState samplerState; + S0 s0; + int a; +}; + +struct S2 +{ + int a1; + int a2; + int a3; + int a4; + int a5; + S1 resources; +}; + +SamplerState samp; +Texture2D tex; + +float4 main(float4 vpos : VPOS) : COLOR0 +{ + S1 s1; + S2 s2; + s1.s0.ss = samp; + s2.resources = s1; + return tex.Sample(s2.resources.s0.ss, float2(0.5)); +} diff --git a/core/deps/glslang/Test/hlsl.flattenSubset2.frag b/core/deps/glslang/Test/hlsl.flattenSubset2.frag index 030c70957..753475dc1 100644 --- a/core/deps/glslang/Test/hlsl.flattenSubset2.frag +++ b/core/deps/glslang/Test/hlsl.flattenSubset2.frag @@ -1,24 +1,24 @@ -struct Nested { float y; Texture2D texNested; }; -struct A { Nested n; float x; }; -struct B { Nested n; Texture2D tex; }; - -Texture2D someTex; - -float4 main(float4 vpos : VPOS) : COLOR0 -{ - A a1, a2; - B b; - - // Assignment of nested structs to nested structs - a1.n = a2.n; - b .n = a1.n; - - // Assignment of nested struct to standalone - Nested n = b.n; - - // Assignment to nestested struct members - a2.n.texNested = someTex; - a1.n.y = 1.0; - - return float4(0,0,0,0); -} +struct Nested { float y; Texture2D texNested; }; +struct A { Nested n; float x; }; +struct B { Nested n; Texture2D tex; }; + +Texture2D someTex; + +float4 main(float4 vpos : VPOS) : COLOR0 +{ + A a1, a2; + B b; + + // Assignment of nested structs to nested structs + a1.n = a2.n; + b .n = a1.n; + + // Assignment of nested struct to standalone + Nested n = b.n; + + // Assignment to nestested struct members + a2.n.texNested = someTex; + a1.n.y = 1.0; + + return float4(0,0,0,0); +} diff --git a/core/deps/glslang/Test/hlsl.function.frag b/core/deps/glslang/Test/hlsl.function.frag index 8119c7544..5834b3196 100644 --- a/core/deps/glslang/Test/hlsl.function.frag +++ b/core/deps/glslang/Test/hlsl.function.frag @@ -1,25 +1,25 @@ -float4 fun0() -{ - return 1.0f; -} - -uint fun2(float4 col) -{ - return 7; -} - -float4 fun4(uint id1, uniform uint id2) -{ - return id1 * id2; -} - -float4 fun1(int index) -{ - uint entityId = fun2(fun0()); - return fun4(entityId, entityId); -} - -int main() : SV_TARGET -{ - return fun1; +float4 fun0() +{ + return 1.0f; +} + +uint fun2(float4 col) +{ + return 7; +} + +float4 fun4(uint id1, uniform uint id2) +{ + return id1 * id2; +} + +float4 fun1(int index) +{ + uint entityId = fun2(fun0()); + return fun4(entityId, entityId); +} + +int main() : SV_TARGET +{ + return fun1; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.gs-hs-mix.tesc b/core/deps/glslang/Test/hlsl.gs-hs-mix.tesc index dd9f7ea7b..451969611 100644 --- a/core/deps/glslang/Test/hlsl.gs-hs-mix.tesc +++ b/core/deps/glslang/Test/hlsl.gs-hs-mix.tesc @@ -1,119 +1,119 @@ -cbuffer UniformBlock0 : register(b0) -{ - float4x4 model_view_matrix; - float4x4 proj_matrix; - float4x4 model_view_proj_matrix; - float3x3 normal_matrix; - float3 color; - float3 view_dir; - float3 tess_factor; -}; - -// ============================================================================= -// Hull Shader -// ============================================================================= -struct HSInput { - float3 PositionWS : POSITION; - float3 NormalWS : NORMAL; -}; - -struct HSOutput { - float3 PositionWS : POSITION; -}; - -struct HSTrianglePatchConstant { - float EdgeTessFactor[3] : SV_TessFactor; - float InsideTessFactor : SV_InsideTessFactor; - float3 NormalWS[3] : NORMAL; -}; - -HSTrianglePatchConstant HSPatchConstant(InputPatch patch) -{ - float3 roundedEdgeTessFactor = tess_factor; - float roundedInsideTessFactor = 3; - float insideTessFactor = 1; - - HSTrianglePatchConstant result; - - // Edge and inside tessellation factors - result.EdgeTessFactor[0] = roundedEdgeTessFactor.x; - result.EdgeTessFactor[1] = roundedEdgeTessFactor.y; - result.EdgeTessFactor[2] = roundedEdgeTessFactor.z; - result.InsideTessFactor = roundedInsideTessFactor; - - // Constant data - result.NormalWS[0] = patch[0].NormalWS; - result.NormalWS[1] = patch[1].NormalWS; - result.NormalWS[2] = patch[2].NormalWS; - - return result; -} - -[domain("tri")] -[partitioning("fractional_odd")] -[outputtopology("triangle_ccw")] -[outputcontrolpoints(3)] -[patchconstantfunc("HSPatchConstant")] -HSOutput HSMain( - InputPatch patch, - uint id : SV_OutputControlPointID -) -{ - HSOutput output; - output.PositionWS = patch[id].PositionWS; - return output; -} - -// ============================================================================= -// Geometry Shader -// ============================================================================= -struct GSVertexInput { - float3 PositionWS : POSITION; - float3 NormalWS : NORMAL; -}; - -struct GSVertexOutput { - float4 PositionCS : SV_POSITION; -}; - -[maxvertexcount(6)] -void GSMain( - triangle GSVertexInput input[3], - inout LineStream output -) -{ - - float3 P0 = input[0].PositionWS.xyz; - float3 P1 = input[1].PositionWS.xyz; - float3 P2 = input[2].PositionWS.xyz; - - GSVertexOutput vertex; - // Totally hacky... - P0.z += 0.001; - P1.z += 0.001; - P2.z += 0.001; - float4 Q0 = mul(proj_matrix, float4(P0, 1.0)); - float4 Q1 = mul(proj_matrix, float4(P1, 1.0)); - float4 Q2 = mul(proj_matrix, float4(P2, 1.0)); - - // Edge 0 - vertex.PositionCS = Q0; - output.Append(vertex); - vertex.PositionCS = Q1; - output.Append(vertex); - output.RestartStrip(); - - // Edge 1 - vertex.PositionCS = Q1; - output.Append(vertex); - vertex.PositionCS = Q2; - output.Append(vertex); - output.RestartStrip(); - - // Edge 2 - vertex.PositionCS = Q2; - output.Append(vertex); - vertex.PositionCS = Q0; - output.Append(vertex); - output.RestartStrip(); -} +cbuffer UniformBlock0 : register(b0) +{ + float4x4 model_view_matrix; + float4x4 proj_matrix; + float4x4 model_view_proj_matrix; + float3x3 normal_matrix; + float3 color; + float3 view_dir; + float3 tess_factor; +}; + +// ============================================================================= +// Hull Shader +// ============================================================================= +struct HSInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct HSOutput { + float3 PositionWS : POSITION; +}; + +struct HSTrianglePatchConstant { + float EdgeTessFactor[3] : SV_TessFactor; + float InsideTessFactor : SV_InsideTessFactor; + float3 NormalWS[3] : NORMAL; +}; + +HSTrianglePatchConstant HSPatchConstant(InputPatch patch) +{ + float3 roundedEdgeTessFactor = tess_factor; + float roundedInsideTessFactor = 3; + float insideTessFactor = 1; + + HSTrianglePatchConstant result; + + // Edge and inside tessellation factors + result.EdgeTessFactor[0] = roundedEdgeTessFactor.x; + result.EdgeTessFactor[1] = roundedEdgeTessFactor.y; + result.EdgeTessFactor[2] = roundedEdgeTessFactor.z; + result.InsideTessFactor = roundedInsideTessFactor; + + // Constant data + result.NormalWS[0] = patch[0].NormalWS; + result.NormalWS[1] = patch[1].NormalWS; + result.NormalWS[2] = patch[2].NormalWS; + + return result; +} + +[domain("tri")] +[partitioning("fractional_odd")] +[outputtopology("triangle_ccw")] +[outputcontrolpoints(3)] +[patchconstantfunc("HSPatchConstant")] +HSOutput HSMain( + InputPatch patch, + uint id : SV_OutputControlPointID +) +{ + HSOutput output; + output.PositionWS = patch[id].PositionWS; + return output; +} + +// ============================================================================= +// Geometry Shader +// ============================================================================= +struct GSVertexInput { + float3 PositionWS : POSITION; + float3 NormalWS : NORMAL; +}; + +struct GSVertexOutput { + float4 PositionCS : SV_POSITION; +}; + +[maxvertexcount(6)] +void GSMain( + triangle GSVertexInput input[3], + inout LineStream output +) +{ + + float3 P0 = input[0].PositionWS.xyz; + float3 P1 = input[1].PositionWS.xyz; + float3 P2 = input[2].PositionWS.xyz; + + GSVertexOutput vertex; + // Totally hacky... + P0.z += 0.001; + P1.z += 0.001; + P2.z += 0.001; + float4 Q0 = mul(proj_matrix, float4(P0, 1.0)); + float4 Q1 = mul(proj_matrix, float4(P1, 1.0)); + float4 Q2 = mul(proj_matrix, float4(P2, 1.0)); + + // Edge 0 + vertex.PositionCS = Q0; + output.Append(vertex); + vertex.PositionCS = Q1; + output.Append(vertex); + output.RestartStrip(); + + // Edge 1 + vertex.PositionCS = Q1; + output.Append(vertex); + vertex.PositionCS = Q2; + output.Append(vertex); + output.RestartStrip(); + + // Edge 2 + vertex.PositionCS = Q2; + output.Append(vertex); + vertex.PositionCS = Q0; + output.Append(vertex); + output.RestartStrip(); +} diff --git a/core/deps/glslang/Test/hlsl.hlslOffset.vert b/core/deps/glslang/Test/hlsl.hlslOffset.vert index da41022aa..aa95f6a34 100644 --- a/core/deps/glslang/Test/hlsl.hlslOffset.vert +++ b/core/deps/glslang/Test/hlsl.hlslOffset.vert @@ -1,20 +1,20 @@ -cbuffer b { - float m0; - float3 m4; - ////// - float m16; - float3 m20 : packoffset(c1.y); - ///// - float3 m36 : packoffset(c2.y); - ///// - float2 m56 : packoffset(c3.z); - ///// - float m64; - float2 m68; - float m76; - ////// - float m80; - float2 m96[1]; -}; - -void main() {} +cbuffer b { + float m0; + float3 m4; + ////// + float m16; + float3 m20 : packoffset(c1.y); + ///// + float3 m36 : packoffset(c2.y); + ///// + float2 m56 : packoffset(c3.z); + ///// + float m64; + float2 m68; + float m76; + ////// + float m80; + float2 m96[1]; +}; + +void main() {} diff --git a/core/deps/glslang/Test/hlsl.implicitBool.frag b/core/deps/glslang/Test/hlsl.implicitBool.frag index ad47c0683..c6aea9d1e 100644 --- a/core/deps/glslang/Test/hlsl.implicitBool.frag +++ b/core/deps/glslang/Test/hlsl.implicitBool.frag @@ -1,32 +1,32 @@ -float condf; -int condi; -float1 condf1; -int1 condi1; - -float4 main() : SV_Target0 -{ - float4 a = float4(2.0, 2.0, 2.0, 2.0); - if (condi) - return a + 1.0; - if (condf) - return a + 2.0; - if (condf1) - return a + 3.0; - if (condi1) - return a + 4.0; - if (condi && condf || condf1) - return a + 5.0; - - float f = condf; - while (f) { --f; } - - int i = condi; - do { --i; } while (i); - - for (; i; ) { --i; } - - float g = condf ? 7.0 : 8.0; - a += g; - - return a - 1.0; +float condf; +int condi; +float1 condf1; +int1 condi1; + +float4 main() : SV_Target0 +{ + float4 a = float4(2.0, 2.0, 2.0, 2.0); + if (condi) + return a + 1.0; + if (condf) + return a + 2.0; + if (condf1) + return a + 3.0; + if (condi1) + return a + 4.0; + if (condi && condf || condf1) + return a + 5.0; + + float f = condf; + while (f) { --f; } + + int i = condi; + do { --i; } while (i); + + for (; i; ) { --i; } + + float g = condf ? 7.0 : 8.0; + a += g; + + return a - 1.0; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.inf.vert b/core/deps/glslang/Test/hlsl.inf.vert index 58c83bec4..d57b83793 100644 --- a/core/deps/glslang/Test/hlsl.inf.vert +++ b/core/deps/glslang/Test/hlsl.inf.vert @@ -1,11 +1,11 @@ -float4 main() : SV_Position -{ - float f1 = -1.#INF; - float f2 = 1.#INF; - float f3 = +1.#INF; - float f4 = f2 * 1.#INF + 1.#INF; - const float f5 = -1.#INF; - const float f6 = f5 * 0.0f; - - return (float4)(f1 + f2 + f3 + f4 + f5 + f6); +float4 main() : SV_Position +{ + float f1 = -1.#INF; + float f2 = 1.#INF; + float f3 = +1.#INF; + float f4 = f2 * 1.#INF + 1.#INF; + const float f5 = -1.#INF; + const float f6 = f5 * 0.0f; + + return (float4)(f1 + f2 + f3 + f4 + f5 + f6); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.init.frag b/core/deps/glslang/Test/hlsl.init.frag index fd4bad36d..8caf3c7d9 100644 --- a/core/deps/glslang/Test/hlsl.init.frag +++ b/core/deps/glslang/Test/hlsl.init.frag @@ -4,18 +4,18 @@ static float a2 = 0.2, b2; static float a3, b3 = 0.3; static float a4, b4 = 0.4, c4; static float a5 = 0.5, b5, c5 = 1.5; - -struct Single1 { int f; }; -static Single1 single1 = { 10 }; - -struct Single2 { uint2 v; }; -static Single2 single2 = { { 1, 2 } }; - -struct Single3 { Single1 s1; }; -static Single3 single3 = { { 3 } }; - -struct Single4 { Single2 s1; }; -static Single4 single4 = { { { 4u, 5u } } }; + +struct Single1 { int f; }; +static Single1 single1 = { 10 }; + +struct Single2 { uint2 v; }; +static Single2 single2 = { { 1, 2 } }; + +struct Single3 { Single1 s1; }; +static Single3 single3 = { { 3 } }; + +struct Single4 { Single2 s1; }; +static Single4 single4 = { { { 4u, 5u } } }; float4 ShaderFunction(float4 input) : COLOR0 { @@ -35,7 +35,7 @@ float4 ShaderFunction(float4 input) : COLOR0 return input * a1; } -cbuffer Constants -{ - float a = 1.0f, b, c = 2.0f; -}; +cbuffer Constants +{ + float a = 1.0f, b, c = 2.0f; +}; diff --git a/core/deps/glslang/Test/hlsl.init2.frag b/core/deps/glslang/Test/hlsl.init2.frag index d0b42d224..2b9b7e688 100644 --- a/core/deps/glslang/Test/hlsl.init2.frag +++ b/core/deps/glslang/Test/hlsl.init2.frag @@ -21,16 +21,16 @@ void Test1() const mystruct2 constTest5 = { {8,}, {9,}, {10}, }; constTest5.c; - const float step = 1.f; - float n = 0; - const float3 a[8] = { - normalize(float3(1, 1, 1)) * (n += step), - normalize(float3(-1, -1, -1)) * (n += step), - normalize(float3(-1, -1, 1)) * (n += step), - normalize(float3(-1, 1, -1)) * (n += step), - normalize(float3(-1, 1, 1)) * (n += step), - normalize(float3(1, -1, -1)) * (n += step), - normalize(float3(1, -1, 1)) * (n += step), + const float step = 1.f; + float n = 0; + const float3 a[8] = { + normalize(float3(1, 1, 1)) * (n += step), + normalize(float3(-1, -1, -1)) * (n += step), + normalize(float3(-1, -1, 1)) * (n += step), + normalize(float3(-1, 1, -1)) * (n += step), + normalize(float3(-1, 1, 1)) * (n += step), + normalize(float3(1, -1, -1)) * (n += step), + normalize(float3(1, -1, 1)) * (n += step), normalize(float3(1, 1, -1)) * (n += step) }; const struct one { float3 a; } oneNonConst = { normalize(float3(-1, 1, 1)) * (n += step) }; diff --git a/core/deps/glslang/Test/hlsl.int.dot.frag b/core/deps/glslang/Test/hlsl.int.dot.frag index bf0f22450..c293dc14b 100644 --- a/core/deps/glslang/Test/hlsl.int.dot.frag +++ b/core/deps/glslang/Test/hlsl.int.dot.frag @@ -1,14 +1,14 @@ -float4 main() : SV_Target { - int i = 1; - int1 i2 = 2; - int2 i3 = 3; - int3 i4 = 4; - int4 i5 = 5; - - i = dot(i, i); - i2 = dot(i2, i2); - i3 = dot(i3, i3); - i4 = dot(i4, i4); - i5 = dot(i5, i5); - return i + i2.xxxx + i3.xyxy + i4.xyzx + i5; +float4 main() : SV_Target { + int i = 1; + int1 i2 = 2; + int2 i3 = 3; + int3 i4 = 4; + int4 i5 = 5; + + i = dot(i, i); + i2 = dot(i2, i2); + i3 = dot(i3, i3); + i4 = dot(i4, i4); + i5 = dot(i5, i5); + return i + i2.xxxx + i3.xyxy + i4.xyzx + i5; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.layoutOverride.vert b/core/deps/glslang/Test/hlsl.layoutOverride.vert index 1f17a7efd..4c006018b 100644 --- a/core/deps/glslang/Test/hlsl.layoutOverride.vert +++ b/core/deps/glslang/Test/hlsl.layoutOverride.vert @@ -1,7 +1,7 @@ -layout(set=2,binding=0) Texture2D tex : register(t16); -SamplerState samp; - -float4 main() : SV_Position -{ - return tex.Sample(samp, float2(0.2, 0.3)); +layout(set=2,binding=0) Texture2D tex : register(t16); +SamplerState samp; + +float4 main() : SV_Position +{ + return tex.Sample(samp, float2(0.2, 0.3)); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.localStructuredBuffer.comp b/core/deps/glslang/Test/hlsl.localStructuredBuffer.comp index 06d9d6b90..34e06e001 100644 --- a/core/deps/glslang/Test/hlsl.localStructuredBuffer.comp +++ b/core/deps/glslang/Test/hlsl.localStructuredBuffer.comp @@ -1,4 +1,4 @@ -RWStructuredBuffer srt0; -void main() { - RWStructuredBuffer srt0Local = srt0; +RWStructuredBuffer srt0; +void main() { + RWStructuredBuffer srt0Local = srt0; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.logicalConvert.frag b/core/deps/glslang/Test/hlsl.logicalConvert.frag index ff36d6391..b353eb1ee 100644 --- a/core/deps/glslang/Test/hlsl.logicalConvert.frag +++ b/core/deps/glslang/Test/hlsl.logicalConvert.frag @@ -1,23 +1,23 @@ -float4 main() : SV_TARGET -{ - if (!(0) && (0) || (!1)) - return 0.0.xxxx; - if (0) - return 0.0.xxxx; - if (!(bool)0) - return 0.0.xxxx; - if (!0) - return 0.0.xxxx; - if (!(bool)1) - return 0.0.xxxx; - if (!1) - return 0.0.xxxx; - if (0 || 1) - return 0.0.xxxx; - if (1 && 0) - return 0.0.xxxx; - if (1 || false) - return 0.0.xxxx; - if (true && 1) - return 0.0.xxxx; +float4 main() : SV_TARGET +{ + if (!(0) && (0) || (!1)) + return 0.0.xxxx; + if (0) + return 0.0.xxxx; + if (!(bool)0) + return 0.0.xxxx; + if (!0) + return 0.0.xxxx; + if (!(bool)1) + return 0.0.xxxx; + if (!1) + return 0.0.xxxx; + if (0 || 1) + return 0.0.xxxx; + if (1 && 0) + return 0.0.xxxx; + if (1 || false) + return 0.0.xxxx; + if (true && 1) + return 0.0.xxxx; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.matrixSwizzle.vert b/core/deps/glslang/Test/hlsl.matrixSwizzle.vert index bff81e1c4..c06996b31 100644 --- a/core/deps/glslang/Test/hlsl.matrixSwizzle.vert +++ b/core/deps/glslang/Test/hlsl.matrixSwizzle.vert @@ -23,11 +23,11 @@ void ShaderFunction(float inf) : COLOR0 f3 = m._21_12_31; } -float3x3 createMat3x3(float3 a, float3 b, float3 c) -{ - float3x3 m; - m._11_21_31 = a; - m._12_22_32 = b; - m._13_23_33 = c; - return m; +float3x3 createMat3x3(float3 a, float3 b, float3 c) +{ + float3x3 m; + m._11_21_31 = a; + m._12_22_32 = b; + m._13_23_33 = c; + return m; } diff --git a/core/deps/glslang/Test/hlsl.memberFunCall.frag b/core/deps/glslang/Test/hlsl.memberFunCall.frag index 44796f021..27d3f6e01 100644 --- a/core/deps/glslang/Test/hlsl.memberFunCall.frag +++ b/core/deps/glslang/Test/hlsl.memberFunCall.frag @@ -1,16 +1,16 @@ -float method3(float a) { return 1.0; } - -struct myContext { - float method1() { return method2(); } - float method2() { return method3(1.0); } - float method3(float a) { return method4(a, a); } - float method4(float a, float b) { return a + b + f; } - float f; -}; - -float4 main() : SV_TARGET0 -{ - myContext context; - context.f = 3.0; - return (float4)context.method1(); -} +float method3(float a) { return 1.0; } + +struct myContext { + float method1() { return method2(); } + float method2() { return method3(1.0); } + float method3(float a) { return method4(a, a); } + float method4(float a, float b) { return a + b + f; } + float f; +}; + +float4 main() : SV_TARGET0 +{ + myContext context; + context.f = 3.0; + return (float4)context.method1(); +} diff --git a/core/deps/glslang/Test/hlsl.multiDescriptorSet.frag b/core/deps/glslang/Test/hlsl.multiDescriptorSet.frag index 3aee0783a..6c4be21ef 100644 --- a/core/deps/glslang/Test/hlsl.multiDescriptorSet.frag +++ b/core/deps/glslang/Test/hlsl.multiDescriptorSet.frag @@ -1,45 +1,45 @@ -Texture2D txDiffuseA : register( t0 ); -Texture2D txDiffuseB : register( t1 ); - -SamplerState samLinearA : register( s0 ); -SamplerState samLinearB : register( s1 ); - -cbuffer cbNeverChanges : register( b0 ) -{ - matrix View; -}; - -cbuffer cbChangeOnResize : register( b1 ) -{ - matrix Projection; -}; - -cbuffer cbChangesEveryFrame : register( b2 ) -{ - matrix World; - float4 vMeshColor; -}; - - -struct VS_INPUT -{ - float4 Pos : POSITION; - float2 Tex : TEXCOORD0; -}; - -struct PS_INPUT -{ - float4 Pos : SV_POSITION; - float2 Tex : TEXCOORD0; -}; - - -float4 main( PS_INPUT input) : SV_Target -{ - PS_INPUT output = (PS_INPUT)0; - output.Pos = mul( input.Pos, World ); - output.Pos = mul( output.Pos, View ); - output.Pos = mul( output.Pos, Projection ); - output.Tex = input.Tex; - return txDiffuseA.Sample( samLinearA, output.Tex ) * vMeshColor; -} +Texture2D txDiffuseA : register( t0 ); +Texture2D txDiffuseB : register( t1 ); + +SamplerState samLinearA : register( s0 ); +SamplerState samLinearB : register( s1 ); + +cbuffer cbNeverChanges : register( b0 ) +{ + matrix View; +}; + +cbuffer cbChangeOnResize : register( b1 ) +{ + matrix Projection; +}; + +cbuffer cbChangesEveryFrame : register( b2 ) +{ + matrix World; + float4 vMeshColor; +}; + + +struct VS_INPUT +{ + float4 Pos : POSITION; + float2 Tex : TEXCOORD0; +}; + +struct PS_INPUT +{ + float4 Pos : SV_POSITION; + float2 Tex : TEXCOORD0; +}; + + +float4 main( PS_INPUT input) : SV_Target +{ + PS_INPUT output = (PS_INPUT)0; + output.Pos = mul( input.Pos, World ); + output.Pos = mul( output.Pos, View ); + output.Pos = mul( output.Pos, Projection ); + output.Tex = input.Tex; + return txDiffuseA.Sample( samLinearA, output.Tex ) * vMeshColor; +} diff --git a/core/deps/glslang/Test/hlsl.multiEntry.vert b/core/deps/glslang/Test/hlsl.multiEntry.vert index 8c6d69fce..d155c26d1 100644 --- a/core/deps/glslang/Test/hlsl.multiEntry.vert +++ b/core/deps/glslang/Test/hlsl.multiEntry.vert @@ -1,11 +1,11 @@ -Buffer Position; - -float4 FakeEntrypoint(uint Index : SV_VERTEXID) : SV_POSITION -{ - return Position.Load(Index); -} - -float4 RealEntrypoint(uint Index : SV_VERTEXID) : SV_POSITION -{ - return FakeEntrypoint(Index); +Buffer Position; + +float4 FakeEntrypoint(uint Index : SV_VERTEXID) : SV_POSITION +{ + return Position.Load(Index); +} + +float4 RealEntrypoint(uint Index : SV_VERTEXID) : SV_POSITION +{ + return FakeEntrypoint(Index); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.multiReturn.frag b/core/deps/glslang/Test/hlsl.multiReturn.frag index 614e3d397..fdab77210 100644 --- a/core/deps/glslang/Test/hlsl.multiReturn.frag +++ b/core/deps/glslang/Test/hlsl.multiReturn.frag @@ -1,19 +1,19 @@ -struct S { - float f; - float3 v; - float3x3 m; -}; - -cbuffer bufName { - S s; -}; - -S foo() -{ - return s; -} - -void main() -{ - foo(); -} +struct S { + float f; + float3 v; + float3x3 m; +}; + +cbuffer bufName { + S s; +}; + +S foo() +{ + return s; +} + +void main() +{ + foo(); +} diff --git a/core/deps/glslang/Test/hlsl.namespace.frag b/core/deps/glslang/Test/hlsl.namespace.frag index 341753ea5..76c3062d6 100644 --- a/core/deps/glslang/Test/hlsl.namespace.frag +++ b/core/deps/glslang/Test/hlsl.namespace.frag @@ -1,23 +1,23 @@ -static float4 v1; -static float4 v2; - -namespace N1 { - float4 getVec() { return v1; } -} - -namespace N2 { - static float gf; - float4 getVec() { return v2; } - namespace N3 { - float4 getVec() { return v2; } - - class C1 { - float4 getVec() { return v2; } - }; - } -} - -float4 main() : SV_Target0 -{ - return N1::getVec() + N2::getVec() + N2::N3::getVec() + N2::N3::C1::getVec() * N2::gf; -} +static float4 v1; +static float4 v2; + +namespace N1 { + float4 getVec() { return v1; } +} + +namespace N2 { + static float gf; + float4 getVec() { return v2; } + namespace N3 { + float4 getVec() { return v2; } + + class C1 { + float4 getVec() { return v2; } + }; + } +} + +float4 main() : SV_Target0 +{ + return N1::getVec() + N2::getVec() + N2::N3::getVec() + N2::N3::C1::getVec() * N2::gf; +} diff --git a/core/deps/glslang/Test/hlsl.noSemantic.functionality1.comp b/core/deps/glslang/Test/hlsl.noSemantic.functionality1.comp index 9484f7ab2..ac9a7a932 100644 --- a/core/deps/glslang/Test/hlsl.noSemantic.functionality1.comp +++ b/core/deps/glslang/Test/hlsl.noSemantic.functionality1.comp @@ -1,7 +1,7 @@ -AppendStructuredBuffer Buf : register(u0); - -[numthreads(1, 1, 1)] -void main() -{ - Buf.Append(1.0f.xxxx); +AppendStructuredBuffer Buf : register(u0); + +[numthreads(1, 1, 1)] +void main() +{ + Buf.Append(1.0f.xxxx); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag b/core/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag index c60e80a02..3655ed0f9 100644 --- a/core/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag +++ b/core/deps/glslang/Test/hlsl.nonstaticMemberFunction.frag @@ -1,35 +1,35 @@ -static float2 i = float2(1.0, 2.0); - -struct type1 -{ - void setmem(float4 m) { memVar = m; } - void seti(int si) { i = si; } - float4 memVar; - float4 memFun(float4 a) : SV_Position - { - return i * a + memVar; - } - int memFun(int a) : SV_Position - { - return i + a - memVar.z; - } - int i; -}; - -static float2 j = i; - -struct type2 -{ - float2 memFun() { return i; } -}; - -float4 main() : SV_Target0 -{ - type1 test; - test.setmem(float4(2.0,2.0,2.0,2.0)); - test.seti(17); - float4 f4 = float4(1.0,1.0,1.0,1.0); - f4 += test.memFun(float4(5.0f,5.0f,5.0f,5.0f)); - f4 += test.memFun(7); - return f4; -} +static float2 i = float2(1.0, 2.0); + +struct type1 +{ + void setmem(float4 m) { memVar = m; } + void seti(int si) { i = si; } + float4 memVar; + float4 memFun(float4 a) : SV_Position + { + return i * a + memVar; + } + int memFun(int a) : SV_Position + { + return i + a - memVar.z; + } + int i; +}; + +static float2 j = i; + +struct type2 +{ + float2 memFun() { return i; } +}; + +float4 main() : SV_Target0 +{ + type1 test; + test.setmem(float4(2.0,2.0,2.0,2.0)); + test.seti(17); + float4 f4 = float4(1.0,1.0,1.0,1.0); + f4 += test.memFun(float4(5.0f,5.0f,5.0f,5.0f)); + f4 += test.memFun(7); + return f4; +} diff --git a/core/deps/glslang/Test/hlsl.partialFlattenLocal.vert b/core/deps/glslang/Test/hlsl.partialFlattenLocal.vert index 3431f5714..9d6cdc900 100644 --- a/core/deps/glslang/Test/hlsl.partialFlattenLocal.vert +++ b/core/deps/glslang/Test/hlsl.partialFlattenLocal.vert @@ -1,27 +1,27 @@ -Texture2D tex; - -struct Packed { - Texture2D tex; - float3 pos[3]; - float2 uv[2]; - float x; - int n; -}; - -float4 main(float4 pos : POSITION) : SV_POSITION -{ - Packed packed; - packed.tex = tex; - packed.pos[0] = float3(0, 0, 0); - packed.uv[0] = float2(0, 1); - packed.x = 1.0; - packed.n = 3; - - for (int i = 0; i < 1; ++i) { - packed.pos[i].xy += packed.uv[i]; - } - - Packed packed2 = packed; - - return pos + float4(packed2.pos[0], 0); +Texture2D tex; + +struct Packed { + Texture2D tex; + float3 pos[3]; + float2 uv[2]; + float x; + int n; +}; + +float4 main(float4 pos : POSITION) : SV_POSITION +{ + Packed packed; + packed.tex = tex; + packed.pos[0] = float3(0, 0, 0); + packed.uv[0] = float2(0, 1); + packed.x = 1.0; + packed.n = 3; + + for (int i = 0; i < 1; ++i) { + packed.pos[i].xy += packed.uv[i]; + } + + Packed packed2 = packed; + + return pos + float4(packed2.pos[0], 0); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.partialFlattenMixed.vert b/core/deps/glslang/Test/hlsl.partialFlattenMixed.vert index f44de4885..3fc9d68e2 100644 --- a/core/deps/glslang/Test/hlsl.partialFlattenMixed.vert +++ b/core/deps/glslang/Test/hlsl.partialFlattenMixed.vert @@ -1,16 +1,16 @@ -Texture2D tex[2]; - -struct Packed { - int a; - Texture2D membTex[2]; - int b; -}; - -float4 main(float4 pos : POSITION) : SV_POSITION -{ - Packed packed; - - packed.membTex = tex; - - return pos; +Texture2D tex[2]; + +struct Packed { + int a; + Texture2D membTex[2]; + int b; +}; + +float4 main(float4 pos : POSITION) : SV_POSITION +{ + Packed packed; + + packed.membTex = tex; + + return pos; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.partialInit.frag b/core/deps/glslang/Test/hlsl.partialInit.frag index 7defd96b0..01aee8e60 100644 --- a/core/deps/glslang/Test/hlsl.partialInit.frag +++ b/core/deps/glslang/Test/hlsl.partialInit.frag @@ -1,36 +1,36 @@ -struct outs { - int a; - float b; - bool c; - float4 v; -}; - -static float4 gv = {0,0,1}; -static float gfa[3] = {0,0}; - -struct Nest { - float4x3 m; - outs os; - bool b; -}; - -outs PixelShaderFunction(float4 input) : COLOR0 -{ - outs o2 = { 3 }; - outs o4; - o4.v = gv * gfa[2]; - outs o1 = { }; - outs o3 = (outs)0; - o4 = (outs)0; - o4.c = o1.c; - Nest nest = (Nest)0; - - float2 gf2a[4] = { }; - int cgi = { }; - o4.b = gf2a[2].y * cgi; - - return o4; -} - -static const float2 cgf2a[3]; -static const int ci; +struct outs { + int a; + float b; + bool c; + float4 v; +}; + +static float4 gv = {0,0,1}; +static float gfa[3] = {0,0}; + +struct Nest { + float4x3 m; + outs os; + bool b; +}; + +outs PixelShaderFunction(float4 input) : COLOR0 +{ + outs o2 = { 3 }; + outs o4; + o4.v = gv * gfa[2]; + outs o1 = { }; + outs o3 = (outs)0; + o4 = (outs)0; + o4.c = o1.c; + Nest nest = (Nest)0; + + float2 gf2a[4] = { }; + int cgi = { }; + o4.b = gf2a[2].y * cgi; + + return o4; +} + +static const float2 cgf2a[3]; +static const int ci; diff --git a/core/deps/glslang/Test/hlsl.pp.expand.frag b/core/deps/glslang/Test/hlsl.pp.expand.frag index 1d99c6d76..d5318a027 100644 --- a/core/deps/glslang/Test/hlsl.pp.expand.frag +++ b/core/deps/glslang/Test/hlsl.pp.expand.frag @@ -1,18 +1,18 @@ -#define EMP1(a) -#define EMP2(a, b) - -#define EXP1(a) = a -#define EXP2(a, b) = a, b - -struct A -{ - float4 a EMP1({1,2,3,4}); // No PP arg errors - float4 b EMP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // No PP arg errors - float4 c EXP1({1,2,3,4}); // ERROR: No PP arg errors, but init error - float4 d EXP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // ERROR: No PP arg errors, but init error -}; - -void main() -{ - "a string" -} +#define EMP1(a) +#define EMP2(a, b) + +#define EXP1(a) = a +#define EXP2(a, b) = a, b + +struct A +{ + float4 a EMP1({1,2,3,4}); // No PP arg errors + float4 b EMP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // No PP arg errors + float4 c EXP1({1,2,3,4}); // ERROR: No PP arg errors, but init error + float4 d EXP2({({{(({1,2,3,4}))}})}, {{1,2,3,4}}); // ERROR: No PP arg errors, but init error +}; + +void main() +{ + "a string" +} diff --git a/core/deps/glslang/Test/hlsl.reflection.binding.frag b/core/deps/glslang/Test/hlsl.reflection.binding.frag index 0227d5aac..25b22c975 100644 --- a/core/deps/glslang/Test/hlsl.reflection.binding.frag +++ b/core/deps/glslang/Test/hlsl.reflection.binding.frag @@ -1,34 +1,34 @@ - -uniform float u1 : register(b2); - -uniform SamplerState s1 : register(s5); -uniform SamplerState s1a[3] : register(s6); - -uniform Texture1D t1 : register(t15); -uniform Texture1D t1a[3] : register(t16); - -cbuffer cbuff1 : register(b2) { - float4 c1_a; - int c1_b; - float c1_c; -}; - -cbuffer cbuff2 : register(b3) { - float4 c2_a; - int c2_b; - float c2_c; -}; - -struct PS_OUTPUT -{ - float4 Color : Sv_Target0; -}; - -void main(out PS_OUTPUT psout) -{ - psout.Color = - t1.Sample(s1, 0.3) + - t1a[0].Sample(s1a[0], 0.3) + - c1_a + c1_b + c1_c + - c2_a + c2_b + c2_c; -} + +uniform float u1 : register(b2); + +uniform SamplerState s1 : register(s5); +uniform SamplerState s1a[3] : register(s6); + +uniform Texture1D t1 : register(t15); +uniform Texture1D t1a[3] : register(t16); + +cbuffer cbuff1 : register(b2) { + float4 c1_a; + int c1_b; + float c1_c; +}; + +cbuffer cbuff2 : register(b3) { + float4 c2_a; + int c2_b; + float c2_c; +}; + +struct PS_OUTPUT +{ + float4 Color : Sv_Target0; +}; + +void main(out PS_OUTPUT psout) +{ + psout.Color = + t1.Sample(s1, 0.3) + + t1a[0].Sample(s1a[0], 0.3) + + c1_a + c1_b + c1_c + + c2_a + c2_b + c2_c; +} diff --git a/core/deps/glslang/Test/hlsl.reflection.vert b/core/deps/glslang/Test/hlsl.reflection.vert index 9cdbbddc5..06207c74f 100644 --- a/core/deps/glslang/Test/hlsl.reflection.vert +++ b/core/deps/glslang/Test/hlsl.reflection.vert @@ -1,138 +1,138 @@ - -cbuffer nameless { - float3 anonMember1; - float3x2 m23; - int scalarAfterm23; - float4 anonDeadMember2; - float4 anonMember3; - int scalarBeforeArray; - float floatArray[5]; - int scalarAfterArray; - float2x2 m22[9]; -}; - -cbuffer c_nameless { - float3 c_anonMember1; - float3x2 c_m23; - int c_scalarAfterm23; - float4 c_anonDeadMember2; - float4 c_anonMember3; -}; - -cbuffer namelessdead { - int a; -}; - -struct N1 { - float a; -}; - -struct N2 { - float b; - float c; - float d; -}; - -struct N3 { - N1 n1; - N2 n2; -}; - -cbuffer nested { - N3 foo; -} - -struct TS { - int a; - int dead; -}; - -uniform TS s; - -uniform float uf1; -uniform float uf2; -uniform float ufDead3; -uniform float ufDead4; - -uniform float2x2 dm22[10]; - -struct deep1 { - float2 va[3]; - bool b; -}; - -struct deep2 { - int i; - deep1 d1[4]; -}; - -struct deep3 { - float4 iv4; - deep2 d2; - int3 v3; -}; - -uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; - -const bool control = true; - -void deadFunction() -{ - float4 v = anonDeadMember2; - float f = ufDead4; -} - -void liveFunction2() -{ - float3 v = anonMember1; - float f = uf1; -} - -tbuffer abl { - float foo1; -} - -tbuffer abl2 { - float foo2; -} - -void flizv(in float attributeFloat, in float2 attributeFloat2, in float3 attributeFloat3, in float4 attributeFloat4, in float4x4 attributeMat4) -{ - liveFunction2(); - - if (! control) - deadFunction(); - - float f; - int i; - if (control) { - liveFunction2(); - f = anonMember3.z; - f = s.a; - f = m23[1].y + scalarAfterm23; - f = c_m23[1].y + c_scalarAfterm23; - f += scalarBeforeArray; - f += floatArray[2]; - f += floatArray[4]; - f += scalarAfterArray; - f += m22[i][1][0]; - f += dm22[3][0][1]; - f += m22[2][1].y; - f += foo.n1.a + foo.n2.b + foo.n2.c + foo.n2.d; - f += deepA[i].d2.d1[2].va[1].x; - f += deepB[1].d2.d1[i].va[1].x; - f += deepB[i].d2.d1[i].va[1].x; - deep3 d = deepC[1]; - deep3 da[2] = deepD; - } else - f = ufDead3; - - f += foo1 + foo2; - f += foo2; - - f += attributeFloat; - f += attributeFloat2.x; - f += attributeFloat3.x; - f += attributeFloat4.x; - f += attributeMat4[0][1]; -} + +cbuffer nameless { + float3 anonMember1; + float3x2 m23; + int scalarAfterm23; + float4 anonDeadMember2; + float4 anonMember3; + int scalarBeforeArray; + float floatArray[5]; + int scalarAfterArray; + float2x2 m22[9]; +}; + +cbuffer c_nameless { + float3 c_anonMember1; + float3x2 c_m23; + int c_scalarAfterm23; + float4 c_anonDeadMember2; + float4 c_anonMember3; +}; + +cbuffer namelessdead { + int a; +}; + +struct N1 { + float a; +}; + +struct N2 { + float b; + float c; + float d; +}; + +struct N3 { + N1 n1; + N2 n2; +}; + +cbuffer nested { + N3 foo; +} + +struct TS { + int a; + int dead; +}; + +uniform TS s; + +uniform float uf1; +uniform float uf2; +uniform float ufDead3; +uniform float ufDead4; + +uniform float2x2 dm22[10]; + +struct deep1 { + float2 va[3]; + bool b; +}; + +struct deep2 { + int i; + deep1 d1[4]; +}; + +struct deep3 { + float4 iv4; + deep2 d2; + int3 v3; +}; + +uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; + +const bool control = true; + +void deadFunction() +{ + float4 v = anonDeadMember2; + float f = ufDead4; +} + +void liveFunction2() +{ + float3 v = anonMember1; + float f = uf1; +} + +tbuffer abl { + float foo1; +} + +tbuffer abl2 { + float foo2; +} + +void flizv(in float attributeFloat, in float2 attributeFloat2, in float3 attributeFloat3, in float4 attributeFloat4, in float4x4 attributeMat4) +{ + liveFunction2(); + + if (! control) + deadFunction(); + + float f; + int i; + if (control) { + liveFunction2(); + f = anonMember3.z; + f = s.a; + f = m23[1].y + scalarAfterm23; + f = c_m23[1].y + c_scalarAfterm23; + f += scalarBeforeArray; + f += floatArray[2]; + f += floatArray[4]; + f += scalarAfterArray; + f += m22[i][1][0]; + f += dm22[3][0][1]; + f += m22[2][1].y; + f += foo.n1.a + foo.n2.b + foo.n2.c + foo.n2.d; + f += deepA[i].d2.d1[2].va[1].x; + f += deepB[1].d2.d1[i].va[1].x; + f += deepB[i].d2.d1[i].va[1].x; + deep3 d = deepC[1]; + deep3 da[2] = deepD; + } else + f = ufDead3; + + f += foo1 + foo2; + f += foo2; + + f += attributeFloat; + f += attributeFloat2.x; + f += attributeFloat3.x; + f += attributeFloat4.x; + f += attributeMat4[0][1]; +} diff --git a/core/deps/glslang/Test/hlsl.scalarCast.vert b/core/deps/glslang/Test/hlsl.scalarCast.vert index 00c6782e3..83bfd6eb2 100644 --- a/core/deps/glslang/Test/hlsl.scalarCast.vert +++ b/core/deps/glslang/Test/hlsl.scalarCast.vert @@ -1,37 +1,37 @@ -struct VertexOut { - float4 position : SV_Position; - float2 texCoord : TEXCOORD; -}; -VertexOut r0() { - const float f = 2.0; - return (VertexOut)f; -} -VertexOut r1() { - const float f = 2.0; - return (VertexOut)(f + 1.0); -} -VertexOut r2() { - const float f = 2.0; - return (VertexOut)(sin(f)); -} -VertexOut r3() { - float f = 2.0; - return (VertexOut)f; -} -VertexOut r4() { - float f = 2.0; - return (VertexOut)(f + 1.0); -} -VertexOut r5() { - float f = 2.0; - return (VertexOut)(sin(f)); -} -VertexOut main() { - VertexOut v0 = r0(); - VertexOut v1 = r1(); - VertexOut v2 = r2(); - VertexOut v3 = r3(); - VertexOut v4 = r4(); - VertexOut v5 = r5(); - return (VertexOut)1; -} +struct VertexOut { + float4 position : SV_Position; + float2 texCoord : TEXCOORD; +}; +VertexOut r0() { + const float f = 2.0; + return (VertexOut)f; +} +VertexOut r1() { + const float f = 2.0; + return (VertexOut)(f + 1.0); +} +VertexOut r2() { + const float f = 2.0; + return (VertexOut)(sin(f)); +} +VertexOut r3() { + float f = 2.0; + return (VertexOut)f; +} +VertexOut r4() { + float f = 2.0; + return (VertexOut)(f + 1.0); +} +VertexOut r5() { + float f = 2.0; + return (VertexOut)(sin(f)); +} +VertexOut main() { + VertexOut v0 = r0(); + VertexOut v1 = r1(); + VertexOut v2 = r2(); + VertexOut v3 = r3(); + VertexOut v4 = r4(); + VertexOut v5 = r5(); + return (VertexOut)1; +} diff --git a/core/deps/glslang/Test/hlsl.semantic.geom b/core/deps/glslang/Test/hlsl.semantic.geom index fc6a53ab4..9e0ed4cec 100644 --- a/core/deps/glslang/Test/hlsl.semantic.geom +++ b/core/deps/glslang/Test/hlsl.semantic.geom @@ -14,3 +14,11 @@ void main(triangle in uint VertexID[3] : VertexID, S s; OutputStream.Append(s); } + +[maxvertexcount(4)] +void notmain(line in uint VertexID[2] : VertexID, + inout LineStream OutputStream) +{ + S s; + OutputStream.Append(s); +} diff --git a/core/deps/glslang/Test/hlsl.shapeConvRet.frag b/core/deps/glslang/Test/hlsl.shapeConvRet.frag index 19ee19037..7d7755821 100644 --- a/core/deps/glslang/Test/hlsl.shapeConvRet.frag +++ b/core/deps/glslang/Test/hlsl.shapeConvRet.frag @@ -1,9 +1,9 @@ -int3 foo() -{ - return 13; -} - -float4 main(float f) -{ - return f; -} +int3 foo() +{ + return 13; +} + +float4 main(float f) +{ + return f; +} diff --git a/core/deps/glslang/Test/hlsl.singleArgIntPromo.vert b/core/deps/glslang/Test/hlsl.singleArgIntPromo.vert new file mode 100755 index 000000000..5c99a38cc --- /dev/null +++ b/core/deps/glslang/Test/hlsl.singleArgIntPromo.vert @@ -0,0 +1,16 @@ +float main(): SV_Target0 +{ + int d = 4; + int2 d2 = int2(5,d); + float f1 = log2(5); + float2 f2 = log(d2); + float3 f3 = log(int3(7,2,3)); + float2 f22 = log(int2(5,d)); // This case does not work yet, due to a different bug that turns this into 2 args. + + int a = 5; + min16float b = min16float(f16tof32(a)); + b *= b; + uint c = f32tof16(b); + + return f1 + f2.x + f3.z + f22.y + c; +} \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.specConstant.frag b/core/deps/glslang/Test/hlsl.specConstant.frag index 9230f51a0..ab2a815ec 100755 --- a/core/deps/glslang/Test/hlsl.specConstant.frag +++ b/core/deps/glslang/Test/hlsl.specConstant.frag @@ -1,15 +1,15 @@ -[[vk::constant_id(0)]] const uint index = 2; - -static const uint array[] = { 10, 20, 30, 40 }; - -float4 main( ) : SV_TARGET -{ - float4 r; - for(uint i = 0; i < array[index]; i++) - r = i; - - r += index + index; - r += 2 * index; - - return r; -} +[[vk::constant_id(0)]] const uint index = 2; + +static const uint array[] = { 10, 20, 30, 40 }; + +float4 main( ) : SV_TARGET +{ + float4 r; + for(uint i = 0; i < array[index]; i++) + r = i; + + r += index + index; + r += 2 * index; + + return r; +} diff --git a/core/deps/glslang/Test/hlsl.staticMemberFunction.frag b/core/deps/glslang/Test/hlsl.staticMemberFunction.frag index 13634102e..700aa82c3 100644 --- a/core/deps/glslang/Test/hlsl.staticMemberFunction.frag +++ b/core/deps/glslang/Test/hlsl.staticMemberFunction.frag @@ -1,22 +1,22 @@ -struct Test -{ - float4 memVar; - static float4 staticMemFun(float4 a) : SV_Position - { - return 2 * a; - } - static int staticMemFun(int a) : SV_Position - { - return 2 + a; - } - int i; -}; - -float4 main() : SV_Target0 -{ - Test test; - float4 f4 = float4(1.0,1.0,1.0,1.0); - f4 += Test::staticMemFun(float4(5.0f,5.0f,5.0f,5.0f)); - f4 += Test::staticMemFun(7); - return f4; -} +struct Test +{ + float4 memVar; + static float4 staticMemFun(float4 a) : SV_Position + { + return 2 * a; + } + static int staticMemFun(int a) : SV_Position + { + return 2 + a; + } + int i; +}; + +float4 main() : SV_Target0 +{ + Test test; + float4 f4 = float4(1.0,1.0,1.0,1.0); + f4 += Test::staticMemFun(float4(5.0f,5.0f,5.0f,5.0f)); + f4 += Test::staticMemFun(7); + return f4; +} diff --git a/core/deps/glslang/Test/hlsl.struct.frag b/core/deps/glslang/Test/hlsl.struct.frag index 9b7afd854..33199e067 100644 --- a/core/deps/glslang/Test/hlsl.struct.frag +++ b/core/deps/glslang/Test/hlsl.struct.frag @@ -30,11 +30,11 @@ struct IN_S { float ff5 : packoffset(c101.y) : register(ps_5_0, s[5]); float ff6 : packoffset(c102.y) : register(s3[5]); -struct empty {}; - -struct containEmpty { - empty e; -}; +struct empty {}; + +struct containEmpty { + empty e; +}; float4 PixelShaderFunction(float4 input, IN_S s) : COLOR0 { diff --git a/core/deps/glslang/Test/hlsl.structIoFourWay.frag b/core/deps/glslang/Test/hlsl.structIoFourWay.frag index bf3ce9564..bca135e73 100644 --- a/core/deps/glslang/Test/hlsl.structIoFourWay.frag +++ b/core/deps/glslang/Test/hlsl.structIoFourWay.frag @@ -1,18 +1,18 @@ -struct T { - float f : packoffset(c4.y); // artificial, but validates all different treatments: uniform offset - centroid float g; // interpolant input - float d: SV_DepthGreaterEqual; // fragment output - float4 normal; // non-IO -}; - -T s; // loose uniform - -cbuffer buff { - T t : packoffset(c5.z); -}; - -T main(T t : myInput) : SV_Target0 -{ - T local; - return local; -} +struct T { + float f : packoffset(c4.y); // artificial, but validates all different treatments: uniform offset + centroid float g; // interpolant input + float d: SV_DepthGreaterEqual; // fragment output + float4 normal; // non-IO +}; + +T s; // loose uniform + +cbuffer buff { + T t : packoffset(c5.z); +}; + +T main(T t : myInput) : SV_Target0 +{ + T local; + return local; +} diff --git a/core/deps/glslang/Test/hlsl.structStructName.frag b/core/deps/glslang/Test/hlsl.structStructName.frag index 63c385003..f8bf90c74 100644 --- a/core/deps/glslang/Test/hlsl.structStructName.frag +++ b/core/deps/glslang/Test/hlsl.structStructName.frag @@ -1,7 +1,7 @@ -struct S { int s; }; - -int main() -{ - struct S t; - return t.s; -} +struct S { int s; }; + +int main() +{ + struct S t; + return t.s; +} diff --git a/core/deps/glslang/Test/hlsl.synthesizeInput.frag b/core/deps/glslang/Test/hlsl.synthesizeInput.frag index 7d3ad070b..c4b2fa4c8 100644 --- a/core/deps/glslang/Test/hlsl.synthesizeInput.frag +++ b/core/deps/glslang/Test/hlsl.synthesizeInput.frag @@ -1,9 +1,9 @@ -struct PSInput { - float interp; - uint no_interp; -}; - -float4 main(PSInput input : INPUT) : SV_TARGET -{ - return float4(float(input.no_interp), input.interp, 0, 1); +struct PSInput { + float interp; + uint no_interp; +}; + +float4 main(PSInput input : INPUT) : SV_TARGET +{ + return float4(float(input.no_interp), input.interp, 0, 1); } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.target.frag b/core/deps/glslang/Test/hlsl.target.frag index 50570dbb4..5317236a0 100644 --- a/core/deps/glslang/Test/hlsl.target.frag +++ b/core/deps/glslang/Test/hlsl.target.frag @@ -1,10 +1,10 @@ -struct PSInput { - float interp; - uint no_interp; -}; - -void main(PSInput input : INPUT, out float4 out1 : SV_TARGET1, out float4 out2 : SV_TARGET3) -{ - out1 = 1; - out2 = 0; +struct PSInput { + float interp; + uint no_interp; +}; + +void main(PSInput input : INPUT, out float4 out1 : SV_TARGET1, out float4 out2 : SV_TARGET3) +{ + out1 = 1; + out2 = 0; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.targetStruct1.frag b/core/deps/glslang/Test/hlsl.targetStruct1.frag index 015030de3..7fcc0827d 100644 --- a/core/deps/glslang/Test/hlsl.targetStruct1.frag +++ b/core/deps/glslang/Test/hlsl.targetStruct1.frag @@ -1,19 +1,19 @@ -struct PSInput { - float interp; - uint no_interp; -}; - -struct PSOutput { - float4 o1 : SV_TARGET2; - float4 o2 : SV_TARGET1; -}; - -PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) -{ - PSOutput pso; - pso.o1 = float4(float(input.no_interp), input.interp, 0, 1); - pso.o2 = 1; - po = 0; - - return pso; +struct PSInput { + float interp; + uint no_interp; +}; + +struct PSOutput { + float4 o1 : SV_TARGET2; + float4 o2 : SV_TARGET1; +}; + +PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) +{ + PSOutput pso; + pso.o1 = float4(float(input.no_interp), input.interp, 0, 1); + pso.o2 = 1; + po = 0; + + return pso; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.targetStruct2.frag b/core/deps/glslang/Test/hlsl.targetStruct2.frag index 43f22acb4..e62ba0f6e 100644 --- a/core/deps/glslang/Test/hlsl.targetStruct2.frag +++ b/core/deps/glslang/Test/hlsl.targetStruct2.frag @@ -1,19 +1,19 @@ -struct PSInput { - float interp; - uint no_interp; -}; - -struct PSOutput { - float4 o1 : SV_TARGET1; - float4 o2 : SV_TARGET0; -}; - -PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) : SV_TARGET2 -{ - PSOutput pso; - pso.o1 = float4(float(input.no_interp), input.interp, 0, 1); - pso.o2 = 1; - po = 0; - - return pso; +struct PSInput { + float interp; + uint no_interp; +}; + +struct PSOutput { + float4 o1 : SV_TARGET1; + float4 o2 : SV_TARGET0; +}; + +PSOutput main(PSInput input : INPUT, out float4 po : SV_TARGET0) : SV_TARGET2 +{ + PSOutput pso; + pso.o1 = float4(float(input.no_interp), input.interp, 0, 1); + pso.o2 = 1; + po = 0; + + return pso; } \ No newline at end of file diff --git a/core/deps/glslang/Test/hlsl.this.frag b/core/deps/glslang/Test/hlsl.this.frag index afd61f18c..645fe5134 100644 --- a/core/deps/glslang/Test/hlsl.this.frag +++ b/core/deps/glslang/Test/hlsl.this.frag @@ -1,29 +1,29 @@ -static float2 var = float2(1.0, 2.0); - -struct type1 -{ - int memFun1(int3 var) - { - return var.z + this.var + var2; - } - int memFun2(int a) - { - int3 var = int3(1,2,3); - return var.z + (int)bar.y + this.var2; - } - float2 bar; - int var; - int var2; -}; - -float4 main() : SV_Target0 -{ - type1 T; - T.bar = var; - T.var = 7; - T.var2 = 9; - int i = T.memFun1(int3(10,11,12)); - i += T.memFun2(17); - - return float4(i,i,i,i); -} +static float2 var = float2(1.0, 2.0); + +struct type1 +{ + int memFun1(int3 var) + { + return var.z + this.var + var2; + } + int memFun2(int a) + { + int3 var = int3(1,2,3); + return var.z + (int)bar.y + this.var2; + } + float2 bar; + int var; + int var2; +}; + +float4 main() : SV_Target0 +{ + type1 T; + T.bar = var; + T.var = 7; + T.var2 = 9; + int i = T.memFun1(int3(10,11,12)); + i += T.memFun2(17); + + return float4(i,i,i,i); +} diff --git a/core/deps/glslang/Test/hlsl.type.half.frag b/core/deps/glslang/Test/hlsl.type.half.frag index c06bebbcb..a78afabf9 100644 --- a/core/deps/glslang/Test/hlsl.type.half.frag +++ b/core/deps/glslang/Test/hlsl.type.half.frag @@ -7,21 +7,21 @@ float4 main() : SV_Target0 half3 h3 = 3; half4 h4 = 4; - half1x1 h11; - half1x2 h12; - half1x3 h13; - half1x4 h14; - half2x1 h21; - half2x2 h22 = half2x2(1,2,3,4); - half2x3 h23 = (half2x3)4.9; - half2x4 h24; - half3x1 h31; - half3x2 h32; - half3x3 h33; - half3x4 h34; - half4x1 h41; - half4x2 h42; - half4x3 h43; + half1x1 h11; + half1x2 h12; + half1x3 h13; + half1x4 h14; + half2x1 h21; + half2x2 h22 = half2x2(1,2,3,4); + half2x3 h23 = (half2x3)4.9; + half2x4 h24; + half3x1 h31; + half3x2 h32; + half3x3 h33; + half3x4 h34; + half4x1 h41; + half4x2 h42; + half4x3 h43; half4x4 h44; return h23._11 + h4.y + h0; diff --git a/core/deps/glslang/Test/hlsl.type.type.conversion.all.frag b/core/deps/glslang/Test/hlsl.type.type.conversion.all.frag index 404d0e1ef..1883b0187 100644 --- a/core/deps/glslang/Test/hlsl.type.type.conversion.all.frag +++ b/core/deps/glslang/Test/hlsl.type.type.conversion.all.frag @@ -1,190 +1,190 @@ -#define zeros 0 -#define zeros1 0 -#define zeros2 0, 0 -#define zeros3 0, 0, 0 -#define zeros4 0, 0, 0, 0 -#define zeros5 0, 0, 0, 0, 0 -#define zeros6 0, 0, 0, 0, 0, 0 -#define zeros7 0, 0, 0, 0, 0, 0, 0 -#define zeros8 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros9 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -float4 main() : SV_Target { - float var0 = float(zeros1); - float2 var13 = float(zeros1); - float2 var14 = float2(zeros2); - float3 var26 = float(zeros1); - float3 var28 = float3(zeros3); - float4 var39 = float(zeros1); - float4 var42 = float4(zeros4); - float4 var43 = float2x2(zeros4); - float2x2 var52 = float(zeros1); - float2x2 var55 = float4(zeros4); - float2x2 var56 = float2x2(zeros4); - float2x3 var65 = float(zeros1); - float2x3 var70 = float2x3(zeros6); - float2x4 var78 = float(zeros1); - float2x4 var84 = float2x4(zeros8); - float3x2 var91 = float(zeros1); - float3x2 var98 = float3x2(zeros6); - float3x3 var104 = float(zeros1); - float3x3 var112 = float3x3(zeros9); - float3x4 var117 = float(zeros1); - float3x4 var126 = float3x4(zeros12); - float4x2 var130 = float(zeros1); - float4x2 var140 = float4x2(zeros8); - float4x3 var143 = float(zeros1); - float4x3 var154 = float4x3(zeros12); - float4x4 var156 = float(zeros1); - float4x4 var168 = float4x4(zeros16); - float var1 = float2(zeros2);// warning X3206: implicit truncation of vector type - float var2 = float3(zeros3);// warning X3206: implicit truncation of vector type - float var3 = float4(zeros4);// warning X3206: implicit truncation of vector type - float var4 = float2x2(zeros4);// warning X3206: implicit truncation of vector type - float var5 = float2x3(zeros6);// warning X3206: implicit truncation of vector type - float var6 = float2x4(zeros8);// warning X3206: implicit truncation of vector type - float var7 = float3x2(zeros6);// warning X3206: implicit truncation of vector type - float var8 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float var9 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float var10 = float4x2(zeros8);// warning X3206: implicit truncation of vector type - float var11 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float var12 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2 var15 = float3(zeros3);// warning X3206: implicit truncation of vector type - float2 var16 = float4(zeros4);// warning X3206: implicit truncation of vector type - float3 var29 = float4(zeros4);// warning X3206: implicit truncation of vector type - float2x2 var57 = float2x3(zeros6);// warning X3206: implicit truncation of vector type - float2x2 var58 = float2x4(zeros8);// warning X3206: implicit truncation of vector type - float2x2 var59 = float3x2(zeros6);// warning X3206: implicit truncation of vector type - float2x2 var60 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float2x2 var61 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float2x2 var62 = float4x2(zeros8);// warning X3206: implicit truncation of vector type - float2x2 var63 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float2x2 var64 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2x3 var71 = float2x4(zeros8);// warning X3206: implicit truncation of vector type - float2x3 var73 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float2x3 var74 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float2x3 var76 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float2x3 var77 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2x4 var87 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float2x4 var90 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float3x2 var99 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float3x2 var100 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float3x2 var101 = float4x2(zeros8);// warning X3206: implicit truncation of vector type - float3x2 var102 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float3x2 var103 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float3x3 var113 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float3x3 var115 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float3x3 var116 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float3x4 var129 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float4x2 var141 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float4x2 var142 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float4x3 var155 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2 var17 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2' - float2 var18 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float2' - float2 var19 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float2' - float2 var20 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2' - float2 var21 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float2' - float2 var22 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float2' - float2 var23 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2' - float2 var24 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float2' - float2 var25 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float2' - float3 var27 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3' - float3 var30 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3' - float3 var31 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3' - float3 var32 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3' - float3 var33 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3' - float3 var34 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float3' - float3 var35 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float3' - float3 var36 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3' - float3 var37 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float3' - float3 var38 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float3' - float4 var40 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4' - float4 var41 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4' - float4 var44 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4' - float4 var45 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4' - float4 var46 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4' - float4 var47 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4' - float4 var48 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4' - float4 var49 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4' - float4 var50 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float4' - float4 var51 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float4' - float2x2 var53 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x2' - float2x2 var54 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x2' - float2x3 var66 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x3' - float2x3 var67 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x3' - float2x3 var68 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float2x3' - float2x3 var69 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2x3' - float2x3 var72 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2x3' - float2x3 var75 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2x3' - float2x4 var79 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x4' - float2x4 var80 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x4' - float2x4 var81 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float2x4' - float2x4 var82 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2x4' - float2x4 var83 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float2x4' - float2x4 var85 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2x4' - float2x4 var86 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float2x4' - float2x4 var88 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2x4' - float2x4 var89 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float2x4' - float3x2 var92 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x2' - float3x2 var93 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x2' - float3x2 var94 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x2' - float3x2 var95 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x2' - float3x2 var96 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x2' - float3x2 var97 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x2' - float3x3 var105 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x3' - float3x3 var106 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x3' - float3x3 var107 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x3' - float3x3 var108 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x3' - float3x3 var109 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x3' - float3x3 var110 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x3' - float3x3 var111 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3x3' - float3x3 var114 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3x3' - float3x4 var118 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x4' - float3x4 var119 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x4' - float3x4 var120 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x4' - float3x4 var121 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x4' - float3x4 var122 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x4' - float3x4 var123 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x4' - float3x4 var124 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3x4' - float3x4 var125 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float3x4' - float3x4 var127 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3x4' - float3x4 var128 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float3x4' - float4x2 var131 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x2' - float4x2 var132 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x2' - float4x2 var133 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x2' - float4x2 var134 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x2' - float4x2 var135 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x2' - float4x2 var136 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x2' - float4x2 var137 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x2' - float4x2 var138 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x2' - float4x2 var139 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x2' - float4x3 var144 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x3' - float4x3 var145 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x3' - float4x3 var146 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x3' - float4x3 var147 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x3' - float4x3 var148 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x3' - float4x3 var149 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x3' - float4x3 var150 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x3' - float4x3 var151 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x3' - float4x3 var152 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x3' - float4x3 var153 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4x3' - float4x4 var157 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x4' - float4x4 var158 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x4' - float4x4 var159 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x4' - float4x4 var160 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x4' - float4x4 var161 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x4' - float4x4 var162 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x4' - float4x4 var163 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x4' - float4x4 var164 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x4' - float4x4 var165 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x4' - float4x4 var166 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4x4' - float4x4 var167 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float4x4' - return 0; -} - +#define zeros 0 +#define zeros1 0 +#define zeros2 0, 0 +#define zeros3 0, 0, 0 +#define zeros4 0, 0, 0, 0 +#define zeros5 0, 0, 0, 0, 0 +#define zeros6 0, 0, 0, 0, 0, 0 +#define zeros7 0, 0, 0, 0, 0, 0, 0 +#define zeros8 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros9 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +float4 main() : SV_Target { + float var0 = float(zeros1); + float2 var13 = float(zeros1); + float2 var14 = float2(zeros2); + float3 var26 = float(zeros1); + float3 var28 = float3(zeros3); + float4 var39 = float(zeros1); + float4 var42 = float4(zeros4); + float4 var43 = float2x2(zeros4); + float2x2 var52 = float(zeros1); + float2x2 var55 = float4(zeros4); + float2x2 var56 = float2x2(zeros4); + float2x3 var65 = float(zeros1); + float2x3 var70 = float2x3(zeros6); + float2x4 var78 = float(zeros1); + float2x4 var84 = float2x4(zeros8); + float3x2 var91 = float(zeros1); + float3x2 var98 = float3x2(zeros6); + float3x3 var104 = float(zeros1); + float3x3 var112 = float3x3(zeros9); + float3x4 var117 = float(zeros1); + float3x4 var126 = float3x4(zeros12); + float4x2 var130 = float(zeros1); + float4x2 var140 = float4x2(zeros8); + float4x3 var143 = float(zeros1); + float4x3 var154 = float4x3(zeros12); + float4x4 var156 = float(zeros1); + float4x4 var168 = float4x4(zeros16); + float var1 = float2(zeros2);// warning X3206: implicit truncation of vector type + float var2 = float3(zeros3);// warning X3206: implicit truncation of vector type + float var3 = float4(zeros4);// warning X3206: implicit truncation of vector type + float var4 = float2x2(zeros4);// warning X3206: implicit truncation of vector type + float var5 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float var6 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float var7 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float var8 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float var9 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float var10 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float var11 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float var12 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2 var15 = float3(zeros3);// warning X3206: implicit truncation of vector type + float2 var16 = float4(zeros4);// warning X3206: implicit truncation of vector type + float3 var29 = float4(zeros4);// warning X3206: implicit truncation of vector type + float2x2 var57 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var58 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var59 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var60 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x2 var61 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var62 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var63 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var64 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x3 var71 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x3 var73 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x3 var74 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var76 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var77 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x4 var87 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x4 var90 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x2 var99 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float3x2 var100 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var101 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float3x2 var102 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var103 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x3 var113 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var115 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var116 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x4 var129 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x2 var141 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float4x2 var142 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x3 var155 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2 var17 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2' + float2 var18 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float2' + float2 var19 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float2' + float2 var20 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2' + float2 var21 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float2' + float2 var22 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float2' + float2 var23 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2' + float2 var24 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float2' + float2 var25 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float2' + float3 var27 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3' + float3 var30 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3' + float3 var31 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3' + float3 var32 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3' + float3 var33 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3' + float3 var34 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float3' + float3 var35 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float3' + float3 var36 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3' + float3 var37 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float3' + float3 var38 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float3' + float4 var40 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4' + float4 var41 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4' + float4 var44 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4' + float4 var45 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4' + float4 var46 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4' + float4 var47 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4' + float4 var48 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4' + float4 var49 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4' + float4 var50 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float4' + float4 var51 = float4x4(zeros16);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x4' to 'float4' + float2x2 var53 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x2' + float2x2 var54 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x2' + float2x3 var66 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x3' + float2x3 var67 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x3' + float2x3 var68 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float2x3' + float2x3 var69 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2x3' + float2x3 var72 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2x3' + float2x3 var75 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2x3' + float2x4 var79 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float2x4' + float2x4 var80 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float2x4' + float2x4 var81 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float2x4' + float2x4 var82 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float2x4' + float2x4 var83 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float2x4' + float2x4 var85 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float2x4' + float2x4 var86 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float2x4' + float2x4 var88 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float2x4' + float2x4 var89 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float2x4' + float3x2 var92 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x2' + float3x2 var93 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x2' + float3x2 var94 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x2' + float3x2 var95 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x2' + float3x2 var96 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x2' + float3x2 var97 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x2' + float3x3 var105 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x3' + float3x3 var106 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x3' + float3x3 var107 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x3' + float3x3 var108 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x3' + float3x3 var109 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x3' + float3x3 var110 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x3' + float3x3 var111 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3x3' + float3x3 var114 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3x3' + float3x4 var118 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float3x4' + float3x4 var119 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float3x4' + float3x4 var120 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float3x4' + float3x4 var121 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float3x4' + float3x4 var122 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float3x4' + float3x4 var123 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float3x4' + float3x4 var124 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float3x4' + float3x4 var125 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float3x4' + float3x4 var127 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float3x4' + float3x4 var128 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float3x4' + float4x2 var131 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x2' + float4x2 var132 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x2' + float4x2 var133 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x2' + float4x2 var134 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x2' + float4x2 var135 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x2' + float4x2 var136 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x2' + float4x2 var137 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x2' + float4x2 var138 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x2' + float4x2 var139 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x2' + float4x3 var144 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x3' + float4x3 var145 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x3' + float4x3 var146 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x3' + float4x3 var147 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x3' + float4x3 var148 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x3' + float4x3 var149 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x3' + float4x3 var150 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x3' + float4x3 var151 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x3' + float4x3 var152 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x3' + float4x3 var153 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4x3' + float4x4 var157 = float2(zeros2);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2' to 'float4x4' + float4x4 var158 = float3(zeros3);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3' to 'float4x4' + float4x4 var159 = float4(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4' to 'float4x4' + float4x4 var160 = float2x2(zeros4);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x2' to 'float4x4' + float4x4 var161 = float2x3(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x3' to 'float4x4' + float4x4 var162 = float2x4(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float2x4' to 'float4x4' + float4x4 var163 = float3x2(zeros6);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x2' to 'float4x4' + float4x4 var164 = float3x3(zeros9);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x3' to 'float4x4' + float4x4 var165 = float3x4(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float3x4' to 'float4x4' + float4x4 var166 = float4x2(zeros8);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x2' to 'float4x4' + float4x4 var167 = float4x3(zeros12);// Compilation failed because: error X3017: cannot implicitly convert from 'const float4x3' to 'float4x4' + return 0; +} + diff --git a/core/deps/glslang/Test/hlsl.type.type.conversion.valid.frag b/core/deps/glslang/Test/hlsl.type.type.conversion.valid.frag index cba8f5ed4..114edbcca 100644 --- a/core/deps/glslang/Test/hlsl.type.type.conversion.valid.frag +++ b/core/deps/glslang/Test/hlsl.type.type.conversion.valid.frag @@ -1,90 +1,90 @@ -#define zeros 0 -#define zeros1 0 -#define zeros2 0, 0 -#define zeros3 0, 0, 0 -#define zeros4 0, 0, 0, 0 -#define zeros5 0, 0, 0, 0, 0 -#define zeros6 0, 0, 0, 0, 0, 0 -#define zeros7 0, 0, 0, 0, 0, 0, 0 -#define zeros8 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros9 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -#define zeros16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -float4 main() : SV_Target { - float var0 = float(zeros1); - float2 var13 = float(zeros1); - float2 var14 = float2(zeros2); - float3 var26 = float(zeros1); - float3 var28 = float3(zeros3); - float4 var39 = float(zeros1); - float4 var42 = float4(zeros4); - float4 var43 = float2x2(zeros4); - float2x2 var52 = float(zeros1); - float2x2 var55 = float4(zeros4); - float2x2 var56 = float2x2(zeros4); - float2x3 var65 = float(zeros1); - float2x3 var70 = float2x3(zeros6); - float2x4 var78 = float(zeros1); - float2x4 var84 = float2x4(zeros8); - float3x2 var91 = float(zeros1); - float3x2 var98 = float3x2(zeros6); - float3x3 var104 = float(zeros1); - float3x3 var112 = float3x3(zeros9); - float3x4 var117 = float(zeros1); - float3x4 var126 = float3x4(zeros12); - float4x2 var130 = float(zeros1); - float4x2 var140 = float4x2(zeros8); - float4x3 var143 = float(zeros1); - float4x3 var154 = float4x3(zeros12); - float4x4 var156 = float(zeros1); - float4x4 var168 = float4x4(zeros16); - float var1 = float2(zeros2);// warning X3206: implicit truncation of vector type - float var2 = float3(zeros3);// warning X3206: implicit truncation of vector type - float var3 = float4(zeros4);// warning X3206: implicit truncation of vector type - float var4 = float2x2(zeros4);// warning X3206: implicit truncation of vector type - float var5 = float2x3(zeros6);// warning X3206: implicit truncation of vector type - float var6 = float2x4(zeros8);// warning X3206: implicit truncation of vector type - float var7 = float3x2(zeros6);// warning X3206: implicit truncation of vector type - float var8 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float var9 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float var10 = float4x2(zeros8);// warning X3206: implicit truncation of vector type - float var11 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float var12 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2 var15 = float3(zeros3);// warning X3206: implicit truncation of vector type - float2 var16 = float4(zeros4);// warning X3206: implicit truncation of vector type - float3 var29 = float4(zeros4);// warning X3206: implicit truncation of vector type - float2x2 var57 = float2x3(zeros6);// warning X3206: implicit truncation of vector type - float2x2 var58 = float2x4(zeros8);// warning X3206: implicit truncation of vector type - float2x2 var59 = float3x2(zeros6);// warning X3206: implicit truncation of vector type - float2x2 var60 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float2x2 var61 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float2x2 var62 = float4x2(zeros8);// warning X3206: implicit truncation of vector type - float2x2 var63 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float2x2 var64 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2x3 var71 = float2x4(zeros8);// warning X3206: implicit truncation of vector type - float2x3 var73 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float2x3 var74 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float2x3 var76 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float2x3 var77 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float2x4 var87 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float2x4 var90 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float3x2 var99 = float3x3(zeros9);// warning X3206: implicit truncation of vector type - float3x2 var100 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float3x2 var101 = float4x2(zeros8);// warning X3206: implicit truncation of vector type - float3x2 var102 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float3x2 var103 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float3x3 var113 = float3x4(zeros12);// warning X3206: implicit truncation of vector type - float3x3 var115 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float3x3 var116 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float3x4 var129 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float4x2 var141 = float4x3(zeros12);// warning X3206: implicit truncation of vector type - float4x2 var142 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - float4x3 var155 = float4x4(zeros16);// warning X3206: implicit truncation of vector type - return 0; -} - +#define zeros 0 +#define zeros1 0 +#define zeros2 0, 0 +#define zeros3 0, 0, 0 +#define zeros4 0, 0, 0, 0 +#define zeros5 0, 0, 0, 0, 0 +#define zeros6 0, 0, 0, 0, 0, 0 +#define zeros7 0, 0, 0, 0, 0, 0, 0 +#define zeros8 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros9 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros10 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +#define zeros16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +float4 main() : SV_Target { + float var0 = float(zeros1); + float2 var13 = float(zeros1); + float2 var14 = float2(zeros2); + float3 var26 = float(zeros1); + float3 var28 = float3(zeros3); + float4 var39 = float(zeros1); + float4 var42 = float4(zeros4); + float4 var43 = float2x2(zeros4); + float2x2 var52 = float(zeros1); + float2x2 var55 = float4(zeros4); + float2x2 var56 = float2x2(zeros4); + float2x3 var65 = float(zeros1); + float2x3 var70 = float2x3(zeros6); + float2x4 var78 = float(zeros1); + float2x4 var84 = float2x4(zeros8); + float3x2 var91 = float(zeros1); + float3x2 var98 = float3x2(zeros6); + float3x3 var104 = float(zeros1); + float3x3 var112 = float3x3(zeros9); + float3x4 var117 = float(zeros1); + float3x4 var126 = float3x4(zeros12); + float4x2 var130 = float(zeros1); + float4x2 var140 = float4x2(zeros8); + float4x3 var143 = float(zeros1); + float4x3 var154 = float4x3(zeros12); + float4x4 var156 = float(zeros1); + float4x4 var168 = float4x4(zeros16); + float var1 = float2(zeros2);// warning X3206: implicit truncation of vector type + float var2 = float3(zeros3);// warning X3206: implicit truncation of vector type + float var3 = float4(zeros4);// warning X3206: implicit truncation of vector type + float var4 = float2x2(zeros4);// warning X3206: implicit truncation of vector type + float var5 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float var6 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float var7 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float var8 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float var9 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float var10 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float var11 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float var12 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2 var15 = float3(zeros3);// warning X3206: implicit truncation of vector type + float2 var16 = float4(zeros4);// warning X3206: implicit truncation of vector type + float3 var29 = float4(zeros4);// warning X3206: implicit truncation of vector type + float2x2 var57 = float2x3(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var58 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var59 = float3x2(zeros6);// warning X3206: implicit truncation of vector type + float2x2 var60 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x2 var61 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var62 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float2x2 var63 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x2 var64 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x3 var71 = float2x4(zeros8);// warning X3206: implicit truncation of vector type + float2x3 var73 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float2x3 var74 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var76 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float2x3 var77 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float2x4 var87 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float2x4 var90 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x2 var99 = float3x3(zeros9);// warning X3206: implicit truncation of vector type + float3x2 var100 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var101 = float4x2(zeros8);// warning X3206: implicit truncation of vector type + float3x2 var102 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x2 var103 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x3 var113 = float3x4(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var115 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float3x3 var116 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float3x4 var129 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x2 var141 = float4x3(zeros12);// warning X3206: implicit truncation of vector type + float4x2 var142 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + float4x3 var155 = float4x4(zeros16);// warning X3206: implicit truncation of vector type + return 0; +} + diff --git a/core/deps/glslang/Test/hlsl.typeGraphCopy.vert b/core/deps/glslang/Test/hlsl.typeGraphCopy.vert index 659b98093..a4677c105 100644 --- a/core/deps/glslang/Test/hlsl.typeGraphCopy.vert +++ b/core/deps/glslang/Test/hlsl.typeGraphCopy.vert @@ -1,24 +1,24 @@ -struct N1 { - int a; - float b; -}; - -struct N2 { - N1 s1; - N1 s2; -}; - -struct N3 { - N2 t1; - N1 t2; - N2 t3; -}; - -typedef N3 T3; - -T3 foo; - -float main() -{ - return foo.t3.s2.b; -} +struct N1 { + int a; + float b; +}; + +struct N2 { + N1 s1; + N1 s2; +}; + +struct N3 { + N2 t1; + N1 t2; + N2 t3; +}; + +typedef N3 T3; + +T3 foo; + +float main() +{ + return foo.t3.s2.b; +} diff --git a/core/deps/glslang/Test/hlsl.wavebroadcast.comp b/core/deps/glslang/Test/hlsl.wavebroadcast.comp index fe677e4b1..4498305ca 100644 --- a/core/deps/glslang/Test/hlsl.wavebroadcast.comp +++ b/core/deps/glslang/Test/hlsl.wavebroadcast.comp @@ -1,53 +1,53 @@ -struct Types -{ - uint4 u; - int4 i; - float4 f; - double4 d; -}; - -RWStructuredBuffer data; - -[numthreads(32, 16, 1)] -void CSMain(uint3 dti : SV_DispatchThreadID) -{ - data[dti.x].u = WaveReadLaneAt(data[dti.x].u, 13); - data[dti.x].u.x = WaveReadLaneAt(data[dti.x].u.x, 13); - data[dti.x].u.xy = WaveReadLaneAt(data[dti.x].u.xy, 13); - data[dti.x].u.xyz = WaveReadLaneAt(data[dti.x].u.xyz, 13); - - data[dti.x].i = WaveReadLaneAt(data[dti.x].i, 13); - data[dti.x].i.x = WaveReadLaneAt(data[dti.x].i.x, 13); - data[dti.x].i.xy = WaveReadLaneAt(data[dti.x].i.xy, 13); - data[dti.x].i.xyz = WaveReadLaneAt(data[dti.x].i.xyz, 13); - - data[dti.x].f = WaveReadLaneAt(data[dti.x].f, 13); - data[dti.x].f.x = WaveReadLaneAt(data[dti.x].f.x, 13); - data[dti.x].f.xy = WaveReadLaneAt(data[dti.x].f.xy, 13); - data[dti.x].f.xyz = WaveReadLaneAt(data[dti.x].f.xyz, 13); - - data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); - data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); - data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); - data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); - - data[dti.x].u = WaveReadLaneFirst(data[dti.x].u); - data[dti.x].u.x = WaveReadLaneFirst(data[dti.x].u.x); - data[dti.x].u.xy = WaveReadLaneFirst(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveReadLaneFirst(data[dti.x].u.xyz); - - data[dti.x].i = WaveReadLaneFirst(data[dti.x].i); - data[dti.x].i.x = WaveReadLaneFirst(data[dti.x].i.x); - data[dti.x].i.xy = WaveReadLaneFirst(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveReadLaneFirst(data[dti.x].i.xyz); - - data[dti.x].f = WaveReadLaneFirst(data[dti.x].f); - data[dti.x].f.x = WaveReadLaneFirst(data[dti.x].f.x); - data[dti.x].f.xy = WaveReadLaneFirst(data[dti.x].f.xy); - data[dti.x].f.xyz = WaveReadLaneFirst(data[dti.x].f.xyz); - - data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); - data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); - data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); - data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); -} +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WaveReadLaneAt(data[dti.x].u, 13); + data[dti.x].u.x = WaveReadLaneAt(data[dti.x].u.x, 13); + data[dti.x].u.xy = WaveReadLaneAt(data[dti.x].u.xy, 13); + data[dti.x].u.xyz = WaveReadLaneAt(data[dti.x].u.xyz, 13); + + data[dti.x].i = WaveReadLaneAt(data[dti.x].i, 13); + data[dti.x].i.x = WaveReadLaneAt(data[dti.x].i.x, 13); + data[dti.x].i.xy = WaveReadLaneAt(data[dti.x].i.xy, 13); + data[dti.x].i.xyz = WaveReadLaneAt(data[dti.x].i.xyz, 13); + + data[dti.x].f = WaveReadLaneAt(data[dti.x].f, 13); + data[dti.x].f.x = WaveReadLaneAt(data[dti.x].f.x, 13); + data[dti.x].f.xy = WaveReadLaneAt(data[dti.x].f.xy, 13); + data[dti.x].f.xyz = WaveReadLaneAt(data[dti.x].f.xyz, 13); + + data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); + data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); + data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); + + data[dti.x].u = WaveReadLaneFirst(data[dti.x].u); + data[dti.x].u.x = WaveReadLaneFirst(data[dti.x].u.x); + data[dti.x].u.xy = WaveReadLaneFirst(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveReadLaneFirst(data[dti.x].u.xyz); + + data[dti.x].i = WaveReadLaneFirst(data[dti.x].i); + data[dti.x].i.x = WaveReadLaneFirst(data[dti.x].i.x); + data[dti.x].i.xy = WaveReadLaneFirst(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveReadLaneFirst(data[dti.x].i.xyz); + + data[dti.x].f = WaveReadLaneFirst(data[dti.x].f); + data[dti.x].f.x = WaveReadLaneFirst(data[dti.x].f.x); + data[dti.x].f.xy = WaveReadLaneFirst(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveReadLaneFirst(data[dti.x].f.xyz); + + data[dti.x].d = WaveReadLaneFirst(data[dti.x].d); + data[dti.x].d.x = WaveReadLaneFirst(data[dti.x].d.x); + data[dti.x].d.xy = WaveReadLaneFirst(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveReadLaneFirst(data[dti.x].d.xyz); +} diff --git a/core/deps/glslang/Test/hlsl.waveprefix.comp b/core/deps/glslang/Test/hlsl.waveprefix.comp index 431e4d7d4..e4b4367d9 100644 --- a/core/deps/glslang/Test/hlsl.waveprefix.comp +++ b/core/deps/glslang/Test/hlsl.waveprefix.comp @@ -1,55 +1,55 @@ -struct Types -{ - uint4 u; - int4 i; - float4 f; - double4 d; -}; - -RWStructuredBuffer data; - -[numthreads(32, 16, 1)] -void CSMain(uint3 dti : SV_DispatchThreadID) -{ - data[dti.x].u = WavePrefixSum(data[dti.x].u); - data[dti.x].u.x = WavePrefixSum(data[dti.x].u.x); - data[dti.x].u.xy = WavePrefixSum(data[dti.x].u.xy); - data[dti.x].u.xyz = WavePrefixSum(data[dti.x].u.xyz); - - data[dti.x].i = WavePrefixSum(data[dti.x].i); - data[dti.x].i.x = WavePrefixSum(data[dti.x].i.x); - data[dti.x].i.xy = WavePrefixSum(data[dti.x].i.xy); - data[dti.x].i.xyz = WavePrefixSum(data[dti.x].i.xyz); - - data[dti.x].f = WavePrefixSum(data[dti.x].f); - data[dti.x].f.x = WavePrefixSum(data[dti.x].f.x); - data[dti.x].f.xy = WavePrefixSum(data[dti.x].f.xy); - data[dti.x].f.xyz = WavePrefixSum(data[dti.x].f.xyz); - - data[dti.x].d = WavePrefixSum(data[dti.x].d); - data[dti.x].d.x = WavePrefixSum(data[dti.x].d.x); - data[dti.x].d.xy = WavePrefixSum(data[dti.x].d.xy); - data[dti.x].d.xyz = WavePrefixSum(data[dti.x].d.xyz); - - data[dti.x].u = WavePrefixProduct(data[dti.x].u); - data[dti.x].u.x = WavePrefixProduct(data[dti.x].u.x); - data[dti.x].u.xy = WavePrefixProduct(data[dti.x].u.xy); - data[dti.x].u.xyz = WavePrefixProduct(data[dti.x].u.xyz); - - data[dti.x].i = WavePrefixProduct(data[dti.x].i); - data[dti.x].i.x = WavePrefixProduct(data[dti.x].i.x); - data[dti.x].i.xy = WavePrefixProduct(data[dti.x].i.xy); - data[dti.x].i.xyz = WavePrefixProduct(data[dti.x].i.xyz); - - data[dti.x].f = WavePrefixProduct(data[dti.x].f); - data[dti.x].f.x = WavePrefixProduct(data[dti.x].f.x); - data[dti.x].f.xy = WavePrefixProduct(data[dti.x].f.xy); - data[dti.x].f.xyz = WavePrefixProduct(data[dti.x].f.xyz); - - data[dti.x].d = WavePrefixProduct(data[dti.x].d); - data[dti.x].d.x = WavePrefixProduct(data[dti.x].d.x); - data[dti.x].d.xy = WavePrefixProduct(data[dti.x].d.xy); - data[dti.x].d.xyz = WavePrefixProduct(data[dti.x].d.xyz); - - data[dti.x].u.x = WavePrefixCountBits(data[dti.x].u.x == 0); -} +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WavePrefixSum(data[dti.x].u); + data[dti.x].u.x = WavePrefixSum(data[dti.x].u.x); + data[dti.x].u.xy = WavePrefixSum(data[dti.x].u.xy); + data[dti.x].u.xyz = WavePrefixSum(data[dti.x].u.xyz); + + data[dti.x].i = WavePrefixSum(data[dti.x].i); + data[dti.x].i.x = WavePrefixSum(data[dti.x].i.x); + data[dti.x].i.xy = WavePrefixSum(data[dti.x].i.xy); + data[dti.x].i.xyz = WavePrefixSum(data[dti.x].i.xyz); + + data[dti.x].f = WavePrefixSum(data[dti.x].f); + data[dti.x].f.x = WavePrefixSum(data[dti.x].f.x); + data[dti.x].f.xy = WavePrefixSum(data[dti.x].f.xy); + data[dti.x].f.xyz = WavePrefixSum(data[dti.x].f.xyz); + + data[dti.x].d = WavePrefixSum(data[dti.x].d); + data[dti.x].d.x = WavePrefixSum(data[dti.x].d.x); + data[dti.x].d.xy = WavePrefixSum(data[dti.x].d.xy); + data[dti.x].d.xyz = WavePrefixSum(data[dti.x].d.xyz); + + data[dti.x].u = WavePrefixProduct(data[dti.x].u); + data[dti.x].u.x = WavePrefixProduct(data[dti.x].u.x); + data[dti.x].u.xy = WavePrefixProduct(data[dti.x].u.xy); + data[dti.x].u.xyz = WavePrefixProduct(data[dti.x].u.xyz); + + data[dti.x].i = WavePrefixProduct(data[dti.x].i); + data[dti.x].i.x = WavePrefixProduct(data[dti.x].i.x); + data[dti.x].i.xy = WavePrefixProduct(data[dti.x].i.xy); + data[dti.x].i.xyz = WavePrefixProduct(data[dti.x].i.xyz); + + data[dti.x].f = WavePrefixProduct(data[dti.x].f); + data[dti.x].f.x = WavePrefixProduct(data[dti.x].f.x); + data[dti.x].f.xy = WavePrefixProduct(data[dti.x].f.xy); + data[dti.x].f.xyz = WavePrefixProduct(data[dti.x].f.xyz); + + data[dti.x].d = WavePrefixProduct(data[dti.x].d); + data[dti.x].d.x = WavePrefixProduct(data[dti.x].d.x); + data[dti.x].d.xy = WavePrefixProduct(data[dti.x].d.xy); + data[dti.x].d.xyz = WavePrefixProduct(data[dti.x].d.xyz); + + data[dti.x].u.x = WavePrefixCountBits(data[dti.x].u.x == 0); +} diff --git a/core/deps/glslang/Test/hlsl.wavequad.comp b/core/deps/glslang/Test/hlsl.wavequad.comp index ce6adc51f..34e8b7828 100644 --- a/core/deps/glslang/Test/hlsl.wavequad.comp +++ b/core/deps/glslang/Test/hlsl.wavequad.comp @@ -1,153 +1,153 @@ -struct Types -{ - uint4 u; - int4 i; - float4 f; - double4 d; -}; - -RWStructuredBuffer data; - -[numthreads(32, 16, 1)] -void CSMain(uint3 dti : SV_DispatchThreadID) -{ - data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 0); - data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 0); - data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 0); - data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 0); - - data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 0); - data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 0); - data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 0); - data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 0); - - data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 0); - data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 0); - data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 0); - data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 0); - - data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 0); - data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 0); - data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 0); - data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 0); - - data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 1); - data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 1); - data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 1); - data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 1); - - data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 1); - data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 1); - data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 1); - data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 1); - - data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 1); - data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 1); - data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 1); - data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 1); - - data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 1); - data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 1); - data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 1); - data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 1); - - data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 2); - data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 2); - data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 2); - data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 2); - - data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 2); - data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 2); - data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 2); - data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 2); - - data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 2); - data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 2); - data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 2); - data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 2); - - data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 2); - data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 2); - data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 2); - data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 2); - - data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 3); - data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 3); - data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 3); - data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 3); - - data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 3); - data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 3); - data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 3); - data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 3); - - data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 3); - data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 3); - data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 3); - data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 3); - - data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 3); - data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 3); - data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 3); - data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 3); - - data[dti.x].u = QuadReadAcrossX(data[dti.x].u); - data[dti.x].u.x = QuadReadAcrossX(data[dti.x].u.x); - data[dti.x].u.xy = QuadReadAcrossX(data[dti.x].u.xy); - data[dti.x].u.xyz = QuadReadAcrossX(data[dti.x].u.xyz); - - data[dti.x].i = QuadReadAcrossX(data[dti.x].i); - data[dti.x].i.x = QuadReadAcrossX(data[dti.x].i.x); - data[dti.x].i.xy = QuadReadAcrossX(data[dti.x].i.xy); - data[dti.x].i.xyz = QuadReadAcrossX(data[dti.x].i.xyz); - - data[dti.x].f = QuadReadAcrossX(data[dti.x].f); - data[dti.x].f.x = QuadReadAcrossX(data[dti.x].f.x); - data[dti.x].f.xy = QuadReadAcrossX(data[dti.x].f.xy); - data[dti.x].f.xyz = QuadReadAcrossX(data[dti.x].f.xyz); - - data[dti.x].d = QuadReadAcrossX(data[dti.x].d); - data[dti.x].d.x = QuadReadAcrossX(data[dti.x].d.x); - data[dti.x].d.xy = QuadReadAcrossX(data[dti.x].d.xy); - data[dti.x].d.xyz = QuadReadAcrossX(data[dti.x].d.xyz); - - data[dti.x].u = QuadReadAcrossY(data[dti.x].u); - data[dti.x].u.x = QuadReadAcrossY(data[dti.x].u.x); - data[dti.x].u.xy = QuadReadAcrossY(data[dti.x].u.xy); - data[dti.x].u.xyz = QuadReadAcrossY(data[dti.x].u.xyz); - - data[dti.x].i = QuadReadAcrossY(data[dti.x].i); - data[dti.x].i.x = QuadReadAcrossY(data[dti.x].i.x); - data[dti.x].i.xy = QuadReadAcrossY(data[dti.x].i.xy); - data[dti.x].i.xyz = QuadReadAcrossY(data[dti.x].i.xyz); - - data[dti.x].f = QuadReadAcrossY(data[dti.x].f); - data[dti.x].f.x = QuadReadAcrossY(data[dti.x].f.x); - data[dti.x].f.xy = QuadReadAcrossY(data[dti.x].f.xy); - data[dti.x].f.xyz = QuadReadAcrossY(data[dti.x].f.xyz); - - data[dti.x].d = QuadReadAcrossY(data[dti.x].d); - data[dti.x].d.x = QuadReadAcrossY(data[dti.x].d.x); - data[dti.x].d.xy = QuadReadAcrossY(data[dti.x].d.xy); - data[dti.x].d.xyz = QuadReadAcrossY(data[dti.x].d.xyz); - - data[dti.x].u = QuadReadAcrossDiagonal(data[dti.x].u); - data[dti.x].u.x = QuadReadAcrossDiagonal(data[dti.x].u.x); - data[dti.x].u.xy = QuadReadAcrossDiagonal(data[dti.x].u.xy); - data[dti.x].u.xyz = QuadReadAcrossDiagonal(data[dti.x].u.xyz); - - data[dti.x].i = QuadReadAcrossDiagonal(data[dti.x].i); - data[dti.x].i.x = QuadReadAcrossDiagonal(data[dti.x].i.x); - data[dti.x].i.xy = QuadReadAcrossDiagonal(data[dti.x].i.xy); - data[dti.x].i.xyz = QuadReadAcrossDiagonal(data[dti.x].i.xyz); - - data[dti.x].f = QuadReadAcrossDiagonal(data[dti.x].f); - data[dti.x].f.x = QuadReadAcrossDiagonal(data[dti.x].f.x); - data[dti.x].f.xy = QuadReadAcrossDiagonal(data[dti.x].f.xy); - data[dti.x].f.xyz = QuadReadAcrossDiagonal(data[dti.x].f.xyz); - - data[dti.x].d = QuadReadAcrossDiagonal(data[dti.x].d); - data[dti.x].d.x = QuadReadAcrossDiagonal(data[dti.x].d.x); - data[dti.x].d.xy = QuadReadAcrossDiagonal(data[dti.x].d.xy); - data[dti.x].d.xyz = QuadReadAcrossDiagonal(data[dti.x].d.xyz); -} +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 0); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 0); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 0); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 0); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 0); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 0); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 0); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 0); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 0); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 0); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 0); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 0); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 0); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 0); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 0); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 0); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 1); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 1); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 1); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 1); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 1); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 1); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 1); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 1); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 1); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 1); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 1); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 1); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 1); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 1); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 1); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 1); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 2); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 2); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 2); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 2); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 2); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 2); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 2); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 2); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 2); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 2); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 2); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 2); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 2); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 2); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 2); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 2); + + data[dti.x].u = QuadReadLaneAt(data[dti.x].u, 3); + data[dti.x].u.x = QuadReadLaneAt(data[dti.x].u.x, 3); + data[dti.x].u.xy = QuadReadLaneAt(data[dti.x].u.xy, 3); + data[dti.x].u.xyz = QuadReadLaneAt(data[dti.x].u.xyz, 3); + + data[dti.x].i = QuadReadLaneAt(data[dti.x].i, 3); + data[dti.x].i.x = QuadReadLaneAt(data[dti.x].i.x, 3); + data[dti.x].i.xy = QuadReadLaneAt(data[dti.x].i.xy, 3); + data[dti.x].i.xyz = QuadReadLaneAt(data[dti.x].i.xyz, 3); + + data[dti.x].f = QuadReadLaneAt(data[dti.x].f, 3); + data[dti.x].f.x = QuadReadLaneAt(data[dti.x].f.x, 3); + data[dti.x].f.xy = QuadReadLaneAt(data[dti.x].f.xy, 3); + data[dti.x].f.xyz = QuadReadLaneAt(data[dti.x].f.xyz, 3); + + data[dti.x].d = QuadReadLaneAt(data[dti.x].d, 3); + data[dti.x].d.x = QuadReadLaneAt(data[dti.x].d.x, 3); + data[dti.x].d.xy = QuadReadLaneAt(data[dti.x].d.xy, 3); + data[dti.x].d.xyz = QuadReadLaneAt(data[dti.x].d.xyz, 3); + + data[dti.x].u = QuadReadAcrossX(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossX(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossX(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossX(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossX(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossX(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossX(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossX(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossX(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossX(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossX(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossX(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossX(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossX(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossX(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossX(data[dti.x].d.xyz); + + data[dti.x].u = QuadReadAcrossY(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossY(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossY(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossY(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossY(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossY(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossY(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossY(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossY(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossY(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossY(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossY(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossY(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossY(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossY(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossY(data[dti.x].d.xyz); + + data[dti.x].u = QuadReadAcrossDiagonal(data[dti.x].u); + data[dti.x].u.x = QuadReadAcrossDiagonal(data[dti.x].u.x); + data[dti.x].u.xy = QuadReadAcrossDiagonal(data[dti.x].u.xy); + data[dti.x].u.xyz = QuadReadAcrossDiagonal(data[dti.x].u.xyz); + + data[dti.x].i = QuadReadAcrossDiagonal(data[dti.x].i); + data[dti.x].i.x = QuadReadAcrossDiagonal(data[dti.x].i.x); + data[dti.x].i.xy = QuadReadAcrossDiagonal(data[dti.x].i.xy); + data[dti.x].i.xyz = QuadReadAcrossDiagonal(data[dti.x].i.xyz); + + data[dti.x].f = QuadReadAcrossDiagonal(data[dti.x].f); + data[dti.x].f.x = QuadReadAcrossDiagonal(data[dti.x].f.x); + data[dti.x].f.xy = QuadReadAcrossDiagonal(data[dti.x].f.xy); + data[dti.x].f.xyz = QuadReadAcrossDiagonal(data[dti.x].f.xyz); + + data[dti.x].d = QuadReadAcrossDiagonal(data[dti.x].d); + data[dti.x].d.x = QuadReadAcrossDiagonal(data[dti.x].d.x); + data[dti.x].d.xy = QuadReadAcrossDiagonal(data[dti.x].d.xy); + data[dti.x].d.xyz = QuadReadAcrossDiagonal(data[dti.x].d.xyz); +} diff --git a/core/deps/glslang/Test/hlsl.wavequery.comp b/core/deps/glslang/Test/hlsl.wavequery.comp index ce3f933ec..a689e1197 100644 --- a/core/deps/glslang/Test/hlsl.wavequery.comp +++ b/core/deps/glslang/Test/hlsl.wavequery.comp @@ -1,7 +1,7 @@ -RWStructuredBuffer data; - -[numthreads(32, 16, 1)] -void CSMain() -{ - data[WaveGetLaneIndex()] = (WaveIsFirstLane()) ? WaveGetLaneCount() : 0; -} +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain() +{ + data[WaveGetLaneIndex()] = (WaveIsFirstLane()) ? WaveGetLaneCount() : 0; +} diff --git a/core/deps/glslang/Test/hlsl.wavequery.frag b/core/deps/glslang/Test/hlsl.wavequery.frag index 126905a78..d1437f064 100644 --- a/core/deps/glslang/Test/hlsl.wavequery.frag +++ b/core/deps/glslang/Test/hlsl.wavequery.frag @@ -1,11 +1,11 @@ -float4 PixelShaderFunction() : COLOR0 -{ - if (WaveIsFirstLane()) - { - return float4(1, 2, 3, 4); - } - else - { - return float4(4, 3, 2, 1); - } -} +float4 PixelShaderFunction() : COLOR0 +{ + if (WaveIsFirstLane()) + { + return float4(1, 2, 3, 4); + } + else + { + return float4(4, 3, 2, 1); + } +} diff --git a/core/deps/glslang/Test/hlsl.wavereduction.comp b/core/deps/glslang/Test/hlsl.wavereduction.comp index cd7d40f88..b7604ad9a 100644 --- a/core/deps/glslang/Test/hlsl.wavereduction.comp +++ b/core/deps/glslang/Test/hlsl.wavereduction.comp @@ -1,125 +1,125 @@ -struct Types -{ - uint4 u; - int4 i; - float4 f; - double4 d; -}; - -RWStructuredBuffer data; - -[numthreads(32, 16, 1)] -void CSMain(uint3 dti : SV_DispatchThreadID) -{ - data[dti.x].u = WaveActiveSum(data[dti.x].u); - data[dti.x].u.x = WaveActiveSum(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveSum(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveSum(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveSum(data[dti.x].i); - data[dti.x].i.x = WaveActiveSum(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveSum(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveSum(data[dti.x].i.xyz); - - data[dti.x].f = WaveActiveSum(data[dti.x].f); - data[dti.x].f.x = WaveActiveSum(data[dti.x].f.x); - data[dti.x].f.xy = WaveActiveSum(data[dti.x].f.xy); - data[dti.x].f.xyz = WaveActiveSum(data[dti.x].f.xyz); - - data[dti.x].d = WaveActiveSum(data[dti.x].d); - data[dti.x].d.x = WaveActiveSum(data[dti.x].d.x); - data[dti.x].d.xy = WaveActiveSum(data[dti.x].d.xy); - data[dti.x].d.xyz = WaveActiveSum(data[dti.x].d.xyz); - - data[dti.x].u = WaveActiveProduct(data[dti.x].u); - data[dti.x].u.x = WaveActiveProduct(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveProduct(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveProduct(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveProduct(data[dti.x].i); - data[dti.x].i.x = WaveActiveProduct(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveProduct(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveProduct(data[dti.x].i.xyz); - - data[dti.x].f = WaveActiveProduct(data[dti.x].f); - data[dti.x].f.x = WaveActiveProduct(data[dti.x].f.x); - data[dti.x].f.xy = WaveActiveProduct(data[dti.x].f.xy); - data[dti.x].f.xyz = WaveActiveProduct(data[dti.x].f.xyz); - - data[dti.x].d = WaveActiveProduct(data[dti.x].d); - data[dti.x].d.x = WaveActiveProduct(data[dti.x].d.x); - data[dti.x].d.xy = WaveActiveProduct(data[dti.x].d.xy); - data[dti.x].d.xyz = WaveActiveProduct(data[dti.x].d.xyz); - - data[dti.x].u = WaveActiveMin(data[dti.x].u); - data[dti.x].u.x = WaveActiveMin(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveMin(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveMin(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveMin(data[dti.x].i); - data[dti.x].i.x = WaveActiveMin(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveMin(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveMin(data[dti.x].i.xyz); - - data[dti.x].f = WaveActiveMin(data[dti.x].f); - data[dti.x].f.x = WaveActiveMin(data[dti.x].f.x); - data[dti.x].f.xy = WaveActiveMin(data[dti.x].f.xy); - data[dti.x].f.xyz = WaveActiveMin(data[dti.x].f.xyz); - - data[dti.x].d = WaveActiveMin(data[dti.x].d); - data[dti.x].d.x = WaveActiveMin(data[dti.x].d.x); - data[dti.x].d.xy = WaveActiveMin(data[dti.x].d.xy); - data[dti.x].d.xyz = WaveActiveMin(data[dti.x].d.xyz); - - data[dti.x].u = WaveActiveMax(data[dti.x].u); - data[dti.x].u.x = WaveActiveMax(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveMax(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveMax(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveMax(data[dti.x].i); - data[dti.x].i.x = WaveActiveMax(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveMax(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveMax(data[dti.x].i.xyz); - - data[dti.x].f = WaveActiveMax(data[dti.x].f); - data[dti.x].f.x = WaveActiveMax(data[dti.x].f.x); - data[dti.x].f.xy = WaveActiveMax(data[dti.x].f.xy); - data[dti.x].f.xyz = WaveActiveMax(data[dti.x].f.xyz); - - data[dti.x].d = WaveActiveMax(data[dti.x].d); - data[dti.x].d.x = WaveActiveMax(data[dti.x].d.x); - data[dti.x].d.xy = WaveActiveMax(data[dti.x].d.xy); - data[dti.x].d.xyz = WaveActiveMax(data[dti.x].d.xyz); - - data[dti.x].u = WaveActiveBitAnd(data[dti.x].u); - data[dti.x].u.x = WaveActiveBitAnd(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveBitAnd(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveBitAnd(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveBitAnd(data[dti.x].i); - data[dti.x].i.x = WaveActiveBitAnd(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveBitAnd(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveBitAnd(data[dti.x].i.xyz); - - data[dti.x].u = WaveActiveBitOr(data[dti.x].u); - data[dti.x].u.x = WaveActiveBitOr(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveBitOr(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveBitOr(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveBitOr(data[dti.x].i); - data[dti.x].i.x = WaveActiveBitOr(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveBitOr(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveBitOr(data[dti.x].i.xyz); - - data[dti.x].u = WaveActiveBitXor(data[dti.x].u); - data[dti.x].u.x = WaveActiveBitXor(data[dti.x].u.x); - data[dti.x].u.xy = WaveActiveBitXor(data[dti.x].u.xy); - data[dti.x].u.xyz = WaveActiveBitXor(data[dti.x].u.xyz); - - data[dti.x].i = WaveActiveBitXor(data[dti.x].i); - data[dti.x].i.x = WaveActiveBitXor(data[dti.x].i.x); - data[dti.x].i.xy = WaveActiveBitXor(data[dti.x].i.xy); - data[dti.x].i.xyz = WaveActiveBitXor(data[dti.x].i.xyz); - - data[dti.x].u.x = WaveActiveCountBits(data[dti.x].u.x == 0); -} +struct Types +{ + uint4 u; + int4 i; + float4 f; + double4 d; +}; + +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x].u = WaveActiveSum(data[dti.x].u); + data[dti.x].u.x = WaveActiveSum(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveSum(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveSum(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveSum(data[dti.x].i); + data[dti.x].i.x = WaveActiveSum(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveSum(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveSum(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveSum(data[dti.x].f); + data[dti.x].f.x = WaveActiveSum(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveSum(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveSum(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveSum(data[dti.x].d); + data[dti.x].d.x = WaveActiveSum(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveSum(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveSum(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveProduct(data[dti.x].u); + data[dti.x].u.x = WaveActiveProduct(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveProduct(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveProduct(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveProduct(data[dti.x].i); + data[dti.x].i.x = WaveActiveProduct(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveProduct(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveProduct(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveProduct(data[dti.x].f); + data[dti.x].f.x = WaveActiveProduct(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveProduct(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveProduct(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveProduct(data[dti.x].d); + data[dti.x].d.x = WaveActiveProduct(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveProduct(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveProduct(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveMin(data[dti.x].u); + data[dti.x].u.x = WaveActiveMin(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveMin(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveMin(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveMin(data[dti.x].i); + data[dti.x].i.x = WaveActiveMin(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveMin(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveMin(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveMin(data[dti.x].f); + data[dti.x].f.x = WaveActiveMin(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveMin(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveMin(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveMin(data[dti.x].d); + data[dti.x].d.x = WaveActiveMin(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveMin(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveMin(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveMax(data[dti.x].u); + data[dti.x].u.x = WaveActiveMax(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveMax(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveMax(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveMax(data[dti.x].i); + data[dti.x].i.x = WaveActiveMax(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveMax(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveMax(data[dti.x].i.xyz); + + data[dti.x].f = WaveActiveMax(data[dti.x].f); + data[dti.x].f.x = WaveActiveMax(data[dti.x].f.x); + data[dti.x].f.xy = WaveActiveMax(data[dti.x].f.xy); + data[dti.x].f.xyz = WaveActiveMax(data[dti.x].f.xyz); + + data[dti.x].d = WaveActiveMax(data[dti.x].d); + data[dti.x].d.x = WaveActiveMax(data[dti.x].d.x); + data[dti.x].d.xy = WaveActiveMax(data[dti.x].d.xy); + data[dti.x].d.xyz = WaveActiveMax(data[dti.x].d.xyz); + + data[dti.x].u = WaveActiveBitAnd(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitAnd(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitAnd(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitAnd(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitAnd(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitAnd(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitAnd(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitAnd(data[dti.x].i.xyz); + + data[dti.x].u = WaveActiveBitOr(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitOr(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitOr(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitOr(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitOr(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitOr(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitOr(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitOr(data[dti.x].i.xyz); + + data[dti.x].u = WaveActiveBitXor(data[dti.x].u); + data[dti.x].u.x = WaveActiveBitXor(data[dti.x].u.x); + data[dti.x].u.xy = WaveActiveBitXor(data[dti.x].u.xy); + data[dti.x].u.xyz = WaveActiveBitXor(data[dti.x].u.xyz); + + data[dti.x].i = WaveActiveBitXor(data[dti.x].i); + data[dti.x].i.x = WaveActiveBitXor(data[dti.x].i.x); + data[dti.x].i.xy = WaveActiveBitXor(data[dti.x].i.xy); + data[dti.x].i.xyz = WaveActiveBitXor(data[dti.x].i.xyz); + + data[dti.x].u.x = WaveActiveCountBits(data[dti.x].u.x == 0); +} diff --git a/core/deps/glslang/Test/hlsl.wavevote.comp b/core/deps/glslang/Test/hlsl.wavevote.comp index cf554e327..0370e69b7 100644 --- a/core/deps/glslang/Test/hlsl.wavevote.comp +++ b/core/deps/glslang/Test/hlsl.wavevote.comp @@ -1,10 +1,10 @@ -RWStructuredBuffer data; - -[numthreads(32, 16, 1)] -void CSMain(uint3 dti : SV_DispatchThreadID) -{ - data[dti.x] = WaveActiveBallot(WaveActiveAnyTrue(dti.x == 0)); - data[dti.y] = WaveActiveBallot(WaveActiveAllTrue(dti.y == 0)); - data[dti.z] = WaveActiveBallot(WaveActiveAllEqualBool(dti.z == 0)); - data[dti.z] = WaveActiveBallot(WaveActiveAllEqual(dti.z)); -} +RWStructuredBuffer data; + +[numthreads(32, 16, 1)] +void CSMain(uint3 dti : SV_DispatchThreadID) +{ + data[dti.x] = WaveActiveBallot(WaveActiveAnyTrue(dti.x == 0)); + data[dti.y] = WaveActiveBallot(WaveActiveAllTrue(dti.y == 0)); + data[dti.z] = WaveActiveBallot(WaveActiveAllEqualBool(dti.z == 0)); + data[dti.z] = WaveActiveBallot(WaveActiveAllEqual(dti.z)); +} diff --git a/core/deps/glslang/Test/inc2/foo.h b/core/deps/glslang/Test/inc2/foo.h index fd09e808c..ea1e5ba11 100644 --- a/core/deps/glslang/Test/inc2/foo.h +++ b/core/deps/glslang/Test/inc2/foo.h @@ -1 +1 @@ -float4 i6; \ No newline at end of file +float4 i6; diff --git a/core/deps/glslang/Test/length.frag b/core/deps/glslang/Test/length.frag index 6520facdc..74c286f33 100644 --- a/core/deps/glslang/Test/length.frag +++ b/core/deps/glslang/Test/length.frag @@ -1,18 +1,18 @@ -#version 120 - -uniform vec4 u[3]; - -#ifdef TEST_POST_110 -varying vec2 v[]; -#else -varying vec2 v[2]; -#endif - -void main() -{ - int a[5]; - - vec2 t = v[0] + v[1]; - - gl_FragColor = vec4(u.length() * v.length() * a.length()); -} +#version 120 + +uniform vec4 u[3]; + +#ifdef TEST_POST_110 +varying vec2 v[]; +#else +varying vec2 v[2]; +#endif + +void main() +{ + int a[5]; + + vec2 t = v[0] + v[1]; + + gl_FragColor = vec4(u.length() * v.length() * a.length()); +} diff --git a/core/deps/glslang/Test/lineContinuation100.vert b/core/deps/glslang/Test/lineContinuation100.vert index 955be3f8d..e632023cc 100644 --- a/core/deps/glslang/Test/lineContinuation100.vert +++ b/core/deps/glslang/Test/lineContinuation100.vert @@ -1,56 +1,56 @@ -#version 100 - -// non-line continuation comment \ -#error good error - - - -float f\ -oo; // same as 'float foo;' - -#error e2 - -#define MAIN void main() \ - { \ -gl_Position = vec4(foo); \ -} - -#error e3 - -MAIN - -vec4 foo2(vec4 a) -{ - vec4 b = a; \ - return b; -} - -// aoeuntheo unatehutna \ antaehnathe -// anteonuth $ natohe " ' -// anteonuth natohe -/*@*/ -/* *@/*/ -//@ - -#define A int q1 = \ 1 -#define B int q2 = \1 -#define C int q3 = $ 1 -#define D int q4 = @ 1 - -const highp int a1 = \ 4; // ERROR -const highp int a2 = @ 3; // ERROR -const highp int a3 = $4; // ERROR -const highp int a4 = a2\; // ERROR - -A; -B; -C; -D; - -# \ - -# \ - error bad continuation - -#define QUOTE "ab\ -cd" +#version 100 + +// non-line continuation comment \ +#error good error + + + +float f\ +oo; // same as 'float foo;' + +#error e2 + +#define MAIN void main() \ + { \ +gl_Position = vec4(foo); \ +} + +#error e3 + +MAIN + +vec4 foo2(vec4 a) +{ + vec4 b = a; \ + return b; +} + +// aoeuntheo unatehutna \ antaehnathe +// anteonuth $ natohe " ' +// anteonuth natohe +/*@*/ +/* *@/*/ +//@ + +#define A int q1 = \ 1 +#define B int q2 = \1 +#define C int q3 = $ 1 +#define D int q4 = @ 1 + +const highp int a1 = \ 4; // ERROR +const highp int a2 = @ 3; // ERROR +const highp int a3 = $4; // ERROR +const highp int a4 = a2\; // ERROR + +A; +B; +C; +D; + +# \ + +# \ + error bad continuation + +#define QUOTE "ab\ +cd" diff --git a/core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.0.vert b/core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.0.vert new file mode 100755 index 000000000..106dd2507 --- /dev/null +++ b/core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.0.vert @@ -0,0 +1,52 @@ +#version 430 + +// Error: Block has different members +layout (std140) uniform Block +{ + mat4 uProj; +}; + +// Error: BufferBlock has different members +buffer BufferBlock +{ + vec4 b; +}; + +// Error: Vertex has different members +out Vertex +{ + vec4 v1; +}; + +// Error: ColorBlock has different members +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; + // Error, redeclare varaible in another anonymous block + vec4 v1; +}; + +// Error: NamedBlock is anonymous in other compilation unit +layout (std140) uniform NamedBlock +{ + mat4 m; +} myName; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +// Error: redeclare varaibles that are in anonymous blocks +out vec4 v1; +uniform mat4 uProj; + +void +main() +{ + oColor = color1 * getColor2(); + v1 = color1; + + gl_Position = uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.1.vert b/core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.1.vert new file mode 100755 index 000000000..8b4c7f814 --- /dev/null +++ b/core/deps/glslang/Test/link.multiAnonBlocksInvalid.0.1.vert @@ -0,0 +1,48 @@ +#version 430 + +// Error: ColorBlock has different members +layout (std140) uniform ColorBlock +{ + vec4 color2; +}; + +// Error: Block has different members +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +}; + +// Error: Vertex has different members +out Vertex +{ + vec4 v1; + vec4 v2; +}; + +// Error BufferBlock has different members +buffer BufferBlock +{ + vec4 a; +}; + +// Error: NamedBlock is anonymous in other compilation unit +layout (std140) uniform NamedBlock +{ + mat4 m; +}; + + +in vec4 P; + +vec4 getColor2() +{ + return color2; +} + +vec4 getWorld() +{ + return uWorld * P; + v2 = vec4(1); +} + diff --git a/core/deps/glslang/Test/link.multiAnonBlocksValid.0.0.vert b/core/deps/glslang/Test/link.multiAnonBlocksValid.0.0.vert new file mode 100755 index 000000000..470d81546 --- /dev/null +++ b/core/deps/glslang/Test/link.multiAnonBlocksValid.0.0.vert @@ -0,0 +1,38 @@ +#version 430 + +// Verify that matching by block name is working, not +// instance name, which was at one point failing on this +// test due to E.g anon@1 being different blocks for +// different compilation units + +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +}; + +out Vertex +{ + vec4 v1; + vec4 v2; +}; + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +}; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = color1 * getColor2(); + v1 = color1; + + gl_Position = uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.multiAnonBlocksValid.0.1.vert b/core/deps/glslang/Test/link.multiAnonBlocksValid.0.1.vert new file mode 100755 index 000000000..e7dccbe43 --- /dev/null +++ b/core/deps/glslang/Test/link.multiAnonBlocksValid.0.1.vert @@ -0,0 +1,34 @@ +#version 430 + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +}; + +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +}; + +out Vertex +{ + vec4 v1; + vec4 v2; +}; + + +in vec4 P; + +vec4 getColor2() +{ + return color2; +} + +vec4 getWorld() +{ + return uWorld * P; + v2 = vec4(1); +} + diff --git a/core/deps/glslang/Test/link.multiBlocksInvalid.0.0.vert b/core/deps/glslang/Test/link.multiBlocksInvalid.0.0.vert new file mode 100755 index 000000000..19bc04986 --- /dev/null +++ b/core/deps/glslang/Test/link.multiBlocksInvalid.0.0.vert @@ -0,0 +1,40 @@ +#version 430 + +// Verify that blocks with different instance names +// are correctly detected as invalid non-matching blocks +// when they are matched up by block name +layout (std140) uniform Block +{ + mat4 uProj; +} uD; + +out Vertex +{ + vec4 v1; +} oV; + +layout (std140) uniform ColorBlock +{ + vec4 color1; +} uC; + +// Error, buffer blocks and uniform blocks share the +// same namespace for their block name +layout (std430) buffer ColorBlock +{ + vec4 color1; +} uBufC; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = uC.color1 * getColor2(); + oV.v1 = uC.color1 + uBufC.color1; + + gl_Position = uD.uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.multiBlocksInvalid.0.1.vert b/core/deps/glslang/Test/link.multiBlocksInvalid.0.1.vert new file mode 100755 index 000000000..8b9ccd151 --- /dev/null +++ b/core/deps/glslang/Test/link.multiBlocksInvalid.0.1.vert @@ -0,0 +1,31 @@ +#version 430 + +layout (std140) uniform ColorBlock +{ + vec4 color2; +} uColorB; + +layout (std140) uniform Block +{ + mat4 uWorld; +} uDefaultB; + +out Vertex +{ + vec4 v2; +} oVert; + + +in vec4 P; + +vec4 getColor2() +{ + return uColorB.color2; +} + +vec4 getWorld() +{ + return uDefaultB.uWorld * P; + oVert.v2 = vec4(1); +} + diff --git a/core/deps/glslang/Test/link.multiBlocksValid.1.0.vert b/core/deps/glslang/Test/link.multiBlocksValid.1.0.vert new file mode 100755 index 000000000..b21683b7c --- /dev/null +++ b/core/deps/glslang/Test/link.multiBlocksValid.1.0.vert @@ -0,0 +1,32 @@ +#version 430 +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +} a; + +out Vertex +{ + vec4 v1; + vec4 v2; +} b; + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +} c; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = c.color1 * getColor2(); + b.v1 = c.color1; + + gl_Position = a.uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.multiBlocksValid.1.1.vert b/core/deps/glslang/Test/link.multiBlocksValid.1.1.vert new file mode 100755 index 000000000..d86a0d105 --- /dev/null +++ b/core/deps/glslang/Test/link.multiBlocksValid.1.1.vert @@ -0,0 +1,34 @@ +#version 430 + +layout (std140) uniform ColorBlock +{ + vec4 color1; + vec4 color2; +} a; + +layout (std140) uniform Block +{ + mat4 uProj; + mat4 uWorld; +} b; + +out Vertex +{ + vec4 v1; + vec4 v2; +} c; + + +in vec4 P; + +vec4 getColor2() +{ + return a.color2; +} + +vec4 getWorld() +{ + return b.uWorld * P; + c.v2 = vec4(1); +} + diff --git a/core/deps/glslang/Test/link.vk.differentPC.0.0.frag b/core/deps/glslang/Test/link.vk.differentPC.0.0.frag new file mode 100755 index 000000000..f5ad4ceb0 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.differentPC.0.0.frag @@ -0,0 +1,18 @@ +#version 450 + +layout(location=0) out vec4 color; + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +vec4 getColor2(); +float getScale(); + +void main() +{ + color = uPC.color + getColor2() * getScale(); +} diff --git a/core/deps/glslang/Test/link.vk.differentPC.0.1.frag b/core/deps/glslang/Test/link.vk.differentPC.0.1.frag new file mode 100755 index 000000000..972fc65e7 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.differentPC.0.1.frag @@ -0,0 +1,14 @@ +#version 450 + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +vec4 +getColor2() +{ + return uPC.color2; +} diff --git a/core/deps/glslang/Test/link.vk.differentPC.0.2.frag b/core/deps/glslang/Test/link.vk.differentPC.0.2.frag new file mode 100755 index 000000000..287e4252b --- /dev/null +++ b/core/deps/glslang/Test/link.vk.differentPC.0.2.frag @@ -0,0 +1,15 @@ +#version 450 + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale2; +} uPC; + +float +getScale() +{ + return uPC.scale2; +} + diff --git a/core/deps/glslang/Test/link.vk.differentPC.1.0.frag b/core/deps/glslang/Test/link.vk.differentPC.1.0.frag new file mode 100755 index 000000000..e395bb856 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.differentPC.1.0.frag @@ -0,0 +1,16 @@ +#version 450 + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; + float scale2; +} uPC; + +float +getScale() +{ + return uPC.scale; +} + diff --git a/core/deps/glslang/Test/link.vk.differentPC.1.1.frag b/core/deps/glslang/Test/link.vk.differentPC.1.1.frag new file mode 100755 index 000000000..972fc65e7 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.differentPC.1.1.frag @@ -0,0 +1,14 @@ +#version 450 + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +vec4 +getColor2() +{ + return uPC.color2; +} diff --git a/core/deps/glslang/Test/link.vk.differentPC.1.2.frag b/core/deps/glslang/Test/link.vk.differentPC.1.2.frag new file mode 100755 index 000000000..f5ad4ceb0 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.differentPC.1.2.frag @@ -0,0 +1,18 @@ +#version 450 + +layout(location=0) out vec4 color; + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +vec4 getColor2(); +float getScale(); + +void main() +{ + color = uPC.color + getColor2() * getScale(); +} diff --git a/core/deps/glslang/Test/link.vk.matchingPC.0.0.frag b/core/deps/glslang/Test/link.vk.matchingPC.0.0.frag new file mode 100755 index 000000000..f5ad4ceb0 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.matchingPC.0.0.frag @@ -0,0 +1,18 @@ +#version 450 + +layout(location=0) out vec4 color; + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +vec4 getColor2(); +float getScale(); + +void main() +{ + color = uPC.color + getColor2() * getScale(); +} diff --git a/core/deps/glslang/Test/link.vk.matchingPC.0.1.frag b/core/deps/glslang/Test/link.vk.matchingPC.0.1.frag new file mode 100755 index 000000000..972fc65e7 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.matchingPC.0.1.frag @@ -0,0 +1,14 @@ +#version 450 + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +vec4 +getColor2() +{ + return uPC.color2; +} diff --git a/core/deps/glslang/Test/link.vk.matchingPC.0.2.frag b/core/deps/glslang/Test/link.vk.matchingPC.0.2.frag new file mode 100755 index 000000000..734358c4d --- /dev/null +++ b/core/deps/glslang/Test/link.vk.matchingPC.0.2.frag @@ -0,0 +1,14 @@ +#version 450 + +layout (push_constant) uniform PushConstantBlock +{ + vec4 color; + vec4 color2; + float scale; +} uPC; + +float +getScale() +{ + return uPC.scale; +} diff --git a/core/deps/glslang/Test/link.vk.multiBlocksValid.0.0.vert b/core/deps/glslang/Test/link.vk.multiBlocksValid.0.0.vert new file mode 100755 index 000000000..81747ec4e --- /dev/null +++ b/core/deps/glslang/Test/link.vk.multiBlocksValid.0.0.vert @@ -0,0 +1,49 @@ +#version 430 + +// OK: different instance names is allowed in other unit +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uM; + +// OK: other unit has it as anonymous, but that is allowed +out Vertex +{ + vec4 v1; + vec4 v2; +} oV; + +// OK: different instance names is allowed in other unit +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uC; + +// OK: different instance names is allowed in other unit +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuf; + +layout (std430, binding = 0) buffer SecondaryColorBlock +{ + vec4 c; +} uColorBuf; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = uC.color1 * getColor2() * uColorBuf.c; + oV.v1 = uC.color1; + + gl_Position = uM.uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.vk.multiBlocksValid.0.1.vert b/core/deps/glslang/Test/link.vk.multiBlocksValid.0.1.vert new file mode 100755 index 000000000..526777826 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.multiBlocksValid.0.1.vert @@ -0,0 +1,46 @@ +#version 430 + +// OK: different instance names is allowed in other unit +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uColor; + +// OK: different instance names is allowed in other unit +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuffer; + +// OK: different instance names is allowed in other unit +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uMatrix; + +// OK, it's allowed for input/output interfaces to +// be anonymous is one unit and not in another +out Vertex +{ + vec4 v1; + vec4 v2; +}; + + +in vec4 P; + +vec4 getColor2() +{ + return uColor.color2; +} + +vec4 getWorld() +{ + v1 = vec4(1); + return uMatrix.uWorld * P; +} + diff --git a/core/deps/glslang/Test/link.vk.multiBlocksValid.1.0.geom b/core/deps/glslang/Test/link.vk.multiBlocksValid.1.0.geom new file mode 100755 index 000000000..9811b0861 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.multiBlocksValid.1.0.geom @@ -0,0 +1,62 @@ +#version 430 + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +// OK: different instance names is allowed +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uM; + +// Verify that in/out blocks with same block name work +in Vertex +{ + vec4 v1; + vec4 v2; +} iV[3]; + +out Vertex +{ + vec4 val1; +} oV; + +// OK: different instance names is allowed +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uC; + +// OK: different instance names is allowed +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuf; + +vec4 getWorld(int i); +vec4 getColor2(); + +out vec4 oColor; + +float globalF; + +void +main() +{ + oColor = uC.color1 * getColor2(); + + globalF = 1.0; + + for (int i = 0; i < 3; i++) + { + gl_Position = uM.uProj * getWorld(i); + oV.val1 = uC.color1 + iV[i].v2 * globalF; + EmitVertex(); + } + + EndPrimitive(); +} diff --git a/core/deps/glslang/Test/link.vk.multiBlocksValid.1.1.geom b/core/deps/glslang/Test/link.vk.multiBlocksValid.1.1.geom new file mode 100755 index 000000000..f372343a0 --- /dev/null +++ b/core/deps/glslang/Test/link.vk.multiBlocksValid.1.1.geom @@ -0,0 +1,54 @@ +#version 430 + +layout (triangles) in; +layout (triangle_strip, max_vertices = 3) out; + +// OK: different instance names is allowed +layout (std140, binding = 1) uniform ColorBlock +{ + vec4 color1; + bool b; + vec4 color2; + vec4 color3; +} uColor; + +// OK: different instance names is allowed +layout (std430, binding = 1) buffer BufferBlock +{ + mat4 p; +} uBuffer; + +// OK: different instance names is allowed +layout (std140, binding = 0) uniform MatrixBlock +{ + mat4 uProj; + mat4 uWorld; +} uMatrix; + +// OK, it's allowed for input/output interfaces to +// be anonymous is one unit and not in another +out Vertex +{ + vec4 val1; +}; + +in Vertex +{ + vec4 v1; + vec4 v2; +} iVV[]; + + +in vec4 P[3]; + +vec4 getColor2() +{ + return uColor.color2; +} + +vec4 getWorld(int i) +{ + val1 = vec4(1); + return uMatrix.uWorld * iVV[i].v1; +} + diff --git a/core/deps/glslang/Test/link.vk.pcNamingInvalid.0.0.vert b/core/deps/glslang/Test/link.vk.pcNamingInvalid.0.0.vert new file mode 100755 index 000000000..26a75862f --- /dev/null +++ b/core/deps/glslang/Test/link.vk.pcNamingInvalid.0.0.vert @@ -0,0 +1,21 @@ +#version 450 +layout (push_constant) uniform Block +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} a; + +vec4 getWorld(); +vec4 getColor2(); + +out vec4 oColor; + +void +main() +{ + oColor = a.color1 * getColor2(); + + gl_Position = a.uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.vk.pcNamingInvalid.0.1.vert b/core/deps/glslang/Test/link.vk.pcNamingInvalid.0.1.vert new file mode 100755 index 000000000..47d2314bf --- /dev/null +++ b/core/deps/glslang/Test/link.vk.pcNamingInvalid.0.1.vert @@ -0,0 +1,22 @@ +#version 450 + +layout (push_constant) uniform Block2 +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} a; + +in vec4 P; + +vec4 getColor2() +{ + return a.color2; +} + +vec4 getWorld() +{ + return a.uWorld * P; +} + diff --git a/core/deps/glslang/Test/link.vk.pcNamingValid.0.0.vert b/core/deps/glslang/Test/link.vk.pcNamingValid.0.0.vert new file mode 100755 index 000000000..7df21901a --- /dev/null +++ b/core/deps/glslang/Test/link.vk.pcNamingValid.0.0.vert @@ -0,0 +1,21 @@ +#version 450 +layout (push_constant) uniform PCBlock +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} a; + +vec4 getWorld(); +vec4 getColor2(); + +layout(location = 0) out vec4 oColor; + +void +main() +{ + oColor = a.color1 * getColor2(); + + gl_Position = a.uProj * getWorld(); +} diff --git a/core/deps/glslang/Test/link.vk.pcNamingValid.0.1.vert b/core/deps/glslang/Test/link.vk.pcNamingValid.0.1.vert new file mode 100755 index 000000000..9a4b41b3f --- /dev/null +++ b/core/deps/glslang/Test/link.vk.pcNamingValid.0.1.vert @@ -0,0 +1,22 @@ +#version 450 + +layout (push_constant) uniform PCBlock +{ + mat4 uWorld; + mat4 uProj; + vec4 color1; + vec4 color2; +} b; + +layout(location = 0) in vec4 P; + +vec4 getColor2() +{ + return b.color2; +} + +vec4 getWorld() +{ + return b.uWorld * P; +} + diff --git a/core/deps/glslang/Test/link1.frag b/core/deps/glslang/Test/link1.frag index 31676813c..2b8d95a85 100644 --- a/core/deps/glslang/Test/link1.frag +++ b/core/deps/glslang/Test/link1.frag @@ -1,38 +1,38 @@ -#version 130 - -uniform vec4 uv4; -uniform vec3 glass; - -const int ci = 8; - -vec4 a = ci * uv4; - -in vec3 iv3; -in vec4 cup; - -void main() -{ -} - -vec4 b = ci * a; - -ivec2 foo(mat2 m) -{ - return ivec2(m[0]); -} - -vec4 c = b * b; - -const vec3 cv3 = vec3(43.0, 0.34, 9.9); -const vec3 cv3n = vec3(43.0, 0.34, 9.9); -const vec3 cv3e = vec3(43.0, 0.34, 9.9); -uniform mat2 um2 = mat2(4.0); -uniform mat2 um2n = mat2(4.0); -uniform mat2 um2e = mat2(4.0); -struct S { - int a; - float b; -}; -uniform S s = S(82, 3.9); -uniform S sn; -uniform S se = S(82, 3.9); +#version 130 + +uniform vec4 uv4; +uniform vec3 glass; + +const int ci = 8; + +vec4 a = ci * uv4; + +in vec3 iv3; +in vec4 cup; + +void main() +{ +} + +vec4 b = ci * a; + +ivec2 foo(mat2 m) +{ + return ivec2(m[0]); +} + +vec4 c = b * b; + +const vec3 cv3 = vec3(43.0, 0.34, 9.9); +const vec3 cv3n = vec3(43.0, 0.34, 9.9); +const vec3 cv3e = vec3(43.0, 0.34, 9.9); +uniform mat2 um2 = mat2(4.0); +uniform mat2 um2n = mat2(4.0); +uniform mat2 um2e = mat2(4.0); +struct S { + int a; + float b; +}; +uniform S s = S(82, 3.9); +uniform S sn; +uniform S se = S(82, 3.9); diff --git a/core/deps/glslang/Test/link1.vk.frag b/core/deps/glslang/Test/link1.vk.frag index 7c576b69a..c860f6476 100644 --- a/core/deps/glslang/Test/link1.vk.frag +++ b/core/deps/glslang/Test/link1.vk.frag @@ -1,24 +1,24 @@ -#version 450 - -vec4 getColor(); - -layout(location=0) out vec4 color; - -int a1[]; // max size from link1 -int a2[]; // max size from link2 -int b[5]; -int c[]; -int i; - -layout (binding = 0) buffer bnameRuntime { float r[]; }; -layout (binding = 1) buffer bnameImplicit { float m[]; }; - -void main() -{ - color = getColor(); - - a1[8] = 1; - a2[1] = 1; - b[i] = 1; - c[3] = 1; -} +#version 450 + +vec4 getColor(); + +layout(location=0) out vec4 color; + +int a1[]; // max size from link1 +int a2[]; // max size from link2 +int b[5]; +int c[]; +int i; + +layout (binding = 0) buffer bnameRuntime { float r[]; }; +layout (binding = 1) buffer bnameImplicit { float m[]; }; + +void main() +{ + color = getColor(); + + a1[8] = 1; + a2[1] = 1; + b[i] = 1; + c[3] = 1; +} diff --git a/core/deps/glslang/Test/link2.frag b/core/deps/glslang/Test/link2.frag index 301c2717d..7c698917e 100644 --- a/core/deps/glslang/Test/link2.frag +++ b/core/deps/glslang/Test/link2.frag @@ -1,36 +1,36 @@ -#version 130 - -uniform vec4 uv4; -uniform vec2 glass; - -const int ci = 8; - -vec4 d = ci * uv4; - -in vec3 iv3; -flat in vec4 cup; - -vec4 e = ci * d; - -ivec2 foo() -{ - return ivec2(2); -} - -vec4 f = e * e; - -const vec3 cv3 = vec3(43.0, 0.34, 9.9); -const vec3 cv3e = vec3(43.0, 0.34, 2.9); -uniform mat2 um2 = mat2(4.0); -uniform mat2 um2n; -uniform mat2 um2e = mat2(3.0); -struct S { - int a; - float b; -}; -uniform S s = S(82, 3.9); -uniform S sn = S(82, 3.9); -uniform S se = S(81, 3.9); - -#extension GL_OES_texture_3D : enable -#extension GL_OES_standard_derivatives : enable +#version 130 + +uniform vec4 uv4; +uniform vec2 glass; + +const int ci = 8; + +vec4 d = ci * uv4; + +in vec3 iv3; +flat in vec4 cup; + +vec4 e = ci * d; + +ivec2 foo() +{ + return ivec2(2); +} + +vec4 f = e * e; + +const vec3 cv3 = vec3(43.0, 0.34, 9.9); +const vec3 cv3e = vec3(43.0, 0.34, 2.9); +uniform mat2 um2 = mat2(4.0); +uniform mat2 um2n; +uniform mat2 um2e = mat2(3.0); +struct S { + int a; + float b; +}; +uniform S s = S(82, 3.9); +uniform S sn = S(82, 3.9); +uniform S se = S(81, 3.9); + +#extension GL_OES_texture_3D : enable +#extension GL_OES_standard_derivatives : enable diff --git a/core/deps/glslang/Test/link2.vk.frag b/core/deps/glslang/Test/link2.vk.frag index 7fba68931..b83f8694f 100644 --- a/core/deps/glslang/Test/link2.vk.frag +++ b/core/deps/glslang/Test/link2.vk.frag @@ -1,23 +1,23 @@ -#version 450 - -layout(binding=1) uniform sampler2D s2D; - -int a1[]; // max size from link1 -int a2[]; // max size from link2 -int b[]; -int c[7]; -int i; - -layout (binding = 0) buffer bnameRuntime { float r[]; }; -layout (binding = 1) buffer bnameImplicit { float m[4]; }; - -vec4 getColor() -{ - a1[2] = 1; - a2[9] = 1; - b[2] = 1; - c[3] = 1; - c[i] = 1; - - return texture(s2D, vec2(0.5)); -} +#version 450 + +layout(binding=1) uniform sampler2D s2D; + +int a1[]; // max size from link1 +int a2[]; // max size from link2 +int b[]; +int c[7]; +int i; + +layout (binding = 0) buffer bnameRuntime { float r[]; }; +layout (binding = 1) buffer bnameImplicit { float m[4]; }; + +vec4 getColor() +{ + a1[2] = 1; + a2[9] = 1; + b[2] = 1; + c[3] = 1; + c[i] = 1; + + return texture(s2D, vec2(0.5)); +} diff --git a/core/deps/glslang/Test/link3.frag b/core/deps/glslang/Test/link3.frag index 015ad35b2..f886b23f9 100644 --- a/core/deps/glslang/Test/link3.frag +++ b/core/deps/glslang/Test/link3.frag @@ -1,9 +1,9 @@ -#version 300 es - -precision highp float; - -in vec2 iv3; - -#extension GL_OES_standard_derivatives : enable -#extension GL_OES_EGL_image_external : require -#extension GL_OES_texture_3D : enable +#version 300 es + +precision highp float; + +in vec2 iv3; + +#extension GL_OES_standard_derivatives : enable +#extension GL_OES_EGL_image_external : require +#extension GL_OES_texture_3D : enable diff --git a/core/deps/glslang/Test/localAggregates.frag b/core/deps/glslang/Test/localAggregates.frag index dbc9725b4..d8a7fb18d 100644 --- a/core/deps/glslang/Test/localAggregates.frag +++ b/core/deps/glslang/Test/localAggregates.frag @@ -1,72 +1,72 @@ -#version 130 - -uniform sampler2D sampler; -varying vec2 coord; -varying vec4 color; - -struct s1 { - int i; - float f; -}; - -struct s2 { - int i; - float f; - s1 s1_1; - vec4 bleh; -}; - -struct s3 { - s2 s2_1; - int i; - float f; - s1 s1_1; -}; - - -uniform s1 foo; -uniform s2 foo2; -uniform s3 foo3; - -uniform float[16] uFloatArray; -uniform int condition; - -void main() -{ - s2 locals2; - s3 locals3; - float localFArray[16]; - int localIArray[8]; - - locals2 = foo3.s2_1; - - if (foo3.s2_1.i > 0) { - locals2.s1_1.f = 1.0; - localFArray[4] = coord.x; - localIArray[2] = foo3.s2_1.i; - } else { - locals2.s1_1.f = coord.x; - localFArray[4] = 1.0; - localIArray[2] = 0; - } - - if (localIArray[2] == 0) - ++localFArray[4]; - - float localArray[16]; - int x = 5; - localArray[x] = coord.x; - - float[16] a; - - for (int i = 0; i < 16; i++) - a[i] = 0.0; - - if (condition == 1) - a = localArray; - - locals2.bleh = color; - locals2.bleh.z = coord.y; - - gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture2D(sampler, coord); -} +#version 130 + +uniform sampler2D sampler; +varying vec2 coord; +varying vec4 color; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; + vec4 bleh; +}; + +struct s3 { + s2 s2_1; + int i; + float f; + s1 s1_1; +}; + + +uniform s1 foo; +uniform s2 foo2; +uniform s3 foo3; + +uniform float[16] uFloatArray; +uniform int condition; + +void main() +{ + s2 locals2; + s3 locals3; + float localFArray[16]; + int localIArray[8]; + + locals2 = foo3.s2_1; + + if (foo3.s2_1.i > 0) { + locals2.s1_1.f = 1.0; + localFArray[4] = coord.x; + localIArray[2] = foo3.s2_1.i; + } else { + locals2.s1_1.f = coord.x; + localFArray[4] = 1.0; + localIArray[2] = 0; + } + + if (localIArray[2] == 0) + ++localFArray[4]; + + float localArray[16]; + int x = 5; + localArray[x] = coord.x; + + float[16] a; + + for (int i = 0; i < 16; i++) + a[i] = 0.0; + + if (condition == 1) + a = localArray; + + locals2.bleh = color; + locals2.bleh.z = coord.y; + + gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture2D(sampler, coord); +} diff --git a/core/deps/glslang/Test/loops.frag b/core/deps/glslang/Test/loops.frag index 44f13bcd8..ce2d2a0b2 100644 --- a/core/deps/glslang/Test/loops.frag +++ b/core/deps/glslang/Test/loops.frag @@ -1,320 +1,320 @@ -#version 130 -uniform vec4 bigColor; -uniform vec4 bigColor1_1; -uniform vec4 bigColor1_2; -uniform vec4 bigColor1_3; -uniform vec4 bigColor2; -uniform vec4 bigColor3; -uniform vec4 bigColor4; -uniform vec4 bigColor5; -uniform vec4 bigColor6; -uniform vec4 bigColor7; -uniform vec4 bigColor8; - -varying vec4 BaseColor; - -uniform float d; -uniform float d2; -uniform float d3; -uniform float d4; -uniform float d5; -uniform float d6; -uniform float d7; -uniform float d8; -uniform float d9; -uniform float d10; -uniform float d11; -uniform float d12; -uniform float d13; -uniform float d14; -uniform float d15; -uniform float d16; -uniform float d17; -uniform float d18; -uniform float d19; -uniform float d20; -uniform float d21; -uniform float d22; -uniform float d23; -uniform float d24; -uniform float d25; -uniform float d26; -uniform float d27; -uniform float d28; -uniform float d29; -uniform float d30; -uniform float d31; -uniform float d32; -uniform float d33; -uniform float d34; - -uniform int Count; - -void main() -{ - vec4 color = BaseColor; - - // Not a real loop - while (true) { - if (color.x < 0.33) { - color += vec4(0.33); - break; - } - if (color.x < 0.66) { - color += vec4(0.66); - break; - } - - color += vec4(0.33); - break; - } - - // While - while (color.x < d) { - color += bigColor; - } - - // While (latchy) - while (color.z < d) { - color += bigColor1_1; - if (color.w < d) - continue; - - color += bigColor1_1; - } - - // While (constant) - while (color.x < 42.0) { - ++color; - } - - // While (complicated-conditional) - while (color.w < d2 && color.y < d3) { - color += bigColor1_2; - } - - // While (multi-exit) - while (color.z < d3) { - color += bigColor1_3; - if (color.y < d4) - break; - color += bigColor1_3; - } - - // For (dynamic) - for (int i = 0; i < Count; ++i) { - color += bigColor2; - } - - // Do while - do { - color += bigColor3; - } while (color.x < d2); - - // For (static) - for (int i = 0; i < 42; ++i) { - color.z += d3; - } - - // For (static) flow-control - for (int i = 0; i < 100; ++i) { - if (color.z < 20.0) - color.x++; - else - color.y++; - if (color.w < 20.0) - if (color.z > color.y) - 0; // do nothing - } - - // For (static) flow-control with latch merge - for (int i = 0; i < 120; ++i) { - if (color.z < 20.0) - color.x++; - else - color.y++; - } - - // For (static) latchy - for (int i = 0; i < 42; ++i) { - color.z += d3; - if (color.x < d4) - continue; - ++color.w; - } - - // For (static) multi-exit - for (int i = 0; i < 42; ++i) { - color.z += d3; - if (color.x < d4) - break; - ++color.w; - } - - // Latchy - do { - color += bigColor4; - if (color.x < d4) - continue; - if (color.y < d4) - color.y += d4; - else - color.x += d4; - } while (color.z < d4); - - // Do while flow control - do { - color += bigColor5; - if (color.y < d5) - color.y += d5; - } while (color.x < d5); - - // If then loop - if (color.x < d6) { - while (color.y < d6) - color += bigColor6; - } else { - while (color.z < d6) - color.z += bigColor6.z; - } - - // If then multi-exit - if (color.x < d6) { - while (color.y < d6) { - color += bigColor6; - if (d7 < 1.0) - break; - } - - } else { - while (color.z < d6) - color.z += bigColor6.z; - } - - - // Multi-exit - do { - if (d7 < 0.0) - break; - - color += bigColor7; - - if (d7 < 1.0) { - color.z++; - break; - } - - color += BaseColor; - - } while (true); - - - // Multi-exit2 - do { - // invariant conditional break at the top of the loop. This could be a - // situation where unswitching the loop has no real increases in code - // size. - if (d8 < 0.0) - break; - - color += bigColor7; - - if (d8 < 1.0) { - color.z++; - if (d8 < 2.0) { - color.y++; - } else { - color.x++; - } - break; - } - - color += BaseColor; - - } while (color.z < d8); - - // Deep exit - while (color.w < d9) { - if (d9 > d8) { - if (color.x <= d7) { - if (color.z == 5.0) - color.w++; - else - break; - } - } - - } - - // No end loop-back. - while (color.z < d10) { - color.y++; - if (color.y < d11) { - color.z++; - if (color.w < d12) - color.w++; - else - color.x++; - continue; - } - - color++; - break; - } - - // Multi-continue - while (color.x < 10.0) { - color += bigColor8; - - if (color.z < d8) - if (color.w < d6) - continue; - - color.y += bigColor8.x; - } - - color++; - gl_FragColor = color; - - // Early Return - while (color.x < d14) { - if (color.y < d15) { - return; - } - else - color++; - } - - color++; - - while (color.w < d16) { - color.w++; - } - - - // While (complicated-conditional) - while (color.w < d2 && color.y < d3) { - color += bigColor1_2; - if (color.z < d3) - return; - } - - - do { - if (color.y < d18) - return; - color++; - } while (color.x < d17); - - // Early Discard - while (color.y < d16) { - if (color.w < d16) { - discard; - } else - color++; - } - - color++; - - gl_FragColor = color; -} +#version 130 +uniform vec4 bigColor; +uniform vec4 bigColor1_1; +uniform vec4 bigColor1_2; +uniform vec4 bigColor1_3; +uniform vec4 bigColor2; +uniform vec4 bigColor3; +uniform vec4 bigColor4; +uniform vec4 bigColor5; +uniform vec4 bigColor6; +uniform vec4 bigColor7; +uniform vec4 bigColor8; + +varying vec4 BaseColor; + +uniform float d; +uniform float d2; +uniform float d3; +uniform float d4; +uniform float d5; +uniform float d6; +uniform float d7; +uniform float d8; +uniform float d9; +uniform float d10; +uniform float d11; +uniform float d12; +uniform float d13; +uniform float d14; +uniform float d15; +uniform float d16; +uniform float d17; +uniform float d18; +uniform float d19; +uniform float d20; +uniform float d21; +uniform float d22; +uniform float d23; +uniform float d24; +uniform float d25; +uniform float d26; +uniform float d27; +uniform float d28; +uniform float d29; +uniform float d30; +uniform float d31; +uniform float d32; +uniform float d33; +uniform float d34; + +uniform int Count; + +void main() +{ + vec4 color = BaseColor; + + // Not a real loop + while (true) { + if (color.x < 0.33) { + color += vec4(0.33); + break; + } + if (color.x < 0.66) { + color += vec4(0.66); + break; + } + + color += vec4(0.33); + break; + } + + // While + while (color.x < d) { + color += bigColor; + } + + // While (latchy) + while (color.z < d) { + color += bigColor1_1; + if (color.w < d) + continue; + + color += bigColor1_1; + } + + // While (constant) + while (color.x < 42.0) { + ++color; + } + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + } + + // While (multi-exit) + while (color.z < d3) { + color += bigColor1_3; + if (color.y < d4) + break; + color += bigColor1_3; + } + + // For (dynamic) + for (int i = 0; i < Count; ++i) { + color += bigColor2; + } + + // Do while + do { + color += bigColor3; + } while (color.x < d2); + + // For (static) + for (int i = 0; i < 42; ++i) { + color.z += d3; + } + + // For (static) flow-control + for (int i = 0; i < 100; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + if (color.w < 20.0) + if (color.z > color.y) + 0; // do nothing + } + + // For (static) flow-control with latch merge + for (int i = 0; i < 120; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + } + + // For (static) latchy + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + continue; + ++color.w; + } + + // For (static) multi-exit + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + break; + ++color.w; + } + + // Latchy + do { + color += bigColor4; + if (color.x < d4) + continue; + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Do while flow control + do { + color += bigColor5; + if (color.y < d5) + color.y += d5; + } while (color.x < d5); + + // If then loop + if (color.x < d6) { + while (color.y < d6) + color += bigColor6; + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + // If then multi-exit + if (color.x < d6) { + while (color.y < d6) { + color += bigColor6; + if (d7 < 1.0) + break; + } + + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + + // Multi-exit + do { + if (d7 < 0.0) + break; + + color += bigColor7; + + if (d7 < 1.0) { + color.z++; + break; + } + + color += BaseColor; + + } while (true); + + + // Multi-exit2 + do { + // invariant conditional break at the top of the loop. This could be a + // situation where unswitching the loop has no real increases in code + // size. + if (d8 < 0.0) + break; + + color += bigColor7; + + if (d8 < 1.0) { + color.z++; + if (d8 < 2.0) { + color.y++; + } else { + color.x++; + } + break; + } + + color += BaseColor; + + } while (color.z < d8); + + // Deep exit + while (color.w < d9) { + if (d9 > d8) { + if (color.x <= d7) { + if (color.z == 5.0) + color.w++; + else + break; + } + } + + } + + // No end loop-back. + while (color.z < d10) { + color.y++; + if (color.y < d11) { + color.z++; + if (color.w < d12) + color.w++; + else + color.x++; + continue; + } + + color++; + break; + } + + // Multi-continue + while (color.x < 10.0) { + color += bigColor8; + + if (color.z < d8) + if (color.w < d6) + continue; + + color.y += bigColor8.x; + } + + color++; + gl_FragColor = color; + + // Early Return + while (color.x < d14) { + if (color.y < d15) { + return; + } + else + color++; + } + + color++; + + while (color.w < d16) { + color.w++; + } + + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + if (color.z < d3) + return; + } + + + do { + if (color.y < d18) + return; + color++; + } while (color.x < d17); + + // Early Discard + while (color.y < d16) { + if (color.w < d16) { + discard; + } else + color++; + } + + color++; + + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/loopsArtificial.frag b/core/deps/glslang/Test/loopsArtificial.frag index 7195a4f87..2f196af8e 100644 --- a/core/deps/glslang/Test/loopsArtificial.frag +++ b/core/deps/glslang/Test/loopsArtificial.frag @@ -1,96 +1,96 @@ -#version 130 -uniform vec4 bigColor; -uniform vec4 bigColor1_1; -uniform vec4 bigColor1_2; -uniform vec4 bigColor1_3; -uniform vec4 bigColor2; -uniform vec4 bigColor3; -uniform vec4 bigColor4; -uniform vec4 bigColor5; -uniform vec4 bigColor6; -uniform vec4 bigColor7; -uniform vec4 bigColor8; - -varying vec4 BaseColor; - -uniform float d; -uniform float d2; -uniform float d3; -uniform float d4; -uniform float d5; -uniform float d6; -uniform float d7; -uniform float d8; -uniform float d9; -uniform float d10; -uniform float d11; -uniform float d12; -uniform float d13; -uniform float d14; -uniform float d15; -uniform float d16; -uniform float d17; -uniform float d18; -uniform float d19; -uniform float d20; -uniform float d21; -uniform float d22; -uniform float d23; -uniform float d24; -uniform float d25; -uniform float d26; -uniform float d27; -uniform float d28; -uniform float d29; -uniform float d30; -uniform float d31; -uniform float d32; -uniform float d33; -uniform float d34; - -uniform int Count; - -void main() -{ - vec4 color = BaseColor; - - // Latchy2 - do { - color += bigColor4; - if (color.x < d4) { - color.z += 2.0; - if (color.z < d4) { - color.x++; - continue; - } - } - if (color.y < d4) - color.y += d4; - else - color.x += d4; - } while (color.z < d4); - - // Immediate dominator - while (color.w < d13) { - if (color.z < d13) - color++; - else - color--; - // code from Latchy 2 - color += bigColor4; - if (color.x < d4) { - color.z += 2.0; - if (color.z < d4) { - color.x++; - continue; - } - } - if (color.y < d4) - color.y += d4; - else - color.x += d4; - } - - color++; - gl_FragColor = color; -} +#version 130 +uniform vec4 bigColor; +uniform vec4 bigColor1_1; +uniform vec4 bigColor1_2; +uniform vec4 bigColor1_3; +uniform vec4 bigColor2; +uniform vec4 bigColor3; +uniform vec4 bigColor4; +uniform vec4 bigColor5; +uniform vec4 bigColor6; +uniform vec4 bigColor7; +uniform vec4 bigColor8; + +varying vec4 BaseColor; + +uniform float d; +uniform float d2; +uniform float d3; +uniform float d4; +uniform float d5; +uniform float d6; +uniform float d7; +uniform float d8; +uniform float d9; +uniform float d10; +uniform float d11; +uniform float d12; +uniform float d13; +uniform float d14; +uniform float d15; +uniform float d16; +uniform float d17; +uniform float d18; +uniform float d19; +uniform float d20; +uniform float d21; +uniform float d22; +uniform float d23; +uniform float d24; +uniform float d25; +uniform float d26; +uniform float d27; +uniform float d28; +uniform float d29; +uniform float d30; +uniform float d31; +uniform float d32; +uniform float d33; +uniform float d34; + +uniform int Count; + +void main() +{ + vec4 color = BaseColor; + + // Latchy2 + do { + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Immediate dominator + while (color.w < d13) { + if (color.z < d13) + color++; + else + color--; + // code from Latchy 2 + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } + + color++; + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/mains.frag b/core/deps/glslang/Test/mains.frag index d6e17f966..5756a3e13 100644 --- a/core/deps/glslang/Test/mains.frag +++ b/core/deps/glslang/Test/mains.frag @@ -1,9 +1,9 @@ -#version 300 es - -void main() -{ -} - -void main() -{ -} +#version 300 es + +void main() +{ +} + +void main() +{ +} diff --git a/core/deps/glslang/Test/mains1.frag b/core/deps/glslang/Test/mains1.frag index b2beec6d7..e0de2e1e1 100644 --- a/core/deps/glslang/Test/mains1.frag +++ b/core/deps/glslang/Test/mains1.frag @@ -1,5 +1,5 @@ -#version 110 - -void main() -{ -} +#version 110 + +void main() +{ +} diff --git a/core/deps/glslang/Test/mains2.frag b/core/deps/glslang/Test/mains2.frag index b2beec6d7..e0de2e1e1 100644 --- a/core/deps/glslang/Test/mains2.frag +++ b/core/deps/glslang/Test/mains2.frag @@ -1,5 +1,5 @@ -#version 110 - -void main() -{ -} +#version 110 + +void main() +{ +} diff --git a/core/deps/glslang/Test/matrix.frag b/core/deps/glslang/Test/matrix.frag index 0c0be7417..150e0434f 100644 --- a/core/deps/glslang/Test/matrix.frag +++ b/core/deps/glslang/Test/matrix.frag @@ -1,55 +1,55 @@ -#version 130 - -//#define TEST_POST_110 - -uniform mat3 colorTransform; -varying vec3 Color; -uniform mat4 m, n; - -#ifdef TEST_POST_110 -uniform mat4x3 um43; -uniform mat3x4 un34; -#else -uniform mat4 um43; -uniform mat4 un34; -#endif - -varying vec4 v; - -#ifdef TEST_POST_110 -varying vec3 u; -#else -varying vec4 u; -#endif - -void main() -{ - gl_FragColor = vec4(un34[1]); - gl_FragColor += vec4(Color * colorTransform, 1.0); - - if (m != n) - gl_FragColor += v; - else { - gl_FragColor += m * v; - gl_FragColor += v * (m - n); - } - -#ifdef TEST_POST_110 - mat3x4 m34 = outerProduct(v, u); - m34 += mat4(v.x); - m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); -#else - mat4 m34 = mat4(v.x*u.x, v.x*u.y, v.x*u.z, v.x*u.w, - v.y*u.x, v.y*u.y, v.y*u.z, v.y*u.w, - v.z*u.x, v.z*u.y, v.z*u.z, v.z*u.w, - v.w*u.x, v.w*u.y, v.w*u.z, v.w*u.w); - m34 += mat4(v.x); - m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); - -#endif - - if (m34 == un34) - gl_FragColor += m34 * u; - else - gl_FragColor += (un34 * um43) * v; -} +#version 130 + +//#define TEST_POST_110 + +uniform mat3 colorTransform; +varying vec3 Color; +uniform mat4 m, n; + +#ifdef TEST_POST_110 +uniform mat4x3 um43; +uniform mat3x4 un34; +#else +uniform mat4 um43; +uniform mat4 un34; +#endif + +varying vec4 v; + +#ifdef TEST_POST_110 +varying vec3 u; +#else +varying vec4 u; +#endif + +void main() +{ + gl_FragColor = vec4(un34[1]); + gl_FragColor += vec4(Color * colorTransform, 1.0); + + if (m != n) + gl_FragColor += v; + else { + gl_FragColor += m * v; + gl_FragColor += v * (m - n); + } + +#ifdef TEST_POST_110 + mat3x4 m34 = outerProduct(v, u); + m34 += mat4(v.x); + m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); +#else + mat4 m34 = mat4(v.x*u.x, v.x*u.y, v.x*u.z, v.x*u.w, + v.y*u.x, v.y*u.y, v.y*u.z, v.y*u.w, + v.z*u.x, v.z*u.y, v.z*u.z, v.z*u.w, + v.w*u.x, v.w*u.y, v.w*u.z, v.w*u.w); + m34 += mat4(v.x); + m34 += mat4(u, u.x, u, u.x, u, u.x, u.x); + +#endif + + if (m34 == un34) + gl_FragColor += m34 * u; + else + gl_FragColor += (un34 * um43) * v; +} diff --git a/core/deps/glslang/Test/matrix2.frag b/core/deps/glslang/Test/matrix2.frag index 44fa4ec2d..df6580440 100644 --- a/core/deps/glslang/Test/matrix2.frag +++ b/core/deps/glslang/Test/matrix2.frag @@ -1,51 +1,51 @@ -#version 150 - -uniform mat3 colorTransform; -varying vec3 Color; -uniform mat4 m, n; - -uniform mat4x3 um43; -uniform mat3x4 un34; -uniform mat2 um2; -uniform mat3 um3; -uniform mat4 um4; - -varying vec4 v; - -varying vec3 u; - -out vec4 FragColor; - -void main() -{ - mat3x4 m34 = outerProduct(v, u); - - m34 += mat3x4(4.3); - - FragColor = vec4(Color, 1.0); - FragColor *= vec4(FragColor * m34, 1.0); - - m34 *= v.x; - - mat4 m44 = mat4(un34); - - m44 += m34 * um43; - - FragColor += (-m44) * v; - - FragColor *= matrixCompMult(m44, m44); - - m34 = transpose(um43); - FragColor *= vec4(FragColor * m34, 1.0); - FragColor *= vec4(determinant(um4)); - mat2 inv = inverse(um2); - FragColor *= vec4(inv[0][0], inv[1][0], inv[0][1], inv[1][1]); - mat3 inv3 = inverse(um3); - FragColor *= vec4(inv3[2][1]); - - mat4 inv4 = inverse(um4); - FragColor *= inv4; - - FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); - m34 *= colorTransform; -} +#version 150 + +uniform mat3 colorTransform; +varying vec3 Color; +uniform mat4 m, n; + +uniform mat4x3 um43; +uniform mat3x4 un34; +uniform mat2 um2; +uniform mat3 um3; +uniform mat4 um4; + +varying vec4 v; + +varying vec3 u; + +out vec4 FragColor; + +void main() +{ + mat3x4 m34 = outerProduct(v, u); + + m34 += mat3x4(4.3); + + FragColor = vec4(Color, 1.0); + FragColor *= vec4(FragColor * m34, 1.0); + + m34 *= v.x; + + mat4 m44 = mat4(un34); + + m44 += m34 * um43; + + FragColor += (-m44) * v; + + FragColor *= matrixCompMult(m44, m44); + + m34 = transpose(um43); + FragColor *= vec4(FragColor * m34, 1.0); + FragColor *= vec4(determinant(um4)); + mat2 inv = inverse(um2); + FragColor *= vec4(inv[0][0], inv[1][0], inv[0][1], inv[1][1]); + mat3 inv3 = inverse(um3); + FragColor *= vec4(inv3[2][1]); + + mat4 inv4 = inverse(um4); + FragColor *= inv4; + + FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); + m34 *= colorTransform; +} diff --git a/core/deps/glslang/Test/max_vertices_0.geom b/core/deps/glslang/Test/max_vertices_0.geom index 08fd6e6f2..4a420be10 100644 --- a/core/deps/glslang/Test/max_vertices_0.geom +++ b/core/deps/glslang/Test/max_vertices_0.geom @@ -1,12 +1,12 @@ -#version 330 - -layout(points) in; -layout(triangle_strip, max_vertices = 0) out; -in highp vec4 v_geom_FragColor[]; -out highp vec4 v_frag_FragColor; - -void main (void) -{ - EndPrimitive(); - EndPrimitive(); -} +#version 330 + +layout(points) in; +layout(triangle_strip, max_vertices = 0) out; +in highp vec4 v_geom_FragColor[]; +out highp vec4 v_frag_FragColor; + +void main (void) +{ + EndPrimitive(); + EndPrimitive(); +} diff --git a/core/deps/glslang/Test/missingBodies.vert b/core/deps/glslang/Test/missingBodies.vert index ab34a8a43..04b718154 100644 --- a/core/deps/glslang/Test/missingBodies.vert +++ b/core/deps/glslang/Test/missingBodies.vert @@ -1,24 +1,24 @@ -#version 450 - -void bar(); -void foo() { bar(); } - -void B(); -void C(int); -void C(int, int) { } -void C(bool); -void A() { B(); C(1); C(true); C(1, 2); } - -void main() -{ - foo(); - C(true); -} - -int ret1(); - -int f1 = ret1(); - -int ret2() { return 3; } - -int f2 = ret2(); +#version 450 + +void bar(); +void foo() { bar(); } + +void B(); +void C(int); +void C(int, int) { } +void C(bool); +void A() { B(); C(1); C(true); C(1, 2); } + +void main() +{ + foo(); + C(true); +} + +int ret1(); + +int f1 = ret1(); + +int ret2() { return 3; } + +int f2 = ret2(); diff --git a/core/deps/glslang/Test/mixedArrayDecls.frag b/core/deps/glslang/Test/mixedArrayDecls.frag index 45c68b840..aff4f78a5 100644 --- a/core/deps/glslang/Test/mixedArrayDecls.frag +++ b/core/deps/glslang/Test/mixedArrayDecls.frag @@ -1,30 +1,30 @@ -#version 450 - -struct S { - int[3] a[2], b[5]; -}; - -S s; - -int[5] c[4], d[8]; -int[9] e[], f[]; -int e[11][9]; -int f[13][9]; - -int[14] g[], h[]; - -int [14][15][6] foo(int[6] p[14][15]) { return p; } - -void main() -{ - g[3]; - h[2]; -} - -float[4][3][2] bar() { float[3][2] a[4]; return a; } - -in inbname { - float[7] f[8][9]; -} inbinst[4][5][6]; - -float[3][2] barm[4]() { float[3][2] a[4]; return a; } // ERROR +#version 450 + +struct S { + int[3] a[2], b[5]; +}; + +S s; + +int[5] c[4], d[8]; +int[9] e[], f[]; +int e[11][9]; +int f[13][9]; + +int[14] g[], h[]; + +int [14][15][6] foo(int[6] p[14][15]) { return p; } + +void main() +{ + g[3]; + h[2]; +} + +float[4][3][2] bar() { float[3][2] a[4]; return a; } + +in inbname { + float[7] f[8][9]; +} inbinst[4][5][6]; + +float[3][2] barm[4]() { float[3][2] a[4]; return a; } // ERROR diff --git a/core/deps/glslang/Test/newTexture.frag b/core/deps/glslang/Test/newTexture.frag index 4f807691f..30e77dce6 100644 --- a/core/deps/glslang/Test/newTexture.frag +++ b/core/deps/glslang/Test/newTexture.frag @@ -1,75 +1,75 @@ -#version 430 - -uniform samplerBuffer sb; -uniform sampler2DRect sr; -uniform sampler2D s2D; -uniform sampler3D s3D; -uniform samplerCube sCube; -uniform samplerCubeShadow sCubeShadow; -uniform sampler2DShadow s2DShadow; -uniform sampler2DArray s2DArray; -uniform sampler2DArrayShadow s2DArrayShadow; - -uniform isampler2D is2D; -uniform isampler3D is3D; -uniform isamplerCube isCube; -uniform isampler2DArray is2DArray; -uniform isampler2DMS is2Dms; - -uniform usampler2D us2D; -uniform usampler3D us3D; -uniform usamplerCube usCube; -uniform usampler2DArray us2DArray; - -in float c1D; -in vec2 c2D; -in vec3 c3D; -in vec4 c4D; - -flat in int ic1D; -flat in ivec2 ic2D; -flat in ivec3 ic3D; -flat in ivec4 ic4D; - -out vec4 FragData; - -void main() -{ - vec4 v = texture(s2D, c2D); - v += textureProj(s3D, c4D); - v += textureLod(s2DArray, c3D, 1.2); - v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); - v += texelFetch(s3D, ic3D, ic1D); - v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); - v += texelFetchOffset(sr, ic2D, ivec2(4)); - v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); - v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); - v += textureGrad(sCube, c3D, c3D, c3D); - v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ivec2(3)); - v += textureProjGrad(s3D, c4D, c3D, c3D); - v += textureProjGradOffset(s2D, c3D, c2D, c2D, ivec2(3)); - - ivec4 iv = texture(is2D, c2D); - v += vec4(iv); - iv = textureProjOffset(is2D, c4D, ivec2(3)); - v += vec4(iv); - iv = textureProjLod(is2D, c3D, c1D); - v += vec4(iv); - iv = textureProjGrad(is2D, c3D, c2D, c2D); - v += vec4(iv); - iv = texture(is3D, c3D, 4.2); - v += vec4(iv); - iv = textureLod(isCube, c3D, c1D); - v += vec4(iv); - iv = texelFetch(is2DArray, ic3D, ic1D); - v += vec4(iv); - iv += texelFetch(is2Dms, ic2D, ic1D); - v += vec4(iv); - v += texelFetch(sb, ic1D); - v += texelFetch(sr, ic2D); - - ivec2 iv2 = textureSize(sCubeShadow, 2); - // iv2 += textureSize(is2Dms); - - FragData = v + vec4(iv2, 0.0, 0.0); -} +#version 430 + +uniform samplerBuffer sb; +uniform sampler2DRect sr; +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform samplerCube sCube; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DShadow s2DShadow; +uniform sampler2DArray s2DArray; +uniform sampler2DArrayShadow s2DArrayShadow; + +uniform isampler2D is2D; +uniform isampler3D is3D; +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; +uniform isampler2DMS is2Dms; + +uniform usampler2D us2D; +uniform usampler3D us3D; +uniform usamplerCube usCube; +uniform usampler2DArray us2DArray; + +in float c1D; +in vec2 c2D; +in vec3 c3D; +in vec4 c4D; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +out vec4 FragData; + +void main() +{ + vec4 v = texture(s2D, c2D); + v += textureProj(s3D, c4D); + v += textureLod(s2DArray, c3D, 1.2); + v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); + v += texelFetch(s3D, ic3D, ic1D); + v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); + v += texelFetchOffset(sr, ic2D, ivec2(4)); + v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); + v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); + v += textureGrad(sCube, c3D, c3D, c3D); + v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ivec2(3)); + v += textureProjGrad(s3D, c4D, c3D, c3D); + v += textureProjGradOffset(s2D, c3D, c2D, c2D, ivec2(3)); + + ivec4 iv = texture(is2D, c2D); + v += vec4(iv); + iv = textureProjOffset(is2D, c4D, ivec2(3)); + v += vec4(iv); + iv = textureProjLod(is2D, c3D, c1D); + v += vec4(iv); + iv = textureProjGrad(is2D, c3D, c2D, c2D); + v += vec4(iv); + iv = texture(is3D, c3D, 4.2); + v += vec4(iv); + iv = textureLod(isCube, c3D, c1D); + v += vec4(iv); + iv = texelFetch(is2DArray, ic3D, ic1D); + v += vec4(iv); + iv += texelFetch(is2Dms, ic2D, ic1D); + v += vec4(iv); + v += texelFetch(sb, ic1D); + v += texelFetch(sr, ic2D); + + ivec2 iv2 = textureSize(sCubeShadow, 2); + // iv2 += textureSize(is2Dms); + + FragData = v + vec4(iv2, 0.0, 0.0); +} diff --git a/core/deps/glslang/Test/noMain.vert b/core/deps/glslang/Test/noMain.vert index 27be67df3..e83be0476 100644 --- a/core/deps/glslang/Test/noMain.vert +++ b/core/deps/glslang/Test/noMain.vert @@ -1,5 +1,5 @@ -#version 300 es - -void foo() -{ -} +#version 300 es + +void foo() +{ +} diff --git a/core/deps/glslang/Test/noMain1.geom b/core/deps/glslang/Test/noMain1.geom index 4fa1b768c..ab0834f9c 100644 --- a/core/deps/glslang/Test/noMain1.geom +++ b/core/deps/glslang/Test/noMain1.geom @@ -1,7 +1,7 @@ -#version 110 - -void foo() -{ -} - +#version 110 + +void foo() +{ +} + layout(points) out; \ No newline at end of file diff --git a/core/deps/glslang/Test/noMain2.geom b/core/deps/glslang/Test/noMain2.geom index d7c96c956..9fb5fd7d2 100644 --- a/core/deps/glslang/Test/noMain2.geom +++ b/core/deps/glslang/Test/noMain2.geom @@ -1,7 +1,7 @@ -#version 150 - -void bar() -{ -} - -layout(line_strip) out; +#version 150 + +void bar() +{ +} + +layout(line_strip) out; diff --git a/core/deps/glslang/Test/nonVulkan.frag b/core/deps/glslang/Test/nonVulkan.frag index 05c818d7c..425e8402d 100644 --- a/core/deps/glslang/Test/nonVulkan.frag +++ b/core/deps/glslang/Test/nonVulkan.frag @@ -1,9 +1,9 @@ -#version 450 - -layout(constant_id = 17) const int arraySize = 12; // ERROR -layout(input_attachment_index = 1) int foo; // ERROR -layout(push_constant) uniform ubn { int a; } ubi; // ERROR - -#ifdef VULKAN -#error VULKAN should not be defined -#endif +#version 450 + +layout(constant_id = 17) const int arraySize = 12; // ERROR +layout(input_attachment_index = 1) int foo; // ERROR +layout(push_constant) uniform ubn { int a; } ubi; // ERROR + +#ifdef VULKAN +#error VULKAN should not be defined +#endif diff --git a/core/deps/glslang/Test/nonuniform.frag b/core/deps/glslang/Test/nonuniform.frag index 9a43350e3..e98aacc30 100644 --- a/core/deps/glslang/Test/nonuniform.frag +++ b/core/deps/glslang/Test/nonuniform.frag @@ -1,33 +1,33 @@ -#version 450 - -int nonuniformEXT; - -#extension GL_EXT_nonuniform_qualifier : enable - -nonuniformEXT in vec4 nu_inv4; -nonuniformEXT float nu_gf; - -nonuniformEXT out vec4 nu_outv4; // ERROR, out -nonuniformEXT uniform vec4 nu_uv4; // ERROR, uniform -nonuniformEXT const float nu_constf = 1.0; // ERROR, const - -nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) -{ - return nupi; -} - -void main() -{ - nonuniformEXT int nu_li; - nonuniformEXT const int nu_ci = 2; // ERROR, const - - foo(nu_li, nu_li); - int table[5]; - int a; - nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); - nu_li = nonuniformEXT(a, a); // ERROR, too many arguments - nu_li = nonuniformEXT(); // ERROR, no arguments - nu_li = table[nonuniformEXT(3)]; -} -layout(location=1) in struct S { float a; nonuniformEXT float b; } ins; // ERROR, not on member -layout(location=3) in inbName { float a; nonuniformEXT float b; } inb; // ERROR, not on member +#version 450 + +int nonuniformEXT; + +#extension GL_EXT_nonuniform_qualifier : enable + +nonuniformEXT in vec4 nu_inv4; +nonuniformEXT float nu_gf; + +nonuniformEXT out vec4 nu_outv4; // ERROR, out +nonuniformEXT uniform vec4 nu_uv4; // ERROR, uniform +nonuniformEXT const float nu_constf = 1.0; // ERROR, const + +nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) +{ + return nupi; +} + +void main() +{ + nonuniformEXT int nu_li; + nonuniformEXT const int nu_ci = 2; // ERROR, const + + foo(nu_li, nu_li); + int table[5]; + int a; + nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + nu_li = nonuniformEXT(a, a); // ERROR, too many arguments + nu_li = nonuniformEXT(); // ERROR, no arguments + nu_li = table[nonuniformEXT(3)]; +} +layout(location=1) in struct S { float a; nonuniformEXT float b; } ins; // ERROR, not on member +layout(location=3) in inbName { float a; nonuniformEXT float b; } inb; // ERROR, not on member diff --git a/core/deps/glslang/Test/nosuffix b/core/deps/glslang/Test/nosuffix index 4da53b77e..26862fff1 100644 --- a/core/deps/glslang/Test/nosuffix +++ b/core/deps/glslang/Test/nosuffix @@ -1,4 +1,4 @@ -void main() -{ - gl_Position = vec4(1.0); +void main() +{ + gl_Position = vec4(1.0); } \ No newline at end of file diff --git a/core/deps/glslang/Test/numeral.frag b/core/deps/glslang/Test/numeral.frag index 3354d1db8..39814f4ed 100644 --- a/core/deps/glslang/Test/numeral.frag +++ b/core/deps/glslang/Test/numeral.frag @@ -1,106 +1,106 @@ -#version 400 - -void main() -{ - int o00 = 00; - int o000 = 000; - int o0000 = 0000; - int o5 = 05; - int o05 = 005; - int o006 = 0006; - int o7 = 07; - int o58 = 072; - int omax = 037777777777; - int o8 = 08; // ERROR - int o08 = 008; // ERROR - int o009 = 0009; // ERROR - int obig = 07324327323472347234; // ERROR - int omax1 = 040000000000; // ERROR - - uint uo5 = 05u; - uint uo6 = 06u; - uint uo7 = 07u; - uint uo8 = 08u; // ERROR - uint uo9 = 09u; // ERROR - - int h0 = 0x0; - int h00 = 0x00; - int h000 = 0x000; - int h1 = 0x1; - int h2 = 0x00000002; - int h300 = 0x000300; - int hABCDEF = 0xAbCdEF; - int hFFFFFFFF = 0xFFFFFFFF; - int h12345678 = 0xBC614E; - int hToBeOrNotToBe = 0x2b | ~0x2B; - - uint uh0 = 0x0u; - uint uhg = (0xcu); - uint uh000 = 0x000u; - uint uh1 = 0x1u; - uint uh2 = 0x00000002u; - uint uh300 = 0x000300u; - uint uhABCDEF = 0xAbCdEFu; - uint uhFFFFFFFF = 0xFFFFFFFFu; - uint uh12345678 = 0xBC614Eu; - uint uhToBeOrNotToBe = 0x2bu | ~0x2BU; - - //int he1 = 0xG; // ERROR - int he2 = 0x; // ERROR - int hbig = 0xFFFFFFFF1; // ERROR - - float f1 = 1.0; - float f2 = 2.; - float f3 = 3e0; - float f4 = 40e-1; - float f5 = 05.; - float f6 = 006.; - float f7 = .7e1; - float f8 = 08e0; - float f9 = .9e+1; - float f10 = 10.0; - float f11 = .011e+3; - float f12 = .0012e4; - float f543 = 000000543.; - float f6789 = 00006789.; - float f88 = 0000088.; - - float g1 = 5.3876e4; - float g2 = 4000000000e-11; - float g3 = 1e+5; - float g4 = 7.321E-3; - float g5 = 3.2E+4; - float g6 = 0.5e-5; - float g7 = 0.45; - float g8 = 6.e10; - - double gf1 = 1.0lf; - double gf2 = 2.Lf; - double gf3 = .3e1lF; - double gf4 = .4e1LF; - float gf5 = 5.f; - float gf6 = 6.F; - - //float e1 = 1..; // ERROR - //float e2 = 2.l; // ERROR - //float e3 = ..3; // ERROR - //float e4 = 4ee1; // ERROR - float e5 = 5f; // ERROR -} - -layout (location = 2) out vec4 c2; -layout (location = 3u) out vec4 c3; -layout (location = 04) out vec4 c4; -layout (location = 005u) out vec4 c5; -layout (location = 0x6) out vec4 c6; -layout (location = 0x7u) out vec4 c7; - -uint g1 = 4294967296u; // ERROR, too big -uint g2 = 4294967295u; -uint g3 = 4294967294u; -int g4 = 4294967296; // ERROR, too big -int g5 = 4294967295; -int g6 = 4294967294; -float inf1 = -1.#INF; -float inf2 = 1.#INF; -float inf3 = +1.#INF; +#version 400 + +void main() +{ + int o00 = 00; + int o000 = 000; + int o0000 = 0000; + int o5 = 05; + int o05 = 005; + int o006 = 0006; + int o7 = 07; + int o58 = 072; + int omax = 037777777777; + int o8 = 08; // ERROR + int o08 = 008; // ERROR + int o009 = 0009; // ERROR + int obig = 07324327323472347234; // ERROR + int omax1 = 040000000000; // ERROR + + uint uo5 = 05u; + uint uo6 = 06u; + uint uo7 = 07u; + uint uo8 = 08u; // ERROR + uint uo9 = 09u; // ERROR + + int h0 = 0x0; + int h00 = 0x00; + int h000 = 0x000; + int h1 = 0x1; + int h2 = 0x00000002; + int h300 = 0x000300; + int hABCDEF = 0xAbCdEF; + int hFFFFFFFF = 0xFFFFFFFF; + int h12345678 = 0xBC614E; + int hToBeOrNotToBe = 0x2b | ~0x2B; + + uint uh0 = 0x0u; + uint uhg = (0xcu); + uint uh000 = 0x000u; + uint uh1 = 0x1u; + uint uh2 = 0x00000002u; + uint uh300 = 0x000300u; + uint uhABCDEF = 0xAbCdEFu; + uint uhFFFFFFFF = 0xFFFFFFFFu; + uint uh12345678 = 0xBC614Eu; + uint uhToBeOrNotToBe = 0x2bu | ~0x2BU; + + //int he1 = 0xG; // ERROR + int he2 = 0x; // ERROR + int hbig = 0xFFFFFFFF1; // ERROR + + float f1 = 1.0; + float f2 = 2.; + float f3 = 3e0; + float f4 = 40e-1; + float f5 = 05.; + float f6 = 006.; + float f7 = .7e1; + float f8 = 08e0; + float f9 = .9e+1; + float f10 = 10.0; + float f11 = .011e+3; + float f12 = .0012e4; + float f543 = 000000543.; + float f6789 = 00006789.; + float f88 = 0000088.; + + float g1 = 5.3876e4; + float g2 = 4000000000e-11; + float g3 = 1e+5; + float g4 = 7.321E-3; + float g5 = 3.2E+4; + float g6 = 0.5e-5; + float g7 = 0.45; + float g8 = 6.e10; + + double gf1 = 1.0lf; + double gf2 = 2.Lf; + double gf3 = .3e1lF; + double gf4 = .4e1LF; + float gf5 = 5.f; + float gf6 = 6.F; + + //float e1 = 1..; // ERROR + //float e2 = 2.l; // ERROR + //float e3 = ..3; // ERROR + //float e4 = 4ee1; // ERROR + float e5 = 5f; // ERROR +} + +layout (location = 2) out vec4 c2; +layout (location = 3u) out vec4 c3; +layout (location = 04) out vec4 c4; +layout (location = 005u) out vec4 c5; +layout (location = 0x6) out vec4 c6; +layout (location = 0x7u) out vec4 c7; + +uint g1 = 4294967296u; // ERROR, too big +uint g2 = 4294967295u; +uint g3 = 4294967294u; +int g4 = 4294967296; // ERROR, too big +int g5 = 4294967295; +int g6 = 4294967294; +float inf1 = -1.#INF; +float inf2 = 1.#INF; +float inf3 = +1.#INF; diff --git a/core/deps/glslang/Test/parentBad b/core/deps/glslang/Test/parentBad index c5a00a65d..e54c10d05 100644 --- a/core/deps/glslang/Test/parentBad +++ b/core/deps/glslang/Test/parentBad @@ -1,3 +1,3 @@ -int a; - -#error bad parent +int a; + +#error bad parent diff --git a/core/deps/glslang/Test/precision.frag b/core/deps/glslang/Test/precision.frag index 02bc6ca89..e24fa52cc 100644 --- a/core/deps/glslang/Test/precision.frag +++ b/core/deps/glslang/Test/precision.frag @@ -1,76 +1,76 @@ -#version 100 - -varying vec3 color; // ERRROR, there is no default qualifier for float - -lowp vec2 foo(mediump vec3 mv3) -{ - highp vec4 hv4; - return hv4.xy; -} - -int global_medium; - -uniform lowp sampler2D samplerLow; -uniform mediump sampler2D samplerMed; -uniform highp sampler2D samplerHigh; - -precision highp int; -precision highp ivec2; // ERROR -precision mediump int[2]; // ERROR -vec4 uint; // okay -precision mediump vec4; // ERROR - -int global_high; - -void main() -{ - lowp int sum = global_medium + global_high; - - gl_FragColor = vec4(color, 1.0); - - int level1_high; - sum += level1_high; - - precision lowp int; - int level1_low; - sum += level1_low; - - // test maxing precisions of args to get precision of builtin - lowp float arg1; - mediump float arg2; - lowp float d = distance(arg1, arg2); - - { - int level2_low; - sum += level2_low; - - precision highp int; - int level2_high; - sum += level2_high; - do { - if (true) { - precision mediump int; - int level4_medium; - sum += level4_medium; - } - int level3_high; - sum += level3_high; - } while (true); - int level2_high2; - sum += level2_high2; - } - int level1_low3; - sum += level1_low3; - - sum += 4 + ((ivec2(level1_low3) * ivec2(level1_high) + ivec2((/* comma operator */level1_low3, level1_high)))).x; - - texture2D(samplerLow, vec2(0.1, 0.2)); - texture2D(samplerMed, vec2(0.1, 0.2)); - texture2D(samplerHigh, vec2(0.1, 0.2)); -} - -precision mediump bool; // ERROR -//precision mediump struct { int a; } s; // ERROR -struct s {int a;}; -precision mediump s; // ERROR -mediump bvec2 b2; // ERROR +#version 100 + +varying vec3 color; // ERRROR, there is no default qualifier for float + +lowp vec2 foo(mediump vec3 mv3) +{ + highp vec4 hv4; + return hv4.xy; +} + +int global_medium; + +uniform lowp sampler2D samplerLow; +uniform mediump sampler2D samplerMed; +uniform highp sampler2D samplerHigh; + +precision highp int; +precision highp ivec2; // ERROR +precision mediump int[2]; // ERROR +vec4 uint; // okay +precision mediump vec4; // ERROR + +int global_high; + +void main() +{ + lowp int sum = global_medium + global_high; + + gl_FragColor = vec4(color, 1.0); + + int level1_high; + sum += level1_high; + + precision lowp int; + int level1_low; + sum += level1_low; + + // test maxing precisions of args to get precision of builtin + lowp float arg1; + mediump float arg2; + lowp float d = distance(arg1, arg2); + + { + int level2_low; + sum += level2_low; + + precision highp int; + int level2_high; + sum += level2_high; + do { + if (true) { + precision mediump int; + int level4_medium; + sum += level4_medium; + } + int level3_high; + sum += level3_high; + } while (true); + int level2_high2; + sum += level2_high2; + } + int level1_low3; + sum += level1_low3; + + sum += 4 + ((ivec2(level1_low3) * ivec2(level1_high) + ivec2((/* comma operator */level1_low3, level1_high)))).x; + + texture2D(samplerLow, vec2(0.1, 0.2)); + texture2D(samplerMed, vec2(0.1, 0.2)); + texture2D(samplerHigh, vec2(0.1, 0.2)); +} + +precision mediump bool; // ERROR +//precision mediump struct { int a; } s; // ERROR +struct s {int a;}; +precision mediump s; // ERROR +mediump bvec2 b2; // ERROR diff --git a/core/deps/glslang/Test/prepost.frag b/core/deps/glslang/Test/prepost.frag index 9627b7e2d..dfd456660 100644 --- a/core/deps/glslang/Test/prepost.frag +++ b/core/deps/glslang/Test/prepost.frag @@ -1,38 +1,38 @@ -#version 140 - -void main() -{ - struct s { - float y[5]; - } str; - - float t; - int index = 5; // all indexing is 4 - - str.y[4] = 2.0; // 2.0 - t = ++str.y[--index]; // 3.0 - str.y[4] += t; // 6.0 - t = str.y[4]--; // 5.0 (t = 6.0) - str.y[index++] += t; // 11.0 - --str.y[--index]; // 10.0 - - float x = str.y[4]; - ++x; - --x; - x++; - x--; - - // x is 10.0 - - float y = x * ++x; // 10 * 11 - float z = y * x--; // 110 * 11 - - // x is 10.0 - // z is 1210.0 - - vec4 v = vec4(1.0, 2.0, 3.0, 4.0); - v.y = v.z--; // (1,3,2,4) - v.x = --v.w; // (3,3,2,3) - - gl_FragColor = z * v;// (3630.0, 3630.0, 2420.0, 3630.0) -} +#version 140 + +void main() +{ + struct s { + float y[5]; + } str; + + float t; + int index = 5; // all indexing is 4 + + str.y[4] = 2.0; // 2.0 + t = ++str.y[--index]; // 3.0 + str.y[4] += t; // 6.0 + t = str.y[4]--; // 5.0 (t = 6.0) + str.y[index++] += t; // 11.0 + --str.y[--index]; // 10.0 + + float x = str.y[4]; + ++x; + --x; + x++; + x--; + + // x is 10.0 + + float y = x * ++x; // 10 * 11 + float z = y * x--; // 110 * 11 + + // x is 10.0 + // z is 1210.0 + + vec4 v = vec4(1.0, 2.0, 3.0, 4.0); + v.y = v.z--; // (1,3,2,4) + v.x = --v.w; // (3,3,2,3) + + gl_FragColor = z * v;// (3630.0, 3630.0, 2420.0, 3630.0) +} diff --git a/core/deps/glslang/Test/preprocessor.bad_arg.vert b/core/deps/glslang/Test/preprocessor.bad_arg.vert index 8098fcdf9..344fc4b1e 100644 --- a/core/deps/glslang/Test/preprocessor.bad_arg.vert +++ b/core/deps/glslang/Test/preprocessor.bad_arg.vert @@ -1,8 +1,8 @@ -#define M(a) a -int M(aou - = 2) // Okay, one argument, split across newline - ; - -// end of file during an argument -#define EXP2(a, b) -EXP2(((((1,2,3,4))), ); +#define M(a) a +int M(aou + = 2) // Okay, one argument, split across newline + ; + +// end of file during an argument +#define EXP2(a, b) +EXP2(((((1,2,3,4))), ); diff --git a/core/deps/glslang/Test/preprocessor.edge_cases.vert b/core/deps/glslang/Test/preprocessor.edge_cases.vert index ebea94f2e..95bfbb3a1 100644 --- a/core/deps/glslang/Test/preprocessor.edge_cases.vert +++ b/core/deps/glslang/Test/preprocessor.edge_cases.vert @@ -1,15 +1,15 @@ -#version 310 es -#define X(Y) /* - */ Y + 2 - -#define Y(Z) 2 * Z// asdf - -#define Z(Y) /* - */ \ - 2 /* - */ + 3 \ - * Y - -void main() { - gl_Position = vec4(X(3) + Y(4) + Z(2)); -} +#version 310 es +#define X(Y) /* + */ Y + 2 + +#define Y(Z) 2 * Z// asdf + +#define Z(Y) /* + */ \ + 2 /* + */ + 3 \ + * Y + +void main() { + gl_Position = vec4(X(3) + Y(4) + Z(2)); +} diff --git a/core/deps/glslang/Test/preprocessor.errors.vert b/core/deps/glslang/Test/preprocessor.errors.vert index 86b396242..ca83848fa 100644 --- a/core/deps/glslang/Test/preprocessor.errors.vert +++ b/core/deps/glslang/Test/preprocessor.errors.vert @@ -1,20 +1,20 @@ -#version 310 es - -#define X 1 - -#if X - #ifdef Y - #error This should not show up in pp output. - #endif - #error This should show up in pp output. -#else - #error This should not show up in pp output. -#endif - -#def X -#if Y - -#extension a - -int main() { -} +#version 310 es + +#define X 1 + +#if X + #ifdef Y + #error This should not show up in pp output. + #endif + #error This should show up in pp output. +#else + #error This should not show up in pp output. +#endif + +#def X +#if Y + +#extension a + +int main() { +} diff --git a/core/deps/glslang/Test/preprocessor.extensions.vert b/core/deps/glslang/Test/preprocessor.extensions.vert index 89012960c..07455d544 100644 --- a/core/deps/glslang/Test/preprocessor.extensions.vert +++ b/core/deps/glslang/Test/preprocessor.extensions.vert @@ -1,12 +1,12 @@ -#version 310 es - -#extension GL_EXT_geometry_shader: enable -#extension GL_EXT_frag_depth: disable -#extension GL_EXT_gpu_shader5: require -#extension GL_EXT_shader_texture_image_samples: warn - -#extension unknown_extension: require - -int main() { -} - +#version 310 es + +#extension GL_EXT_geometry_shader: enable +#extension GL_EXT_frag_depth: disable +#extension GL_EXT_gpu_shader5: require +#extension GL_EXT_shader_texture_image_samples: warn + +#extension unknown_extension: require + +int main() { +} + diff --git a/core/deps/glslang/Test/preprocessor.function_macro.vert b/core/deps/glslang/Test/preprocessor.function_macro.vert index 3ae7c62af..577ea7e35 100644 --- a/core/deps/glslang/Test/preprocessor.function_macro.vert +++ b/core/deps/glslang/Test/preprocessor.function_macro.vert @@ -1,20 +1,20 @@ -#version 310 es - - -#define X(n) n + 1 -#define Y(n, z) n + z -#define Z(f) X(f) - -#define REALLY_LONG_MACRO_NAME_WITH_MANY_PARAMETERS(X1, X2, X3, X4, X5, X6, X7,\ - X8, X9, X10, X11, X12) X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11+X12 - -#define A(\ - Y\ - )\ -4 + 3 + Y - -int main() { - gl_Position = vec4(X(3), Y(3, 4), Z(3)); - gl_Position = vec4(REALLY_LONG_MACRO_NAME_WITH_MANY_PARAMETERS(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); - gl_Position = vec4(A(3)); -} +#version 310 es + + +#define X(n) n + 1 +#define Y(n, z) n + z +#define Z(f) X(f) + +#define REALLY_LONG_MACRO_NAME_WITH_MANY_PARAMETERS(X1, X2, X3, X4, X5, X6, X7,\ + X8, X9, X10, X11, X12) X1+X2+X3+X4+X5+X6+X7+X8+X9+X10+X11+X12 + +#define A(\ + Y\ + )\ +4 + 3 + Y + +int main() { + gl_Position = vec4(X(3), Y(3, 4), Z(3)); + gl_Position = vec4(REALLY_LONG_MACRO_NAME_WITH_MANY_PARAMETERS(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)); + gl_Position = vec4(A(3)); +} diff --git a/core/deps/glslang/Test/preprocessor.include.enabled.vert b/core/deps/glslang/Test/preprocessor.include.enabled.vert index 7d2cbfe2c..985eae2ce 100644 --- a/core/deps/glslang/Test/preprocessor.include.enabled.vert +++ b/core/deps/glslang/Test/preprocessor.include.enabled.vert @@ -1,20 +1,20 @@ -#extension GL_GOOGLE_include_directive : enable -#line 8000 -#include -#include 123 -#include "foo.oeu" -#include "foo.oeu/ao eu/ao.h" -#include "foo" -#include -#include -#include -#include "foo.oe>" -#include -#include "foo2.h" garbage -#include garbage -// max length -#include -// too long -#include +#extension GL_GOOGLE_include_directive : enable +#line 8000 +#include +#include 123 +#include "foo.oeu" +#include "foo.oeu/ao eu/ao.h" +#include "foo" +#include +#include +#include +#include "foo.oe>" +#include +#include "foo2.h" garbage +#include garbage +// max length +#include +// too long +#include #include "no-eol" \ No newline at end of file diff --git a/core/deps/glslang/Test/preprocessor.line.vert b/core/deps/glslang/Test/preprocessor.line.vert index 22d2907de..fed6bba2a 100644 --- a/core/deps/glslang/Test/preprocessor.line.vert +++ b/core/deps/glslang/Test/preprocessor.line.vert @@ -1,39 +1,39 @@ -#line 300 - -#line 2 - - - - - -#line __LINE__ + 3 - - -#line __FILE__ + 2 - -#line __FILE__ * __LINE__ - - -#define X 4 - -#line X - -#undef X - -#define X(y) y + 3 + 2 - -#line X(3) - -void main() { - gl_Position = vec4(__LINE__); -} - -#line X(3) 4 - -#define Z(y, q) \ - y*q*2 q - -#line Z(2, 3) - -#line 1 - +#line 300 + +#line 2 + + + + + +#line __LINE__ + 3 + + +#line __FILE__ + 2 + +#line __FILE__ * __LINE__ + + +#define X 4 + +#line X + +#undef X + +#define X(y) y + 3 + 2 + +#line X(3) + +void main() { + gl_Position = vec4(__LINE__); +} + +#line X(3) 4 + +#define Z(y, q) \ + y*q*2 q + +#line Z(2, 3) + +#line 1 + diff --git a/core/deps/glslang/Test/preprocessor.pragma.vert b/core/deps/glslang/Test/preprocessor.pragma.vert index 5e53cf127..0ae7ee212 100644 --- a/core/deps/glslang/Test/preprocessor.pragma.vert +++ b/core/deps/glslang/Test/preprocessor.pragma.vert @@ -1,13 +1,13 @@ -#version 310 es - -#pragma optimize(on) -#pragma optimize(off) -#pragma debug(on) -#pragma debug(off) - -#pragma undefined_pragma(x, 4) - -#pragma once - -int main() { -} +#version 310 es + +#pragma optimize(on) +#pragma optimize(off) +#pragma debug(on) +#pragma debug(off) + +#pragma undefined_pragma(x, 4) + +#pragma once + +int main() { +} diff --git a/core/deps/glslang/Test/preprocessor.simple.vert b/core/deps/glslang/Test/preprocessor.simple.vert index 4aa89c33e..788df76ce 100644 --- a/core/deps/glslang/Test/preprocessor.simple.vert +++ b/core/deps/glslang/Test/preprocessor.simple.vert @@ -1,65 +1,65 @@ -#version 310 es -#define X 1 -#define Y clamp -#define Z X - -#define F 1, 2 - -#define make_function \ - float fn ( float x ) \ - {\ - return x + 4.0; \ - } - -make_function - -int main() { - gl_Position = vec4(X); - gl_Position = Y(1, 2, 3); - gl_Position = vec4(Z); - gl_Position = vec4(F); - gl_Position = vec4(fn(3)); - [] . ++ -- - + - * % / - ! ~ - << >> < > <= >= - == != - & ^ | && ^^ || ? : - += -= *= /= %= <<= >>= &= |= ^= - 1.2 2E10 5u -5lf -} - -struct S { - int member1; - float member2; - vec4 member3; -}; - -#define xyz xxyz -#define yzy() yyz - -#define FUN_MAC() \ - vec3 a = vec3(0); \ - vec3 b = a.zxyz; \ - vec3 b = a.xyz; \ - vec3 b = a.yzy(); \ - vec3 b = a.xyz(); \ - vec3 b = a.yzy; \ - vec3 b = a.z; - -void foo() -{ - S s; - s.member2 + s.member1; - s.member3.zyx; - s.member2.xyz; - s.member2.yzy(); - s.member2.xyz(); - s.member2.yzy; - FUN_MAC() - yzy - - (); - yzy - - -} +#version 310 es +#define X 1 +#define Y clamp +#define Z X + +#define F 1, 2 + +#define make_function \ + float fn ( float x ) \ + {\ + return x + 4.0; \ + } + +make_function + +int main() { + gl_Position = vec4(X); + gl_Position = Y(1, 2, 3); + gl_Position = vec4(Z); + gl_Position = vec4(F); + gl_Position = vec4(fn(3)); + [] . ++ -- + + - * % / - ! ~ + << >> < > <= >= + == != + & ^ | && ^^ || ? : + += -= *= /= %= <<= >>= &= |= ^= + 1.2 2E10 5u -5lf +} + +struct S { + int member1; + float member2; + vec4 member3; +}; + +#define xyz xxyz +#define yzy() yyz + +#define FUN_MAC() \ + vec3 a = vec3(0); \ + vec3 b = a.zxyz; \ + vec3 b = a.xyz; \ + vec3 b = a.yzy(); \ + vec3 b = a.xyz(); \ + vec3 b = a.yzy; \ + vec3 b = a.z; + +void foo() +{ + S s; + s.member2 + s.member1; + s.member3.zyx; + s.member2.xyz; + s.member2.yzy(); + s.member2.xyz(); + s.member2.yzy; + FUN_MAC() + yzy + + (); + yzy + + +} diff --git a/core/deps/glslang/Test/rayQuery-allOps.Error.rgen b/core/deps/glslang/Test/rayQuery-allOps.Error.rgen new file mode 100644 index 000000000..d25a183a4 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-allOps.Error.rgen @@ -0,0 +1,212 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(std430, set = 0, binding = 0) buffer Log +{ + uint x; + uint y; +}; + +layout(binding = 1, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +void doSomething() +{ + x = 0; + y = 0; +} + +Ray makeRayDesc() +{ + Ray ray; + ray.pos= vec3(0,0,0); + ray.dir = vec3(1,0,0); + ray.tmin = 0.0f; + ray.tmax = 9999.0; + return ray; +} + +void main() +{ + Ray ray = makeRayDesc(); + rayQueryEXT rayQuery; + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, 0xFF, ray.pos, ray.tmin, ray.dir, ray.tmax); + + mat4x3 _mat4x3; + mat3x4 _mat3x4; + + while (rayQueryProceedEXT(rayQuery) == 1) + { + int candidateType = rayQueryGetIntersectionTypeEXT(rayQuery, false); + switch(candidateType) + { + case gl_RayQueryCandidateIntersectionTriangleEXT: + + rayQueryTerminateEXT(rayQuery); + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + rayQueryConfirmIntersectionEXT(rayQuery); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true) == 1) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true) == 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceIdEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionTEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQuery, true)) + { + doSomething(); + } + break; + + case gl_RayQueryCandidateIntersectionAABBEXT: + { + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + if (rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQuery)) + { + doSomething(); + } + + int t = 1; + rayQueryGenerateIntersectionEXT(rayQuery, t); + rayQueryTerminateEXT(rayQuery); + break; + } + } + } + + if(_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + int committedStatus = rayQueryGetIntersectionTypeEXT(rayQuery, true); + + switch(committedStatus) + { + case gl_RayQueryCommittedIntersectionNoneEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + break; + + case gl_RayQueryCommittedIntersectionTriangleEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, true); + _mat3x4 = transpose(_mat4x3); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true) == 0) + { + doSomething(); + } + break; + + case gl_RayQueryCommittedIntersectionGeneratedEXT : + + if(rayQueryGetIntersectionGeometryIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceIdEXT(rayQuery, true)) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true)) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true)) + { + doSomething(); + } + + if(rayQueryGetIntersectionTEXT(rayQuery, true)) + { + doSomething(); + } + break; + } + + if (_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + if (rayQueryGetRayFlagsEXT(rayQuery)) + { + doSomething(); + } + + if (rayQueryGetRayTMinEXT(rayQuery)) + { + doSomething(); + } + + vec3 o = rayQueryGetWorldRayOriginEXT(rayQuery); + vec3 d = rayQueryGetWorldRayDirectionEXT(rayQuery); + + if (o.x == d.z) + { + doSomething(); + } +} diff --git a/core/deps/glslang/Test/rayQuery-allOps.comp b/core/deps/glslang/Test/rayQuery-allOps.comp new file mode 100644 index 000000000..80f2593d6 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-allOps.comp @@ -0,0 +1,212 @@ +#version 460 +#extension GL_EXT_ray_query : enable +#extension GL_EXT_ray_flags_primitive_culling : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(std430, set = 0, binding = 0) buffer Log +{ + uint x; + uint y; +}; + +layout(binding = 1, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +void doSomething() +{ + x = 0; + y = 0; +} + +Ray makeRayDesc() +{ + Ray ray; + ray.pos= vec3(0,0,0); + ray.dir = vec3(1,0,0); + ray.tmin = 0.0f; + ray.tmax = 9999.0; + return ray; +} + +void main() +{ + Ray ray = makeRayDesc(); + rayQueryEXT rayQuery; + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, 0xFF, ray.pos, ray.tmin, ray.dir, ray.tmax); + + mat4x3 _mat4x3; + mat3x4 _mat3x4; + + while (rayQueryProceedEXT(rayQuery)) + { + uint candidateType = rayQueryGetIntersectionTypeEXT(rayQuery, false); + switch(candidateType) + { + case gl_RayQueryCandidateIntersectionTriangleEXT: + + rayQueryTerminateEXT(rayQuery); + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + rayQueryConfirmIntersectionEXT(rayQuery); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true).x == 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceIdEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionTEXT(rayQuery, true) > 0.f) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQuery, true) > 0) + { + doSomething(); + } + break; + + case gl_RayQueryCandidateIntersectionAABBEXT: + { + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + if (rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQuery)) + { + doSomething(); + } + + float t = 0.5; + rayQueryGenerateIntersectionEXT(rayQuery, t); + rayQueryTerminateEXT(rayQuery); + break; + } + } + } + + if(_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + uint committedStatus = rayQueryGetIntersectionTypeEXT(rayQuery, true); + + switch(committedStatus) + { + case gl_RayQueryCommittedIntersectionNoneEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + break; + + case gl_RayQueryCommittedIntersectionTriangleEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, true); + _mat3x4 = transpose(_mat4x3); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true).y == 0) + { + doSomething(); + } + break; + + case gl_RayQueryCommittedIntersectionGeneratedEXT : + + if(rayQueryGetIntersectionGeometryIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceIdEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true).z > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionTEXT(rayQuery, true) > 0.f) + { + doSomething(); + } + break; + } + + if (_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + if (rayQueryGetRayFlagsEXT(rayQuery) > gl_RayFlagsSkipTrianglesEXT) + { + doSomething(); + } + + if (rayQueryGetRayTMinEXT(rayQuery) > 0.0) + { + doSomething(); + } + + vec3 o = rayQueryGetWorldRayOriginEXT(rayQuery); + vec3 d = rayQueryGetWorldRayDirectionEXT(rayQuery); + + if (o.x == d.z) + { + doSomething(); + } +} diff --git a/core/deps/glslang/Test/rayQuery-allOps.frag b/core/deps/glslang/Test/rayQuery-allOps.frag new file mode 100644 index 000000000..9fdf0c067 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-allOps.frag @@ -0,0 +1,212 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(std430, set = 0, binding = 0) buffer Log +{ + uint x; + uint y; +}; + +layout(binding = 1, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +void doSomething() +{ + x = 0; + y = 0; +} + +Ray makeRayDesc() +{ + Ray ray; + ray.pos= vec3(0,0,0); + ray.dir = vec3(1,0,0); + ray.tmin = 0.0f; + ray.tmax = 9999.0; + return ray; +} + +void main() +{ + Ray ray = makeRayDesc(); + rayQueryEXT rayQuery; + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, 0xFF, ray.pos, ray.tmin, ray.dir, ray.tmax); + + mat4x3 _mat4x3; + mat3x4 _mat3x4; + + while (rayQueryProceedEXT(rayQuery)) + { + uint candidateType = rayQueryGetIntersectionTypeEXT(rayQuery, false); + switch(candidateType) + { + case gl_RayQueryCandidateIntersectionTriangleEXT: + + rayQueryTerminateEXT(rayQuery); + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + rayQueryConfirmIntersectionEXT(rayQuery); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true).x == 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceIdEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionTEXT(rayQuery, true) > 0.f) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQuery, true) > 0) + { + doSomething(); + } + break; + + case gl_RayQueryCandidateIntersectionAABBEXT: + { + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + if (rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQuery)) + { + doSomething(); + } + + float t = 0.5; + rayQueryGenerateIntersectionEXT(rayQuery, t); + rayQueryTerminateEXT(rayQuery); + break; + } + } + } + + if(_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + uint committedStatus = rayQueryGetIntersectionTypeEXT(rayQuery, true); + + switch(committedStatus) + { + case gl_RayQueryCommittedIntersectionNoneEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + break; + + case gl_RayQueryCommittedIntersectionTriangleEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, true); + _mat3x4 = transpose(_mat4x3); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true).y == 0) + { + doSomething(); + } + break; + + case gl_RayQueryCommittedIntersectionGeneratedEXT : + + if(rayQueryGetIntersectionGeometryIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceIdEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true).z > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionTEXT(rayQuery, true) > 0.f) + { + doSomething(); + } + break; + } + + if (_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + if (rayQueryGetRayFlagsEXT(rayQuery) > 0) + { + doSomething(); + } + + if (rayQueryGetRayTMinEXT(rayQuery) > 0.0) + { + doSomething(); + } + + vec3 o = rayQueryGetWorldRayOriginEXT(rayQuery); + vec3 d = rayQueryGetWorldRayDirectionEXT(rayQuery); + + if (o.x == d.z) + { + doSomething(); + } +} diff --git a/core/deps/glslang/Test/rayQuery-allOps.rgen b/core/deps/glslang/Test/rayQuery-allOps.rgen new file mode 100644 index 000000000..9fdf0c067 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-allOps.rgen @@ -0,0 +1,212 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(std430, set = 0, binding = 0) buffer Log +{ + uint x; + uint y; +}; + +layout(binding = 1, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +void doSomething() +{ + x = 0; + y = 0; +} + +Ray makeRayDesc() +{ + Ray ray; + ray.pos= vec3(0,0,0); + ray.dir = vec3(1,0,0); + ray.tmin = 0.0f; + ray.tmax = 9999.0; + return ray; +} + +void main() +{ + Ray ray = makeRayDesc(); + rayQueryEXT rayQuery; + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, 0xFF, ray.pos, ray.tmin, ray.dir, ray.tmax); + + mat4x3 _mat4x3; + mat3x4 _mat3x4; + + while (rayQueryProceedEXT(rayQuery)) + { + uint candidateType = rayQueryGetIntersectionTypeEXT(rayQuery, false); + switch(candidateType) + { + case gl_RayQueryCandidateIntersectionTriangleEXT: + + rayQueryTerminateEXT(rayQuery); + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + rayQueryConfirmIntersectionEXT(rayQuery); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true).x == 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceIdEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if (rayQueryGetIntersectionTEXT(rayQuery, true) > 0.f) + { + doSomething(); + } + + if (rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQuery, true) > 0) + { + doSomething(); + } + break; + + case gl_RayQueryCandidateIntersectionAABBEXT: + { + _mat4x3 = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + if (rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQuery)) + { + doSomething(); + } + + float t = 0.5; + rayQueryGenerateIntersectionEXT(rayQuery, t); + rayQueryTerminateEXT(rayQuery); + break; + } + } + } + + if(_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + uint committedStatus = rayQueryGetIntersectionTypeEXT(rayQuery, true); + + switch(committedStatus) + { + case gl_RayQueryCommittedIntersectionNoneEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, false); + _mat3x4 = transpose(_mat4x3); + break; + + case gl_RayQueryCommittedIntersectionTriangleEXT : + _mat4x3 = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, true); + _mat3x4 = transpose(_mat4x3); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, true)) + { + doSomething(); + } + + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, true).y == 0) + { + doSomething(); + } + break; + + case gl_RayQueryCommittedIntersectionGeneratedEXT : + + if(rayQueryGetIntersectionGeometryIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceIdEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, true).z > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, true).x > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, true) > 0) + { + doSomething(); + } + + if(rayQueryGetIntersectionTEXT(rayQuery, true) > 0.f) + { + doSomething(); + } + break; + } + + if (_mat3x4[0][0] == _mat4x3[0][0]) + { + doSomething(); + } + + if (rayQueryGetRayFlagsEXT(rayQuery) > 0) + { + doSomething(); + } + + if (rayQueryGetRayTMinEXT(rayQuery) > 0.0) + { + doSomething(); + } + + vec3 o = rayQueryGetWorldRayOriginEXT(rayQuery); + vec3 d = rayQueryGetWorldRayDirectionEXT(rayQuery); + + if (o.x == d.z) + { + doSomething(); + } +} diff --git a/core/deps/glslang/Test/rayQuery-committed.Error.rgen b/core/deps/glslang/Test/rayQuery-committed.Error.rgen new file mode 100644 index 000000000..aeb8ec066 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-committed.Error.rgen @@ -0,0 +1,105 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(std430, set = 0, binding = 0) buffer Log +{ + uint x; + uint y; +}; + +layout(binding = 1, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +void doSomething() +{ + x = 0; + y = 0; +} + +uint launchIndex() +{ + return gl_LaunchIDNV.z*gl_LaunchSizeNV.x*gl_LaunchSizeNV.y + gl_LaunchIDNV.y*gl_LaunchSizeNV.x + gl_LaunchIDNV.x; +} + +void main() +{ + uint index = launchIndex(); + Ray ray = rays[index]; + rayQueryEXT rayQuery; + + bool committed_true = true; + bool committed_false = false; + + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsOpaqueEXT, gl_RayFlagsCullBackFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax); + while (rayQueryProceedEXT(rayQuery)) + { + mat4x3 mat_o2w; + mat4x3 mat_w2o; + + uint candidateType = rayQueryGetIntersectionTypeEXT(rayQuery, committed_false); + if (candidateType == gl_RayQueryCandidateIntersectionTriangleEXT) + { + rayQueryTerminateEXT(rayQuery); + + mat_o2w = rayQueryGetIntersectionObjectToWorldEXT(rayQuery, committed_false); + mat_w2o = rayQueryGetIntersectionWorldToObjectEXT(rayQuery, committed_false); + + rayQueryConfirmIntersectionEXT(rayQuery); + + if (rayQueryGetIntersectionFrontFaceEXT(rayQuery, committed_true)) + { + doSomething(); + } + if (rayQueryGetIntersectionBarycentricsEXT(rayQuery, committed_true).x == 0) + { + doSomething(); + } + if (rayQueryGetIntersectionInstanceCustomIndexEXT(rayQuery, committed_true) > 0) + { + doSomething(); + } + if (rayQueryGetIntersectionInstanceIdEXT(rayQuery, committed_true) > 0) + { + doSomething(); + } + if (rayQueryGetIntersectionObjectRayDirectionEXT(rayQuery, committed_true).x > 0) + { + doSomething(); + } + if (rayQueryGetIntersectionObjectRayOriginEXT(rayQuery, committed_true).x > 0) + { + doSomething(); + } + if (rayQueryGetIntersectionPrimitiveIndexEXT(rayQuery, committed_true) > 0) + { + doSomething(); + } + if (rayQueryGetIntersectionTEXT(rayQuery, committed_true) > 0.f) + { + doSomething(); + } + if (rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQuery, committed_true) > 0) + { + doSomething(); + } + } + } + + uint committedStatus = rayQueryGetIntersectionTypeEXT(rayQuery, committed_true); + if (committedStatus == gl_RayQueryCommittedIntersectionGeneratedEXT) + { + if (rayQueryGetIntersectionGeometryIndexEXT(rayQuery, committed_true) > 0) + { + doSomething(); + } + } +} diff --git a/core/deps/glslang/Test/rayQuery-initialize.rgen b/core/deps/glslang/Test/rayQuery-initialize.rgen new file mode 100644 index 000000000..ff6180060 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-initialize.rgen @@ -0,0 +1,33 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(binding = 0, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +uint launchIndex() +{ + return gl_LaunchIDNV.z*gl_LaunchSizeNV.x*gl_LaunchSizeNV.y + gl_LaunchIDNV.y*gl_LaunchSizeNV.x + gl_LaunchIDNV.x; +} + +void doInitialize(rayQueryEXT rayQuery, Ray ray) +{ + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, gl_RayFlagsCullBackFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax); +} + +void main() +{ + uint index = launchIndex(); + Ray ray = rays[index]; + rayQueryEXT rayQuery; + doInitialize(rayQuery, ray); + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsOpaqueEXT, gl_RayFlagsCullFrontFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax); +} diff --git a/core/deps/glslang/Test/rayQuery-no-cse.rgen b/core/deps/glslang/Test/rayQuery-no-cse.rgen new file mode 100644 index 000000000..ccec76f79 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery-no-cse.rgen @@ -0,0 +1,35 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable + +struct Ray +{ + vec3 pos; + float tmin; + vec3 dir; + float tmax; +}; + +layout(binding = 0, set = 0) uniform accelerationStructureEXT rtas; +layout(std430, set = 0, binding = 2) buffer Rays { Ray rays[]; }; + +uint launchIndex() +{ + return gl_LaunchIDNV.z*gl_LaunchSizeNV.x*gl_LaunchSizeNV.y + gl_LaunchIDNV.y*gl_LaunchSizeNV.x + gl_LaunchIDNV.x; +} + +void doInitialize(rayQueryEXT rayQuery, Ray ray) +{ + rayQueryInitializeEXT(rayQuery, rtas, gl_RayFlagsNoneEXT, gl_RayFlagsCullBackFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax); +} + +void main() +{ + uint index = launchIndex(); + Ray ray = rays[index]; + rayQueryEXT rayQuery1; + rayQueryEXT rayQuery2; + doInitialize(rayQuery1, ray); + rayQueryInitializeEXT(rayQuery1, rtas, gl_RayFlagsOpaqueEXT, gl_RayFlagsCullFrontFacingTrianglesEXT, ray.pos, ray.tmin, ray.dir, ray.tmax); + doInitialize(rayQuery2, ray); +} diff --git a/core/deps/glslang/Test/rayQuery.rgen b/core/deps/glslang/Test/rayQuery.rgen new file mode 100644 index 000000000..8d5638fd8 --- /dev/null +++ b/core/deps/glslang/Test/rayQuery.rgen @@ -0,0 +1,23 @@ +#version 460 +#extension GL_NV_ray_tracing : enable +#extension GL_EXT_ray_query : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT acc0; + +layout(shaderRecordNV) buffer block +{ + vec3 dir; + vec3 origin; +}; + +void main() +{ + rayQueryEXT localRayQuery; + uint rayFlags = gl_RayFlagsOpaqueEXT | gl_RayFlagsSkipClosestHitShaderEXT; + float tMin = 0.f; + float tMax = 1000.f; + rayQueryInitializeEXT(localRayQuery, acc0, rayFlags, 0xFF , origin, tMin, dir, tMax); + if (!rayQueryProceedEXT(localRayQuery)) + { + rayQueryTerminateEXT(localRayQuery); + } +} diff --git a/core/deps/glslang/Test/recurse1.frag b/core/deps/glslang/Test/recurse1.frag index 447a8827d..66b4c3fea 100644 --- a/core/deps/glslang/Test/recurse1.frag +++ b/core/deps/glslang/Test/recurse1.frag @@ -1,48 +1,48 @@ -#version 330 core - -// cross-unit recursion - -void main() {} - -// two-level recursion - -float cbar(int); - -void cfoo(float) -{ - cbar(2); -} - -// four-level, out of order - -void CB(); -void CD(); -void CA() { CB(); } -void CC() { CD(); } - -// high degree - -void CBT(); -void CDT(); -void CAT() { CBT(); CBT(); CBT(); } -void CCT() { CDT(); CDT(); CBT(); } - -// not recursive - -void norA() {} -void norB() { norA(); } -void norC() { norA(); } -void norD() { norA(); } -void norE() { norB(); } -void norF() { norB(); } -void norG() { norE(); } -void norH() { norE(); } -void norI() { norE(); } - -// not recursive, but with a call leading into a cycle if ignoring direction - -void norcA() { } -void norcB() { norcA(); } -void norcC() { norcB(); } -void norcD() { norcC(); norcB(); } // head of cycle -void norcE() { norcD(); } // lead into cycle +#version 330 core + +// cross-unit recursion + +void main() {} + +// two-level recursion + +float cbar(int); + +void cfoo(float) +{ + cbar(2); +} + +// four-level, out of order + +void CB(); +void CD(); +void CA() { CB(); } +void CC() { CD(); } + +// high degree + +void CBT(); +void CDT(); +void CAT() { CBT(); CBT(); CBT(); } +void CCT() { CDT(); CDT(); CBT(); } + +// not recursive + +void norA() {} +void norB() { norA(); } +void norC() { norA(); } +void norD() { norA(); } +void norE() { norB(); } +void norF() { norB(); } +void norG() { norE(); } +void norH() { norE(); } +void norI() { norE(); } + +// not recursive, but with a call leading into a cycle if ignoring direction + +void norcA() { } +void norcB() { norcA(); } +void norcC() { norcB(); } +void norcD() { norcC(); norcB(); } // head of cycle +void norcE() { norcD(); } // lead into cycle diff --git a/core/deps/glslang/Test/recurse1.vert b/core/deps/glslang/Test/recurse1.vert index bb5b245e8..e2dbce00e 100644 --- a/core/deps/glslang/Test/recurse1.vert +++ b/core/deps/glslang/Test/recurse1.vert @@ -1,44 +1,44 @@ -#version 330 core - -void main() {} - -float bar(int); - -// direct recursion - -void self() -{ - self(); -} - -// two-level recursion - -void foo(float) -{ - bar(2); -} - -float bar(int) -{ - foo(4.2); - - return 3.2; -} - -// four-level, out of order - -void B(); -void D(); -void A() { B(); } -void C() { D(); } -void B() { C(); } -void D() { A(); } - -// high degree - -void BT(); -void DT(); -void AT() { BT(); BT(); BT(); } -void CT() { DT(); AT(); DT(); BT(); } -void BT() { CT(); CT(); CT(); } -void DT() { AT(); } +#version 330 core + +void main() {} + +float bar(int); + +// direct recursion + +void self() +{ + self(); +} + +// two-level recursion + +void foo(float) +{ + bar(2); +} + +float bar(int) +{ + foo(4.2); + + return 3.2; +} + +// four-level, out of order + +void B(); +void D(); +void A() { B(); } +void C() { D(); } +void B() { C(); } +void D() { A(); } + +// high degree + +void BT(); +void DT(); +void AT() { BT(); BT(); BT(); } +void CT() { DT(); AT(); DT(); BT(); } +void BT() { CT(); CT(); CT(); } +void DT() { AT(); } diff --git a/core/deps/glslang/Test/recurse2.frag b/core/deps/glslang/Test/recurse2.frag index 6bd4067f1..d649fef6b 100644 --- a/core/deps/glslang/Test/recurse2.frag +++ b/core/deps/glslang/Test/recurse2.frag @@ -1,28 +1,28 @@ -#version 330 core - -// cross-unit recursion - -// two-level recursion - -void cfoo(float); - -float cbar(int) -{ - cfoo(4.2); - - return 3.2; -} - -// four-level, out of order - -void CA(); -void CC(); -void CB() { CC(); } -void CD() { CA(); } - -// high degree - -void CAT(); -void CCT(); -void CBT() { CCT(); CCT(); CCT(); } -void CDT() { CAT(); } +#version 330 core + +// cross-unit recursion + +// two-level recursion + +void cfoo(float); + +float cbar(int) +{ + cfoo(4.2); + + return 3.2; +} + +// four-level, out of order + +void CA(); +void CC(); +void CB() { CC(); } +void CD() { CA(); } + +// high degree + +void CAT(); +void CCT(); +void CBT() { CCT(); CCT(); CCT(); } +void CDT() { CAT(); } diff --git a/core/deps/glslang/Test/reflection.frag b/core/deps/glslang/Test/reflection.frag index 6dfa2b878..929965313 100644 --- a/core/deps/glslang/Test/reflection.frag +++ b/core/deps/glslang/Test/reflection.frag @@ -1,8 +1,8 @@ -#version 440 core - -in float inval; - -void main() -{ - float f = inval; -} +#version 440 core + +in float inval; + +void main() +{ + float f = inval; +} diff --git a/core/deps/glslang/Test/reflection.linked.frag b/core/deps/glslang/Test/reflection.linked.frag index 4f847bce4..4a88ec49f 100644 --- a/core/deps/glslang/Test/reflection.linked.frag +++ b/core/deps/glslang/Test/reflection.linked.frag @@ -1,19 +1,19 @@ -#version 440 core - -layout(binding = 0, std140) uniform ubo_block { - float unused_uniform; - float shared_uniform; - float vsonly_uniform; - float fsonly_uniform; -} ubo; - -in float vertout; - -out float fragout; - -void main() -{ - fragout = vertout; - fragout += ubo.shared_uniform; - fragout += ubo.fsonly_uniform; -} +#version 440 core + +layout(binding = 0, std140) uniform ubo_block { + float unused_uniform; + float shared_uniform; + float vsonly_uniform; + float fsonly_uniform; +} ubo; + +in float vertout; + +out float fragout; + +void main() +{ + fragout = vertout; + fragout += ubo.shared_uniform; + fragout += ubo.fsonly_uniform; +} diff --git a/core/deps/glslang/Test/reflection.linked.vert b/core/deps/glslang/Test/reflection.linked.vert index bb55c2d92..e28142de7 100644 --- a/core/deps/glslang/Test/reflection.linked.vert +++ b/core/deps/glslang/Test/reflection.linked.vert @@ -1,19 +1,19 @@ -#version 440 core - -layout(binding = 0, std140) uniform ubo_block { - float unused_uniform; - float shared_uniform; - float vsonly_uniform; - float fsonly_uniform; -} ubo; - -in float vertin; - -out float vertout; - -void main() -{ - vertout = vertin; - vertout += ubo.shared_uniform; - vertout += ubo.vsonly_uniform; -} +#version 440 core + +layout(binding = 0, std140) uniform ubo_block { + float unused_uniform; + float shared_uniform; + float vsonly_uniform; + float fsonly_uniform; +} ubo; + +in float vertin; + +out float vertout; + +void main() +{ + vertout = vertin; + vertout += ubo.shared_uniform; + vertout += ubo.vsonly_uniform; +} diff --git a/core/deps/glslang/Test/reflection.options.geom b/core/deps/glslang/Test/reflection.options.geom index 41b7a85f7..76ba3c049 100644 --- a/core/deps/glslang/Test/reflection.options.geom +++ b/core/deps/glslang/Test/reflection.options.geom @@ -1,31 +1,31 @@ -#version 330 core - -precision highp float; - -layout(triangles) in; -layout(triangle_strip, max_vertices = 4) out; - -in block -{ - vec2 Color; - vec2 Texcoord; - flat ivec3 in_a; -} In[]; - -out block -{ - vec4 Color; - vec4 a; - vec2 b[3]; -} Out; - -void main() -{ - for(int i = 0; i < gl_in.length(); ++i) - { - gl_Position = gl_in[i].gl_Position; - Out.Color = vec4(In[i].Color, 0, 1); - EmitVertex(); - } - EndPrimitive(); -} +#version 330 core + +precision highp float; + +layout(triangles) in; +layout(triangle_strip, max_vertices = 4) out; + +in block +{ + vec2 Color; + vec2 Texcoord; + flat ivec3 in_a; +} In[]; + +out block +{ + vec4 Color; + vec4 a; + vec2 b[3]; +} Out; + +void main() +{ + for(int i = 0; i < gl_in.length(); ++i) + { + gl_Position = gl_in[i].gl_Position; + Out.Color = vec4(In[i].Color, 0, 1); + EmitVertex(); + } + EndPrimitive(); +} diff --git a/core/deps/glslang/Test/reflection.options.vert b/core/deps/glslang/Test/reflection.options.vert index 24f113345..b88f8542e 100644 --- a/core/deps/glslang/Test/reflection.options.vert +++ b/core/deps/glslang/Test/reflection.options.vert @@ -1,64 +1,64 @@ -#version 440 core - -struct VertexInfo { - float position[3]; - float normal[3]; -}; - -struct TriangleInfo { - VertexInfo v[3]; -}; - -buffer VertexCollection { - TriangleInfo t[5]; - uint padding[10]; -}; - -buffer MultipleArrays { - TriangleInfo tri[5]; - VertexInfo vert[5]; - float f[5]; -} multiarray; - -buffer ArrayedBind { - float a; - float b; -} buffers[3]; - -uniform UBO { - VertexInfo verts[2]; - float flt[8]; - uvec4 unused; - float uniform_multi[4][3][2]; -} ubo; - -uniform float uniform_multi[4][3][2]; - -struct OutputStruct { - float val; - vec3 a; - vec2 b[4]; - mat2x2 c; -}; - -out OutputStruct outval; -out float outarr[3]; - -void main() -{ - float f; - f += t[0].v[0].position[0]; - f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID]; - f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID]; - f += multiarray.tri[gl_InstanceID].v[0].position[0]; - f += multiarray.vert[gl_InstanceID].position[0]; - f += multiarray.f[gl_InstanceID]; - f += ubo.verts[gl_InstanceID].position[0]; - f += ubo.flt[gl_InstanceID]; - f += ubo.uniform_multi[0][0][0]; - f += uniform_multi[gl_InstanceID][gl_InstanceID][gl_InstanceID]; - f += buffers[gl_InstanceID].b; - TriangleInfo tlocal[5] = t; - outval.val = f; - outarr[2] = f; -} +#version 440 core + +struct VertexInfo { + float position[3]; + float normal[3]; +}; + +struct TriangleInfo { + VertexInfo v[3]; +}; + +buffer VertexCollection { + TriangleInfo t[5]; + uint padding[10]; +}; + +buffer MultipleArrays { + TriangleInfo tri[5]; + VertexInfo vert[5]; + float f[5]; +} multiarray; + +buffer ArrayedBind { + float a; + float b; +} buffers[3]; + +uniform UBO { + VertexInfo verts[2]; + float flt[8]; + uvec4 unused; + float uniform_multi[4][3][2]; +} ubo; + +uniform float uniform_multi[4][3][2]; + +struct OutputStruct { + float val; + vec3 a; + vec2 b[4]; + mat2x2 c; +}; + +out OutputStruct outval; +out float outarr[3]; + +void main() +{ + float f; + f += t[0].v[0].position[0]; + f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID]; + f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID]; + f += multiarray.tri[gl_InstanceID].v[0].position[0]; + f += multiarray.vert[gl_InstanceID].position[0]; + f += multiarray.f[gl_InstanceID]; + f += ubo.verts[gl_InstanceID].position[0]; + f += ubo.flt[gl_InstanceID]; + f += ubo.uniform_multi[0][0][0]; + f += uniform_multi[gl_InstanceID][gl_InstanceID][gl_InstanceID]; + f += buffers[gl_InstanceID].b; + TriangleInfo tlocal[5] = t; + outval.val = f; + outarr[2] = f; +} diff --git a/core/deps/glslang/Test/reflection.vert b/core/deps/glslang/Test/reflection.vert index 367519d7a..7b9239b83 100644 --- a/core/deps/glslang/Test/reflection.vert +++ b/core/deps/glslang/Test/reflection.vert @@ -1,245 +1,245 @@ -#version 440 core - -layout(std140, row_major) uniform nameless { - vec3 anonMember1; - mat3x2 m23; - int scalarAfterm23; - vec4 anonDeadMember2; - vec4 anonMember3; - int scalarBeforeArray; - float floatArray[5]; - int scalarAfterArray; - mat2x2 m22[9]; -}; - -layout(std140, column_major) uniform c_nameless { - vec3 c_anonMember1; - mat3x2 c_m23; - int c_scalarAfterm23; - vec4 c_anonDeadMember2; - vec4 c_anonMember3; -}; - -layout(std140) uniform named { - vec3 deadMember1; - int scalar; - vec4 member2; - vec4 member3; - vec2 memvec2; - float memf1; - bool memf2; - int memf3; - vec2 memvec2a; - mat2x2 m22[7]; -} ablock; - -layout(std140) uniform namelessdead { - int a; -}; - -layout(std140) uniform namedDead { - int b; -} bblock; - -struct N1 { - float a; -}; - -struct N2 { - float b; - float c; - float d; -}; - -struct N3 { - N1 n1; - N2 n2; -}; - -layout(std140) uniform nested { - N3 foo; -} nest; - -layout(std140) uniform nested2 { - vec4 padding; // offset 0, size 16 - N3 a; // offset 16, size 32 - N1 b[4]; // offset 48, size 64 - N1 c[2]; // offset 112, size 32 - N1 d[4]; // offset 144, size 64 -} nest2; - -struct TS { - int a; - int dead; -}; - -uniform TS s; - -uniform float uf1; -uniform float uf2; -uniform float ufDead3; -uniform float ufDead4; - -uniform writeonly uimage2D image_ui2D; -uniform sampler2D sampler_2D; -uniform sampler2DMSArray sampler_2DMSArray; - -uniform mat2 dm22[10]; - -struct deep1 { - vec2 va[3]; - bool b; -}; - -struct deep2 { - int i; - deep1 d1[4]; -}; - -struct deep3 { - vec4 iv4; - deep2 d2; - ivec3 v3; -}; - -in float attributeFloat; -layout(location = 2) in vec2 attributeFloat2; -in vec3 attributeFloat3; -in vec4 attributeFloat4; -in mat4 attributeMat4; -in float attributeFloatArray[3]; - -uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; - -const bool control = true; - -void deadFunction() -{ - vec3 v3 = ablock.deadMember1; - vec4 v = anonDeadMember2; - float f = ufDead4; -} - -void liveFunction2() -{ - vec3 v = anonMember1; - float f = uf1; -} - -void liveFunction1(writeonly uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray) - -{ - liveFunction2(); - float f = uf2; - vec4 v = ablock.member3; -} - -uniform abl { - float foo; -} arrBl[4]; - -uniform abl2 { - float foo; -} arrBl2[4]; - -buffer buf1 { - float scalar; - float runtimeArray[]; -} buf1i; - -buffer buf2 { - float scalar; - N2 runtimeArray[]; -} buf2i; - -buffer buf3 { - float scalar; - float runtimeArray[]; -} buf3i; - -buffer buf4 { - float scalar; - N2 runtimeArray[]; -} buf4i; - -struct VertexInfo { - float position[3]; - float normal[3]; -}; - -struct TriangleInfo { - VertexInfo v[3]; -}; - -buffer VertexCollection { - TriangleInfo t[5]; - uint padding[10]; -}; - -out float outval; - -void main() -{ - liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray); - liveFunction2(); - - if (! control) - deadFunction(); - - float f; - int i; - if (control) { - liveFunction2(); - f = anonMember3.z; - f = s.a; - f = ablock.scalar; - f = m23[1].y + scalarAfterm23; - f = c_m23[1].y + c_scalarAfterm23; - f += scalarBeforeArray; - f += floatArray[2]; - f += floatArray[4]; - f += scalarAfterArray; - f += ablock.memvec2.x; - f += ablock.memf1; - f += float(ablock.memf2); - f += ablock.memf3; - f += ablock.memvec2a.y; - f += ablock.m22[i][1][0]; - f += dm22[3][0][1]; - f += m22[2][1].y; - f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d; - f += deepA[i].d2.d1[2].va[1].x; - f += deepB[1].d2.d1[i].va[1].x; - f += deepB[i].d2.d1[i].va[1].x; - deep3 d = deepC[1]; - deep3 da[2] = deepD; - deep1 db = deepA[i].d2.d1[i]; - } else - f = ufDead3; - - f += arrBl[2].foo + arrBl[0].foo; - f += arrBl2[i].foo; - - f += attributeFloat; - f += attributeFloat2.x; - f += attributeFloat3.x; - f += attributeFloat4.x; - f += attributeMat4[0][1]; - f += attributeFloatArray[2]; - f += buf1i.runtimeArray[3]; - f += buf2i.runtimeArray[3].c; - f += buf3i.runtimeArray[gl_InstanceID]; - f += buf4i.runtimeArray[gl_InstanceID].c; - - N3 n = nest2.a; - N1 b[4] = nest2.b; - f += nest2.c[1].a; - f += nest2.d[gl_InstanceID].a; - - f += t[0].v[0].position[0]; - f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID]; - f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID]; - TriangleInfo tlocal[5] = t; - - outval = f; -} +#version 440 core + +layout(std140, row_major) uniform nameless { + vec3 anonMember1; + mat3x2 m23; + int scalarAfterm23; + vec4 anonDeadMember2; + vec4 anonMember3; + int scalarBeforeArray; + float floatArray[5]; + int scalarAfterArray; + mat2x2 m22[9]; +}; + +layout(std140, column_major) uniform c_nameless { + vec3 c_anonMember1; + mat3x2 c_m23; + int c_scalarAfterm23; + vec4 c_anonDeadMember2; + vec4 c_anonMember3; +}; + +layout(std140) uniform named { + vec3 deadMember1; + int scalar; + vec4 member2; + vec4 member3; + vec2 memvec2; + float memf1; + bool memf2; + int memf3; + vec2 memvec2a; + mat2x2 m22[7]; +} ablock; + +layout(std140) uniform namelessdead { + int a; +}; + +layout(std140) uniform namedDead { + int b; +} bblock; + +struct N1 { + float a; +}; + +struct N2 { + float b; + float c; + float d; +}; + +struct N3 { + N1 n1; + N2 n2; +}; + +layout(std140) uniform nested { + N3 foo; +} nest; + +layout(std140) uniform nested2 { + vec4 padding; // offset 0, size 16 + N3 a; // offset 16, size 32 + N1 b[4]; // offset 48, size 64 + N1 c[2]; // offset 112, size 32 + N1 d[4]; // offset 144, size 64 +} nest2; + +struct TS { + int a; + int dead; +}; + +uniform TS s; + +uniform float uf1; +uniform float uf2; +uniform float ufDead3; +uniform float ufDead4; + +uniform writeonly uimage2D image_ui2D; +uniform sampler2D sampler_2D; +uniform sampler2DMSArray sampler_2DMSArray; + +uniform mat2 dm22[10]; + +struct deep1 { + vec2 va[3]; + bool b; +}; + +struct deep2 { + int i; + deep1 d1[4]; +}; + +struct deep3 { + vec4 iv4; + deep2 d2; + ivec3 v3; +}; + +in float attributeFloat; +layout(location = 2) in vec2 attributeFloat2; +in vec3 attributeFloat3; +in vec4 attributeFloat4; +in mat4 attributeMat4; +in float attributeFloatArray[3]; + +uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; + +const bool control = true; + +void deadFunction() +{ + vec3 v3 = ablock.deadMember1; + vec4 v = anonDeadMember2; + float f = ufDead4; +} + +void liveFunction2() +{ + vec3 v = anonMember1; + float f = uf1; +} + +void liveFunction1(writeonly uimage2D p_ui2D, sampler2D p_2D, sampler2DMSArray p_2DMSArray) + +{ + liveFunction2(); + float f = uf2; + vec4 v = ablock.member3; +} + +uniform abl { + float foo; +} arrBl[4]; + +uniform abl2 { + float foo; +} arrBl2[4]; + +buffer buf1 { + float scalar; + float runtimeArray[]; +} buf1i; + +buffer buf2 { + float scalar; + N2 runtimeArray[]; +} buf2i; + +buffer buf3 { + float scalar; + float runtimeArray[]; +} buf3i; + +buffer buf4 { + float scalar; + N2 runtimeArray[]; +} buf4i; + +struct VertexInfo { + float position[3]; + float normal[3]; +}; + +struct TriangleInfo { + VertexInfo v[3]; +}; + +buffer VertexCollection { + TriangleInfo t[5]; + uint padding[10]; +}; + +out float outval; + +void main() +{ + liveFunction1(image_ui2D, sampler_2D, sampler_2DMSArray); + liveFunction2(); + + if (! control) + deadFunction(); + + float f; + int i; + if (control) { + liveFunction2(); + f = anonMember3.z; + f = s.a; + f = ablock.scalar; + f = m23[1].y + scalarAfterm23; + f = c_m23[1].y + c_scalarAfterm23; + f += scalarBeforeArray; + f += floatArray[2]; + f += floatArray[4]; + f += scalarAfterArray; + f += ablock.memvec2.x; + f += ablock.memf1; + f += float(ablock.memf2); + f += ablock.memf3; + f += ablock.memvec2a.y; + f += ablock.m22[i][1][0]; + f += dm22[3][0][1]; + f += m22[2][1].y; + f += nest.foo.n1.a + nest.foo.n2.b + nest.foo.n2.c + nest.foo.n2.d; + f += deepA[i].d2.d1[2].va[1].x; + f += deepB[1].d2.d1[i].va[1].x; + f += deepB[i].d2.d1[i].va[1].x; + deep3 d = deepC[1]; + deep3 da[2] = deepD; + deep1 db = deepA[i].d2.d1[i]; + } else + f = ufDead3; + + f += arrBl[2].foo + arrBl[0].foo; + f += arrBl2[i].foo; + + f += attributeFloat; + f += attributeFloat2.x; + f += attributeFloat3.x; + f += attributeFloat4.x; + f += attributeMat4[0][1]; + f += attributeFloatArray[2]; + f += buf1i.runtimeArray[3]; + f += buf2i.runtimeArray[3].c; + f += buf3i.runtimeArray[gl_InstanceID]; + f += buf4i.runtimeArray[gl_InstanceID].c; + + N3 n = nest2.a; + N1 b[4] = nest2.b; + f += nest2.c[1].a; + f += nest2.d[gl_InstanceID].a; + + f += t[0].v[0].position[0]; + f += t[gl_InstanceID].v[gl_InstanceID].position[gl_InstanceID]; + f += t[gl_InstanceID].v[gl_InstanceID].normal[gl_InstanceID]; + TriangleInfo tlocal[5] = t; + + outval = f; +} diff --git a/core/deps/glslang/Test/runtests b/core/deps/glslang/Test/runtests index 23406dc34..1a7c7c941 100755 --- a/core/deps/glslang/Test/runtests +++ b/core/deps/glslang/Test/runtests @@ -176,9 +176,9 @@ diff -b $BASEDIR/hlsl.pp.line3.frag.out $TARGETDIR/hlsl.pp.line3.frag.out || HAS # Testing -D and -U # echo "Testing -D and -U" -$EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l -UUNDEFED -DMUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out +$EXE -DUNDEFED -UIN_SHADER -DFOO=200 -i -l --U UNDEFED --define-macro MUL=FOO*2 glsl.-D-U.frag > $TARGETDIR/glsl.-D-U.frag.out diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1 -$EXE -D -Od -e main -V -i -DUNDEFED -UIN_SHADER -DFOO=200 -UUNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out +$EXE -D -Od -e main -V -i -DUNDEFED -UIN_SHADER --D FOO=200 --undef-macro UNDEFED -Od hlsl.-D-U.frag > $TARGETDIR/hlsl.-D-U.frag.out diff -b $BASEDIR/hlsl.-D-U.frag.out $TARGETDIR/hlsl.-D-U.frag.out || HASERROR=1 # @@ -189,6 +189,7 @@ $EXE --client vulkan100 spv.targetVulkan.vert || HASERROR=1 $EXE --client opengl100 spv.targetOpenGL.vert || HASERROR=1 $EXE --target-env vulkan1.0 spv.targetVulkan.vert || HASERROR=1 $EXE --target-env vulkan1.1 spv.targetVulkan.vert || HASERROR=1 +$EXE --target-env vulkan1.2 spv.targetVulkan.vert || HASERROR=1 $EXE --target-env opengl spv.targetOpenGL.vert || HASERROR=1 $EXE -V100 spv.targetVulkan.vert || HASERROR=1 $EXE -G100 spv.targetOpenGL.vert || HASERROR=1 diff --git a/core/deps/glslang/Test/runtimeArray.vert b/core/deps/glslang/Test/runtimeArray.vert index 9341330c9..a5da4f419 100644 --- a/core/deps/glslang/Test/runtimeArray.vert +++ b/core/deps/glslang/Test/runtimeArray.vert @@ -1,110 +1,110 @@ -#version 450 core - -buffer bn { - int a[]; - float b[]; -} buf; - -uniform un { - int a[]; - float b[]; -} ubuf; - -buffer bna { - int a[]; - float b[]; -} bufa[4]; - -uniform una { - int a[]; - float b[]; -} ubufa[4]; - -buffer abn { - int aba[]; - float abb[]; -}; - -uniform aun { - int aua[]; - float aub[]; -}; - -layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; -layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; -layout(binding=3) uniform uname { float a; } uniformBuffer[]; -layout(binding=4) buffer bname { float b; } storageBuffer[]; -layout(binding=5) uniform sampler2D sampledImage[]; -layout(binding=6, r32f) uniform image2D storageImage[]; -layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; -layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; - -int i; - -void main() -{ - ubuf.a[3]; - ubuf.b[3]; - buf.a[3]; - buf.b[3]; - - ubufa[3].a[3]; - ubufa[3].b[3]; - bufa[3].a[3]; - bufa[3].b[3]; - - aua[3]; - aub[3]; - aba[3]; - abb[3]; - - ubuf.a[i]; // ERROR - ubuf.b[i]; // ERROR - buf.a[i]; // ERROR - buf.b[i]; - - ubuf.a.length(); // ERROR - ubuf.b.length(); // ERROR - buf.a.length(); // ERROR - buf.b.length(); - - ubufa[1].a[i]; // ERROR - ubufa[1].b[i]; // ERROR - bufa[1].a[i]; // ERROR - bufa[1].b[i]; - - ubufa[1].a.length(); // ERROR - ubufa[1].b.length(); // ERROR - bufa[1].a.length(); // ERROR - bufa[1].b.length(); - - aua[i]; // ERROR - aub[i]; // ERROR - aba[i]; // ERROR - abb[i]; - - aua.length(); // ERROR - aub.length(); // ERROR - aba.length(); // ERROR - abb.length(); - - uniformTexelBufferDyn[1]; - storageTexelBufferDyn[1]; - uniformBuffer[1]; - storageBuffer[1]; - sampledImage[1]; - storageImage[1]; - uniformTexelBuffer[1]; - storageTexelBuffer[1]; - - uniformTexelBufferDyn[i]; // ERROR, need extension - storageTexelBufferDyn[i]; // ERROR, need extension - uniformBuffer[i]; // ERROR, need extension - storageBuffer[i]; // ERROR, need extension - sampledImage[i]; // ERROR, need extension - storageImage[i]; // ERROR, need extension - uniformTexelBuffer[i]; // ERROR, need extension - storageTexelBuffer[i]; // ERROR, need extension - - float local[] = ubuf.b; // ERROR, can initialize with runtime-sized array -} +#version 450 core + +buffer bn { + int a[]; + float b[]; +} buf; + +uniform un { + int a[]; + float b[]; +} ubuf; + +buffer bna { + int a[]; + float b[]; +} bufa[4]; + +uniform una { + int a[]; + float b[]; +} ubufa[4]; + +buffer abn { + int aba[]; + float abb[]; +}; + +uniform aun { + int aua[]; + float aub[]; +}; + +layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; +layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; +layout(binding=3) uniform uname { float a; } uniformBuffer[]; +layout(binding=4) buffer bname { float b; } storageBuffer[]; +layout(binding=5) uniform sampler2D sampledImage[]; +layout(binding=6, r32f) uniform image2D storageImage[]; +layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; +layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; + +int i; + +void main() +{ + ubuf.a[3]; + ubuf.b[3]; + buf.a[3]; + buf.b[3]; + + ubufa[3].a[3]; + ubufa[3].b[3]; + bufa[3].a[3]; + bufa[3].b[3]; + + aua[3]; + aub[3]; + aba[3]; + abb[3]; + + ubuf.a[i]; // ERROR + ubuf.b[i]; // ERROR + buf.a[i]; // ERROR + buf.b[i]; + + ubuf.a.length(); // ERROR + ubuf.b.length(); // ERROR + buf.a.length(); // ERROR + buf.b.length(); + + ubufa[1].a[i]; // ERROR + ubufa[1].b[i]; // ERROR + bufa[1].a[i]; // ERROR + bufa[1].b[i]; + + ubufa[1].a.length(); // ERROR + ubufa[1].b.length(); // ERROR + bufa[1].a.length(); // ERROR + bufa[1].b.length(); + + aua[i]; // ERROR + aub[i]; // ERROR + aba[i]; // ERROR + abb[i]; + + aua.length(); // ERROR + aub.length(); // ERROR + aba.length(); // ERROR + abb.length(); + + uniformTexelBufferDyn[1]; + storageTexelBufferDyn[1]; + uniformBuffer[1]; + storageBuffer[1]; + sampledImage[1]; + storageImage[1]; + uniformTexelBuffer[1]; + storageTexelBuffer[1]; + + uniformTexelBufferDyn[i]; // ERROR, need extension + storageTexelBufferDyn[i]; // ERROR, need extension + uniformBuffer[i]; // ERROR, need extension + storageBuffer[i]; // ERROR, need extension + sampledImage[i]; // ERROR, need extension + storageImage[i]; // ERROR, need extension + uniformTexelBuffer[i]; // ERROR, need extension + storageTexelBuffer[i]; // ERROR, need extension + + float local[] = ubuf.b; // ERROR, can initialize with runtime-sized array +} diff --git a/core/deps/glslang/Test/sample.frag b/core/deps/glslang/Test/sample.frag index 014b54a40..d9b9f5cc4 100644 --- a/core/deps/glslang/Test/sample.frag +++ b/core/deps/glslang/Test/sample.frag @@ -1,41 +1,41 @@ -// -//Copyright (C) 2002-2004 3Dlabs Inc. Ltd. -//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 3Dlabs Inc. Ltd. 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. -// -#version 110 - -varying vec3 color; - -void main() -{ - gl_FragColor = vec4(color, 1.0); -} +// +//Copyright (C) 2002-2004 3Dlabs Inc. Ltd. +//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 3Dlabs Inc. Ltd. 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. +// +#version 110 + +varying vec3 color; + +void main() +{ + gl_FragColor = vec4(color, 1.0); +} diff --git a/core/deps/glslang/Test/sample.vert b/core/deps/glslang/Test/sample.vert index 675bfec11..8cda91f96 100644 --- a/core/deps/glslang/Test/sample.vert +++ b/core/deps/glslang/Test/sample.vert @@ -1,43 +1,43 @@ -// -//Copyright (C) 2002-2004 3Dlabs Inc. Ltd. -//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 3Dlabs Inc. Ltd. 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. -// -#version 110 - -varying vec3 color; - -void main() -{ - color = vec3(1.0, 1.0, 1.0); - - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; -} +// +//Copyright (C) 2002-2004 3Dlabs Inc. Ltd. +//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 3Dlabs Inc. Ltd. 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. +// +#version 110 + +varying vec3 color; + +void main() +{ + color = vec3(1.0, 1.0, 1.0); + + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} diff --git a/core/deps/glslang/Test/simpleFunctionCall.frag b/core/deps/glslang/Test/simpleFunctionCall.frag index 1adddd562..59f0ccd58 100644 --- a/core/deps/glslang/Test/simpleFunctionCall.frag +++ b/core/deps/glslang/Test/simpleFunctionCall.frag @@ -1,15 +1,15 @@ -#version 150 - -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; - -vec4 foo() -{ - return BaseColor; -} - -void main() -{ - gl_FragColor = foo(); -} +#version 150 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +vec4 foo() +{ + return BaseColor; +} + +void main() +{ + gl_FragColor = foo(); +} diff --git a/core/deps/glslang/Test/specExamples.frag b/core/deps/glslang/Test/specExamples.frag index 177a0a799..7eec45e95 100644 --- a/core/deps/glslang/Test/specExamples.frag +++ b/core/deps/glslang/Test/specExamples.frag @@ -1,237 +1,237 @@ -#version 430 - -#extension GL_3DL_array_objects : enable - -int a = 0xffffffff; // 32 bits, a gets the value -1 -int b = 0xffffffffU; // ERROR: can't convert uint to int -uint c = 0xffffffff; // 32 bits, c gets the value 0xFFFFFFFF -uint d = 0xffffffffU; // 32 bits, d gets the value 0xFFFFFFFF -int e = -1; // the literal is "1", then negation is performed, - // and the resulting non-literal 32-bit signed - // bit pattern of 0xFFFFFFFF is assigned, giving e - // the value of -1. -uint f = -1u; // the literal is "1u", then negation is performed, - // and the resulting non-literal 32-bit unsigned - // bit pattern of 0xFFFFFFFF is assigned, giving f - // the value of 0xFFFFFFFF. -int g = 3000000000; // a signed decimal literal taking 32 bits, - // setting the sign bit, g gets -1294967296 -int h = 0xA0000000; // okay, 32-bit signed hexadecimal -int i = 5000000000; // ERROR: needs more than 32 bits -int j = 0xFFFFFFFFF; // ERROR: needs more that 32 bits -int k = 0x80000000; // k gets -2147483648 == 0x80000000 -int l = 2147483648; // l gets -2147483648 (the literal set the sign bit) - -float fa, fb = 1.5; // single-precision floating-point -double fc, fd = 2.0LF; // double-precision floating-point - -vec2 texcoord1, texcoord2; -vec3 position; -vec4 myRGBA; -ivec2 textureLookup; -bvec3 less; - -mat2 mat2D; -mat3 optMatrix; -mat4 view, projection; -mat4x4 view; // an alternate way of declaring a mat4 -mat3x2 m; // a matrix with 3 columns and 2 rows -dmat4 highPrecisionMVP; -dmat2x4 dm; - -struct light { - float intensity; - vec3 position; -} lightVar; - -struct S { float f; }; - -struct T { - //S; // Error: anonymous structures disallowed - //struct { ... }; // Error: embedded structures disallowed - S s; // Okay: nested structures with name are allowed -}; - -float frequencies[3]; -uniform vec4 lightPosition[4]; -light lights[]; -const int numLights = 2; -light lights[numLights]; - -in vec3 normal; -centroid in vec2 TexCoord; -invariant centroid in vec4 Color; -noperspective in float temperature; -flat in vec3 myColor; -noperspective centroid in vec2 myTexCoord; - -uniform vec4 lightPosition; -uniform vec3 color = vec3(0.7, 0.7, 0.2); // value assigned at link time - -in Material { - smooth in vec4 Color1; // legal, input inside in block - smooth vec4 Color2; // legal, 'in' inherited from 'in Material' - vec2 TexCoordA; // legal, TexCoord is an input - uniform float Atten; // illegal, mismatched storage qualifier - -}; - -in Light { - vec4 LightPos; - vec3 LightColor; -}; -in ColoredTexture { - vec4 Color; - vec2 TexCoord; -} Materiala; // instance name -vec3 Color; // different Color than Material.Color - -in vec4 gl_FragCoord; // redeclaration that changes nothing is allowed - -// All the following are allowed redeclaration that change behavior -layout(origin_upper_left) in vec4 gl_FragCoord; -layout(pixel_center_integer) in vec4 gl_FragCoord; -layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; - -layout(early_fragment_tests) in; - -// compute shader: -layout (local_size_x = 32, local_size_y = 32) in; -layout (local_size_x = 8) in; - -layout(location = 3) out vec4 color; -layout(location = 3, index = 1) out vec4 factor; -layout(location = 2) out vec4 colors[3]; - -layout (depth_greater) out float gl_FragDepth; - -// redeclaration that changes nothing is allowed -out float gl_FragDepth; - -// assume it may be modified in any way -layout (depth_any) out float gl_FragDepth; - -// assume it may be modified such that its value will only increase -layout (depth_greater) out float gl_FragDepth; - -// assume it may be modified such that its value will only decrease -layout (depth_less) out float gl_FragDepth; - -// assume it will not be modified -layout (depth_unchanged) out float gl_FragDepth; - -in vec4 gl_Color; // predeclared by the fragment language -flat in vec4 gl_Color; // redeclared by user to be flat - - -float[5] foo(float[5]) -{ - return float[5](3.4, 4.2, 5.0, 5.2, 1.1); -} - -precision highp float; -precision highp int; -precision mediump int; -precision highp float; - -void main() -{ - { - float a[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1); - } - { - float a[5] = float[](3.4, 4.2, 5.0, 5.2, 1.1); // same thing - } - { - vec4 a[3][2]; // size-3 array of size-2 array of vec4 - vec4[2] a1[3]; // size-3 array of size-2 array of vec4 - vec4[3][2] a2; // size-3 array of size-2 array of vec4 - vec4 b[2] = vec4[2](vec4(0.0), vec4(0.1)); - vec4[3][2] a3 = vec4[3][2](b, b, b); // constructor - void foo(vec4[3][2]); // prototype with unnamed parameter - vec4 a4[3][2] = {vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0)), - vec4[2](vec4(0.0), vec4(1.0)) }; - } - { - float a[5]; - { - float b[] = a; // b is explicitly size 5 - } - { - float b[5] = a; // means the same thing - } - { - float b[] = float[](1,2,3,4,5); // also explicitly sizes to 5 - } - a.length(); // returns 5 - } - { - vec4 a[3][2]; - a.length(); // this is 3 - a[x].length(); // this is 2 - } - // for an array b containing a member array a: - b[++x].a.length(); // b is never dereferenced, but “++x” is evaluated - - // for an array s of a shader storage object containing a member array a: - s[x].a.length(); // s is dereferenced; x needs to be a valid index - // - //All of the following declarations result in a compile-time error. - //float a[2] = { 3.4, 4.2, 5.0 }; // illegal - //vec2 b = { 1.0, 2.0, 3.0 }; // illegal - //mat3x3 c = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal - //mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting - //struct { - // float a; - // int b; - //} e = { 1.2, 2, 3 }; // illegal - - struct { - float a; - int b; - } e = { 1.2, 2 }; // legal, all types match - - struct { - float a; - int b; - } e = { 1, 3 }; // legal, first initializer is converted - - //All of the following declarations result in a compile-time error. - //int a = true; // illegal - //vec4 b[2] = { vec4(0.0), 1.0 }; // illegal - //mat4x2 c = { vec3(0.0), vec3(1.0) }; // illegal - - //struct S1 { - // vec4 a; - // vec4 b; - //}; - - //struct { - // float s; - // float t; - //} d[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal - - { - float a[] = float[](3.4, 4.2, 5.0, 5.2, 1.1); - float b[] = { 3.4, 4.2, 5.0, 5.2, 1.1 }; - float c[] = a; // c is explicitly size 5 - float d[5] = b; // means the same thing - } - { - const vec3 zAxis = vec3 (0.0, 0.0, 1.0); - const float ceiling = a + b; // a and b not necessarily constants - } - { - in vec4 position; - in vec3 normal; - in vec2 texCoord[4]; - } - { - lowp float color; - out mediump vec2 P; - lowp ivec2 foo(lowp mat3); - highp mat4 m; - } - -} +#version 430 + +#extension GL_3DL_array_objects : enable + +int a = 0xffffffff; // 32 bits, a gets the value -1 +int b = 0xffffffffU; // ERROR: can't convert uint to int +uint c = 0xffffffff; // 32 bits, c gets the value 0xFFFFFFFF +uint d = 0xffffffffU; // 32 bits, d gets the value 0xFFFFFFFF +int e = -1; // the literal is "1", then negation is performed, + // and the resulting non-literal 32-bit signed + // bit pattern of 0xFFFFFFFF is assigned, giving e + // the value of -1. +uint f = -1u; // the literal is "1u", then negation is performed, + // and the resulting non-literal 32-bit unsigned + // bit pattern of 0xFFFFFFFF is assigned, giving f + // the value of 0xFFFFFFFF. +int g = 3000000000; // a signed decimal literal taking 32 bits, + // setting the sign bit, g gets -1294967296 +int h = 0xA0000000; // okay, 32-bit signed hexadecimal +int i = 5000000000; // ERROR: needs more than 32 bits +int j = 0xFFFFFFFFF; // ERROR: needs more that 32 bits +int k = 0x80000000; // k gets -2147483648 == 0x80000000 +int l = 2147483648; // l gets -2147483648 (the literal set the sign bit) + +float fa, fb = 1.5; // single-precision floating-point +double fc, fd = 2.0LF; // double-precision floating-point + +vec2 texcoord1, texcoord2; +vec3 position; +vec4 myRGBA; +ivec2 textureLookup; +bvec3 less; + +mat2 mat2D; +mat3 optMatrix; +mat4 view, projection; +mat4x4 view; // an alternate way of declaring a mat4 +mat3x2 m; // a matrix with 3 columns and 2 rows +dmat4 highPrecisionMVP; +dmat2x4 dm; + +struct light { + float intensity; + vec3 position; +} lightVar; + +struct S { float f; }; + +struct T { + //S; // Error: anonymous structures disallowed + //struct { ... }; // Error: embedded structures disallowed + S s; // Okay: nested structures with name are allowed +}; + +float frequencies[3]; +uniform vec4 lightPosition[4]; +light lights[]; +const int numLights = 2; +light lights[numLights]; + +in vec3 normal; +centroid in vec2 TexCoord; +invariant centroid in vec4 Color; +noperspective in float temperature; +flat in vec3 myColor; +noperspective centroid in vec2 myTexCoord; + +uniform vec4 lightPosition; +uniform vec3 color = vec3(0.7, 0.7, 0.2); // value assigned at link time + +in Material { + smooth in vec4 Color1; // legal, input inside in block + smooth vec4 Color2; // legal, 'in' inherited from 'in Material' + vec2 TexCoordA; // legal, TexCoord is an input + uniform float Atten; // illegal, mismatched storage qualifier + +}; + +in Light { + vec4 LightPos; + vec3 LightColor; +}; +in ColoredTexture { + vec4 Color; + vec2 TexCoord; +} Materiala; // instance name +vec3 Color; // different Color than Material.Color + +in vec4 gl_FragCoord; // redeclaration that changes nothing is allowed + +// All the following are allowed redeclaration that change behavior +layout(origin_upper_left) in vec4 gl_FragCoord; +layout(pixel_center_integer) in vec4 gl_FragCoord; +layout(origin_upper_left, pixel_center_integer) in vec4 gl_FragCoord; + +layout(early_fragment_tests) in; + +// compute shader: +layout (local_size_x = 32, local_size_y = 32) in; +layout (local_size_x = 8) in; + +layout(location = 3) out vec4 color; +layout(location = 3, index = 1) out vec4 factor; +layout(location = 2) out vec4 colors[3]; + +layout (depth_greater) out float gl_FragDepth; + +// redeclaration that changes nothing is allowed +out float gl_FragDepth; + +// assume it may be modified in any way +layout (depth_any) out float gl_FragDepth; + +// assume it may be modified such that its value will only increase +layout (depth_greater) out float gl_FragDepth; + +// assume it may be modified such that its value will only decrease +layout (depth_less) out float gl_FragDepth; + +// assume it will not be modified +layout (depth_unchanged) out float gl_FragDepth; + +in vec4 gl_Color; // predeclared by the fragment language +flat in vec4 gl_Color; // redeclared by user to be flat + + +float[5] foo(float[5]) +{ + return float[5](3.4, 4.2, 5.0, 5.2, 1.1); +} + +precision highp float; +precision highp int; +precision mediump int; +precision highp float; + +void main() +{ + { + float a[5] = float[5](3.4, 4.2, 5.0, 5.2, 1.1); + } + { + float a[5] = float[](3.4, 4.2, 5.0, 5.2, 1.1); // same thing + } + { + vec4 a[3][2]; // size-3 array of size-2 array of vec4 + vec4[2] a1[3]; // size-3 array of size-2 array of vec4 + vec4[3][2] a2; // size-3 array of size-2 array of vec4 + vec4 b[2] = vec4[2](vec4(0.0), vec4(0.1)); + vec4[3][2] a3 = vec4[3][2](b, b, b); // constructor + void foo(vec4[3][2]); // prototype with unnamed parameter + vec4 a4[3][2] = {vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)) }; + } + { + float a[5]; + { + float b[] = a; // b is explicitly size 5 + } + { + float b[5] = a; // means the same thing + } + { + float b[] = float[](1,2,3,4,5); // also explicitly sizes to 5 + } + a.length(); // returns 5 + } + { + vec4 a[3][2]; + a.length(); // this is 3 + a[x].length(); // this is 2 + } + // for an array b containing a member array a: + b[++x].a.length(); // b is never dereferenced, but “++x” is evaluated + + // for an array s of a shader storage object containing a member array a: + s[x].a.length(); // s is dereferenced; x needs to be a valid index + // + //All of the following declarations result in a compile-time error. + //float a[2] = { 3.4, 4.2, 5.0 }; // illegal + //vec2 b = { 1.0, 2.0, 3.0 }; // illegal + //mat3x3 c = { vec3(0.0), vec3(1.0), vec3(2.0), vec3(3.0) }; // illegal + //mat2x2 d = { 1.0, 0.0, 0.0, 1.0 }; // illegal, can't flatten nesting + //struct { + // float a; + // int b; + //} e = { 1.2, 2, 3 }; // illegal + + struct { + float a; + int b; + } e = { 1.2, 2 }; // legal, all types match + + struct { + float a; + int b; + } e = { 1, 3 }; // legal, first initializer is converted + + //All of the following declarations result in a compile-time error. + //int a = true; // illegal + //vec4 b[2] = { vec4(0.0), 1.0 }; // illegal + //mat4x2 c = { vec3(0.0), vec3(1.0) }; // illegal + + //struct S1 { + // vec4 a; + // vec4 b; + //}; + + //struct { + // float s; + // float t; + //} d[] = { S1(vec4(0.0), vec4(1.1)) }; // illegal + + { + float a[] = float[](3.4, 4.2, 5.0, 5.2, 1.1); + float b[] = { 3.4, 4.2, 5.0, 5.2, 1.1 }; + float c[] = a; // c is explicitly size 5 + float d[5] = b; // means the same thing + } + { + const vec3 zAxis = vec3 (0.0, 0.0, 1.0); + const float ceiling = a + b; // a and b not necessarily constants + } + { + in vec4 position; + in vec3 normal; + in vec2 texCoord[4]; + } + { + lowp float color; + out mediump vec2 P; + lowp ivec2 foo(lowp mat3); + highp mat4 m; + } + +} diff --git a/core/deps/glslang/Test/specExamples.vert b/core/deps/glslang/Test/specExamples.vert index a700fc246..64ec7104b 100644 --- a/core/deps/glslang/Test/specExamples.vert +++ b/core/deps/glslang/Test/specExamples.vert @@ -1,196 +1,196 @@ -#version 430 - -#extension GL_3DL_array_objects : enable - -out Vertex { - vec4 Position; // API transform/feedback will use “Vertex.Position” - vec2 Texture; -} Coords; // shader will use “Coords.Position” - -out Vertex2 { - vec4 Color; // API will use “Color” -}; - -uniform Transform { // API uses “Transform[2]” to refer to instance 2 - mat4 ModelViewMatrix; - mat4 ModelViewProjectionMatrix; - vec4 a[]; // array will get implicitly sized - float Deformation; -} transforms[4]; - -layout(location = 3) in vec4 normal; -layout(location = 6) in vec4 colors[3]; -layout(location = 9) in mat4 transforms2[2]; - -layout(location = 3) struct S { - vec3 a1; - mat2 b; - vec4 c[2]; -} s; - -layout(triangles, invocations = 6) in; - -layout(lines) in; // legal for Color2, input size is 2, matching Color2 - -layout(triangle_strip, max_vertices = 60) out; // order does not matter -layout(max_vertices = 60) out; // redeclaration okay -layout(triangle_strip) out; // redeclaration okay -//layout(points) out; // error, contradicts triangle_strip -//layout(max_vertices = 30) out; // error, contradicts 60 - -layout(stream = 1) out; - -layout(stream=1) out; // default is now stream 1 -out vec4 var1; // var1 gets default stream (1) -layout(stream=2) out Block1 { // "Block1" belongs to stream 2 - layout(stream=2) vec4 var2; // redundant block member stream decl - layout(stream=3) vec2 var3; // ILLEGAL (must match block stream) - vec3 var4; // belongs to stream 2 -}; -layout(stream=0) out; // default is now stream 0 -out vec4 var5; // var5 gets default stream (0) -out Block2 { // "Block2" gets default stream (0) - vec4 var6; -}; -layout(stream=3) out vec4 var7; // var7 belongs to stream 3 - -layout(shared, column_major) uniform; -layout(shared, column_major) buffer; - -layout(row_major, column_major) - -layout(shared, row_major) uniform; // default is now shared and row_major - -layout(std140) uniform Transform2 { // layout of this block is std140 - mat4 M1; // row_major - layout(column_major) mat4 M2; // column major - mat3 N1; // row_major -}; - -layout(column_major) uniform T3 { // shared and column_major - mat4 M13; // column_major - layout(row_major) mat4 m14; // row major - mat3 N12; // column_major -}; - -// in one compilation unit... -layout(binding=3) uniform sampler2D s17; // s bound to unit 3 - -// in another compilation unit... -uniform sampler2D s17; // okay, s still bound at 3 - -// in another compilation unit... -//layout(binding=4) uniform sampler2D s; // ERROR: contradictory bindings - -layout (binding = 2, offset = 4) uniform atomic_uint a2; - -layout (binding = 2) uniform atomic_uint bar; - -layout (binding = 2, offset = 4) uniform atomic_uint; - -layout (binding = 2) uniform atomic_uint bar; // offset is 4 -layout (offset = 8) uniform atomic_uint bar23; // error, no default binding - -layout (binding=3, offset=4) uniform atomic_uint a2; // offset = 4 -layout (binding=2) uniform atomic_uint b2; // offset = 0 -layout (binding=3) uniform atomic_uint c2; // offset = 8 -layout (binding=2) uniform atomic_uint d2; // offset = 4 - -//layout (offset=4) // error, must include binding -//layout (binding=1, offset=0) a; // okay -//layout (binding=2, offset=0) b; // okay -//layout (binding=1, offset=0) c; // error, offsets must not be shared -// // between a and c -//layout (binding=1, offset=2) d; // error, overlaps offset 0 of a - -flat in vec4 gl_FrontColor; // input to geometry shader, no “gl_in[]” -flat out vec4 gl_FrontColor; // output from geometry shader - -invariant gl_Position; // make existing gl_Position be invariant - -out vec3 ColorInv; -invariant ColorIvn; // make existing Color be invariant - -invariant centroid out vec3 Color4; -precise out vec4 position; - -out vec3 Color5; -precise Color5; // make existing Color be precise -in vec4 a, b, c, d; -precise out vec4 v; - -coherent buffer Block { - readonly vec4 member1; - vec4 member2; -}; - -buffer Block2a { - coherent readonly vec4 member1A; - coherent vec4 member2A; -}; - -shared vec4 shv; - -vec4 funcA(restrict image2D a) { } - -vec4 funcB(image2D a) { } -layout(rgba32f) uniform image2D img1; -layout(rgba32f) coherent uniform image2D img2; - -float func(float e, float f, float g, float h) -{ - return (e*f) + (g*h); // no constraint on order or - // operator consistency -} - -float func2(float e, float f, float g, float h) -{ - precise float result = (e*f) + (g*h); // ensures same precision for - // the two multiplies - return result; -} - -float func3(float i, float j, precise out float k) -{ - k = i * i + j; // precise, due to declaration -} - -void main() -{ - vec3 r = vec3(a * b); // precise, used to compute v.xyz - vec3 s = vec3(c * d); // precise, used to compute v.xyz - v.xyz = r + s; // precise - v.w = (a.w * b.w) + (c.w * d.w); // precise - v.x = func(a.x, b.x, c.x, d.x); // values computed in func() - // are NOT precise - v.x = func2(a.x, b.x, c.x, d.x); // precise! - func3(a.x * b.x, c.x * d.x, v.x); // precise! - - funcA(img1); // OK, adding "restrict" is allowed, ERROR, changing formats - funcB(img2); // illegal, stripping "coherent" is not, ERROR, changing formats - - { - struct light { - float intensity; - vec3 position; - }; - - light lightVar = light(3.0, vec3(1.0, 2.0, 3.0)); - } - { - const float c[3] = float[3](5.0, 7.2, 1.1); - const float d[3] = float[](5.0, 7.2, 1.1); - - float g; - float a[5] = float[5](g, 1, g, 2.3, g); - float b[3]; - - b = float[3](g, g + 1.0, g + 2.0); - } - { - vec4 b[2] = { vec4(1.0), vec4(1.0) }; - vec4[3][2](b, b, b); // constructor - vec4[][2](b, b, b); // constructor, valid, size deduced - vec4[3][](b, b, b); // compile-time error, invalid type constructed - } -} +#version 430 + +#extension GL_3DL_array_objects : enable + +out Vertex { + vec4 Position; // API transform/feedback will use “Vertex.Position” + vec2 Texture; +} Coords; // shader will use “Coords.Position” + +out Vertex2 { + vec4 Color; // API will use “Color” +}; + +uniform Transform { // API uses “Transform[2]” to refer to instance 2 + mat4 ModelViewMatrix; + mat4 ModelViewProjectionMatrix; + vec4 a[]; // array will get implicitly sized + float Deformation; +} transforms[4]; + +layout(location = 3) in vec4 normal; +layout(location = 6) in vec4 colors[3]; +layout(location = 9) in mat4 transforms2[2]; + +layout(location = 3) struct S { + vec3 a1; + mat2 b; + vec4 c[2]; +} s; + +layout(triangles, invocations = 6) in; + +layout(lines) in; // legal for Color2, input size is 2, matching Color2 + +layout(triangle_strip, max_vertices = 60) out; // order does not matter +layout(max_vertices = 60) out; // redeclaration okay +layout(triangle_strip) out; // redeclaration okay +//layout(points) out; // error, contradicts triangle_strip +//layout(max_vertices = 30) out; // error, contradicts 60 + +layout(stream = 1) out; + +layout(stream=1) out; // default is now stream 1 +out vec4 var1; // var1 gets default stream (1) +layout(stream=2) out Block1 { // "Block1" belongs to stream 2 + layout(stream=2) vec4 var2; // redundant block member stream decl + layout(stream=3) vec2 var3; // ILLEGAL (must match block stream) + vec3 var4; // belongs to stream 2 +}; +layout(stream=0) out; // default is now stream 0 +out vec4 var5; // var5 gets default stream (0) +out Block2 { // "Block2" gets default stream (0) + vec4 var6; +}; +layout(stream=3) out vec4 var7; // var7 belongs to stream 3 + +layout(shared, column_major) uniform; +layout(shared, column_major) buffer; + +layout(row_major, column_major) + +layout(shared, row_major) uniform; // default is now shared and row_major + +layout(std140) uniform Transform2 { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M13; // column_major + layout(row_major) mat4 m14; // row major + mat3 N12; // column_major +}; + +// in one compilation unit... +layout(binding=3) uniform sampler2D s17; // s bound to unit 3 + +// in another compilation unit... +uniform sampler2D s17; // okay, s still bound at 3 + +// in another compilation unit... +//layout(binding=4) uniform sampler2D s; // ERROR: contradictory bindings + +layout (binding = 2, offset = 4) uniform atomic_uint a2; + +layout (binding = 2) uniform atomic_uint bar; + +layout (binding = 2, offset = 4) uniform atomic_uint; + +layout (binding = 2) uniform atomic_uint bar; // offset is 4 +layout (offset = 8) uniform atomic_uint bar23; // error, no default binding + +layout (binding=3, offset=4) uniform atomic_uint a2; // offset = 4 +layout (binding=2) uniform atomic_uint b2; // offset = 0 +layout (binding=3) uniform atomic_uint c2; // offset = 8 +layout (binding=2) uniform atomic_uint d2; // offset = 4 + +//layout (offset=4) // error, must include binding +//layout (binding=1, offset=0) a; // okay +//layout (binding=2, offset=0) b; // okay +//layout (binding=1, offset=0) c; // error, offsets must not be shared +// // between a and c +//layout (binding=1, offset=2) d; // error, overlaps offset 0 of a + +flat in vec4 gl_FrontColor; // input to geometry shader, no “gl_in[]” +flat out vec4 gl_FrontColor; // output from geometry shader + +invariant gl_Position; // make existing gl_Position be invariant + +out vec3 ColorInv; +invariant ColorIvn; // make existing Color be invariant + +invariant centroid out vec3 Color4; +precise out vec4 position; + +out vec3 Color5; +precise Color5; // make existing Color be precise +in vec4 a, b, c, d; +precise out vec4 v; + +coherent buffer Block { + readonly vec4 member1; + vec4 member2; +}; + +buffer Block2a { + coherent readonly vec4 member1A; + coherent vec4 member2A; +}; + +shared vec4 shv; + +vec4 funcA(restrict image2D a) { } + +vec4 funcB(image2D a) { } +layout(rgba32f) uniform image2D img1; +layout(rgba32f) coherent uniform image2D img2; + +float func(float e, float f, float g, float h) +{ + return (e*f) + (g*h); // no constraint on order or + // operator consistency +} + +float func2(float e, float f, float g, float h) +{ + precise float result = (e*f) + (g*h); // ensures same precision for + // the two multiplies + return result; +} + +float func3(float i, float j, precise out float k) +{ + k = i * i + j; // precise, due to declaration +} + +void main() +{ + vec3 r = vec3(a * b); // precise, used to compute v.xyz + vec3 s = vec3(c * d); // precise, used to compute v.xyz + v.xyz = r + s; // precise + v.w = (a.w * b.w) + (c.w * d.w); // precise + v.x = func(a.x, b.x, c.x, d.x); // values computed in func() + // are NOT precise + v.x = func2(a.x, b.x, c.x, d.x); // precise! + func3(a.x * b.x, c.x * d.x, v.x); // precise! + + funcA(img1); // OK, adding "restrict" is allowed, ERROR, changing formats + funcB(img2); // illegal, stripping "coherent" is not, ERROR, changing formats + + { + struct light { + float intensity; + vec3 position; + }; + + light lightVar = light(3.0, vec3(1.0, 2.0, 3.0)); + } + { + const float c[3] = float[3](5.0, 7.2, 1.1); + const float d[3] = float[](5.0, 7.2, 1.1); + + float g; + float a[5] = float[5](g, 1, g, 2.3, g); + float b[3]; + + b = float[3](g, g + 1.0, g + 2.0); + } + { + vec4 b[2] = { vec4(1.0), vec4(1.0) }; + vec4[3][2](b, b, b); // constructor + vec4[][2](b, b, b); // constructor, valid, size deduced + vec4[3][](b, b, b); // compile-time error, invalid type constructed + } +} diff --git a/core/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert b/core/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert index 671b8ae60..61ba7bf15 100644 --- a/core/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert +++ b/core/deps/glslang/Test/spv.1.3.8bitstorage-ssbo.vert @@ -1,15 +1,15 @@ -#version 450 - -#extension GL_EXT_shader_8bit_storage: require - -layout(binding = 0) readonly buffer Vertices -{ - uint8_t vertices[]; -}; - -layout(location = 0) out vec4 color; - -void main() -{ - color = vec4(int(vertices[gl_VertexIndex])); -} +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly buffer Vertices +{ + uint8_t vertices[]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/core/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert b/core/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert index 9e4c4c65f..5c49a2434 100644 --- a/core/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert +++ b/core/deps/glslang/Test/spv.1.3.8bitstorage-ubo.vert @@ -1,15 +1,15 @@ -#version 450 - -#extension GL_EXT_shader_8bit_storage: require - -layout(binding = 0) readonly uniform Vertices -{ - uint8_t vertices[512]; -}; - -layout(location = 0) out vec4 color; - -void main() -{ - color = vec4(int(vertices[gl_VertexIndex])); -} +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly uniform Vertices +{ + uint8_t vertices[512]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/core/deps/glslang/Test/spv.1.3.coopmat.comp b/core/deps/glslang/Test/spv.1.3.coopmat.comp index 23e8e8f5f..23e0b7816 100644 --- a/core/deps/glslang/Test/spv.1.3.coopmat.comp +++ b/core/deps/glslang/Test/spv.1.3.coopmat.comp @@ -1,28 +1,28 @@ #version 450 core -#extension GL_KHR_memory_scope_semantics : enable -#extension GL_NV_cooperative_matrix : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable - -#pragma use_variable_pointers - +#extension GL_KHR_memory_scope_semantics : enable +#extension GL_NV_cooperative_matrix : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable + +#pragma use_variable_pointers + layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; - -layout(set = 0, binding = 0) coherent buffer Block { - float y[1024*1024]; - float x[]; -} block; - - + +layout(set = 0, binding = 0) coherent buffer Block { + float y[1024*1024]; + float x[]; +} block; + + void main() { - fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> m = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(0.0); - - m = m + m; - m = m - m; - m = -m; - m = 2.0*m; - m = m*2.0; - - coopMatLoadNV(m, block.x, 16, 128, false); - coopMatStoreNV(m, block.x, 16, 128, false); + fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> m = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(0.0); + + m = m + m; + m = m - m; + m = -m; + m = 2.0*m; + m = m*2.0; + + coopMatLoadNV(m, block.x, 16, 128, false); + coopMatStoreNV(m, block.x, 16, 128, false); } diff --git a/core/deps/glslang/Test/spv.1.4.OpCopyLogical.comp b/core/deps/glslang/Test/spv.1.4.OpCopyLogical.comp index 5ced24709..fe95da754 100644 --- a/core/deps/glslang/Test/spv.1.4.OpCopyLogical.comp +++ b/core/deps/glslang/Test/spv.1.4.OpCopyLogical.comp @@ -1,48 +1,48 @@ -#version 450 core - -struct MyStruct -{ - vec2 foo[2]; - int sb; -}; - -layout(binding = 0, std430) buffer SSBO0 -{ - MyStruct a; -} inBuf; - -layout(binding = 1, std430) buffer SSBO1 -{ - MyStruct b; -} outBuf; - -layout(binding = 2, std140) uniform UBO -{ - MyStruct c; -} uBuf; - -struct Nested { - float f; - MyStruct S[2]; -}; - -layout(binding = 2, std140) uniform UBON -{ - Nested N1; -} uBufN; - -layout(binding = 1, std430) buffer SSBO1N -{ - Nested N2; -} outBufN; - -void main() -{ - MyStruct t = inBuf.a; - outBuf.b = t; - t = uBuf.c; - outBuf.b = t; - - Nested n = uBufN.N1; - outBufN.N2 = n; -} +#version 450 core + +struct MyStruct +{ + vec2 foo[2]; + int sb; +}; + +layout(binding = 0, std430) buffer SSBO0 +{ + MyStruct a; +} inBuf; + +layout(binding = 1, std430) buffer SSBO1 +{ + MyStruct b; +} outBuf; + +layout(binding = 2, std140) uniform UBO +{ + MyStruct c; +} uBuf; + +struct Nested { + float f; + MyStruct S[2]; +}; + +layout(binding = 2, std140) uniform UBON +{ + Nested N1; +} uBufN; + +layout(binding = 1, std430) buffer SSBO1N +{ + Nested N2; +} outBufN; + +void main() +{ + MyStruct t = inBuf.a; + outBuf.b = t; + t = uBuf.c; + outBuf.b = t; + + Nested n = uBufN.N1; + outBufN.N2 = n; +} diff --git a/core/deps/glslang/Test/spv.1.4.OpCopyLogical.funcall.frag b/core/deps/glslang/Test/spv.1.4.OpCopyLogical.funcall.frag index 6176c4deb..7f9968dcf 100644 --- a/core/deps/glslang/Test/spv.1.4.OpCopyLogical.funcall.frag +++ b/core/deps/glslang/Test/spv.1.4.OpCopyLogical.funcall.frag @@ -1,21 +1,21 @@ -#version 450 - -struct S { mat4 m; }; -buffer blockName { S s1; }; // need an S with decoration -S s2; // no decorations on S - -void fooConst(const in S s) { } -void foo(in S s) { } -void fooOut(inout S s) { } - -void main() -{ - fooConst(s1); - fooConst(s2); - - foo(s1); - foo(s2); - - fooOut(s1); - fooOut(s2); +#version 450 + +struct S { mat4 m; }; +buffer blockName { S s1; }; // need an S with decoration +S s2; // no decorations on S + +void fooConst(const in S s) { } +void foo(in S s) { } +void fooOut(inout S s) { } + +void main() +{ + fooConst(s1); + fooConst(s2); + + foo(s1); + foo(s2); + + fooOut(s1); + fooOut(s2); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.1.4.OpCopyLogicalBool.comp b/core/deps/glslang/Test/spv.1.4.OpCopyLogicalBool.comp index 07dfe042e..303bdb8a3 100644 --- a/core/deps/glslang/Test/spv.1.4.OpCopyLogicalBool.comp +++ b/core/deps/glslang/Test/spv.1.4.OpCopyLogicalBool.comp @@ -1,48 +1,48 @@ -#version 450 core - -struct MyStruct -{ - vec2 foo[2]; - bool sb; -}; - -layout(binding = 0, std430) buffer SSBO0 -{ - MyStruct a; -} inBuf; - -layout(binding = 1, std430) buffer SSBO1 -{ - MyStruct b; -} outBuf; - -layout(binding = 2, std140) uniform UBO -{ - MyStruct c; -} uBuf; - -struct Nested { - bool b; - MyStruct S[2]; -}; - -layout(binding = 2, std140) uniform UBON -{ - Nested N1; -} uBufN; - -layout(binding = 1, std430) buffer SSBO1N -{ - Nested N2; -} outBufN; - -void main() -{ - MyStruct t = inBuf.a; - outBuf.b = t; - t = uBuf.c; - outBuf.b = t; - - Nested n = uBufN.N1; - outBufN.N2 = n; -} +#version 450 core + +struct MyStruct +{ + vec2 foo[2]; + bool sb; +}; + +layout(binding = 0, std430) buffer SSBO0 +{ + MyStruct a; +} inBuf; + +layout(binding = 1, std430) buffer SSBO1 +{ + MyStruct b; +} outBuf; + +layout(binding = 2, std140) uniform UBO +{ + MyStruct c; +} uBuf; + +struct Nested { + bool b; + MyStruct S[2]; +}; + +layout(binding = 2, std140) uniform UBON +{ + Nested N1; +} uBufN; + +layout(binding = 1, std430) buffer SSBO1N +{ + Nested N2; +} outBufN; + +void main() +{ + MyStruct t = inBuf.a; + outBuf.b = t; + t = uBuf.c; + outBuf.b = t; + + Nested n = uBufN.N1; + outBufN.N2 = n; +} diff --git a/core/deps/glslang/Test/spv.1.4.constructComposite.comp b/core/deps/glslang/Test/spv.1.4.constructComposite.comp index 5f79a197c..7f1c37076 100644 --- a/core/deps/glslang/Test/spv.1.4.constructComposite.comp +++ b/core/deps/glslang/Test/spv.1.4.constructComposite.comp @@ -1,25 +1,25 @@ -#version 460 core - -layout(local_size_x=64) in; - -struct sA { - int x, y; -}; - -struct sB { - sA a; -}; - -layout(binding=0,set=0) uniform ubo { - sB b; -}; - -struct sC { - sA state; -} c = { - b.a, -}; - -void main() -{ -} +#version 460 core + +layout(local_size_x=64) in; + +struct sA { + int x, y; +}; + +struct sB { + sA a; +}; + +layout(binding=0,set=0) uniform ubo { + sB b; +}; + +struct sC { + sA state; +} c = { + b.a, +}; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.1.4.image.frag b/core/deps/glslang/Test/spv.1.4.image.frag index e3973a2ea..a835e3c9d 100644 --- a/core/deps/glslang/Test/spv.1.4.image.frag +++ b/core/deps/glslang/Test/spv.1.4.image.frag @@ -1,38 +1,38 @@ -#version 450 - -layout(rgba32f, binding = 1) uniform image2D i2D; -layout(r32i, binding = 12) uniform iimage2D ii2D; -layout(r32ui, binding = 12) uniform uimage2D ui2D; - -layout(rgba32f, binding = 9) uniform image2DMS i2DMS; -layout(r32i, binding = 13) uniform iimage2DMS ii2DMS; -layout(r32ui, binding = 13) uniform uimage2DMS ui2DMS; - -flat in ivec2 ic2D; -flat in uint value; - -out vec4 fragData; - -void main() -{ - vec4 v = vec4(0.0); - ivec4 iv = ivec4(0.0); - uvec4 uv = uvec4(0.0); - - v += imageLoad(i2D, ic2D); - imageStore(i2D, ic2D, v); - v += imageLoad(ii2D, ic2D); - imageStore(ii2D, ic2D, iv); - v += imageLoad(ui2D, ic2D); - imageStore(ui2D, ic2D, uv); - - v += imageLoad(i2DMS, ic2D, 1); - imageStore(i2DMS, ic2D, 2, v); - v += imageLoad(ii2DMS, ic2D, 1); - imageStore(ii2DMS, ic2D, 2, iv); - v += imageLoad(ui2DMS, ic2D, 1); - imageStore(ui2DMS, ic2D, 2, uv); - - fragData = v; -} - +#version 450 + +layout(rgba32f, binding = 1) uniform image2D i2D; +layout(r32i, binding = 12) uniform iimage2D ii2D; +layout(r32ui, binding = 12) uniform uimage2D ui2D; + +layout(rgba32f, binding = 9) uniform image2DMS i2DMS; +layout(r32i, binding = 13) uniform iimage2DMS ii2DMS; +layout(r32ui, binding = 13) uniform uimage2DMS ui2DMS; + +flat in ivec2 ic2D; +flat in uint value; + +out vec4 fragData; + +void main() +{ + vec4 v = vec4(0.0); + ivec4 iv = ivec4(0.0); + uvec4 uv = uvec4(0.0); + + v += imageLoad(i2D, ic2D); + imageStore(i2D, ic2D, v); + v += imageLoad(ii2D, ic2D); + imageStore(ii2D, ic2D, iv); + v += imageLoad(ui2D, ic2D); + imageStore(ui2D, ic2D, uv); + + v += imageLoad(i2DMS, ic2D, 1); + imageStore(i2DMS, ic2D, 2, v); + v += imageLoad(ii2DMS, ic2D, 1); + imageStore(ii2DMS, ic2D, 2, iv); + v += imageLoad(ui2DMS, ic2D, 1); + imageStore(ui2DMS, ic2D, 2, uv); + + fragData = v; +} + diff --git a/core/deps/glslang/Test/spv.1.4.sparseTexture.frag b/core/deps/glslang/Test/spv.1.4.sparseTexture.frag index 8e44f0254..fcddbeb0a 100644 --- a/core/deps/glslang/Test/spv.1.4.sparseTexture.frag +++ b/core/deps/glslang/Test/spv.1.4.sparseTexture.frag @@ -1,47 +1,47 @@ -#version 450 -#extension GL_ARB_sparse_texture2: enable - -uniform sampler2D s2D; -uniform isampler2D is2D; -uniform usampler2D us2D; - -layout(rgba32f) uniform image2D i2D; -layout(rgba32i) uniform iimage2DMS ii2DMS; -layout(rgba32ui) uniform uimage3D ui3D; - -in vec2 c2; -in vec3 c3; -in vec4 c4; - -in flat ivec2 ic2; -in flat ivec3 ic3; - -in flat ivec2 offsets[4]; - -out vec4 outColor; - -void main() -{ - int resident = 0; - vec4 texel = vec4(0.0); - ivec4 itexel = ivec4(0); - uvec4 utexel = uvec4(0); - - resident |= sparseTextureARB(s2D, c2, texel); - resident |= sparseTextureARB(is2D, c2, texel); - resident |= sparseTextureARB(us2D, c2, texel); - - resident |= sparseTextureLodARB( s2D, c2, 2.0, texel); - resident |= sparseTextureLodARB(is2D, c2, 2.0, texel); - resident |= sparseTextureLodARB(us2D, c2, 2.0, texel); - - resident |= sparseTexelFetchARB( s2D, ivec2(c2), 2, texel); - resident |= sparseTexelFetchARB(is2D, ivec2(c2), 2, texel); - resident |= sparseTexelFetchARB(us2D, ivec2(c2), 2, texel); - - resident |= sparseImageLoadARB(i2D, ic2, texel); - resident |= sparseImageLoadARB(ii2DMS, ic2, 3, texel); - resident |= sparseImageLoadARB(ui3D, ic3, utexel); - - outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +#version 450 +#extension GL_ARB_sparse_texture2: enable + +uniform sampler2D s2D; +uniform isampler2D is2D; +uniform usampler2D us2D; + +layout(rgba32f) uniform image2D i2D; +layout(rgba32i) uniform iimage2DMS ii2DMS; +layout(rgba32ui) uniform uimage3D ui3D; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in flat ivec2 ic2; +in flat ivec3 ic3; + +in flat ivec2 offsets[4]; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureARB(s2D, c2, texel); + resident |= sparseTextureARB(is2D, c2, texel); + resident |= sparseTextureARB(us2D, c2, texel); + + resident |= sparseTextureLodARB( s2D, c2, 2.0, texel); + resident |= sparseTextureLodARB(is2D, c2, 2.0, texel); + resident |= sparseTextureLodARB(us2D, c2, 2.0, texel); + + resident |= sparseTexelFetchARB( s2D, ivec2(c2), 2, texel); + resident |= sparseTexelFetchARB(is2D, ivec2(c2), 2, texel); + resident |= sparseTexelFetchARB(us2D, ivec2(c2), 2, texel); + + resident |= sparseImageLoadARB(i2D, ic2, texel); + resident |= sparseImageLoadARB(ii2DMS, ic2, 3, texel); + resident |= sparseImageLoadARB(ui3D, ic3, utexel); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.1.4.texture.frag b/core/deps/glslang/Test/spv.1.4.texture.frag index 211dfbca1..cd98dd5f1 100644 --- a/core/deps/glslang/Test/spv.1.4.texture.frag +++ b/core/deps/glslang/Test/spv.1.4.texture.frag @@ -1,26 +1,26 @@ -#version 450 - -uniform sampler2D texSampler2D; -uniform isampler2D itexSampler2D; -uniform usampler2D utexSampler2D; - -in vec2 t; -in vec2 coords2D; -flat in ivec2 iCoords2D; - -out vec4 color; - -flat in int iLod; - -void main() -{ - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - - color += texture( texSampler2D, coords2D); - color += texture(itexSampler2D, coords2D); - color += texture(utexSampler2D, coords2D); - - color += texelFetch( texSampler2D, iCoords2D, iLod); - color += texelFetch(itexSampler2D, iCoords2D, iLod); - color += texelFetch(utexSampler2D, iCoords2D, iLod); +#version 450 + +uniform sampler2D texSampler2D; +uniform isampler2D itexSampler2D; +uniform usampler2D utexSampler2D; + +in vec2 t; +in vec2 coords2D; +flat in ivec2 iCoords2D; + +out vec4 color; + +flat in int iLod; + +void main() +{ + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += texture( texSampler2D, coords2D); + color += texture(itexSampler2D, coords2D); + color += texture(utexSampler2D, coords2D); + + color += texelFetch( texSampler2D, iCoords2D, iLod); + color += texelFetch(itexSampler2D, iCoords2D, iLod); + color += texelFetch(utexSampler2D, iCoords2D, iLod); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.100ops.frag b/core/deps/glslang/Test/spv.100ops.frag index 126578666..43452a1f1 100644 --- a/core/deps/glslang/Test/spv.100ops.frag +++ b/core/deps/glslang/Test/spv.100ops.frag @@ -1,27 +1,27 @@ -#version 310 es - -lowp float foo(); - -in lowp float low, high; - -lowp float face1 = 11.0; - -out lowp vec4 Color; - -void main() -{ - int z = 3; - - if (2.0 * low + 1.0 < high) - ++z; - - Color = face1 * vec4(z) + foo(); -} - -lowp float face2 = -2.0; - -lowp float foo() -{ - // testing if face2 initializer insert logic is correct in main - return face2; -} +#version 310 es + +lowp float foo(); + +in lowp float low, high; + +lowp float face1 = 11.0; + +out lowp vec4 Color; + +void main() +{ + int z = 3; + + if (2.0 * low + 1.0 < high) + ++z; + + Color = face1 * vec4(z) + foo(); +} + +lowp float face2 = -2.0; + +lowp float foo() +{ + // testing if face2 initializer insert logic is correct in main + return face2; +} diff --git a/core/deps/glslang/Test/spv.130.frag b/core/deps/glslang/Test/spv.130.frag index 55a165912..e7fdd3889 100644 --- a/core/deps/glslang/Test/spv.130.frag +++ b/core/deps/glslang/Test/spv.130.frag @@ -1,93 +1,93 @@ -#version 140 -#extension GL_ARB_texture_gather : enable - -vec3 a; -float b; - -in vec4 i; -out vec4 o; -out ivec3 io; -out uvec4 uo; - -flat in float fflat; -smooth in float fsmooth; -noperspective in float fnop; - -uniform samplerCube sampC; - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2D samp2D; -uniform sampler2DShadow samp2DS; -uniform sampler2DRect samp2DR; -uniform sampler2DArray samp2DA; - -void bar3() -{ - o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); - o += textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); -} - -#extension GL_ARB_gpu_shader5 : enable - -void bar4() -{ - o += textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); - o += textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); - o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); -} - -#extension GL_ARB_texture_cube_map_array : enable - -uniform samplerCubeArray Sca; -uniform isamplerCubeArray Isca; -uniform usamplerCubeArray Usca; -uniform samplerCubeArrayShadow Scas; - -void bar5() -{ - io = textureSize(Sca, 3); - o += texture(Sca, i); - io += texture(Isca, i, 0.7).xyz; - uo = texture(Usca, i); - - o += textureLod(Sca, i, 1.7); - a = textureSize(Scas, 3); - float f = texture(Scas, i, i.y); - ivec4 c = textureGrad(Isca, i, vec3(0.1), vec3(0.2)); - o += vec4(a, f + c); -} - -#extension GL_ARB_shading_language_420pack : enable - -const int ai[3] = { 10, 23, 32 }; -uniform layout(binding=0) sampler2D bounds; - -void bar6() -{ - mat4x3 m43; - float a1 = m43[3].y; - //int a2 = m43.length(); // ERROR until shading_language_420pack is fully implemented - const float b = 2 * a1; - //a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; // ERROR until shading_language_420pack is fully implemented -} - - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_shader_texture_lod : require - -uniform sampler2D s2D; -uniform sampler2DRect s2DR; -uniform sampler2DRectShadow s2DRS; -uniform sampler1D s1D; -uniform sampler2DShadow s2DS; - -void main() -{ - o = textureGather(sampC, vec3(0.2)); - o.y = gl_ClipDistance[3]; - bar3(); - bar4(); - bar5(); - bar6(); +#version 140 +#extension GL_ARB_texture_gather : enable + +vec3 a; +float b; + +in vec4 i; +out vec4 o; +out ivec3 io; +out uvec4 uo; + +flat in float fflat; +smooth in float fsmooth; +noperspective in float fnop; + +uniform samplerCube sampC; + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2D samp2D; +uniform sampler2DShadow samp2DS; +uniform sampler2DRect samp2DR; +uniform sampler2DArray samp2DA; + +void bar3() +{ + o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1)); + o += textureGatherOffset(samp2DA, vec3(0.3), ivec2(1)); +} + +#extension GL_ARB_gpu_shader5 : enable + +void bar4() +{ + o += textureGatherOffset(samp2DR, vec2(0.3), ivec2(1)); + o += textureGatherOffset(samp2DS, vec2(0.3), 1.3, ivec2(1)); + o += textureGatherOffset(samp2D, vec2(0.3), ivec2(1), 2); +} + +#extension GL_ARB_texture_cube_map_array : enable + +uniform samplerCubeArray Sca; +uniform isamplerCubeArray Isca; +uniform usamplerCubeArray Usca; +uniform samplerCubeArrayShadow Scas; + +void bar5() +{ + io = textureSize(Sca, 3); + o += texture(Sca, i); + io += texture(Isca, i, 0.7).xyz; + uo = texture(Usca, i); + + o += textureLod(Sca, i, 1.7); + a = textureSize(Scas, 3); + float f = texture(Scas, i, i.y); + ivec4 c = textureGrad(Isca, i, vec3(0.1), vec3(0.2)); + o += vec4(a, f + c); +} + +#extension GL_ARB_shading_language_420pack : enable + +const int ai[3] = { 10, 23, 32 }; +uniform layout(binding=0) sampler2D bounds; + +void bar6() +{ + mat4x3 m43; + float a1 = m43[3].y; + //int a2 = m43.length(); // ERROR until shading_language_420pack is fully implemented + const float b = 2 * a1; + //a.x = gl_MinProgramTexelOffset + gl_MaxProgramTexelOffset; // ERROR until shading_language_420pack is fully implemented +} + + +#extension GL_ARB_texture_rectangle : enable +#extension GL_ARB_shader_texture_lod : require + +uniform sampler2D s2D; +uniform sampler2DRect s2DR; +uniform sampler2DRectShadow s2DRS; +uniform sampler1D s1D; +uniform sampler2DShadow s2DS; + +void main() +{ + o = textureGather(sampC, vec3(0.2)); + o.y = gl_ClipDistance[3]; + bar3(); + bar4(); + bar5(); + bar6(); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.140.frag b/core/deps/glslang/Test/spv.140.frag index dc1618e75..ceeac47bf 100644 --- a/core/deps/glslang/Test/spv.140.frag +++ b/core/deps/glslang/Test/spv.140.frag @@ -1,46 +1,46 @@ -#version 140 - -in vec4 k; -out vec4 o; - -in float gl_ClipDistance[5]; - -layout(row_major) uniform; - -uniform sampler2D samp2Da[3]; - -layout(std140) uniform bn { - layout(row_major) mat4 matra[4]; - layout(column_major) mat4 matca[4]; - layout(row_major) mat4 matr; - layout(column_major) mat4 matc; - layout(align=512, offset=1024) mat4 matrdef; -}; - -uniform sampler2DRect sampR; -uniform isamplerBuffer sampB; - -float foo(); - -void main() -{ - o.y = gl_ClipDistance[2]; - o.z = gl_ClipDistance[int(k)]; - o.w = float(textureSize(sampR) + textureSize(sampB)) / 100.0; - o.z = foo(); -} - -// Test extra-function initializers - -float i1 = gl_FrontFacing ? -2.0 : 2.0; -float i2 = 102; - -float foo() -{ - return i1 + i2; -} - -// test arrayed block -layout(std140) uniform bi { - vec3 v[2]; -} bname[4]; +#version 140 + +in vec4 k; +out vec4 o; + +in float gl_ClipDistance[5]; + +layout(row_major) uniform; + +uniform sampler2D samp2Da[3]; + +layout(std140) uniform bn { + layout(row_major) mat4 matra[4]; + layout(column_major) mat4 matca[4]; + layout(row_major) mat4 matr; + layout(column_major) mat4 matc; + layout(align=512, offset=1024) mat4 matrdef; +}; + +uniform sampler2DRect sampR; +uniform isamplerBuffer sampB; + +float foo(); + +void main() +{ + o.y = gl_ClipDistance[2]; + o.z = gl_ClipDistance[int(k)]; + o.w = float(textureSize(sampR) + textureSize(sampB)) / 100.0; + o.z = foo(); +} + +// Test extra-function initializers + +float i1 = gl_FrontFacing ? -2.0 : 2.0; +float i2 = 102; + +float foo() +{ + return i1 + i2; +} + +// test arrayed block +layout(std140) uniform bi { + vec3 v[2]; +} bname[4]; diff --git a/core/deps/glslang/Test/spv.150.geom b/core/deps/glslang/Test/spv.150.geom index 0c0dfba63..0419265dc 100644 --- a/core/deps/glslang/Test/spv.150.geom +++ b/core/deps/glslang/Test/spv.150.geom @@ -1,39 +1,39 @@ -#version 150 core - -layout(triangles_adjacency) in; -layout(max_vertices = 30) out; -layout(stream = 3, triangle_strip) out; - -in fromVertex { - in vec3 color; -} fromV[]; - -out toFragment { - out vec3 color; -} toF; - -out fromVertex { - vec3 color; -}; - -void main() -{ - color = fromV[0].color; - //?? gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; - gl_Position = gl_in[0].gl_Position; - gl_PointSize = gl_in[3].gl_PointSize; - gl_PrimitiveID = gl_PrimitiveIDIn; - gl_Layer = 2; - - EmitVertex(); - - color = 2 * fromV[0].color; - gl_Position = 2.0 * gl_in[0].gl_Position; - gl_PointSize = 2.0 * gl_in[3].gl_PointSize; - gl_PrimitiveID = gl_PrimitiveIDIn + 1; - gl_Layer = 3; - - EmitVertex(); - - EndPrimitive(); -} +#version 150 core + +layout(triangles_adjacency) in; +layout(max_vertices = 30) out; +layout(stream = 3, triangle_strip) out; + +in fromVertex { + in vec3 color; +} fromV[]; + +out toFragment { + out vec3 color; +} toF; + +out fromVertex { + vec3 color; +}; + +void main() +{ + color = fromV[0].color; + //?? gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; + gl_Position = gl_in[0].gl_Position; + gl_PointSize = gl_in[3].gl_PointSize; + gl_PrimitiveID = gl_PrimitiveIDIn; + gl_Layer = 2; + + EmitVertex(); + + color = 2 * fromV[0].color; + gl_Position = 2.0 * gl_in[0].gl_Position; + gl_PointSize = 2.0 * gl_in[3].gl_PointSize; + gl_PrimitiveID = gl_PrimitiveIDIn + 1; + gl_Layer = 3; + + EmitVertex(); + + EndPrimitive(); +} diff --git a/core/deps/glslang/Test/spv.150.vert b/core/deps/glslang/Test/spv.150.vert index c5b6fd246..382e3c9bf 100644 --- a/core/deps/glslang/Test/spv.150.vert +++ b/core/deps/glslang/Test/spv.150.vert @@ -1,38 +1,38 @@ -#version 150 core - -in vec4 iv4; - -in float ps; -in int ui; -uniform sampler2D s2D; - -invariant gl_Position; - -struct s1 { - int a; - int a2; - vec4 b[3]; -}; - -struct s2 { - int c; - s1 d[4]; -}; - -out s2 s2out; - -void main() -{ - gl_Position = iv4; - gl_PointSize = ps; - gl_ClipDistance[2] = iv4.x; - int i; - s2out.d[i].b[2].w = ps; - - // test non-implicit lod - texture(s2D, vec2(0.5)); - textureProj(s2D, vec3(0.5)); - textureLod(s2D, vec2(0.5), 3.2); -} - -out float gl_ClipDistance[4]; +#version 150 core + +in vec4 iv4; + +in float ps; +in int ui; +uniform sampler2D s2D; + +invariant gl_Position; + +struct s1 { + int a; + int a2; + vec4 b[3]; +}; + +struct s2 { + int c; + s1 d[4]; +}; + +out s2 s2out; + +void main() +{ + gl_Position = iv4; + gl_PointSize = ps; + gl_ClipDistance[2] = iv4.x; + int i; + s2out.d[i].b[2].w = ps; + + // test non-implicit lod + texture(s2D, vec2(0.5)); + textureProj(s2D, vec3(0.5)); + textureLod(s2D, vec2(0.5), 3.2); +} + +out float gl_ClipDistance[4]; diff --git a/core/deps/glslang/Test/spv.16bitstorage-int.frag b/core/deps/glslang/Test/spv.16bitstorage-int.frag index 608477f18..57be67ee9 100644 --- a/core/deps/glslang/Test/spv.16bitstorage-int.frag +++ b/core/deps/glslang/Test/spv.16bitstorage-int.frag @@ -1,90 +1,90 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : enable - -struct S -{ - int16_t x; - i16vec2 y; - i16vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - int16_t a; - i16vec2 b; - i16vec3 c; - int16_t d[2]; - S g; - S h[2]; - int j; -} b1; - -layout(row_major, std430) buffer B2 -{ - int16_t o; - i16vec2 p; - i16vec3 q; - int16_t r[2]; - S u; - S v[2]; - i16vec2 x[100]; - int16_t w[]; -} b2; - -layout(row_major, std140) uniform B5 -{ - int16_t o; - i16vec2 p; - i16vec3 q; - int16_t r[2]; - S u; - S v[2]; - i16vec2 x[100]; - int16_t w[100]; -} b5; - -struct S2 { - mat4x4 x; - int16_t y; - int z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; - S3 y; -} b4; - -void main() -{ - b2.o = b1.a; - b2.p = i16vec2(ivec3(b2.q).xy); - b2.p = i16vec2(ivec3(b5.q).xy); - b2.r[0] = b2.r[0]; - b2.r[1] = b5.r[1]; - b2.p = b2.p; - int x0 = int(b1.a); - ivec4 x1 = ivec4(b1.a, b2.p, 1); - b4.x.x = b3.x.x; - b2.o = int16_t(ivec2(b2.p).x); - b2.p = b2.v[1].y; - ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); - ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); - b2.x[0] = b2.x[0]; - b2.x[1] = b5.x[1]; - b2.p.x = b1.a; - b2.o = b2.p.x; - b2.p = i16vec2(ivec2(1, 2)); - b2.o = int16_t(3); -} - +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + int16_t x; + i16vec2 y; + i16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int16_t a; + i16vec2 b; + i16vec3 c; + int16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int16_t o; + i16vec2 p; + i16vec3 q; + int16_t r[2]; + S u; + S v[2]; + i16vec2 x[100]; + int16_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + int16_t o; + i16vec2 p; + i16vec3 q; + int16_t r[2]; + S u; + S v[2]; + i16vec2 x[100]; + int16_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + int16_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = i16vec2(ivec3(b2.q).xy); + b2.p = i16vec2(ivec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + int x0 = int(b1.a); + ivec4 x1 = ivec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = int16_t(ivec2(b2.p).x); + b2.p = b2.v[1].y; + ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = i16vec2(ivec2(1, 2)); + b2.o = int16_t(3); +} + diff --git a/core/deps/glslang/Test/spv.16bitstorage-uint.frag b/core/deps/glslang/Test/spv.16bitstorage-uint.frag index 48bacc9e1..aeecd0419 100644 --- a/core/deps/glslang/Test/spv.16bitstorage-uint.frag +++ b/core/deps/glslang/Test/spv.16bitstorage-uint.frag @@ -1,90 +1,90 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : enable - -struct S -{ - uint16_t x; - u16vec2 y; - u16vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - uint16_t a; - u16vec2 b; - u16vec3 c; - uint16_t d[2]; - S g; - S h[2]; - uint j; -} b1; - -layout(row_major, std430) buffer B2 -{ - uint16_t o; - u16vec2 p; - u16vec3 q; - uint16_t r[2]; - S u; - S v[2]; - u16vec2 x[100]; - uint16_t w[]; -} b2; - -layout(row_major, std140) uniform B5 -{ - uint16_t o; - u16vec2 p; - u16vec3 q; - uint16_t r[2]; - S u; - S v[2]; - u16vec2 x[100]; - uint16_t w[100]; -} b5; - -struct S2 { - mat4x4 x; - uint16_t y; - uint z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; - S3 y; -} b4; - -void main() -{ - b2.o = b1.a; - b2.p = u16vec2(uvec3(b2.q).xy); - b2.p = u16vec2(uvec3(b5.q).xy); - b2.r[0] = b2.r[0]; - b2.r[1] = b5.r[1]; - b2.p = b2.p; - uint x0 = uint(b1.a); - uvec4 x1 = uvec4(b1.a, b2.p, 1); - b4.x.x = b3.x.x; - b2.o = uint16_t(uvec2(b2.p).x); - b2.p = b2.v[1].y; - uvec3 v3 = uvec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); - uvec3 u3 = uvec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); - b2.x[0] = b2.x[0]; - b2.x[1] = b5.x[1]; - b2.p.x = b1.a; - b2.o = b2.p.x; - b2.p = u16vec2(uvec2(1, 2)); - b2.o = uint16_t(3u); -} - +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + uint16_t x; + u16vec2 y; + u16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint16_t a; + u16vec2 b; + u16vec3 c; + uint16_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint16_t o; + u16vec2 p; + u16vec3 q; + uint16_t r[2]; + S u; + S v[2]; + u16vec2 x[100]; + uint16_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + uint16_t o; + u16vec2 p; + u16vec3 q; + uint16_t r[2]; + S u; + S v[2]; + u16vec2 x[100]; + uint16_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + uint16_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = u16vec2(uvec3(b2.q).xy); + b2.p = u16vec2(uvec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + uint x0 = uint(b1.a); + uvec4 x1 = uvec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = uint16_t(uvec2(b2.p).x); + b2.p = b2.v[1].y; + uvec3 v3 = uvec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + uvec3 u3 = uvec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = u16vec2(uvec2(1, 2)); + b2.o = uint16_t(3u); +} + diff --git a/core/deps/glslang/Test/spv.16bitstorage.frag b/core/deps/glslang/Test/spv.16bitstorage.frag index 724fab3a6..b821be1e1 100644 --- a/core/deps/glslang/Test/spv.16bitstorage.frag +++ b/core/deps/glslang/Test/spv.16bitstorage.frag @@ -1,90 +1,90 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : enable - -struct S -{ - float16_t x; - f16vec2 y; - f16vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - float16_t a; - f16vec2 b; - f16vec3 c; - float16_t d[2]; - S g; - S h[2]; - int j; -} b1; - -layout(row_major, std430) buffer B2 -{ - float16_t o; - f16vec2 p; - f16vec3 q; - float16_t r[2]; - S u; - S v[2]; - f16vec2 x[100]; - float16_t w[]; -} b2; - -layout(row_major, std140) uniform B5 -{ - float16_t o; - f16vec2 p; - f16vec3 q; - float16_t r[2]; - S u; - S v[2]; - f16vec2 x[100]; - float16_t w[100]; -} b5; - -struct S2 { - mat4x4 x; - float16_t y; - float z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; - S3 y; -} b4; - -void main() -{ - b2.o = b1.a; - b2.p = f16vec2(vec3(b2.q).xy); - b2.p = f16vec2(vec3(b5.q).xy); - b2.r[0] = b2.r[0]; - b2.r[1] = b5.r[1]; - b2.p = b2.p; - float x0 = float(b1.a); - vec4 x1 = vec4(b1.a, b2.p, 1.0); - b4.x.x = b3.x.x; - b2.o = float16_t(vec2(b2.p).x); - b2.p = b2.v[1].y; - vec3 v3 = vec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); - vec3 u3 = vec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); - b2.x[0] = b2.x[0]; - b2.x[1] = b5.x[1]; - b2.p.x = b1.a; - b2.o = b2.p.x; - b2.p = f16vec2(vec2(1.0, 2.0)); - b2.o = float16_t(3.0); -} - +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + float16_t x; + f16vec2 y; + f16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float16_t a; + f16vec2 b; + f16vec3 c; + float16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + float16_t o; + f16vec2 p; + f16vec3 q; + float16_t r[2]; + S u; + S v[2]; + f16vec2 x[100]; + float16_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + float16_t o; + f16vec2 p; + f16vec3 q; + float16_t r[2]; + S u; + S v[2]; + f16vec2 x[100]; + float16_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + float16_t y; + float z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = f16vec2(vec3(b2.q).xy); + b2.p = f16vec2(vec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + float x0 = float(b1.a); + vec4 x1 = vec4(b1.a, b2.p, 1.0); + b4.x.x = b3.x.x; + b2.o = float16_t(vec2(b2.p).x); + b2.p = b2.v[1].y; + vec3 v3 = vec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + vec3 u3 = vec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = f16vec2(vec2(1.0, 2.0)); + b2.o = float16_t(3.0); +} + diff --git a/core/deps/glslang/Test/spv.16bitstorage_Error-int.frag b/core/deps/glslang/Test/spv.16bitstorage_Error-int.frag index d51957f1c..1897b026c 100644 --- a/core/deps/glslang/Test/spv.16bitstorage_Error-int.frag +++ b/core/deps/glslang/Test/spv.16bitstorage_Error-int.frag @@ -1,101 +1,101 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : enable - -struct S -{ - int16_t x; - i16vec2 y; - i16vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - int16_t a; - i16vec2 b; - i16vec3 c; - int16_t d[2]; - S g; - S h[2]; - int j; -} b1; - -layout(row_major, std430) buffer B2 -{ - int16_t o; - i16vec2 p; - i16vec3 q; - int16_t r[2]; - S u; - S v[2]; - int16_t w[]; -} b2; - -struct S2 { - mat4x4 x; - int16_t y; - int z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; -} b4; - -void func3(S2 x) { -} - -S2 func4() { - return b4.x; -} - -int func(int16_t a) { - return 0; -} - -struct S4 { - int x; - int16_t y; -}; - -int func2(int a) { return 0; } - -void main() -{ - b2.o = b2.q[1]; - b2.p = b2.q.xy; - b2.o = max(b1.a, b1.a); - bvec2 bv = lessThan(b2.p, b2.p); - b2.o = b1.a + b1.a; - b2.o = -b1.a; - b2.o = b1.a + 1; - b2.p = b2.p.yx; - b4.x = b3.x; - int16_t f0; - S2 f1; - S3 f2; - if (b1.a == b1.a) {} - b2.r = b2.r; - b2.p = i16vec2(3, 4); - i16vec2[2](i16vec2(ivec2(1,2)), i16vec2(ivec2(3,4))); - // NOT ERRORING YET - b3.x; - S4(0, int16_t(0)); - func2(b1.a); -} - - -layout(column_major, std140) uniform B6 -{ - i16mat2x3 e; -} b6; - +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + int16_t x; + i16vec2 y; + i16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int16_t a; + i16vec2 b; + i16vec3 c; + int16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int16_t o; + i16vec2 p; + i16vec3 q; + int16_t r[2]; + S u; + S v[2]; + int16_t w[]; +} b2; + +struct S2 { + mat4x4 x; + int16_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +int func(int16_t a) { + return 0; +} + +struct S4 { + int x; + int16_t y; +}; + +int func2(int a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + int16_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = i16vec2(3, 4); + i16vec2[2](i16vec2(ivec2(1,2)), i16vec2(ivec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0, int16_t(0)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + i16mat2x3 e; +} b6; + diff --git a/core/deps/glslang/Test/spv.16bitstorage_Error-uint.frag b/core/deps/glslang/Test/spv.16bitstorage_Error-uint.frag index ec3847639..5f32a3b7f 100644 --- a/core/deps/glslang/Test/spv.16bitstorage_Error-uint.frag +++ b/core/deps/glslang/Test/spv.16bitstorage_Error-uint.frag @@ -1,101 +1,101 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : enable - -struct S -{ - uint16_t x; - u16vec2 y; - u16vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - uint16_t a; - u16vec2 b; - u16vec3 c; - uint16_t d[2]; - S g; - S h[2]; - uint j; -} b1; - -layout(row_major, std430) buffer B2 -{ - uint16_t o; - u16vec2 p; - u16vec3 q; - uint16_t r[2]; - S u; - S v[2]; - uint16_t w[]; -} b2; - -struct S2 { - mat4x4 x; - uint16_t y; - uint z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; -} b4; - -void func3(S2 x) { -} - -S2 func4() { - return b4.x; -} - -uint func(uint16_t a) { - return 0; -} - -struct S4 { - uint x; - uint16_t y; -}; - -uint func2(uint a) { return 0; } - -void main() -{ - b2.o = b2.q[1]; - b2.p = b2.q.xy; - b2.o = max(b1.a, b1.a); - bvec2 bv = lessThan(b2.p, b2.p); - b2.o = b1.a + b1.a; - b2.o = -b1.a; - b2.o = b1.a + 1; - b2.p = b2.p.yx; - b4.x = b3.x; - uint16_t f0; - S2 f1; - S3 f2; - if (b1.a == b1.a) {} - b2.r = b2.r; - b2.p = u16vec2(3, 4); - u16vec2[2](u16vec2(uvec2(1,2)), u16vec2(uvec2(3,4))); - // NOT ERRORING YET - b3.x; - S4(0u, uint16_t(0u)); - func2(b1.a); -} - - -layout(column_major, std140) uniform B6 -{ - u16mat2x3 e; -} b6; - +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + uint16_t x; + u16vec2 y; + u16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint16_t a; + u16vec2 b; + u16vec3 c; + uint16_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint16_t o; + u16vec2 p; + u16vec3 q; + uint16_t r[2]; + S u; + S v[2]; + uint16_t w[]; +} b2; + +struct S2 { + mat4x4 x; + uint16_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +uint func(uint16_t a) { + return 0; +} + +struct S4 { + uint x; + uint16_t y; +}; + +uint func2(uint a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + uint16_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = u16vec2(3, 4); + u16vec2[2](u16vec2(uvec2(1,2)), u16vec2(uvec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0u, uint16_t(0u)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + u16mat2x3 e; +} b6; + diff --git a/core/deps/glslang/Test/spv.16bitstorage_Error.frag b/core/deps/glslang/Test/spv.16bitstorage_Error.frag index 3c427045d..7a61a97ff 100644 --- a/core/deps/glslang/Test/spv.16bitstorage_Error.frag +++ b/core/deps/glslang/Test/spv.16bitstorage_Error.frag @@ -1,102 +1,102 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : enable - -struct S -{ - float16_t x; - f16vec2 y; - f16vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - float16_t a; - f16vec2 b; - f16vec3 c; - float16_t d[2]; - S g; - S h[2]; - int j; -} b1; - -layout(row_major, std430) buffer B2 -{ - float16_t o; - f16vec2 p; - f16vec3 q; - float16_t r[2]; - S u; - S v[2]; - float16_t w[]; -} b2; - -struct S2 { - mat4x4 x; - float16_t y; - float z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; -} b4; - -void func3(S2 x) { -} - -S2 func4() { - return b4.x; -} - -float func(float16_t a) { - return 0.0; -} - -struct S4 { - float x; - float16_t y; -}; - -float func2(float a) { return 0.0; } - -void main() -{ - b2.o = b2.q[1]; - b2.p = b2.q.xy; - b2.o = max(b1.a, b1.a); - bvec2 bv = lessThan(b2.p, b2.p); - b2.o = b1.a + b1.a; - b2.o = -b1.a; - b2.o = b1.a + 1.0; - b2.p = b2.p.yx; - b4.x = b3.x; - float16_t f0; - S2 f1; - S3 f2; - if (b1.a == b1.a) {} - b2.r = b2.r; - b2.o = 1.0HF; - b2.p = f16vec2(3.0, 4.0); - f16vec2[2](f16vec2(vec2(1.0,2.0)), f16vec2(vec2(3.0,4.0))); - // NOT ERRORING YET - b3.x; - S4(0.0, float16_t(0.0)); - func2(b1.a); -} - - -layout(column_major, std140) uniform B6 -{ - f16mat2x3 e; -} b6; - +#version 450 core + +#extension GL_EXT_shader_16bit_storage : enable + +struct S +{ + float16_t x; + f16vec2 y; + f16vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + float16_t a; + f16vec2 b; + f16vec3 c; + float16_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + float16_t o; + f16vec2 p; + f16vec3 q; + float16_t r[2]; + S u; + S v[2]; + float16_t w[]; +} b2; + +struct S2 { + mat4x4 x; + float16_t y; + float z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +float func(float16_t a) { + return 0.0; +} + +struct S4 { + float x; + float16_t y; +}; + +float func2(float a) { return 0.0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1.0; + b2.p = b2.p.yx; + b4.x = b3.x; + float16_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.o = 1.0HF; + b2.p = f16vec2(3.0, 4.0); + f16vec2[2](f16vec2(vec2(1.0,2.0)), f16vec2(vec2(3.0,4.0))); + // NOT ERRORING YET + b3.x; + S4(0.0, float16_t(0.0)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + f16mat2x3 e; +} b6; + diff --git a/core/deps/glslang/Test/spv.16bitxfb.vert b/core/deps/glslang/Test/spv.16bitxfb.vert index b20c4d31e..f9719436c 100644 --- a/core/deps/glslang/Test/spv.16bitxfb.vert +++ b/core/deps/glslang/Test/spv.16bitxfb.vert @@ -1,33 +1,33 @@ -#version 450 core - -#extension GL_AMD_gpu_shader_half_float: enable -#extension GL_AMD_gpu_shader_int16: enable - -layout(location = 0) in f16vec4 if16v4; -layout(location = 1) in i16vec4 ii16v4; -layout(location = 2) in u16vec4 iu16v4; - -layout(location = 0, xfb_buffer = 0, xfb_stride = 6, xfb_offset = 0) out f16vec3 of16v3; -layout(location = 1, xfb_buffer = 1, xfb_stride = 6, xfb_offset = 0) out F16Out -{ - float16_t of16; - f16vec2 of16v2; -}; - -layout(location = 5, xfb_buffer = 2, xfb_stride = 6, xfb_offset = 0) out i16vec3 oi16v3; -layout(location = 6, xfb_buffer = 3, xfb_stride = 6, xfb_offset = 0) out I16Out -{ - uint16_t ou16; - u16vec2 ou16v2; -}; - -void main() -{ - of16v3 = if16v4.xyz; - of16 = if16v4.x; - of16v2 = if16v4.xy; - - oi16v3 = ii16v4.xyz; - ou16 = iu16v4.x; - ou16v2 = iu16v4.xy; +#version 450 core + +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable + +layout(location = 0) in f16vec4 if16v4; +layout(location = 1) in i16vec4 ii16v4; +layout(location = 2) in u16vec4 iu16v4; + +layout(location = 0, xfb_buffer = 0, xfb_stride = 6, xfb_offset = 0) out f16vec3 of16v3; +layout(location = 1, xfb_buffer = 1, xfb_stride = 6, xfb_offset = 0) out F16Out +{ + float16_t of16; + f16vec2 of16v2; +}; + +layout(location = 5, xfb_buffer = 2, xfb_stride = 6, xfb_offset = 0) out i16vec3 oi16v3; +layout(location = 6, xfb_buffer = 3, xfb_stride = 6, xfb_offset = 0) out I16Out +{ + uint16_t ou16; + u16vec2 ou16v2; +}; + +void main() +{ + of16v3 = if16v4.xyz; + of16 = if16v4.x; + of16v2 = if16v4.xy; + + oi16v3 = ii16v4.xyz; + ou16 = iu16v4.x; + ou16v2 = iu16v4.xy; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.300BuiltIns.vert b/core/deps/glslang/Test/spv.300BuiltIns.vert index 847448fb6..46c3f0fed 100644 --- a/core/deps/glslang/Test/spv.300BuiltIns.vert +++ b/core/deps/glslang/Test/spv.300BuiltIns.vert @@ -1,14 +1,14 @@ -#version 310 es - -in mediump float ps; - -invariant gl_Position; - -void main() -{ - gl_Position = vec4(ps); - gl_Position *= float(4 - gl_VertexIndex); - - gl_PointSize = ps; - gl_PointSize *= float(5 - gl_InstanceIndex); -} +#version 310 es + +in mediump float ps; + +invariant gl_Position; + +void main() +{ + gl_Position = vec4(ps); + gl_Position *= float(4 - gl_VertexIndex); + + gl_PointSize = ps; + gl_PointSize *= float(5 - gl_InstanceIndex); +} diff --git a/core/deps/glslang/Test/spv.300layout.frag b/core/deps/glslang/Test/spv.300layout.frag index 69687f6db..5b4c56c22 100644 --- a/core/deps/glslang/Test/spv.300layout.frag +++ b/core/deps/glslang/Test/spv.300layout.frag @@ -1,22 +1,22 @@ -#version 310 es - -precision mediump float; - -in vec4 pos; -in vec3 color; - -layout(location = 7) out vec3 c; -layout(LocatioN = 3) out vec4 p[2]; - -struct S { - vec3 c; - float f; -}; - -in S s; - -void main() -{ - c = color + s.c; - p[1] = pos * s.f; -} +#version 310 es + +precision mediump float; + +in vec4 pos; +in vec3 color; + +layout(location = 7) out vec3 c; +layout(LocatioN = 3) out vec4 p[2]; + +struct S { + vec3 c; + float f; +}; + +in S s; + +void main() +{ + c = color + s.c; + p[1] = pos * s.f; +} diff --git a/core/deps/glslang/Test/spv.300layout.vert b/core/deps/glslang/Test/spv.300layout.vert index f18e27315..a32a95de7 100644 --- a/core/deps/glslang/Test/spv.300layout.vert +++ b/core/deps/glslang/Test/spv.300layout.vert @@ -1,49 +1,49 @@ -#version 310 es - -layout(location = 7) in vec3 c; -layout(LocatioN = 3) in vec4 p; -layout(location = 9) in ivec2 aiv2; -out vec4 pos; -out vec3 color; -flat out int iout; - -layout(row_major) uniform; // default is now row_major - -layout(std140) uniform Transform { // layout of this block is std140 - mat4 M1; // row_major - layout(column_major) mat4 M2; // column major - mat3 N1; // row_major - int iuin; -} tblock; - -uniform T2 { // layout of this block is shared - bool b; - mat4 t2m; -}; - -layout(column_major) uniform T3 { // shared and column_major - mat4 M3; // column_major - layout(row_major) mat4 M4; // row major - mat2x3 N2; // column_major - layout(align=16, offset=2048) uvec3 uv3a[4]; -}; - -in uint uiuin; - -struct S { - vec3 c; - float f; -}; - -out S s; - -void main() -{ - pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m); - color = c * tblock.N1; - iout = tblock.iuin + int(uiuin) + aiv2.y; - s.c = c; - s.f = p.x; - if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5)) - ++s.c; -} +#version 310 es + +layout(location = 7) in vec3 c; +layout(LocatioN = 3) in vec4 p; +layout(location = 9) in ivec2 aiv2; +out vec4 pos; +out vec3 color; +flat out int iout; + +layout(row_major) uniform; // default is now row_major + +layout(std140) uniform Transform { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major + int iuin; +} tblock; + +uniform T2 { // layout of this block is shared + bool b; + mat4 t2m; +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M3; // column_major + layout(row_major) mat4 M4; // row major + mat2x3 N2; // column_major + layout(align=16, offset=2048) uvec3 uv3a[4]; +}; + +in uint uiuin; + +struct S { + vec3 c; + float f; +}; + +out S s; + +void main() +{ + pos = p * (tblock.M1 + tblock.M2 + M4 + M3 + t2m); + color = c * tblock.N1; + iout = tblock.iuin + int(uiuin) + aiv2.y; + s.c = c; + s.f = p.x; + if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5)) + ++s.c; +} diff --git a/core/deps/glslang/Test/spv.300layoutp.vert b/core/deps/glslang/Test/spv.300layoutp.vert index 3b2e6b96d..d14aa1cd4 100644 --- a/core/deps/glslang/Test/spv.300layoutp.vert +++ b/core/deps/glslang/Test/spv.300layoutp.vert @@ -1,49 +1,49 @@ -#version 310 es - -layout(location = 7) in vec3 c; -layout(LocatioN = 3) in vec4 p; -layout(location = 9) in ivec2 aiv2; -out vec4 pos; -out vec3 color; -flat out int iout; - -layout(row_major) uniform; // default is now row_major - -layout(std140) uniform Transform { // layout of this block is std140 - mat4 M1; // row_major - layout(column_major) mat4 M2; // column major - mat3 N1; // row_major - int iuin; -} tblock; - -uniform T2 { // layout of this block is shared - bool b; - mat4 t2m; -}; - -layout(column_major) uniform T3 { // shared and column_major - mat4 M3; // column_major - layout(row_major) mat4 M4; // row major - mat2x3 N2; // column_major - uvec3 uv3a[4]; -}; - -uint uiuin; - -struct S { - vec3 c; - float f; -}; - -out S s; - -void main() -{ - pos = p * (tblock.M1 * tblock.M2 * M4 * M3 * t2m); - color = c * tblock.N1; - iout = tblock.iuin + int(uiuin) + aiv2.y; - s.c = c; - s.f = p.x; - if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5)) - ++s.c; -} +#version 310 es + +layout(location = 7) in vec3 c; +layout(LocatioN = 3) in vec4 p; +layout(location = 9) in ivec2 aiv2; +out vec4 pos; +out vec3 color; +flat out int iout; + +layout(row_major) uniform; // default is now row_major + +layout(std140) uniform Transform { // layout of this block is std140 + mat4 M1; // row_major + layout(column_major) mat4 M2; // column major + mat3 N1; // row_major + int iuin; +} tblock; + +uniform T2 { // layout of this block is shared + bool b; + mat4 t2m; +}; + +layout(column_major) uniform T3 { // shared and column_major + mat4 M3; // column_major + layout(row_major) mat4 M4; // row major + mat2x3 N2; // column_major + uvec3 uv3a[4]; +}; + +uint uiuin; + +struct S { + vec3 c; + float f; +}; + +out S s; + +void main() +{ + pos = p * (tblock.M1 * tblock.M2 * M4 * M3 * t2m); + color = c * tblock.N1; + iout = tblock.iuin + int(uiuin) + aiv2.y; + s.c = c; + s.f = p.x; + if (N2[1] != vec3(1.0) || uv3a[2] != uvec3(5)) + ++s.c; +} diff --git a/core/deps/glslang/Test/spv.310.bitcast.frag b/core/deps/glslang/Test/spv.310.bitcast.frag index 180c83a0c..dbde52f87 100644 --- a/core/deps/glslang/Test/spv.310.bitcast.frag +++ b/core/deps/glslang/Test/spv.310.bitcast.frag @@ -1,41 +1,41 @@ -#version 310 es - -flat in mediump int i1; -flat in lowp ivec2 i2; -flat in mediump ivec3 i3; -flat in highp ivec4 i4; - -flat in mediump uint u1; -flat in lowp uvec2 u2; -flat in mediump uvec3 u3; -flat in highp uvec4 u4; - -mediump in float f1; -lowp in vec2 f2; -mediump in vec3 f3; -highp in vec4 f4; - -void main() -{ - highp ivec4 idata = ivec4(0); - idata.x += floatBitsToInt(f1); - idata.xy += floatBitsToInt(f2); - idata.xyz += floatBitsToInt(f3); - idata += floatBitsToInt(f4); - - highp uvec4 udata = uvec4(0); - udata.x += floatBitsToUint(f1); - udata.xy += floatBitsToUint(f2); - udata.xyz += floatBitsToUint(f3); - udata += floatBitsToUint(f4); - - highp vec4 fdata = vec4(0.0); - fdata.x += intBitsToFloat(i1); - fdata.xy += intBitsToFloat(i2); - fdata.xyz += intBitsToFloat(i3); - fdata += intBitsToFloat(i4); - fdata.x += uintBitsToFloat(u1); - fdata.xy += uintBitsToFloat(u2); - fdata.xyz += uintBitsToFloat(u3); - fdata += uintBitsToFloat(u4); +#version 310 es + +flat in mediump int i1; +flat in lowp ivec2 i2; +flat in mediump ivec3 i3; +flat in highp ivec4 i4; + +flat in mediump uint u1; +flat in lowp uvec2 u2; +flat in mediump uvec3 u3; +flat in highp uvec4 u4; + +mediump in float f1; +lowp in vec2 f2; +mediump in vec3 f3; +highp in vec4 f4; + +void main() +{ + highp ivec4 idata = ivec4(0); + idata.x += floatBitsToInt(f1); + idata.xy += floatBitsToInt(f2); + idata.xyz += floatBitsToInt(f3); + idata += floatBitsToInt(f4); + + highp uvec4 udata = uvec4(0); + udata.x += floatBitsToUint(f1); + udata.xy += floatBitsToUint(f2); + udata.xyz += floatBitsToUint(f3); + udata += floatBitsToUint(f4); + + highp vec4 fdata = vec4(0.0); + fdata.x += intBitsToFloat(i1); + fdata.xy += intBitsToFloat(i2); + fdata.xyz += intBitsToFloat(i3); + fdata += intBitsToFloat(i4); + fdata.x += uintBitsToFloat(u1); + fdata.xy += uintBitsToFloat(u2); + fdata.xyz += uintBitsToFloat(u3); + fdata += uintBitsToFloat(u4); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.330.geom b/core/deps/glslang/Test/spv.330.geom index b7962657b..ebd4ac66e 100644 --- a/core/deps/glslang/Test/spv.330.geom +++ b/core/deps/glslang/Test/spv.330.geom @@ -1,26 +1,26 @@ -#version 330 core -#extension GL_ARB_separate_shader_objects : enable - -in gl_PerVertex -{ - float gl_ClipDistance[1]; - vec4 gl_Position; -} gl_in[]; - -out gl_PerVertex -{ - vec4 gl_Position; - float gl_ClipDistance[1]; -}; - -layout( triangles ) in; -layout( triangle_strip, max_vertices = 3 ) out; - -void main() -{ - vec4 v; - gl_Position = gl_in[1].gl_Position; - gl_ClipDistance[0] = gl_in[1].gl_ClipDistance[0]; - EmitVertex(); - EndPrimitive(); -} +#version 330 core +#extension GL_ARB_separate_shader_objects : enable + +in gl_PerVertex +{ + float gl_ClipDistance[1]; + vec4 gl_Position; +} gl_in[]; + +out gl_PerVertex +{ + vec4 gl_Position; + float gl_ClipDistance[1]; +}; + +layout( triangles ) in; +layout( triangle_strip, max_vertices = 3 ) out; + +void main() +{ + vec4 v; + gl_Position = gl_in[1].gl_Position; + gl_ClipDistance[0] = gl_in[1].gl_ClipDistance[0]; + EmitVertex(); + EndPrimitive(); +} diff --git a/core/deps/glslang/Test/spv.400.frag b/core/deps/glslang/Test/spv.400.frag index b7dafc27c..d64c4700e 100644 --- a/core/deps/glslang/Test/spv.400.frag +++ b/core/deps/glslang/Test/spv.400.frag @@ -1,265 +1,265 @@ -#version 400 core - -in vec2 c2D; -flat in int i; -flat in uint u; -out uint uo; -out vec4 outp; -out ivec4 ioutp; -out uvec4 uoutp; -uniform sampler2D arrayedSampler[5]; -uniform usampler2DRect samp2dr; -uniform isampler2DArray isamp2DA; -uniform sampler2DRectShadow u2drs; - -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 6) in vec4 vl2; - -void foo23() -{ - const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); - - outp.x += textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); -} - -void doubles() -{ - double doublev; - dvec2 dvec2v; - dvec3 dvec3v; - dvec4 dvec4v; - - bool boolv; - bvec2 bvec2v; - bvec3 bvec3v; - bvec4 bvec4v; - - doublev = sqrt(2.9); - dvec2v = sqrt(dvec2(2.7)); - dvec3v = sqrt(dvec3(2.0)); - dvec4v = sqrt(dvec4(doublev)); - - doublev += inversesqrt(doublev); - dvec2v += inversesqrt(dvec2v); - dvec3v += inversesqrt(dvec3v); - dvec4v += inversesqrt(dvec4v); - - doublev += abs(doublev); - dvec2v += abs(dvec2v); - dvec3v += abs(dvec3v); - dvec4v += abs(dvec4v); - - doublev += sign(doublev); - dvec2v += sign(dvec2v); - dvec3v += sign(dvec3v); - dvec4v += sign(dvec4v); - - doublev += floor(doublev); - dvec2v += floor(dvec2v); - dvec3v += floor(dvec3v); - dvec4v += floor(dvec4v); - - doublev += trunc(doublev); - dvec2v += trunc(dvec2v); - dvec3v += trunc(dvec3v); - dvec4v += trunc(dvec4v); - - doublev += round(doublev); - dvec2v += round(dvec2v); - dvec3v += round(dvec3v); - dvec4v += round(dvec4v); - - doublev += roundEven(doublev); - dvec2v += roundEven(dvec2v); - dvec3v += roundEven(dvec3v); - dvec4v += roundEven(dvec4v); - - doublev += ceil(doublev); - dvec2v += ceil(dvec2v); - dvec3v += ceil(dvec3v); - dvec4v += ceil(dvec4v); - - doublev += fract(doublev); - dvec2v += fract(dvec2v); - dvec3v += fract(dvec3v); - dvec4v += fract(dvec4v); - - doublev += mod(doublev, doublev); - dvec2v += mod(dvec2v, doublev); - dvec3v += mod(dvec3v, doublev); - dvec4v += mod(dvec4v, doublev); - dvec2v += mod(dvec2v, dvec2v); - dvec3v += mod(dvec3v, dvec3v); - dvec4v += mod(dvec4v, dvec4v); - - doublev += modf(doublev, doublev); - dvec2v += modf(dvec2v, dvec2v); - dvec3v += modf(dvec3v, dvec3v); - dvec4v += modf(dvec4v, dvec4v); - - doublev += min(doublev, doublev); - dvec2v += min(dvec2v, doublev); - dvec3v += min(dvec3v, doublev); - dvec4v += min(dvec4v, doublev); - dvec2v += min(dvec2v, dvec2v); - dvec3v += min(dvec3v, dvec3v); - dvec4v += min(dvec4v, dvec4v); - - doublev += max(doublev, doublev); - dvec2v += max(dvec2v, doublev); - dvec3v += max(dvec3v, doublev); - dvec4v += max(dvec4v, doublev); - dvec2v += max(dvec2v, dvec2v); - dvec3v += max(dvec3v, dvec3v); - dvec4v += max(dvec4v, dvec4v); - - doublev += clamp(doublev, doublev, doublev); - dvec2v += clamp(dvec2v, doublev, doublev); - dvec3v += clamp(dvec3v, doublev, doublev); - dvec4v += clamp(dvec4v, doublev, doublev); - dvec2v += clamp(dvec2v, dvec2v, dvec2v); - dvec3v += clamp(dvec3v, dvec3v, dvec3v); - dvec4v += clamp(dvec4v, dvec4v, dvec4v); - - doublev += mix(doublev, doublev, doublev); - dvec2v += mix(dvec2v, dvec2v, doublev); - dvec3v += mix(dvec3v, dvec3v, doublev); - dvec4v += mix(dvec4v, dvec4v, doublev); - dvec2v += mix(dvec2v, dvec2v, dvec2v); - dvec3v += mix(dvec3v, dvec3v, dvec3v); - dvec4v += mix(dvec4v, dvec4v, dvec4v); - doublev += mix(doublev, doublev, boolv); - dvec2v += mix(dvec2v, dvec2v, bvec2v); - dvec3v += mix(dvec3v, dvec3v, bvec3v); - dvec4v += mix(dvec4v, dvec4v, bvec4v); - - doublev += step(doublev, doublev); - dvec2v += step(dvec2v, dvec2v); - dvec3v += step(dvec3v, dvec3v); - dvec4v += step(dvec4v, dvec4v); - dvec2v += step(doublev, dvec2v); - dvec3v += step(doublev, dvec3v); - dvec4v += step(doublev, dvec4v); - - doublev += smoothstep(doublev, doublev, doublev); - dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); - dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); - dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); - dvec2v += smoothstep(doublev, doublev, dvec2v); - dvec3v += smoothstep(doublev, doublev, dvec3v); - dvec4v += smoothstep(doublev, doublev, dvec4v); - - boolv = isnan(doublev); - bvec2v = isnan(dvec2v); - bvec3v = isnan(dvec3v); - bvec4v = isnan(dvec4v); - - boolv = boolv ? isinf(doublev) : false; - bvec2v = boolv ? isinf(dvec2v) : bvec2(false); - bvec3v = boolv ? isinf(dvec3v) : bvec3(false); - bvec4v = boolv ? isinf(dvec4v) : bvec4(false); - - doublev += length(doublev); - doublev += length(dvec2v); - doublev += length(dvec3v); - doublev += length(dvec4v); - - doublev += distance(doublev, doublev); - doublev += distance(dvec2v, dvec2v); - doublev += distance(dvec3v, dvec3v); - doublev += distance(dvec4v, dvec4v); - - doublev += dot(doublev, doublev); - doublev += dot(dvec2v, dvec2v); - doublev += dot(dvec3v, dvec3v); - doublev += dot(dvec4v, dvec4v); - - dvec3v += cross(dvec3v, dvec3v); - - doublev += normalize(doublev); - dvec2v += normalize(dvec2v); - dvec3v += normalize(dvec3v); - dvec4v += normalize(dvec4v); - - doublev += faceforward(doublev, doublev, doublev); - dvec2v += faceforward(dvec2v, dvec2v, dvec2v); - dvec3v += faceforward(dvec3v, dvec3v, dvec3v); - dvec4v += faceforward(dvec4v, dvec4v, dvec4v); - - doublev += reflect(doublev, doublev); - dvec2v += reflect(dvec2v, dvec2v); - dvec3v += reflect(dvec3v, dvec3v); - dvec4v += reflect(dvec4v, dvec4v); - - doublev += refract(doublev, doublev, doublev); - dvec2v += refract(dvec2v, dvec2v, doublev); - dvec3v += refract(dvec3v, dvec3v, doublev); - dvec4v += refract(dvec4v, dvec4v, doublev); - - dmat2 dmat2v = outerProduct(dvec2v, dvec2v); - dmat3 dmat3v = outerProduct(dvec3v, dvec3v); - dmat4 dmat4v = outerProduct(dvec4v, dvec4v); - dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); - dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); - dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); - dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); - dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); - dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); - +#version 400 core + +in vec2 c2D; +flat in int i; +flat in uint u; +out uint uo; +out vec4 outp; +out ivec4 ioutp; +out uvec4 uoutp; +uniform sampler2D arrayedSampler[5]; +uniform usampler2DRect samp2dr; +uniform isampler2DArray isamp2DA; +uniform sampler2DRectShadow u2drs; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 6) in vec4 vl2; + +void foo23() +{ + const ivec2[3] offsets = ivec2[3](ivec2(1,2), ivec2(3,4), ivec2(15,16)); + + outp.x += textureProjGradOffset(u2drs, outp, vec2(0.0), vec2(0.0), offsets[1]); +} + +void doubles() +{ + double doublev; + dvec2 dvec2v; + dvec3 dvec3v; + dvec4 dvec4v; + + bool boolv; + bvec2 bvec2v; + bvec3 bvec3v; + bvec4 bvec4v; + + doublev = sqrt(2.9); + dvec2v = sqrt(dvec2(2.7)); + dvec3v = sqrt(dvec3(2.0)); + dvec4v = sqrt(dvec4(doublev)); + + doublev += inversesqrt(doublev); + dvec2v += inversesqrt(dvec2v); + dvec3v += inversesqrt(dvec3v); + dvec4v += inversesqrt(dvec4v); + + doublev += abs(doublev); + dvec2v += abs(dvec2v); + dvec3v += abs(dvec3v); + dvec4v += abs(dvec4v); + + doublev += sign(doublev); + dvec2v += sign(dvec2v); + dvec3v += sign(dvec3v); + dvec4v += sign(dvec4v); + + doublev += floor(doublev); + dvec2v += floor(dvec2v); + dvec3v += floor(dvec3v); + dvec4v += floor(dvec4v); + + doublev += trunc(doublev); + dvec2v += trunc(dvec2v); + dvec3v += trunc(dvec3v); + dvec4v += trunc(dvec4v); + + doublev += round(doublev); + dvec2v += round(dvec2v); + dvec3v += round(dvec3v); + dvec4v += round(dvec4v); + + doublev += roundEven(doublev); + dvec2v += roundEven(dvec2v); + dvec3v += roundEven(dvec3v); + dvec4v += roundEven(dvec4v); + + doublev += ceil(doublev); + dvec2v += ceil(dvec2v); + dvec3v += ceil(dvec3v); + dvec4v += ceil(dvec4v); + + doublev += fract(doublev); + dvec2v += fract(dvec2v); + dvec3v += fract(dvec3v); + dvec4v += fract(dvec4v); + + doublev += mod(doublev, doublev); + dvec2v += mod(dvec2v, doublev); + dvec3v += mod(dvec3v, doublev); + dvec4v += mod(dvec4v, doublev); + dvec2v += mod(dvec2v, dvec2v); + dvec3v += mod(dvec3v, dvec3v); + dvec4v += mod(dvec4v, dvec4v); + + doublev += modf(doublev, doublev); + dvec2v += modf(dvec2v, dvec2v); + dvec3v += modf(dvec3v, dvec3v); + dvec4v += modf(dvec4v, dvec4v); + + doublev += min(doublev, doublev); + dvec2v += min(dvec2v, doublev); + dvec3v += min(dvec3v, doublev); + dvec4v += min(dvec4v, doublev); + dvec2v += min(dvec2v, dvec2v); + dvec3v += min(dvec3v, dvec3v); + dvec4v += min(dvec4v, dvec4v); + + doublev += max(doublev, doublev); + dvec2v += max(dvec2v, doublev); + dvec3v += max(dvec3v, doublev); + dvec4v += max(dvec4v, doublev); + dvec2v += max(dvec2v, dvec2v); + dvec3v += max(dvec3v, dvec3v); + dvec4v += max(dvec4v, dvec4v); + + doublev += clamp(doublev, doublev, doublev); + dvec2v += clamp(dvec2v, doublev, doublev); + dvec3v += clamp(dvec3v, doublev, doublev); + dvec4v += clamp(dvec4v, doublev, doublev); + dvec2v += clamp(dvec2v, dvec2v, dvec2v); + dvec3v += clamp(dvec3v, dvec3v, dvec3v); + dvec4v += clamp(dvec4v, dvec4v, dvec4v); + + doublev += mix(doublev, doublev, doublev); + dvec2v += mix(dvec2v, dvec2v, doublev); + dvec3v += mix(dvec3v, dvec3v, doublev); + dvec4v += mix(dvec4v, dvec4v, doublev); + dvec2v += mix(dvec2v, dvec2v, dvec2v); + dvec3v += mix(dvec3v, dvec3v, dvec3v); + dvec4v += mix(dvec4v, dvec4v, dvec4v); + doublev += mix(doublev, doublev, boolv); + dvec2v += mix(dvec2v, dvec2v, bvec2v); + dvec3v += mix(dvec3v, dvec3v, bvec3v); + dvec4v += mix(dvec4v, dvec4v, bvec4v); + + doublev += step(doublev, doublev); + dvec2v += step(dvec2v, dvec2v); + dvec3v += step(dvec3v, dvec3v); + dvec4v += step(dvec4v, dvec4v); + dvec2v += step(doublev, dvec2v); + dvec3v += step(doublev, dvec3v); + dvec4v += step(doublev, dvec4v); + + doublev += smoothstep(doublev, doublev, doublev); + dvec2v += smoothstep(dvec2v, dvec2v, dvec2v); + dvec3v += smoothstep(dvec3v, dvec3v, dvec3v); + dvec4v += smoothstep(dvec4v, dvec4v, dvec4v); + dvec2v += smoothstep(doublev, doublev, dvec2v); + dvec3v += smoothstep(doublev, doublev, dvec3v); + dvec4v += smoothstep(doublev, doublev, dvec4v); + + boolv = isnan(doublev); + bvec2v = isnan(dvec2v); + bvec3v = isnan(dvec3v); + bvec4v = isnan(dvec4v); + + boolv = boolv ? isinf(doublev) : false; + bvec2v = boolv ? isinf(dvec2v) : bvec2(false); + bvec3v = boolv ? isinf(dvec3v) : bvec3(false); + bvec4v = boolv ? isinf(dvec4v) : bvec4(false); + + doublev += length(doublev); + doublev += length(dvec2v); + doublev += length(dvec3v); + doublev += length(dvec4v); + + doublev += distance(doublev, doublev); + doublev += distance(dvec2v, dvec2v); + doublev += distance(dvec3v, dvec3v); + doublev += distance(dvec4v, dvec4v); + + doublev += dot(doublev, doublev); + doublev += dot(dvec2v, dvec2v); + doublev += dot(dvec3v, dvec3v); + doublev += dot(dvec4v, dvec4v); + + dvec3v += cross(dvec3v, dvec3v); + + doublev += normalize(doublev); + dvec2v += normalize(dvec2v); + dvec3v += normalize(dvec3v); + dvec4v += normalize(dvec4v); + + doublev += faceforward(doublev, doublev, doublev); + dvec2v += faceforward(dvec2v, dvec2v, dvec2v); + dvec3v += faceforward(dvec3v, dvec3v, dvec3v); + dvec4v += faceforward(dvec4v, dvec4v, dvec4v); + + doublev += reflect(doublev, doublev); + dvec2v += reflect(dvec2v, dvec2v); + dvec3v += reflect(dvec3v, dvec3v); + dvec4v += reflect(dvec4v, dvec4v); + + doublev += refract(doublev, doublev, doublev); + dvec2v += refract(dvec2v, dvec2v, doublev); + dvec3v += refract(dvec3v, dvec3v, doublev); + dvec4v += refract(dvec4v, dvec4v, doublev); + + dmat2 dmat2v = outerProduct(dvec2v, dvec2v); + dmat3 dmat3v = outerProduct(dvec3v, dvec3v); + dmat4 dmat4v = outerProduct(dvec4v, dvec4v); + dmat2x3 dmat2x3v = outerProduct(dvec3v, dvec2v); + dmat3x2 dmat3x2v = outerProduct(dvec2v, dvec3v); + dmat2x4 dmat2x4v = outerProduct(dvec4v, dvec2v); + dmat4x2 dmat4x2v = outerProduct(dvec2v, dvec4v); + dmat3x4 dmat3x4v = outerProduct(dvec4v, dvec3v); + dmat4x3 dmat4x3v = outerProduct(dvec3v, dvec4v); + dmat2v *= matrixCompMult(dmat2v, dmat2v); dmat3v *= matrixCompMult(dmat3v, dmat3v); dmat4v *= matrixCompMult(dmat4v, dmat4v); - dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); // For now, relying on no dead-code elimination - dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); - dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); - dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); - dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); - dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); - - dmat2v *= transpose(dmat2v); - dmat3v *= transpose(dmat3v); - dmat4v *= transpose(dmat4v); - dmat2x3v = transpose(dmat3x2v); // For now, relying on no dead-code elimination - dmat3x2v = transpose(dmat2x3v); - dmat2x4v = transpose(dmat4x2v); - dmat4x2v = transpose(dmat2x4v); - dmat3x4v = transpose(dmat4x3v); - dmat4x3v = transpose(dmat3x4v); - - doublev += determinant(dmat2v); - doublev += determinant(dmat3v); - doublev += determinant(dmat4v); - - dmat2v *= inverse(dmat2v); - dmat3v *= inverse(dmat3v); - dmat4v *= inverse(dmat4v); - - outp *= float(doublev + dvec2v.y + dvec3v.z + dvec4v.w + - dmat2v[1][1] + dmat3v[2][2] + dmat4v[3][3] + dmat2x3v[1][1] + dmat3x2v[1][1] + dmat3x4v[2][2] + dmat4x3v[2][2] + dmat2x4v[1][1] + dmat4x2v[1][1] + - float(boolv) + float(bvec2v.x) + float(bvec3v.x) + float(bvec4v.x)); -} - -void main() -{ - vec4 v; - v = texture(arrayedSampler[i], c2D); - outp.x = gl_ClipDistance[1]; - outp.yzw = v.yzw; - - ivec2 offsets[4]; - const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); - uoutp = textureGatherOffsets(samp2dr, c2D, constOffsets, 2); - outp += textureGather(arrayedSampler[0], c2D); - ioutp = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); - ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); - ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); - - outp += gl_FragCoord + vl2; - uo = u % i; - foo23(); - doubles(); - - int id = gl_PrimitiveID; -} - + dmat2x3v = matrixCompMult(dmat2x3v, dmat2x3v); // For now, relying on no dead-code elimination + dmat2x4v = matrixCompMult(dmat2x4v, dmat2x4v); + dmat3x2v = matrixCompMult(dmat3x2v, dmat3x2v); + dmat3x4v = matrixCompMult(dmat3x4v, dmat3x4v); + dmat4x2v = matrixCompMult(dmat4x2v, dmat4x2v); + dmat4x3v = matrixCompMult(dmat4x3v, dmat4x3v); + + dmat2v *= transpose(dmat2v); + dmat3v *= transpose(dmat3v); + dmat4v *= transpose(dmat4v); + dmat2x3v = transpose(dmat3x2v); // For now, relying on no dead-code elimination + dmat3x2v = transpose(dmat2x3v); + dmat2x4v = transpose(dmat4x2v); + dmat4x2v = transpose(dmat2x4v); + dmat3x4v = transpose(dmat4x3v); + dmat4x3v = transpose(dmat3x4v); + + doublev += determinant(dmat2v); + doublev += determinant(dmat3v); + doublev += determinant(dmat4v); + + dmat2v *= inverse(dmat2v); + dmat3v *= inverse(dmat3v); + dmat4v *= inverse(dmat4v); + + outp *= float(doublev + dvec2v.y + dvec3v.z + dvec4v.w + + dmat2v[1][1] + dmat3v[2][2] + dmat4v[3][3] + dmat2x3v[1][1] + dmat3x2v[1][1] + dmat3x4v[2][2] + dmat4x3v[2][2] + dmat2x4v[1][1] + dmat4x2v[1][1] + + float(boolv) + float(bvec2v.x) + float(bvec3v.x) + float(bvec4v.x)); +} + +void main() +{ + vec4 v; + v = texture(arrayedSampler[i], c2D); + outp.x = gl_ClipDistance[1]; + outp.yzw = v.yzw; + + ivec2 offsets[4]; + const ivec2 constOffsets[4] = ivec2[4](ivec2(1,2), ivec2(3,4), ivec2(15,16), ivec2(-2,0)); + uoutp = textureGatherOffsets(samp2dr, c2D, constOffsets, 2); + outp += textureGather(arrayedSampler[0], c2D); + ioutp = textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 3); + ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(1), 1+2); + ioutp += textureGatherOffset(isamp2DA, vec3(0.1), ivec2(i)); + + outp += gl_FragCoord + vl2; + uo = u % i; + foo23(); + doubles(); + + int id = gl_PrimitiveID; +} + diff --git a/core/deps/glslang/Test/spv.400.tesc b/core/deps/glslang/Test/spv.400.tesc index fa08fcdfd..1c926d084 100644 --- a/core/deps/glslang/Test/spv.400.tesc +++ b/core/deps/glslang/Test/spv.400.tesc @@ -1,43 +1,43 @@ -#version 400 core - -layout(vertices = 4) out; -int outa[gl_out.length()]; - -patch out vec4 patchOut; - -void main() -{ - barrier(); - - int a = gl_MaxTessControlInputComponents + - gl_MaxTessControlOutputComponents + - gl_MaxTessControlTextureImageUnits + - gl_MaxTessControlUniformComponents + - gl_MaxTessControlTotalOutputComponents; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - int iid = gl_InvocationID; - - gl_out[gl_InvocationID].gl_Position = p; - gl_out[gl_InvocationID].gl_PointSize = ps; - gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; - - gl_TessLevelOuter[3] = 3.2; - gl_TessLevelInner[1] = 1.3; -} - -in vec2 inb[]; -in vec2 ind[gl_MaxPatchVertices]; - -#extension GL_ARB_separate_shader_objects : enable - -layout(location = 3) in vec4 ivla[]; -layout(location = 4) in vec4 ivlb[]; - -layout(location = 3) out vec4 ovla[]; -layout(location = 4) out vec4 ovlb[]; +#version 400 core + +layout(vertices = 4) out; +int outa[gl_out.length()]; + +patch out vec4 patchOut; + +void main() +{ + barrier(); + + int a = gl_MaxTessControlInputComponents + + gl_MaxTessControlOutputComponents + + gl_MaxTessControlTextureImageUnits + + gl_MaxTessControlUniformComponents + + gl_MaxTessControlTotalOutputComponents; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + int iid = gl_InvocationID; + + gl_out[gl_InvocationID].gl_Position = p; + gl_out[gl_InvocationID].gl_PointSize = ps; + gl_out[gl_InvocationID].gl_ClipDistance[1] = cd; + + gl_TessLevelOuter[3] = 3.2; + gl_TessLevelInner[1] = 1.3; +} + +in vec2 inb[]; +in vec2 ind[gl_MaxPatchVertices]; + +#extension GL_ARB_separate_shader_objects : enable + +layout(location = 3) in vec4 ivla[]; +layout(location = 4) in vec4 ivlb[]; + +layout(location = 3) out vec4 ovla[]; +layout(location = 4) out vec4 ovlb[]; diff --git a/core/deps/glslang/Test/spv.400.tese b/core/deps/glslang/Test/spv.400.tese index 6eb1861f8..da33f41ea 100644 --- a/core/deps/glslang/Test/spv.400.tese +++ b/core/deps/glslang/Test/spv.400.tese @@ -1,52 +1,52 @@ -#version 400 core - -layout(triangles, ccw) in; - -layout(fractional_odd_spacing) in; - -layout(point_mode) in; - -patch in vec4 patchIn; - -void main() -{ - int a = gl_MaxTessEvaluationInputComponents + - gl_MaxTessEvaluationOutputComponents + - gl_MaxTessEvaluationTextureImageUnits + - gl_MaxTessEvaluationUniformComponents + - gl_MaxTessPatchComponents + - gl_MaxPatchVertices + - gl_MaxTessGenLevel; - - vec4 p = gl_in[1].gl_Position; - float ps = gl_in[1].gl_PointSize; - float cd = gl_in[1].gl_ClipDistance[2]; - - int pvi = gl_PatchVerticesIn; - int pid = gl_PrimitiveID; - vec3 tc = gl_TessCoord; - float tlo = gl_TessLevelOuter[3]; - float tli = gl_TessLevelInner[1]; - - gl_Position = p; - gl_PointSize = ps; - gl_ClipDistance[2] = cd; -} - -#extension GL_ARB_separate_shader_objects : enable - -in vec2 inb[]; -in vec2 ind[gl_MaxPatchVertices]; - -in testblb { - int f; -} blb[]; - -in testbld { - int f; -} bld[gl_MaxPatchVertices]; - -layout(location = 23) in vec4 ivla[]; -layout(location = 24) in vec4 ivlb[]; - -layout(location = 23) out vec4 ovla[2]; +#version 400 core + +layout(triangles, ccw) in; + +layout(fractional_odd_spacing) in; + +layout(point_mode) in; + +patch in vec4 patchIn; + +void main() +{ + int a = gl_MaxTessEvaluationInputComponents + + gl_MaxTessEvaluationOutputComponents + + gl_MaxTessEvaluationTextureImageUnits + + gl_MaxTessEvaluationUniformComponents + + gl_MaxTessPatchComponents + + gl_MaxPatchVertices + + gl_MaxTessGenLevel; + + vec4 p = gl_in[1].gl_Position; + float ps = gl_in[1].gl_PointSize; + float cd = gl_in[1].gl_ClipDistance[2]; + + int pvi = gl_PatchVerticesIn; + int pid = gl_PrimitiveID; + vec3 tc = gl_TessCoord; + float tlo = gl_TessLevelOuter[3]; + float tli = gl_TessLevelInner[1]; + + gl_Position = p; + gl_PointSize = ps; + gl_ClipDistance[2] = cd; +} + +#extension GL_ARB_separate_shader_objects : enable + +in vec2 inb[]; +in vec2 ind[gl_MaxPatchVertices]; + +in testblb { + int f; +} blb[]; + +in testbld { + int f; +} bld[gl_MaxPatchVertices]; + +layout(location = 23) in vec4 ivla[]; +layout(location = 24) in vec4 ivlb[]; + +layout(location = 23) out vec4 ovla[2]; diff --git a/core/deps/glslang/Test/spv.420.geom b/core/deps/glslang/Test/spv.420.geom index 3c0a05121..92186ae8d 100644 --- a/core/deps/glslang/Test/spv.420.geom +++ b/core/deps/glslang/Test/spv.420.geom @@ -1,43 +1,43 @@ -#version 420 core - -layout(triangles) in; - -in gl_PerVertex { - float gl_PointSize; -} gl_in[]; - -out gl_PerVertex { - float gl_PointSize; -}; - -layout(line_strip) out; -layout(max_vertices = 127) out; -layout(invocations = 4) in; - -uniform sampler2D s2D; -in vec2 coord[]; - -int i; - -void main() -{ - float p = gl_in[1].gl_PointSize; - gl_PointSize = p; - gl_ViewportIndex = 7; - - EmitStreamVertex(1); - EndStreamPrimitive(0); - EmitVertex(); - EndPrimitive(); - int id = gl_InvocationID; - - const ivec2 offsets[5] = - { - ivec2(0,1), - ivec2(1,-2), - ivec2(0,3), - ivec2(-3,0), - ivec2(2,1) - }; - vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); -} +#version 420 core + +layout(triangles) in; + +in gl_PerVertex { + float gl_PointSize; +} gl_in[]; + +out gl_PerVertex { + float gl_PointSize; +}; + +layout(line_strip) out; +layout(max_vertices = 127) out; +layout(invocations = 4) in; + +uniform sampler2D s2D; +in vec2 coord[]; + +int i; + +void main() +{ + float p = gl_in[1].gl_PointSize; + gl_PointSize = p; + gl_ViewportIndex = 7; + + EmitStreamVertex(1); + EndStreamPrimitive(0); + EmitVertex(); + EndPrimitive(); + int id = gl_InvocationID; + + const ivec2 offsets[5] = + { + ivec2(0,1), + ivec2(1,-2), + ivec2(0,3), + ivec2(-3,0), + ivec2(2,1) + }; + vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy); +} diff --git a/core/deps/glslang/Test/spv.430.frag b/core/deps/glslang/Test/spv.430.frag index d747cb68e..e547f6109 100644 --- a/core/deps/glslang/Test/spv.430.frag +++ b/core/deps/glslang/Test/spv.430.frag @@ -1,10 +1,10 @@ -#version 430 core - -out vec4 color; - -void main() -{ - color = vec4(1.0); - color *= gl_Layer; - color *= gl_ViewportIndex; -} +#version 430 core + +out vec4 color; + +void main() +{ + color = vec4(1.0); + color *= gl_Layer; + color *= gl_ViewportIndex; +} diff --git a/core/deps/glslang/Test/spv.430.vert b/core/deps/glslang/Test/spv.430.vert index 82a445738..f52ff4a64 100644 --- a/core/deps/glslang/Test/spv.430.vert +++ b/core/deps/glslang/Test/spv.430.vert @@ -1,37 +1,37 @@ -#version 450 core - - - -out gl_PerVertex { - float gl_ClipDistance[]; -}; - -const float cx = 4.20; -const float dx = 4.20; -in vec4 bad[10]; -highp in vec4 badorder; -out invariant vec4 badorder2; -out flat vec4 badorder3; - -in float f; - -void main() -{ - gl_ClipDistance[2] = 3.7; - - if (bad[0].x == cx.x) - badorder3 = bad[0]; - - gl_ClipDistance[0] = f.x; -} - -layout(binding = 3) uniform boundblock { int aoeu; } boundInst; -layout(binding = 7) uniform anonblock { int aoeu; } ; -layout(binding = 4) uniform sampler2D sampb1; -layout(binding = 5) uniform sampler2D sampb2[10]; -layout(binding = 31) uniform sampler2D sampb4; - -struct S { mediump float a; highp uvec2 b; highp vec3 c; }; -struct SS { vec4 b; S s; vec4 c; }; -layout(location = 0) flat out SS var; -out MS { layout(location = 17) float f; } outMS; +#version 450 core + + + +out gl_PerVertex { + float gl_ClipDistance[]; +}; + +const float cx = 4.20; +const float dx = 4.20; +in vec4 bad[10]; +highp in vec4 badorder; +out invariant vec4 badorder2; +out flat vec4 badorder3; + +in float f; + +void main() +{ + gl_ClipDistance[2] = 3.7; + + if (bad[0].x == cx.x) + badorder3 = bad[0]; + + gl_ClipDistance[0] = f.x; +} + +layout(binding = 3) uniform boundblock { int aoeu; } boundInst; +layout(binding = 7) uniform anonblock { int aoeu; } ; +layout(binding = 4) uniform sampler2D sampb1; +layout(binding = 5) uniform sampler2D sampb2[10]; +layout(binding = 31) uniform sampler2D sampb4; + +struct S { mediump float a; highp uvec2 b; highp vec3 c; }; +struct SS { vec4 b; S s; vec4 c; }; +layout(location = 0) flat out SS var; +out MS { layout(location = 17) float f; } outMS; diff --git a/core/deps/glslang/Test/spv.450.geom b/core/deps/glslang/Test/spv.450.geom index ed26e3368..3489a8881 100644 --- a/core/deps/glslang/Test/spv.450.geom +++ b/core/deps/glslang/Test/spv.450.geom @@ -1,14 +1,14 @@ -#version 450 core - -layout(triangles) in; - -layout(line_strip) out; -layout(max_vertices = 127) out; -layout(invocations = 4) in; - -void main() -{ - gl_PointSize = gl_in[1].gl_PointSize; - gl_Layer = 2; - gl_ViewportIndex = 3; -} +#version 450 core + +layout(triangles) in; + +layout(line_strip) out; +layout(max_vertices = 127) out; +layout(invocations = 4) in; + +void main() +{ + gl_PointSize = gl_in[1].gl_PointSize; + gl_Layer = 2; + gl_ViewportIndex = 3; +} diff --git a/core/deps/glslang/Test/spv.450.noRedecl.tesc b/core/deps/glslang/Test/spv.450.noRedecl.tesc index 288c4861c..85fe94b81 100644 --- a/core/deps/glslang/Test/spv.450.noRedecl.tesc +++ b/core/deps/glslang/Test/spv.450.noRedecl.tesc @@ -1,10 +1,10 @@ -#version 450 core - -layout(vertices = 4) out; - -patch out vec4 patchOut; - -void main() -{ - gl_in[0].gl_PointSize; -} +#version 450 core + +layout(vertices = 4) out; + +patch out vec4 patchOut; + +void main() +{ + gl_in[0].gl_PointSize; +} diff --git a/core/deps/glslang/Test/spv.450.tesc b/core/deps/glslang/Test/spv.450.tesc index 6e551bf33..47b9a4087 100644 --- a/core/deps/glslang/Test/spv.450.tesc +++ b/core/deps/glslang/Test/spv.450.tesc @@ -1,33 +1,33 @@ -#version 450 core - -layout(vertices = 4) out; - -layout(location=1) patch out vec4 patchOut; - -struct S { - float sMem1; // should not see a patch decoration - float sMem2; // should not see a patch decoration -}; - -layout(location = 12) patch out TheBlock { - highp float bMem1; // should not see a location decoration - highp float bMem2; - S s; // should see a patch decoration -} tcBlock[2]; - -void main() -{ +#version 450 core + +layout(vertices = 4) out; + +layout(location=1) patch out vec4 patchOut; + +struct S { + float sMem1; // should not see a patch decoration + float sMem2; // should not see a patch decoration +}; + +layout(location = 12) patch out TheBlock { + highp float bMem1; // should not see a location decoration + highp float bMem2; + S s; // should see a patch decoration +} tcBlock[2]; + +void main() +{ gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position; -} - -layout(location = 2) patch out SingleBlock { - highp float bMem1; // should not see a location decoration - highp float bMem2; - S s; // should see a patch decoration -} singleBlock; - -layout(location = 20) patch out bn { - vec4 v1; // location 20 - layout(location = 24) vec4 v2; // location 24 - vec4 v3; // location 25 +} + +layout(location = 2) patch out SingleBlock { + highp float bMem1; // should not see a location decoration + highp float bMem2; + S s; // should see a patch decoration +} singleBlock; + +layout(location = 20) patch out bn { + vec4 v1; // location 20 + layout(location = 24) vec4 v2; // location 24 + vec4 v3; // location 25 }; \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.460.comp b/core/deps/glslang/Test/spv.460.comp index 90308f25a..eb671a38b 100644 --- a/core/deps/glslang/Test/spv.460.comp +++ b/core/deps/glslang/Test/spv.460.comp @@ -1,9 +1,9 @@ -#version 460 - -void main() -{ - bool b1; - b1 = anyInvocation(b1); - b1 = allInvocations(b1); - b1 = allInvocationsEqual(b1); -} +#version 460 + +void main() +{ + bool b1; + b1 = anyInvocation(b1); + b1 = allInvocations(b1); + b1 = allInvocationsEqual(b1); +} diff --git a/core/deps/glslang/Test/spv.460.frag b/core/deps/glslang/Test/spv.460.frag index 1cd415cdc..9eb8bf46f 100644 --- a/core/deps/glslang/Test/spv.460.frag +++ b/core/deps/glslang/Test/spv.460.frag @@ -1,17 +1,17 @@ -#version 460 core - -layout(binding = 0) uniform atomic_uint aui; -uint ui; - -void main() -{ - atomicCounterAdd(aui, ui); - atomicCounterSubtract(aui, ui); - atomicCounterMin(aui, ui); - atomicCounterMax(aui, ui); - atomicCounterAnd(aui, ui); - atomicCounterOr(aui, ui); - atomicCounterXor(aui, ui); - atomicCounterExchange(aui, ui); - atomicCounterCompSwap(aui, ui, ui); -} +#version 460 core + +layout(binding = 0) uniform atomic_uint aui; +uint ui; + +void main() +{ + atomicCounterAdd(aui, ui); + atomicCounterSubtract(aui, ui); + atomicCounterMin(aui, ui); + atomicCounterMax(aui, ui); + atomicCounterAnd(aui, ui); + atomicCounterOr(aui, ui); + atomicCounterXor(aui, ui); + atomicCounterExchange(aui, ui); + atomicCounterCompSwap(aui, ui, ui); +} diff --git a/core/deps/glslang/Test/spv.460.vert b/core/deps/glslang/Test/spv.460.vert index e87646119..72d4e775f 100644 --- a/core/deps/glslang/Test/spv.460.vert +++ b/core/deps/glslang/Test/spv.460.vert @@ -1,6 +1,6 @@ -#version 460 - -void main() -{ - int a = gl_BaseVertex + gl_BaseInstance + gl_DrawID; -} +#version 460 + +void main() +{ + int a = gl_BaseVertex + gl_BaseInstance + gl_DrawID; +} diff --git a/core/deps/glslang/Test/spv.8bitstorage-int.frag b/core/deps/glslang/Test/spv.8bitstorage-int.frag index c104bfb40..93203c36c 100644 --- a/core/deps/glslang/Test/spv.8bitstorage-int.frag +++ b/core/deps/glslang/Test/spv.8bitstorage-int.frag @@ -1,90 +1,90 @@ -#version 450 core - -#extension GL_EXT_shader_8bit_storage : enable - -struct S -{ - int8_t x; - i8vec2 y; - i8vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - int8_t a; - i8vec2 b; - i8vec3 c; - int8_t d[2]; - S g; - S h[2]; - int j; -} b1; - -layout(row_major, std430) buffer B2 -{ - int8_t o; - i8vec2 p; - i8vec3 q; - int8_t r[2]; - S u; - S v[2]; - i8vec2 x[100]; - int8_t w[]; -} b2; - -layout(row_major, std140) uniform B5 -{ - int8_t o; - i8vec2 p; - i8vec3 q; - int8_t r[2]; - S u; - S v[2]; - i8vec2 x[100]; - int8_t w[100]; -} b5; - -struct S2 { - mat4x4 x; - int8_t y; - int z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; - S3 y; -} b4; - -void main() -{ - b2.o = b1.a; - b2.p = i8vec2(ivec3(b2.q).xy); - b2.p = i8vec2(ivec3(b5.q).xy); - b2.r[0] = b2.r[0]; - b2.r[1] = b5.r[1]; - b2.p = b2.p; - int x0 = int(b1.a); - ivec4 x1 = ivec4(b1.a, b2.p, 1); - b4.x.x = b3.x.x; - b2.o = int8_t(ivec2(b2.p).x); - b2.p = b2.v[1].y; - ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); - ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); - b2.x[0] = b2.x[0]; - b2.x[1] = b5.x[1]; - b2.p.x = b1.a; - b2.o = b2.p.x; - b2.p = i8vec2(ivec2(1, 2)); - b2.o = int8_t(3); -} - +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + int8_t x; + i8vec2 y; + i8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int8_t a; + i8vec2 b; + i8vec3 c; + int8_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int8_t o; + i8vec2 p; + i8vec3 q; + int8_t r[2]; + S u; + S v[2]; + i8vec2 x[100]; + int8_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + int8_t o; + i8vec2 p; + i8vec3 q; + int8_t r[2]; + S u; + S v[2]; + i8vec2 x[100]; + int8_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + int8_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = i8vec2(ivec3(b2.q).xy); + b2.p = i8vec2(ivec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + int x0 = int(b1.a); + ivec4 x1 = ivec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = int8_t(ivec2(b2.p).x); + b2.p = b2.v[1].y; + ivec3 v3 = ivec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + ivec3 u3 = ivec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = i8vec2(ivec2(1, 2)); + b2.o = int8_t(3); +} + diff --git a/core/deps/glslang/Test/spv.8bitstorage-ssbo.vert b/core/deps/glslang/Test/spv.8bitstorage-ssbo.vert index 671b8ae60..61ba7bf15 100644 --- a/core/deps/glslang/Test/spv.8bitstorage-ssbo.vert +++ b/core/deps/glslang/Test/spv.8bitstorage-ssbo.vert @@ -1,15 +1,15 @@ -#version 450 - -#extension GL_EXT_shader_8bit_storage: require - -layout(binding = 0) readonly buffer Vertices -{ - uint8_t vertices[]; -}; - -layout(location = 0) out vec4 color; - -void main() -{ - color = vec4(int(vertices[gl_VertexIndex])); -} +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly buffer Vertices +{ + uint8_t vertices[]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/core/deps/glslang/Test/spv.8bitstorage-ubo.vert b/core/deps/glslang/Test/spv.8bitstorage-ubo.vert index 9e4c4c65f..5c49a2434 100644 --- a/core/deps/glslang/Test/spv.8bitstorage-ubo.vert +++ b/core/deps/glslang/Test/spv.8bitstorage-ubo.vert @@ -1,15 +1,15 @@ -#version 450 - -#extension GL_EXT_shader_8bit_storage: require - -layout(binding = 0) readonly uniform Vertices -{ - uint8_t vertices[512]; -}; - -layout(location = 0) out vec4 color; - -void main() -{ - color = vec4(int(vertices[gl_VertexIndex])); -} +#version 450 + +#extension GL_EXT_shader_8bit_storage: require + +layout(binding = 0) readonly uniform Vertices +{ + uint8_t vertices[512]; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(int(vertices[gl_VertexIndex])); +} diff --git a/core/deps/glslang/Test/spv.8bitstorage-uint.frag b/core/deps/glslang/Test/spv.8bitstorage-uint.frag index 334247ec5..574d088ed 100644 --- a/core/deps/glslang/Test/spv.8bitstorage-uint.frag +++ b/core/deps/glslang/Test/spv.8bitstorage-uint.frag @@ -1,90 +1,90 @@ -#version 450 core - -#extension GL_EXT_shader_8bit_storage : enable - -struct S -{ - uint8_t x; - u8vec2 y; - u8vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - uint8_t a; - u8vec2 b; - u8vec3 c; - uint8_t d[2]; - S g; - S h[2]; - uint j; -} b1; - -layout(row_major, std430) buffer B2 -{ - uint8_t o; - u8vec2 p; - u8vec3 q; - uint8_t r[2]; - S u; - S v[2]; - u8vec2 x[100]; - uint8_t w[]; -} b2; - -layout(row_major, std140) uniform B5 -{ - uint8_t o; - u8vec2 p; - u8vec3 q; - uint8_t r[2]; - S u; - S v[2]; - u8vec2 x[100]; - uint8_t w[100]; -} b5; - -struct S2 { - mat4x4 x; - uint8_t y; - uint z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; - S3 y; -} b4; - -void main() -{ - b2.o = b1.a; - b2.p = u8vec2(uvec3(b2.q).xy); - b2.p = u8vec2(uvec3(b5.q).xy); - b2.r[0] = b2.r[0]; - b2.r[1] = b5.r[1]; - b2.p = b2.p; - uint x0 = uint(b1.a); - uvec4 x1 = uvec4(b1.a, b2.p, 1); - b4.x.x = b3.x.x; - b2.o = uint8_t(uvec2(b2.p).x); - b2.p = b2.v[1].y; - uvec3 v3 = uvec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); - uvec3 u3 = uvec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); - b2.x[0] = b2.x[0]; - b2.x[1] = b5.x[1]; - b2.p.x = b1.a; - b2.o = b2.p.x; - b2.p = u8vec2(uvec2(1, 2)); - b2.o = uint8_t(3u); -} - +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + uint8_t x; + u8vec2 y; + u8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint8_t a; + u8vec2 b; + u8vec3 c; + uint8_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint8_t o; + u8vec2 p; + u8vec3 q; + uint8_t r[2]; + S u; + S v[2]; + u8vec2 x[100]; + uint8_t w[]; +} b2; + +layout(row_major, std140) uniform B5 +{ + uint8_t o; + u8vec2 p; + u8vec3 q; + uint8_t r[2]; + S u; + S v[2]; + u8vec2 x[100]; + uint8_t w[100]; +} b5; + +struct S2 { + mat4x4 x; + uint8_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; + S3 y; +} b4; + +void main() +{ + b2.o = b1.a; + b2.p = u8vec2(uvec3(b2.q).xy); + b2.p = u8vec2(uvec3(b5.q).xy); + b2.r[0] = b2.r[0]; + b2.r[1] = b5.r[1]; + b2.p = b2.p; + uint x0 = uint(b1.a); + uvec4 x1 = uvec4(b1.a, b2.p, 1); + b4.x.x = b3.x.x; + b2.o = uint8_t(uvec2(b2.p).x); + b2.p = b2.v[1].y; + uvec3 v3 = uvec3(b2.w[b1.j], b2.w[b1.j+1], b2.w[b1.j+2]); + uvec3 u3 = uvec3(b5.w[b1.j], b5.w[b1.j+1], b5.w[b1.j+2]); + b2.x[0] = b2.x[0]; + b2.x[1] = b5.x[1]; + b2.p.x = b1.a; + b2.o = b2.p.x; + b2.p = u8vec2(uvec2(1, 2)); + b2.o = uint8_t(3u); +} + diff --git a/core/deps/glslang/Test/spv.8bitstorage_Error-int.frag b/core/deps/glslang/Test/spv.8bitstorage_Error-int.frag index d01fc8493..35fe18267 100644 --- a/core/deps/glslang/Test/spv.8bitstorage_Error-int.frag +++ b/core/deps/glslang/Test/spv.8bitstorage_Error-int.frag @@ -1,101 +1,101 @@ -#version 450 core - -#extension GL_EXT_shader_8bit_storage : enable - -struct S -{ - int8_t x; - i8vec2 y; - i8vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - int8_t a; - i8vec2 b; - i8vec3 c; - int8_t d[2]; - S g; - S h[2]; - int j; -} b1; - -layout(row_major, std430) buffer B2 -{ - int8_t o; - i8vec2 p; - i8vec3 q; - int8_t r[2]; - S u; - S v[2]; - int8_t w[]; -} b2; - -struct S2 { - mat4x4 x; - int8_t y; - int z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; -} b4; - -void func3(S2 x) { -} - -S2 func4() { - return b4.x; -} - -int func(int8_t a) { - return 0; -} - -struct S4 { - int x; - int8_t y; -}; - -int func2(int a) { return 0; } - -void main() -{ - b2.o = b2.q[1]; - b2.p = b2.q.xy; - b2.o = max(b1.a, b1.a); - bvec2 bv = lessThan(b2.p, b2.p); - b2.o = b1.a + b1.a; - b2.o = -b1.a; - b2.o = b1.a + 1; - b2.p = b2.p.yx; - b4.x = b3.x; - int8_t f0; - S2 f1; - S3 f2; - if (b1.a == b1.a) {} - b2.r = b2.r; - b2.p = i8vec2(3, 4); - i8vec2[2](i8vec2(ivec2(1,2)), i8vec2(ivec2(3,4))); - // NOT ERRORING YET - b3.x; - S4(0, int8_t(0)); - func2(b1.a); -} - - -layout(column_major, std140) uniform B6 -{ - i8mat2x3 e; -} b6; - +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + int8_t x; + i8vec2 y; + i8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + int8_t a; + i8vec2 b; + i8vec3 c; + int8_t d[2]; + S g; + S h[2]; + int j; +} b1; + +layout(row_major, std430) buffer B2 +{ + int8_t o; + i8vec2 p; + i8vec3 q; + int8_t r[2]; + S u; + S v[2]; + int8_t w[]; +} b2; + +struct S2 { + mat4x4 x; + int8_t y; + int z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +int func(int8_t a) { + return 0; +} + +struct S4 { + int x; + int8_t y; +}; + +int func2(int a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + int8_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = i8vec2(3, 4); + i8vec2[2](i8vec2(ivec2(1,2)), i8vec2(ivec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0, int8_t(0)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + i8mat2x3 e; +} b6; + diff --git a/core/deps/glslang/Test/spv.8bitstorage_Error-uint.frag b/core/deps/glslang/Test/spv.8bitstorage_Error-uint.frag index a696ff26e..5d0209f0c 100644 --- a/core/deps/glslang/Test/spv.8bitstorage_Error-uint.frag +++ b/core/deps/glslang/Test/spv.8bitstorage_Error-uint.frag @@ -1,101 +1,101 @@ -#version 450 core - -#extension GL_EXT_shader_8bit_storage : enable - -struct S -{ - uint8_t x; - u8vec2 y; - u8vec3 z; -}; - -layout(column_major, std140) uniform B1 -{ - uint8_t a; - u8vec2 b; - u8vec3 c; - uint8_t d[2]; - S g; - S h[2]; - uint j; -} b1; - -layout(row_major, std430) buffer B2 -{ - uint8_t o; - u8vec2 p; - u8vec3 q; - uint8_t r[2]; - S u; - S v[2]; - uint8_t w[]; -} b2; - -struct S2 { - mat4x4 x; - uint8_t y; - uint z; -}; - -struct S3 { - S2 x; -}; - -layout(row_major, std430) buffer B3 -{ - S2 x; -} b3; - -layout(column_major, std430) buffer B4 -{ - S2 x; -} b4; - -void func3(S2 x) { -} - -S2 func4() { - return b4.x; -} - -uint func(uint8_t a) { - return 0; -} - -struct S4 { - uint x; - uint8_t y; -}; - -uint func2(uint a) { return 0; } - -void main() -{ - b2.o = b2.q[1]; - b2.p = b2.q.xy; - b2.o = max(b1.a, b1.a); - bvec2 bv = lessThan(b2.p, b2.p); - b2.o = b1.a + b1.a; - b2.o = -b1.a; - b2.o = b1.a + 1; - b2.p = b2.p.yx; - b4.x = b3.x; - uint8_t f0; - S2 f1; - S3 f2; - if (b1.a == b1.a) {} - b2.r = b2.r; - b2.p = u8vec2(3, 4); - u8vec2[2](u8vec2(uvec2(1,2)), u8vec2(uvec2(3,4))); - // NOT ERRORING YET - b3.x; - S4(0u, uint8_t(0u)); - func2(b1.a); -} - - -layout(column_major, std140) uniform B6 -{ - u8mat2x3 e; -} b6; - +#version 450 core + +#extension GL_EXT_shader_8bit_storage : enable + +struct S +{ + uint8_t x; + u8vec2 y; + u8vec3 z; +}; + +layout(column_major, std140) uniform B1 +{ + uint8_t a; + u8vec2 b; + u8vec3 c; + uint8_t d[2]; + S g; + S h[2]; + uint j; +} b1; + +layout(row_major, std430) buffer B2 +{ + uint8_t o; + u8vec2 p; + u8vec3 q; + uint8_t r[2]; + S u; + S v[2]; + uint8_t w[]; +} b2; + +struct S2 { + mat4x4 x; + uint8_t y; + uint z; +}; + +struct S3 { + S2 x; +}; + +layout(row_major, std430) buffer B3 +{ + S2 x; +} b3; + +layout(column_major, std430) buffer B4 +{ + S2 x; +} b4; + +void func3(S2 x) { +} + +S2 func4() { + return b4.x; +} + +uint func(uint8_t a) { + return 0; +} + +struct S4 { + uint x; + uint8_t y; +}; + +uint func2(uint a) { return 0; } + +void main() +{ + b2.o = b2.q[1]; + b2.p = b2.q.xy; + b2.o = max(b1.a, b1.a); + bvec2 bv = lessThan(b2.p, b2.p); + b2.o = b1.a + b1.a; + b2.o = -b1.a; + b2.o = b1.a + 1; + b2.p = b2.p.yx; + b4.x = b3.x; + uint8_t f0; + S2 f1; + S3 f2; + if (b1.a == b1.a) {} + b2.r = b2.r; + b2.p = u8vec2(3, 4); + u8vec2[2](u8vec2(uvec2(1,2)), u8vec2(uvec2(3,4))); + // NOT ERRORING YET + b3.x; + S4(0u, uint8_t(0u)); + func2(b1.a); +} + + +layout(column_major, std140) uniform B6 +{ + u8mat2x3 e; +} b6; + diff --git a/core/deps/glslang/Test/spv.AofA.frag b/core/deps/glslang/Test/spv.AofA.frag index 562fc98e9..62847100e 100644 --- a/core/deps/glslang/Test/spv.AofA.frag +++ b/core/deps/glslang/Test/spv.AofA.frag @@ -1,43 +1,43 @@ -#version 430 - -in float infloat; -out float outfloat; - -uniform uAofA { - float f[2][4]; -} nameAofA[3][5]; - -float[4][5][6] many[1][2][3]; - -float g4[4][7]; -in float g5[5][7]; - -flat in int i, j, k; - -float[4][7] foo(float a[5][7]) -{ - float r[7]; - r = a[2]; - - return float[4][7](a[0], a[1], r, a[3]); -} - -void main() -{ - outfloat = 0.0; - - g4 = foo(g5); - -// if (foo(g5) == g4) -// ++outfloat; - - float u[][7]; - u[2][2] = 3.0; - float u[5][7]; - - foo(u); - - many[i][j][k][i][j][k] = infloat; - outfloat += many[j][j][j][j][j][j]; - outfloat += nameAofA[1][2].f[0][3]; -} +#version 430 + +in float infloat; +out float outfloat; + +uniform uAofA { + float f[2][4]; +} nameAofA[3][5]; + +float[4][5][6] many[1][2][3]; + +float g4[4][7]; +in float g5[5][7]; + +flat in int i, j, k; + +float[4][7] foo(float a[5][7]) +{ + float r[7]; + r = a[2]; + + return float[4][7](a[0], a[1], r, a[3]); +} + +void main() +{ + outfloat = 0.0; + + g4 = foo(g5); + +// if (foo(g5) == g4) +// ++outfloat; + + float u[][7]; + u[2][2] = 3.0; + float u[5][7]; + + foo(u); + + many[i][j][k][i][j][k] = infloat; + outfloat += many[j][j][j][j][j][j]; + outfloat += nameAofA[1][2].f[0][3]; +} diff --git a/core/deps/glslang/Test/spv.GeometryShaderPassthrough.geom b/core/deps/glslang/Test/spv.GeometryShaderPassthrough.geom index 2fe83ed65..9e6fe4cec 100644 --- a/core/deps/glslang/Test/spv.GeometryShaderPassthrough.geom +++ b/core/deps/glslang/Test/spv.GeometryShaderPassthrough.geom @@ -1,17 +1,17 @@ -#version 450 -#extension GL_NV_geometry_shader_passthrough : require - -layout(triangles) in; - -layout(passthrough) in gl_PerVertex { - vec4 gl_Position; -}; - -layout(passthrough) in Inputs { -vec2 texcoord; -vec4 baseColor; -}; - -void main() -{ +#version 450 +#extension GL_NV_geometry_shader_passthrough : require + +layout(triangles) in; + +layout(passthrough) in gl_PerVertex { + vec4 gl_Position; +}; + +layout(passthrough) in Inputs { +vec2 texcoord; +vec4 baseColor; +}; + +void main() +{ } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.Operations.frag b/core/deps/glslang/Test/spv.Operations.frag index 5e00eb245..3477a79a8 100644 --- a/core/deps/glslang/Test/spv.Operations.frag +++ b/core/deps/glslang/Test/spv.Operations.frag @@ -1,141 +1,149 @@ -#version 450 - -flat in ivec4 uiv4; -in vec4 uv4; -bool ub; -bvec4 ub41, ub42; -in float uf; -flat in int ui; -flat in uvec4 uuv4; -flat in uint uui; - -out vec4 FragColor; - -void main() -{ - vec4 v; - float f; - bool b; - bvec4 bv4; - int i; - uint u; - - // floating point - v = radians(uv4); - v += degrees(v); - v += (i = ui*ui, sin(v)); - v += cos(v); - v += tan(v); - v += asin(v); - v += acos(v); - - v += atan(v); - v += sinh(v); - v += cosh(v); - v += tanh(v); - v += asinh(v); - v += acosh(v); - v += atanh(v); - - v += pow(v, v); - v += exp(v); - v += log(v); - v += exp2(v); - v += log2(v); - v += sqrt(v); - v += inversesqrt(v); - v += abs(v); - v += sign(v); - v += floor(v); - - v += trunc(v); - v += round(v); - v += roundEven(v); - - v += ceil(v); - v += fract(v); - v += mod(v, v); - v += mod(v, v.x); - - v += modf(v, v); - - v += min(v, uv4); - v += max(v, uv4); - v += clamp(v, uv4, uv4); - v += mix(v,v,v); - - v += mix(v,v,ub41); - v += mix(v,v,f); -//spv v += intBitsToFloat(ui); -// v += uintBitsToFloat(uui); -// i += floatBitsToInt(f); -// u += floatBitsToUint(f); - v += fma(v, uv4, v); - - v += step(v,v); - v += smoothstep(v,v,v); - v += step(uf,v); - v += smoothstep(uf,uf,v); - v += normalize(v); - v += faceforward(v, v, v); - v += reflect(v, v); - v += refract(v, v, uf); - v += dFdx(v); - v += dFdy(v); - v += fwidth(v); - - // signed integer - i += abs(ui); - i += sign(i); - i += min(i, ui); - i += max(i, ui); - i += clamp(i, ui, ui); - - // unsigned integer - u += min(u, uui); - u += max(u, uui); - u += clamp(u, uui, uui); - - //// bool - b = isnan(uf); - b = isinf(f); - b = any(lessThan(v, uv4)); - b = (b && any(lessThanEqual(v, uv4))); - b = (b && any(greaterThan(v, uv4))); - b = (b && any(greaterThanEqual(v, uv4))); - b = (b && any(equal(ub41, ub42))); - b = (b && any(notEqual(ub41, ub42))); - b = (b && any(ub41)); - b = (b && all(ub41)); - b = (b && any(not(ub41))); - - i = ((i + ui) * i - ui) / i; - i = i % ui; - if (i == ui || i != ui && i == ui ^^ i != 2) - ++i; - - f = ((uf + uf) * uf - uf) / uf; - - f += length(v); - f += distance(v, v); - f += dot(v, v); - f += dot(f, uf); - f += cross(v.xyz, v.xyz).x; - - if (f == uf || f != uf && f != 2.0) - ++f; - - i &= ui; - i |= 0x42; - i ^= ui; - i %= 17; - i >>= 2; - i <<= ui; - i = ~i; - b = !b; - - FragColor = b ? vec4(i) + vec4(f) + v : v; - - mat4 m1 = mat4(1.0), m2 = mat4(0.0); - FragColor += (b ? m1 : m2)[1]; -} +#version 450 + +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bvec4 ub41, ub42; +in float uf; +flat in int ui; +flat in uvec4 uuv4; +flat in uint uui; + +out vec4 FragColor; + +void main() +{ + vec4 v; + float f; + bool b; + bvec4 bv4; + int i; + uint u; + + // floating point + v = radians(uv4); + v += degrees(v); + v += (i = ui*ui, sin(v)); + v += cos(v); + v += tan(v); + v += asin(v); + v += acos(v); + + v += atan(v); + v += sinh(v); + v += cosh(v); + v += tanh(v); + v += asinh(v); + v += acosh(v); + v += atanh(v); + + v += pow(v, v); + v += exp(v); + v += log(v); + v += exp2(v); + v += log2(v); + v += sqrt(v); + v += inversesqrt(v); + v += abs(v); + v += sign(v); + v += floor(v); + + v += trunc(v); + v += round(v); + v += roundEven(v); + + v += ceil(v); + v += fract(v); + v += mod(v, v); + v += mod(v, v.x); + + v += modf(v, v); + v += modf(v, v.yzxw); + + v += min(v, uv4); + v += max(v, uv4); + v += clamp(v, uv4, uv4); + v += mix(v,v,v); + + v += mix(v,v,ub41); + v += mix(v,v,f); +//spv v += intBitsToFloat(ui); +// v += uintBitsToFloat(uui); +// i += floatBitsToInt(f); +// u += floatBitsToUint(f); + v += fma(v, uv4, v); + + v += step(v,v); + v += smoothstep(v,v,v); + v += step(uf,v); + v += smoothstep(uf,uf,v); + v += normalize(v); + v += faceforward(v, v, v); + v += reflect(v, v); + v += refract(v, v, uf); + v += dFdx(v); + v += dFdy(v); + v += fwidth(v); + + // signed integer + i += abs(ui); + i += sign(i); + i += min(i, ui); + i += max(i, ui); + i += clamp(i, ui, ui); + + // unsigned integer + u += min(u, uui); + u += max(u, uui); + u += clamp(u, uui, uui); + + // multiple out operands + uvec4 msb; + uvec4 lsb; + umulExtended(uuv4.xyz, uuv4.xyz, msb.xyz, lsb.xyz); + u += msb.x + msb.y + msb.z; + u += lsb.x + lsb.y + lsb.z; + + //// bool + b = isnan(uf); + b = isinf(f); + b = any(lessThan(v, uv4)); + b = (b && any(lessThanEqual(v, uv4))); + b = (b && any(greaterThan(v, uv4))); + b = (b && any(greaterThanEqual(v, uv4))); + b = (b && any(equal(ub41, ub42))); + b = (b && any(notEqual(ub41, ub42))); + b = (b && any(ub41)); + b = (b && all(ub41)); + b = (b && any(not(ub41))); + + i = ((i + ui) * i - ui) / i; + i = i % ui; + if (i == ui || i != ui && i == ui ^^ i != 2) + ++i; + + f = ((uf + uf) * uf - uf) / uf; + + f += length(v); + f += distance(v, v); + f += dot(v, v); + f += dot(f, uf); + f += cross(v.xyz, v.xyz).x; + + if (f == uf || f != uf && f != 2.0) + ++f; + + i &= ui; + i |= 0x42; + i ^= ui; + i %= 17; + i >>= 2; + i <<= ui; + i = ~i; + b = !b; + + FragColor = b ? vec4(i) + vec4(f) + v : v; + + mat4 m1 = mat4(1.0), m2 = mat4(0.0); + FragColor += (b ? m1 : m2)[1]; +} diff --git a/core/deps/glslang/Test/spv.RayGenShaderArray.rgen b/core/deps/glslang/Test/spv.RayGenShaderArray.rgen index a1a7f161d..d7434583c 100644 --- a/core/deps/glslang/Test/spv.RayGenShaderArray.rgen +++ b/core/deps/glslang/Test/spv.RayGenShaderArray.rgen @@ -1,8 +1,8 @@ #version 460 #extension GL_NV_ray_tracing : enable -#extension GL_EXT_nonuniform_qualifier : enable +#extension GL_EXT_nonuniform_qualifier : enable layout(binding = 0, set = 0) uniform accelerationStructureNV accNV0[]; -layout(binding = 1, set = 0) uniform accelerationStructureNV accNV1[2]; +layout(binding = 1, set = 0) uniform accelerationStructureNV accNV1[2]; layout(location = 0) rayPayloadNV vec4 payload; layout(shaderRecordNV) buffer block { @@ -17,6 +17,6 @@ void main() uint sx = gl_LaunchSizeNV.x; uint sy = gl_LaunchSizeNV.y; traceNV(accNV0[i], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); - traceNV(accNV1[i], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); - traceNV(accNV0[nonuniformEXT(i)], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); + traceNV(accNV1[i], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); + traceNV(accNV0[nonuniformEXT(i)], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); } diff --git a/core/deps/glslang/Test/spv.accessChain.frag b/core/deps/glslang/Test/spv.accessChain.frag index ba72eca8c..3f4929b65 100644 --- a/core/deps/glslang/Test/spv.accessChain.frag +++ b/core/deps/glslang/Test/spv.accessChain.frag @@ -1,100 +1,100 @@ -#version 420 - -struct S -{ - vec3 color; -}; - -layout(location = 0) out vec3 OutColor; - -flat in int u; - -void GetColor1(const S i) -{ - OutColor += i.color.x; -} - -void GetColor2(const S i, int comp) -{ - OutColor += i.color[comp]; -} - -void GetColor3(const S i, int comp) -{ - OutColor += i.color[comp].x; -} - -void GetColor4(const S i, int comp) -{ - OutColor += i.color[comp].x; -} - -void GetColor5(const S i, int comp) -{ - OutColor += i.color; -} - -void GetColor6(const S i, int comp) -{ - OutColor += i.color.yx[comp]; -} - -void GetColor7(const S i, int comp) -{ - OutColor.xy += i.color.yxz.yx; -} - -void GetColor8(const S i, int comp) -{ - OutColor += i.color.yzx.yx.x.x; -} - -void GetColor9(const S i, int comp) -{ - OutColor.zxy += i.color; -} - -void GetColor10(const S i, int comp) -{ - OutColor.zy += i.color.xy; -} - -void GetColor11(const S i, int comp) -{ - OutColor.zxy.yx += i.color.xy; -} - -void GetColor12(const S i, int comp) -{ - OutColor[comp] += i.color.x; -} - -void GetColor13(const S i, int comp) -{ - OutColor.zy[comp] += i.color.x; -} - -void GetColor14(const S i, int comp) -{ - OutColor.zyx[comp] = i.color.x; -} - -void main() -{ - S s; - OutColor = vec3(0.0); - GetColor1(s); - GetColor2(s, u); - GetColor3(s, u); - GetColor4(s, u); - GetColor5(s, u); - GetColor6(s, u); - GetColor7(s, u); - GetColor8(s, u); - GetColor9(s, u); - GetColor10(s, u); - GetColor11(s, u); - GetColor12(s, u); - GetColor13(s, u); - GetColor14(s, u); -} +#version 420 + +struct S +{ + vec3 color; +}; + +layout(location = 0) out vec3 OutColor; + +flat in int u; + +void GetColor1(const S i) +{ + OutColor += i.color.x; +} + +void GetColor2(const S i, int comp) +{ + OutColor += i.color[comp]; +} + +void GetColor3(const S i, int comp) +{ + OutColor += i.color[comp].x; +} + +void GetColor4(const S i, int comp) +{ + OutColor += i.color[comp].x; +} + +void GetColor5(const S i, int comp) +{ + OutColor += i.color; +} + +void GetColor6(const S i, int comp) +{ + OutColor += i.color.yx[comp]; +} + +void GetColor7(const S i, int comp) +{ + OutColor.xy += i.color.yxz.yx; +} + +void GetColor8(const S i, int comp) +{ + OutColor += i.color.yzx.yx.x.x; +} + +void GetColor9(const S i, int comp) +{ + OutColor.zxy += i.color; +} + +void GetColor10(const S i, int comp) +{ + OutColor.zy += i.color.xy; +} + +void GetColor11(const S i, int comp) +{ + OutColor.zxy.yx += i.color.xy; +} + +void GetColor12(const S i, int comp) +{ + OutColor[comp] += i.color.x; +} + +void GetColor13(const S i, int comp) +{ + OutColor.zy[comp] += i.color.x; +} + +void GetColor14(const S i, int comp) +{ + OutColor.zyx[comp] = i.color.x; +} + +void main() +{ + S s; + OutColor = vec3(0.0); + GetColor1(s); + GetColor2(s, u); + GetColor3(s, u); + GetColor4(s, u); + GetColor5(s, u); + GetColor6(s, u); + GetColor7(s, u); + GetColor8(s, u); + GetColor9(s, u); + GetColor10(s, u); + GetColor11(s, u); + GetColor12(s, u); + GetColor13(s, u); + GetColor14(s, u); +} diff --git a/core/deps/glslang/Test/spv.aggOps.frag b/core/deps/glslang/Test/spv.aggOps.frag index 1a889ffd8..bc34d7acd 100644 --- a/core/deps/glslang/Test/spv.aggOps.frag +++ b/core/deps/glslang/Test/spv.aggOps.frag @@ -1,51 +1,51 @@ -#version 450 - -uniform sampler2D samp2D; -in mediump vec2 coord; - -in vec4 u, w; -out vec4 color; - -struct s1 { - int i; - float f; -}; - -struct s2 { - int i; - float f; - s1 s1_1; -}; - -layout(std140) uniform ub1 { s2 foo2a; } uName1; -layout(std430) buffer ub2 { s2 foo2b; } uName2; - -void main() -{ - vec4 v; - s1 a[3], b[3]; - a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); - b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); - - if (uName1.foo2a == uName2.foo2b) - v = texture(samp2D, coord); - else - v = texture(samp2D, 2.0*coord); - - if (u == v) - v *= 3.0; - - if (u != v) - v *= 4.0; - - if (coord == v.yw) - v *= 5.0; - - if (a == b) - v *= 6.0; - - if (a != b) - v *= 7.0; - - color = v; -} +#version 450 + +uniform sampler2D samp2D; +in mediump vec2 coord; + +in vec4 u, w; +out vec4 color; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +layout(std140) uniform ub1 { s2 foo2a; } uName1; +layout(std430) buffer ub2 { s2 foo2b; } uName2; + +void main() +{ + vec4 v; + s1 a[3], b[3]; + a = s1[3](s1(int(u.x), u.y), s1(int(u.z), u.w), s1(14, 14.0)); + b = s1[3](s1(17, 17.0), s1(int(w.x), w.y), s1(int(w.z), w.w)); + + if (uName1.foo2a == uName2.foo2b) + v = texture(samp2D, coord); + else + v = texture(samp2D, 2.0*coord); + + if (u == v) + v *= 3.0; + + if (u != v) + v *= 4.0; + + if (coord == v.yw) + v *= 5.0; + + if (a == b) + v *= 6.0; + + if (a != b) + v *= 7.0; + + color = v; +} diff --git a/core/deps/glslang/Test/spv.always-discard.frag b/core/deps/glslang/Test/spv.always-discard.frag index 2d7d38950..6cd4d04fc 100644 --- a/core/deps/glslang/Test/spv.always-discard.frag +++ b/core/deps/glslang/Test/spv.always-discard.frag @@ -1,36 +1,36 @@ -#version 140 -in vec2 tex_coord; - -void main (void) -{ - vec4 white = vec4(1.0); - vec4 black = vec4(0.2); - vec4 color = white; - - // First, cut out our circle - float x = tex_coord.x*2.0 - 1.0; - float y = tex_coord.y*2.0 - 1.0; - - float radius = sqrt(x*x + y*y); - if (radius > 1.0) { - if (radius > 1.1) { - ++color; - } - - gl_FragColor = color; - - if (radius > 1.2) { - ++color; - } - - } - - discard; - - // If we're near an edge, darken us a tiny bit - if (radius >= 0.75) - color -= abs(pow(radius, 16.0)/2.0); - - gl_FragColor = color; - -} +#version 140 +in vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + } + + discard; + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/core/deps/glslang/Test/spv.always-discard2.frag b/core/deps/glslang/Test/spv.always-discard2.frag index 3005e48a3..2b125f32d 100644 --- a/core/deps/glslang/Test/spv.always-discard2.frag +++ b/core/deps/glslang/Test/spv.always-discard2.frag @@ -1,19 +1,19 @@ -#version 140 -in vec2 tex_coord; - -void main (void) -{ - vec4 white = vec4(1.0); - vec4 black = vec4(0.2); - vec4 color = white; - - // First, cut out our circle - float x = tex_coord.x*2.0 - 1.0; - float y = tex_coord.y*2.0 - 1.0; - - discard; - - - gl_FragColor = color; - -} +#version 140 +in vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + discard; + + + gl_FragColor = color; + +} diff --git a/core/deps/glslang/Test/spv.arbPostDepthCoverage.frag b/core/deps/glslang/Test/spv.arbPostDepthCoverage.frag index 8530aded3..03b61cb5e 100644 --- a/core/deps/glslang/Test/spv.arbPostDepthCoverage.frag +++ b/core/deps/glslang/Test/spv.arbPostDepthCoverage.frag @@ -1,13 +1,13 @@ -#version 450 - -#extension GL_ARB_post_depth_coverage : enable -#extension GL_EXT_post_depth_coverage : enable //according to ARB_post_depth_coverage, - //if both enabled, this one should be ignored -precision highp int; -layout(post_depth_coverage) in; - -layout (location = 0) out int readSampleMaskIn; - -void main () { - readSampleMaskIn = gl_SampleMaskIn[0]; -} +#version 450 + +#extension GL_ARB_post_depth_coverage : enable +#extension GL_EXT_post_depth_coverage : enable //according to ARB_post_depth_coverage, + //if both enabled, this one should be ignored +precision highp int; +layout(post_depth_coverage) in; + +layout (location = 0) out int readSampleMaskIn; + +void main () { + readSampleMaskIn = gl_SampleMaskIn[0]; +} diff --git a/core/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag b/core/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag index fd379d98f..652933b81 100644 --- a/core/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag +++ b/core/deps/glslang/Test/spv.arbPostDepthCoverage_Error.frag @@ -1,12 +1,12 @@ -#version 310 es - -#extension GL_ARB_post_depth_coverage : enable - -precision highp float; - -layout(post_depth_coverage, location = 0) in float a; // should fail since post_depth_coverage may only - // be declared on in only (not with variable declarations) - -void main () { - -} +#version 310 es + +#extension GL_ARB_post_depth_coverage : enable + +precision highp float; + +layout(post_depth_coverage, location = 0) in float a; // should fail since post_depth_coverage may only + // be declared on in only (not with variable declarations) + +void main () { + +} diff --git a/core/deps/glslang/Test/spv.atomic.comp b/core/deps/glslang/Test/spv.atomic.comp index da7dba37f..8ab846e4f 100644 --- a/core/deps/glslang/Test/spv.atomic.comp +++ b/core/deps/glslang/Test/spv.atomic.comp @@ -1,48 +1,48 @@ -#version 450 - - - -layout(binding = 0) uniform atomic_uint counter; - -layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; -shared uint value; - -int arrX[gl_WorkGroupSize.x]; -int arrY[gl_WorkGroupSize.y]; -int arrZ[gl_WorkGroupSize.z]; - -uint func(atomic_uint c) -{ - return atomicCounterIncrement(c); -} - -void main() -{ - memoryBarrierAtomicCounter(); - func(counter); - uint val = atomicCounter(countArr[2]); - atomicCounterDecrement(counter); - atomicCounterIncrement(counter); -} - -shared int atomi; -shared uint atomu; - -layout (std140, binding = 0) restrict buffer dataSSB -{ - float f; - ivec4 n_frames_rendered; -} result; - -void atoms() -{ - int origi = atomicAdd(atomi, 3); - uint origu = atomicAnd(atomu, value); - origu = atomicOr(atomu, 7u); - origu = atomicXor(atomu, 7u); - origu = atomicMin(atomu, value); - origi = atomicMax(atomi, 7); - origi = atomicExchange(atomi, origi); - origu = atomicCompSwap(atomu, 10u, value); - atomicAdd(result.n_frames_rendered.z, 1); -} +#version 450 + + + +layout(binding = 0) uniform atomic_uint counter; + +layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; +shared uint value; + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +uint func(atomic_uint c) +{ + return atomicCounterIncrement(c); +} + +void main() +{ + memoryBarrierAtomicCounter(); + func(counter); + uint val = atomicCounter(countArr[2]); + atomicCounterDecrement(counter); + atomicCounterIncrement(counter); +} + +shared int atomi; +shared uint atomu; + +layout (std140, binding = 0) restrict buffer dataSSB +{ + float f; + ivec4 n_frames_rendered; +} result; + +void atoms() +{ + int origi = atomicAdd(atomi, 3); + uint origu = atomicAnd(atomu, value); + origu = atomicOr(atomu, 7u); + origu = atomicXor(atomu, 7u); + origu = atomicMin(atomu, value); + origi = atomicMax(atomi, 7); + origi = atomicExchange(atomi, origi); + origu = atomicCompSwap(atomu, 10u, value); + atomicAdd(result.n_frames_rendered.z, 1); +} diff --git a/core/deps/glslang/Test/spv.atomicCounter.comp b/core/deps/glslang/Test/spv.atomicCounter.comp new file mode 100644 index 000000000..ecb230446 --- /dev/null +++ b/core/deps/glslang/Test/spv.atomicCounter.comp @@ -0,0 +1,26 @@ +#version 450 + + + +layout(binding = 0) uniform atomic_uint counter; + +layout(binding = 0, offset = 4) uniform atomic_uint countArr[4]; +shared uint value; + +int arrX[gl_WorkGroupSize.x]; +int arrY[gl_WorkGroupSize.y]; +int arrZ[gl_WorkGroupSize.z]; + +uint func(atomic_uint c) +{ + return atomicCounterIncrement(c); +} + +void main() +{ + memoryBarrierAtomicCounter(); + func(counter); + uint val = atomicCounter(countArr[2]); + atomicCounterDecrement(counter); + atomicCounterIncrement(counter); +} diff --git a/core/deps/glslang/Test/spv.atomicInt64.comp b/core/deps/glslang/Test/spv.atomicInt64.comp index e74688039..baca4cefe 100644 --- a/core/deps/glslang/Test/spv.atomicInt64.comp +++ b/core/deps/glslang/Test/spv.atomicInt64.comp @@ -1,79 +1,79 @@ -#version 450 core - -#extension GL_ARB_gpu_shader_int64: enable -#extension GL_NV_shader_atomic_int64: enable - -layout(local_size_x = 16, local_size_y = 16) in; - -layout(binding = 0) buffer Buffer -{ - int64_t i64; - uint64_t u64; -} buf; - -struct Struct -{ - int64_t i64; - uint64_t u64; -}; - -shared Struct s; - -void main() -{ - const int64_t i64c = -24; - const uint64_t u64c = 0xF00000000Ful; - - // Test shader storage block - int64_t i64 = 0; - uint64_t u64 = 0; - - i64 += atomicMin(buf.i64, i64c); - u64 += atomicMin(buf.u64, u64c); - - i64 += atomicMax(buf.i64, i64c); - u64 += atomicMax(buf.u64, u64c); - - i64 += atomicAnd(buf.i64, i64c); - u64 += atomicAnd(buf.u64, u64c); - - i64 += atomicOr(buf.i64, i64c); - u64 += atomicOr(buf.u64, u64c); - - i64 += atomicXor(buf.i64, i64c); - u64 += atomicXor(buf.u64, u64c); - - i64 += atomicAdd(buf.i64, i64c); - i64 += atomicExchange(buf.i64, i64c); - i64 += atomicCompSwap(buf.i64, i64c, i64); - - buf.i64 = i64; - buf.u64 = u64; - - // Test shared variable - i64 = 0; - u64 = 0; - - i64 += atomicMin(s.i64, i64c); - u64 += atomicMin(s.u64, u64c); - - i64 += atomicMax(s.i64, i64c); - u64 += atomicMax(s.u64, u64c); - - i64 += atomicAnd(s.i64, i64c); - u64 += atomicAnd(s.u64, u64c); - - i64 += atomicOr(s.i64, i64c); - u64 += atomicOr(s.u64, u64c); - - i64 += atomicXor(s.i64, i64c); - u64 += atomicXor(s.u64, u64c); - - i64 += atomicAdd(s.i64, i64c); - i64 += atomicExchange(s.i64, i64c); - i64 += atomicCompSwap(s.i64, i64c, i64); - - s.i64 = i64; - s.u64 = u64; -} - +#version 450 core + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_NV_shader_atomic_int64: enable + +layout(local_size_x = 16, local_size_y = 16) in; + +layout(binding = 0) buffer Buffer +{ + int64_t i64; + uint64_t u64; +} buf; + +struct Struct +{ + int64_t i64; + uint64_t u64; +}; + +shared Struct s; + +void main() +{ + const int64_t i64c = -24; + const uint64_t u64c = 0xF00000000Ful; + + // Test shader storage block + int64_t i64 = 0; + uint64_t u64 = 0; + + i64 += atomicMin(buf.i64, i64c); + u64 += atomicMin(buf.u64, u64c); + + i64 += atomicMax(buf.i64, i64c); + u64 += atomicMax(buf.u64, u64c); + + i64 += atomicAnd(buf.i64, i64c); + u64 += atomicAnd(buf.u64, u64c); + + i64 += atomicOr(buf.i64, i64c); + u64 += atomicOr(buf.u64, u64c); + + i64 += atomicXor(buf.i64, i64c); + u64 += atomicXor(buf.u64, u64c); + + i64 += atomicAdd(buf.i64, i64c); + i64 += atomicExchange(buf.i64, i64c); + i64 += atomicCompSwap(buf.i64, i64c, i64); + + buf.i64 = i64; + buf.u64 = u64; + + // Test shared variable + i64 = 0; + u64 = 0; + + i64 += atomicMin(s.i64, i64c); + u64 += atomicMin(s.u64, u64c); + + i64 += atomicMax(s.i64, i64c); + u64 += atomicMax(s.u64, u64c); + + i64 += atomicAnd(s.i64, i64c); + u64 += atomicAnd(s.u64, u64c); + + i64 += atomicOr(s.i64, i64c); + u64 += atomicOr(s.u64, u64c); + + i64 += atomicXor(s.i64, i64c); + u64 += atomicXor(s.u64, u64c); + + i64 += atomicAdd(s.i64, i64c); + i64 += atomicExchange(s.i64, i64c); + i64 += atomicCompSwap(s.i64, i64c, i64); + + s.i64 = i64; + s.u64 = u64; +} + diff --git a/core/deps/glslang/Test/spv.barrier.vert b/core/deps/glslang/Test/spv.barrier.vert index e2b5cbf02..c7828ce7b 100644 --- a/core/deps/glslang/Test/spv.barrier.vert +++ b/core/deps/glslang/Test/spv.barrier.vert @@ -1,15 +1,15 @@ -#version 450 - -layout(location=0) out vec4 c0; -layout(location=1) out vec4 c1; - -void main() -{ - c0 = vec4(1.0); - memoryBarrier(); - c1 = vec4(1.0); - memoryBarrierBuffer(); - ++c0; - memoryBarrierImage(); - ++c0; +#version 450 + +layout(location=0) out vec4 c0; +layout(location=1) out vec4 c1; + +void main() +{ + c0 = vec4(1.0); + memoryBarrier(); + c1 = vec4(1.0); + memoryBarrierBuffer(); + ++c0; + memoryBarrierImage(); + ++c0; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.bitCast.frag b/core/deps/glslang/Test/spv.bitCast.frag index 8bd1e91e9..73c7e3037 100644 --- a/core/deps/glslang/Test/spv.bitCast.frag +++ b/core/deps/glslang/Test/spv.bitCast.frag @@ -1,45 +1,45 @@ -#version 450 - -flat in int i1; -flat in ivec2 i2; -flat in ivec3 i3; -flat in ivec4 i4; - -flat in uint u1; -flat in uvec2 u2; -flat in uvec3 u3; -flat in uvec4 u4; - -in float f1; -in vec2 f2; -in vec3 f3; -in vec4 f4; - -out vec4 fragColor; - -void main() -{ - ivec4 idata = ivec4(0); - idata.x += floatBitsToInt(f1); - idata.xy += floatBitsToInt(f2); - idata.xyz += floatBitsToInt(f3); - idata += floatBitsToInt(f4); - - uvec4 udata = uvec4(0); - udata.x += floatBitsToUint(f1); - udata.xy += floatBitsToUint(f2); - udata.xyz += floatBitsToUint(f3); - udata += floatBitsToUint(f4); - - vec4 fdata = vec4(0.0); - fdata.x += intBitsToFloat(i1); - fdata.xy += intBitsToFloat(i2); - fdata.xyz += intBitsToFloat(i3); - fdata += intBitsToFloat(i4); - fdata.x += uintBitsToFloat(u1); - fdata.xy += uintBitsToFloat(u2); - fdata.xyz += uintBitsToFloat(u3); - fdata += uintBitsToFloat(u4); - - fragColor = (idata == udata) ? fdata : fdata + vec4(0.2); +#version 450 + +flat in int i1; +flat in ivec2 i2; +flat in ivec3 i3; +flat in ivec4 i4; + +flat in uint u1; +flat in uvec2 u2; +flat in uvec3 u3; +flat in uvec4 u4; + +in float f1; +in vec2 f2; +in vec3 f3; +in vec4 f4; + +out vec4 fragColor; + +void main() +{ + ivec4 idata = ivec4(0); + idata.x += floatBitsToInt(f1); + idata.xy += floatBitsToInt(f2); + idata.xyz += floatBitsToInt(f3); + idata += floatBitsToInt(f4); + + uvec4 udata = uvec4(0); + udata.x += floatBitsToUint(f1); + udata.xy += floatBitsToUint(f2); + udata.xyz += floatBitsToUint(f3); + udata += floatBitsToUint(f4); + + vec4 fdata = vec4(0.0); + fdata.x += intBitsToFloat(i1); + fdata.xy += intBitsToFloat(i2); + fdata.xyz += intBitsToFloat(i3); + fdata += intBitsToFloat(i4); + fdata.x += uintBitsToFloat(u1); + fdata.xy += uintBitsToFloat(u2); + fdata.xyz += uintBitsToFloat(u3); + fdata += uintBitsToFloat(u4); + + fragColor = (idata == udata) ? fdata : fdata + vec4(0.2); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.bool.vert b/core/deps/glslang/Test/spv.bool.vert index cc8a1857b..f58bc55d5 100644 --- a/core/deps/glslang/Test/spv.bool.vert +++ b/core/deps/glslang/Test/spv.bool.vert @@ -1,17 +1,17 @@ -#version 450 - -const bool condition = false; - -uniform ubname { - bool b; -} ubinst; - -bool foo(bool b) -{ - return b != condition; -} - -void main() -{ - gl_Position = foo(ubinst.b) ? vec4(0.0) : vec4(1.0); -} +#version 450 + +const bool condition = false; + +uniform ubname { + bool b; +} ubinst; + +bool foo(bool b) +{ + return b != condition; +} + +void main() +{ + gl_Position = foo(ubinst.b) ? vec4(0.0) : vec4(1.0); +} diff --git a/core/deps/glslang/Test/spv.boolInBlock.frag b/core/deps/glslang/Test/spv.boolInBlock.frag index 71866facf..a4f62fae0 100644 --- a/core/deps/glslang/Test/spv.boolInBlock.frag +++ b/core/deps/glslang/Test/spv.boolInBlock.frag @@ -1,31 +1,31 @@ -#version 450 - -layout(binding = 0, std140) uniform Uniform -{ - bvec4 b4; -}; - -layout(binding = 1, std430) buffer Buffer -{ - bvec2 b2; -}; - -void foo(bvec4 paramb4, out bvec2 paramb2) -{ - bool b1 = paramb4.z; - paramb2 = bvec2(b1); -} - -layout(location = 0) out vec4 fragColor; - -void main() -{ - b2 = bvec2(0.0); - if (b4.z) - b2 = bvec2(b4.x); - if (b2.x) - foo(b4, b2); - - fragColor = vec4(b4.x && b4.y); - fragColor -= vec4(b4.x || b4.y); +#version 450 + +layout(binding = 0, std140) uniform Uniform +{ + bvec4 b4; +}; + +layout(binding = 1, std430) buffer Buffer +{ + bvec2 b2; +}; + +void foo(bvec4 paramb4, out bvec2 paramb2) +{ + bool b1 = paramb4.z; + paramb2 = bvec2(b1); +} + +layout(location = 0) out vec4 fragColor; + +void main() +{ + b2 = bvec2(0.0); + if (b4.z) + b2 = bvec2(b4.x); + if (b2.x) + foo(b4, b2); + + fragColor = vec4(b4.x && b4.y); + fragColor -= vec4(b4.x || b4.y); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.bufferhandle1.frag b/core/deps/glslang/Test/spv.bufferhandle1.frag index 2b54e9fab..14acac197 100644 --- a/core/deps/glslang/Test/spv.bufferhandle1.frag +++ b/core/deps/glslang/Test/spv.bufferhandle1.frag @@ -1,28 +1,28 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable -#pragma use_vulkan_memory_model - -layout(buffer_reference, std430) buffer blockType { - layout(offset = 0) int a; - layout(offset = 4) int b; - layout(offset = 8) int c; - layout(offset = 12) int d; - layout(offset = 16) int e; - layout(offset = 32) int f[2]; - coherent layout(offset = 48) ivec4 g; -}; - -layout(std430) buffer t2 { - blockType f; - blockType g; -} t; - -void main() { - t.f.b = t.g.a; - - blockType j = t.f; - j.d = j.c; - j.d = j.f[1]; - j.d = j.g.y; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable +#pragma use_vulkan_memory_model + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; + layout(offset = 32) int f[2]; + coherent layout(offset = 48) ivec4 g; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +void main() { + t.f.b = t.g.a; + + blockType j = t.f; + j.d = j.c; + j.d = j.f[1]; + j.d = j.g.y; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle10.frag b/core/deps/glslang/Test/spv.bufferhandle10.frag index 744b4d0eb..d72056324 100644 --- a/core/deps/glslang/Test/spv.bufferhandle10.frag +++ b/core/deps/glslang/Test/spv.bufferhandle10.frag @@ -1,25 +1,25 @@ -#version 450 - -#extension GL_ARB_gpu_shader_int64 : enable -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430) buffer blockType { - uint x[]; -}; - -layout(std430) buffer t2 { - blockType f; -} t; - -layout(location = 0) flat in uint i; - -void main() { - - atomicAdd(t.f.x[i], 1); - - coherent blockType b = t.f; - b.x[0] = 2; - - volatile blockType b2 = t.f; - b2.x[0] = 3; -} +#version 450 + +#extension GL_ARB_gpu_shader_int64 : enable +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + uint x[]; +}; + +layout(std430) buffer t2 { + blockType f; +} t; + +layout(location = 0) flat in uint i; + +void main() { + + atomicAdd(t.f.x[i], 1); + + coherent blockType b = t.f; + b.x[0] = 2; + + volatile blockType b2 = t.f; + b2.x[0] = 3; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle11.frag b/core/deps/glslang/Test/spv.bufferhandle11.frag index 9c7640b2f..14d05dcc1 100644 --- a/core/deps/glslang/Test/spv.bufferhandle11.frag +++ b/core/deps/glslang/Test/spv.bufferhandle11.frag @@ -1,26 +1,26 @@ -#version 450 -#extension GL_EXT_shader_16bit_storage : enable -#extension GL_EXT_shader_8bit_storage : enable -#extension GL_EXT_buffer_reference : enable - -layout(std140, binding = 0) buffer AcBlock { highp uint ac_numPassed; }; - -layout(std140, buffer_reference) buffer Block -{ - uint8_t var; -}; -layout (push_constant, std430) uniform PC { - Block block; -}; - -bool compare_uint8_t (highp uint a, highp uint b) { return a == b; } - -void main (void) -{ - bool allOk = true; - allOk = allOk && compare_uint8_t(uint(block.var), 7u); - if (allOk) - ac_numPassed++; - - block.var = uint8_t(9u); +#version 450 +#extension GL_EXT_shader_16bit_storage : enable +#extension GL_EXT_shader_8bit_storage : enable +#extension GL_EXT_buffer_reference : enable + +layout(std140, binding = 0) buffer AcBlock { highp uint ac_numPassed; }; + +layout(std140, buffer_reference) buffer Block +{ + uint8_t var; +}; +layout (push_constant, std430) uniform PC { + Block block; +}; + +bool compare_uint8_t (highp uint a, highp uint b) { return a == b; } + +void main (void) +{ + bool allOk = true; + allOk = allOk && compare_uint8_t(uint(block.var), 7u); + if (allOk) + ac_numPassed++; + + block.var = uint8_t(9u); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.bufferhandle12.frag b/core/deps/glslang/Test/spv.bufferhandle12.frag index a73d23f21..cb7ec6adb 100644 --- a/core/deps/glslang/Test/spv.bufferhandle12.frag +++ b/core/deps/glslang/Test/spv.bufferhandle12.frag @@ -1,42 +1,42 @@ -#version 450 -#extension GL_EXT_shader_16bit_storage : enable -#extension GL_EXT_shader_8bit_storage : enable -#extension GL_EXT_buffer_reference : enable - -layout(std140, binding = 0) buffer AcBlock { highp uint ac_numPassed; }; - -layout(std430, column_major, buffer_reference) buffer BlockB -{ - float16_t a; - highp ivec2 b; -}; -layout(std430, buffer_reference) buffer BlockC -{ - mediump mat2x3 c; -}; -layout(std430, row_major, buffer_reference) buffer BlockD -{ - lowp uvec3 d; -}; -layout (push_constant, std430) uniform PC { - BlockB blockB; - BlockC blockC; - BlockD blockD; -}; - -bool compare_float (highp float a, highp float b) { return abs(a - b) < 0.05; } -bool compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)&&compare_float(a.y, b.y)&&compare_float(a.z, b.z); } -bool compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])&&compare_vec3(a[1], b[1]); } -bool compare_ivec2 (highp ivec2 a, highp ivec2 b) { return a == b; } -bool compare_uvec3 (highp uvec3 a, highp uvec3 b) { return a == b; } -bool compare_float16_t(highp float a, highp float b) { return abs(a - b) < 0.05; } - -void main (void) -{ - bool allOk = true; - allOk = allOk && compare_mat2x3(blockC.c, mat2x3(-5.0, 1.0, -7.0, 1.0, 2.0, 8.0)); - if (allOk) - ac_numPassed++; - - blockD.d = (uvec3(8u, 1u, 5u)); +#version 450 +#extension GL_EXT_shader_16bit_storage : enable +#extension GL_EXT_shader_8bit_storage : enable +#extension GL_EXT_buffer_reference : enable + +layout(std140, binding = 0) buffer AcBlock { highp uint ac_numPassed; }; + +layout(std430, column_major, buffer_reference) buffer BlockB +{ + float16_t a; + highp ivec2 b; +}; +layout(std430, buffer_reference) buffer BlockC +{ + mediump mat2x3 c; +}; +layout(std430, row_major, buffer_reference) buffer BlockD +{ + lowp uvec3 d; +}; +layout (push_constant, std430) uniform PC { + BlockB blockB; + BlockC blockC; + BlockD blockD; +}; + +bool compare_float (highp float a, highp float b) { return abs(a - b) < 0.05; } +bool compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)&&compare_float(a.y, b.y)&&compare_float(a.z, b.z); } +bool compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])&&compare_vec3(a[1], b[1]); } +bool compare_ivec2 (highp ivec2 a, highp ivec2 b) { return a == b; } +bool compare_uvec3 (highp uvec3 a, highp uvec3 b) { return a == b; } +bool compare_float16_t(highp float a, highp float b) { return abs(a - b) < 0.05; } + +void main (void) +{ + bool allOk = true; + allOk = allOk && compare_mat2x3(blockC.c, mat2x3(-5.0, 1.0, -7.0, 1.0, 2.0, 8.0)); + if (allOk) + ac_numPassed++; + + blockD.d = (uvec3(8u, 1u, 5u)); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.bufferhandle13.frag b/core/deps/glslang/Test/spv.bufferhandle13.frag index a3ba93f42..1538d90b4 100644 --- a/core/deps/glslang/Test/spv.bufferhandle13.frag +++ b/core/deps/glslang/Test/spv.bufferhandle13.frag @@ -1,30 +1,30 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { - layout(offset = 0) int j; -}; - -layout(std430) buffer t5 { - t4 m; -} s5; - -t4 f1(const t4 y) { return y; } -t4 f2(t4 y) { return y; } -t4 f3(const restrict t4 y) { return y; } -t4 f4(restrict t4 y) { return y; } - -t4 g1; -restrict t4 g2; - -void main() -{ - t4 a = s5.m; - restrict t4 b = s5.m; - - f1(a); - f2(a); - f3(a); - f4(a); -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; +}; + +layout(std430) buffer t5 { + t4 m; +} s5; + +t4 f1(const t4 y) { return y; } +t4 f2(t4 y) { return y; } +t4 f3(const restrict t4 y) { return y; } +t4 f4(restrict t4 y) { return y; } + +t4 g1; +restrict t4 g2; + +void main() +{ + t4 a = s5.m; + restrict t4 b = s5.m; + + f1(a); + f2(a); + f3(a); + f4(a); +} diff --git a/core/deps/glslang/Test/spv.bufferhandle14.frag b/core/deps/glslang/Test/spv.bufferhandle14.frag index 5746882b5..132af69fc 100644 --- a/core/deps/glslang/Test/spv.bufferhandle14.frag +++ b/core/deps/glslang/Test/spv.bufferhandle14.frag @@ -1,40 +1,40 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430, buffer_reference_align = 4) buffer T1 { - int i; - int j; - int k; -}; - -layout(buffer_reference, std430, buffer_reference_align = 8) buffer T2 { - int i; - int j; - int k; -}; - -layout(buffer_reference, std430) buffer T3 { - int i; - int j; - int k; -}; - -layout(buffer_reference, std430, buffer_reference_align = 32) buffer T4 { - int i; - int j; - int k; -}; - -void main() -{ - T1 t1; - T2 t2; - T3 t3; - T4 t4; - - t1.i = t1.k; - t2.i = t2.k; - t3.i = t3.k; - t4.i = t4.k; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430, buffer_reference_align = 4) buffer T1 { + int i; + int j; + int k; +}; + +layout(buffer_reference, std430, buffer_reference_align = 8) buffer T2 { + int i; + int j; + int k; +}; + +layout(buffer_reference, std430) buffer T3 { + int i; + int j; + int k; +}; + +layout(buffer_reference, std430, buffer_reference_align = 32) buffer T4 { + int i; + int j; + int k; +}; + +void main() +{ + T1 t1; + T2 t2; + T3 t3; + T4 t4; + + t1.i = t1.k; + t2.i = t2.k; + t3.i = t3.k; + t4.i = t4.k; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle15.frag b/core/deps/glslang/Test/spv.bufferhandle15.frag index 6380493ff..ca6459374 100644 --- a/core/deps/glslang/Test/spv.bufferhandle15.frag +++ b/core/deps/glslang/Test/spv.bufferhandle15.frag @@ -1,38 +1,38 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable -#extension GL_EXT_scalar_block_layout : enable - -layout(buffer_reference, scalar) buffer T1 { - vec3 x[]; -}; - -layout(buffer_reference, scalar) buffer T2 { - vec3 x[][4][2]; -}; - -struct S -{ - highp ivec3 a; - mediump mat3 b[4]; - highp vec4 c; -}; - -layout(buffer_reference, scalar) buffer T3 { - S s; -}; -layout(std430) buffer T4 { - T1 t1; - T2 t2; - T3 t3; -} t4; - -layout(location = 0) flat in int i; - -void main() -{ - vec3 y; - y = t4.t1.x[i]; - y = t4.t2.x[i][i][i]; - mat3 z = t4.t3.s.b[0]; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference, scalar) buffer T1 { + vec3 x[]; +}; + +layout(buffer_reference, scalar) buffer T2 { + vec3 x[][4][2]; +}; + +struct S +{ + highp ivec3 a; + mediump mat3 b[4]; + highp vec4 c; +}; + +layout(buffer_reference, scalar) buffer T3 { + S s; +}; +layout(std430) buffer T4 { + T1 t1; + T2 t2; + T3 t3; +} t4; + +layout(location = 0) flat in int i; + +void main() +{ + vec3 y; + y = t4.t1.x[i]; + y = t4.t2.x[i][i][i]; + mat3 z = t4.t3.s.b[0]; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle16.frag b/core/deps/glslang/Test/spv.bufferhandle16.frag index 4c41085e6..168148ccb 100644 --- a/core/deps/glslang/Test/spv.bufferhandle16.frag +++ b/core/deps/glslang/Test/spv.bufferhandle16.frag @@ -1,26 +1,26 @@ -#version 450 - -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable -#extension GL_EXT_buffer_reference : enable -#extension GL_EXT_scalar_block_layout : enable - -layout(buffer_reference) buffer T1 { - int x; - bool y; -}; -layout(buffer_reference) buffer T2 { - int x; -}; - -const int s = int(uint64_t(T1(T2(uint64_t(3))))); -int x[s]; -const uint64_t t = uint64_t(true ? T2(uint64_t(10)) : T2(uint64_t(11))); - -void main() -{ - T1 a = T1(uint64_t(4)), b = T1(uint64_t(5)); - T1 c = true ? a : b; - T1 d = (a,b); - T1 e = true ? T1(uint64_t(6)) : T1(uint64_t(7)); - T1 f = a.y ? T1(uint64_t(8)) : T1(uint64_t(9)); -} +#version 450 + +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable +#extension GL_EXT_buffer_reference : enable +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference) buffer T1 { + int x; + bool y; +}; +layout(buffer_reference) buffer T2 { + int x; +}; + +const int s = int(uint64_t(T1(T2(uint64_t(3))))); +int x[s]; +const uint64_t t = uint64_t(true ? T2(uint64_t(10)) : T2(uint64_t(11))); + +void main() +{ + T1 a = T1(uint64_t(4)), b = T1(uint64_t(5)); + T1 c = true ? a : b; + T1 d = (a,b); + T1 e = true ? T1(uint64_t(6)) : T1(uint64_t(7)); + T1 f = a.y ? T1(uint64_t(8)) : T1(uint64_t(9)); +} diff --git a/core/deps/glslang/Test/spv.bufferhandle17_Errors.frag b/core/deps/glslang/Test/spv.bufferhandle17_Errors.frag index 51a9a8b8d..e9997d58e 100644 --- a/core/deps/glslang/Test/spv.bufferhandle17_Errors.frag +++ b/core/deps/glslang/Test/spv.bufferhandle17_Errors.frag @@ -1,20 +1,20 @@ -#version 450 - -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable -#extension GL_EXT_buffer_reference : enable -#extension GL_EXT_scalar_block_layout : enable - -layout(buffer_reference) buffer T1 { - int x; -}; - -const T1 a = T1(uint64_t(2)); - -void main() -{ - T1 b, c; - const T1 d = b; - - b == c; - b != c; -} +#version 450 + +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable +#extension GL_EXT_buffer_reference : enable +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference) buffer T1 { + int x; +}; + +const T1 a = T1(uint64_t(2)); + +void main() +{ + T1 b, c; + const T1 d = b; + + b == c; + b != c; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle18.frag b/core/deps/glslang/Test/spv.bufferhandle18.frag index a5ea7acad..64517fe15 100644 --- a/core/deps/glslang/Test/spv.bufferhandle18.frag +++ b/core/deps/glslang/Test/spv.bufferhandle18.frag @@ -1,59 +1,59 @@ -#version 450 - -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable -#extension GL_EXT_buffer_reference2 : enable -#extension GL_EXT_scalar_block_layout : enable - -layout(buffer_reference, buffer_reference_align = 8) buffer T1 { - int x; - bool y; -}; -layout(buffer_reference, buffer_reference_align = 64) buffer T2 { - int x; -}; - -const int s = int(uint64_t(T1(T2(uint64_t(3))))); -int x[s]; -const uint64_t t = uint64_t(true ? T2(uint64_t(10)) : T2(uint64_t(11))); - - -#define sizeof(T) (uint64_t(T(uint64_t(0))+1)) - -const uint64_t s2 = sizeof(T1); -uint buf[int(s2)]; - - -void main() -{ - T1 a = T1(uint64_t(4)), b = T1(uint64_t(5)); - T1 c = true ? a : b; - T1 d = (a,b); - T1 e = true ? T1(uint64_t(6)) : T1(uint64_t(7)); - T1 f = a.y ? T1(uint64_t(8)) : T1(uint64_t(9)); - - f[3].x = 1; - (f+5).x = 1; - - T1 arr[2] = {a, f}; - arr[1][7].x = 1; - int i; - arr[i][i].x = 1; - // Since we don't distinguish between "pointer" and "reference" type, - // a reference type can have [] applied to it repeatedly and it has - // the effect of adding up the indices. - arr[i][i][i][i][i][i][i].x = 1; - - T1 j; - j = j+1; - j = j-2; - j += 3; - j -= 4; - j = 5+j; - T1 k = j + 6; - int64_t x = k - j; - uint64_t y = sizeof(T1); - k = k + (-1); - - T2 m; - m = m+1; -} +#version 450 + +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable +#extension GL_EXT_buffer_reference2 : enable +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference, buffer_reference_align = 8) buffer T1 { + int x; + bool y; +}; +layout(buffer_reference, buffer_reference_align = 64) buffer T2 { + int x; +}; + +const int s = int(uint64_t(T1(T2(uint64_t(3))))); +int x[s]; +const uint64_t t = uint64_t(true ? T2(uint64_t(10)) : T2(uint64_t(11))); + + +#define sizeof(T) (uint64_t(T(uint64_t(0))+1)) + +const uint64_t s2 = sizeof(T1); +uint buf[int(s2)]; + + +void main() +{ + T1 a = T1(uint64_t(4)), b = T1(uint64_t(5)); + T1 c = true ? a : b; + T1 d = (a,b); + T1 e = true ? T1(uint64_t(6)) : T1(uint64_t(7)); + T1 f = a.y ? T1(uint64_t(8)) : T1(uint64_t(9)); + + f[3].x = 1; + (f+5).x = 1; + + T1 arr[2] = {a, f}; + arr[1][7].x = 1; + int i; + arr[i][i].x = 1; + // Since we don't distinguish between "pointer" and "reference" type, + // a reference type can have [] applied to it repeatedly and it has + // the effect of adding up the indices. + arr[i][i][i][i][i][i][i].x = 1; + + T1 j; + j = j+1; + j = j-2; + j += 3; + j -= 4; + j = 5+j; + T1 k = j + 6; + int64_t x = k - j; + uint64_t y = sizeof(T1); + k = k + (-1); + + T2 m; + m = m+1; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle19_Errors.frag b/core/deps/glslang/Test/spv.bufferhandle19_Errors.frag index aa9fa86ff..75f53e6e2 100644 --- a/core/deps/glslang/Test/spv.bufferhandle19_Errors.frag +++ b/core/deps/glslang/Test/spv.bufferhandle19_Errors.frag @@ -1,32 +1,32 @@ -#version 450 - -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable -#extension GL_EXT_buffer_reference2 : enable -#extension GL_EXT_scalar_block_layout : enable - -layout(buffer_reference) buffer T1 { - int x[]; -}; - -layout(buffer_reference) buffer T2 { - int x[2]; -}; - -void main() -{ - T1 a; - a+1; - a-1; - 1+a; - a-a; - a+=1; - a-=1; - a+=a; - a-=a; - - T2 b; - b+=b; - b-=b; - b+b; - 1-b; -} +#version 450 + +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable +#extension GL_EXT_buffer_reference2 : enable +#extension GL_EXT_scalar_block_layout : enable + +layout(buffer_reference) buffer T1 { + int x[]; +}; + +layout(buffer_reference) buffer T2 { + int x[2]; +}; + +void main() +{ + T1 a; + a+1; + a-1; + 1+a; + a-a; + a+=1; + a-=1; + a+=a; + a-=a; + + T2 b; + b+=b; + b-=b; + b+b; + 1-b; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle2.frag b/core/deps/glslang/Test/spv.bufferhandle2.frag index 1afe2bd33..497e5509c 100644 --- a/core/deps/glslang/Test/spv.bufferhandle2.frag +++ b/core/deps/glslang/Test/spv.bufferhandle2.frag @@ -1,25 +1,25 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430) buffer blockType { - layout(offset = 0) int a; - layout(offset = 4) int b; - layout(offset = 8) int c; - layout(offset = 12) int d; - layout(offset = 16) int e; -}; - -layout(std430) buffer t2 { - blockType f; - blockType g; -} t; - -void main() { - - blockType b1[2] = blockType[2](t.f, t.g); - b1[0].a = b1[1].b; - blockType b2 = t.f; - blockType b3 = t.g; - b2.a = b3.b; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +void main() { + + blockType b1[2] = blockType[2](t.f, t.g); + b1[0].a = b1[1].b; + blockType b2 = t.f; + blockType b3 = t.g; + b2.a = b3.b; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle3.frag b/core/deps/glslang/Test/spv.bufferhandle3.frag index 7da209f27..6dddf20b1 100644 --- a/core/deps/glslang/Test/spv.bufferhandle3.frag +++ b/core/deps/glslang/Test/spv.bufferhandle3.frag @@ -1,25 +1,25 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430) buffer t3 { - int h; -}; - -layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { - layout(offset = 0) int j; - t3 k; -} x; - -layout(std430) buffer t5 { - t4 m; -} s5; - -flat in t4 k; - -t4 foo(t4 y) { return y; } - -void main() { - foo(s5.m).j = s5.m.k.h; - x.j = k.k.h; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer t3 { + int h; +}; + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; + t3 k; +} x; + +layout(std430) buffer t5 { + t4 m; +} s5; + +flat in t4 k; + +t4 foo(t4 y) { return y; } + +void main() { + foo(s5.m).j = s5.m.k.h; + x.j = k.k.h; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle4.frag b/core/deps/glslang/Test/spv.bufferhandle4.frag index 87846907f..16a02cbfe 100644 --- a/core/deps/glslang/Test/spv.bufferhandle4.frag +++ b/core/deps/glslang/Test/spv.bufferhandle4.frag @@ -1,26 +1,26 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference) buffer t4; - -layout(buffer_reference, std430) buffer t3 { - int h; - t4 i; -}; - -layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { - layout(offset = 0) int j; - t3 k; -} x; - -layout(std430) buffer t5 { - t4 m; -} s5; - -void main() { - x.k.h = s5.m.k.i.k.i.k.h; - - bool b = true; - s5.m = b ? s5.m : s5.m.k.i; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference) buffer t4; + +layout(buffer_reference, std430) buffer t3 { + int h; + t4 i; +}; + +layout(set = 1, binding = 2, buffer_reference, std430) buffer t4 { + layout(offset = 0) int j; + t3 k; +} x; + +layout(std430) buffer t5 { + t4 m; +} s5; + +void main() { + x.k.h = s5.m.k.i.k.i.k.h; + + bool b = true; + s5.m = b ? s5.m : s5.m.k.i; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle5.frag b/core/deps/glslang/Test/spv.bufferhandle5.frag index 372ebaeb7..6ad51881f 100644 --- a/core/deps/glslang/Test/spv.bufferhandle5.frag +++ b/core/deps/glslang/Test/spv.bufferhandle5.frag @@ -1,16 +1,16 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std140) buffer t3 { - int h; -}; - -layout(set = 1, binding = 2, std140) uniform t4 { - layout(offset = 0) int j; - t3 k; -} x; - -void main() { - x.k.h = x.j; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std140) buffer t3 { + int h; +}; + +layout(set = 1, binding = 2, std140) uniform t4 { + layout(offset = 0) int j; + t3 k; +} x; + +void main() { + x.k.h = x.j; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle6.frag b/core/deps/glslang/Test/spv.bufferhandle6.frag index 1beea6e9a..dcc30d005 100644 --- a/core/deps/glslang/Test/spv.bufferhandle6.frag +++ b/core/deps/glslang/Test/spv.bufferhandle6.frag @@ -1,30 +1,30 @@ -#version 450 core - -#extension GL_EXT_buffer_reference : enable -layout (push_constant, std430) uniform Block { int identity[32]; } pc; -layout(r32ui, set = 3, binding = 0) uniform uimage2D image0_0; -layout(buffer_reference) buffer T1; -layout(set = 3, binding = 1, buffer_reference) buffer T1 { - layout(offset = 0) int a[2]; // stride = 4 for std430, 16 for std140 - layout(offset = 32) int b; - layout(offset = 48) T1 c[2]; // stride = 8 for std430, 16 for std140 - layout(offset = 80) T1 d; -} x; -void main() -{ - int accum = 0, temp; - accum |= x.a[0] - 0; - accum |= x.a[pc.identity[1]] - 1; - accum |= x.b - 2; - accum |= x.c[0].a[0] - 3; - accum |= x.c[0].a[pc.identity[1]] - 4; - accum |= x.c[0].b - 5; - accum |= x.c[pc.identity[1]].a[0] - 6; - accum |= x.c[pc.identity[1]].a[pc.identity[1]] - 7; - accum |= x.c[pc.identity[1]].b - 8; - accum |= x.d.a[0] - 9; - accum |= x.d.a[pc.identity[1]] - 10; - accum |= x.d.b - 11; - uvec4 color = (accum != 0) ? uvec4(0,0,0,0) : uvec4(1,0,0,1); - imageStore(image0_0, ivec2(gl_FragCoord.x, gl_FragCoord.y), color); +#version 450 core + +#extension GL_EXT_buffer_reference : enable +layout (push_constant, std430) uniform Block { int identity[32]; } pc; +layout(r32ui, set = 3, binding = 0) uniform uimage2D image0_0; +layout(buffer_reference) buffer T1; +layout(set = 3, binding = 1, buffer_reference) buffer T1 { + layout(offset = 0) int a[2]; // stride = 4 for std430, 16 for std140 + layout(offset = 32) int b; + layout(offset = 48) T1 c[2]; // stride = 8 for std430, 16 for std140 + layout(offset = 80) T1 d; +} x; +void main() +{ + int accum = 0, temp; + accum |= x.a[0] - 0; + accum |= x.a[pc.identity[1]] - 1; + accum |= x.b - 2; + accum |= x.c[0].a[0] - 3; + accum |= x.c[0].a[pc.identity[1]] - 4; + accum |= x.c[0].b - 5; + accum |= x.c[pc.identity[1]].a[0] - 6; + accum |= x.c[pc.identity[1]].a[pc.identity[1]] - 7; + accum |= x.c[pc.identity[1]].b - 8; + accum |= x.d.a[0] - 9; + accum |= x.d.a[pc.identity[1]] - 10; + accum |= x.d.b - 11; + uvec4 color = (accum != 0) ? uvec4(0,0,0,0) : uvec4(1,0,0,1); + imageStore(image0_0, ivec2(gl_FragCoord.x, gl_FragCoord.y), color); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.bufferhandle7.frag b/core/deps/glslang/Test/spv.bufferhandle7.frag index b04169ef5..dbc9b2f17 100644 --- a/core/deps/glslang/Test/spv.bufferhandle7.frag +++ b/core/deps/glslang/Test/spv.bufferhandle7.frag @@ -1,24 +1,24 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430) buffer blockType { - layout(offset = 0) int a; - layout(offset = 4) int b; - layout(offset = 8) int c; - layout(offset = 12) int d; - layout(offset = 16) int e; -}; - -layout(std430, buffer_reference) buffer t2 { - blockType f; - blockType g; -} t; - -layout(std430) buffer t3 { - t2 f; -} u; - -void main() { - t.f = blockType(u.f); -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430, buffer_reference) buffer t2 { + blockType f; + blockType g; +} t; + +layout(std430) buffer t3 { + t2 f; +} u; + +void main() { + t.f = blockType(u.f); +} diff --git a/core/deps/glslang/Test/spv.bufferhandle8.frag b/core/deps/glslang/Test/spv.bufferhandle8.frag index 480a1b359..1bc13c3cf 100644 --- a/core/deps/glslang/Test/spv.bufferhandle8.frag +++ b/core/deps/glslang/Test/spv.bufferhandle8.frag @@ -1,32 +1,32 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430) buffer blockType { - layout(offset = 0) int a; - layout(offset = 4) int b; - layout(offset = 8) int c; - layout(offset = 12) int d; - layout(offset = 16) int e; -}; - -layout(std430) buffer t2 { - blockType f; - blockType g; -} t; - -layout(std430, buffer_reference) buffer T2 { int x; }; -layout(std430, buffer_reference) buffer T1 { int x; }; - -struct Blah { - T1 t1; - T2 t2; -}; - -layout(set=0, binding=0) buffer T3 { - Blah Bindings[]; -} t3; - -void main() { - t3.Bindings[0] = t3.Bindings[1]; -} +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +layout(std430, buffer_reference) buffer T2 { int x; }; +layout(std430, buffer_reference) buffer T1 { int x; }; + +struct Blah { + T1 t1; + T2 t2; +}; + +layout(set=0, binding=0) buffer T3 { + Blah Bindings[]; +} t3; + +void main() { + t3.Bindings[0] = t3.Bindings[1]; +} diff --git a/core/deps/glslang/Test/spv.bufferhandle9.frag b/core/deps/glslang/Test/spv.bufferhandle9.frag index 5d93a3800..7c9f60851 100644 --- a/core/deps/glslang/Test/spv.bufferhandle9.frag +++ b/core/deps/glslang/Test/spv.bufferhandle9.frag @@ -1,30 +1,30 @@ -#version 450 - -#extension GL_ARB_gpu_shader_int64 : enable -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference, std430) buffer blockType { - layout(offset = 0) int a; - layout(offset = 4) int b; - layout(offset = 8) int c; - layout(offset = 12) int d; - layout(offset = 16) int e; -}; - -layout(std430) buffer t2 { - blockType f; - blockType g; -} t; - -flat in uint64_t h, i; - -void main() { - - blockType b1[2] = blockType[2](blockType(h), blockType(i)); - b1[0].a = b1[1].b; - blockType b2 = blockType(h); - blockType b3 = blockType(i); - b2.a = b3.b; - uint64_t j = uint64_t(b2); - b2 = blockType(j+256); -} +#version 450 + +#extension GL_ARB_gpu_shader_int64 : enable +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +flat in uint64_t h, i; + +void main() { + + blockType b1[2] = blockType[2](blockType(h), blockType(i)); + b1[0].a = b1[1].b; + blockType b2 = blockType(h); + blockType b3 = blockType(i); + b2.a = b3.b; + uint64_t j = uint64_t(b2); + b2 = blockType(j+256); +} diff --git a/core/deps/glslang/Test/spv.bufferhandleUvec2.frag b/core/deps/glslang/Test/spv.bufferhandleUvec2.frag index 5545dd7b4..bc86822bb 100644 --- a/core/deps/glslang/Test/spv.bufferhandleUvec2.frag +++ b/core/deps/glslang/Test/spv.bufferhandleUvec2.frag @@ -1,32 +1,32 @@ -#version 450 - -#extension GL_EXT_buffer_reference_uvec2 : enable - -layout(buffer_reference, std430) buffer blockType { - layout(offset = 0) int a; - layout(offset = 4) int b; - layout(offset = 8) int c; - layout(offset = 12) int d; - layout(offset = 16) int e; -}; - -layout(std430) buffer t2 { - blockType f; - blockType g; -} t; - -flat in uvec2 h, i; - -void main() { - - blockType b1[2] = blockType[2](blockType(h), blockType(i)); - b1[0].a = b1[1].b; - blockType b2 = blockType(h); - blockType b3 = blockType(i); - b2.a = b3.b; - uvec2 j = uvec2(b2); - uint carry; - j.x = uaddCarry(j.x, 256, carry); - j.y += carry; - b2 = blockType(j); -} +#version 450 + +#extension GL_EXT_buffer_reference_uvec2 : enable + +layout(buffer_reference, std430) buffer blockType { + layout(offset = 0) int a; + layout(offset = 4) int b; + layout(offset = 8) int c; + layout(offset = 12) int d; + layout(offset = 16) int e; +}; + +layout(std430) buffer t2 { + blockType f; + blockType g; +} t; + +flat in uvec2 h, i; + +void main() { + + blockType b1[2] = blockType[2](blockType(h), blockType(i)); + b1[0].a = b1[1].b; + blockType b2 = blockType(h); + blockType b3 = blockType(i); + b2.a = b3.b; + uvec2 j = uvec2(b2); + uint carry; + j.x = uaddCarry(j.x, 256, carry); + j.y += carry; + b2 = blockType(j); +} diff --git a/core/deps/glslang/Test/spv.bufferhandle_Error.frag b/core/deps/glslang/Test/spv.bufferhandle_Error.frag index b39df13b5..98cbac86c 100644 --- a/core/deps/glslang/Test/spv.bufferhandle_Error.frag +++ b/core/deps/glslang/Test/spv.bufferhandle_Error.frag @@ -1,45 +1,45 @@ -#version 450 - -#extension GL_EXT_buffer_reference : enable - -layout(buffer_reference) buffer bufType1 { int x; }; -layout(buffer_reference) buffer bufType2 { int x; }; -layout(buffer_reference) uniform bufType3 { int x; }; - -layout(buffer_reference) buffer; -layout(buffer_reference) uniform; -layout(buffer_reference) in; -layout(buffer_reference) out; -layout(buffer_reference) in badin { float x; } badin2; -layout(buffer_reference) out badout { float x; } badout2; - -layout(buffer_reference) buffer bufType5; - -layout(buffer_reference) buffer bufType6 { int x[]; }; - -buffer bufType4 { - bufType1 b1; - bufType2 b2; - bufType3 b3; - bufType6 b6; -} b4; - -void f() -{ - bufType6 b; - b.x.length(); - b4.b6.x.length(); -} - -void main() { - bufType2 x1 = b4.b1; - bufType2 x2 = bufType2(b4.b1); - bufType2 x3 = bufType2(b4.b2); - bufType2 x4 = bufType2(b4.b3); - - b4.b1 = b4.b2; - b4.b1 = b4.b3; - b4.b3 = b4.b2; -} - -layout(buffer_reference) uniform bufType5 { int x; }; +#version 450 + +#extension GL_EXT_buffer_reference : enable + +layout(buffer_reference) buffer bufType1 { int x; }; +layout(buffer_reference) buffer bufType2 { int x; }; +layout(buffer_reference) uniform bufType3 { int x; }; + +layout(buffer_reference) buffer; +layout(buffer_reference) uniform; +layout(buffer_reference) in; +layout(buffer_reference) out; +layout(buffer_reference) in badin { float x; } badin2; +layout(buffer_reference) out badout { float x; } badout2; + +layout(buffer_reference) buffer bufType5; + +layout(buffer_reference) buffer bufType6 { int x[]; }; + +buffer bufType4 { + bufType1 b1; + bufType2 b2; + bufType3 b3; + bufType6 b6; +} b4; + +void f() +{ + bufType6 b; + b.x.length(); + b4.b6.x.length(); +} + +void main() { + bufType2 x1 = b4.b1; + bufType2 x2 = bufType2(b4.b1); + bufType2 x3 = bufType2(b4.b2); + bufType2 x4 = bufType2(b4.b3); + + b4.b1 = b4.b2; + b4.b1 = b4.b3; + b4.b3 = b4.b2; +} + +layout(buffer_reference) uniform bufType5 { int x; }; diff --git a/core/deps/glslang/Test/spv.builtInXFB.vert b/core/deps/glslang/Test/spv.builtInXFB.vert index 921982501..619bc1e2f 100644 --- a/core/deps/glslang/Test/spv.builtInXFB.vert +++ b/core/deps/glslang/Test/spv.builtInXFB.vert @@ -1,15 +1,15 @@ -#version 450 - -layout(xfb_buffer = 1, xfb_stride = 64) out; - -layout (xfb_buffer = 1, xfb_offset = 16) out gl_PerVertex -{ - float gl_PointSize; - vec4 gl_Position; -}; - -void main() -{ - gl_Position = vec4(1.0); - gl_PointSize = 2.0; +#version 450 + +layout(xfb_buffer = 1, xfb_stride = 64) out; + +layout (xfb_buffer = 1, xfb_offset = 16) out gl_PerVertex +{ + float gl_PointSize; + vec4 gl_Position; +}; + +void main() +{ + gl_Position = vec4(1.0); + gl_PointSize = 2.0; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.conditionalDemote.frag b/core/deps/glslang/Test/spv.conditionalDemote.frag index df5456aed..1f9b238af 100644 --- a/core/deps/glslang/Test/spv.conditionalDemote.frag +++ b/core/deps/glslang/Test/spv.conditionalDemote.frag @@ -1,18 +1,18 @@ -#version 460 core -#extension GL_EXT_demote_to_helper_invocation : enable - -layout(set = 0, binding = 0) uniform sampler2D tex; -layout(location = 0) in vec2 coord; -layout(location = 0) out vec4 o; - -void main (void) -{ - vec4 v = texture(tex, coord); - - if (v == vec4(0.1,0.2,0.3,0.4)) - demote; - - bool x = helperInvocationEXT(); - - o = v; -} +#version 460 core +#extension GL_EXT_demote_to_helper_invocation : enable + +layout(set = 0, binding = 0) uniform sampler2D tex; +layout(location = 0) in vec2 coord; +layout(location = 0) out vec4 o; + +void main (void) +{ + vec4 v = texture(tex, coord); + + if (v == vec4(0.1,0.2,0.3,0.4)) + demote; + + bool x = helperInvocationEXT(); + + o = v; +} diff --git a/core/deps/glslang/Test/spv.conditionalDiscard.frag b/core/deps/glslang/Test/spv.conditionalDiscard.frag index 7e52e436e..ea803374b 100644 --- a/core/deps/glslang/Test/spv.conditionalDiscard.frag +++ b/core/deps/glslang/Test/spv.conditionalDiscard.frag @@ -1,14 +1,14 @@ -#version 400 - -uniform sampler2D tex; -in vec2 coord; - -void main (void) -{ - vec4 v = texture(tex, coord); - - if (v == vec4(0.1,0.2,0.3,0.4)) - discard; - - gl_FragColor = v; -} +#version 400 + +uniform sampler2D tex; +in vec2 coord; + +void main (void) +{ + vec4 v = texture(tex, coord); + + if (v == vec4(0.1,0.2,0.3,0.4)) + discard; + + gl_FragColor = v; +} diff --git a/core/deps/glslang/Test/spv.constConstruct.vert b/core/deps/glslang/Test/spv.constConstruct.vert index 78d56e146..13d5e3613 100644 --- a/core/deps/glslang/Test/spv.constConstruct.vert +++ b/core/deps/glslang/Test/spv.constConstruct.vert @@ -1,158 +1,158 @@ -#version 450 -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float32 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float64 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int32 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable - -precision highp float; - -void main() -{ - float16_t(float16_t(0x1)); - float16_t(float32_t(0x2)); - float16_t(float64_t(0x3)); - float16_t(int8_t (0x4)); - float16_t(int16_t (0x5)); - float16_t(int32_t (0x6)); - float16_t(int64_t (0x7)); - float16_t(uint8_t (0x8)); - float16_t(uint16_t (0x9)); - float16_t(uint32_t (0xA)); - float16_t(uint64_t (0xB)); - float16_t(bool (0xC)); - float32_t(float16_t(0x11)); - float32_t(float32_t(0x12)); - float32_t(float64_t(0x13)); - float32_t(int8_t (0x14)); - float32_t(int16_t (0x15)); - float32_t(int32_t (0x16)); - float32_t(int64_t (0x17)); - float32_t(uint8_t (0x18)); - float32_t(uint16_t (0x19)); - float32_t(uint32_t (0x1A)); - float32_t(uint64_t (0x1B)); - float32_t(bool (0x1C)); - float64_t(float16_t(0x21)); - float64_t(float32_t(0x22)); - float64_t(float64_t(0x23)); - float64_t(int8_t (0x24)); - float64_t(int16_t (0x25)); - float64_t(int32_t (0x26)); - float64_t(int64_t (0x27)); - float64_t(uint8_t (0x28)); - float64_t(uint16_t (0x29)); - float64_t(uint32_t (0x2A)); - float64_t(uint64_t (0x2B)); - float64_t(bool (0x2C)); - int8_t(float16_t(0x31)); - int8_t(float32_t(0x32)); - int8_t(float64_t(0x33)); - int8_t(int8_t (0x34)); - int8_t(int16_t (0x35)); - int8_t(int32_t (0x36)); - int8_t(int64_t (0x37)); - int8_t(uint8_t (0x38)); - int8_t(uint16_t (0x39)); - int8_t(uint32_t (0x3A)); - int8_t(uint64_t (0x3B)); - int8_t(bool (0x3C)); - int16_t(float16_t(0x41)); - int16_t(float32_t(0x42)); - int16_t(float64_t(0x43)); - int16_t(int8_t (0x44)); - int16_t(int16_t (0x45)); - int16_t(int32_t (0x46)); - int16_t(int64_t (0x47)); - int16_t(uint8_t (0x48)); - int16_t(uint16_t (0x49)); - int16_t(uint32_t (0x4A)); - int16_t(uint64_t (0x4B)); - int16_t(bool (0x4C)); - int32_t(float16_t(0x51)); - int32_t(float32_t(0x52)); - int32_t(float64_t(0x53)); - int32_t(int8_t (0x54)); - int32_t(int16_t (0x55)); - int32_t(int32_t (0x56)); - int32_t(int64_t (0x57)); - int32_t(uint8_t (0x58)); - int32_t(uint16_t (0x59)); - int32_t(uint32_t (0x5A)); - int32_t(uint64_t (0x5B)); - int32_t(bool (0x5C)); - int64_t(float16_t(0x61)); - int64_t(float32_t(0x62)); - int64_t(float64_t(0x63)); - int64_t(int8_t (0x64)); - int64_t(int16_t (0x65)); - int64_t(int32_t (0x66)); - int64_t(int64_t (0x67)); - int64_t(uint8_t (0x68)); - int64_t(uint16_t (0x69)); - int64_t(uint32_t (0x6A)); - int64_t(uint64_t (0x6B)); - int64_t(bool (0x6C)); - uint8_t(float16_t(0x71)); - uint8_t(float32_t(0x72)); - uint8_t(float64_t(0x73)); - uint8_t(int8_t (0x74)); - uint8_t(int16_t (0x75)); - uint8_t(int32_t (0x76)); - uint8_t(int64_t (0x77)); - uint8_t(uint8_t (0x78)); - uint8_t(uint16_t (0x79)); - uint8_t(uint32_t (0x7A)); - uint8_t(uint64_t (0x7B)); - uint8_t(bool (0x7C)); - uint16_t(float16_t(0x81)); - uint16_t(float32_t(0x82)); - uint16_t(float64_t(0x83)); - uint16_t(int8_t (0x84)); - uint16_t(int16_t (0x85)); - uint16_t(int32_t (0x86)); - uint16_t(int64_t (0x87)); - uint16_t(uint8_t (0x88)); - uint16_t(uint16_t (0x89)); - uint16_t(uint32_t (0x8A)); - uint16_t(uint64_t (0x8B)); - uint16_t(bool (0x8C)); - uint32_t(float16_t(0x91)); - uint32_t(float32_t(0x92)); - uint32_t(float64_t(0x93)); - uint32_t(int8_t (0x94)); - uint32_t(int16_t (0x95)); - uint32_t(int32_t (0x96)); - uint32_t(int64_t (0x97)); - uint32_t(uint8_t (0x98)); - uint32_t(uint16_t (0x99)); - uint32_t(uint32_t (0x9A)); - uint32_t(uint64_t (0x9B)); - uint32_t(bool (0x9C)); - uint64_t(float16_t(0xA1)); - uint64_t(float32_t(0xA2)); - uint64_t(float64_t(0xA3)); - uint64_t(int8_t (0xA4)); - uint64_t(int16_t (0xA5)); - uint64_t(int32_t (0xA6)); - uint64_t(int64_t (0xA7)); - uint64_t(uint8_t (0xA8)); - uint64_t(uint16_t (0xA9)); - uint64_t(uint32_t (0xAA)); - uint64_t(uint64_t (0xAB)); - uint64_t(bool (0xAC)); - bool(float16_t(0xB1)); - bool(float32_t(0xB2)); - bool(float64_t(0xB3)); - bool(int8_t (0xB4)); - bool(int16_t (0xB5)); - bool(int32_t (0xB6)); - bool(int64_t (0xB7)); - bool(uint8_t (0xB8)); - bool(uint16_t (0xB9)); - bool(uint32_t (0xBA)); - bool(uint64_t (0xBB)); - bool(bool (0xBC)); -} +#version 450 +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float32 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float64 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int32 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable + +precision highp float; + +void main() +{ + float16_t(float16_t(0x1)); + float16_t(float32_t(0x2)); + float16_t(float64_t(0x3)); + float16_t(int8_t (0x4)); + float16_t(int16_t (0x5)); + float16_t(int32_t (0x6)); + float16_t(int64_t (0x7)); + float16_t(uint8_t (0x8)); + float16_t(uint16_t (0x9)); + float16_t(uint32_t (0xA)); + float16_t(uint64_t (0xB)); + float16_t(bool (0xC)); + float32_t(float16_t(0x11)); + float32_t(float32_t(0x12)); + float32_t(float64_t(0x13)); + float32_t(int8_t (0x14)); + float32_t(int16_t (0x15)); + float32_t(int32_t (0x16)); + float32_t(int64_t (0x17)); + float32_t(uint8_t (0x18)); + float32_t(uint16_t (0x19)); + float32_t(uint32_t (0x1A)); + float32_t(uint64_t (0x1B)); + float32_t(bool (0x1C)); + float64_t(float16_t(0x21)); + float64_t(float32_t(0x22)); + float64_t(float64_t(0x23)); + float64_t(int8_t (0x24)); + float64_t(int16_t (0x25)); + float64_t(int32_t (0x26)); + float64_t(int64_t (0x27)); + float64_t(uint8_t (0x28)); + float64_t(uint16_t (0x29)); + float64_t(uint32_t (0x2A)); + float64_t(uint64_t (0x2B)); + float64_t(bool (0x2C)); + int8_t(float16_t(0x31)); + int8_t(float32_t(0x32)); + int8_t(float64_t(0x33)); + int8_t(int8_t (0x34)); + int8_t(int16_t (0x35)); + int8_t(int32_t (0x36)); + int8_t(int64_t (0x37)); + int8_t(uint8_t (0x38)); + int8_t(uint16_t (0x39)); + int8_t(uint32_t (0x3A)); + int8_t(uint64_t (0x3B)); + int8_t(bool (0x3C)); + int16_t(float16_t(0x41)); + int16_t(float32_t(0x42)); + int16_t(float64_t(0x43)); + int16_t(int8_t (0x44)); + int16_t(int16_t (0x45)); + int16_t(int32_t (0x46)); + int16_t(int64_t (0x47)); + int16_t(uint8_t (0x48)); + int16_t(uint16_t (0x49)); + int16_t(uint32_t (0x4A)); + int16_t(uint64_t (0x4B)); + int16_t(bool (0x4C)); + int32_t(float16_t(0x51)); + int32_t(float32_t(0x52)); + int32_t(float64_t(0x53)); + int32_t(int8_t (0x54)); + int32_t(int16_t (0x55)); + int32_t(int32_t (0x56)); + int32_t(int64_t (0x57)); + int32_t(uint8_t (0x58)); + int32_t(uint16_t (0x59)); + int32_t(uint32_t (0x5A)); + int32_t(uint64_t (0x5B)); + int32_t(bool (0x5C)); + int64_t(float16_t(0x61)); + int64_t(float32_t(0x62)); + int64_t(float64_t(0x63)); + int64_t(int8_t (0x64)); + int64_t(int16_t (0x65)); + int64_t(int32_t (0x66)); + int64_t(int64_t (0x67)); + int64_t(uint8_t (0x68)); + int64_t(uint16_t (0x69)); + int64_t(uint32_t (0x6A)); + int64_t(uint64_t (0x6B)); + int64_t(bool (0x6C)); + uint8_t(float16_t(0x71)); + uint8_t(float32_t(0x72)); + uint8_t(float64_t(0x73)); + uint8_t(int8_t (0x74)); + uint8_t(int16_t (0x75)); + uint8_t(int32_t (0x76)); + uint8_t(int64_t (0x77)); + uint8_t(uint8_t (0x78)); + uint8_t(uint16_t (0x79)); + uint8_t(uint32_t (0x7A)); + uint8_t(uint64_t (0x7B)); + uint8_t(bool (0x7C)); + uint16_t(float16_t(0x81)); + uint16_t(float32_t(0x82)); + uint16_t(float64_t(0x83)); + uint16_t(int8_t (0x84)); + uint16_t(int16_t (0x85)); + uint16_t(int32_t (0x86)); + uint16_t(int64_t (0x87)); + uint16_t(uint8_t (0x88)); + uint16_t(uint16_t (0x89)); + uint16_t(uint32_t (0x8A)); + uint16_t(uint64_t (0x8B)); + uint16_t(bool (0x8C)); + uint32_t(float16_t(0x91)); + uint32_t(float32_t(0x92)); + uint32_t(float64_t(0x93)); + uint32_t(int8_t (0x94)); + uint32_t(int16_t (0x95)); + uint32_t(int32_t (0x96)); + uint32_t(int64_t (0x97)); + uint32_t(uint8_t (0x98)); + uint32_t(uint16_t (0x99)); + uint32_t(uint32_t (0x9A)); + uint32_t(uint64_t (0x9B)); + uint32_t(bool (0x9C)); + uint64_t(float16_t(0xA1)); + uint64_t(float32_t(0xA2)); + uint64_t(float64_t(0xA3)); + uint64_t(int8_t (0xA4)); + uint64_t(int16_t (0xA5)); + uint64_t(int32_t (0xA6)); + uint64_t(int64_t (0xA7)); + uint64_t(uint8_t (0xA8)); + uint64_t(uint16_t (0xA9)); + uint64_t(uint32_t (0xAA)); + uint64_t(uint64_t (0xAB)); + uint64_t(bool (0xAC)); + bool(float16_t(0xB1)); + bool(float32_t(0xB2)); + bool(float64_t(0xB3)); + bool(int8_t (0xB4)); + bool(int16_t (0xB5)); + bool(int32_t (0xB6)); + bool(int64_t (0xB7)); + bool(uint8_t (0xB8)); + bool(uint16_t (0xB9)); + bool(uint32_t (0xBA)); + bool(uint64_t (0xBB)); + bool(bool (0xBC)); +} diff --git a/core/deps/glslang/Test/spv.constStruct.vert b/core/deps/glslang/Test/spv.constStruct.vert index 0cc25beaa..d5dd8da97 100644 --- a/core/deps/glslang/Test/spv.constStruct.vert +++ b/core/deps/glslang/Test/spv.constStruct.vert @@ -1,22 +1,22 @@ -#version 450 - -precision highp float; - -struct U { - mat2 m; -}; - -struct T { - mat2 m; -}; - -struct S { - T t; - U u; -}; - -void main() -{ - S s1 = S(T(mat2(1.0)), U(mat2(1.0))); - S s2 = S(T(mat2(1.0)), U(mat2(1.0))); -} +#version 450 + +precision highp float; + +struct U { + mat2 m; +}; + +struct T { + mat2 m; +}; + +struct S { + T t; + U u; +}; + +void main() +{ + S s1 = S(T(mat2(1.0)), U(mat2(1.0))); + S s2 = S(T(mat2(1.0)), U(mat2(1.0))); +} diff --git a/core/deps/glslang/Test/spv.constructComposite.comp b/core/deps/glslang/Test/spv.constructComposite.comp index 5f79a197c..7f1c37076 100644 --- a/core/deps/glslang/Test/spv.constructComposite.comp +++ b/core/deps/glslang/Test/spv.constructComposite.comp @@ -1,25 +1,25 @@ -#version 460 core - -layout(local_size_x=64) in; - -struct sA { - int x, y; -}; - -struct sB { - sA a; -}; - -layout(binding=0,set=0) uniform ubo { - sB b; -}; - -struct sC { - sA state; -} c = { - b.a, -}; - -void main() -{ -} +#version 460 core + +layout(local_size_x=64) in; + +struct sA { + int x, y; +}; + +struct sB { + sA a; +}; + +layout(binding=0,set=0) uniform ubo { + sB b; +}; + +struct sC { + sA state; +} c = { + b.a, +}; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.conversion.frag b/core/deps/glslang/Test/spv.conversion.frag index 1a1327976..3b5e5123f 100644 --- a/core/deps/glslang/Test/spv.conversion.frag +++ b/core/deps/glslang/Test/spv.conversion.frag @@ -1,112 +1,112 @@ -#version 140 - -bool u_b; -bvec2 u_b2; -bvec3 u_b3; -bvec4 u_b4; - -int u_i; -ivec2 u_i2; -ivec3 u_i3; -ivec4 u_i4; - -float u_f; -vec2 u_f2; -vec3 u_f3; -vec4 u_f4; - -bool i_b; -bvec2 i_b2; -bvec3 i_b3; -bvec4 i_b4; - -flat in int i_i; -flat in ivec2 i_i2; -flat in ivec3 i_i3; -flat in ivec4 i_i4; - -in float i_f; -in vec2 i_f2; -in vec3 i_f3; -in vec4 i_f4; - -void main() -{ - bool b = bool(u_i) ^^ bool(u_f); - bvec2 b2 = bvec2(u_i, u_f); - bvec3 b3 = bvec3(u_i, u_f, i_i); - bvec4 b4 = bvec4(u_i, u_f, i_i, i_f); - - int i = int(u_f) + int(b); - ivec2 i2 = ivec2(u_f2) + ivec2(b2); - ivec3 i3 = ivec3(u_f3) + ivec3(b3); - ivec4 i4 = ivec4(u_f4) + ivec4(b4); - - float f = i; - vec2 f2 = i2; - vec3 f3 = i3; - vec4 f4 = i4; - - f += (float(i) + float(b)); - f2 -= vec2(i2) + vec2(b2); - f3 /= vec3(i3) + vec3(b3); - f4 += vec4(i4) + vec4(b4); - - f4 += vec4(bvec4(i_i4)); - f4 += vec4(bvec4(u_f4)); - - f += f - i; - f2 += vec2(f, i) + i2; - f3 += i3 + vec3(f, i, f); - f4 += vec4(b, i, f, i) + i4; - - f2 += vec2(f, i) * i; - f3 += vec3(f, i, f) + i; - f4 += i - vec4(b, i, f, i); - - i2 += ivec2(f, i); - i3 += ivec3(f, i, f); - i4 += ivec4(b, i, f, i); - - if (f < i || i < f || - f2 == i2 || - i3 != f3) - f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y); - - gl_FragColor = - b || - b2.x || - b2.y || - b3.x || - b3.y || - b3.z || - b4.x || - b4.y || - b4.z || - b4.w ? vec4( - i + - i2.x + - i2.y + - i3.x + - i3.y + - i3.z + - i4.x + - i4.y + - i4.z + - i4.w + - f + - f2.x + - f2.y + - f3.x + - f3.y + - f3.z + - f4.x + - f4.y + - f4.z + - f4.w) : vec4(1.0); - - // with constants... - ivec4 cv2 = ivec4(1.0); - bvec4 cv5 = bvec4(cv2); - gl_FragColor += float(cv5); -} +#version 140 + +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; + +int u_i; +ivec2 u_i2; +ivec3 u_i3; +ivec4 u_i4; + +float u_f; +vec2 u_f2; +vec3 u_f3; +vec4 u_f4; + +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = bool(u_i) ^^ bool(u_f); + bvec2 b2 = bvec2(u_i, u_f); + bvec3 b3 = bvec3(u_i, u_f, i_i); + bvec4 b4 = bvec4(u_i, u_f, i_i, i_f); + + int i = int(u_f) + int(b); + ivec2 i2 = ivec2(u_f2) + ivec2(b2); + ivec3 i3 = ivec3(u_f3) + ivec3(b3); + ivec4 i4 = ivec4(u_f4) + ivec4(b4); + + float f = i; + vec2 f2 = i2; + vec3 f3 = i3; + vec4 f4 = i4; + + f += (float(i) + float(b)); + f2 -= vec2(i2) + vec2(b2); + f3 /= vec3(i3) + vec3(b3); + f4 += vec4(i4) + vec4(b4); + + f4 += vec4(bvec4(i_i4)); + f4 += vec4(bvec4(u_f4)); + + f += f - i; + f2 += vec2(f, i) + i2; + f3 += i3 + vec3(f, i, f); + f4 += vec4(b, i, f, i) + i4; + + f2 += vec2(f, i) * i; + f3 += vec3(f, i, f) + i; + f4 += i - vec4(b, i, f, i); + + i2 += ivec2(f, i); + i3 += ivec3(f, i, f); + i4 += ivec4(b, i, f, i); + + if (f < i || i < f || + f2 == i2 || + i3 != f3) + f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y); + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); + + // with constants... + ivec4 cv2 = ivec4(1.0); + bvec4 cv5 = bvec4(cv2); + gl_FragColor += float(cv5); +} diff --git a/core/deps/glslang/Test/spv.coopmat.comp b/core/deps/glslang/Test/spv.coopmat.comp index fdecc39f9..ab4292fe7 100644 --- a/core/deps/glslang/Test/spv.coopmat.comp +++ b/core/deps/glslang/Test/spv.coopmat.comp @@ -1,115 +1,115 @@ #version 450 core -#extension GL_KHR_memory_scope_semantics : enable -#extension GL_NV_cooperative_matrix : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable -#extension GL_EXT_buffer_reference : enable - +#extension GL_KHR_memory_scope_semantics : enable +#extension GL_NV_cooperative_matrix : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable +#extension GL_EXT_buffer_reference : enable + layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; - -const int X = 8; -layout(constant_id = 0) const int Y = 2; -const int Z = X*Y; - -fcoopmatNV<16, gl_ScopeSubgroup, Z, 8> mC; -fcoopmatNV<16, gl_ScopeSubgroup, Z, 8> mC2[3]; - -int arr[mC.length()]; -int arr2[mC2[1].length()]; - -layout(constant_id = 1) const float F = 3.0; - -const fcoopmatNV<32, gl_ScopeSubgroup, Z, 8> mD = fcoopmatNV<32, gl_ScopeSubgroup, Z, 8>(0.0); -const fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> mD2 = fcoopmatNV<16, gl_ScopeSubgroup, 8, 8>(1); - -struct S { int a; int b; int c; }; - -const S s = S(12, 23, 34); - -layout(set = 0, binding = 0, buffer_reference) coherent buffer Block { - float y[1024*1024]; - float x[]; -} block; - -layout(set = 0, binding = 0) coherent buffer Block16 { - float16_t y[1024*1024]; - float16_t x[]; - - Block b; -} block16; - -fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> f16(fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> m) { return -m; } -fcoopmatNV<32, gl_ScopeSubgroup, 8, 8> f32(fcoopmatNV<32, gl_ScopeSubgroup, 8, 8> m) { return -m; } - -layout(constant_id = 2) const int SC = 1; -fcoopmatNV<16, gl_ScopeSubgroup, SC, SC> scm[SC][SC]; - -// sized for fcoopmatNV<16, gl_ScopeSubgroup, 16, 16> -shared uvec4 shmatrix[16*16*2/16]; - + +const int X = 8; +layout(constant_id = 0) const int Y = 2; +const int Z = X*Y; + +fcoopmatNV<16, gl_ScopeSubgroup, Z, 8> mC; +fcoopmatNV<16, gl_ScopeSubgroup, Z, 8> mC2[3]; + +int arr[mC.length()]; +int arr2[mC2[1].length()]; + +layout(constant_id = 1) const float F = 3.0; + +const fcoopmatNV<32, gl_ScopeSubgroup, Z, 8> mD = fcoopmatNV<32, gl_ScopeSubgroup, Z, 8>(0.0); +const fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> mD2 = fcoopmatNV<16, gl_ScopeSubgroup, 8, 8>(1); + +struct S { int a; int b; int c; }; + +const S s = S(12, 23, 34); + +layout(set = 0, binding = 0, buffer_reference) coherent buffer Block { + float y[1024*1024]; + float x[]; +} block; + +layout(set = 0, binding = 0) coherent buffer Block16 { + float16_t y[1024*1024]; + float16_t x[]; + + Block b; +} block16; + +fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> f16(fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> m) { return -m; } +fcoopmatNV<32, gl_ScopeSubgroup, 8, 8> f32(fcoopmatNV<32, gl_ScopeSubgroup, 8, 8> m) { return -m; } + +layout(constant_id = 2) const int SC = 1; +fcoopmatNV<16, gl_ScopeSubgroup, SC, SC> scm[SC][SC]; + +// sized for fcoopmatNV<16, gl_ScopeSubgroup, 16, 16> +shared uvec4 shmatrix[16*16*2/16]; + void main() { - fcoopmatNV<32, gl_ScopeSubgroup, 16, (2>1?8:4)> m = fcoopmatNV<32, gl_ScopeSubgroup, 16, (2>1?8:4)>(0.0); - - m = m + m; - m = m - m; - m = -m; - m = 2.0*m; - m = m*2.0; - - fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> m2 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(m); - - float x = m[1]; - m[0] = x; - - coopMatLoadNV(m, block.x, 16, 128, false); - coopMatStoreNV(m, block.x, 16, 128, false); - coopMatLoadNV(m2, block16.x, 16, 128, false); - coopMatStoreNV(m2, block16.x, 16, 128, false); - coopMatLoadNV(m, block16.b.x, 16, 128, false); - coopMatStoreNV(m, block16.b.x, 16, 128, false); - - fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> A; - fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> B; - fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> C; - fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> D; - D = coopMatMulAddNV(A, B, C); - - int l = D.length(); - - fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> E; - - fcoopmatNV<16, gl_ScopeSubgroup, Z, Z> F = fcoopmatNV<16, gl_ScopeSubgroup, Z, Z>(0.0); - - fcoopmatNV<32, gl_ScopeSubgroup, 16, (2>1?8:4)> a[5]; - a[3][0] = 1.0; - - float md1 = mD[1]; - - md1 += (m += m)[1234]; - - mC2[1] = mC2[2]; - - coopMatLoadNV(m, block.y, 16, 128, false); - coopMatStoreNV(m, block.y, 16, 128, false); - coopMatLoadNV(m2, block16.y, 16, 128, false); - coopMatStoreNV(m2, block16.y, 16, 128, false); - - fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> p1; - fcoopmatNV<32, gl_ScopeSubgroup, 8, 8> p2; - - p1 = f16(p1); - p2 = f32(p2); - - p1 = fcoopmatNV<16, gl_ScopeSubgroup, 8, 8>(0.0); - p2 = fcoopmatNV<32, gl_ScopeSubgroup, 8, 8>(0.0); - - p1 /= p1; - - p1 *= float16_t(2.0); - p2 *= 4.0; - - fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> ms; - coopMatLoadNV(ms, shmatrix, 1, 2, false); - coopMatStoreNV(ms, shmatrix, 1, 2, false); - + fcoopmatNV<32, gl_ScopeSubgroup, 16, (2>1?8:4)> m = fcoopmatNV<32, gl_ScopeSubgroup, 16, (2>1?8:4)>(0.0); + + m = m + m; + m = m - m; + m = -m; + m = 2.0*m; + m = m*2.0; + + fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> m2 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(m); + + float x = m[1]; + m[0] = x; + + coopMatLoadNV(m, block.x, 16, 128, false); + coopMatStoreNV(m, block.x, 16, 128, false); + coopMatLoadNV(m2, block16.x, 16, 128, false); + coopMatStoreNV(m2, block16.x, 16, 128, false); + coopMatLoadNV(m, block16.b.x, 16, 128, false); + coopMatStoreNV(m, block16.b.x, 16, 128, false); + + fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> A; + fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> B; + fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> C; + fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> D; + D = coopMatMulAddNV(A, B, C); + + int l = D.length(); + + fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> E; + + fcoopmatNV<16, gl_ScopeSubgroup, Z, Z> F = fcoopmatNV<16, gl_ScopeSubgroup, Z, Z>(0.0); + + fcoopmatNV<32, gl_ScopeSubgroup, 16, (2>1?8:4)> a[5]; + a[3][0] = 1.0; + + float md1 = mD[1]; + + md1 += (m += m)[1234]; + + mC2[1] = mC2[2]; + + coopMatLoadNV(m, block.y, 16, 128, false); + coopMatStoreNV(m, block.y, 16, 128, false); + coopMatLoadNV(m2, block16.y, 16, 128, false); + coopMatStoreNV(m2, block16.y, 16, 128, false); + + fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> p1; + fcoopmatNV<32, gl_ScopeSubgroup, 8, 8> p2; + + p1 = f16(p1); + p2 = f32(p2); + + p1 = fcoopmatNV<16, gl_ScopeSubgroup, 8, 8>(0.0); + p2 = fcoopmatNV<32, gl_ScopeSubgroup, 8, 8>(0.0); + + p1 /= p1; + + p1 *= float16_t(2.0); + p2 *= 4.0; + + fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> ms; + coopMatLoadNV(ms, shmatrix, 1, 2, false); + coopMatStoreNV(ms, shmatrix, 1, 2, false); + } diff --git a/core/deps/glslang/Test/spv.coopmat_Error.comp b/core/deps/glslang/Test/spv.coopmat_Error.comp index 32fccf5ca..220aa980c 100644 --- a/core/deps/glslang/Test/spv.coopmat_Error.comp +++ b/core/deps/glslang/Test/spv.coopmat_Error.comp @@ -1,76 +1,76 @@ #version 450 core -#extension GL_KHR_memory_scope_semantics : enable -#extension GL_NV_cooperative_matrix : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable - +#extension GL_KHR_memory_scope_semantics : enable +#extension GL_NV_cooperative_matrix : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable + layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; - -float<16> ftemplate16; - -fcoopmatNV fnoparams; - -fcoopmatNV<8, gl_ScopeSubgroup, 8, 8> fbadbits; - -fcoopmatNV<16, gl_ScopeSubgroup, 8> fbadnumparams; - -int X = 8; - -fcoopmatNV<16, gl_ScopeSubgroup, 8, X> fbadparam; - -layout(constant_id = 0) int Y = 1; - -shared fcoopmatNV<16, gl_ScopeSubgroup, 16, 16> sharedmat; - -layout(set = 0, binding = 0) buffer InvBlock { - fcoopmatNV<16, gl_ScopeSubgroup, 16, 16> bufmat; -} invblock; - + +float<16> ftemplate16; + +fcoopmatNV fnoparams; + +fcoopmatNV<8, gl_ScopeSubgroup, 8, 8> fbadbits; + +fcoopmatNV<16, gl_ScopeSubgroup, 8> fbadnumparams; + +int X = 8; + +fcoopmatNV<16, gl_ScopeSubgroup, 8, X> fbadparam; + +layout(constant_id = 0) int Y = 1; + +shared fcoopmatNV<16, gl_ScopeSubgroup, 16, 16> sharedmat; + +layout(set = 0, binding = 0) buffer InvBlock { + fcoopmatNV<16, gl_ScopeSubgroup, 16, 16> bufmat; +} invblock; + void main() -{ - fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> f32_16_8; - fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> f16_16_8; - - // invalid implicit conversions - f32_16_8 = f16_16_8; - f32_16_8 = f16_16_8 + f16_16_8; - - fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> f16_8_8; - - // mismatching dimensions - f16_16_8 = f16_8_8; - - fcoopmatNV<16, gl_ScopeSubgroup, 8, Y> f16_8_Y; - fcoopmatNV<16, gl_ScopeSubgroup, 8, (Y+1)> f16_8_Y1; - - // mismatching dimensions with specialization constants - f16_8_Y = f16_8_Y1; - - // wrong arguments for constructor - f16_8_8 = fcoopmatNV<16, gl_ScopeSubgroup, 8, 8>(1, 1); - - // can't construct from a builtin type - mat4 m4; - fcoopmatNV<32, gl_ScopeSubgroup, 4, 4> f32_4_4 = fcoopmatNV<32, gl_ScopeSubgroup, 4, 4>(m4); - - // only support a single array subscript - f16_16_8[0][0]; - - // don't support scalar component selection - f16_16_8.x; - - f16_16_8 * f16_16_8; - - f16_16_8 + 1.0; - f16_16_8 - 1.0; - f16_16_8 / 1.0; - f16_16_8 += 1.0; - f16_16_8 -= 1.0; - f16_16_8 /= 1.0; - - f16_16_8*2.0; - 2.0*f16_16_8; - f32_16_8*float16_t(2.0); - float16_t(2.0)*f32_16_8; - - transpose(f16_8_8); +{ + fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> f32_16_8; + fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> f16_16_8; + + // invalid implicit conversions + f32_16_8 = f16_16_8; + f32_16_8 = f16_16_8 + f16_16_8; + + fcoopmatNV<16, gl_ScopeSubgroup, 8, 8> f16_8_8; + + // mismatching dimensions + f16_16_8 = f16_8_8; + + fcoopmatNV<16, gl_ScopeSubgroup, 8, Y> f16_8_Y; + fcoopmatNV<16, gl_ScopeSubgroup, 8, (Y+1)> f16_8_Y1; + + // mismatching dimensions with specialization constants + f16_8_Y = f16_8_Y1; + + // wrong arguments for constructor + f16_8_8 = fcoopmatNV<16, gl_ScopeSubgroup, 8, 8>(1, 1); + + // can't construct from a builtin type + mat4 m4; + fcoopmatNV<32, gl_ScopeSubgroup, 4, 4> f32_4_4 = fcoopmatNV<32, gl_ScopeSubgroup, 4, 4>(m4); + + // only support a single array subscript + f16_16_8[0][0]; + + // don't support scalar component selection + f16_16_8.x; + + f16_16_8 * f16_16_8; + + f16_16_8 + 1.0; + f16_16_8 - 1.0; + f16_16_8 / 1.0; + f16_16_8 += 1.0; + f16_16_8 -= 1.0; + f16_16_8 /= 1.0; + + f16_16_8*2.0; + 2.0*f16_16_8; + f32_16_8*float16_t(2.0); + float16_t(2.0)*f32_16_8; + + transpose(f16_8_8); } diff --git a/core/deps/glslang/Test/spv.dataOut.frag b/core/deps/glslang/Test/spv.dataOut.frag index 7f4208afb..94c6db062 100644 --- a/core/deps/glslang/Test/spv.dataOut.frag +++ b/core/deps/glslang/Test/spv.dataOut.frag @@ -1,8 +1,8 @@ -#version 140 - -in vec4 Color; - -void main() -{ - gl_FragData[1] = Color; -} +#version 140 + +in vec4 Color; + +void main() +{ + gl_FragData[1] = Color; +} diff --git a/core/deps/glslang/Test/spv.dataOutIndirect.frag b/core/deps/glslang/Test/spv.dataOutIndirect.frag index 1d8795f57..88a32d582 100644 --- a/core/deps/glslang/Test/spv.dataOutIndirect.frag +++ b/core/deps/glslang/Test/spv.dataOutIndirect.frag @@ -1,12 +1,12 @@ -#version 140 - -in vec4 Color; - -out vec4 fcolor[4]; - -uniform b { int i; } bName; - -void main() -{ - fcolor[bName.i] = Color; -} +#version 140 + +in vec4 Color; + +out vec4 fcolor[4]; + +uniform b { int i; } bName; + +void main() +{ + fcolor[bName.i] = Color; +} diff --git a/core/deps/glslang/Test/spv.dataOutIndirect.vert b/core/deps/glslang/Test/spv.dataOutIndirect.vert index 8606d9f3d..cb6b7e0d7 100644 --- a/core/deps/glslang/Test/spv.dataOutIndirect.vert +++ b/core/deps/glslang/Test/spv.dataOutIndirect.vert @@ -1,12 +1,12 @@ -#version 140 - -attribute vec4 color; -out vec4 colorOut[6]; - -void main() -{ - for (int i = 1; i < 5; ++i) - colorOut[i] = color; - - gl_Position = colorOut[2]; -} +#version 140 + +attribute vec4 color; +out vec4 colorOut[6]; + +void main() +{ + for (int i = 1; i < 5; ++i) + colorOut[i] = color; + + gl_Position = colorOut[2]; +} diff --git a/core/deps/glslang/Test/spv.debugInfo.frag b/core/deps/glslang/Test/spv.debugInfo.frag index 5f596edf5..3b6cd27fe 100644 --- a/core/deps/glslang/Test/spv.debugInfo.frag +++ b/core/deps/glslang/Test/spv.debugInfo.frag @@ -1,52 +1,52 @@ -#version 450 - -struct S { - int a; -}; - -uniform ubuf { - S s; -}; - -uniform sampler2D s2d; - -layout(location = 0) in vec4 inv; -layout(location = 0) out vec4 outv; - -vec4 foo(S s) -{ - vec4 r = s.a * inv; - ++r; - if (r.x > 3.0) - --r; - else - r *= 2; - - return r; -} - -void main() -{ - outv = foo(s); - outv += texture(s2d, vec2(0.5)); - - switch (s.a) { - case 10: - ++outv; - break; - case 20: - outv = 2 * outv; - ++outv; - break; - default: - --outv; - break; - } - - for (int i = 0; i < 10; ++i) - outv *= 3.0; - - outv.x < 10.0 ? - outv = sin(outv) : - outv = cos(outv); +#version 450 + +struct S { + int a; +}; + +uniform ubuf { + S s; +}; + +uniform sampler2D s2d; + +layout(location = 0) in vec4 inv; +layout(location = 0) out vec4 outv; + +vec4 foo(S s) +{ + vec4 r = s.a * inv; + ++r; + if (r.x > 3.0) + --r; + else + r *= 2; + + return r; +} + +void main() +{ + outv = foo(s); + outv += texture(s2d, vec2(0.5)); + + switch (s.a) { + case 10: + ++outv; + break; + case 20: + outv = 2 * outv; + ++outv; + break; + default: + --outv; + break; + } + + for (int i = 0; i < 10; ++i) + outv *= 3.0; + + outv.x < 10.0 ? + outv = sin(outv) : + outv = cos(outv); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.debugPrintf.frag b/core/deps/glslang/Test/spv.debugPrintf.frag new file mode 100644 index 000000000..3dff62989 --- /dev/null +++ b/core/deps/glslang/Test/spv.debugPrintf.frag @@ -0,0 +1,13 @@ +#version 450 +#extension GL_EXT_debug_printf : enable + +void main() +{ + debugPrintfEXT("ASDF \\ \? \x5C %d %d %d", 1, 2, 3); + + // ABA{backspace}Z + debugPrintfEXT("\x41\x000042\x41\x8Z"); + + // B#${bell, aka \a}B1Z + debugPrintfEXT("\102\043\44\7\1021Z"); +} diff --git a/core/deps/glslang/Test/spv.debugPrintf_Error.frag b/core/deps/glslang/Test/spv.debugPrintf_Error.frag new file mode 100644 index 000000000..c1980a7fe --- /dev/null +++ b/core/deps/glslang/Test/spv.debugPrintf_Error.frag @@ -0,0 +1,11 @@ +#version 450 +#extension GL_EXT_debug_printf : enable + +void main() +{ + // invalid hex sequence + debugPrintfEXT("\xZ"); + + // not an octal sequence + debugPrintfEXT("\8"); +} diff --git a/core/deps/glslang/Test/spv.deepRvalue.frag b/core/deps/glslang/Test/spv.deepRvalue.frag index 49c348ec4..2c88ca8ad 100644 --- a/core/deps/glslang/Test/spv.deepRvalue.frag +++ b/core/deps/glslang/Test/spv.deepRvalue.frag @@ -1,36 +1,36 @@ -#version 330 - -uniform sampler2D samp2D; - -vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); -vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); -vec4 v3 = vec4(23.0, 29.0, 31.0, 37.0); -vec4 v4 = vec4(41.0, 43.0, 47.0, 53.0); - -struct str { - int a; - vec2 b[3]; - bool c; -}; - -void main() -{ - mat4 m = mat4(v1, v2, v3, v4); - - mat4 mm = matrixCompMult(m, m); - float f = mm[1].w; // should be 19 * 19 = 361 - - // do a deep access to a spontaneous r-value - float g = matrixCompMult(m, m)[2].y; // should be 29 * 29 = 841 - - float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 - - float i = texture(samp2D, vec2(0.5,0.5)).y; - - i += (i > 0.1 ? v1 : v2)[3]; - - str t; - i += (t = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true)).b[2].y; // should be 7.0 - - gl_FragColor = vec4(f, g, h, i); -} +#version 330 + +uniform sampler2D samp2D; + +vec4 v1 = vec4(2.0, 3.0, 5.0, 7.0); +vec4 v2 = vec4(11.0, 13.0, 17.0, 19.0); +vec4 v3 = vec4(23.0, 29.0, 31.0, 37.0); +vec4 v4 = vec4(41.0, 43.0, 47.0, 53.0); + +struct str { + int a; + vec2 b[3]; + bool c; +}; + +void main() +{ + mat4 m = mat4(v1, v2, v3, v4); + + mat4 mm = matrixCompMult(m, m); + float f = mm[1].w; // should be 19 * 19 = 361 + + // do a deep access to a spontaneous r-value + float g = matrixCompMult(m, m)[2].y; // should be 29 * 29 = 841 + + float h = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true).b[1][1]; // should be 5.0 + + float i = texture(samp2D, vec2(0.5,0.5)).y; + + i += (i > 0.1 ? v1 : v2)[3]; + + str t; + i += (t = str(1, vec2[3](vec2(2.0, 3.0), vec2(4.0, 5.0), vec2(6.0, 7.0)), true)).b[2].y; // should be 7.0 + + gl_FragColor = vec4(f, g, h, i); +} diff --git a/core/deps/glslang/Test/spv.demoteDisabled.frag b/core/deps/glslang/Test/spv.demoteDisabled.frag index c2d07437d..fca702d69 100644 --- a/core/deps/glslang/Test/spv.demoteDisabled.frag +++ b/core/deps/glslang/Test/spv.demoteDisabled.frag @@ -1,10 +1,10 @@ -#version 460 core - -void main (void) -{ - { - int demote = 0; - demote; - } - demote; -} +#version 460 core + +void main (void) +{ + { + int demote = 0; + demote; + } + demote; +} diff --git a/core/deps/glslang/Test/spv.depthOut.frag b/core/deps/glslang/Test/spv.depthOut.frag index d90fc0f8c..feb8a0d4f 100644 --- a/core/deps/glslang/Test/spv.depthOut.frag +++ b/core/deps/glslang/Test/spv.depthOut.frag @@ -1,11 +1,11 @@ -#version 450 - -in vec4 Color; -in float Depth; - -layout(depth_greater) out float gl_FragDepth; - -void main() -{ - gl_FragDepth = Depth; -} +#version 450 + +in vec4 Color; +in float Depth; + +layout(depth_greater) out float gl_FragDepth; + +void main() +{ + gl_FragDepth = Depth; +} diff --git a/core/deps/glslang/Test/spv.discard-dce.frag b/core/deps/glslang/Test/spv.discard-dce.frag index b4a708d50..e824f76ed 100644 --- a/core/deps/glslang/Test/spv.discard-dce.frag +++ b/core/deps/glslang/Test/spv.discard-dce.frag @@ -1,35 +1,35 @@ -#version 140 -in vec2 tex_coord; - -void main (void) -{ - vec4 white = vec4(1.0); - vec4 black = vec4(0.2); - vec4 color = white; - - // First, cut out our circle - float x = tex_coord.x*2.0 - 1.0; - float y = tex_coord.y*2.0 - 1.0; - - float radius = sqrt(x*x + y*y); - if (radius > 1.0) { - if (radius > 1.1) { - ++color; - } - - gl_FragColor = color; - - if (radius > 1.2) { - ++color; - } - - discard; - } - - // If we're near an edge, darken us a tiny bit - if (radius >= 0.75) - color -= abs(pow(radius, 16.0)/2.0); - - gl_FragColor = color; - -} +#version 140 +in vec2 tex_coord; + +void main (void) +{ + vec4 white = vec4(1.0); + vec4 black = vec4(0.2); + vec4 color = white; + + // First, cut out our circle + float x = tex_coord.x*2.0 - 1.0; + float y = tex_coord.y*2.0 - 1.0; + + float radius = sqrt(x*x + y*y); + if (radius > 1.0) { + if (radius > 1.1) { + ++color; + } + + gl_FragColor = color; + + if (radius > 1.2) { + ++color; + } + + discard; + } + + // If we're near an edge, darken us a tiny bit + if (radius >= 0.75) + color -= abs(pow(radius, 16.0)/2.0); + + gl_FragColor = color; + +} diff --git a/core/deps/glslang/Test/spv.doWhileLoop.frag b/core/deps/glslang/Test/spv.doWhileLoop.frag index 685fe419c..5abdb61be 100644 --- a/core/deps/glslang/Test/spv.doWhileLoop.frag +++ b/core/deps/glslang/Test/spv.doWhileLoop.frag @@ -1,16 +1,16 @@ -#version 140 - -in vec4 bigColor; -in vec4 BaseColor; -in float d; - -void main() -{ - vec4 color = BaseColor; - - do { - color += bigColor; - } while (color.x < d); - - gl_FragColor = color; -} +#version 140 + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +void main() +{ + vec4 color = BaseColor; + + do { + color += bigColor; + } while (color.x < d); + + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/spv.double.comp b/core/deps/glslang/Test/spv.double.comp index 51434cab0..6397e6305 100644 --- a/core/deps/glslang/Test/spv.double.comp +++ b/core/deps/glslang/Test/spv.double.comp @@ -1,25 +1,25 @@ -#version 430 - -const double d1 = 3.1415926535897932384626433832795LF; -const double d2 = 3.1415; -const double d3 = 3.1415926535897932384626433832795LF; -const double d4 = 3.1415926535897932384626433832795; - -buffer bufName { - float f; - double d; -} bufInst; - - -uniform writeonly image2D destTex; - -void main() -{ - bufInst.d = float(d1); - bufInst.f = float(d1 + d2 + d3 + d4); - - ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); - double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0); - dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4); - double globalCoef = 1.0; -} +#version 430 + +const double d1 = 3.1415926535897932384626433832795LF; +const double d2 = 3.1415; +const double d3 = 3.1415926535897932384626433832795LF; +const double d4 = 3.1415926535897932384626433832795; + +buffer bufName { + float f; + double d; +} bufInst; + + +uniform writeonly image2D destTex; + +void main() +{ + bufInst.d = float(d1); + bufInst.f = float(d1 + d2 + d3 + d4); + + ivec2 storePos = ivec2(gl_GlobalInvocationID.xy); + double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0); + dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4); + double globalCoef = 1.0; +} diff --git a/core/deps/glslang/Test/spv.earlyReturnDiscard.frag b/core/deps/glslang/Test/spv.earlyReturnDiscard.frag index 43e4666c5..bba4b76d2 100644 --- a/core/deps/glslang/Test/spv.earlyReturnDiscard.frag +++ b/core/deps/glslang/Test/spv.earlyReturnDiscard.frag @@ -1,102 +1,102 @@ -#version 140 - -in float d; -in vec4 bigColor, smallColor; -in vec4 otherColor; - -in float c; - -in float threshhold; -in float threshhold2; -in float threshhold3; - -in float minimum; - -in vec4 BaseColor; - -bool b; - -void main() -{ - vec4 color = BaseColor; - vec4 color2; - - color2 = otherColor; - - if (c > d) - color += bigColor; - else - color += smallColor; - - if (color.z < minimum) - return; - - color.z++; - - if (color.z > threshhold) - discard; - - color++; - - // Two path, different rest - if (color.w > threshhold2) { - if (color.z > threshhold2) - return; - else if (b) - color.z++; - else { - if (color.x < minimum) { - discard; - } else { - color++; - } - } - } else { - if (b) - discard; - else - return; - } - - - // // Two path, shared rest - // if (color.w > threshhold2) { - // if (color.z > threshhold2) - // return; - // else if (b) - // color++; - // else { - // if (color.x < minimum) { - // discard; - // } else { - // color++; - // } - // } - // } else { - // if (b) - // discard; - // else - // return; - // } - - - // // One path - // if (color.w > threshhold2) { - // if (color.z > threshhold2) - // return; - // else { - // if (color.x < minimum) { - // discard; - // } else { - // color++; - // } - // } - // } else { - // if (b) - // discard; - // else - // return; - // } - - gl_FragColor = color * color2; -} +#version 140 + +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; + +in float c; + +in float threshhold; +in float threshhold2; +in float threshhold3; + +in float minimum; + +in vec4 BaseColor; + +bool b; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + if (color.z < minimum) + return; + + color.z++; + + if (color.z > threshhold) + discard; + + color++; + + // Two path, different rest + if (color.w > threshhold2) { + if (color.z > threshhold2) + return; + else if (b) + color.z++; + else { + if (color.x < minimum) { + discard; + } else { + color++; + } + } + } else { + if (b) + discard; + else + return; + } + + + // // Two path, shared rest + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else if (b) + // color++; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + + // // One path + // if (color.w > threshhold2) { + // if (color.z > threshhold2) + // return; + // else { + // if (color.x < minimum) { + // discard; + // } else { + // color++; + // } + // } + // } else { + // if (b) + // discard; + // else + // return; + // } + + gl_FragColor = color * color2; +} diff --git a/core/deps/glslang/Test/spv.ext.AnyHitShader.rahit b/core/deps/glslang/Test/spv.ext.AnyHitShader.rahit new file mode 100644 index 000000000..ee7d9c7a4 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.AnyHitShader.rahit @@ -0,0 +1,29 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +layout(location = 1) rayPayloadInEXT vec4 incomingPayload; +void main() +{ + uvec3 v0 = gl_LaunchIDEXT; + uvec3 v1 = gl_LaunchSizeEXT; + int v2 = gl_PrimitiveID; + int v3 = gl_InstanceID; + int v4 = gl_InstanceCustomIndexEXT; + vec3 v5 = gl_WorldRayOriginEXT; + vec3 v6 = gl_WorldRayDirectionEXT; + vec3 v7 = gl_ObjectRayOriginEXT; + vec3 v8 = gl_ObjectRayDirectionEXT; + float v9 = gl_RayTminEXT; + float v10 = gl_RayTmaxEXT; + float v11 = gl_HitTEXT; + uint v12 = gl_HitKindEXT; + mat4x3 v13 = gl_ObjectToWorldEXT; + mat4x3 v14 = gl_WorldToObjectEXT; + int v15 = gl_GeometryIndexEXT; + mat3x4 v16 = gl_ObjectToWorld3x4EXT; + mat3x4 v17 = gl_WorldToObject3x4EXT; + incomingPayload = vec4(0.5f); + if (v2 == 1) + ignoreIntersectionEXT(); + else + terminateRayEXT(); +} diff --git a/core/deps/glslang/Test/spv.ext.AnyHitShader_Errors.rahit b/core/deps/glslang/Test/spv.ext.AnyHitShader_Errors.rahit new file mode 100644 index 000000000..f9fd730ed --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.AnyHitShader_Errors.rahit @@ -0,0 +1,11 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +hitAttributeEXT vec4 payload; +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; + +void main() +{ + payload.x = 1.0f; // ERROR, cannot write to hitattributeEXT in stage + reportIntersectionEXT(1.0, 1U); // ERROR, unsupported builtin in stage + traceRayEXT(accEXT, 0, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 0); // ERROR, unsupported builtin in stage +} diff --git a/core/deps/glslang/Test/spv.ext.ClosestHitShader.rchit b/core/deps/glslang/Test/spv.ext.ClosestHitShader.rchit new file mode 100644 index 000000000..3f9bbaa0b --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.ClosestHitShader.rchit @@ -0,0 +1,27 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadEXT vec4 localPayload; +layout(location = 1) rayPayloadInEXT vec4 incomingPayload; +void main() +{ + uvec3 v0 = gl_LaunchIDEXT; + uvec3 v1 = gl_LaunchSizeEXT; + int v2 = gl_PrimitiveID; + int v3 = gl_InstanceID; + int v4 = gl_InstanceCustomIndexEXT; + vec3 v5 = gl_WorldRayOriginEXT; + vec3 v6 = gl_WorldRayDirectionEXT; + vec3 v7 = gl_ObjectRayOriginEXT; + vec3 v8 = gl_ObjectRayDirectionEXT; + float v9 = gl_RayTminEXT; + float v10 = gl_RayTmaxEXT; + float v11 = gl_HitTEXT; + uint v12 = gl_HitKindEXT; + mat4x3 v13 = gl_ObjectToWorldEXT; + mat4x3 v14 = gl_WorldToObjectEXT; + int v15 = gl_GeometryIndexEXT; + mat3x4 v16 = gl_ObjectToWorld3x4EXT; + mat3x4 v17 = gl_WorldToObject3x4EXT; + traceRayEXT(accEXT, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1); +} diff --git a/core/deps/glslang/Test/spv.ext.ClosestHitShader_Errors.rchit b/core/deps/glslang/Test/spv.ext.ClosestHitShader_Errors.rchit new file mode 100644 index 000000000..05e05fe95 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.ClosestHitShader_Errors.rchit @@ -0,0 +1,13 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +hitAttributeEXT vec4 payload; +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; + +void main() +{ + payload.x = 1.0f; // ERROR, cannot write to hitattributeEXT in stage + reportIntersectionEXT(1.0, 1U); // ERROR, unsupported builtin in stage + terminateRayEXT(); + ignoreIntersectionEXT(); + bool e1 = gl_IncomingRayFlagsEXT == gl_RayFlagsSkipAABBEXT; +} diff --git a/core/deps/glslang/Test/spv.ext.IntersectShader.rint b/core/deps/glslang/Test/spv.ext.IntersectShader.rint new file mode 100644 index 000000000..4933ff5ef --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.IntersectShader.rint @@ -0,0 +1,23 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +hitAttributeEXT vec4 iAttr; +void main() +{ + uvec3 v0 = gl_LaunchIDEXT; + uvec3 v1 = gl_LaunchSizeEXT; + int v2 = gl_PrimitiveID; + int v3 = gl_InstanceID; + int v4 = gl_InstanceCustomIndexEXT; + vec3 v5 = gl_WorldRayOriginEXT; + vec3 v6 = gl_WorldRayDirectionEXT; + vec3 v7 = gl_ObjectRayOriginEXT; + vec3 v8 = gl_ObjectRayDirectionEXT; + float v9 = gl_RayTminEXT; + float v10 = gl_RayTmaxEXT; + mat4x3 v11 = gl_ObjectToWorldEXT; + mat4x3 v12 = gl_WorldToObjectEXT; + mat3x4 v13 = gl_ObjectToWorld3x4EXT; + mat3x4 v14 = gl_WorldToObject3x4EXT; + iAttr = vec4(0.5f,0.5f,0.0f,1.0f); + reportIntersectionEXT(0.5, 1U); +} diff --git a/core/deps/glslang/Test/spv.ext.IntersectShader_Errors.rint b/core/deps/glslang/Test/spv.ext.IntersectShader_Errors.rint new file mode 100644 index 000000000..e767ca367 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.IntersectShader_Errors.rint @@ -0,0 +1,11 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +rayPayloadInEXT vec4 payloadIn; // ERROR, rayPayloadIn unsupported in this stage +rayPayloadEXT vec4 payload; // ERROR, rayPayload unsuppoted in this stage +uniform accelerationStructureEXT accEXT; +void main() +{ + float e12 = gl_HitTEXT; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindEXT; // ERROR, unsupported builtin in stage + traceRayEXT(accEXT, 0, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, 0); // ERROR, unsupported +} diff --git a/core/deps/glslang/Test/spv.ext.MissShader.rmiss b/core/deps/glslang/Test/spv.ext.MissShader.rmiss new file mode 100644 index 000000000..e77433480 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.MissShader.rmiss @@ -0,0 +1,15 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadEXT vec4 localPayload; +layout(location = 1) rayPayloadInEXT vec4 incomingPayload; +void main() +{ + uvec3 v0 = gl_LaunchIDEXT; + uvec3 v1 = gl_LaunchSizeEXT; + vec3 v2 = gl_WorldRayOriginEXT; + vec3 v3 = gl_WorldRayDirectionEXT; + float v4 = gl_RayTminEXT; + float v5 = gl_RayTmaxEXT; + traceRayEXT(accEXT, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1); +} diff --git a/core/deps/glslang/Test/spv.ext.MissShader_Errors.rmiss b/core/deps/glslang/Test/spv.ext.MissShader_Errors.rmiss new file mode 100644 index 000000000..2391211a5 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.MissShader_Errors.rmiss @@ -0,0 +1,16 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +hitAttributeEXT vec4 payload; // ERROR, hitattributeEXT unsupported in this stage +void main() +{ + int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage + int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage + int e3 = gl_InstanceCustomIndexEXT; // ERROR, unsupported builtin in stage + mat4x3 e10 = gl_ObjectToWorldEXT; // ERROR, unsupported builtin in stage + mat4x3 e11 = gl_WorldToObjectEXT; // ERROR, unsupported builtin in stage + float e12 = gl_HitTEXT; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindEXT; // ERROR, unsupported builtin in stage + reportIntersectionEXT(1.0, 1U); // ERROR, unsupported builtin in stage + ignoreIntersectionEXT(); // ERROR, unsupported builtin in stage + terminateRayEXT(); // ERROR, unsupported builtin in stage +} diff --git a/core/deps/glslang/Test/spv.ext.RayCallable.rcall b/core/deps/glslang/Test/spv.ext.RayCallable.rcall new file mode 100644 index 000000000..9ec6820da --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayCallable.rcall @@ -0,0 +1,13 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +layout(location = 0) callableDataEXT vec4 data0; +layout(location = 1) callableDataInEXT dataBlock { + uint data1; +}; +void main() +{ + uvec3 id = gl_LaunchIDEXT; + uvec3 size = gl_LaunchSizeEXT; + data1 = 256U; + executeCallableEXT(2,1); +} diff --git a/core/deps/glslang/Test/spv.ext.RayCallable_Errors.rcall b/core/deps/glslang/Test/spv.ext.RayCallable_Errors.rcall new file mode 100644 index 000000000..d35672e92 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayCallable_Errors.rcall @@ -0,0 +1,26 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +hitAttributeEXT vec4 hitattr; // ERROR, hitattributeEXT unsupported in this stage +rayPayloadEXT vec4 payload; // ERROR, rayPayloadEXT unsupported in this stage +rayPayloadInEXT vec4 payloadIn; // ERROR, rayPayloadInEXT unsupported in this stage + +void main() +{ + int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage + int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage + int e3 = gl_InstanceCustomIndexEXT; // ERROR, unsupported builtin in stage + vec3 e4 = gl_WorldRayOriginEXT; // ERROR, unsupported builtin in stage + vec3 e5 = gl_WorldRayDirectionEXT; // ERROR, unsupported builtin in stage + vec3 e6 = gl_ObjectRayOriginEXT; // ERROR, unsupported builtin in stage + vec3 e7 = gl_ObjectRayDirectionEXT; // ERROR, unsupported builtin in stage + float e8 = gl_RayTminEXT; // ERROR, unsupported builtin in stage + float e9 = gl_RayTmaxEXT; // ERROR, unsupported builtin in stage + mat4x3 e10 = gl_ObjectToWorldEXT; // ERROR, unsupported builtin in stage + mat4x3 e11 = gl_WorldToObjectEXT; // ERROR, unsupported builtin in stage + float e12 = gl_HitTEXT; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindEXT; // ERROR, unsupported builtin in stage + uint curFlags = gl_IncomingRayFlagsEXT; // ERROR, unsupported builtin in stage + reportIntersectionEXT(1.0, 1U); // ERROR, unsupported builtin in stage + ignoreIntersectionEXT(); // ERROR, unsupported builtin in stage + terminateRayEXT(); // ERROR, unsupported builtin in stage +} diff --git a/core/deps/glslang/Test/spv.ext.RayConstants.rgen b/core/deps/glslang/Test/spv.ext.RayConstants.rgen new file mode 100644 index 000000000..73cb0c183 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayConstants.rgen @@ -0,0 +1,15 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadEXT vec4 payload; +void main() +{ + const uint rayFlags = gl_RayFlagsNoneEXT | gl_RayFlagsOpaqueEXT | + gl_RayFlagsNoOpaqueEXT | gl_RayFlagsTerminateOnFirstHitEXT | + gl_RayFlagsSkipClosestHitShaderEXT | gl_RayFlagsCullBackFacingTrianglesEXT | + gl_RayFlagsCullFrontFacingTrianglesEXT | gl_RayFlagsCullOpaqueEXT | + gl_RayFlagsCullNoOpaqueEXT; + + const int payloadId = 1; + traceRayEXT(accEXT, rayFlags, 0, 1, 1, 0, vec3(0.0f), 0.5f, vec3(1.0f), 0.75f, payloadId); +} diff --git a/core/deps/glslang/Test/spv.ext.RayGenShader.rgen b/core/deps/glslang/Test/spv.ext.RayGenShader.rgen new file mode 100644 index 000000000..c92772ee6 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayGenShader.rgen @@ -0,0 +1,21 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +#extension GL_EXT_ray_flags_primitive_culling : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT0; +layout(binding = 1, set = 0) uniform accelerationStructureEXT accEXT1; // Unused +layout(binding = 2, r32ui) shadercallcoherent uniform uimage2D imageu; +layout(location = 0) rayPayloadEXT vec4 payload; +layout(shaderRecordEXT) buffer block +{ + vec3 dir; + vec3 origin; + +}; +void main() +{ + uint lx = gl_LaunchIDEXT.x; + uint ly = gl_LaunchIDEXT.y; + uint sx = gl_LaunchSizeEXT.x; + uint sy = gl_LaunchSizeEXT.y; + traceRayEXT(accEXT0, lx, ly, sx, sy, gl_RayFlagsSkipTrianglesEXT | gl_RayFlagsSkipAABBEXT, origin, 0.5f, dir, 0.75f, 1); +} diff --git a/core/deps/glslang/Test/spv.ext.RayGenShader11.rgen b/core/deps/glslang/Test/spv.ext.RayGenShader11.rgen new file mode 100644 index 000000000..48170264d --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayGenShader11.rgen @@ -0,0 +1,17 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadEXT vec4 payload; +layout(shaderRecordEXT) buffer block +{ + vec3 dir; + vec3 origin; +}; +void main() +{ + uint lx = gl_LaunchIDEXT.x; + uint ly = gl_LaunchIDEXT.y; + uint sx = gl_LaunchSizeEXT.x; + uint sy = gl_LaunchSizeEXT.y; + traceRayEXT(accEXT, lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); +} diff --git a/core/deps/glslang/Test/spv.ext.RayGenShaderArray.rgen b/core/deps/glslang/Test/spv.ext.RayGenShaderArray.rgen new file mode 100644 index 000000000..d3f99de22 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayGenShaderArray.rgen @@ -0,0 +1,22 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +#extension GL_EXT_nonuniform_qualifier : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT0[]; +layout(binding = 1, set = 0) uniform accelerationStructureEXT accEXT1[2]; +layout(location = 0) rayPayloadEXT vec4 payload; +layout(shaderRecordEXT) buffer block +{ + vec3 dir; + vec3 origin; + int i; +}; +void main() +{ + uint lx = gl_LaunchIDEXT.x; + uint ly = gl_LaunchIDEXT.y; + uint sx = gl_LaunchSizeEXT.x; + uint sy = gl_LaunchSizeEXT.y; + traceRayEXT(accEXT0[i], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); + traceRayEXT(accEXT1[i], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); + traceRayEXT(accEXT0[nonuniformEXT(i)], lx, ly, sx, sy, 0u, origin, 0.5f, dir, 0.75f, 1); +} diff --git a/core/deps/glslang/Test/spv.ext.RayGenShader_Errors.rgen b/core/deps/glslang/Test/spv.ext.RayGenShader_Errors.rgen new file mode 100644 index 000000000..349834242 --- /dev/null +++ b/core/deps/glslang/Test/spv.ext.RayGenShader_Errors.rgen @@ -0,0 +1,42 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +hitAttributeEXT vec4 payload; // ERROR, hitattributeEXT unsupported in this stage +rayPayloadInEXT vec4 payloadIn; // ERROR, rayPayloadIn unsupported in this stage +layout(shaderRecordEXT) uniform ublock // ERROR, shaderRecordEXT unsupported on uniform blocks +{ + float a; +}; +layout(binding = 0, shaderRecordEXT) buffer bblock { // ERROR, binding unsupported on shaderRecordEXT blocks + float b; +}; +layout(set = 0, shaderRecordEXT) buffer bblock2 { // ERROR, set unsupported on shaderRecordEXT blocks + float c; +}; +layout(shaderRecordEXT) buffer bblock3 { + float d; +}; +layout(shaderRecordEXT) buffer bblock4 { // ERROR, cannot have more than one shaderRecordEXTX block + float e; +}; +void main() +{ + accelerationStructureEXT a = 0; + int e0 = gl_PrimitiveID; // ERROR, unsupported builtin in stage + int e1 = gl_InstanceID; // ERROR, unsupported builtin in stage + int e3 = gl_InstanceCustomIndexEXT; // ERROR, unsupported builtin in stage + vec3 e4 = gl_WorldRayOriginEXT; // ERROR, unsupported builtin in stage + vec3 e5 = gl_WorldRayDirectionEXT; // ERROR, unsupported builtin in stage + vec3 e6 = gl_ObjectRayOriginEXT; // ERROR, unsupported builtin in stage + vec3 e7 = gl_ObjectRayDirectionEXT; // ERROR, unsupported builtin in stage + float e8 = gl_RayTminEXT; // ERROR, unsupported builtin in stage + float e9 = gl_RayTmaxEXT; // ERROR, unsupported builtin in stage + mat4x3 e10 = gl_ObjectToWorldEXT; // ERROR, unsupported builtin in stage + mat4x3 e11 = gl_WorldToObjectEXT; // ERROR, unsupported builtin in stage + float e12 = gl_HitTEXT; // ERROR, unsupported builtin in stage + float e13 = gl_HitKindEXT; // ERROR, unsupported builtin in stage + int e14 = gl_RayFlagsSkipAABBEXT; // ERROR, unsupported builtin in stage + reportIntersectionEXT(1.0, 1U); // ERROR, unsupported builtin in stage + ignoreIntersectionEXT(); // ERROR, unsupported builtin in stage + terminateRayEXT(); // ERROR, unsupported builtin in stage + d = 1.0f; // ERROR, can't modify shaderRecordEXT block +} diff --git a/core/deps/glslang/Test/spv.extPostDepthCoverage.frag b/core/deps/glslang/Test/spv.extPostDepthCoverage.frag index 9e5cbd399..20aebc395 100644 --- a/core/deps/glslang/Test/spv.extPostDepthCoverage.frag +++ b/core/deps/glslang/Test/spv.extPostDepthCoverage.frag @@ -1,9 +1,9 @@ -#version 310 es - -#extension GL_EXT_post_depth_coverage : enable - -layout(post_depth_coverage) in; -layout(early_fragment_tests) in; - -void main () { -} +#version 310 es + +#extension GL_EXT_post_depth_coverage : enable + +layout(post_depth_coverage) in; +layout(early_fragment_tests) in; + +void main () { +} diff --git a/core/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag b/core/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag index c9a59a7f0..25ce2e2e6 100644 --- a/core/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag +++ b/core/deps/glslang/Test/spv.extPostDepthCoverage_Error.frag @@ -1,9 +1,9 @@ -#version 450 - -#extension GL_EXT_post_depth_coverage : enable - -layout(post_depth_coverage) in; // should fail since for GL_EXT_post_depth_coverage - // explicit declaration of early_fragment_tests is required - -void main () { -} +#version 450 + +#extension GL_EXT_post_depth_coverage : enable + +layout(post_depth_coverage) in; // should fail since for GL_EXT_post_depth_coverage + // explicit declaration of early_fragment_tests is required + +void main () { +} diff --git a/core/deps/glslang/Test/spv.float16.frag b/core/deps/glslang/Test/spv.float16.frag index 204cf12e5..7c94a5151 100644 --- a/core/deps/glslang/Test/spv.float16.frag +++ b/core/deps/glslang/Test/spv.float16.frag @@ -1,306 +1,306 @@ -#version 450 core - -#extension GL_AMD_gpu_shader_half_float: enable -#extension GL_ARB_gpu_shader_int64: enable - -void main() -{ -} - -// Half float literals -void literal() -{ - const float16_t f16c = 0.000001hf; - const f16vec2 f16cv = f16vec2(-0.25HF, 0.03HF); - - f16vec2 f16v; - f16v.x = f16c; - f16v += f16cv; -} - -// Block memory layout -struct S -{ - float16_t x; // rule 1: align = 2, takes offsets 0-1 - f16vec2 y; // rule 2: align = 4, takes offsets 4-7 - f16vec3 z; // rule 3: align = 8, takes offsets 8-13 -}; - -layout(column_major, std140) uniform B1 -{ - float16_t a; // rule 1: align = 2, takes offsets 0-1 - f16vec2 b; // rule 2: align = 4, takes offsets 4-7 - f16vec3 c; // rule 3: align = 8, takes offsets 8-15 - float16_t d[2]; // rule 4: align = 16, array stride = 16, - // takes offsets 16-47 - f16mat2x3 e; // rule 5: align = 16, matrix stride = 16, - // takes offsets 48-79 - f16mat2x3 f[2]; // rule 6: align = 16, matrix stride = 16, - // array stride = 32, f[0] takes - // offsets 80-111, f[1] takes offsets - // 112-143 - S g; // rule 9: align = 16, g.x takes offsets - // 144-145, g.y takes offsets 148-151, - // g.z takes offsets 152-159 - S h[2]; // rule 10: align = 16, array stride = 16, h[0] - // takes offsets 160-175, h[1] takes - // offsets 176-191 -}; - -layout(row_major, std430) buffer B2 -{ - float16_t o; // rule 1: align = 2, takes offsets 0-1 - f16vec2 p; // rule 2: align = 4, takes offsets 4-7 - f16vec3 q; // rule 3: align = 8, takes offsets 8-13 - float16_t r[2]; // rule 4: align = 2, array stride = 2, takes - // offsets 14-17 - f16mat2x3 s; // rule 7: align = 4, matrix stride = 4, takes - // offsets 20-31 - f16mat2x3 t[2]; // rule 8: align = 4, matrix stride = 4, array - // stride = 12, t[0] takes offsets - // 32-43, t[1] takes offsets 44-55 - S u; // rule 9: align = 8, u.x takes offsets - // 56-57, u.y takes offsets 60-63, u.z - // takes offsets 64-69 - S v[2]; // rule 10: align = 8, array stride = 16, v[0] - // takes offsets 72-87, v[1] takes - // offsets 88-103 -}; - -// Specialization constant -layout(constant_id = 100) const float16_t sf16 = 0.125hf; -layout(constant_id = 101) const float sf = 0.25; -layout(constant_id = 102) const double sd = 0.5lf; - -const float f16_to_f = float(sf16); -const double f16_to_d = float(sf16); - -const float16_t f_to_f16 = float16_t(sf); -const float16_t d_to_f16 = float16_t(sd); - -void operators() -{ - float16_t f16; - f16vec2 f16v; - f16mat2x2 f16m; - bool b; - - // Arithmetic - f16v += f16v; - f16v -= f16v; - f16v *= f16v; - f16v /= f16v; - f16v++; - f16v--; - ++f16m; - --f16m; - f16v = -f16v; - f16m = -f16m; - - f16 = f16v.x + f16v.y; - f16 = f16v.x - f16v.y; - f16 = f16v.x * f16v.y; - f16 = f16v.x / f16v.y; - - // Relational - b = (f16v.x != f16); - b = (f16v.y == f16); - b = (f16v.x > f16); - b = (f16v.y < f16); - b = (f16v.x >= f16); - b = (f16v.y <= f16); - - // Vector/matrix operations - f16v = f16v * f16; - f16m = f16m * f16; - f16v = f16m * f16v; - f16v = f16v * f16m; - f16m = f16m * f16m; -} - -void typeCast() -{ - bvec3 bv; - vec3 fv; - dvec3 dv; - ivec3 iv; - uvec3 uv; - i64vec3 i64v; - u64vec3 u64v; - - f16vec3 f16v; - - f16v = f16vec3(bv); // bool -> float16 - bv = bvec3(f16v); // float16 -> bool - - f16v = f16vec3(fv); // float -> float16 - fv = vec3(f16v); // float16 -> float - - f16v = f16vec3(dv); // double -> float16 - dv = dvec3(dv); // float16 -> double - - f16v = f16vec3(iv); // int -> float16 - iv = ivec3(f16v); // float16 -> int - - f16v = f16vec3(uv); // uint -> float16 - uv = uvec3(f16v); // float16 -> uint - - f16v = f16vec3(i64v); // int64 -> float16 - i64v = i64vec3(f16v); // float16 -> int64 - - f16v = f16vec3(u64v); // uint64 -> float16 - u64v = u64vec3(f16v); // float16 -> uint64 -} - -void builtinAngleTrigFuncs() -{ - f16vec4 f16v1, f16v2; - - f16v2 = radians(f16v1); - f16v2 = degrees(f16v1); - f16v2 = sin(f16v1); - f16v2 = cos(f16v1); - f16v2 = tan(f16v1); - f16v2 = asin(f16v1); - f16v2 = acos(f16v1); - f16v2 = atan(f16v1, f16v2); - f16v2 = atan(f16v1); - f16v2 = sinh(f16v1); - f16v2 = cosh(f16v1); - f16v2 = tanh(f16v1); - f16v2 = asinh(f16v1); - f16v2 = acosh(f16v1); - f16v2 = atanh(f16v1); -} - -void builtinExpFuncs() -{ - f16vec2 f16v1, f16v2; - - f16v2 = pow(f16v1, f16v2); - f16v2 = exp(f16v1); - f16v2 = log(f16v1); - f16v2 = exp2(f16v1); - f16v2 = log2(f16v1); - f16v2 = sqrt(f16v1); - f16v2 = inversesqrt(f16v1); -} - -void builtinCommonFuncs() -{ - f16vec3 f16v1, f16v2, f16v3; - float16_t f16; - bool b; - bvec3 bv; - ivec3 iv; - - f16v2 = abs(f16v1); - f16v2 = sign(f16v1); - f16v2 = floor(f16v1); - f16v2 = trunc(f16v1); - f16v2 = round(f16v1); - f16v2 = roundEven(f16v1); - f16v2 = ceil(f16v1); - f16v2 = fract(f16v1); - f16v2 = mod(f16v1, f16v2); - f16v2 = mod(f16v1, f16); - f16v3 = modf(f16v1, f16v2); - f16v3 = min(f16v1, f16v2); - f16v3 = min(f16v1, f16); - f16v3 = max(f16v1, f16v2); - f16v3 = max(f16v1, f16); - f16v3 = clamp(f16v1, f16, f16v2.x); - f16v3 = clamp(f16v1, f16v2, f16vec3(f16)); - f16v3 = mix(f16v1, f16v2, f16); - f16v3 = mix(f16v1, f16v2, f16v3); - f16v3 = mix(f16v1, f16v2, bv); - f16v3 = step(f16v1, f16v2); - f16v3 = step(f16, f16v3); - f16v3 = smoothstep(f16v1, f16v2, f16v3); - f16v3 = smoothstep(f16, f16v1.x, f16v2); - b = isnan(f16); - bv = isinf(f16v1); - f16v3 = fma(f16v1, f16v2, f16v3); - f16v2 = frexp(f16v1, iv); - f16v2 = ldexp(f16v1, iv); -} - -void builtinPackUnpackFuncs() -{ - uint u; - f16vec2 f16v; - - u = packFloat2x16(f16v); - f16v = unpackFloat2x16(u); -} - -void builtinGeometryFuncs() -{ - float16_t f16; - f16vec3 f16v1, f16v2, f16v3; - - f16 = length(f16v1); - f16 = distance(f16v1, f16v2); - f16 = dot(f16v1, f16v2); - f16v3 = cross(f16v1, f16v2); - f16v2 = normalize(f16v1); - f16v3 = faceforward(f16v1, f16v2, f16v3); - f16v3 = reflect(f16v1, f16v2); - f16v3 = refract(f16v1, f16v2, f16); -} - -void builtinMatrixFuncs() -{ - f16mat2x3 f16m1, f16m2, f16m3; - f16mat3x2 f16m4; - f16mat3 f16m5; - f16mat4 f16m6, f16m7; - - f16vec3 f16v1; - f16vec2 f16v2; - - float16_t f16; - - f16m3 = matrixCompMult(f16m1, f16m2); - f16m1 = outerProduct(f16v1, f16v2); - f16m4 = transpose(f16m1); - f16 = determinant(f16m5); - f16m6 = inverse(f16m7); -} - -void builtinVecRelFuncs() -{ - f16vec3 f16v1, f16v2; - bvec3 bv; - - bv = lessThan(f16v1, f16v2); - bv = lessThanEqual(f16v1, f16v2); - bv = greaterThan(f16v1, f16v2); - bv = greaterThanEqual(f16v1, f16v2); - bv = equal(f16v1, f16v2); - bv = notEqual(f16v1, f16v2); -} - -in f16vec3 if16v; - -void builtinFragProcFuncs() -{ - f16vec3 f16v; - - // Derivative - f16v.x = dFdx(if16v.x); - f16v.y = dFdy(if16v.y); - f16v.xy = dFdxFine(if16v.xy); - f16v.xy = dFdyFine(if16v.xy); - f16v = dFdxCoarse(if16v); - f16v = dFdxCoarse(if16v); - - f16v.x = fwidth(if16v.x); - f16v.xy = fwidthFine(if16v.xy); - f16v = fwidthCoarse(if16v); - - // Interpolation - f16v.x = interpolateAtCentroid(if16v.x); - f16v.xy = interpolateAtSample(if16v.xy, 1); - f16v = interpolateAtOffset(if16v, f16vec2(0.5hf)); -} +#version 450 core + +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_ARB_gpu_shader_int64: enable + +void main() +{ +} + +// Half float literals +void literal() +{ + const float16_t f16c = 0.000001hf; + const f16vec2 f16cv = f16vec2(-0.25HF, 0.03HF); + + f16vec2 f16v; + f16v.x = f16c; + f16v += f16cv; +} + +// Block memory layout +struct S +{ + float16_t x; // rule 1: align = 2, takes offsets 0-1 + f16vec2 y; // rule 2: align = 4, takes offsets 4-7 + f16vec3 z; // rule 3: align = 8, takes offsets 8-13 +}; + +layout(column_major, std140) uniform B1 +{ + float16_t a; // rule 1: align = 2, takes offsets 0-1 + f16vec2 b; // rule 2: align = 4, takes offsets 4-7 + f16vec3 c; // rule 3: align = 8, takes offsets 8-15 + float16_t d[2]; // rule 4: align = 16, array stride = 16, + // takes offsets 16-47 + f16mat2x3 e; // rule 5: align = 16, matrix stride = 16, + // takes offsets 48-79 + f16mat2x3 f[2]; // rule 6: align = 16, matrix stride = 16, + // array stride = 32, f[0] takes + // offsets 80-111, f[1] takes offsets + // 112-143 + S g; // rule 9: align = 16, g.x takes offsets + // 144-145, g.y takes offsets 148-151, + // g.z takes offsets 152-159 + S h[2]; // rule 10: align = 16, array stride = 16, h[0] + // takes offsets 160-175, h[1] takes + // offsets 176-191 +}; + +layout(row_major, std430) buffer B2 +{ + float16_t o; // rule 1: align = 2, takes offsets 0-1 + f16vec2 p; // rule 2: align = 4, takes offsets 4-7 + f16vec3 q; // rule 3: align = 8, takes offsets 8-13 + float16_t r[2]; // rule 4: align = 2, array stride = 2, takes + // offsets 14-17 + f16mat2x3 s; // rule 7: align = 4, matrix stride = 4, takes + // offsets 20-31 + f16mat2x3 t[2]; // rule 8: align = 4, matrix stride = 4, array + // stride = 12, t[0] takes offsets + // 32-43, t[1] takes offsets 44-55 + S u; // rule 9: align = 8, u.x takes offsets + // 56-57, u.y takes offsets 60-63, u.z + // takes offsets 64-69 + S v[2]; // rule 10: align = 8, array stride = 16, v[0] + // takes offsets 72-87, v[1] takes + // offsets 88-103 +}; + +// Specialization constant +layout(constant_id = 100) const float16_t sf16 = 0.125hf; +layout(constant_id = 101) const float sf = 0.25; +layout(constant_id = 102) const double sd = 0.5lf; + +const float f16_to_f = float(sf16); +const double f16_to_d = float(sf16); + +const float16_t f_to_f16 = float16_t(sf); +const float16_t d_to_f16 = float16_t(sd); + +void operators() +{ + float16_t f16; + f16vec2 f16v; + f16mat2x2 f16m; + bool b; + + // Arithmetic + f16v += f16v; + f16v -= f16v; + f16v *= f16v; + f16v /= f16v; + f16v++; + f16v--; + ++f16m; + --f16m; + f16v = -f16v; + f16m = -f16m; + + f16 = f16v.x + f16v.y; + f16 = f16v.x - f16v.y; + f16 = f16v.x * f16v.y; + f16 = f16v.x / f16v.y; + + // Relational + b = (f16v.x != f16); + b = (f16v.y == f16); + b = (f16v.x > f16); + b = (f16v.y < f16); + b = (f16v.x >= f16); + b = (f16v.y <= f16); + + // Vector/matrix operations + f16v = f16v * f16; + f16m = f16m * f16; + f16v = f16m * f16v; + f16v = f16v * f16m; + f16m = f16m * f16m; +} + +void typeCast() +{ + bvec3 bv; + vec3 fv; + dvec3 dv; + ivec3 iv; + uvec3 uv; + i64vec3 i64v; + u64vec3 u64v; + + f16vec3 f16v; + + f16v = f16vec3(bv); // bool -> float16 + bv = bvec3(f16v); // float16 -> bool + + f16v = f16vec3(fv); // float -> float16 + fv = vec3(f16v); // float16 -> float + + f16v = f16vec3(dv); // double -> float16 + dv = dvec3(dv); // float16 -> double + + f16v = f16vec3(iv); // int -> float16 + iv = ivec3(f16v); // float16 -> int + + f16v = f16vec3(uv); // uint -> float16 + uv = uvec3(f16v); // float16 -> uint + + f16v = f16vec3(i64v); // int64 -> float16 + i64v = i64vec3(f16v); // float16 -> int64 + + f16v = f16vec3(u64v); // uint64 -> float16 + u64v = u64vec3(f16v); // float16 -> uint64 +} + +void builtinAngleTrigFuncs() +{ + f16vec4 f16v1, f16v2; + + f16v2 = radians(f16v1); + f16v2 = degrees(f16v1); + f16v2 = sin(f16v1); + f16v2 = cos(f16v1); + f16v2 = tan(f16v1); + f16v2 = asin(f16v1); + f16v2 = acos(f16v1); + f16v2 = atan(f16v1, f16v2); + f16v2 = atan(f16v1); + f16v2 = sinh(f16v1); + f16v2 = cosh(f16v1); + f16v2 = tanh(f16v1); + f16v2 = asinh(f16v1); + f16v2 = acosh(f16v1); + f16v2 = atanh(f16v1); +} + +void builtinExpFuncs() +{ + f16vec2 f16v1, f16v2; + + f16v2 = pow(f16v1, f16v2); + f16v2 = exp(f16v1); + f16v2 = log(f16v1); + f16v2 = exp2(f16v1); + f16v2 = log2(f16v1); + f16v2 = sqrt(f16v1); + f16v2 = inversesqrt(f16v1); +} + +void builtinCommonFuncs() +{ + f16vec3 f16v1, f16v2, f16v3; + float16_t f16; + bool b; + bvec3 bv; + ivec3 iv; + + f16v2 = abs(f16v1); + f16v2 = sign(f16v1); + f16v2 = floor(f16v1); + f16v2 = trunc(f16v1); + f16v2 = round(f16v1); + f16v2 = roundEven(f16v1); + f16v2 = ceil(f16v1); + f16v2 = fract(f16v1); + f16v2 = mod(f16v1, f16v2); + f16v2 = mod(f16v1, f16); + f16v3 = modf(f16v1, f16v2); + f16v3 = min(f16v1, f16v2); + f16v3 = min(f16v1, f16); + f16v3 = max(f16v1, f16v2); + f16v3 = max(f16v1, f16); + f16v3 = clamp(f16v1, f16, f16v2.x); + f16v3 = clamp(f16v1, f16v2, f16vec3(f16)); + f16v3 = mix(f16v1, f16v2, f16); + f16v3 = mix(f16v1, f16v2, f16v3); + f16v3 = mix(f16v1, f16v2, bv); + f16v3 = step(f16v1, f16v2); + f16v3 = step(f16, f16v3); + f16v3 = smoothstep(f16v1, f16v2, f16v3); + f16v3 = smoothstep(f16, f16v1.x, f16v2); + b = isnan(f16); + bv = isinf(f16v1); + f16v3 = fma(f16v1, f16v2, f16v3); + f16v2 = frexp(f16v1, iv); + f16v2 = ldexp(f16v1, iv); +} + +void builtinPackUnpackFuncs() +{ + uint u; + f16vec2 f16v; + + u = packFloat2x16(f16v); + f16v = unpackFloat2x16(u); +} + +void builtinGeometryFuncs() +{ + float16_t f16; + f16vec3 f16v1, f16v2, f16v3; + + f16 = length(f16v1); + f16 = distance(f16v1, f16v2); + f16 = dot(f16v1, f16v2); + f16v3 = cross(f16v1, f16v2); + f16v2 = normalize(f16v1); + f16v3 = faceforward(f16v1, f16v2, f16v3); + f16v3 = reflect(f16v1, f16v2); + f16v3 = refract(f16v1, f16v2, f16); +} + +void builtinMatrixFuncs() +{ + f16mat2x3 f16m1, f16m2, f16m3; + f16mat3x2 f16m4; + f16mat3 f16m5; + f16mat4 f16m6, f16m7; + + f16vec3 f16v1; + f16vec2 f16v2; + + float16_t f16; + + f16m3 = matrixCompMult(f16m1, f16m2); + f16m1 = outerProduct(f16v1, f16v2); + f16m4 = transpose(f16m1); + f16 = determinant(f16m5); + f16m6 = inverse(f16m7); +} + +void builtinVecRelFuncs() +{ + f16vec3 f16v1, f16v2; + bvec3 bv; + + bv = lessThan(f16v1, f16v2); + bv = lessThanEqual(f16v1, f16v2); + bv = greaterThan(f16v1, f16v2); + bv = greaterThanEqual(f16v1, f16v2); + bv = equal(f16v1, f16v2); + bv = notEqual(f16v1, f16v2); +} + +in f16vec3 if16v; + +void builtinFragProcFuncs() +{ + f16vec3 f16v; + + // Derivative + f16v.x = dFdx(if16v.x); + f16v.y = dFdy(if16v.y); + f16v.xy = dFdxFine(if16v.xy); + f16v.xy = dFdyFine(if16v.xy); + f16v = dFdxCoarse(if16v); + f16v = dFdxCoarse(if16v); + + f16v.x = fwidth(if16v.x); + f16v.xy = fwidthFine(if16v.xy); + f16v = fwidthCoarse(if16v); + + // Interpolation + f16v.x = interpolateAtCentroid(if16v.x); + f16v.xy = interpolateAtSample(if16v.xy, 1); + f16v = interpolateAtOffset(if16v, f16vec2(0.5hf)); +} diff --git a/core/deps/glslang/Test/spv.float16Fetch.frag b/core/deps/glslang/Test/spv.float16Fetch.frag index 2150c8d6d..b1ba98c8a 100644 --- a/core/deps/glslang/Test/spv.float16Fetch.frag +++ b/core/deps/glslang/Test/spv.float16Fetch.frag @@ -1,1273 +1,1273 @@ -#version 450 core - -#extension GL_ARB_sparse_texture2: enable -#extension GL_ARB_sparse_texture_clamp: enable -#extension GL_AMD_gpu_shader_half_float: enable -#extension GL_AMD_gpu_shader_half_float_fetch: enable -#extension GL_AMD_texture_gather_bias_lod: enable - -layout(set = 0, binding = 0) uniform f16sampler1D s1D; -layout(set = 0, binding = 1) uniform f16sampler2D s2D; -layout(set = 0, binding = 2) uniform f16sampler3D s3D; -layout(set = 0, binding = 3) uniform f16sampler2DRect s2DRect; -layout(set = 0, binding = 4) uniform f16samplerCube sCube; -layout(set = 0, binding = 5) uniform f16samplerBuffer sBuffer; -layout(set = 0, binding = 6) uniform f16sampler2DMS s2DMS; -layout(set = 0, binding = 7) uniform f16sampler1DArray s1DArray; -layout(set = 0, binding = 8) uniform f16sampler2DArray s2DArray; -layout(set = 0, binding = 9) uniform f16samplerCubeArray sCubeArray; -layout(set = 0, binding = 10) uniform f16sampler2DMSArray s2DMSArray; - -layout(set = 0, binding = 11) uniform f16sampler1DShadow s1DShadow; -layout(set = 0, binding = 12) uniform f16sampler2DShadow s2DShadow; -layout(set = 0, binding = 13) uniform f16sampler2DRectShadow s2DRectShadow; -layout(set = 0, binding = 14) uniform f16samplerCubeShadow sCubeShadow; -layout(set = 0, binding = 15) uniform f16sampler1DArrayShadow s1DArrayShadow; -layout(set = 0, binding = 16) uniform f16sampler2DArrayShadow s2DArrayShadow; -layout(set = 0, binding = 17) uniform f16samplerCubeArrayShadow sCubeArrayShadow; - -layout(set = 1, binding = 0) layout(rgba16f) uniform f16image1D i1D; -layout(set = 1, binding = 1) layout(rgba16f) uniform f16image2D i2D; -layout(set = 1, binding = 2) layout(rgba16f) uniform f16image3D i3D; -layout(set = 1, binding = 3) layout(rgba16f) uniform f16image2DRect i2DRect; -layout(set = 1, binding = 4) layout(rgba16f) uniform f16imageCube iCube; -layout(set = 1, binding = 5) layout(rgba16f) uniform f16image1DArray i1DArray; -layout(set = 1, binding = 6) layout(rgba16f) uniform f16image2DArray i2DArray; -layout(set = 1, binding = 7) layout(rgba16f) uniform f16imageCubeArray iCubeArray; -layout(set = 1, binding = 8) layout(rgba16f) uniform f16imageBuffer iBuffer; -layout(set = 1, binding = 9) layout(rgba16f) uniform f16image2DMS i2DMS; -layout(set = 1, binding = 10) layout(rgba16f) uniform f16image2DMSArray i2DMSArray; - -layout(set = 2, binding = 0) uniform f16texture1D t1D; -layout(set = 2, binding = 1) uniform f16texture2D t2D; -layout(set = 2, binding = 2) uniform f16texture3D t3D; -layout(set = 2, binding = 3) uniform f16texture2DRect t2DRect; -layout(set = 2, binding = 4) uniform f16textureCube tCube; -layout(set = 2, binding = 5) uniform f16texture1DArray t1DArray; -layout(set = 2, binding = 6) uniform f16texture2DArray t2DArray; -layout(set = 2, binding = 7) uniform f16textureCubeArray tCubeArray; -layout(set = 2, binding = 8) uniform f16textureBuffer tBuffer; -layout(set = 2, binding = 9) uniform f16texture2DMS t2DMS; -layout(set = 2, binding = 10) uniform f16texture2DMSArray t2DMSArray; - -layout(set = 2, binding = 11) uniform sampler s; -layout(set = 2, binding = 12) uniform samplerShadow sShadow; - -layout(set = 3, binding = 0, input_attachment_index = 0) uniform f16subpassInput subpass; -layout(set = 3, binding = 1, input_attachment_index = 0) uniform f16subpassInputMS subpassMS; - -layout(location = 0) in float c1; -layout(location = 1) in vec2 c2; -layout(location = 2) in vec3 c3; -layout(location = 3) in vec4 c4; - -layout(location = 4) in float compare; -layout(location = 5) in float lod; -layout(location = 6) in float bias; -layout(location = 7) in float lodClamp; - -layout(location = 8) in float dPdxy1; -layout(location = 9) in vec2 dPdxy2; -layout(location = 10) in vec3 dPdxy3; - -layout(location = 11) in float16_t f16c1; -layout(location = 12) in f16vec2 f16c2; -layout(location = 13) in f16vec3 f16c3; -layout(location = 14) in f16vec4 f16c4; - -layout(location = 15) in float16_t f16lod; -layout(location = 16) in float16_t f16bias; -layout(location = 17) in float16_t f16lodClamp; - -layout(location = 18) in float16_t f16dPdxy1; -layout(location = 19) in f16vec2 f16dPdxy2; -layout(location = 20) in f16vec3 f16dPdxy3; - -const int offset1 = 1; -const ivec2 offset2 = ivec2(1); -const ivec3 offset3 = ivec3(1); -const ivec2 offsets[4] = { offset2, offset2, offset2, offset2 }; - -layout(location = 0) out vec4 fragColor; - -f16vec4 testTexture() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += texture(s1D, c1); - texel += texture(s1D, f16c1, f16bias); - texel += texture(s2D, c2); - texel += texture(s2D, f16c2, f16bias); - texel += texture(s3D, c3); - texel += texture(s3D, f16c3, f16bias); - texel += texture(sCube, c3); - texel += texture(sCube, f16c3, f16bias); - texel.x += texture(s1DShadow, c3); - texel.x += texture(s1DShadow, f16c2, compare, f16bias); - texel.x += texture(s2DShadow, c3); - texel.x += texture(s2DShadow, f16c2, compare, f16bias); - texel.x += texture(sCubeShadow, c4); - texel.x += texture(sCubeShadow, f16c3, compare, f16bias); - texel += texture(s1DArray, c2); - texel += texture(s1DArray, f16c2, f16bias); - texel += texture(s2DArray, c3); - texel += texture(s2DArray, f16c3, f16bias); - texel += texture(sCubeArray, c4); - texel += texture(sCubeArray, f16c4, f16bias); - texel.x += texture(s1DArrayShadow, c3); - texel.x += texture(s1DArrayShadow, f16c2, compare, f16bias); - texel.x += texture(s2DArrayShadow, c4); - texel.x += texture(s2DArrayShadow, f16c3, compare); - texel += texture(s2DRect, c2); - texel += texture(s2DRect, f16c2); - texel.x += texture(s2DRectShadow, c3); - texel.x += texture(s2DRectShadow, f16c2, compare); - texel.x += texture(sCubeArrayShadow, c4, compare); - texel.x += texture(sCubeArrayShadow, f16c4, compare); - - return texel; -} - -f16vec4 testTextureProj() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureProj(s1D, c2); - texel += textureProj(s1D, f16c2, f16bias); - texel += textureProj(s1D, c4); - texel += textureProj(s1D, f16c4, f16bias); - texel += textureProj(s2D, c3); - texel += textureProj(s2D, f16c3, f16bias); - texel += textureProj(s2D, c4); - texel += textureProj(s2D, f16c4, f16bias); - texel += textureProj(s3D, c4); - texel += textureProj(s3D, f16c4, f16bias); - texel.x += textureProj(s1DShadow, c4); - texel.x += textureProj(s1DShadow, f16c3, compare, f16bias); - texel.x += textureProj(s2DShadow, c4); - texel.x += textureProj(s2DShadow, f16c3, compare, f16bias); - texel += textureProj(s2DRect, c3); - texel += textureProj(s2DRect, f16c3); - texel += textureProj(s2DRect, c4); - texel += textureProj(s2DRect, f16c4); - texel.x += textureProj(s2DRectShadow, c4); - texel.x += textureProj(s2DRectShadow, f16c3, compare); - - return texel; -} - -f16vec4 testTextureLod() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureLod(s1D, c1, lod); - texel += textureLod(s1D, f16c1, f16lod); - texel += textureLod(s2D, c2, lod); - texel += textureLod(s2D, f16c2, f16lod); - texel += textureLod(s3D, c3, lod); - texel += textureLod(s3D, f16c3, f16lod); - texel += textureLod(sCube, c3, lod); - texel += textureLod(sCube, f16c3, f16lod); - texel.x += textureLod(s1DShadow, c3, lod); - texel.x += textureLod(s1DShadow, f16c2, compare, f16lod); - texel.x += textureLod(s2DShadow, c3, lod); - texel.x += textureLod(s2DShadow, f16c2, compare, f16lod); - texel += textureLod(s1DArray, c2, lod); - texel += textureLod(s1DArray, f16c2, f16lod); - texel += textureLod(s2DArray, c3, lod); - texel += textureLod(s2DArray, f16c3, f16lod); - texel.x += textureLod(s1DArrayShadow, c3, lod); - texel.x += textureLod(s1DArrayShadow, f16c2, compare, f16lod); - texel += textureLod(sCubeArray, c4, lod); - texel += textureLod(sCubeArray, f16c4, f16lod); - - return texel; -} - -f16vec4 testTextureOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureOffset(s1D, c1, offset1); - texel += textureOffset(s1D, f16c1, offset1, f16bias); - texel += textureOffset(s2D, c2, offset2); - texel += textureOffset(s2D, f16c2, offset2, f16bias); - texel += textureOffset(s3D, c3, offset3); - texel += textureOffset(s3D, f16c3, offset3, f16bias); - texel += textureOffset(s2DRect, c2, offset2); - texel += textureOffset(s2DRect, f16c2, offset2); - texel.x += textureOffset(s2DRectShadow, c3, offset2); - texel.x += textureOffset(s2DRectShadow, f16c2, compare, offset2); - texel.x += textureOffset(s1DShadow, c3, offset1); - texel.x += textureOffset(s1DShadow, f16c2, compare, offset1, f16bias); - texel.x += textureOffset(s2DShadow, c3, offset2); - texel.x += textureOffset(s2DShadow, f16c2, compare, offset2, f16bias); - texel += textureOffset(s1DArray, c2, offset1); - texel += textureOffset(s1DArray, f16c2, offset1, f16bias); - texel += textureOffset(s2DArray, c3, offset2); - texel += textureOffset(s2DArray, f16c3, offset2, f16bias); - texel.x += textureOffset(s1DArrayShadow, c3, offset1); - texel.x += textureOffset(s1DArrayShadow, f16c2, compare, offset1, f16bias); - texel.x += textureOffset(s2DArrayShadow, c4, offset2); - texel.x += textureOffset(s2DArrayShadow, f16c3, compare, offset2); - - return texel; -} - -f16vec4 testTextureProjOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureProjOffset(s1D, c2, offset1); - texel += textureProjOffset(s1D, f16c2, offset1, f16bias); - texel += textureProjOffset(s1D, c4, offset1); - texel += textureProjOffset(s1D, f16c4, offset1, f16bias); - texel += textureProjOffset(s2D, c3, offset2); - texel += textureProjOffset(s2D, f16c3, offset2, f16bias); - texel += textureProjOffset(s2D, c4, offset2); - texel += textureProjOffset(s2D, f16c4, offset2, f16bias); - texel += textureProjOffset(s3D, c4, offset3); - texel += textureProjOffset(s3D, f16c4, offset3, f16bias); - texel += textureProjOffset(s2DRect, c3, offset2); - texel += textureProjOffset(s2DRect, f16c3, offset2); - texel += textureProjOffset(s2DRect, c4, offset2); - texel += textureProjOffset(s2DRect, f16c4, offset2); - texel.x += textureProjOffset(s2DRectShadow, c4, offset2); - texel.x += textureProjOffset(s2DRectShadow, f16c3, compare, offset2); - texel.x += textureProjOffset(s1DShadow, c4, offset1); - texel.x += textureProjOffset(s1DShadow, f16c3, compare, offset1, f16bias); - texel.x += textureProjOffset(s2DShadow, c4, offset2); - texel.x += textureProjOffset(s2DShadow, f16c3, compare, offset2, f16bias); - - return texel; -} - -f16vec4 testTextureLodOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureLodOffset(s1D, c1, lod, offset1); - texel += textureLodOffset(s1D, f16c1, f16lod, offset1); - texel += textureLodOffset(s2D, c2, lod, offset2); - texel += textureLodOffset(s2D, f16c2, f16lod, offset2); - texel += textureLodOffset(s3D, c3, lod, offset3); - texel += textureLodOffset(s3D, f16c3, f16lod, offset3); - texel.x += textureLodOffset(s1DShadow, c3, lod, offset1); - texel.x += textureLodOffset(s1DShadow, f16c2, compare, f16lod, offset1); - texel.x += textureLodOffset(s2DShadow, c3, lod, offset2); - texel.x += textureLodOffset(s2DShadow, f16c2, compare, f16lod, offset2); - texel += textureLodOffset(s1DArray, c2, lod, offset1); - texel += textureLodOffset(s1DArray, f16c2, f16lod, offset1); - texel += textureLodOffset(s2DArray, c3, lod, offset2); - texel += textureLodOffset(s2DArray, f16c3, f16lod, offset2); - texel.x += textureLodOffset(s1DArrayShadow, c3, lod, offset1); - texel.x += textureLodOffset(s1DArrayShadow, f16c2, compare, f16lod, offset1); - - return texel; -} - -f16vec4 testTextureProjLodOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureProjLodOffset(s1D, c2, lod, offset1); - texel += textureProjLodOffset(s1D, f16c2, f16lod, offset1); - texel += textureProjLodOffset(s1D, c4, lod, offset1); - texel += textureProjLodOffset(s1D, f16c4, f16lod, offset1); - texel += textureProjLodOffset(s2D, c3, lod, offset2); - texel += textureProjLodOffset(s2D, f16c3, f16lod, offset2); - texel += textureProjLodOffset(s2D, c4, lod, offset2); - texel += textureProjLodOffset(s2D, f16c4, f16lod, offset2); - texel += textureProjLodOffset(s3D, c4, lod, offset3); - texel += textureProjLodOffset(s3D, f16c4, f16lod, offset3); - texel.x += textureProjLodOffset(s1DShadow, c4, lod, offset1); - texel.x += textureProjLodOffset(s1DShadow, f16c3, compare, f16lod, offset1); - texel.x += textureProjLodOffset(s2DShadow, c4, lod, offset2); - texel.x += textureProjLodOffset(s2DShadow, f16c3, compare, f16lod, offset2); - - return texel; -} - -f16vec4 testTexelFetch() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += texelFetch(s1D, int(c1), int(lod)); - texel += texelFetch(s2D, ivec2(c2), int(lod)); - texel += texelFetch(s3D, ivec3(c3), int(lod)); - texel += texelFetch(s2DRect, ivec2(c2)); - texel += texelFetch(s1DArray, ivec2(c2), int(lod)); - texel += texelFetch(s2DArray, ivec3(c3), int(lod)); - texel += texelFetch(sBuffer, int(c1)); - texel += texelFetch(s2DMS, ivec2(c2), 1); - texel += texelFetch(s2DMSArray, ivec3(c3), 2); - - return texel; -} - -f16vec4 testTexelFetchOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += texelFetchOffset(s1D, int(c1), int(lod), offset1); - texel += texelFetchOffset(s2D, ivec2(c2), int(lod), offset2); - texel += texelFetchOffset(s3D, ivec3(c3), int(lod), offset3); - texel += texelFetchOffset(s2DRect, ivec2(c2), offset2); - texel += texelFetchOffset(s1DArray, ivec2(c2), int(lod), offset1); - texel += texelFetchOffset(s2DArray, ivec3(c3), int(lod), offset2); - - return texel; -} - -f16vec4 testTextureGrad() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGrad(s1D, c1, dPdxy1, dPdxy1); - texel += textureGrad(s1D, f16c1, f16dPdxy1, f16dPdxy1); - texel += textureGrad(s2D, c2, dPdxy2, dPdxy2); - texel += textureGrad(s2D, f16c2, f16dPdxy2, f16dPdxy2); - texel += textureGrad(s3D, c3, dPdxy3, dPdxy3); - texel += textureGrad(s3D, f16c3, f16dPdxy3, f16dPdxy3); - texel += textureGrad(sCube, c3, dPdxy3, dPdxy3); - texel += textureGrad(sCube, f16c3, f16dPdxy3, f16dPdxy3); - texel += textureGrad(s2DRect, c2, dPdxy2, dPdxy2); - texel += textureGrad(s2DRect, f16c2, f16dPdxy2, f16dPdxy2); - texel.x += textureGrad(s2DRectShadow, c3, dPdxy2, dPdxy2); - texel.x += textureGrad(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); - texel.x += textureGrad(s1DShadow, c3, dPdxy1, dPdxy1); - texel.x += textureGrad(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); - texel.x += textureGrad(s2DShadow, c3, dPdxy2, dPdxy2); - texel.x += textureGrad(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); - texel.x += textureGrad(sCubeShadow, c4, dPdxy3, dPdxy3); - texel.x += textureGrad(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3); - texel += textureGrad(s1DArray, c2, dPdxy1, dPdxy1); - texel += textureGrad(s1DArray, f16c2, f16dPdxy1, f16dPdxy1); - texel += textureGrad(s2DArray, c3, dPdxy2, dPdxy2); - texel += textureGrad(s2DArray, f16c3, f16dPdxy2, f16dPdxy2); - texel.x += textureGrad(s1DArrayShadow, c3, dPdxy1, dPdxy1); - texel.x += textureGrad(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); - texel.x += textureGrad(s2DArrayShadow, c4, dPdxy2, dPdxy2); - texel.x += textureGrad(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); - texel += textureGrad(sCubeArray, c4, dPdxy3, dPdxy3); - texel += textureGrad(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3); - - return texel; -} - -f16vec4 testTextureGradOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGradOffset(s1D, c1, dPdxy1, dPdxy1, offset1); - texel += textureGradOffset(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1); - texel += textureGradOffset(s2D, c2, dPdxy2, dPdxy2, offset2); - texel += textureGradOffset(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2); - texel += textureGradOffset(s3D, c3, dPdxy3, dPdxy3, offset3); - texel += textureGradOffset(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3); - texel += textureGradOffset(s2DRect, c2, dPdxy2, dPdxy2, offset2); - texel += textureGradOffset(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2); - texel.x += textureGradOffset(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2); - texel.x += textureGradOffset(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); - texel.x += textureGradOffset(s1DShadow, c3, dPdxy1, dPdxy1, offset1); - texel.x += textureGradOffset(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); - texel.x += textureGradOffset(s2DShadow, c3, dPdxy2, dPdxy2, offset2); - texel.x += textureGradOffset(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); - texel += textureGradOffset(s1DArray, c2, dPdxy1, dPdxy1, offset1); - texel += textureGradOffset(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1); - texel += textureGradOffset(s2DArray, c3, dPdxy2, dPdxy2, offset2); - texel += textureGradOffset(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2); - texel.x += textureGradOffset(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1); - texel.x += textureGradOffset(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); - texel.x += textureGradOffset(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2); - texel.x += textureGradOffset(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); - - return texel; -} - -f16vec4 testTextureProjGrad() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureProjGrad(s1D, c2, dPdxy1, dPdxy1); - texel += textureProjGrad(s1D, f16c2, f16dPdxy1, f16dPdxy1); - texel += textureProjGrad(s1D, c4, dPdxy1, dPdxy1); - texel += textureProjGrad(s1D, f16c4, f16dPdxy1, f16dPdxy1); - texel += textureProjGrad(s2D, c3, dPdxy2, dPdxy2); - texel += textureProjGrad(s2D, f16c3, f16dPdxy2, f16dPdxy2); - texel += textureProjGrad(s2D, c4, dPdxy2, dPdxy2); - texel += textureProjGrad(s2D, f16c4, f16dPdxy2, f16dPdxy2); - texel += textureProjGrad(s3D, c4, dPdxy3, dPdxy3); - texel += textureProjGrad(s3D, f16c4, f16dPdxy3, f16dPdxy3); - texel += textureProjGrad(s2DRect, c3, dPdxy2, dPdxy2); - texel += textureProjGrad(s2DRect, f16c3, f16dPdxy2, f16dPdxy2); - texel += textureProjGrad(s2DRect, c4, dPdxy2, dPdxy2); - texel += textureProjGrad(s2DRect, f16c4, f16dPdxy2, f16dPdxy2); - texel.x += textureProjGrad(s2DRectShadow, c4, dPdxy2, dPdxy2); - texel.x += textureProjGrad(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); - texel.x += textureProjGrad(s1DShadow, c4, dPdxy1, dPdxy1); - texel.x += textureProjGrad(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1); - texel.x += textureProjGrad(s2DShadow, c4, dPdxy2, dPdxy2); - texel.x += textureProjGrad(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); - - return texel; -} - -f16vec4 testTextureProjGradoffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureProjGradOffset(s1D, c2, dPdxy1, dPdxy1, offset1); - texel += textureProjGradOffset(s1D, f16c2, f16dPdxy1, f16dPdxy1, offset1); - texel += textureProjGradOffset(s1D, c4, dPdxy1, dPdxy1, offset1); - texel += textureProjGradOffset(s1D, f16c4, f16dPdxy1, f16dPdxy1, offset1); - texel += textureProjGradOffset(s2D, c3, dPdxy2, dPdxy2, offset2); - texel += textureProjGradOffset(s2D, f16c3, f16dPdxy2, f16dPdxy2, offset2); - texel += textureProjGradOffset(s2D, c4, dPdxy2, dPdxy2, offset2); - texel += textureProjGradOffset(s2D, f16c4, f16dPdxy2, f16dPdxy2, offset2); - texel += textureProjGradOffset(s2DRect, c3, dPdxy2, dPdxy2, offset2); - texel += textureProjGradOffset(s2DRect, f16c3, f16dPdxy2, f16dPdxy2, offset2); - texel += textureProjGradOffset(s2DRect, c4, dPdxy2, dPdxy2, offset2); - texel += textureProjGradOffset(s2DRect, f16c4, f16dPdxy2, f16dPdxy2, offset2); - texel.x += textureProjGradOffset(s2DRectShadow, c4, dPdxy2, dPdxy2, offset2); - texel.x += textureProjGradOffset(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); - texel += textureProjGradOffset(s3D, c4, dPdxy3, dPdxy3, offset3); - texel += textureProjGradOffset(s3D, f16c4, f16dPdxy3, f16dPdxy3, offset3); - texel.x += textureProjGradOffset(s1DShadow, c4, dPdxy1, dPdxy1, offset1); - texel.x += textureProjGradOffset(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1, offset1); - texel.x += textureProjGradOffset(s2DShadow, c4, dPdxy2, dPdxy2, offset2); - texel.x += textureProjGradOffset(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); - - return texel; -} - -f16vec4 testTextureGather() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGather(s2D, c2, 0); - texel += textureGather(s2D, f16c2, 0, f16bias); - texel += textureGather(s2DArray, c3, 0); - texel += textureGather(s2DArray, f16c3, 0, f16bias); - texel += textureGather(sCube, c3, 0); - texel += textureGather(sCube, f16c3, 0, f16bias); - texel += textureGather(sCubeArray, c4, 0); - texel += textureGather(sCubeArray, f16c4, 0, f16bias); - texel += textureGather(s2DRect, c2, 0); - texel += textureGather(s2DRect, f16c2, 0); - texel += textureGather(s2DShadow, c2, compare); - texel += textureGather(s2DShadow, f16c2, compare); - texel += textureGather(s2DArrayShadow, c3, compare); - texel += textureGather(s2DArrayShadow, f16c3, compare); - texel += textureGather(sCubeShadow, c3, compare); - texel += textureGather(sCubeShadow, f16c3, compare); - texel += textureGather(sCubeArrayShadow, c4, compare); - texel += textureGather(sCubeArrayShadow, f16c4, compare); - texel += textureGather(s2DRectShadow, c2, compare); - texel += textureGather(s2DRectShadow, f16c2, compare); - - return texel; -} - -f16vec4 testTextureGatherOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGatherOffset(s2D, c2, offset2, 0); - texel += textureGatherOffset(s2D, f16c2, offset2, 0, f16bias); - texel += textureGatherOffset(s2DArray, c3, offset2, 0); - texel += textureGatherOffset(s2DArray, f16c3, offset2, 0, f16bias); - texel += textureGatherOffset(s2DRect, c2, offset2, 0); - texel += textureGatherOffset(s2DRect, f16c2, offset2, 0); - texel += textureGatherOffset(s2DShadow, c2, compare, offset2); - texel += textureGatherOffset(s2DShadow, f16c2, compare, offset2); - texel += textureGatherOffset(s2DArrayShadow, c3, compare, offset2); - texel += textureGatherOffset(s2DArrayShadow, f16c3, compare, offset2); - texel += textureGatherOffset(s2DRectShadow, c2, compare, offset2); - texel += textureGatherOffset(s2DRectShadow, f16c2, compare, offset2); - - return texel; -} - -f16vec4 testTextureGatherOffsets() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGatherOffsets(s2D, c2, offsets, 0); - texel += textureGatherOffsets(s2D, f16c2, offsets, 0, f16bias); - texel += textureGatherOffsets(s2DArray, c3, offsets, 0); - texel += textureGatherOffsets(s2DArray, f16c3, offsets, 0, f16bias); - texel += textureGatherOffsets(s2DRect, c2, offsets, 0); - texel += textureGatherOffsets(s2DRect, f16c2, offsets, 0); - texel += textureGatherOffsets(s2DShadow, c2, compare, offsets); - texel += textureGatherOffsets(s2DShadow, f16c2, compare, offsets); - texel += textureGatherOffsets(s2DArrayShadow, c3, compare, offsets); - texel += textureGatherOffsets(s2DArrayShadow, f16c3, compare, offsets); - texel += textureGatherOffsets(s2DRectShadow, c2, compare, offsets); - texel += textureGatherOffsets(s2DRectShadow, f16c2, compare, offsets); - - return texel; -} - -f16vec4 testTextureGatherLod() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGatherLodAMD(s2D, c2, lod, 0); - texel += textureGatherLodAMD(s2D, f16c2, f16lod, 0); - texel += textureGatherLodAMD(s2DArray, c3, lod, 0); - texel += textureGatherLodAMD(s2DArray, f16c3, f16lod, 0); - texel += textureGatherLodAMD(sCube, c3, lod, 0); - texel += textureGatherLodAMD(sCube, f16c3, f16lod, 0); - texel += textureGatherLodAMD(sCubeArray, c4, lod, 0); - texel += textureGatherLodAMD(sCubeArray, f16c4, f16lod, 0); - - return texel; -} - -f16vec4 testTextureGatherLodOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGatherLodOffsetAMD(s2D, c2, lod, offset2, 0); - texel += textureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, 0); - texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, 0); - texel += textureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, 0); - - return texel; -} - -f16vec4 testTextureGatherLodOffsets() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets, 0); - texel += textureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, 0); - texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 0); - texel += textureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, 0); - - return texel; -} - -ivec4 testTextureSize() -{ - ivec4 size = ivec4(0); - - size.x += textureSize(s1D, int(lod)); - size.xy += textureSize(s2D, int(lod)); - size.xyz += textureSize(s3D, int(lod)); - size.xy += textureSize(sCube, int(lod)); - size.x += textureSize(s1DShadow, int(lod)); - size.xy += textureSize(s2DShadow, int(lod)); - size.xy += textureSize(sCubeShadow, int(lod)); - size.xyz += textureSize(sCubeArray, int(lod)); - size.xyz += textureSize(sCubeArrayShadow, int(lod)); - size.xy += textureSize(s2DRect); - size.xy += textureSize(s2DRectShadow); - size.xy += textureSize(s1DArray, int(lod)); - size.xyz += textureSize(s2DArray, int(lod)); - size.xy += textureSize(s1DArrayShadow, int(lod)); - size.xyz += textureSize(s2DArrayShadow, int(lod)); - size.x += textureSize(sBuffer); - size.xy += textureSize(s2DMS); - size.xyz += textureSize(s2DMSArray); - - return size; -} - -vec2 testTextureQueryLod() -{ - vec2 lod = vec2(0.0); - - lod += textureQueryLod(s1D, c1); - lod += textureQueryLod(s1D, f16c1); - lod += textureQueryLod(s2D, c2); - lod += textureQueryLod(s2D, f16c2); - lod += textureQueryLod(s3D, c3); - lod += textureQueryLod(s3D, f16c3); - lod += textureQueryLod(sCube, c3); - lod += textureQueryLod(sCube, f16c3); - lod += textureQueryLod(s1DArray, c1); - lod += textureQueryLod(s1DArray, f16c1); - lod += textureQueryLod(s2DArray, c2); - lod += textureQueryLod(s2DArray, f16c2); - lod += textureQueryLod(sCubeArray, c3); - lod += textureQueryLod(sCubeArray, f16c3); - lod += textureQueryLod(s1DShadow, c1); - lod += textureQueryLod(s1DShadow, f16c1); - lod += textureQueryLod(s2DShadow, c2); - lod += textureQueryLod(s2DShadow, f16c2); - lod += textureQueryLod(sCubeArrayShadow, c3); - lod += textureQueryLod(sCubeArrayShadow, f16c3); - lod += textureQueryLod(s1DArrayShadow, c1); - lod += textureQueryLod(s1DArrayShadow, f16c1); - lod += textureQueryLod(s2DArrayShadow, c2); - lod += textureQueryLod(s2DArrayShadow, f16c2); - lod += textureQueryLod(sCubeArrayShadow, c3); - lod += textureQueryLod(sCubeArrayShadow, f16c3); - - return lod; -} - -int testTextureQueryLevels() -{ - int levels = 0; - - levels += textureQueryLevels(s1D); - levels += textureQueryLevels(s2D); - levels += textureQueryLevels(s3D); - levels += textureQueryLevels(sCube); - levels += textureQueryLevels(s1DShadow); - levels += textureQueryLevels(s2DShadow); - levels += textureQueryLevels(sCubeShadow); - levels += textureQueryLevels(sCubeArray); - levels += textureQueryLevels(sCubeArrayShadow); - levels += textureQueryLevels(s1DArray); - levels += textureQueryLevels(s2DArray); - levels += textureQueryLevels(s1DArrayShadow); - levels += textureQueryLevels(s2DArrayShadow); - - return levels; -} - -int testTextureSamples() -{ - int samples = 0; - - samples += textureSamples(s2DMS); - samples += textureSamples(s2DMSArray); - - return samples; -} - -f16vec4 testImageLoad() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += imageLoad(i1D, int(c1)); - texel += imageLoad(i2D, ivec2(c2)); - texel += imageLoad(i3D, ivec3(c3)); - texel += imageLoad(i2DRect, ivec2(c2)); - texel += imageLoad(iCube, ivec3(c3)); - texel += imageLoad(iBuffer, int(c1)); - texel += imageLoad(i1DArray, ivec2(c2)); - texel += imageLoad(i2DArray, ivec3(c3)); - texel += imageLoad(iCubeArray, ivec3(c3)); - texel += imageLoad(i2DMS, ivec2(c2), 1); - texel += imageLoad(i2DMSArray, ivec3(c3), 1); - - return texel; -} - -void testImageStore(f16vec4 data) -{ - imageStore(i1D, int(c1), data); - imageStore(i2D, ivec2(c2), data); - imageStore(i3D, ivec3(c3), data); - imageStore(i2DRect, ivec2(c2), data); - imageStore(iCube, ivec3(c3), data); - imageStore(iBuffer, int(c1), data); - imageStore(i1DArray, ivec2(c2), data); - imageStore(i2DArray, ivec3(c3), data); - imageStore(iCubeArray, ivec3(c3), data); - imageStore(i2DMS, ivec2(c2), 1, data); - imageStore(i2DMSArray, ivec3(c3), 1, data); -} - -f16vec4 testSparseTexture() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureARB(s2D, c2, texel); - sparseTextureARB(s2D, f16c2, texel, f16bias); - sparseTextureARB(s3D, c3, texel); - sparseTextureARB(s3D, f16c3, texel, f16bias); - sparseTextureARB(sCube, c3, texel); - sparseTextureARB(sCube, f16c3, texel, f16bias); - sparseTextureARB(s2DShadow, c3, texel.x); - sparseTextureARB(s2DShadow, f16c2, compare, texel.x, f16bias); - sparseTextureARB(sCubeShadow, c4, texel.x); - sparseTextureARB(sCubeShadow, f16c3, compare, texel.x, f16bias); - sparseTextureARB(s2DArray, c3, texel); - sparseTextureARB(s2DArray, f16c3, texel, f16bias); - sparseTextureARB(sCubeArray, c4, texel); - sparseTextureARB(sCubeArray, f16c4, texel, f16bias); - sparseTextureARB(s2DArrayShadow, c4, texel.x); - sparseTextureARB(s2DArrayShadow, f16c3, compare, texel.x); - sparseTextureARB(s2DRect, c2, texel); - sparseTextureARB(s2DRect, f16c2, texel); - sparseTextureARB(s2DRectShadow, c3, texel.x); - sparseTextureARB(s2DRectShadow, f16c2, compare, texel.x); - sparseTextureARB(sCubeArrayShadow, c4, compare, texel.x); - sparseTextureARB(sCubeArrayShadow, f16c4, compare, texel.x); - - return texel; -} - -f16vec4 testSparseTextureLod() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureLodARB(s2D, c2, lod, texel); - sparseTextureLodARB(s2D, f16c2, f16lod, texel); - sparseTextureLodARB(s3D, c3, lod, texel); - sparseTextureLodARB(s3D, f16c3, f16lod, texel); - sparseTextureLodARB(sCube, c3, lod, texel); - sparseTextureLodARB(sCube, f16c3, f16lod, texel); - sparseTextureLodARB(s2DShadow, c3, lod, texel.x); - sparseTextureLodARB(s2DShadow, f16c2, compare, f16lod, texel.x); - sparseTextureLodARB(s2DArray, c3, lod, texel); - sparseTextureLodARB(s2DArray, f16c3, f16lod, texel); - sparseTextureLodARB(sCubeArray, c4, lod, texel); - sparseTextureLodARB(sCubeArray, f16c4, f16lod, texel); - - return texel; -} - -f16vec4 testSparseTextureOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureOffsetARB(s2D, c2, offset2, texel); - sparseTextureOffsetARB(s2D, f16c2, offset2, texel, f16bias); - sparseTextureOffsetARB(s3D, c3, offset3, texel); - sparseTextureOffsetARB(s3D, f16c3, offset3, texel, f16bias); - sparseTextureOffsetARB(s2DRect, c2, offset2, texel); - sparseTextureOffsetARB(s2DRect, f16c2, offset2, texel); - sparseTextureOffsetARB(s2DRectShadow, c3, offset2, texel.x); - sparseTextureOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel.x); - sparseTextureOffsetARB(s2DShadow, c3, offset2, texel.x); - sparseTextureOffsetARB(s2DShadow, f16c2, compare, offset2, texel.x, f16bias); - sparseTextureOffsetARB(s2DArray, c3, offset2, texel); - sparseTextureOffsetARB(s2DArray, f16c3, offset2, texel, f16bias); - sparseTextureOffsetARB(s2DArrayShadow, c4, offset2, texel.x); - sparseTextureOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel.x); - - return texel; -} - -f16vec4 testSparseTextureLodOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureLodOffsetARB(s2D, c2, lod, offset2, texel); - sparseTextureLodOffsetARB(s2D, f16c2, f16lod, offset2, texel); - sparseTextureLodOffsetARB(s3D, c3, lod, offset3, texel); - sparseTextureLodOffsetARB(s3D, f16c3, f16lod, offset3, texel); - sparseTextureLodOffsetARB(s2DShadow, c3, lod, offset2, texel.x); - sparseTextureLodOffsetARB(s2DShadow, f16c2, compare, f16lod, offset2, texel.x); - sparseTextureLodOffsetARB(s2DArray, c3, lod, offset2, texel); - sparseTextureLodOffsetARB(s2DArray, f16c3, f16lod, offset2, texel); - - return texel; -} - -f16vec4 testSparseTextureGrad() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGradARB(s2D, c2, dPdxy2, dPdxy2, texel); - sparseTextureGradARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, texel); - sparseTextureGradARB(s3D, c3, dPdxy3, dPdxy3, texel); - sparseTextureGradARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, texel); - sparseTextureGradARB(sCube, c3, dPdxy3, dPdxy3, texel); - sparseTextureGradARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, texel); - sparseTextureGradARB(s2DRect, c2, dPdxy2, dPdxy2, texel); - sparseTextureGradARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, texel); - sparseTextureGradARB(s2DRectShadow, c3, dPdxy2, dPdxy2, texel.x); - sparseTextureGradARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); - sparseTextureGradARB(s2DShadow, c3, dPdxy2, dPdxy2, texel.x); - sparseTextureGradARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); - sparseTextureGradARB(sCubeShadow, c4, dPdxy3, dPdxy3, texel.x); - sparseTextureGradARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, texel.x); - sparseTextureGradARB(s2DArray, c3, dPdxy2, dPdxy2, texel); - sparseTextureGradARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, texel); - sparseTextureGradARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, texel.x); - sparseTextureGradARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, texel.x); - sparseTextureGradARB(sCubeArray, c4, dPdxy3, dPdxy3, texel); - sparseTextureGradARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, texel); - - return texel; -} - -f16vec4 testSparseTextureGradOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGradOffsetARB(s2D, c2, dPdxy2, dPdxy2, offset2, texel); - sparseTextureGradOffsetARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); - sparseTextureGradOffsetARB(s3D, c3, dPdxy3, dPdxy3, offset3, texel); - sparseTextureGradOffsetARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, texel); - sparseTextureGradOffsetARB(s2DRect, c2, dPdxy2, dPdxy2, offset2, texel); - sparseTextureGradOffsetARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); - sparseTextureGradOffsetARB(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); - sparseTextureGradOffsetARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); - sparseTextureGradOffsetARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); - sparseTextureGradOffsetARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); - sparseTextureGradOffsetARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, texel); - sparseTextureGradOffsetARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, texel); - sparseTextureGradOffsetARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, texel.x); - sparseTextureGradOffsetARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); - - return texel; -} - -f16vec4 testSparseTexelFetch() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTexelFetchARB(s2D, ivec2(c2), int(lod), texel); - sparseTexelFetchARB(s3D, ivec3(c3), int(lod), texel); - sparseTexelFetchARB(s2DRect, ivec2(c2), texel); - sparseTexelFetchARB(s2DArray, ivec3(c3), int(lod), texel); - sparseTexelFetchARB(s2DMS, ivec2(c2), 1, texel); - sparseTexelFetchARB(s2DMSArray, ivec3(c3), 2, texel); - - return texel; -} - -f16vec4 testSparseTexelFetchOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTexelFetchOffsetARB(s2D, ivec2(c2), int(lod), offset2, texel); - sparseTexelFetchOffsetARB(s3D, ivec3(c3), int(lod), offset3, texel); - sparseTexelFetchOffsetARB(s2DRect, ivec2(c2), offset2, texel); - sparseTexelFetchOffsetARB(s2DArray, ivec3(c3), int(lod), offset2, texel); - - return texel; -} - -f16vec4 testSparseTextureGather() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGatherARB(s2D, c2, texel, 0); - sparseTextureGatherARB(s2D, f16c2, texel, 0, f16bias); - sparseTextureGatherARB(s2DArray, c3, texel, 0); - sparseTextureGatherARB(s2DArray, f16c3, texel, 0, f16bias); - sparseTextureGatherARB(sCube, c3, texel, 0); - sparseTextureGatherARB(sCube, f16c3, texel, 0, f16bias); - sparseTextureGatherARB(sCubeArray, c4, texel, 0); - sparseTextureGatherARB(sCubeArray, f16c4, texel, 0, f16bias); - sparseTextureGatherARB(s2DRect, c2, texel, 0); - sparseTextureGatherARB(s2DRect, f16c2, texel, 0); - sparseTextureGatherARB(s2DShadow, c2, compare, texel); - sparseTextureGatherARB(s2DShadow, f16c2, compare, texel); - sparseTextureGatherARB(s2DArrayShadow, c3, compare, texel); - sparseTextureGatherARB(s2DArrayShadow, f16c3, compare, texel); - sparseTextureGatherARB(sCubeShadow, c3, compare, texel); - sparseTextureGatherARB(sCubeShadow, f16c3, compare, texel); - sparseTextureGatherARB(sCubeArrayShadow, c4, compare, texel); - sparseTextureGatherARB(sCubeArrayShadow, f16c4, compare, texel); - sparseTextureGatherARB(s2DRectShadow, c2, compare, texel); - sparseTextureGatherARB(s2DRectShadow, f16c2, compare, texel); - - return texel; -} - -f16vec4 testSparseTextureGatherOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGatherOffsetARB(s2D, c2, offset2, texel, 0); - sparseTextureGatherOffsetARB(s2D, f16c2, offset2, texel, 0, f16bias); - sparseTextureGatherOffsetARB(s2DArray, c3, offset2, texel, 0); - sparseTextureGatherOffsetARB(s2DArray, f16c3, offset2, texel, 0, f16bias); - sparseTextureGatherOffsetARB(s2DRect, c2, offset2, texel, 0); - sparseTextureGatherOffsetARB(s2DRect, f16c2, offset2, texel, 0); - sparseTextureGatherOffsetARB(s2DShadow, c2, compare, offset2, texel); - sparseTextureGatherOffsetARB(s2DShadow, f16c2, compare, offset2, texel); - sparseTextureGatherOffsetARB(s2DArrayShadow, c3, compare, offset2, texel); - sparseTextureGatherOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel); - sparseTextureGatherOffsetARB(s2DRectShadow, c2, compare, offset2, texel); - sparseTextureGatherOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel); - - return texel; -} - -f16vec4 testSparseTextureGatherOffsets() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel, 0); - sparseTextureGatherOffsetsARB(s2D, f16c2, offsets, texel, 0, f16bias); - sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, texel, 0); - sparseTextureGatherOffsetsARB(s2DArray, f16c3, offsets, texel, 0, f16bias); - sparseTextureGatherOffsetsARB(s2DRect, c2, offsets, texel, 0); - sparseTextureGatherOffsetsARB(s2DRect, f16c2, offsets, texel, 0); - sparseTextureGatherOffsetsARB(s2DShadow, c2, compare, offsets, texel); - sparseTextureGatherOffsetsARB(s2DShadow, f16c2, compare, offsets, texel); - sparseTextureGatherOffsetsARB(s2DArrayShadow, c3, compare, offsets, texel); - sparseTextureGatherOffsetsARB(s2DArrayShadow, f16c3, compare, offsets, texel); - sparseTextureGatherOffsetsARB(s2DRectShadow, c2, compare, offsets, texel); - sparseTextureGatherOffsetsARB(s2DRectShadow, f16c2, compare, offsets, texel); - - return texel; -} - -f16vec4 testSparseTextureGatherLod() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGatherLodAMD(s2D, c2, lod, texel, 0); - sparseTextureGatherLodAMD(s2D, f16c2, f16lod, texel, 0); - sparseTextureGatherLodAMD(s2DArray, c3, lod, texel, 0); - sparseTextureGatherLodAMD(s2DArray, f16c3, f16lod, texel, 0); - sparseTextureGatherLodAMD(sCube, c3, lod, texel, 0); - sparseTextureGatherLodAMD(sCube, f16c3, f16lod, texel, 0); - sparseTextureGatherLodAMD(sCubeArray, c4, lod, texel, 0); - sparseTextureGatherLodAMD(sCubeArray, f16c4, f16lod, texel, 0); - - return texel; -} - -f16vec4 testSparseTextureGatherLodOffset() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offset2, texel, 0); - sparseTextureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, texel, 0); - sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, texel, 0); - sparseTextureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, texel, 0); - - return texel; -} - -f16vec4 testSparseTextureGatherLodOffsets() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, texel, 0); - sparseTextureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, texel, 0); - sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, texel, 0); - sparseTextureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, texel, 0); - - return texel; -} - -f16vec4 testSparseImageLoad() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseImageLoadARB(i2D, ivec2(c2), texel); - sparseImageLoadARB(i3D, ivec3(c3), texel); - sparseImageLoadARB(i2DRect, ivec2(c2), texel); - sparseImageLoadARB(iCube, ivec3(c3), texel); - sparseImageLoadARB(i2DArray, ivec3(c3), texel); - sparseImageLoadARB(iCubeArray, ivec3(c3), texel); - sparseImageLoadARB(i2DMS, ivec2(c2), 1, texel); - sparseImageLoadARB(i2DMSArray, ivec3(c3), 2, texel); - - return texel; -} - -f16vec4 testSparseTextureClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureClampARB(s2D, c2, lodClamp, texel); - sparseTextureClampARB(s2D, f16c2, f16lodClamp, texel, f16bias); - sparseTextureClampARB(s3D, c3, lodClamp, texel); - sparseTextureClampARB(s3D, f16c3, f16lodClamp, texel, f16bias); - sparseTextureClampARB(sCube, c3, lodClamp, texel); - sparseTextureClampARB(sCube, f16c3, f16lodClamp, texel, f16bias); - sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); - sparseTextureClampARB(s2DShadow, f16c2, compare, f16lodClamp, texel.x, f16bias); - sparseTextureClampARB(sCubeShadow, c4, lodClamp, texel.x); - sparseTextureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, texel.x, f16bias); - sparseTextureClampARB(s2DArray, c3, lodClamp, texel); - sparseTextureClampARB(s2DArray, f16c3, f16lodClamp, texel, f16bias); - sparseTextureClampARB(sCubeArray, c4, lodClamp, texel); - sparseTextureClampARB(sCubeArray, f16c4, f16lodClamp, texel, f16bias); - sparseTextureClampARB(s2DArrayShadow, c4, lodClamp, texel.x); - sparseTextureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp, texel.x); - sparseTextureClampARB(sCubeArrayShadow, c4, compare, lodClamp, texel.x); - sparseTextureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp, texel.x); - - return texel; -} - -f16vec4 testTextureClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureClampARB(s1D, c1, lodClamp); - texel += textureClampARB(s1D, f16c1, f16lodClamp, f16bias); - texel += textureClampARB(s2D, c2, lodClamp); - texel += textureClampARB(s2D, f16c2, f16lodClamp, f16bias); - texel += textureClampARB(s3D, c3, lodClamp); - texel += textureClampARB(s3D, f16c3, f16lodClamp, f16bias); - texel += textureClampARB(sCube, c3, lodClamp); - texel += textureClampARB(sCube, f16c3, f16lodClamp, f16bias); - texel.x += textureClampARB(s1DShadow, c3, lodClamp); - texel.x += textureClampARB(s1DShadow, f16c2, compare, f16lodClamp, f16bias); - texel.x += textureClampARB(s2DShadow, c3, lodClamp); - texel.x += textureClampARB(s2DShadow, f16c2, compare, f16lodClamp, f16bias); - texel.x += textureClampARB(sCubeShadow, c4, lodClamp); - texel.x += textureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, f16bias); - texel += textureClampARB(s1DArray, c2, lodClamp); - texel += textureClampARB(s1DArray, f16c2, f16lodClamp, f16bias); - texel += textureClampARB(s2DArray, c3, lodClamp); - texel += textureClampARB(s2DArray, f16c3, f16lodClamp, f16bias); - texel += textureClampARB(sCubeArray, c4, lodClamp); - texel += textureClampARB(sCubeArray, f16c4, f16lodClamp, f16bias); - texel.x += textureClampARB(s1DArrayShadow, c3, lodClamp); - texel.x += textureClampARB(s1DArrayShadow, f16c2, compare, f16lodClamp, f16bias); - texel.x += textureClampARB(s2DArrayShadow, c4, lodClamp); - texel.x += textureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp); - texel.x += textureClampARB(sCubeArrayShadow, c4, compare, lodClamp); - texel.x += textureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp); - - return texel; -} - -f16vec4 testSparseTextureOffsetClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureOffsetClampARB(s2D, c2, offset2, lodClamp, texel); - sparseTextureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, texel, f16bias); - sparseTextureOffsetClampARB(s3D, c3, offset3, lodClamp, texel); - sparseTextureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, texel, f16bias); - sparseTextureOffsetClampARB(s2DShadow, c3, offset2, lodClamp, texel.x); - sparseTextureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, texel.x, f16bias); - sparseTextureOffsetClampARB(s2DArray, c3, offset2, lodClamp, texel); - sparseTextureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, texel, f16bias); - sparseTextureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp, texel.x); - sparseTextureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp, texel.x); - - return texel; -} - -f16vec4 testTextureOffsetClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureOffsetClampARB(s1D, c1, offset1, lodClamp); - texel += textureOffsetClampARB(s1D, f16c1, offset1, f16lodClamp, f16bias); - texel += textureOffsetClampARB(s2D, c2, offset2, lodClamp); - texel += textureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, f16bias); - texel += textureOffsetClampARB(s3D, c3, offset3, lodClamp); - texel += textureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, f16bias); - texel.x += textureOffsetClampARB(s1DShadow, c3, offset1, lodClamp); - texel.x += textureOffsetClampARB(s1DShadow, f16c2, compare, offset1, f16lodClamp, f16bias); - texel.x += textureOffsetClampARB(s2DShadow, c3, offset2, lodClamp); - texel.x += textureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, f16bias); - texel += textureOffsetClampARB(s1DArray, c2, offset1, lodClamp); - texel += textureOffsetClampARB(s1DArray, f16c2, offset1, f16lodClamp, f16bias); - texel += textureOffsetClampARB(s2DArray, c3, offset2, lodClamp); - texel += textureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, f16bias); - texel.x += textureOffsetClampARB(s1DArrayShadow, c3, offset1, lodClamp); - texel.x += textureOffsetClampARB(s1DArrayShadow, f16c2, compare, offset1, f16lodClamp, f16bias); - texel.x += textureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp); - texel.x += textureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp); - - return texel; -} - -f16vec4 testSparseTextureGradClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp, texel); - sparseTextureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); - sparseTextureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp, texel); - sparseTextureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); - sparseTextureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp, texel); - sparseTextureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); - sparseTextureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp, texel.x); - sparseTextureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); - sparseTextureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp, texel.x); - sparseTextureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp, texel.x); - sparseTextureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp, texel); - sparseTextureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); - sparseTextureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp, texel.x); - sparseTextureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); - sparseTextureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp, texel); - sparseTextureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); - - return texel; -} - -f16vec4 testTextureGradClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGradClampARB(s1D, c1, dPdxy1, dPdxy1, lodClamp); - texel += textureGradClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, f16lodClamp); - texel += textureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp); - texel += textureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp); - texel += textureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp); - texel += textureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); - texel += textureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp); - texel += textureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); - texel.x += textureGradClampARB(s1DShadow, c3, dPdxy1, dPdxy1, lodClamp); - texel.x += textureGradClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); - texel.x += textureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp); - texel.x += textureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); - texel.x += textureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp); - texel.x += textureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp); - texel += textureGradClampARB(s1DArray, c2, dPdxy1, dPdxy1, lodClamp); - texel += textureGradClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, f16lodClamp); - texel += textureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp); - texel += textureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp); - texel.x += textureGradClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, lodClamp); - texel.x += textureGradClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); - texel.x += textureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp); - texel.x += textureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); - texel += textureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp); - texel += textureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp); - - return texel; -} - -f16vec4 testSparseTextureGradOffsetClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - sparseTextureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp, texel); - sparseTextureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); - sparseTextureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp, texel); - sparseTextureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp, texel); - sparseTextureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); - sparseTextureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); - sparseTextureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel); - sparseTextureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); - sparseTextureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); - sparseTextureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); - - return texel; -} - -f16vec4 testTextureGradOffsetClamp() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += textureGradOffsetClampARB(s1D, c1, dPdxy1, dPdxy1, offset1, lodClamp); - texel += textureGradOffsetClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); - texel += textureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp); - texel += textureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); - texel += textureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp); - texel += textureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp); - texel.x += textureGradOffsetClampARB(s1DShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); - texel.x += textureGradOffsetClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); - texel.x += textureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp); - texel.x += textureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); - texel += textureGradOffsetClampARB(s1DArray, c2, dPdxy1, dPdxy1, offset1, lodClamp); - texel += textureGradOffsetClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); - texel += textureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp); - texel += textureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); - texel.x += textureGradOffsetClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); - texel.x += textureGradOffsetClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); - texel.x += textureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp); - texel.x += textureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); - - return texel; -} - -f16vec4 testCombinedTextureSampler() -{ - f16vec4 texel = f16vec4(0.0hf); - - texel += texture(f16sampler1D(t1D, s), c1); - texel += texture(f16sampler1D(t1D, s), f16c1, f16bias); - texel += texture(f16sampler2D(t2D, s), c2); - texel += texture(f16sampler2D(t2D, s), f16c2, f16bias); - texel += texture(f16sampler3D(t3D, s), c3); - texel += texture(f16sampler3D(t3D, s), f16c3, f16bias); - texel += texture(f16samplerCube(tCube, s), c3); - texel += texture(f16samplerCube(tCube, s), f16c3, f16bias); - texel.x += texture(f16sampler1DShadow(t1D, sShadow), c3); - texel.x += texture(f16sampler1DShadow(t1D, sShadow), f16c2, compare, f16bias); - texel.x += texture(f16sampler2DShadow(t2D, sShadow), c3); - texel.x += texture(f16sampler2DShadow(t2D, sShadow), f16c2, compare, f16bias); - texel.x += texture(f16samplerCubeShadow(tCube, sShadow), c4); - texel.x += texture(f16samplerCubeShadow(tCube, sShadow), f16c3, compare, f16bias); - texel += texture(f16sampler1DArray(t1DArray, s), c2); - texel += texture(f16sampler1DArray(t1DArray, s), f16c2, f16bias); - texel += texture(f16sampler2DArray(t2DArray, s), c3); - texel += texture(f16sampler2DArray(t2DArray, s), f16c3, f16bias); - texel += texture(f16samplerCubeArray(tCubeArray, s), c4); - texel += texture(f16samplerCubeArray(tCubeArray, s), f16c4, f16bias); - texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), c3); - texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), f16c2, compare, f16bias); - texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), c4); - texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), f16c3, compare); - texel += texture(f16sampler2DRect(t2DRect, s), c2); - texel += texture(f16sampler2DRect(t2DRect, s), f16c2); - texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), c3); - texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), f16c2, compare); - texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), c4, compare); - texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), f16c4, compare); - - return texel; -} - -f16vec4 testSubpassLoad() -{ - return subpassLoad(subpass) + subpassLoad(subpassMS, 2); -} - -void main() -{ - f16vec4 result = f16vec4(0.0hf); - - result += testTexture(); - result += testTextureProj(); - result += testTextureLod(); - result += testTextureOffset(); - result += testTextureLodOffset(); - result += testTextureProjLodOffset(); - result += testTexelFetch(); - result += testTexelFetchOffset(); - result += testTextureGrad(); - result += testTextureGradOffset(); - result += testTextureProjGrad(); - result += testTextureProjGradoffset(); - result += testTextureGather(); - result += testTextureGatherOffset(); - result += testTextureGatherOffsets(); - result += testTextureGatherLod(); - result += testTextureGatherLodOffset(); - result += testTextureGatherLodOffsets(); - - result += f16vec4(testTextureSize()); - result.xy += f16vec2(testTextureQueryLod()); - result.x += float16_t(testTextureQueryLevels()); - result.x += float16_t(testTextureSamples()); - - result += testImageLoad(); - testImageStore(result); - - result += testSparseTexture(); - result += testSparseTextureLod(); - result += testSparseTextureOffset(); - result += testSparseTextureLodOffset(); - result += testSparseTextureGrad(); - result += testSparseTextureGradOffset(); - result += testSparseTexelFetch(); - result += testSparseTexelFetchOffset(); - result += testSparseTextureGather(); - result += testSparseTextureGatherOffset(); - result += testSparseTextureGatherOffsets(); - result += testSparseTextureGatherLod(); - result += testSparseTextureGatherLodOffset(); - result += testSparseTextureGatherLodOffsets(); - - result += testSparseImageLoad(); - - result += testSparseTextureClamp(); - result += testTextureClamp(); - result += testSparseTextureOffsetClamp(); - result += testTextureOffsetClamp(); - result += testSparseTextureGrad(); - result += testTextureGrad(); - result += testSparseTextureGradOffsetClamp(); - result += testTextureGradOffsetClamp(); - - result += testCombinedTextureSampler(); - result += testSubpassLoad(); - - fragColor = result; -} +#version 450 core + +#extension GL_ARB_sparse_texture2: enable +#extension GL_ARB_sparse_texture_clamp: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_half_float_fetch: enable +#extension GL_AMD_texture_gather_bias_lod: enable + +layout(set = 0, binding = 0) uniform f16sampler1D s1D; +layout(set = 0, binding = 1) uniform f16sampler2D s2D; +layout(set = 0, binding = 2) uniform f16sampler3D s3D; +layout(set = 0, binding = 3) uniform f16sampler2DRect s2DRect; +layout(set = 0, binding = 4) uniform f16samplerCube sCube; +layout(set = 0, binding = 5) uniform f16samplerBuffer sBuffer; +layout(set = 0, binding = 6) uniform f16sampler2DMS s2DMS; +layout(set = 0, binding = 7) uniform f16sampler1DArray s1DArray; +layout(set = 0, binding = 8) uniform f16sampler2DArray s2DArray; +layout(set = 0, binding = 9) uniform f16samplerCubeArray sCubeArray; +layout(set = 0, binding = 10) uniform f16sampler2DMSArray s2DMSArray; + +layout(set = 0, binding = 11) uniform f16sampler1DShadow s1DShadow; +layout(set = 0, binding = 12) uniform f16sampler2DShadow s2DShadow; +layout(set = 0, binding = 13) uniform f16sampler2DRectShadow s2DRectShadow; +layout(set = 0, binding = 14) uniform f16samplerCubeShadow sCubeShadow; +layout(set = 0, binding = 15) uniform f16sampler1DArrayShadow s1DArrayShadow; +layout(set = 0, binding = 16) uniform f16sampler2DArrayShadow s2DArrayShadow; +layout(set = 0, binding = 17) uniform f16samplerCubeArrayShadow sCubeArrayShadow; + +layout(set = 1, binding = 0) layout(rgba16f) uniform f16image1D i1D; +layout(set = 1, binding = 1) layout(rgba16f) uniform f16image2D i2D; +layout(set = 1, binding = 2) layout(rgba16f) uniform f16image3D i3D; +layout(set = 1, binding = 3) layout(rgba16f) uniform f16image2DRect i2DRect; +layout(set = 1, binding = 4) layout(rgba16f) uniform f16imageCube iCube; +layout(set = 1, binding = 5) layout(rgba16f) uniform f16image1DArray i1DArray; +layout(set = 1, binding = 6) layout(rgba16f) uniform f16image2DArray i2DArray; +layout(set = 1, binding = 7) layout(rgba16f) uniform f16imageCubeArray iCubeArray; +layout(set = 1, binding = 8) layout(rgba16f) uniform f16imageBuffer iBuffer; +layout(set = 1, binding = 9) layout(rgba16f) uniform f16image2DMS i2DMS; +layout(set = 1, binding = 10) layout(rgba16f) uniform f16image2DMSArray i2DMSArray; + +layout(set = 2, binding = 0) uniform f16texture1D t1D; +layout(set = 2, binding = 1) uniform f16texture2D t2D; +layout(set = 2, binding = 2) uniform f16texture3D t3D; +layout(set = 2, binding = 3) uniform f16texture2DRect t2DRect; +layout(set = 2, binding = 4) uniform f16textureCube tCube; +layout(set = 2, binding = 5) uniform f16texture1DArray t1DArray; +layout(set = 2, binding = 6) uniform f16texture2DArray t2DArray; +layout(set = 2, binding = 7) uniform f16textureCubeArray tCubeArray; +layout(set = 2, binding = 8) uniform f16textureBuffer tBuffer; +layout(set = 2, binding = 9) uniform f16texture2DMS t2DMS; +layout(set = 2, binding = 10) uniform f16texture2DMSArray t2DMSArray; + +layout(set = 2, binding = 11) uniform sampler s; +layout(set = 2, binding = 12) uniform samplerShadow sShadow; + +layout(set = 3, binding = 0, input_attachment_index = 0) uniform f16subpassInput subpass; +layout(set = 3, binding = 1, input_attachment_index = 0) uniform f16subpassInputMS subpassMS; + +layout(location = 0) in float c1; +layout(location = 1) in vec2 c2; +layout(location = 2) in vec3 c3; +layout(location = 3) in vec4 c4; + +layout(location = 4) in float compare; +layout(location = 5) in float lod; +layout(location = 6) in float bias; +layout(location = 7) in float lodClamp; + +layout(location = 8) in float dPdxy1; +layout(location = 9) in vec2 dPdxy2; +layout(location = 10) in vec3 dPdxy3; + +layout(location = 11) in float16_t f16c1; +layout(location = 12) in f16vec2 f16c2; +layout(location = 13) in f16vec3 f16c3; +layout(location = 14) in f16vec4 f16c4; + +layout(location = 15) in float16_t f16lod; +layout(location = 16) in float16_t f16bias; +layout(location = 17) in float16_t f16lodClamp; + +layout(location = 18) in float16_t f16dPdxy1; +layout(location = 19) in f16vec2 f16dPdxy2; +layout(location = 20) in f16vec3 f16dPdxy3; + +const int offset1 = 1; +const ivec2 offset2 = ivec2(1); +const ivec3 offset3 = ivec3(1); +const ivec2 offsets[4] = { offset2, offset2, offset2, offset2 }; + +layout(location = 0) out vec4 fragColor; + +f16vec4 testTexture() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texture(s1D, c1); + texel += texture(s1D, f16c1, f16bias); + texel += texture(s2D, c2); + texel += texture(s2D, f16c2, f16bias); + texel += texture(s3D, c3); + texel += texture(s3D, f16c3, f16bias); + texel += texture(sCube, c3); + texel += texture(sCube, f16c3, f16bias); + texel.x += texture(s1DShadow, c3); + texel.x += texture(s1DShadow, f16c2, compare, f16bias); + texel.x += texture(s2DShadow, c3); + texel.x += texture(s2DShadow, f16c2, compare, f16bias); + texel.x += texture(sCubeShadow, c4); + texel.x += texture(sCubeShadow, f16c3, compare, f16bias); + texel += texture(s1DArray, c2); + texel += texture(s1DArray, f16c2, f16bias); + texel += texture(s2DArray, c3); + texel += texture(s2DArray, f16c3, f16bias); + texel += texture(sCubeArray, c4); + texel += texture(sCubeArray, f16c4, f16bias); + texel.x += texture(s1DArrayShadow, c3); + texel.x += texture(s1DArrayShadow, f16c2, compare, f16bias); + texel.x += texture(s2DArrayShadow, c4); + texel.x += texture(s2DArrayShadow, f16c3, compare); + texel += texture(s2DRect, c2); + texel += texture(s2DRect, f16c2); + texel.x += texture(s2DRectShadow, c3); + texel.x += texture(s2DRectShadow, f16c2, compare); + texel.x += texture(sCubeArrayShadow, c4, compare); + texel.x += texture(sCubeArrayShadow, f16c4, compare); + + return texel; +} + +f16vec4 testTextureProj() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProj(s1D, c2); + texel += textureProj(s1D, f16c2, f16bias); + texel += textureProj(s1D, c4); + texel += textureProj(s1D, f16c4, f16bias); + texel += textureProj(s2D, c3); + texel += textureProj(s2D, f16c3, f16bias); + texel += textureProj(s2D, c4); + texel += textureProj(s2D, f16c4, f16bias); + texel += textureProj(s3D, c4); + texel += textureProj(s3D, f16c4, f16bias); + texel.x += textureProj(s1DShadow, c4); + texel.x += textureProj(s1DShadow, f16c3, compare, f16bias); + texel.x += textureProj(s2DShadow, c4); + texel.x += textureProj(s2DShadow, f16c3, compare, f16bias); + texel += textureProj(s2DRect, c3); + texel += textureProj(s2DRect, f16c3); + texel += textureProj(s2DRect, c4); + texel += textureProj(s2DRect, f16c4); + texel.x += textureProj(s2DRectShadow, c4); + texel.x += textureProj(s2DRectShadow, f16c3, compare); + + return texel; +} + +f16vec4 testTextureLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureLod(s1D, c1, lod); + texel += textureLod(s1D, f16c1, f16lod); + texel += textureLod(s2D, c2, lod); + texel += textureLod(s2D, f16c2, f16lod); + texel += textureLod(s3D, c3, lod); + texel += textureLod(s3D, f16c3, f16lod); + texel += textureLod(sCube, c3, lod); + texel += textureLod(sCube, f16c3, f16lod); + texel.x += textureLod(s1DShadow, c3, lod); + texel.x += textureLod(s1DShadow, f16c2, compare, f16lod); + texel.x += textureLod(s2DShadow, c3, lod); + texel.x += textureLod(s2DShadow, f16c2, compare, f16lod); + texel += textureLod(s1DArray, c2, lod); + texel += textureLod(s1DArray, f16c2, f16lod); + texel += textureLod(s2DArray, c3, lod); + texel += textureLod(s2DArray, f16c3, f16lod); + texel.x += textureLod(s1DArrayShadow, c3, lod); + texel.x += textureLod(s1DArrayShadow, f16c2, compare, f16lod); + texel += textureLod(sCubeArray, c4, lod); + texel += textureLod(sCubeArray, f16c4, f16lod); + + return texel; +} + +f16vec4 testTextureOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureOffset(s1D, c1, offset1); + texel += textureOffset(s1D, f16c1, offset1, f16bias); + texel += textureOffset(s2D, c2, offset2); + texel += textureOffset(s2D, f16c2, offset2, f16bias); + texel += textureOffset(s3D, c3, offset3); + texel += textureOffset(s3D, f16c3, offset3, f16bias); + texel += textureOffset(s2DRect, c2, offset2); + texel += textureOffset(s2DRect, f16c2, offset2); + texel.x += textureOffset(s2DRectShadow, c3, offset2); + texel.x += textureOffset(s2DRectShadow, f16c2, compare, offset2); + texel.x += textureOffset(s1DShadow, c3, offset1); + texel.x += textureOffset(s1DShadow, f16c2, compare, offset1, f16bias); + texel.x += textureOffset(s2DShadow, c3, offset2); + texel.x += textureOffset(s2DShadow, f16c2, compare, offset2, f16bias); + texel += textureOffset(s1DArray, c2, offset1); + texel += textureOffset(s1DArray, f16c2, offset1, f16bias); + texel += textureOffset(s2DArray, c3, offset2); + texel += textureOffset(s2DArray, f16c3, offset2, f16bias); + texel.x += textureOffset(s1DArrayShadow, c3, offset1); + texel.x += textureOffset(s1DArrayShadow, f16c2, compare, offset1, f16bias); + texel.x += textureOffset(s2DArrayShadow, c4, offset2); + texel.x += textureOffset(s2DArrayShadow, f16c3, compare, offset2); + + return texel; +} + +f16vec4 testTextureProjOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjOffset(s1D, c2, offset1); + texel += textureProjOffset(s1D, f16c2, offset1, f16bias); + texel += textureProjOffset(s1D, c4, offset1); + texel += textureProjOffset(s1D, f16c4, offset1, f16bias); + texel += textureProjOffset(s2D, c3, offset2); + texel += textureProjOffset(s2D, f16c3, offset2, f16bias); + texel += textureProjOffset(s2D, c4, offset2); + texel += textureProjOffset(s2D, f16c4, offset2, f16bias); + texel += textureProjOffset(s3D, c4, offset3); + texel += textureProjOffset(s3D, f16c4, offset3, f16bias); + texel += textureProjOffset(s2DRect, c3, offset2); + texel += textureProjOffset(s2DRect, f16c3, offset2); + texel += textureProjOffset(s2DRect, c4, offset2); + texel += textureProjOffset(s2DRect, f16c4, offset2); + texel.x += textureProjOffset(s2DRectShadow, c4, offset2); + texel.x += textureProjOffset(s2DRectShadow, f16c3, compare, offset2); + texel.x += textureProjOffset(s1DShadow, c4, offset1); + texel.x += textureProjOffset(s1DShadow, f16c3, compare, offset1, f16bias); + texel.x += textureProjOffset(s2DShadow, c4, offset2); + texel.x += textureProjOffset(s2DShadow, f16c3, compare, offset2, f16bias); + + return texel; +} + +f16vec4 testTextureLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureLodOffset(s1D, c1, lod, offset1); + texel += textureLodOffset(s1D, f16c1, f16lod, offset1); + texel += textureLodOffset(s2D, c2, lod, offset2); + texel += textureLodOffset(s2D, f16c2, f16lod, offset2); + texel += textureLodOffset(s3D, c3, lod, offset3); + texel += textureLodOffset(s3D, f16c3, f16lod, offset3); + texel.x += textureLodOffset(s1DShadow, c3, lod, offset1); + texel.x += textureLodOffset(s1DShadow, f16c2, compare, f16lod, offset1); + texel.x += textureLodOffset(s2DShadow, c3, lod, offset2); + texel.x += textureLodOffset(s2DShadow, f16c2, compare, f16lod, offset2); + texel += textureLodOffset(s1DArray, c2, lod, offset1); + texel += textureLodOffset(s1DArray, f16c2, f16lod, offset1); + texel += textureLodOffset(s2DArray, c3, lod, offset2); + texel += textureLodOffset(s2DArray, f16c3, f16lod, offset2); + texel.x += textureLodOffset(s1DArrayShadow, c3, lod, offset1); + texel.x += textureLodOffset(s1DArrayShadow, f16c2, compare, f16lod, offset1); + + return texel; +} + +f16vec4 testTextureProjLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjLodOffset(s1D, c2, lod, offset1); + texel += textureProjLodOffset(s1D, f16c2, f16lod, offset1); + texel += textureProjLodOffset(s1D, c4, lod, offset1); + texel += textureProjLodOffset(s1D, f16c4, f16lod, offset1); + texel += textureProjLodOffset(s2D, c3, lod, offset2); + texel += textureProjLodOffset(s2D, f16c3, f16lod, offset2); + texel += textureProjLodOffset(s2D, c4, lod, offset2); + texel += textureProjLodOffset(s2D, f16c4, f16lod, offset2); + texel += textureProjLodOffset(s3D, c4, lod, offset3); + texel += textureProjLodOffset(s3D, f16c4, f16lod, offset3); + texel.x += textureProjLodOffset(s1DShadow, c4, lod, offset1); + texel.x += textureProjLodOffset(s1DShadow, f16c3, compare, f16lod, offset1); + texel.x += textureProjLodOffset(s2DShadow, c4, lod, offset2); + texel.x += textureProjLodOffset(s2DShadow, f16c3, compare, f16lod, offset2); + + return texel; +} + +f16vec4 testTexelFetch() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texelFetch(s1D, int(c1), int(lod)); + texel += texelFetch(s2D, ivec2(c2), int(lod)); + texel += texelFetch(s3D, ivec3(c3), int(lod)); + texel += texelFetch(s2DRect, ivec2(c2)); + texel += texelFetch(s1DArray, ivec2(c2), int(lod)); + texel += texelFetch(s2DArray, ivec3(c3), int(lod)); + texel += texelFetch(sBuffer, int(c1)); + texel += texelFetch(s2DMS, ivec2(c2), 1); + texel += texelFetch(s2DMSArray, ivec3(c3), 2); + + return texel; +} + +f16vec4 testTexelFetchOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texelFetchOffset(s1D, int(c1), int(lod), offset1); + texel += texelFetchOffset(s2D, ivec2(c2), int(lod), offset2); + texel += texelFetchOffset(s3D, ivec3(c3), int(lod), offset3); + texel += texelFetchOffset(s2DRect, ivec2(c2), offset2); + texel += texelFetchOffset(s1DArray, ivec2(c2), int(lod), offset1); + texel += texelFetchOffset(s2DArray, ivec3(c3), int(lod), offset2); + + return texel; +} + +f16vec4 testTextureGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGrad(s1D, c1, dPdxy1, dPdxy1); + texel += textureGrad(s1D, f16c1, f16dPdxy1, f16dPdxy1); + texel += textureGrad(s2D, c2, dPdxy2, dPdxy2); + texel += textureGrad(s2D, f16c2, f16dPdxy2, f16dPdxy2); + texel += textureGrad(s3D, c3, dPdxy3, dPdxy3); + texel += textureGrad(s3D, f16c3, f16dPdxy3, f16dPdxy3); + texel += textureGrad(sCube, c3, dPdxy3, dPdxy3); + texel += textureGrad(sCube, f16c3, f16dPdxy3, f16dPdxy3); + texel += textureGrad(s2DRect, c2, dPdxy2, dPdxy2); + texel += textureGrad(s2DRect, f16c2, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s2DRectShadow, c3, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s1DShadow, c3, dPdxy1, dPdxy1); + texel.x += textureGrad(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureGrad(s2DShadow, c3, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(sCubeShadow, c4, dPdxy3, dPdxy3); + texel.x += textureGrad(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3); + texel += textureGrad(s1DArray, c2, dPdxy1, dPdxy1); + texel += textureGrad(s1DArray, f16c2, f16dPdxy1, f16dPdxy1); + texel += textureGrad(s2DArray, c3, dPdxy2, dPdxy2); + texel += textureGrad(s2DArray, f16c3, f16dPdxy2, f16dPdxy2); + texel.x += textureGrad(s1DArrayShadow, c3, dPdxy1, dPdxy1); + texel.x += textureGrad(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureGrad(s2DArrayShadow, c4, dPdxy2, dPdxy2); + texel.x += textureGrad(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + texel += textureGrad(sCubeArray, c4, dPdxy3, dPdxy3); + texel += textureGrad(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3); + + return texel; +} + +f16vec4 testTextureGradOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradOffset(s1D, c1, dPdxy1, dPdxy1, offset1); + texel += textureGradOffset(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1); + texel += textureGradOffset(s2D, c2, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2); + texel += textureGradOffset(s3D, c3, dPdxy3, dPdxy3, offset3); + texel += textureGradOffset(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3); + texel += textureGradOffset(s2DRect, c2, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s1DShadow, c3, dPdxy1, dPdxy1, offset1); + texel.x += textureGradOffset(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureGradOffset(s2DShadow, c3, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2); + texel += textureGradOffset(s1DArray, c2, dPdxy1, dPdxy1, offset1); + texel += textureGradOffset(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1); + texel += textureGradOffset(s2DArray, c3, dPdxy2, dPdxy2, offset2); + texel += textureGradOffset(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureGradOffset(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1); + texel.x += textureGradOffset(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureGradOffset(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureGradOffset(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + + return texel; +} + +f16vec4 testTextureProjGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjGrad(s1D, c2, dPdxy1, dPdxy1); + texel += textureProjGrad(s1D, f16c2, f16dPdxy1, f16dPdxy1); + texel += textureProjGrad(s1D, c4, dPdxy1, dPdxy1); + texel += textureProjGrad(s1D, f16c4, f16dPdxy1, f16dPdxy1); + texel += textureProjGrad(s2D, c3, dPdxy2, dPdxy2); + texel += textureProjGrad(s2D, f16c3, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s2D, c4, dPdxy2, dPdxy2); + texel += textureProjGrad(s2D, f16c4, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s3D, c4, dPdxy3, dPdxy3); + texel += textureProjGrad(s3D, f16c4, f16dPdxy3, f16dPdxy3); + texel += textureProjGrad(s2DRect, c3, dPdxy2, dPdxy2); + texel += textureProjGrad(s2DRect, f16c3, f16dPdxy2, f16dPdxy2); + texel += textureProjGrad(s2DRect, c4, dPdxy2, dPdxy2); + texel += textureProjGrad(s2DRect, f16c4, f16dPdxy2, f16dPdxy2); + texel.x += textureProjGrad(s2DRectShadow, c4, dPdxy2, dPdxy2); + texel.x += textureProjGrad(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + texel.x += textureProjGrad(s1DShadow, c4, dPdxy1, dPdxy1); + texel.x += textureProjGrad(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1); + texel.x += textureProjGrad(s2DShadow, c4, dPdxy2, dPdxy2); + texel.x += textureProjGrad(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2); + + return texel; +} + +f16vec4 testTextureProjGradoffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureProjGradOffset(s1D, c2, dPdxy1, dPdxy1, offset1); + texel += textureProjGradOffset(s1D, f16c2, f16dPdxy1, f16dPdxy1, offset1); + texel += textureProjGradOffset(s1D, c4, dPdxy1, dPdxy1, offset1); + texel += textureProjGradOffset(s1D, f16c4, f16dPdxy1, f16dPdxy1, offset1); + texel += textureProjGradOffset(s2D, c3, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2D, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2D, c4, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2D, f16c4, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, c3, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, f16c3, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, c4, dPdxy2, dPdxy2, offset2); + texel += textureProjGradOffset(s2DRect, f16c4, f16dPdxy2, f16dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DRectShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DRectShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + texel += textureProjGradOffset(s3D, c4, dPdxy3, dPdxy3, offset3); + texel += textureProjGradOffset(s3D, f16c4, f16dPdxy3, f16dPdxy3, offset3); + texel.x += textureProjGradOffset(s1DShadow, c4, dPdxy1, dPdxy1, offset1); + texel.x += textureProjGradOffset(s1DShadow, f16c3, compare, f16dPdxy1, f16dPdxy1, offset1); + texel.x += textureProjGradOffset(s2DShadow, c4, dPdxy2, dPdxy2, offset2); + texel.x += textureProjGradOffset(s2DShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2); + + return texel; +} + +f16vec4 testTextureGather() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGather(s2D, c2, 0); + texel += textureGather(s2D, f16c2, 0, f16bias); + texel += textureGather(s2DArray, c3, 0); + texel += textureGather(s2DArray, f16c3, 0, f16bias); + texel += textureGather(sCube, c3, 0); + texel += textureGather(sCube, f16c3, 0, f16bias); + texel += textureGather(sCubeArray, c4, 0); + texel += textureGather(sCubeArray, f16c4, 0, f16bias); + texel += textureGather(s2DRect, c2, 0); + texel += textureGather(s2DRect, f16c2, 0); + texel += textureGather(s2DShadow, c2, compare); + texel += textureGather(s2DShadow, f16c2, compare); + texel += textureGather(s2DArrayShadow, c3, compare); + texel += textureGather(s2DArrayShadow, f16c3, compare); + texel += textureGather(sCubeShadow, c3, compare); + texel += textureGather(sCubeShadow, f16c3, compare); + texel += textureGather(sCubeArrayShadow, c4, compare); + texel += textureGather(sCubeArrayShadow, f16c4, compare); + texel += textureGather(s2DRectShadow, c2, compare); + texel += textureGather(s2DRectShadow, f16c2, compare); + + return texel; +} + +f16vec4 testTextureGatherOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherOffset(s2D, c2, offset2, 0); + texel += textureGatherOffset(s2D, f16c2, offset2, 0, f16bias); + texel += textureGatherOffset(s2DArray, c3, offset2, 0); + texel += textureGatherOffset(s2DArray, f16c3, offset2, 0, f16bias); + texel += textureGatherOffset(s2DRect, c2, offset2, 0); + texel += textureGatherOffset(s2DRect, f16c2, offset2, 0); + texel += textureGatherOffset(s2DShadow, c2, compare, offset2); + texel += textureGatherOffset(s2DShadow, f16c2, compare, offset2); + texel += textureGatherOffset(s2DArrayShadow, c3, compare, offset2); + texel += textureGatherOffset(s2DArrayShadow, f16c3, compare, offset2); + texel += textureGatherOffset(s2DRectShadow, c2, compare, offset2); + texel += textureGatherOffset(s2DRectShadow, f16c2, compare, offset2); + + return texel; +} + +f16vec4 testTextureGatherOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherOffsets(s2D, c2, offsets, 0); + texel += textureGatherOffsets(s2D, f16c2, offsets, 0, f16bias); + texel += textureGatherOffsets(s2DArray, c3, offsets, 0); + texel += textureGatherOffsets(s2DArray, f16c3, offsets, 0, f16bias); + texel += textureGatherOffsets(s2DRect, c2, offsets, 0); + texel += textureGatherOffsets(s2DRect, f16c2, offsets, 0); + texel += textureGatherOffsets(s2DShadow, c2, compare, offsets); + texel += textureGatherOffsets(s2DShadow, f16c2, compare, offsets); + texel += textureGatherOffsets(s2DArrayShadow, c3, compare, offsets); + texel += textureGatherOffsets(s2DArrayShadow, f16c3, compare, offsets); + texel += textureGatherOffsets(s2DRectShadow, c2, compare, offsets); + texel += textureGatherOffsets(s2DRectShadow, f16c2, compare, offsets); + + return texel; +} + +f16vec4 testTextureGatherLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodAMD(s2D, c2, lod, 0); + texel += textureGatherLodAMD(s2D, f16c2, f16lod, 0); + texel += textureGatherLodAMD(s2DArray, c3, lod, 0); + texel += textureGatherLodAMD(s2DArray, f16c3, f16lod, 0); + texel += textureGatherLodAMD(sCube, c3, lod, 0); + texel += textureGatherLodAMD(sCube, f16c3, f16lod, 0); + texel += textureGatherLodAMD(sCubeArray, c4, lod, 0); + texel += textureGatherLodAMD(sCubeArray, f16c4, f16lod, 0); + + return texel; +} + +f16vec4 testTextureGatherLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodOffsetAMD(s2D, c2, lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, 0); + texel += textureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, 0); + + return texel; +} + +f16vec4 testTextureGatherLodOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 0); + texel += textureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, 0); + + return texel; +} + +ivec4 testTextureSize() +{ + ivec4 size = ivec4(0); + + size.x += textureSize(s1D, int(lod)); + size.xy += textureSize(s2D, int(lod)); + size.xyz += textureSize(s3D, int(lod)); + size.xy += textureSize(sCube, int(lod)); + size.x += textureSize(s1DShadow, int(lod)); + size.xy += textureSize(s2DShadow, int(lod)); + size.xy += textureSize(sCubeShadow, int(lod)); + size.xyz += textureSize(sCubeArray, int(lod)); + size.xyz += textureSize(sCubeArrayShadow, int(lod)); + size.xy += textureSize(s2DRect); + size.xy += textureSize(s2DRectShadow); + size.xy += textureSize(s1DArray, int(lod)); + size.xyz += textureSize(s2DArray, int(lod)); + size.xy += textureSize(s1DArrayShadow, int(lod)); + size.xyz += textureSize(s2DArrayShadow, int(lod)); + size.x += textureSize(sBuffer); + size.xy += textureSize(s2DMS); + size.xyz += textureSize(s2DMSArray); + + return size; +} + +vec2 testTextureQueryLod() +{ + vec2 lod = vec2(0.0); + + lod += textureQueryLod(s1D, c1); + lod += textureQueryLod(s1D, f16c1); + lod += textureQueryLod(s2D, c2); + lod += textureQueryLod(s2D, f16c2); + lod += textureQueryLod(s3D, c3); + lod += textureQueryLod(s3D, f16c3); + lod += textureQueryLod(sCube, c3); + lod += textureQueryLod(sCube, f16c3); + lod += textureQueryLod(s1DArray, c1); + lod += textureQueryLod(s1DArray, f16c1); + lod += textureQueryLod(s2DArray, c2); + lod += textureQueryLod(s2DArray, f16c2); + lod += textureQueryLod(sCubeArray, c3); + lod += textureQueryLod(sCubeArray, f16c3); + lod += textureQueryLod(s1DShadow, c1); + lod += textureQueryLod(s1DShadow, f16c1); + lod += textureQueryLod(s2DShadow, c2); + lod += textureQueryLod(s2DShadow, f16c2); + lod += textureQueryLod(sCubeArrayShadow, c3); + lod += textureQueryLod(sCubeArrayShadow, f16c3); + lod += textureQueryLod(s1DArrayShadow, c1); + lod += textureQueryLod(s1DArrayShadow, f16c1); + lod += textureQueryLod(s2DArrayShadow, c2); + lod += textureQueryLod(s2DArrayShadow, f16c2); + lod += textureQueryLod(sCubeArrayShadow, c3); + lod += textureQueryLod(sCubeArrayShadow, f16c3); + + return lod; +} + +int testTextureQueryLevels() +{ + int levels = 0; + + levels += textureQueryLevels(s1D); + levels += textureQueryLevels(s2D); + levels += textureQueryLevels(s3D); + levels += textureQueryLevels(sCube); + levels += textureQueryLevels(s1DShadow); + levels += textureQueryLevels(s2DShadow); + levels += textureQueryLevels(sCubeShadow); + levels += textureQueryLevels(sCubeArray); + levels += textureQueryLevels(sCubeArrayShadow); + levels += textureQueryLevels(s1DArray); + levels += textureQueryLevels(s2DArray); + levels += textureQueryLevels(s1DArrayShadow); + levels += textureQueryLevels(s2DArrayShadow); + + return levels; +} + +int testTextureSamples() +{ + int samples = 0; + + samples += textureSamples(s2DMS); + samples += textureSamples(s2DMSArray); + + return samples; +} + +f16vec4 testImageLoad() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += imageLoad(i1D, int(c1)); + texel += imageLoad(i2D, ivec2(c2)); + texel += imageLoad(i3D, ivec3(c3)); + texel += imageLoad(i2DRect, ivec2(c2)); + texel += imageLoad(iCube, ivec3(c3)); + texel += imageLoad(iBuffer, int(c1)); + texel += imageLoad(i1DArray, ivec2(c2)); + texel += imageLoad(i2DArray, ivec3(c3)); + texel += imageLoad(iCubeArray, ivec3(c3)); + texel += imageLoad(i2DMS, ivec2(c2), 1); + texel += imageLoad(i2DMSArray, ivec3(c3), 1); + + return texel; +} + +void testImageStore(f16vec4 data) +{ + imageStore(i1D, int(c1), data); + imageStore(i2D, ivec2(c2), data); + imageStore(i3D, ivec3(c3), data); + imageStore(i2DRect, ivec2(c2), data); + imageStore(iCube, ivec3(c3), data); + imageStore(iBuffer, int(c1), data); + imageStore(i1DArray, ivec2(c2), data); + imageStore(i2DArray, ivec3(c3), data); + imageStore(iCubeArray, ivec3(c3), data); + imageStore(i2DMS, ivec2(c2), 1, data); + imageStore(i2DMSArray, ivec3(c3), 1, data); +} + +f16vec4 testSparseTexture() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureARB(s2D, c2, texel); + sparseTextureARB(s2D, f16c2, texel, f16bias); + sparseTextureARB(s3D, c3, texel); + sparseTextureARB(s3D, f16c3, texel, f16bias); + sparseTextureARB(sCube, c3, texel); + sparseTextureARB(sCube, f16c3, texel, f16bias); + sparseTextureARB(s2DShadow, c3, texel.x); + sparseTextureARB(s2DShadow, f16c2, compare, texel.x, f16bias); + sparseTextureARB(sCubeShadow, c4, texel.x); + sparseTextureARB(sCubeShadow, f16c3, compare, texel.x, f16bias); + sparseTextureARB(s2DArray, c3, texel); + sparseTextureARB(s2DArray, f16c3, texel, f16bias); + sparseTextureARB(sCubeArray, c4, texel); + sparseTextureARB(sCubeArray, f16c4, texel, f16bias); + sparseTextureARB(s2DArrayShadow, c4, texel.x); + sparseTextureARB(s2DArrayShadow, f16c3, compare, texel.x); + sparseTextureARB(s2DRect, c2, texel); + sparseTextureARB(s2DRect, f16c2, texel); + sparseTextureARB(s2DRectShadow, c3, texel.x); + sparseTextureARB(s2DRectShadow, f16c2, compare, texel.x); + sparseTextureARB(sCubeArrayShadow, c4, compare, texel.x); + sparseTextureARB(sCubeArrayShadow, f16c4, compare, texel.x); + + return texel; +} + +f16vec4 testSparseTextureLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureLodARB(s2D, c2, lod, texel); + sparseTextureLodARB(s2D, f16c2, f16lod, texel); + sparseTextureLodARB(s3D, c3, lod, texel); + sparseTextureLodARB(s3D, f16c3, f16lod, texel); + sparseTextureLodARB(sCube, c3, lod, texel); + sparseTextureLodARB(sCube, f16c3, f16lod, texel); + sparseTextureLodARB(s2DShadow, c3, lod, texel.x); + sparseTextureLodARB(s2DShadow, f16c2, compare, f16lod, texel.x); + sparseTextureLodARB(s2DArray, c3, lod, texel); + sparseTextureLodARB(s2DArray, f16c3, f16lod, texel); + sparseTextureLodARB(sCubeArray, c4, lod, texel); + sparseTextureLodARB(sCubeArray, f16c4, f16lod, texel); + + return texel; +} + +f16vec4 testSparseTextureOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureOffsetARB(s2D, c2, offset2, texel); + sparseTextureOffsetARB(s2D, f16c2, offset2, texel, f16bias); + sparseTextureOffsetARB(s3D, c3, offset3, texel); + sparseTextureOffsetARB(s3D, f16c3, offset3, texel, f16bias); + sparseTextureOffsetARB(s2DRect, c2, offset2, texel); + sparseTextureOffsetARB(s2DRect, f16c2, offset2, texel); + sparseTextureOffsetARB(s2DRectShadow, c3, offset2, texel.x); + sparseTextureOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel.x); + sparseTextureOffsetARB(s2DShadow, c3, offset2, texel.x); + sparseTextureOffsetARB(s2DShadow, f16c2, compare, offset2, texel.x, f16bias); + sparseTextureOffsetARB(s2DArray, c3, offset2, texel); + sparseTextureOffsetARB(s2DArray, f16c3, offset2, texel, f16bias); + sparseTextureOffsetARB(s2DArrayShadow, c4, offset2, texel.x); + sparseTextureOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel.x); + + return texel; +} + +f16vec4 testSparseTextureLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureLodOffsetARB(s2D, c2, lod, offset2, texel); + sparseTextureLodOffsetARB(s2D, f16c2, f16lod, offset2, texel); + sparseTextureLodOffsetARB(s3D, c3, lod, offset3, texel); + sparseTextureLodOffsetARB(s3D, f16c3, f16lod, offset3, texel); + sparseTextureLodOffsetARB(s2DShadow, c3, lod, offset2, texel.x); + sparseTextureLodOffsetARB(s2DShadow, f16c2, compare, f16lod, offset2, texel.x); + sparseTextureLodOffsetARB(s2DArray, c3, lod, offset2, texel); + sparseTextureLodOffsetARB(s2DArray, f16c3, f16lod, offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGrad() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradARB(s2D, c2, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s3D, c3, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, texel); + sparseTextureGradARB(sCube, c3, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, texel); + sparseTextureGradARB(s2DRect, c2, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s2DRectShadow, c3, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(s2DShadow, c3, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(sCubeShadow, c4, dPdxy3, dPdxy3, texel.x); + sparseTextureGradARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, texel.x); + sparseTextureGradARB(s2DArray, c3, dPdxy2, dPdxy2, texel); + sparseTextureGradARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, texel); + sparseTextureGradARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, texel.x); + sparseTextureGradARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, texel.x); + sparseTextureGradARB(sCubeArray, c4, dPdxy3, dPdxy3, texel); + sparseTextureGradARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, texel); + + return texel; +} + +f16vec4 testSparseTextureGradOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradOffsetARB(s2D, c2, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s3D, c3, dPdxy3, dPdxy3, offset3, texel); + sparseTextureGradOffsetARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, texel); + sparseTextureGradOffsetARB(s2DRect, c2, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DRect, f16c2, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DRectShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DRectShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, texel); + sparseTextureGradOffsetARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, texel.x); + sparseTextureGradOffsetARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, texel.x); + + return texel; +} + +f16vec4 testSparseTexelFetch() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTexelFetchARB(s2D, ivec2(c2), int(lod), texel); + sparseTexelFetchARB(s3D, ivec3(c3), int(lod), texel); + sparseTexelFetchARB(s2DRect, ivec2(c2), texel); + sparseTexelFetchARB(s2DArray, ivec3(c3), int(lod), texel); + sparseTexelFetchARB(s2DMS, ivec2(c2), 1, texel); + sparseTexelFetchARB(s2DMSArray, ivec3(c3), 2, texel); + + return texel; +} + +f16vec4 testSparseTexelFetchOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTexelFetchOffsetARB(s2D, ivec2(c2), int(lod), offset2, texel); + sparseTexelFetchOffsetARB(s3D, ivec3(c3), int(lod), offset3, texel); + sparseTexelFetchOffsetARB(s2DRect, ivec2(c2), offset2, texel); + sparseTexelFetchOffsetARB(s2DArray, ivec3(c3), int(lod), offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGather() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherARB(s2D, c2, texel, 0); + sparseTextureGatherARB(s2D, f16c2, texel, 0, f16bias); + sparseTextureGatherARB(s2DArray, c3, texel, 0); + sparseTextureGatherARB(s2DArray, f16c3, texel, 0, f16bias); + sparseTextureGatherARB(sCube, c3, texel, 0); + sparseTextureGatherARB(sCube, f16c3, texel, 0, f16bias); + sparseTextureGatherARB(sCubeArray, c4, texel, 0); + sparseTextureGatherARB(sCubeArray, f16c4, texel, 0, f16bias); + sparseTextureGatherARB(s2DRect, c2, texel, 0); + sparseTextureGatherARB(s2DRect, f16c2, texel, 0); + sparseTextureGatherARB(s2DShadow, c2, compare, texel); + sparseTextureGatherARB(s2DShadow, f16c2, compare, texel); + sparseTextureGatherARB(s2DArrayShadow, c3, compare, texel); + sparseTextureGatherARB(s2DArrayShadow, f16c3, compare, texel); + sparseTextureGatherARB(sCubeShadow, c3, compare, texel); + sparseTextureGatherARB(sCubeShadow, f16c3, compare, texel); + sparseTextureGatherARB(sCubeArrayShadow, c4, compare, texel); + sparseTextureGatherARB(sCubeArrayShadow, f16c4, compare, texel); + sparseTextureGatherARB(s2DRectShadow, c2, compare, texel); + sparseTextureGatherARB(s2DRectShadow, f16c2, compare, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherOffsetARB(s2D, c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2D, f16c2, offset2, texel, 0, f16bias); + sparseTextureGatherOffsetARB(s2DArray, c3, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DArray, f16c3, offset2, texel, 0, f16bias); + sparseTextureGatherOffsetARB(s2DRect, c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DRect, f16c2, offset2, texel, 0); + sparseTextureGatherOffsetARB(s2DShadow, c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DShadow, f16c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DArrayShadow, c3, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DArrayShadow, f16c3, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DRectShadow, c2, compare, offset2, texel); + sparseTextureGatherOffsetARB(s2DRectShadow, f16c2, compare, offset2, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2D, f16c2, offsets, texel, 0, f16bias); + sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DArray, f16c3, offsets, texel, 0, f16bias); + sparseTextureGatherOffsetsARB(s2DRect, c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DRect, f16c2, offsets, texel, 0); + sparseTextureGatherOffsetsARB(s2DShadow, c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DShadow, f16c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DArrayShadow, c3, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DArrayShadow, f16c3, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DRectShadow, c2, compare, offsets, texel); + sparseTextureGatherOffsetsARB(s2DRectShadow, f16c2, compare, offsets, texel); + + return texel; +} + +f16vec4 testSparseTextureGatherLod() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodAMD(s2D, c2, lod, texel, 0); + sparseTextureGatherLodAMD(s2D, f16c2, f16lod, texel, 0); + sparseTextureGatherLodAMD(s2DArray, c3, lod, texel, 0); + sparseTextureGatherLodAMD(s2DArray, f16c3, f16lod, texel, 0); + sparseTextureGatherLodAMD(sCube, c3, lod, texel, 0); + sparseTextureGatherLodAMD(sCube, f16c3, f16lod, texel, 0); + sparseTextureGatherLodAMD(sCubeArray, c4, lod, texel, 0); + sparseTextureGatherLodAMD(sCubeArray, f16c4, f16lod, texel, 0); + + return texel; +} + +f16vec4 testSparseTextureGatherLodOffset() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2D, f16c2, f16lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offset2, texel, 0); + sparseTextureGatherLodOffsetAMD(s2DArray, f16c3, f16lod, offset2, texel, 0); + + return texel; +} + +f16vec4 testSparseTextureGatherLodOffsets() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2D, f16c2, f16lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, texel, 0); + sparseTextureGatherLodOffsetsAMD(s2DArray, f16c3, f16lod, offsets, texel, 0); + + return texel; +} + +f16vec4 testSparseImageLoad() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseImageLoadARB(i2D, ivec2(c2), texel); + sparseImageLoadARB(i3D, ivec3(c3), texel); + sparseImageLoadARB(i2DRect, ivec2(c2), texel); + sparseImageLoadARB(iCube, ivec3(c3), texel); + sparseImageLoadARB(i2DArray, ivec3(c3), texel); + sparseImageLoadARB(iCubeArray, ivec3(c3), texel); + sparseImageLoadARB(i2DMS, ivec2(c2), 1, texel); + sparseImageLoadARB(i2DMSArray, ivec3(c3), 2, texel); + + return texel; +} + +f16vec4 testSparseTextureClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureClampARB(s2D, c2, lodClamp, texel); + sparseTextureClampARB(s2D, f16c2, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s3D, c3, lodClamp, texel); + sparseTextureClampARB(s3D, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(sCube, c3, lodClamp, texel); + sparseTextureClampARB(sCube, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + sparseTextureClampARB(s2DShadow, f16c2, compare, f16lodClamp, texel.x, f16bias); + sparseTextureClampARB(sCubeShadow, c4, lodClamp, texel.x); + sparseTextureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, texel.x, f16bias); + sparseTextureClampARB(s2DArray, c3, lodClamp, texel); + sparseTextureClampARB(s2DArray, f16c3, f16lodClamp, texel, f16bias); + sparseTextureClampARB(sCubeArray, c4, lodClamp, texel); + sparseTextureClampARB(sCubeArray, f16c4, f16lodClamp, texel, f16bias); + sparseTextureClampARB(s2DArrayShadow, c4, lodClamp, texel.x); + sparseTextureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp, texel.x); + sparseTextureClampARB(sCubeArrayShadow, c4, compare, lodClamp, texel.x); + sparseTextureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureClampARB(s1D, c1, lodClamp); + texel += textureClampARB(s1D, f16c1, f16lodClamp, f16bias); + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s2D, f16c2, f16lodClamp, f16bias); + texel += textureClampARB(s3D, c3, lodClamp); + texel += textureClampARB(s3D, f16c3, f16lodClamp, f16bias); + texel += textureClampARB(sCube, c3, lodClamp); + texel += textureClampARB(sCube, f16c3, f16lodClamp, f16bias); + texel.x += textureClampARB(s1DShadow, c3, lodClamp); + texel.x += textureClampARB(s1DShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(sCubeShadow, c4, lodClamp); + texel.x += textureClampARB(sCubeShadow, f16c3, compare, f16lodClamp, f16bias); + texel += textureClampARB(s1DArray, c2, lodClamp); + texel += textureClampARB(s1DArray, f16c2, f16lodClamp, f16bias); + texel += textureClampARB(s2DArray, c3, lodClamp); + texel += textureClampARB(s2DArray, f16c3, f16lodClamp, f16bias); + texel += textureClampARB(sCubeArray, c4, lodClamp); + texel += textureClampARB(sCubeArray, f16c4, f16lodClamp, f16bias); + texel.x += textureClampARB(s1DArrayShadow, c3, lodClamp); + texel.x += textureClampARB(s1DArrayShadow, f16c2, compare, f16lodClamp, f16bias); + texel.x += textureClampARB(s2DArrayShadow, c4, lodClamp); + texel.x += textureClampARB(s2DArrayShadow, f16c3, compare, f16lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, compare, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, f16c4, compare, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureOffsetClampARB(s2D, c2, offset2, lodClamp, texel); + sparseTextureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s3D, c3, offset3, lodClamp, texel); + sparseTextureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s2DShadow, c3, offset2, lodClamp, texel.x); + sparseTextureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, texel.x, f16bias); + sparseTextureOffsetClampARB(s2DArray, c3, offset2, lodClamp, texel); + sparseTextureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, texel, f16bias); + sparseTextureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp, texel.x); + sparseTextureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureOffsetClampARB(s1D, c1, offset1, lodClamp); + texel += textureOffsetClampARB(s1D, f16c1, offset1, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s2D, c2, offset2, lodClamp); + texel += textureOffsetClampARB(s2D, f16c2, offset2, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s3D, c3, offset3, lodClamp); + texel += textureOffsetClampARB(s3D, f16c3, offset3, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s1DShadow, c3, offset1, lodClamp); + texel.x += textureOffsetClampARB(s1DShadow, f16c2, compare, offset1, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s2DShadow, c3, offset2, lodClamp); + texel.x += textureOffsetClampARB(s2DShadow, f16c2, compare, offset2, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s1DArray, c2, offset1, lodClamp); + texel += textureOffsetClampARB(s1DArray, f16c2, offset1, f16lodClamp, f16bias); + texel += textureOffsetClampARB(s2DArray, c3, offset2, lodClamp); + texel += textureOffsetClampARB(s2DArray, f16c3, offset2, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s1DArrayShadow, c3, offset1, lodClamp); + texel.x += textureOffsetClampARB(s1DArrayShadow, f16c2, compare, offset1, f16lodClamp, f16bias); + texel.x += textureOffsetClampARB(s2DArrayShadow, c4, offset2, lodClamp); + texel.x += textureOffsetClampARB(s2DArrayShadow, f16c3, compare, offset2, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureGradClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp, texel); + sparseTextureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); + sparseTextureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + sparseTextureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + sparseTextureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp, texel.x); + sparseTextureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); + sparseTextureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp, texel.x); + sparseTextureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp, texel.x); + sparseTextureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp, texel); + sparseTextureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp, texel); + sparseTextureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp, texel.x); + sparseTextureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp, texel.x); + sparseTextureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp, texel); + sparseTextureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp, texel); + + return texel; +} + +f16vec4 testTextureGradClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradClampARB(s1D, c1, dPdxy1, dPdxy1, lodClamp); + texel += textureGradClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel += textureGradClampARB(s2D, c2, dPdxy2, dPdxy2, lodClamp); + texel += textureGradClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel += textureGradClampARB(s3D, c3, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel += textureGradClampARB(sCube, c3, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(sCube, f16c3, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel.x += textureGradClampARB(s1DShadow, c3, dPdxy1, dPdxy1, lodClamp); + texel.x += textureGradClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel.x += textureGradClampARB(s2DShadow, c3, dPdxy2, dPdxy2, lodClamp); + texel.x += textureGradClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel.x += textureGradClampARB(sCubeShadow, c4, dPdxy3, dPdxy3, lodClamp); + texel.x += textureGradClampARB(sCubeShadow, f16c3, compare, f16dPdxy3, f16dPdxy3, f16lodClamp); + texel += textureGradClampARB(s1DArray, c2, dPdxy1, dPdxy1, lodClamp); + texel += textureGradClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel += textureGradClampARB(s2DArray, c3, dPdxy2, dPdxy2, lodClamp); + texel += textureGradClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel.x += textureGradClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, lodClamp); + texel.x += textureGradClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, f16lodClamp); + texel.x += textureGradClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, lodClamp); + texel.x += textureGradClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, f16lodClamp); + texel += textureGradClampARB(sCubeArray, c4, dPdxy3, dPdxy3, lodClamp); + texel += textureGradClampARB(sCubeArray, f16c4, f16dPdxy3, f16dPdxy3, f16lodClamp); + + return texel; +} + +f16vec4 testSparseTextureGradOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + sparseTextureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp, texel); + sparseTextureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp, texel); + sparseTextureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel); + sparseTextureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp, texel.x); + sparseTextureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp, texel.x); + + return texel; +} + +f16vec4 testTextureGradOffsetClamp() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += textureGradOffsetClampARB(s1D, c1, dPdxy1, dPdxy1, offset1, lodClamp); + texel += textureGradOffsetClampARB(s1D, f16c1, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel += textureGradOffsetClampARB(s2D, c2, dPdxy2, dPdxy2, offset2, lodClamp); + texel += textureGradOffsetClampARB(s2D, f16c2, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel += textureGradOffsetClampARB(s3D, c3, dPdxy3, dPdxy3, offset3, lodClamp); + texel += textureGradOffsetClampARB(s3D, f16c3, f16dPdxy3, f16dPdxy3, offset3, f16lodClamp); + texel.x += textureGradOffsetClampARB(s1DShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); + texel.x += textureGradOffsetClampARB(s1DShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel.x += textureGradOffsetClampARB(s2DShadow, c3, dPdxy2, dPdxy2, offset2, lodClamp); + texel.x += textureGradOffsetClampARB(s2DShadow, f16c2, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel += textureGradOffsetClampARB(s1DArray, c2, dPdxy1, dPdxy1, offset1, lodClamp); + texel += textureGradOffsetClampARB(s1DArray, f16c2, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel += textureGradOffsetClampARB(s2DArray, c3, dPdxy2, dPdxy2, offset2, lodClamp); + texel += textureGradOffsetClampARB(s2DArray, f16c3, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + texel.x += textureGradOffsetClampARB(s1DArrayShadow, c3, dPdxy1, dPdxy1, offset1, lodClamp); + texel.x += textureGradOffsetClampARB(s1DArrayShadow, f16c2, compare, f16dPdxy1, f16dPdxy1, offset1, f16lodClamp); + texel.x += textureGradOffsetClampARB(s2DArrayShadow, c4, dPdxy2, dPdxy2, offset2, lodClamp); + texel.x += textureGradOffsetClampARB(s2DArrayShadow, f16c3, compare, f16dPdxy2, f16dPdxy2, offset2, f16lodClamp); + + return texel; +} + +f16vec4 testCombinedTextureSampler() +{ + f16vec4 texel = f16vec4(0.0hf); + + texel += texture(f16sampler1D(t1D, s), c1); + texel += texture(f16sampler1D(t1D, s), f16c1, f16bias); + texel += texture(f16sampler2D(t2D, s), c2); + texel += texture(f16sampler2D(t2D, s), f16c2, f16bias); + texel += texture(f16sampler3D(t3D, s), c3); + texel += texture(f16sampler3D(t3D, s), f16c3, f16bias); + texel += texture(f16samplerCube(tCube, s), c3); + texel += texture(f16samplerCube(tCube, s), f16c3, f16bias); + texel.x += texture(f16sampler1DShadow(t1D, sShadow), c3); + texel.x += texture(f16sampler1DShadow(t1D, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16sampler2DShadow(t2D, sShadow), c3); + texel.x += texture(f16sampler2DShadow(t2D, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16samplerCubeShadow(tCube, sShadow), c4); + texel.x += texture(f16samplerCubeShadow(tCube, sShadow), f16c3, compare, f16bias); + texel += texture(f16sampler1DArray(t1DArray, s), c2); + texel += texture(f16sampler1DArray(t1DArray, s), f16c2, f16bias); + texel += texture(f16sampler2DArray(t2DArray, s), c3); + texel += texture(f16sampler2DArray(t2DArray, s), f16c3, f16bias); + texel += texture(f16samplerCubeArray(tCubeArray, s), c4); + texel += texture(f16samplerCubeArray(tCubeArray, s), f16c4, f16bias); + texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), c3); + texel.x += texture(f16sampler1DArrayShadow(t1DArray, sShadow), f16c2, compare, f16bias); + texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), c4); + texel.x += texture(f16sampler2DArrayShadow(t2DArray, sShadow), f16c3, compare); + texel += texture(f16sampler2DRect(t2DRect, s), c2); + texel += texture(f16sampler2DRect(t2DRect, s), f16c2); + texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), c3); + texel.x += texture(f16sampler2DRectShadow(t2DRect, sShadow), f16c2, compare); + texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), c4, compare); + texel.x += texture(f16samplerCubeArrayShadow(tCubeArray, sShadow), f16c4, compare); + + return texel; +} + +f16vec4 testSubpassLoad() +{ + return subpassLoad(subpass) + subpassLoad(subpassMS, 2); +} + +void main() +{ + f16vec4 result = f16vec4(0.0hf); + + result += testTexture(); + result += testTextureProj(); + result += testTextureLod(); + result += testTextureOffset(); + result += testTextureLodOffset(); + result += testTextureProjLodOffset(); + result += testTexelFetch(); + result += testTexelFetchOffset(); + result += testTextureGrad(); + result += testTextureGradOffset(); + result += testTextureProjGrad(); + result += testTextureProjGradoffset(); + result += testTextureGather(); + result += testTextureGatherOffset(); + result += testTextureGatherOffsets(); + result += testTextureGatherLod(); + result += testTextureGatherLodOffset(); + result += testTextureGatherLodOffsets(); + + result += f16vec4(testTextureSize()); + result.xy += f16vec2(testTextureQueryLod()); + result.x += float16_t(testTextureQueryLevels()); + result.x += float16_t(testTextureSamples()); + + result += testImageLoad(); + testImageStore(result); + + result += testSparseTexture(); + result += testSparseTextureLod(); + result += testSparseTextureOffset(); + result += testSparseTextureLodOffset(); + result += testSparseTextureGrad(); + result += testSparseTextureGradOffset(); + result += testSparseTexelFetch(); + result += testSparseTexelFetchOffset(); + result += testSparseTextureGather(); + result += testSparseTextureGatherOffset(); + result += testSparseTextureGatherOffsets(); + result += testSparseTextureGatherLod(); + result += testSparseTextureGatherLodOffset(); + result += testSparseTextureGatherLodOffsets(); + + result += testSparseImageLoad(); + + result += testSparseTextureClamp(); + result += testTextureClamp(); + result += testSparseTextureOffsetClamp(); + result += testTextureOffsetClamp(); + result += testSparseTextureGrad(); + result += testTextureGrad(); + result += testSparseTextureGradOffsetClamp(); + result += testTextureGradOffsetClamp(); + + result += testCombinedTextureSampler(); + result += testSubpassLoad(); + + fragColor = result; +} diff --git a/core/deps/glslang/Test/spv.float16convertonlyarith.comp b/core/deps/glslang/Test/spv.float16convertonlyarith.comp index 2eb093572..9a2e3310a 100644 --- a/core/deps/glslang/Test/spv.float16convertonlyarith.comp +++ b/core/deps/glslang/Test/spv.float16convertonlyarith.comp @@ -1,11 +1,11 @@ -#version 450 core - -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require - -layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; - -void main() -{ - vec4 v = vec4(0.0); - vec4(f16vec4(v)); +#version 450 core + +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +void main() +{ + vec4 v = vec4(0.0); + vec4(f16vec4(v)); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.float16convertonlystorage.comp b/core/deps/glslang/Test/spv.float16convertonlystorage.comp index 2112db5d3..3f8e157e9 100644 --- a/core/deps/glslang/Test/spv.float16convertonlystorage.comp +++ b/core/deps/glslang/Test/spv.float16convertonlystorage.comp @@ -1,11 +1,11 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage : require - -layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; - -void main() -{ - vec4 v = vec4(0.0); - vec4(f16vec4(v)); +#version 450 core + +#extension GL_EXT_shader_16bit_storage : require + +layout(local_size_x = 16, local_size_y = 16, local_size_z = 1) in; + +void main() +{ + vec4 v = vec4(0.0); + vec4(f16vec4(v)); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.flowControl.frag b/core/deps/glslang/Test/spv.flowControl.frag index 8d343df78..f10c76730 100644 --- a/core/deps/glslang/Test/spv.flowControl.frag +++ b/core/deps/glslang/Test/spv.flowControl.frag @@ -1,23 +1,23 @@ -#version 140 - -in float d; -in vec4 bigColor, smallColor; -in vec4 otherColor; - -in float c; -in vec4 BaseColor; - -void main() -{ - vec4 color = BaseColor; - vec4 color2; - - color2 = otherColor; - - if (c > d) - color += bigColor; - else - color += smallColor; - - gl_FragColor = color * color2; -} +#version 140 + +in float d; +in vec4 bigColor, smallColor; +in vec4 otherColor; + +in float c; +in vec4 BaseColor; + +void main() +{ + vec4 color = BaseColor; + vec4 color2; + + color2 = otherColor; + + if (c > d) + color += bigColor; + else + color += smallColor; + + gl_FragColor = color * color2; +} diff --git a/core/deps/glslang/Test/spv.forLoop.frag b/core/deps/glslang/Test/spv.forLoop.frag index a96f50d53..dfa58ad42 100644 --- a/core/deps/glslang/Test/spv.forLoop.frag +++ b/core/deps/glslang/Test/spv.forLoop.frag @@ -1,41 +1,41 @@ -#version 140 - -in vec4 bigColor; -in vec4 BaseColor; -in float f; - -flat in int Count; -flat in uvec4 v4; - -void main() -{ - vec4 color = BaseColor; - - for (int i = 0; i < Count; ++i) { - color += bigColor; - } - - gl_FragColor = color; - - float sum = 0.0; - for (int i = 0; i < 4; ++i) - sum += v4[i]; - - vec4 tv4; - - for (int i = 0; i < 4; ++i) - tv4[i] = v4[i] * 4u; - - gl_FragColor += vec4(sum) + tv4; - - vec4 r; - r.xyz = BaseColor.xyz; - - for (int i = 0; i < Count; ++i) - r.w = f; - - gl_FragColor.xyz += r.xyz; - - for (int i = 0; i < 16; i += 4) - gl_FragColor *= f; -} +#version 140 + +in vec4 bigColor; +in vec4 BaseColor; +in float f; + +flat in int Count; +flat in uvec4 v4; + +void main() +{ + vec4 color = BaseColor; + + for (int i = 0; i < Count; ++i) { + color += bigColor; + } + + gl_FragColor = color; + + float sum = 0.0; + for (int i = 0; i < 4; ++i) + sum += v4[i]; + + vec4 tv4; + + for (int i = 0; i < 4; ++i) + tv4[i] = v4[i] * 4u; + + gl_FragColor += vec4(sum) + tv4; + + vec4 r; + r.xyz = BaseColor.xyz; + + for (int i = 0; i < Count; ++i) + r.w = f; + + gl_FragColor.xyz += r.xyz; + + for (int i = 0; i < 16; i += 4) + gl_FragColor *= f; +} diff --git a/core/deps/glslang/Test/spv.forwardFun.frag b/core/deps/glslang/Test/spv.forwardFun.frag index c52cefd15..0a71521ee 100644 --- a/core/deps/glslang/Test/spv.forwardFun.frag +++ b/core/deps/glslang/Test/spv.forwardFun.frag @@ -1,39 +1,39 @@ -#version 140 - -precision mediump float; - -in vec4 bigColor; -in vec4 BaseColor; -in float d; - -void bar(); -float foo(vec4); -float unreachableReturn(); - -void main() -{ - vec4 color = vec4(foo(BaseColor)); - - bar(); - float f = unreachableReturn(); - - gl_FragColor = color * f; -} - -void bar() -{ -} - -float unreachableReturn() -{ - bar(); - if (d < 4.2) - return 1.2; - else - return 4.5; -} - -float foo(vec4 bar) -{ - return bar.x + bar.y; -} +#version 140 + +precision mediump float; + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +void bar(); +float foo(vec4); +float unreachableReturn(); + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + + gl_FragColor = color * f; +} + +void bar() +{ +} + +float unreachableReturn() +{ + bar(); + if (d < 4.2) + return 1.2; + else + return 4.5; +} + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} diff --git a/core/deps/glslang/Test/spv.fsi.frag b/core/deps/glslang/Test/spv.fsi.frag index 7a5d69979..5e6fb5fef 100644 --- a/core/deps/glslang/Test/spv.fsi.frag +++ b/core/deps/glslang/Test/spv.fsi.frag @@ -1,20 +1,20 @@ -#version 450 -#extension GL_ARB_fragment_shader_interlock : enable - -layout(set = 0, binding = 0) coherent buffer B1 { - layout(offset = 0) int x; -} b1; - -layout(set = 0, binding = 1, rgba32f) coherent uniform image2D im; - -layout(sample_interlock_ordered) in; - -void main() { - - beginInvocationInterlockARB(); - - b1.x = 1; - imageStore(im, ivec2(0,0), vec4(0)); - - endInvocationInterlockARB(); -} +#version 450 +#extension GL_ARB_fragment_shader_interlock : enable + +layout(set = 0, binding = 0) coherent buffer B1 { + layout(offset = 0) int x; +} b1; + +layout(set = 0, binding = 1, rgba32f) coherent uniform image2D im; + +layout(sample_interlock_ordered) in; + +void main() { + + beginInvocationInterlockARB(); + + b1.x = 1; + imageStore(im, ivec2(0,0), vec4(0)); + + endInvocationInterlockARB(); +} diff --git a/core/deps/glslang/Test/spv.fsi_Error.frag b/core/deps/glslang/Test/spv.fsi_Error.frag index 55c61369e..adddf3e51 100644 --- a/core/deps/glslang/Test/spv.fsi_Error.frag +++ b/core/deps/glslang/Test/spv.fsi_Error.frag @@ -1,23 +1,23 @@ -#version 450 -#extension GL_ARB_fragment_shader_interlock : enable - -layout(pixel_interlock_ordered) out; - -layout(pixel_interlock_ordered) in; -layout(pixel_interlock_unordered) in; - -void foo() -{ - beginInvocationInterlockARB(); - endInvocationInterlockARB(); -} - -void main() { - - endInvocationInterlockARB(); - beginInvocationInterlockARB(); - - return; - - endInvocationInterlockARB(); -} +#version 450 +#extension GL_ARB_fragment_shader_interlock : enable + +layout(pixel_interlock_ordered) out; + +layout(pixel_interlock_ordered) in; +layout(pixel_interlock_unordered) in; + +void foo() +{ + beginInvocationInterlockARB(); + endInvocationInterlockARB(); +} + +void main() { + + endInvocationInterlockARB(); + beginInvocationInterlockARB(); + + return; + + endInvocationInterlockARB(); +} diff --git a/core/deps/glslang/Test/spv.functionCall.frag b/core/deps/glslang/Test/spv.functionCall.frag index 0c36f4263..139638d2f 100644 --- a/core/deps/glslang/Test/spv.functionCall.frag +++ b/core/deps/glslang/Test/spv.functionCall.frag @@ -1,44 +1,44 @@ -#version 140 - -varying vec4 bigColor; -varying vec4 BaseColor; -varying float d; - -float h = 0.0; - -float foo(vec4 bar) -{ - return bar.x + bar.y; -} - -void bar() -{ -} - -float unreachableReturn() -{ - if (d < 4.2) - return 1.2; - else - return 4.5; - // might be another return inserted here by builders, has to be correct type -} - -float missingReturn() -{ - if (d < 4.5) { - h = d; - return 3.9; - } -} - -void main() -{ - vec4 color = vec4(foo(BaseColor)); - - bar(); - float f = unreachableReturn(); - float g = missingReturn(); - - gl_FragColor = color * f * h; -} +#version 140 + +varying vec4 bigColor; +varying vec4 BaseColor; +varying float d; + +float h = 0.0; + +float foo(vec4 bar) +{ + return bar.x + bar.y; +} + +void bar() +{ +} + +float unreachableReturn() +{ + if (d < 4.2) + return 1.2; + else + return 4.5; + // might be another return inserted here by builders, has to be correct type +} + +float missingReturn() +{ + if (d < 4.5) { + h = d; + return 3.9; + } +} + +void main() +{ + vec4 color = vec4(foo(BaseColor)); + + bar(); + float f = unreachableReturn(); + float g = missingReturn(); + + gl_FragColor = color * f * h; +} diff --git a/core/deps/glslang/Test/spv.functionNestedOpaque.vert b/core/deps/glslang/Test/spv.functionNestedOpaque.vert index 711c50500..9e308b133 100644 --- a/core/deps/glslang/Test/spv.functionNestedOpaque.vert +++ b/core/deps/glslang/Test/spv.functionNestedOpaque.vert @@ -1,26 +1,26 @@ -#version 450 - -uniform struct S { - sampler2D s; -} si; - -void foo(sampler2D t) -{ - texture(t, vec2(0.5)); -} - -void barc(const S p) -{ - foo(p.s); -} - -void bar(S p) -{ - foo(p.s); -} - -void main() -{ - barc(si); - bar(si); -} +#version 450 + +uniform struct S { + sampler2D s; +} si; + +void foo(sampler2D t) +{ + texture(t, vec2(0.5)); +} + +void barc(const S p) +{ + foo(p.s); +} + +void bar(S p) +{ + foo(p.s); +} + +void main() +{ + barc(si); + bar(si); +} diff --git a/core/deps/glslang/Test/spv.functionParameterTypes.frag b/core/deps/glslang/Test/spv.functionParameterTypes.frag index ed57c9c4e..08c168750 100644 --- a/core/deps/glslang/Test/spv.functionParameterTypes.frag +++ b/core/deps/glslang/Test/spv.functionParameterTypes.frag @@ -1,20 +1,20 @@ -#version 460 core -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable - -int f(int8_t i8, - uint8_t u8, - int16_t i16, - uint16_t u16, - int64_t i64, - uint64_t u64, - float16_t f16) -{ - return 0; -} - -void main() -{ -} +#version 460 core +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable + +int f(int8_t i8, + uint8_t u8, + int16_t i16, + uint16_t u16, + int64_t i64, + uint64_t u64, + float16_t f16) +{ + return 0; +} + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.functionSemantics.frag b/core/deps/glslang/Test/spv.functionSemantics.frag index 9ec236756..a9b59b761 100644 --- a/core/deps/glslang/Test/spv.functionSemantics.frag +++ b/core/deps/glslang/Test/spv.functionSemantics.frag @@ -1,63 +1,63 @@ -#version 400 - -in float u; - -int foo(int a, const int b, in int c, const in int d, out int e, inout int f) -{ - int sum = a + b + c + d + f; // no e, it is out only - // sum should be 47 now - - a *= 64; - // no b, it is read only - c *= 64; - // no d, it is read only - e = 64 * 16; // e starts undefined - f *= 64; - - sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032 - // sum should be 4032 + 47 = 4079 - - return sum; -} - -int foo2(float a, vec3 b, out int r) -{ - r = int(3.0 * a); - return int(5.0 * b.y); -} - -int foo3() -{ - if (u > 3.2) { - discard; - return 1000000; - } - - return 2000000; -} - -void main() -{ - int e; - int t = 2; - struct s { - ivec4 t; - } f; - f.t.y = 32; - - // test the different qualifers - int color = foo(1, 2, t+t, 8, e, f.t.y); - - color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216 - // sum should be 4079 + 393216 = 397295 - - // test conversions - float arg; - float ret; - ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0 - color += int(ret + arg); // adds 22, for total of 397317 - - color += foo3(); // theoretically, add 2000000, for total of 2397317 - - gl_FragColor = vec4(color); -} +#version 400 + +in float u; + +int foo(int a, const int b, in int c, const in int d, out int e, inout int f) +{ + int sum = a + b + c + d + f; // no e, it is out only + // sum should be 47 now + + a *= 64; + // no b, it is read only + c *= 64; + // no d, it is read only + e = 64 * 16; // e starts undefined + f *= 64; + + sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032 + // sum should be 4032 + 47 = 4079 + + return sum; +} + +int foo2(float a, vec3 b, out int r) +{ + r = int(3.0 * a); + return int(5.0 * b.y); +} + +int foo3() +{ + if (u > 3.2) { + discard; + return 1000000; + } + + return 2000000; +} + +void main() +{ + int e; + int t = 2; + struct s { + ivec4 t; + } f; + f.t.y = 32; + + // test the different qualifers + int color = foo(1, 2, t+t, 8, e, f.t.y); + + color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216 + // sum should be 4079 + 393216 = 397295 + + // test conversions + float arg; + float ret; + ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0 + color += int(ret + arg); // adds 22, for total of 397317 + + color += foo3(); // theoretically, add 2000000, for total of 2397317 + + gl_FragColor = vec4(color); +} diff --git a/core/deps/glslang/Test/spv.glFragColor.frag b/core/deps/glslang/Test/spv.glFragColor.frag index e1ca39324..12dbcb220 100644 --- a/core/deps/glslang/Test/spv.glFragColor.frag +++ b/core/deps/glslang/Test/spv.glFragColor.frag @@ -1,6 +1,6 @@ -#version 330 - -void main() -{ - gl_FragColor = vec4(1.0); -} +#version 330 + +void main() +{ + gl_FragColor = vec4(1.0); +} diff --git a/core/deps/glslang/Test/spv.hlslDebugInfo.vert b/core/deps/glslang/Test/spv.hlslDebugInfo.vert index 47cf19284..b2bc18778 100644 --- a/core/deps/glslang/Test/spv.hlslDebugInfo.vert +++ b/core/deps/glslang/Test/spv.hlslDebugInfo.vert @@ -1,4 +1,4 @@ -float4 origMain() : SV_Position -{ - return (float4)0; -} +float4 origMain() : SV_Position +{ + return (float4)0; +} diff --git a/core/deps/glslang/Test/spv.hlslOffsets.vert b/core/deps/glslang/Test/spv.hlslOffsets.vert index 7ba3c5a5e..26950d93a 100644 --- a/core/deps/glslang/Test/spv.hlslOffsets.vert +++ b/core/deps/glslang/Test/spv.hlslOffsets.vert @@ -1,27 +1,27 @@ -#version 450 - -layout(binding = 0) buffer block { - float m0; - vec3 m4; - ////// - float m16; - layout(offset=20) vec3 m20; - ///// - vec3 m32; - ///// - vec2 m48; - vec2 m56; - //// - float m64; - vec2 m68; - float m76; - ////// - float m80; - layout(offset=88) vec2 m88; - ////// - vec2 m96; - /////// - dvec2 m112; -}; - +#version 450 + +layout(binding = 0) buffer block { + float m0; + vec3 m4; + ////// + float m16; + layout(offset=20) vec3 m20; + ///// + vec3 m32; + ///// + vec2 m48; + vec2 m56; + //// + float m64; + vec2 m68; + float m76; + ////// + float m80; + layout(offset=88) vec2 m88; + ////// + vec2 m96; + /////// + dvec2 m112; +}; + void main() {} \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.image.frag b/core/deps/glslang/Test/spv.image.frag index 2124ab296..d9305ef2e 100644 --- a/core/deps/glslang/Test/spv.image.frag +++ b/core/deps/glslang/Test/spv.image.frag @@ -1,97 +1,97 @@ -#version 450 - -layout(rgba32f, binding = 0) uniform image1D i1D; -layout(rgba32f, binding = 1) uniform image2D i2D; -layout(rgba32f, binding = 2) uniform image3D i3D; -layout(rgba32f, binding = 3) uniform imageCube iCube; -layout(rgba32f, binding = 4) uniform imageCubeArray iCubeArray; -layout(rgba32f, binding = 5) uniform image2DRect i2DRect; -layout(rgba32f, binding = 6) uniform image1DArray i1DArray; -layout(rg16, binding = 7) uniform image2DArray i2DArray; -layout(rgba32f, binding = 8) uniform imageBuffer iBuffer; -layout(rgba32f, binding = 9) uniform image2DMS i2DMS; -layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray; - -layout(r32i, binding = 11) uniform iimage1D ii1D; -layout(r32ui, binding = 12) uniform uimage2D ui2D; -layout(r32i, binding = 13) uniform iimage2DMS ii2DMS; -layout(r32ui, binding = 14) uniform uimage2DMSArray ui2DMSArray; - -flat in int ic1D; -flat in ivec2 ic2D; -flat in ivec3 ic3D; -flat in ivec4 ic4D; - -writeonly layout(binding = 1) uniform image2D wo2D; - -flat in uint value; - -out vec4 fragData; - -void main() -{ - ivec3 iv = ivec3(0); - iv.x += imageSize(i1D); - iv.xy += imageSize(i2D); - iv.xyz += imageSize(i3D); - iv.xy += imageSize(iCube); - iv.xyz += imageSize(iCubeArray); - iv.xy += imageSize(i2DRect); - iv.xy += imageSize(i1DArray); - iv.xyz += imageSize(i2DArray); - iv.x += imageSize(iBuffer); - iv.xy += imageSize(i2DMS); - iv.xyz += imageSize(i2DMSArray); - - iv.x += imageSamples(i2DMS); - iv.x += imageSamples(i2DMSArray); - - vec4 v = vec4(0.0); - v += imageLoad(i1D, ic1D); - imageStore(i1D, ic1D, v); - v += imageLoad(i2D, ic2D); - imageStore(i2D, ic2D, v); - v += imageLoad(i3D, ic3D); - imageStore(i3D, ic3D, v); - v += imageLoad(iCube, ic3D); - imageStore(iCube, ic3D, v); - v += imageLoad(iCubeArray, ic3D); - imageStore(iCubeArray, ic3D, v); - v += imageLoad(i2DRect, ic2D); - imageStore(i2DRect, ic2D, v); - v += imageLoad(i1DArray, ic2D); - imageStore(i1DArray, ic2D, v); - v += imageLoad(i2DArray, ic3D); - imageStore(i2DArray, ic3D, v); - v += imageLoad(iBuffer, ic1D); - imageStore(iBuffer, ic1D, v); - v += imageLoad(i2DMS, ic2D, 1); - imageStore(i2DMS, ic2D, 2, v); - v += imageLoad(i2DMSArray, ic3D, 3); - imageStore(i2DMSArray, ic3D, 4, v); - - uint ui = 0; - iv.x += imageAtomicAdd(ii1D, ic1D, 10); - ui += imageAtomicAdd(ui2D, ic2D, value); - iv.x += imageAtomicMin(ii1D, ic1D, 11); - ui += imageAtomicMin(ui2D, ic2D, value); - iv.x += imageAtomicMax(ii1D, ic1D, 12); - ui += imageAtomicMax(ui2D, ic2D, value); - iv.x += imageAtomicAnd(ii1D, ic1D, 13); - ui += imageAtomicAnd(ui2D, ic2D, value); - iv.x += imageAtomicOr(ii1D, ic1D, 14); - ui += imageAtomicOr(ui2D, ic2D, value); - iv.x += imageAtomicXor(ii1D, ic1D, 15); - ui += imageAtomicXor(ui2D, ic2D, value); - iv.x += imageAtomicExchange(ii1D, ic1D, 16); - ui += imageAtomicExchange(ui2D, ic2D, value); - iv.x += imageAtomicCompSwap(ii1D, ic1D, 18, 17); - ui += imageAtomicCompSwap(ui2D, ic2D, 19u, value); - iv.x += imageAtomicCompSwap(ii2DMS, ic2D, 2, 18, 17); - ui += imageAtomicCompSwap(ui2DMSArray, ic3D, 3, 19u, value); - - imageStore(wo2D, ic2D, v); - - fragData = ui != iv.y ? v : vec4(0.0); -} - +#version 450 + +layout(rgba32f, binding = 0) uniform image1D i1D; +layout(rgba32f, binding = 1) uniform image2D i2D; +layout(rgba32f, binding = 2) uniform image3D i3D; +layout(rgba32f, binding = 3) uniform imageCube iCube; +layout(rgba32f, binding = 4) uniform imageCubeArray iCubeArray; +layout(rgba32f, binding = 5) uniform image2DRect i2DRect; +layout(rgba32f, binding = 6) uniform image1DArray i1DArray; +layout(rg16, binding = 7) uniform image2DArray i2DArray; +layout(rgba32f, binding = 8) uniform imageBuffer iBuffer; +layout(rgba32f, binding = 9) uniform image2DMS i2DMS; +layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray; + +layout(r32i, binding = 11) uniform iimage1D ii1D; +layout(r32ui, binding = 12) uniform uimage2D ui2D; +layout(r32i, binding = 13) uniform iimage2DMS ii2DMS; +layout(r32ui, binding = 14) uniform uimage2DMSArray ui2DMSArray; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +writeonly layout(binding = 1) uniform image2D wo2D; + +flat in uint value; + +out vec4 fragData; + +void main() +{ + ivec3 iv = ivec3(0); + iv.x += imageSize(i1D); + iv.xy += imageSize(i2D); + iv.xyz += imageSize(i3D); + iv.xy += imageSize(iCube); + iv.xyz += imageSize(iCubeArray); + iv.xy += imageSize(i2DRect); + iv.xy += imageSize(i1DArray); + iv.xyz += imageSize(i2DArray); + iv.x += imageSize(iBuffer); + iv.xy += imageSize(i2DMS); + iv.xyz += imageSize(i2DMSArray); + + iv.x += imageSamples(i2DMS); + iv.x += imageSamples(i2DMSArray); + + vec4 v = vec4(0.0); + v += imageLoad(i1D, ic1D); + imageStore(i1D, ic1D, v); + v += imageLoad(i2D, ic2D); + imageStore(i2D, ic2D, v); + v += imageLoad(i3D, ic3D); + imageStore(i3D, ic3D, v); + v += imageLoad(iCube, ic3D); + imageStore(iCube, ic3D, v); + v += imageLoad(iCubeArray, ic3D); + imageStore(iCubeArray, ic3D, v); + v += imageLoad(i2DRect, ic2D); + imageStore(i2DRect, ic2D, v); + v += imageLoad(i1DArray, ic2D); + imageStore(i1DArray, ic2D, v); + v += imageLoad(i2DArray, ic3D); + imageStore(i2DArray, ic3D, v); + v += imageLoad(iBuffer, ic1D); + imageStore(iBuffer, ic1D, v); + v += imageLoad(i2DMS, ic2D, 1); + imageStore(i2DMS, ic2D, 2, v); + v += imageLoad(i2DMSArray, ic3D, 3); + imageStore(i2DMSArray, ic3D, 4, v); + + uint ui = 0; + iv.x += imageAtomicAdd(ii1D, ic1D, 10); + ui += imageAtomicAdd(ui2D, ic2D, value); + iv.x += imageAtomicMin(ii1D, ic1D, 11); + ui += imageAtomicMin(ui2D, ic2D, value); + iv.x += imageAtomicMax(ii1D, ic1D, 12); + ui += imageAtomicMax(ui2D, ic2D, value); + iv.x += imageAtomicAnd(ii1D, ic1D, 13); + ui += imageAtomicAnd(ui2D, ic2D, value); + iv.x += imageAtomicOr(ii1D, ic1D, 14); + ui += imageAtomicOr(ui2D, ic2D, value); + iv.x += imageAtomicXor(ii1D, ic1D, 15); + ui += imageAtomicXor(ui2D, ic2D, value); + iv.x += imageAtomicExchange(ii1D, ic1D, 16); + ui += imageAtomicExchange(ui2D, ic2D, value); + iv.x += imageAtomicCompSwap(ii1D, ic1D, 18, 17); + ui += imageAtomicCompSwap(ui2D, ic2D, 19u, value); + iv.x += imageAtomicCompSwap(ii2DMS, ic2D, 2, 18, 17); + ui += imageAtomicCompSwap(ui2DMSArray, ic3D, 3, 19u, value); + + imageStore(wo2D, ic2D, v); + + fragData = ui != iv.y ? v : vec4(0.0); +} + diff --git a/core/deps/glslang/Test/spv.image.load-formatted.frag b/core/deps/glslang/Test/spv.image.load-formatted.frag index a7f812b79..b0adc73bf 100644 --- a/core/deps/glslang/Test/spv.image.load-formatted.frag +++ b/core/deps/glslang/Test/spv.image.load-formatted.frag @@ -1,74 +1,74 @@ -#version 450 - -#extension GL_EXT_shader_image_load_formatted : require - -layout(binding = 0) uniform image1D i1D; -layout(binding = 1) uniform image2D i2D; -layout(binding = 2) uniform image3D i3D; -layout(binding = 3) uniform imageCube iCube; -layout(binding = 4) uniform imageCubeArray iCubeArray; -layout(binding = 5) uniform image2DRect i2DRect; -layout(binding = 6) uniform image1DArray i1DArray; -layout(binding = 7) uniform image2DArray i2DArray; -layout(binding = 8) uniform imageBuffer iBuffer; -layout(binding = 9) uniform image2DMS i2DMS; -layout(binding = 10) uniform image2DMSArray i2DMSArray; - -flat in int ic1D; -flat in ivec2 ic2D; -flat in ivec3 ic3D; -flat in ivec4 ic4D; - -writeonly layout(binding = 1) uniform image2D wo2D; - -flat in uint value; - -out vec4 fragData; - -void main() -{ - ivec3 iv = ivec3(0); - iv.x += imageSize(i1D); - iv.xy += imageSize(i2D); - iv.xyz += imageSize(i3D); - iv.xy += imageSize(iCube); - iv.xyz += imageSize(iCubeArray); - iv.xy += imageSize(i2DRect); - iv.xy += imageSize(i1DArray); - iv.xyz += imageSize(i2DArray); - iv.x += imageSize(iBuffer); - iv.xy += imageSize(i2DMS); - iv.xyz += imageSize(i2DMSArray); - - iv.x += imageSamples(i2DMS); - iv.x += imageSamples(i2DMSArray); - - vec4 v = vec4(0.0); - v += imageLoad(i1D, ic1D); - imageStore(i1D, ic1D, v); - v += imageLoad(i2D, ic2D); - imageStore(i2D, ic2D, v); - v += imageLoad(i3D, ic3D); - imageStore(i3D, ic3D, v); - v += imageLoad(iCube, ic3D); - imageStore(iCube, ic3D, v); - v += imageLoad(iCubeArray, ic3D); - imageStore(iCubeArray, ic3D, v); - v += imageLoad(i2DRect, ic2D); - imageStore(i2DRect, ic2D, v); - v += imageLoad(i1DArray, ic2D); - imageStore(i1DArray, ic2D, v); - v += imageLoad(i2DArray, ic3D); - imageStore(i2DArray, ic3D, v); - v += imageLoad(iBuffer, ic1D); - imageStore(iBuffer, ic1D, v); - v += imageLoad(i2DMS, ic2D, 1); - imageStore(i2DMS, ic2D, 2, v); - v += imageLoad(i2DMSArray, ic3D, 3); - imageStore(i2DMSArray, ic3D, 4, v); - - imageStore(wo2D, ic2D, v); - - fragData = v; -} - +#version 450 + +#extension GL_EXT_shader_image_load_formatted : require + +layout(binding = 0) uniform image1D i1D; +layout(binding = 1) uniform image2D i2D; +layout(binding = 2) uniform image3D i3D; +layout(binding = 3) uniform imageCube iCube; +layout(binding = 4) uniform imageCubeArray iCubeArray; +layout(binding = 5) uniform image2DRect i2DRect; +layout(binding = 6) uniform image1DArray i1DArray; +layout(binding = 7) uniform image2DArray i2DArray; +layout(binding = 8) uniform imageBuffer iBuffer; +layout(binding = 9) uniform image2DMS i2DMS; +layout(binding = 10) uniform image2DMSArray i2DMSArray; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +writeonly layout(binding = 1) uniform image2D wo2D; + +flat in uint value; + +out vec4 fragData; + +void main() +{ + ivec3 iv = ivec3(0); + iv.x += imageSize(i1D); + iv.xy += imageSize(i2D); + iv.xyz += imageSize(i3D); + iv.xy += imageSize(iCube); + iv.xyz += imageSize(iCubeArray); + iv.xy += imageSize(i2DRect); + iv.xy += imageSize(i1DArray); + iv.xyz += imageSize(i2DArray); + iv.x += imageSize(iBuffer); + iv.xy += imageSize(i2DMS); + iv.xyz += imageSize(i2DMSArray); + + iv.x += imageSamples(i2DMS); + iv.x += imageSamples(i2DMSArray); + + vec4 v = vec4(0.0); + v += imageLoad(i1D, ic1D); + imageStore(i1D, ic1D, v); + v += imageLoad(i2D, ic2D); + imageStore(i2D, ic2D, v); + v += imageLoad(i3D, ic3D); + imageStore(i3D, ic3D, v); + v += imageLoad(iCube, ic3D); + imageStore(iCube, ic3D, v); + v += imageLoad(iCubeArray, ic3D); + imageStore(iCubeArray, ic3D, v); + v += imageLoad(i2DRect, ic2D); + imageStore(i2DRect, ic2D, v); + v += imageLoad(i1DArray, ic2D); + imageStore(i1DArray, ic2D, v); + v += imageLoad(i2DArray, ic3D); + imageStore(i2DArray, ic3D, v); + v += imageLoad(iBuffer, ic1D); + imageStore(iBuffer, ic1D, v); + v += imageLoad(i2DMS, ic2D, 1); + imageStore(i2DMS, ic2D, 2, v); + v += imageLoad(i2DMSArray, ic3D, 3); + imageStore(i2DMSArray, ic3D, 4, v); + + imageStore(wo2D, ic2D, v); + + fragData = v; +} + diff --git a/core/deps/glslang/Test/spv.imageLoadStoreLod.frag b/core/deps/glslang/Test/spv.imageLoadStoreLod.frag index 301727dd3..0da1da125 100644 --- a/core/deps/glslang/Test/spv.imageLoadStoreLod.frag +++ b/core/deps/glslang/Test/spv.imageLoadStoreLod.frag @@ -1,36 +1,36 @@ -#version 450 core - -#extension GL_AMD_shader_image_load_store_lod: enable - -layout(rgba32f, binding = 0) uniform image1D i1D; -layout(rgba32f, binding = 1) uniform image2D i2D; -layout(rgba32f, binding = 2) uniform image3D i3D; -layout(rgba32i, binding = 3) uniform iimageCube iiCube; -layout(rgba32i, binding = 4) uniform iimage1DArray ii1DArray; -layout(rgba32ui, binding = 5) uniform uimage2DArray ui2DArray; -layout(rgba32ui, binding = 6) uniform uimageCubeArray uiCubeArray; - -layout(location = 0) out vec4 fragColor; - -void main() -{ - const int c1 = 1; - const ivec2 c2 = ivec2(2, 3); - const ivec3 c3 = ivec3(4, 5, 6); - - const int lod = 3; - - vec4 f4 = vec4(0.0); - f4 += imageLoadLodAMD(i1D, c1, lod); - f4 += imageLoadLodAMD(i2D, c2, lod); - f4 += imageLoadLodAMD(i3D, c3, lod); - - imageStoreLodAMD(iiCube, c3, lod, ivec4(f4)); - imageStoreLodAMD(ii1DArray, c2, lod, ivec4(f4)); - - uvec4 u4; - sparseImageLoadLodAMD(ui2DArray, c3, lod, u4); - sparseImageLoadLodAMD(uiCubeArray, c3, lod, u4); - - fragColor = f4 + vec4(u4); +#version 450 core + +#extension GL_AMD_shader_image_load_store_lod: enable + +layout(rgba32f, binding = 0) uniform image1D i1D; +layout(rgba32f, binding = 1) uniform image2D i2D; +layout(rgba32f, binding = 2) uniform image3D i3D; +layout(rgba32i, binding = 3) uniform iimageCube iiCube; +layout(rgba32i, binding = 4) uniform iimage1DArray ii1DArray; +layout(rgba32ui, binding = 5) uniform uimage2DArray ui2DArray; +layout(rgba32ui, binding = 6) uniform uimageCubeArray uiCubeArray; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + const int c1 = 1; + const ivec2 c2 = ivec2(2, 3); + const ivec3 c3 = ivec3(4, 5, 6); + + const int lod = 3; + + vec4 f4 = vec4(0.0); + f4 += imageLoadLodAMD(i1D, c1, lod); + f4 += imageLoadLodAMD(i2D, c2, lod); + f4 += imageLoadLodAMD(i3D, c3, lod); + + imageStoreLodAMD(iiCube, c3, lod, ivec4(f4)); + imageStoreLodAMD(ii1DArray, c2, lod, ivec4(f4)); + + uvec4 u4; + sparseImageLoadLodAMD(ui2DArray, c3, lod, u4); + sparseImageLoadLodAMD(uiCubeArray, c3, lod, u4); + + fragColor = f4 + vec4(u4); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.int64.frag b/core/deps/glslang/Test/spv.int64.frag index 971614796..5390fb751 100644 --- a/core/deps/glslang/Test/spv.int64.frag +++ b/core/deps/glslang/Test/spv.int64.frag @@ -1,268 +1,268 @@ -#version 450 - -#extension GL_ARB_gpu_shader_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: require - -layout(binding = 0) uniform Uniforms -{ - uint index; -}; - -layout(std140, binding = 1) uniform Block -{ - i64vec3 i64v; - uint64_t u64; -} block; - -void main() -{ -} - -void literal() -{ - const int64_t i64Const[3] = - { - -0x1111111111111111l, // Hex - -1l, // Dec - 040000000000l, // Oct - }; - - int64_t i64 = i64Const[index]; - - const uint64_t u64Const[] = - { - 0xFFFFFFFFFFFFFFFFul, // Hex - 4294967296UL, // Dec - 077777777777ul, // Oct - }; - - uint64_t u64 = u64Const[index]; -} - -void typeCast() -{ - bvec2 bv; - ivec2 iv; - uvec2 uv; - vec2 fv; - dvec2 dv; - - i64vec2 i64v; - u64vec2 u64v; - - i64v = i64vec2(bv); // bool -> int64 - u64v = u64vec2(bv); // bool -> uint64 - - i64v = iv; // int -> int64 - iv = ivec2(i64v); // int64 -> int - - u64v = uv; // uint -> uint64 - uv = uvec2(u64v); // uint64 -> uint - - fv = vec2(i64v); // int64 -> float - dv = i64v; // int64 -> double - - fv = vec2(u64v); // uint64 -> float - dv = u64v; // uint64 -> double - - i64v = i64vec2(fv); // float -> int64 - i64v = i64vec2(dv); // double -> int64 - - u64v = u64vec2(fv); // float -> uint64 - u64v = u64vec2(dv); // double -> uint64 - - bv = bvec2(i64v); // int64 -> bool - bv = bvec2(u64v); // uint64 -> bool - - u64v = i64v; // int64 -> uint64 - i64v = i64vec2(u64v); // uint64 -> int64 - - uv = uvec2(i64v); // int64 -> uint - i64v = i64vec2(uv); // uint -> int64 - iv = ivec2(u64v); // uint64 -> int - u64v = iv; // int -> uint64 -} - -void operators() -{ - u64vec3 u64v; - int64_t i64; - uvec3 uv; - int i; - bool b; - - // Unary - u64v++; - i64--; - ++i64; - --u64v; - - u64v = ~u64v; - - i64 = +i64; - u64v = -u64v; - - // Arithmetic - i64 += i64; - u64v -= u64v; - i64 *= i; - u64v /= uv; - u64v %= i; - - u64v = u64v + uv; - i64 = i64 - i; - u64v = u64v * uv; - i64 = i64 * i; - i64 = i64 % i; - - // Shift - u64v = u64v << i; - i64 = i64 >> uv.y; - u64v <<= i; - i64 >>= uv.y; - - i64 = i64 << u64v.z; - u64v = u64v << i64; - - // Relational - b = (u64v.x != i64); - b = (i64 == u64v.x); - b = (u64v.x > uv.y); - b = (i64 < i); - b = (u64v.y >= uv.x); - b = (i64 <= i); - - // Bitwise - u64v |= i; - i64 = i64 | i; - i64 &= i; - u64v = u64v & uv; - u64v ^= i64; - u64v = u64v ^ i64; -} - -void builtinFuncs() -{ - i64vec2 i64v; - u64vec3 u64v; - dvec3 dv; - bvec3 bv; - - int64_t i64; - uint64_t u64; - - // abs() - i64v = abs(i64v); - - // sign() - i64 = sign(i64); - - // min() - i64v = min(i64v, i64); - i64v = min(i64v, i64vec2(-1)); - u64v = min(u64v, u64); - u64v = min(u64v, u64vec3(0)); - - // max() - i64v = max(i64v, i64); - i64v = max(i64v, i64vec2(-1)); - u64v = max(u64v, u64); - u64v = max(u64v, u64vec3(0)); - - // clamp() - i64v = clamp(i64v, -i64, i64); - i64v = clamp(i64v, -i64v, i64v); - u64v = clamp(u64v, -u64, u64); - u64v = clamp(u64v, -u64v, u64v); - - // mix() - i64 = mix(i64v.x, i64v.y, true); - i64v = mix(i64vec2(i64), i64vec2(-i64), bvec2(false)); - u64 = mix(u64v.x, u64v.y, true); - u64v = mix(u64vec3(u64), u64vec3(-u64), bvec3(false)); - - // doubleBitsToInt64() - i64v = doubleBitsToInt64(dv.xy); - - // doubleBitsToUint64() - u64v.x = doubleBitsToUint64(dv.z); - - // int64BitsToDouble() - dv.xy = int64BitsToDouble(i64v); - - // uint64BitsToDouble() - dv = uint64BitsToDouble(u64v); - - // packInt2x32() - i64 = packInt2x32(ivec2(1, 2)); - - // unpackInt2x32() - ivec2 iv = unpackInt2x32(i64); - - // packUint2x32() - u64 = packUint2x32(uvec2(2, 3)); - - // unpackUint2x32() - uvec2 uv = unpackUint2x32(u64); - - // lessThan() - bv = lessThan(u64v, u64vec3(u64)); - bv.xy = lessThan(i64v, i64vec2(i64)); - - // lessThanEqual() - bv = lessThanEqual(u64v, u64vec3(u64)); - bv.xy = lessThanEqual(i64v, i64vec2(i64)); - - // greaterThan() - bv = greaterThan(u64v, u64vec3(u64)); - bv.xy = greaterThan(i64v, i64vec2(i64)); - - // greaterThanEqual() - bv = greaterThanEqual(u64v, u64vec3(u64)); - bv.xy = greaterThanEqual(i64v, i64vec2(i64)); - - // equal() - bv = equal(u64v, u64vec3(u64)); - bv.xy = equal(i64v, i64vec2(i64)); - - // notEqual() - bv = notEqual(u64v, u64vec3(u64)); - bv.xy = notEqual(i64v, i64vec2(i64)); -} - -// Type conversion for specialization constant -layout(constant_id = 100) const int64_t si64 = -10L; -layout(constant_id = 101) const uint64_t su64 = 20UL; -layout(constant_id = 102) const int si = -5; -layout(constant_id = 103) const uint su = 4; -layout(constant_id = 104) const bool sb = true; -layout(constant_id = 105) const uint64_t su64inc = su64 + 1UL; - -// bool <-> int64/uint64 -const bool i64_to_b = bool(si64); -const bool u64_to_b = bool(su64); -const int64_t b_to_i64 = int64_t(sb); -const uint64_t b_to_u64 = uint64_t(sb); - -// int <-> int64 -const int i64_to_i = int(si64); -const int64_t i_to_i64 = int64_t(si); - -// uint <-> uint64 -const uint u64_to_u = uint(su64); -const uint64_t u_to_u64 = uint64_t(su); - -// int64 <-> uint64 -const int64_t u64_to_i64 = int64_t(su64); -const uint64_t i64_to_u64 = uint64_t(si64); - -// int <-> uint64 -const int u64_to_i = int(su64); -const uint64_t i_to_u64 = uint64_t(si); - -// uint <-> int64 -const uint i64_to_u = uint(si64); -const int64_t u_to_i64 = int64_t(su); - -#define UINT64_MAX 18446744073709551615ul -uint64_t u64Max = UINT64_MAX; +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: require + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + i64vec3 i64v; + uint64_t u64; +} block; + +void main() +{ +} + +void literal() +{ + const int64_t i64Const[3] = + { + -0x1111111111111111l, // Hex + -1l, // Dec + 040000000000l, // Oct + }; + + int64_t i64 = i64Const[index]; + + const uint64_t u64Const[] = + { + 0xFFFFFFFFFFFFFFFFul, // Hex + 4294967296UL, // Dec + 077777777777ul, // Oct + }; + + uint64_t u64 = u64Const[index]; +} + +void typeCast() +{ + bvec2 bv; + ivec2 iv; + uvec2 uv; + vec2 fv; + dvec2 dv; + + i64vec2 i64v; + u64vec2 u64v; + + i64v = i64vec2(bv); // bool -> int64 + u64v = u64vec2(bv); // bool -> uint64 + + i64v = iv; // int -> int64 + iv = ivec2(i64v); // int64 -> int + + u64v = uv; // uint -> uint64 + uv = uvec2(u64v); // uint64 -> uint + + fv = vec2(i64v); // int64 -> float + dv = i64v; // int64 -> double + + fv = vec2(u64v); // uint64 -> float + dv = u64v; // uint64 -> double + + i64v = i64vec2(fv); // float -> int64 + i64v = i64vec2(dv); // double -> int64 + + u64v = u64vec2(fv); // float -> uint64 + u64v = u64vec2(dv); // double -> uint64 + + bv = bvec2(i64v); // int64 -> bool + bv = bvec2(u64v); // uint64 -> bool + + u64v = i64v; // int64 -> uint64 + i64v = i64vec2(u64v); // uint64 -> int64 + + uv = uvec2(i64v); // int64 -> uint + i64v = i64vec2(uv); // uint -> int64 + iv = ivec2(u64v); // uint64 -> int + u64v = iv; // int -> uint64 +} + +void operators() +{ + u64vec3 u64v; + int64_t i64; + uvec3 uv; + int i; + bool b; + + // Unary + u64v++; + i64--; + ++i64; + --u64v; + + u64v = ~u64v; + + i64 = +i64; + u64v = -u64v; + + // Arithmetic + i64 += i64; + u64v -= u64v; + i64 *= i; + u64v /= uv; + u64v %= i; + + u64v = u64v + uv; + i64 = i64 - i; + u64v = u64v * uv; + i64 = i64 * i; + i64 = i64 % i; + + // Shift + u64v = u64v << i; + i64 = i64 >> uv.y; + u64v <<= i; + i64 >>= uv.y; + + i64 = i64 << u64v.z; + u64v = u64v << i64; + + // Relational + b = (u64v.x != i64); + b = (i64 == u64v.x); + b = (u64v.x > uv.y); + b = (i64 < i); + b = (u64v.y >= uv.x); + b = (i64 <= i); + + // Bitwise + u64v |= i; + i64 = i64 | i; + i64 &= i; + u64v = u64v & uv; + u64v ^= i64; + u64v = u64v ^ i64; +} + +void builtinFuncs() +{ + i64vec2 i64v; + u64vec3 u64v; + dvec3 dv; + bvec3 bv; + + int64_t i64; + uint64_t u64; + + // abs() + i64v = abs(i64v); + + // sign() + i64 = sign(i64); + + // min() + i64v = min(i64v, i64); + i64v = min(i64v, i64vec2(-1)); + u64v = min(u64v, u64); + u64v = min(u64v, u64vec3(0)); + + // max() + i64v = max(i64v, i64); + i64v = max(i64v, i64vec2(-1)); + u64v = max(u64v, u64); + u64v = max(u64v, u64vec3(0)); + + // clamp() + i64v = clamp(i64v, -i64, i64); + i64v = clamp(i64v, -i64v, i64v); + u64v = clamp(u64v, -u64, u64); + u64v = clamp(u64v, -u64v, u64v); + + // mix() + i64 = mix(i64v.x, i64v.y, true); + i64v = mix(i64vec2(i64), i64vec2(-i64), bvec2(false)); + u64 = mix(u64v.x, u64v.y, true); + u64v = mix(u64vec3(u64), u64vec3(-u64), bvec3(false)); + + // doubleBitsToInt64() + i64v = doubleBitsToInt64(dv.xy); + + // doubleBitsToUint64() + u64v.x = doubleBitsToUint64(dv.z); + + // int64BitsToDouble() + dv.xy = int64BitsToDouble(i64v); + + // uint64BitsToDouble() + dv = uint64BitsToDouble(u64v); + + // packInt2x32() + i64 = packInt2x32(ivec2(1, 2)); + + // unpackInt2x32() + ivec2 iv = unpackInt2x32(i64); + + // packUint2x32() + u64 = packUint2x32(uvec2(2, 3)); + + // unpackUint2x32() + uvec2 uv = unpackUint2x32(u64); + + // lessThan() + bv = lessThan(u64v, u64vec3(u64)); + bv.xy = lessThan(i64v, i64vec2(i64)); + + // lessThanEqual() + bv = lessThanEqual(u64v, u64vec3(u64)); + bv.xy = lessThanEqual(i64v, i64vec2(i64)); + + // greaterThan() + bv = greaterThan(u64v, u64vec3(u64)); + bv.xy = greaterThan(i64v, i64vec2(i64)); + + // greaterThanEqual() + bv = greaterThanEqual(u64v, u64vec3(u64)); + bv.xy = greaterThanEqual(i64v, i64vec2(i64)); + + // equal() + bv = equal(u64v, u64vec3(u64)); + bv.xy = equal(i64v, i64vec2(i64)); + + // notEqual() + bv = notEqual(u64v, u64vec3(u64)); + bv.xy = notEqual(i64v, i64vec2(i64)); +} + +// Type conversion for specialization constant +layout(constant_id = 100) const int64_t si64 = -10L; +layout(constant_id = 101) const uint64_t su64 = 20UL; +layout(constant_id = 102) const int si = -5; +layout(constant_id = 103) const uint su = 4; +layout(constant_id = 104) const bool sb = true; +layout(constant_id = 105) const uint64_t su64inc = su64 + 1UL; + +// bool <-> int64/uint64 +const bool i64_to_b = bool(si64); +const bool u64_to_b = bool(su64); +const int64_t b_to_i64 = int64_t(sb); +const uint64_t b_to_u64 = uint64_t(sb); + +// int <-> int64 +const int i64_to_i = int(si64); +const int64_t i_to_i64 = int64_t(si); + +// uint <-> uint64 +const uint u64_to_u = uint(su64); +const uint64_t u_to_u64 = uint64_t(su); + +// int64 <-> uint64 +const int64_t u64_to_i64 = int64_t(su64); +const uint64_t i64_to_u64 = uint64_t(si64); + +// int <-> uint64 +const int u64_to_i = int(su64); +const uint64_t i_to_u64 = uint64_t(si); + +// uint <-> int64 +const uint i64_to_u = uint(si64); +const int64_t u_to_i64 = int64_t(su); + +#define UINT64_MAX 18446744073709551615ul +uint64_t u64Max = UINT64_MAX; diff --git a/core/deps/glslang/Test/spv.intOps.vert b/core/deps/glslang/Test/spv.intOps.vert index 30f20f93d..b7d749b44 100644 --- a/core/deps/glslang/Test/spv.intOps.vert +++ b/core/deps/glslang/Test/spv.intOps.vert @@ -1,72 +1,72 @@ -#version 310 es - -in uint u1; -in uvec2 u2; -in uvec3 u3; -in uvec4 u4; - -in float v1; -in vec2 v2; -in vec3 v3; -in vec4 v4; - -in int i1; -in ivec2 i2; -in ivec3 i3; -in ivec4 i4; - -out uvec4 uout; -out ivec4 iout; -out vec4 fout; - -void main() -{ - iout = ivec4(0); - uout = uvec4(0); - fout = vec4(0.0); - - uvec2 u2out; - uout.xy += uaddCarry(u2, u2, u2out); - uout.xy += u2out; - - uint u1out; - uout.x += usubBorrow(u1, u1, u1out); - uout.x += u1out; - - uvec4 u4outHi, u4outLow; - umulExtended(u4, u4, u4outHi, u4outLow); - uout += u4outHi + u4outLow; - - ivec4 i4outHi, i4outLow; - imulExtended(i4, i4, i4outHi, i4outLow); - iout += i4outLow + i4outHi; - - ivec3 i3out; - fout.xyz += frexp(v3, i3out); - iout.xyz += i3out; - int i1out; - fout.x += frexp(v1, i1out); - iout.x += i1out; - - fout.xy += ldexp(v2, i2); - fout.x += ldexp(v1, i1); - - iout.x += bitfieldExtract(i1, 4, 5); - uout.xyz += bitfieldExtract(u3, 4, 5); - iout.xyz += bitfieldInsert(i3, i3, 4, 5); - uout.x += bitfieldInsert(u1, u1, 4, 5); - iout.xy += bitfieldReverse(i2); - uout += bitfieldReverse(u4); - iout.x += bitCount(i1); - iout.xyz += bitCount(u3); - - iout.xy += findLSB(i2); - iout += findLSB(u4); - iout.x += findMSB(i1); - iout.xy += findMSB(u2); - - uout.x += packUnorm4x8(v4); - uout.x += packSnorm4x8(v4); - fout += unpackUnorm4x8(u1); - fout += unpackSnorm4x8(u1); -} +#version 310 es + +in uint u1; +in uvec2 u2; +in uvec3 u3; +in uvec4 u4; + +in float v1; +in vec2 v2; +in vec3 v3; +in vec4 v4; + +in int i1; +in ivec2 i2; +in ivec3 i3; +in ivec4 i4; + +out uvec4 uout; +out ivec4 iout; +out vec4 fout; + +void main() +{ + iout = ivec4(0); + uout = uvec4(0); + fout = vec4(0.0); + + uvec2 u2out; + uout.xy += uaddCarry(u2, u2, u2out); + uout.xy += u2out; + + uint u1out; + uout.x += usubBorrow(u1, u1, u1out); + uout.x += u1out; + + uvec4 u4outHi, u4outLow; + umulExtended(u4, u4, u4outHi, u4outLow); + uout += u4outHi + u4outLow; + + ivec4 i4outHi, i4outLow; + imulExtended(i4, i4, i4outHi, i4outLow); + iout += i4outLow + i4outHi; + + ivec3 i3out; + fout.xyz += frexp(v3, i3out); + iout.xyz += i3out; + int i1out; + fout.x += frexp(v1, i1out); + iout.x += i1out; + + fout.xy += ldexp(v2, i2); + fout.x += ldexp(v1, i1); + + iout.x += bitfieldExtract(i1, 4, 5); + uout.xyz += bitfieldExtract(u3, 4, 5); + iout.xyz += bitfieldInsert(i3, i3, 4, 5); + uout.x += bitfieldInsert(u1, u1, 4, 5); + iout.xy += bitfieldReverse(i2); + uout += bitfieldReverse(u4); + iout.x += bitCount(i1); + iout.xyz += bitCount(u3); + + iout.xy += findLSB(i2); + iout += findLSB(u4); + iout.x += findMSB(i1); + iout.xy += findMSB(u2); + + uout.x += packUnorm4x8(v4); + uout.x += packSnorm4x8(v4); + fout += unpackUnorm4x8(u1); + fout += unpackSnorm4x8(u1); +} diff --git a/core/deps/glslang/Test/spv.intcoopmat.comp b/core/deps/glslang/Test/spv.intcoopmat.comp index 1b87cf533..235aa16be 100644 --- a/core/deps/glslang/Test/spv.intcoopmat.comp +++ b/core/deps/glslang/Test/spv.intcoopmat.comp @@ -1,117 +1,117 @@ #version 450 core -#extension GL_KHR_memory_scope_semantics : enable -#extension GL_NV_cooperative_matrix : enable -#extension GL_NV_integer_cooperative_matrix : enable -#extension GL_EXT_shader_explicit_arithmetic_types : enable -#extension GL_EXT_buffer_reference : enable - +#extension GL_KHR_memory_scope_semantics : enable +#extension GL_NV_cooperative_matrix : enable +#extension GL_NV_integer_cooperative_matrix : enable +#extension GL_EXT_shader_explicit_arithmetic_types : enable +#extension GL_EXT_buffer_reference : enable + layout (local_size_x = 64, local_size_y = 1, local_size_z = 1) in; - -const int X = 8; -layout(constant_id = 0) const int Y = 2; -const int Z = X*Y; - -icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC; -icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC2[3]; -ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC; -ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC2[3]; - -int iarr[miC.length()]; -int iarr2[miC2[1].length()]; -int uarr[muC.length()]; -int uarr2[muC2[1].length()]; - -const icoopmatNV<32, gl_ScopeSubgroup, Z, 8> mD = icoopmatNV<32, gl_ScopeSubgroup, Z, 8>(1); -const ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> mD2 = ucoopmatNV<8, gl_ScopeSubgroup, 8, 8>(1); - -struct S { int a; int b; int c; }; - -const S s = S(12, 23, 34); - -layout(set = 0, binding = 0, buffer_reference) coherent buffer Block { - uint y[1024*1024]; - uint x[]; -} block; - -layout(set = 0, binding = 0) coherent buffer Block16 { - int8_t y[1024*1024]; - int8_t x[]; - - Block b; -} block8; - -icoopmatNV<8, gl_ScopeSubgroup, 8, 8> ineg(icoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return -m; } -ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> umul(ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return m * uint8_t(2); } - -layout(constant_id = 2) const int SC = 1; -ucoopmatNV<32, gl_ScopeSubgroup, SC, SC> scm[SC][SC]; - -// sized for icoopmatNV<8, gl_ScopeSubgroup, 16, 16> -shared uvec4 shmatrix[16*16*2/16]; - + +const int X = 8; +layout(constant_id = 0) const int Y = 2; +const int Z = X*Y; + +icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC; +icoopmatNV<8, gl_ScopeSubgroup, Z, 8> miC2[3]; +ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC; +ucoopmatNV<8, gl_ScopeSubgroup, Z, 8> muC2[3]; + +int iarr[miC.length()]; +int iarr2[miC2[1].length()]; +int uarr[muC.length()]; +int uarr2[muC2[1].length()]; + +const icoopmatNV<32, gl_ScopeSubgroup, Z, 8> mD = icoopmatNV<32, gl_ScopeSubgroup, Z, 8>(1); +const ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> mD2 = ucoopmatNV<8, gl_ScopeSubgroup, 8, 8>(1); + +struct S { int a; int b; int c; }; + +const S s = S(12, 23, 34); + +layout(set = 0, binding = 0, buffer_reference) coherent buffer Block { + uint y[1024*1024]; + uint x[]; +} block; + +layout(set = 0, binding = 0) coherent buffer Block16 { + int8_t y[1024*1024]; + int8_t x[]; + + Block b; +} block8; + +icoopmatNV<8, gl_ScopeSubgroup, 8, 8> ineg(icoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return -m; } +ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> umul(ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> m) { return m * uint8_t(2); } + +layout(constant_id = 2) const int SC = 1; +ucoopmatNV<32, gl_ScopeSubgroup, SC, SC> scm[SC][SC]; + +// sized for icoopmatNV<8, gl_ScopeSubgroup, 16, 16> +shared uvec4 shmatrix[16*16*2/16]; + void main() { - ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mu = ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2); - icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mi = icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2); - - mu = mu + mu; - mu = mu - mu; - mi = -mi; - mi = mi * int8_t(2); - - fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_0 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mu); - fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_0 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mu); - fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_1 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mi); - fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_1 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mi); - - uint8_t x = mu[1]; - mi[0] = int8_t(x); - - coopMatLoadNV(mi, block.x, 16, 128, false); - coopMatStoreNV(mi, block.x, 16, 128, false); - coopMatLoadNV(mu, block8.x, 16, 128, false); - coopMatStoreNV(mu, block8.x, 16, 128, false); - coopMatLoadNV(mi, block8.b.x, 16, 128, false); - coopMatStoreNV(mi, block8.b.x, 16, 128, false); - - ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> A; - ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> B; - ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> C; - ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> D; - D = coopMatMulAddNV(A, B, C); - - int l = D.length(); - - - icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> a[5]; - a[3][0] = int8_t(1); - - int md1 = mD[1]; - - md1 += (mi += mi)[1234]; - + ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mu = ucoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2); + icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> mi = icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)>(2); + + mu = mu + mu; + mu = mu - mu; + mi = -mi; + mi = mi * int8_t(2); + + fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_0 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mu); + fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_0 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mu); + fcoopmatNV<16, gl_ScopeSubgroup, 16, 8> mf16_1 = fcoopmatNV<16, gl_ScopeSubgroup, 16, 8>(mi); + fcoopmatNV<32, gl_ScopeSubgroup, 16, 8> mf32_1 = fcoopmatNV<32, gl_ScopeSubgroup, 16, 8>(mi); + + uint8_t x = mu[1]; + mi[0] = int8_t(x); + + coopMatLoadNV(mi, block.x, 16, 128, false); + coopMatStoreNV(mi, block.x, 16, 128, false); + coopMatLoadNV(mu, block8.x, 16, 128, false); + coopMatStoreNV(mu, block8.x, 16, 128, false); + coopMatLoadNV(mi, block8.b.x, 16, 128, false); + coopMatStoreNV(mi, block8.b.x, 16, 128, false); + + ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> A; + ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> B; + ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> C; + ucoopmatNV<8, gl_ScopeSubgroup, 16, 8> D; + D = coopMatMulAddNV(A, B, C); + + int l = D.length(); + + + icoopmatNV<8, gl_ScopeSubgroup, 16, (2>1?8:4)> a[5]; + a[3][0] = int8_t(1); + + int md1 = mD[1]; + + md1 += (mi += mi)[1234]; + muC2[0] = muC2[1]; - muC2[1][0] = (miC2[2][0]); - - coopMatLoadNV(mi, block.y, 16, 128, false); - coopMatStoreNV(mi, block.y, 16, 128, false); - coopMatLoadNV(mu, block8.y, 16, 128, false); - coopMatStoreNV(mu, block8.y, 16, 128, false); - - icoopmatNV<8, gl_ScopeSubgroup, 8, 8> p1; - ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> p2; - - p1 = ineg(p1); - p2 = umul(p2); - - p1 /= p1; + muC2[1][0] = (miC2[2][0]); + + coopMatLoadNV(mi, block.y, 16, 128, false); + coopMatStoreNV(mi, block.y, 16, 128, false); + coopMatLoadNV(mu, block8.y, 16, 128, false); + coopMatStoreNV(mu, block8.y, 16, 128, false); + + icoopmatNV<8, gl_ScopeSubgroup, 8, 8> p1; + ucoopmatNV<8, gl_ScopeSubgroup, 8, 8> p2; + + p1 = ineg(p1); + p2 = umul(p2); + + p1 /= p1; p2 /= p2; - - p1 *= int8_t(2); - p2 *= uint8_t(4); - - icoopmatNV<8, gl_ScopeSubgroup, 16, 8> ms; - coopMatLoadNV(ms, shmatrix, 1, 2, false); - coopMatStoreNV(ms, shmatrix, 1, 2, false); - + + p1 *= int8_t(2); + p2 *= uint8_t(4); + + icoopmatNV<8, gl_ScopeSubgroup, 16, 8> ms; + coopMatLoadNV(ms, shmatrix, 1, 2, false); + coopMatStoreNV(ms, shmatrix, 1, 2, false); + } diff --git a/core/deps/glslang/Test/spv.interpOps.frag b/core/deps/glslang/Test/spv.interpOps.frag index 24c55bf9f..afe28dc3a 100644 --- a/core/deps/glslang/Test/spv.interpOps.frag +++ b/core/deps/glslang/Test/spv.interpOps.frag @@ -1,32 +1,32 @@ -#version 450 - -in float if1; -in vec2 if2; -in vec3 if3; -in vec4 if4; - -flat in int samp; -flat in vec2 offset; - -out vec4 fragColor; - -void main() -{ - vec4 f4 = vec4(0.0); - f4.x += interpolateAtCentroid(if1); - f4.xy += interpolateAtCentroid(if2); - f4.xyz += interpolateAtCentroid(if3); - f4 += interpolateAtCentroid(if4); - - f4.x += interpolateAtSample(if1, samp); - f4.xy += interpolateAtSample(if2, samp); - f4.xyz += interpolateAtSample(if3, samp); - f4 += interpolateAtSample(if4, samp); - - f4.x += interpolateAtOffset(if1, offset); - f4.xy += interpolateAtOffset(if2, offset); - f4.xyz += interpolateAtOffset(if3, offset); - f4 += interpolateAtOffset(if4, offset); - - fragColor = f4; -} +#version 450 + +in float if1; +in vec2 if2; +in vec3 if3; +in vec4 if4; + +flat in int samp; +flat in vec2 offset; + +out vec4 fragColor; + +void main() +{ + vec4 f4 = vec4(0.0); + f4.x += interpolateAtCentroid(if1); + f4.xy += interpolateAtCentroid(if2); + f4.xyz += interpolateAtCentroid(if3); + f4 += interpolateAtCentroid(if4); + + f4.x += interpolateAtSample(if1, samp); + f4.xy += interpolateAtSample(if2, samp); + f4.xyz += interpolateAtSample(if3, samp); + f4 += interpolateAtSample(if4, samp); + + f4.x += interpolateAtOffset(if1, offset); + f4.xy += interpolateAtOffset(if2, offset); + f4.xyz += interpolateAtOffset(if3, offset); + f4 += interpolateAtOffset(if4, offset); + + fragColor = f4; +} diff --git a/core/deps/glslang/Test/spv.layoutNested.vert b/core/deps/glslang/Test/spv.layoutNested.vert index 0c4f09f14..f0dc38980 100644 --- a/core/deps/glslang/Test/spv.layoutNested.vert +++ b/core/deps/glslang/Test/spv.layoutNested.vert @@ -1,76 +1,76 @@ -#version 450 - -// should get 3 SPV types for S: no layout, 140, and 430, plus extras for interpolation or invariant differences -struct S -{ - highp uvec3 a; - mediump mat2 b[4]; - lowp uint c; -}; - -layout(set = 0, binding = 0, std140) uniform Block140 -{ - mediump int u; - S s[2][3]; - mediump vec2 v; -} inst140; - -layout(set = 0, binding = 1, std430) buffer Block430 -{ - mediump int u; - S s[2][3]; - mediump vec2 v; -} inst430; - -S s; - -// should get 5 SPV types for T: no layout, 140/row, 140/col, 430/row, and 430/col -struct T { - mat2 m; - int a; -}; - -T t; - -struct Nestor { - T nestorT; -}; - -layout(set = 1, binding = 0, std140) uniform Bt1 -{ - layout(row_major) Nestor nt; -} Btn1; - -layout(set = 1, binding = 0, std140) uniform Bt2 -{ - layout(column_major) Nestor nt; -} Btn2; - -layout(row_major, set = 1, binding = 0, std140) uniform Bt3 -{ - layout(column_major) Nestor ntcol; - Nestor ntrow; // should be row major decoration version of Nestor -} Btn3; - -layout(set = 1, binding = 0, std430) buffer bBt1 -{ - layout(row_major) Nestor nt; -} bBtn1; - -layout(set = 1, binding = 0, std430) buffer bBt2 -{ - layout(column_major) Nestor nt; -} bBtn2; - -layout(set = 1, binding = 0, std430) buffer bBt3 -{ - layout(row_major) Nestor ntcol; - Nestor ntrow; // should be col major decoration version of Nestor -} bBtn3; - -void main() -{ -} - -flat out S sout; -invariant out S soutinv; +#version 450 + +// should get 3 SPV types for S: no layout, 140, and 430, plus extras for interpolation or invariant differences +struct S +{ + highp uvec3 a; + mediump mat2 b[4]; + lowp uint c; +}; + +layout(set = 0, binding = 0, std140) uniform Block140 +{ + mediump int u; + S s[2][3]; + mediump vec2 v; +} inst140; + +layout(set = 0, binding = 1, std430) buffer Block430 +{ + mediump int u; + S s[2][3]; + mediump vec2 v; +} inst430; + +S s; + +// should get 5 SPV types for T: no layout, 140/row, 140/col, 430/row, and 430/col +struct T { + mat2 m; + int a; +}; + +T t; + +struct Nestor { + T nestorT; +}; + +layout(set = 1, binding = 0, std140) uniform Bt1 +{ + layout(row_major) Nestor nt; +} Btn1; + +layout(set = 1, binding = 0, std140) uniform Bt2 +{ + layout(column_major) Nestor nt; +} Btn2; + +layout(row_major, set = 1, binding = 0, std140) uniform Bt3 +{ + layout(column_major) Nestor ntcol; + Nestor ntrow; // should be row major decoration version of Nestor +} Btn3; + +layout(set = 1, binding = 0, std430) buffer bBt1 +{ + layout(row_major) Nestor nt; +} bBtn1; + +layout(set = 1, binding = 0, std430) buffer bBt2 +{ + layout(column_major) Nestor nt; +} bBtn2; + +layout(set = 1, binding = 0, std430) buffer bBt3 +{ + layout(row_major) Nestor ntcol; + Nestor ntrow; // should be col major decoration version of Nestor +} bBtn3; + +void main() +{ +} + +flat out S sout; +invariant out S soutinv; diff --git a/core/deps/glslang/Test/spv.length.frag b/core/deps/glslang/Test/spv.length.frag index 20e74102b..3b3db0b42 100644 --- a/core/deps/glslang/Test/spv.length.frag +++ b/core/deps/glslang/Test/spv.length.frag @@ -1,14 +1,14 @@ -#version 140 - -vec4 u[3]; - -in vec2 v[2]; - -void main() -{ - int a[5]; - - vec2 t = v[0] + v[1]; - - gl_FragColor = vec4(u.length() * v.length() * a.length()); -} +#version 140 + +vec4 u[3]; + +in vec2 v[2]; + +void main() +{ + int a[5]; + + vec2 t = v[0] + v[1]; + + gl_FragColor = vec4(u.length() * v.length() * a.length()); +} diff --git a/core/deps/glslang/Test/spv.localAggregates.frag b/core/deps/glslang/Test/spv.localAggregates.frag index 9c86aba57..9bdb11b76 100644 --- a/core/deps/glslang/Test/spv.localAggregates.frag +++ b/core/deps/glslang/Test/spv.localAggregates.frag @@ -1,72 +1,72 @@ -#version 400 - -uniform sampler2D samp2D; -in vec2 coord; -in vec4 color; - -struct s1 { - int i; - float f; -}; - -struct s2 { - int i; - float f; - s1 s1_1; - vec4 bleh; -}; - -struct s3 { - s2 s2_1; - int i; - float f; - s1 s1_1; -}; - - -flat in s1 foo; -flat in s2 foo2; -flat in s3 foo3; - - -flat in int condition; - -void main() -{ - s2 locals2; - s3 locals3; - float localFArray[16]; - int localIArray[8]; - - locals2 = foo3.s2_1; - - if (foo3.s2_1.i > 0) { - locals2.s1_1.f = 1.0; - localFArray[4] = coord.x; - localIArray[2] = foo3.s2_1.i; - } else { - locals2.s1_1.f = coord.x; - localFArray[4] = 1.0; - localIArray[2] = 0; - } - - if (localIArray[2] == 0) - ++localFArray[4]; - - float localArray[16]; - int x = 5; - localArray[x] = coord.x; - - float[16] a; - - for (int i = 0; i < 16; i++) - a[i] = 0.0; - - if (condition == 1) - a = localArray; - - locals2.bleh = color; - locals2.bleh.z = coord.y; - - gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture(samp2D, coord); -} +#version 400 + +uniform sampler2D samp2D; +in vec2 coord; +in vec4 color; + +struct s1 { + int i; + float f; +}; + +struct s2 { + int i; + float f; + s1 s1_1; + vec4 bleh; +}; + +struct s3 { + s2 s2_1; + int i; + float f; + s1 s1_1; +}; + + +flat in s1 foo; +flat in s2 foo2; +flat in s3 foo3; + + +flat in int condition; + +void main() +{ + s2 locals2; + s3 locals3; + float localFArray[16]; + int localIArray[8]; + + locals2 = foo3.s2_1; + + if (foo3.s2_1.i > 0) { + locals2.s1_1.f = 1.0; + localFArray[4] = coord.x; + localIArray[2] = foo3.s2_1.i; + } else { + locals2.s1_1.f = coord.x; + localFArray[4] = 1.0; + localIArray[2] = 0; + } + + if (localIArray[2] == 0) + ++localFArray[4]; + + float localArray[16]; + int x = 5; + localArray[x] = coord.x; + + float[16] a; + + for (int i = 0; i < 16; i++) + a[i] = 0.0; + + if (condition == 1) + a = localArray; + + locals2.bleh = color; + locals2.bleh.z = coord.y; + + gl_FragColor = locals2.bleh * (localFArray[4] + locals2.s1_1.f + localArray[x] + a[x]) * texture(samp2D, coord); +} diff --git a/core/deps/glslang/Test/spv.loops.frag b/core/deps/glslang/Test/spv.loops.frag index c00449cff..b9ec09975 100644 --- a/core/deps/glslang/Test/spv.loops.frag +++ b/core/deps/glslang/Test/spv.loops.frag @@ -1,302 +1,302 @@ -#version 140 -in vec4 bigColor; -in vec4 bigColor1_1; -in vec4 bigColor1_2; -in vec4 bigColor1_3; -in vec4 bigColor2; -in vec4 bigColor3; -in vec4 bigColor4; -in vec4 bigColor5; -in vec4 bigColor6; -in vec4 bigColor7; -in vec4 bigColor8; - -in vec4 BaseColor; - -in float d; -in float d2; -in float d3; -in float d4; -in float d5; -in float d6; -in float d7; -in float d8; -in float d9; -in float d10; -in float d11; -in float d12; -in float d14; -in float d15; -in float d16; -in float d17; -in float d18; -flat in int Count; - -void main() -{ - vec4 color = BaseColor; - - // Not a real loop - while (true) { - if (color.x < 0.33) { - color += vec4(0.33); - break; - } - if (color.x < 0.66) { - color += vec4(0.66); - break; - } - - color += vec4(0.33); - break; - } - - // While - while (color.x < d) { - color += bigColor; - } - - // While (latchy) - while (color.z < d) { - color += bigColor1_1; - if (color.w < d) - continue; - - color += bigColor1_1; - } - - // While (constant) - while (color.x < 42.0) { - ++color; - } - - // While (complicated-conditional) - while (color.w < d2 && color.y < d3) { - color += bigColor1_2; - } - - // While (multi-exit) - while (color.z < d3) { - color += bigColor1_3; - if (color.y < d4) - break; - color += bigColor1_3; - } - - // For (dynamic) - for (int i = 0; i < Count; ++i) { - color += bigColor2; - } - - // Do while - do { - color += bigColor3; - } while (color.x < d2); - - // For (static) - for (int i = 0; i < 42; ++i) { - color.z += d3; - } - - // For (static) flow-control - for (int i = 0; i < 100; ++i) { - if (color.z < 20.0) - color.x++; - else - color.y++; - if (color.w < 20.0) - if (color.z > color.y) - 0; // do nothing - } - - // For (static) flow-control with latch merge - for (int i = 0; i < 120; ++i) { - if (color.z < 20.0) - color.x++; - else - color.y++; - } - - // For (static) latchy - for (int i = 0; i < 42; ++i) { - color.z += d3; - if (color.x < d4) - continue; - ++color.w; - } - - // For (static) multi-exit - for (int i = 0; i < 42; ++i) { - color.z += d3; - if (color.x < d4) - break; - ++color.w; - } - - // Latchy - do { - color += bigColor4; - if (color.x < d4) - continue; - if (color.y < d4) - color.y += d4; - else - color.x += d4; - } while (color.z < d4); - - // Do while flow control - do { - color += bigColor5; - if (color.y < d5) - color.y += d5; - } while (color.x < d5); - - // If then loop - if (color.x < d6) { - while (color.y < d6) - color += bigColor6; - } else { - while (color.z < d6) - color.z += bigColor6.z; - } - - // If then multi-exit - if (color.x < d6) { - while (color.y < d6) { - color += bigColor6; - if (d7 < 1.0) - break; - } - - } else { - while (color.z < d6) - color.z += bigColor6.z; - } - - - // Multi-exit - do { - if (d7 < 0.0) - break; - - color += bigColor7; - - if (d7 < 1.0) { - color.z++; - break; - } - - color += BaseColor; - - } while (true); - - - // Multi-exit2 - do { - // invariant conditional break at the top of the loop. This could be a - // situation where unswitching the loop has no real increases in code - // size. - if (d8 < 0.0) - break; - - color += bigColor7; - - if (d8 < 1.0) { - color.z++; - if (d8 < 2.0) { - color.y++; - } else { - color.x++; - } - break; - } - - color += BaseColor; - - } while (color.z < d8); - - // Deep exit - while (color.w < d9) { - if (d9 > d8) { - if (color.x <= d7) { - if (color.z == 5.0) - color.w++; - else - break; - } - } - - } - - // No end loop-back. - while (color.z < d10) { - color.y++; - if (color.y < d11) { - color.z++; - if (color.w < d12) - color.w++; - else - color.x++; - continue; - } - - color++; - break; - } - - // Multi-continue - while (color.x < 10.0) { - color += bigColor8; - - if (color.z < d8) - if (color.w < d6) - continue; - - color.y += bigColor8.x; - } - - color++; - gl_FragColor = color; - - // Early Return - while (color.x < d14) { - if (color.y < d15) { - return; - } - else - color++; - } - - color++; - - while (color.w < d16) { - color.w++; - } - - - // While (complicated-conditional) - while (color.w < d2 && color.y < d3) { - color += bigColor1_2; - if (color.z < d3) - return; - } - - - do { - if (color.y < d18) - return; - color++; - } while (color.x < d17); - - // Early Discard - while (color.y < d16) { - if (color.w < d16) { - discard; - } else - color++; - } - - color++; - - gl_FragColor = color; -} +#version 140 +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; + +in vec4 BaseColor; + +in float d; +in float d2; +in float d3; +in float d4; +in float d5; +in float d6; +in float d7; +in float d8; +in float d9; +in float d10; +in float d11; +in float d12; +in float d14; +in float d15; +in float d16; +in float d17; +in float d18; +flat in int Count; + +void main() +{ + vec4 color = BaseColor; + + // Not a real loop + while (true) { + if (color.x < 0.33) { + color += vec4(0.33); + break; + } + if (color.x < 0.66) { + color += vec4(0.66); + break; + } + + color += vec4(0.33); + break; + } + + // While + while (color.x < d) { + color += bigColor; + } + + // While (latchy) + while (color.z < d) { + color += bigColor1_1; + if (color.w < d) + continue; + + color += bigColor1_1; + } + + // While (constant) + while (color.x < 42.0) { + ++color; + } + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + } + + // While (multi-exit) + while (color.z < d3) { + color += bigColor1_3; + if (color.y < d4) + break; + color += bigColor1_3; + } + + // For (dynamic) + for (int i = 0; i < Count; ++i) { + color += bigColor2; + } + + // Do while + do { + color += bigColor3; + } while (color.x < d2); + + // For (static) + for (int i = 0; i < 42; ++i) { + color.z += d3; + } + + // For (static) flow-control + for (int i = 0; i < 100; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + if (color.w < 20.0) + if (color.z > color.y) + 0; // do nothing + } + + // For (static) flow-control with latch merge + for (int i = 0; i < 120; ++i) { + if (color.z < 20.0) + color.x++; + else + color.y++; + } + + // For (static) latchy + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + continue; + ++color.w; + } + + // For (static) multi-exit + for (int i = 0; i < 42; ++i) { + color.z += d3; + if (color.x < d4) + break; + ++color.w; + } + + // Latchy + do { + color += bigColor4; + if (color.x < d4) + continue; + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Do while flow control + do { + color += bigColor5; + if (color.y < d5) + color.y += d5; + } while (color.x < d5); + + // If then loop + if (color.x < d6) { + while (color.y < d6) + color += bigColor6; + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + // If then multi-exit + if (color.x < d6) { + while (color.y < d6) { + color += bigColor6; + if (d7 < 1.0) + break; + } + + } else { + while (color.z < d6) + color.z += bigColor6.z; + } + + + // Multi-exit + do { + if (d7 < 0.0) + break; + + color += bigColor7; + + if (d7 < 1.0) { + color.z++; + break; + } + + color += BaseColor; + + } while (true); + + + // Multi-exit2 + do { + // invariant conditional break at the top of the loop. This could be a + // situation where unswitching the loop has no real increases in code + // size. + if (d8 < 0.0) + break; + + color += bigColor7; + + if (d8 < 1.0) { + color.z++; + if (d8 < 2.0) { + color.y++; + } else { + color.x++; + } + break; + } + + color += BaseColor; + + } while (color.z < d8); + + // Deep exit + while (color.w < d9) { + if (d9 > d8) { + if (color.x <= d7) { + if (color.z == 5.0) + color.w++; + else + break; + } + } + + } + + // No end loop-back. + while (color.z < d10) { + color.y++; + if (color.y < d11) { + color.z++; + if (color.w < d12) + color.w++; + else + color.x++; + continue; + } + + color++; + break; + } + + // Multi-continue + while (color.x < 10.0) { + color += bigColor8; + + if (color.z < d8) + if (color.w < d6) + continue; + + color.y += bigColor8.x; + } + + color++; + gl_FragColor = color; + + // Early Return + while (color.x < d14) { + if (color.y < d15) { + return; + } + else + color++; + } + + color++; + + while (color.w < d16) { + color.w++; + } + + + // While (complicated-conditional) + while (color.w < d2 && color.y < d3) { + color += bigColor1_2; + if (color.z < d3) + return; + } + + + do { + if (color.y < d18) + return; + color++; + } while (color.x < d17); + + // Early Discard + while (color.y < d16) { + if (color.w < d16) { + discard; + } else + color++; + } + + color++; + + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/spv.loopsArtificial.frag b/core/deps/glslang/Test/spv.loopsArtificial.frag index 4eb44c209..ae380b945 100644 --- a/core/deps/glslang/Test/spv.loopsArtificial.frag +++ b/core/deps/glslang/Test/spv.loopsArtificial.frag @@ -1,67 +1,67 @@ -#version 140 -in vec4 bigColor; -in vec4 bigColor1_1; -in vec4 bigColor1_2; -in vec4 bigColor1_3; -in vec4 bigColor2; -in vec4 bigColor3; -in vec4 bigColor4; -in vec4 bigColor5; -in vec4 bigColor6; -in vec4 bigColor7; -in vec4 bigColor8; - -in vec4 BaseColor; - -in float d; -in float d2; -in float d3; -in float d4; -in float d13; - -flat in int Count; - -void main() -{ - vec4 color = BaseColor; - - // Latchy2 - do { - color += bigColor4; - if (color.x < d4) { - color.z += 2.0; - if (color.z < d4) { - color.x++; - continue; - } - } - if (color.y < d4) - color.y += d4; - else - color.x += d4; - } while (color.z < d4); - - // Immediate dominator - while (color.w < d13) { - if (color.z < d13) - color++; - else - color--; - // code from Latchy 2 - color += bigColor4; - if (color.x < d4) { - color.z += 2.0; - if (color.z < d4) { - color.x++; - continue; - } - } - if (color.y < d4) - color.y += d4; - else - color.x += d4; - } - - color++; - gl_FragColor = color; -} +#version 140 +in vec4 bigColor; +in vec4 bigColor1_1; +in vec4 bigColor1_2; +in vec4 bigColor1_3; +in vec4 bigColor2; +in vec4 bigColor3; +in vec4 bigColor4; +in vec4 bigColor5; +in vec4 bigColor6; +in vec4 bigColor7; +in vec4 bigColor8; + +in vec4 BaseColor; + +in float d; +in float d2; +in float d3; +in float d4; +in float d13; + +flat in int Count; + +void main() +{ + vec4 color = BaseColor; + + // Latchy2 + do { + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } while (color.z < d4); + + // Immediate dominator + while (color.w < d13) { + if (color.z < d13) + color++; + else + color--; + // code from Latchy 2 + color += bigColor4; + if (color.x < d4) { + color.z += 2.0; + if (color.z < d4) { + color.x++; + continue; + } + } + if (color.y < d4) + color.y += d4; + else + color.x += d4; + } + + color++; + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/spv.looseUniformNoLoc.vert b/core/deps/glslang/Test/spv.looseUniformNoLoc.vert index 2d7daf837..e88735944 100644 --- a/core/deps/glslang/Test/spv.looseUniformNoLoc.vert +++ b/core/deps/glslang/Test/spv.looseUniformNoLoc.vert @@ -1,15 +1,15 @@ -#version 450 core - -layout(location = 0) -in vec4 foo; - -layout(location = 0) -out vec4 bar; - -uniform vec4 uv; - -void main() -{ - bar = foo; - gl_Position = foo; +#version 450 core + +layout(location = 0) +in vec4 foo; + +layout(location = 0) +out vec4 bar; + +uniform vec4 uv; + +void main() +{ + bar = foo; + gl_Position = foo; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.matFun.vert b/core/deps/glslang/Test/spv.matFun.vert index 70e9f81da..49e882f40 100644 --- a/core/deps/glslang/Test/spv.matFun.vert +++ b/core/deps/glslang/Test/spv.matFun.vert @@ -1,28 +1,28 @@ -#version 400 - -uniform bl { - uniform mat4 m4; - uniform mat3 m3; -} bName; - -in vec3 v3; - -vec3 xf(mat3 m, vec3 v) -{ - return v * m; -} - -mat3 Mat3(mat4 m) -{ - return mat3(m[0].xyz, m[1].xyz, m[2].xyz); -} - -vec3 mxv(mat4 m4, vec3 v) -{ - return v * Mat3(m4); -} - -void main() -{ - gl_Position = vec4(mxv(bName.m4, v3) + xf(bName.m3, v3), 1.0); -} +#version 400 + +uniform bl { + uniform mat4 m4; + uniform mat3 m3; +} bName; + +in vec3 v3; + +vec3 xf(mat3 m, vec3 v) +{ + return v * m; +} + +mat3 Mat3(mat4 m) +{ + return mat3(m[0].xyz, m[1].xyz, m[2].xyz); +} + +vec3 mxv(mat4 m4, vec3 v) +{ + return v * Mat3(m4); +} + +void main() +{ + gl_Position = vec4(mxv(bName.m4, v3) + xf(bName.m3, v3), 1.0); +} diff --git a/core/deps/glslang/Test/spv.matrix.frag b/core/deps/glslang/Test/spv.matrix.frag index e0cb4fc43..315717378 100644 --- a/core/deps/glslang/Test/spv.matrix.frag +++ b/core/deps/glslang/Test/spv.matrix.frag @@ -1,49 +1,49 @@ -#version 420 - -in mat3x4 m1; -in mat3x4 m2; -in float f; -in vec3 v3; -in vec4 v4; - -out vec4 color; - -void main() -{ - mat3x4 sum34; - dmat3x4 dm; - vec3 sum3; - vec4 sum4; - - sum34 = m1 - m2; - sum34 += m1 * f; - sum34 += f * m1; - sum34 /= matrixCompMult(m1, m2); - sum34 += m1 / f; - sum34 += f / m1; - sum34 += f; - sum34 -= f; - dm = dmat3x4(sum34); - sum34 = mat3x4(dm); - - sum3 = v4 * m2; - sum4 = m2 * v3; - - mat4x3 m43 = transpose(sum34); - mat4 m4 = m1 * m43; - - sum4 = v4 * m4; - - color = sum4; - - ++sum34; - --sum34; - - sum34 += mat3x4(f); - sum34 += mat3x4(v3, f, v3, f, v3, f); - - color += sum3 * m43 + sum4; - - color += vec4(m43); - color += vec4(vec3(mat2(f)), 7.2); -} +#version 420 + +in mat3x4 m1; +in mat3x4 m2; +in float f; +in vec3 v3; +in vec4 v4; + +out vec4 color; + +void main() +{ + mat3x4 sum34; + dmat3x4 dm; + vec3 sum3; + vec4 sum4; + + sum34 = m1 - m2; + sum34 += m1 * f; + sum34 += f * m1; + sum34 /= matrixCompMult(m1, m2); + sum34 += m1 / f; + sum34 += f / m1; + sum34 += f; + sum34 -= f; + dm = dmat3x4(sum34); + sum34 = mat3x4(dm); + + sum3 = v4 * m2; + sum4 = m2 * v3; + + mat4x3 m43 = transpose(sum34); + mat4 m4 = m1 * m43; + + sum4 = v4 * m4; + + color = sum4; + + ++sum34; + --sum34; + + sum34 += mat3x4(f); + sum34 += mat3x4(v3, f, v3, f, v3, f); + + color += sum3 * m43 + sum4; + + color += vec4(m43); + color += vec4(vec3(mat2(f)), 7.2); +} diff --git a/core/deps/glslang/Test/spv.matrix2.frag b/core/deps/glslang/Test/spv.matrix2.frag index b14d5b18f..7fb6dd868 100644 --- a/core/deps/glslang/Test/spv.matrix2.frag +++ b/core/deps/glslang/Test/spv.matrix2.frag @@ -1,50 +1,50 @@ -#version 150 - -in mat3 colorTransform; -in vec3 Color; -in mat4 m, n; - -in mat4x3 um43; -in mat3x4 un34; -in mat2 um2; -in mat3 um3; -in mat4 um4; - -in vec4 v; - -in vec3 u; - -out vec4 FragColor; - -void main() -{ - mat3x4 m34 = outerProduct(v, u); - - m34 += mat3x4(4.3); - - FragColor = vec4(Color, 1.0); - FragColor *= vec4(FragColor * m34, 1.0); - - m34 *= v.x; - - mat4 m44 = mat4(un34); - - m44 += m34 * um43; - - FragColor += (-m44) * v; - - FragColor *= matrixCompMult(m44, m44); - - m34 = transpose(um43); - FragColor *= vec4(FragColor * m34, 1.0); - FragColor *= vec4(determinant(um4)); - mat2 inv = inverse(um2); - FragColor *= vec4(inv[0][0], inv[1][0], inv[0][1], inv[1][1]); - mat3 inv3 = inverse(um3); - FragColor *= vec4(inv3[2][1]); - - mat4 inv4 = inverse(um4); - FragColor *= inv4; - - FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); -} +#version 150 + +in mat3 colorTransform; +in vec3 Color; +in mat4 m, n; + +in mat4x3 um43; +in mat3x4 un34; +in mat2 um2; +in mat3 um3; +in mat4 um4; + +in vec4 v; + +in vec3 u; + +out vec4 FragColor; + +void main() +{ + mat3x4 m34 = outerProduct(v, u); + + m34 += mat3x4(4.3); + + FragColor = vec4(Color, 1.0); + FragColor *= vec4(FragColor * m34, 1.0); + + m34 *= v.x; + + mat4 m44 = mat4(un34); + + m44 += m34 * um43; + + FragColor += (-m44) * v; + + FragColor *= matrixCompMult(m44, m44); + + m34 = transpose(um43); + FragColor *= vec4(FragColor * m34, 1.0); + FragColor *= vec4(determinant(um4)); + mat2 inv = inverse(um2); + FragColor *= vec4(inv[0][0], inv[1][0], inv[0][1], inv[1][1]); + mat3 inv3 = inverse(um3); + FragColor *= vec4(inv3[2][1]); + + mat4 inv4 = inverse(um4); + FragColor *= inv4; + + FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); +} diff --git a/core/deps/glslang/Test/spv.memoryQualifier.frag b/core/deps/glslang/Test/spv.memoryQualifier.frag index 889ad9bd5..85e71478d 100644 --- a/core/deps/glslang/Test/spv.memoryQualifier.frag +++ b/core/deps/glslang/Test/spv.memoryQualifier.frag @@ -1,38 +1,38 @@ -#version 450 - -layout(binding = 0, r32f) uniform coherent image1D i1D; -layout(binding = 1, r32f) uniform volatile image2D i2D; -layout(binding = 2, r32f) uniform restrict image2DRect i2DRect; -layout(binding = 3, r32f) uniform readonly image3D i3D; -layout(binding = 3, r32f) uniform writeonly imageCube iCube; - -struct Data -{ - float f1; - vec2 f2; -}; - -coherent buffer Buffer -{ - volatile float f1; - restrict vec2 f2; - readonly vec3 f3; - writeonly vec4 f4; - int i1; - Data data; -}; - -void main() -{ - vec4 texel = imageLoad(i1D, 1); - texel += imageLoad(i2D, ivec2(1)); - texel += imageLoad(i2DRect, ivec2(1)); - texel += imageLoad(i3D, ivec3(1)); - imageStore(iCube, ivec3(1), texel); - - texel[i1] = f1; - texel.xy += f2; - texel.xyz -= f3; - texel.w += data.f1 + data.f2[1]; - f4 = texel; +#version 450 + +layout(binding = 0, r32f) uniform coherent image1D i1D; +layout(binding = 1, r32f) uniform volatile image2D i2D; +layout(binding = 2, r32f) uniform restrict image2DRect i2DRect; +layout(binding = 3, r32f) uniform readonly image3D i3D; +layout(binding = 3, r32f) uniform writeonly imageCube iCube; + +struct Data +{ + float f1; + vec2 f2; +}; + +coherent buffer Buffer +{ + volatile float f1; + restrict vec2 f2; + readonly vec3 f3; + writeonly vec4 f4; + int i1; + Data data; +}; + +void main() +{ + vec4 texel = imageLoad(i1D, 1); + texel += imageLoad(i2D, ivec2(1)); + texel += imageLoad(i2DRect, ivec2(1)); + texel += imageLoad(i3D, ivec3(1)); + imageStore(iCube, ivec3(1), texel); + + texel[i1] = f1; + texel.xy += f2; + texel.xyz -= f3; + texel.w += data.f1 + data.f2[1]; + f4 = texel; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.memoryScopeSemantics.comp b/core/deps/glslang/Test/spv.memoryScopeSemantics.comp index b17b6444e..528a63968 100644 --- a/core/deps/glslang/Test/spv.memoryScopeSemantics.comp +++ b/core/deps/glslang/Test/spv.memoryScopeSemantics.comp @@ -1,70 +1,74 @@ -#version 450 -#extension GL_KHR_memory_scope_semantics : require -#extension GL_ARB_gpu_shader_int64 : require - -#pragma use_vulkan_memory_model - -shared uint value; -shared int atomi; -shared uint atomu; -layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu; -layout(binding = 1, r32i) volatile coherent uniform iimage2D imagei; -layout(binding = 5, r32i) nonprivate uniform iimage2D imagej[2]; -layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu; -layout (binding = 3) coherent buffer BufferI { uint x; } bufferi; -struct A { uint x[2]; }; -layout (binding = 4) volatile buffer BufferJ { subgroupcoherent A a; } bufferj[2]; -layout (binding = 6) nonprivate uniform sampler2D samp[2]; -layout (binding = 7) nonprivate uniform BufferK { uint x; } bufferk; -shared uint64_t atomu64; -shared int64_t atomi64; -layout (binding = 8) volatile buffer BufferL { uint x; } bufferl; -layout (binding = 9) buffer BufferM { volatile uint x; } bufferm; - - -void main() -{ - int origi = atomicAdd(atomi, 3, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); - uint origu = atomicAnd(atomu, value); - origi = atomicLoad(atomi, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); - atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); - origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); - origu = imageAtomicAdd(imageu, ivec2(0,0), 3u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); - imageAtomicStore(imageu, ivec2(0,0), 4u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); - origu = atomicOr(atomu, 7u, gl_ScopeDevice, 0, 0); - origu = atomicXor(atomu, 7u, gl_ScopeDevice, 0, 0); - origu = atomicMin(atomu, value, gl_ScopeDevice, 0, 0); - origi = atomicMax(atomi, 7, gl_ScopeDevice, 0, 0); - origi = atomicExchange(atomi, origi, gl_ScopeDevice, 0, 0); - origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); - atomicAdd(bufferu.x, 1, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); - memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); - controlBarrier(gl_ScopeWorkgroup, gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); - controlBarrier(gl_ScopeWorkgroup, gl_ScopeWorkgroup, 0, 0); - - uint y; - y = bufferu.x; - bufferu.x = y; - y = bufferi.x; - y = bufferj[0].a.x[1]; - bufferi.x = y; - bufferj[0].a.x[1] = y; - bufferj[0].a = bufferj[1].a; - bufferi.x = bufferk.x; - - imageLoad(imagei, ivec2(0,0)); - imageLoad(imagej[0], ivec2(0,0)); - imageStore(imagej[1], ivec2(0,0), ivec4(0,0,0,0)); - texture(samp[0], vec2(0,0)); - - atomu64 = atomicMax(atomu64, uint64_t(7), gl_ScopeDevice, 0, 0); - atomicCompSwap(atomi64, int64_t(10), int64_t(atomu64), gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); - - y = bufferl.x; - atomicAdd(bufferl.x, 1); - atomicOr(bufferm.x, 2); - imageAtomicAdd(imagei, ivec2(0,0), 3); - atomicAdd(bufferu.x, 4u, gl_ScopeDevice, 0, 0); - atomicAdd(bufferu.x, 5u, gl_ScopeDevice, 0, gl_SemanticsVolatile); -} - +#version 450 +#extension GL_KHR_memory_scope_semantics : require +#extension GL_ARB_gpu_shader_int64 : require + +#pragma use_vulkan_memory_model + +shared uint value; +shared int atomi; +shared uint atomu; +layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu; +layout(binding = 1, r32i) volatile coherent uniform iimage2D imagei; +layout(binding = 5, r32i) nonprivate uniform iimage2D imagej[2]; +layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu; +layout (binding = 3) coherent buffer BufferI { uint x; } bufferi; +struct A { uint x[2]; }; +layout (binding = 4) volatile buffer BufferJ { subgroupcoherent A a; } bufferj[2]; +layout (binding = 6) nonprivate uniform sampler2D samp[2]; +layout (binding = 7) nonprivate uniform BufferK { uint x; } bufferk; +shared uint64_t atomu64; +shared int64_t atomi64; +layout (binding = 8) volatile buffer BufferL { uint x; } bufferl; +layout (binding = 9) buffer BufferM { volatile uint x; } bufferm; +layout(binding = 10, r32i) volatile coherent uniform iimage2DMS imageMS; + + +void main() +{ + int origi = atomicAdd(atomi, 3, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); + uint origu = atomicAnd(atomu, value); + origi = atomicLoad(atomi, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + origu = imageAtomicAdd(imageu, ivec2(0,0), 3u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + imageAtomicStore(imageu, ivec2(0,0), 4u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + origu = atomicOr(atomu, 7u, gl_ScopeDevice, 0, 0); + origu = atomicXor(atomu, 7u, gl_ScopeDevice, 0, 0); + origu = atomicMin(atomu, value, gl_ScopeDevice, 0, 0); + origi = atomicMax(atomi, 7, gl_ScopeDevice, 0, 0); + origi = atomicExchange(atomi, origi, gl_ScopeDevice, 0, 0); + origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); + atomicAdd(bufferu.x, 1, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease); + controlBarrier(gl_ScopeWorkgroup, gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); + controlBarrier(gl_ScopeWorkgroup, gl_ScopeWorkgroup, 0, 0); + + uint y; + y = bufferu.x; + bufferu.x = y; + y = bufferi.x; + y = bufferj[0].a.x[1]; + bufferi.x = y; + bufferj[0].a.x[1] = y; + bufferj[0].a = bufferj[1].a; + bufferi.x = bufferk.x; + + imageLoad(imagei, ivec2(0,0)); + imageLoad(imagej[0], ivec2(0,0)); + imageStore(imagej[1], ivec2(0,0), ivec4(0,0,0,0)); + texture(samp[0], vec2(0,0)); + + atomu64 = atomicMax(atomu64, uint64_t(7), gl_ScopeDevice, 0, 0); + atomicCompSwap(atomi64, int64_t(10), int64_t(atomu64), gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire); + + y = bufferl.x; + atomicAdd(bufferl.x, 1); + atomicOr(bufferm.x, 2); + imageAtomicAdd(imagei, ivec2(0,0), 3); + atomicAdd(bufferu.x, 4u, gl_ScopeDevice, 0, 0); + atomicAdd(bufferu.x, 5u, gl_ScopeDevice, 0, gl_SemanticsVolatile); + + imageAtomicStore(imageMS, ivec2(0,0), 1, 4, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + imageAtomicStore(imagei, ivec2(0,0), -7, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); +} + diff --git a/core/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp b/core/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp index a7dbf65c2..1b856717a 100644 --- a/core/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp +++ b/core/deps/glslang/Test/spv.memoryScopeSemantics_Error.comp @@ -1,30 +1,30 @@ -#version 450 -#extension GL_KHR_memory_scope_semantics : require - - -shared uint value; -shared int atomi; -shared uint atomu; -layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu; -layout(binding = 1, r32i) coherent uniform iimage2D imagei; -layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu; -layout (binding = 3) subgroupcoherent buffer BufferI { uint x; } bufferi; - -void main() -{ - atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); - int origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); - atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquireRelease); - atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_StorageSemanticsBuffer); - origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_SemanticsAcquire, gl_SemanticsAcquire); - memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, 0); - memoryBarrier(gl_ScopeWorkgroup, 0, gl_SemanticsRelease); - memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease | gl_SemanticsAcquire); - atomicAdd(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsAcquire); - uint origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquireRelease); - memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsMakeVisible); - memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsMakeAvailable); - memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsVolatile); - atomicCompSwap(bufferi.x, 10u, 10u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsVolatile, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); -} - +#version 450 +#extension GL_KHR_memory_scope_semantics : require + + +shared uint value; +shared int atomi; +shared uint atomu; +layout(binding = 0, r32ui) workgroupcoherent uniform uimage2D imageu; +layout(binding = 1, r32i) coherent uniform iimage2D imagei; +layout (binding = 2) buffer BufferU { workgroupcoherent uint x; } bufferu; +layout (binding = 3) subgroupcoherent buffer BufferI { uint x; } bufferi; + +void main() +{ + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); + int origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease); + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquireRelease); + atomicStore(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_StorageSemanticsBuffer); + origi = imageAtomicLoad(imagei, ivec2(0,0), gl_ScopeDevice, gl_SemanticsAcquire, gl_SemanticsAcquire); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, 0); + memoryBarrier(gl_ScopeWorkgroup, 0, gl_SemanticsRelease); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsRelease | gl_SemanticsAcquire); + atomicAdd(atomu, value, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsAcquire); + uint origu = atomicCompSwap(atomu, 10u, value, gl_ScopeDevice, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquire, gl_StorageSemanticsBuffer | gl_StorageSemanticsShared, gl_SemanticsAcquireRelease); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsMakeVisible); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsMakeAvailable); + memoryBarrier(gl_ScopeWorkgroup, gl_StorageSemanticsBuffer, gl_SemanticsRelease | gl_SemanticsVolatile); + atomicCompSwap(bufferi.x, 10u, 10u, gl_ScopeDevice, gl_StorageSemanticsBuffer, gl_SemanticsAcquire | gl_SemanticsVolatile, gl_StorageSemanticsBuffer, gl_SemanticsAcquire); +} + diff --git a/core/deps/glslang/Test/spv.merge-unreachable.frag b/core/deps/glslang/Test/spv.merge-unreachable.frag index f88b6e581..a650cd1cd 100644 --- a/core/deps/glslang/Test/spv.merge-unreachable.frag +++ b/core/deps/glslang/Test/spv.merge-unreachable.frag @@ -1,8 +1,8 @@ -#version 450 -precision mediump int; precision highp float; -layout(location=1) in highp vec4 v; -void main (void) -{ - if (v == vec4(0.1,0.2,0.3,0.4)) discard; - else return; -} +#version 450 +precision mediump int; precision highp float; +layout(location=1) in highp vec4 v; +void main (void) +{ + if (v == vec4(0.1,0.2,0.3,0.4)) discard; + else return; +} diff --git a/core/deps/glslang/Test/spv.meshShaderPerView_Errors.mesh b/core/deps/glslang/Test/spv.meshShaderPerView_Errors.mesh index 8027172d3..77190ef0e 100644 --- a/core/deps/glslang/Test/spv.meshShaderPerView_Errors.mesh +++ b/core/deps/glslang/Test/spv.meshShaderPerView_Errors.mesh @@ -1,32 +1,32 @@ -#version 450 - -#define MAX_VER 81 -#define MAX_PRIM 32 -#define MAX_VIEWS gl_MaxMeshViewCountNV - -#extension GL_NV_mesh_shader : enable - -layout(local_size_x = 32) in; - -layout(max_vertices=MAX_VER) out; -layout(max_primitives=MAX_PRIM) out; -layout(triangles) out; - -// test error checks for use of incorrect per-view attributes - -// per-view block attributes -perviewNV layout(location=0) out perviewBlock { - vec4 missingInnermostDimSize1[][]; - vec4 incorrectViewDimSize1[MAX_VIEWS+1]; - vec4 missingViewDim1; -} b2[]; - -// per-view non-block attributes -perviewNV layout(location=10) out vec4 missingInnermostDimSize2[][][]; -perviewNV layout(location=11) out vec4 incorrectViewDimSize2[][MAX_VIEWS-1]; -perviewNV layout(location=12) out vec4 missingViewDim2[]; - -void main() -{ -} - +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 +#define MAX_VIEWS gl_MaxMeshViewCountNV + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test error checks for use of incorrect per-view attributes + +// per-view block attributes +perviewNV layout(location=0) out perviewBlock { + vec4 missingInnermostDimSize1[][]; + vec4 incorrectViewDimSize1[MAX_VIEWS+1]; + vec4 missingViewDim1; +} b2[]; + +// per-view non-block attributes +perviewNV layout(location=10) out vec4 missingInnermostDimSize2[][][]; +perviewNV layout(location=11) out vec4 incorrectViewDimSize2[][MAX_VIEWS-1]; +perviewNV layout(location=12) out vec4 missingViewDim2[]; + +void main() +{ +} + diff --git a/core/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh b/core/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh index 9ae491a93..3b75b5583 100644 --- a/core/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh +++ b/core/deps/glslang/Test/spv.meshShaderRedeclPerViewBuiltins.mesh @@ -1,53 +1,53 @@ -#version 450 - -#define MAX_VER 81 -#define MAX_PRIM 32 -#define MAX_VIEWS gl_MaxMeshViewCountNV - -#define BARRIER() \ - memoryBarrierShared(); \ - barrier(); - -#extension GL_NV_mesh_shader : enable - -layout(local_size_x = 32) in; - -layout(max_vertices=MAX_VER) out; -layout(max_primitives=MAX_PRIM) out; -layout(triangles) out; - -// test use of redeclared per-view builtin attributes - -out gl_MeshPerVertexNV { - perviewNV vec4 gl_PositionPerViewNV[MAX_VIEWS]; // explicitly sized view dim - perviewNV float gl_ClipDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim - perviewNV float gl_CullDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim -} gl_MeshVerticesNV[]; - -perprimitiveNV out gl_MeshPerPrimitiveNV { - perviewNV int gl_LayerPerViewNV[]; // implicitly sized view dim - perviewNV int gl_ViewportMaskPerViewNV[][1]; // implicitly sized view dim -} gl_MeshPrimitivesNV[]; - -void main() -{ - uint iid = gl_LocalInvocationID.x; - uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; - - gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID] = vec4(1.0, 2.0, 3.0, 4.0); - gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2] = 5.0; - gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3] = 6.0; - gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID] = 7; - gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0] = 8; - - BARRIER(); - - gl_MeshVerticesNV[iid+1].gl_PositionPerViewNV[viewID] = gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID]; - gl_MeshVerticesNV[iid+1].gl_ClipDistancePerViewNV[viewID][2] = gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2]; - gl_MeshVerticesNV[iid+1].gl_CullDistancePerViewNV[viewID][3] = gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3]; - gl_MeshPrimitivesNV[iid+1].gl_LayerPerViewNV[viewID] = gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID]; - gl_MeshPrimitivesNV[iid+1].gl_ViewportMaskPerViewNV[viewID][0] = gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0]; - - BARRIER(); -} - +#version 450 + +#define MAX_VER 81 +#define MAX_PRIM 32 +#define MAX_VIEWS gl_MaxMeshViewCountNV + +#define BARRIER() \ + memoryBarrierShared(); \ + barrier(); + +#extension GL_NV_mesh_shader : enable + +layout(local_size_x = 32) in; + +layout(max_vertices=MAX_VER) out; +layout(max_primitives=MAX_PRIM) out; +layout(triangles) out; + +// test use of redeclared per-view builtin attributes + +out gl_MeshPerVertexNV { + perviewNV vec4 gl_PositionPerViewNV[MAX_VIEWS]; // explicitly sized view dim + perviewNV float gl_ClipDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim + perviewNV float gl_CullDistancePerViewNV[MAX_VIEWS][4]; // explicitly sized view dim +} gl_MeshVerticesNV[]; + +perprimitiveNV out gl_MeshPerPrimitiveNV { + perviewNV int gl_LayerPerViewNV[]; // implicitly sized view dim + perviewNV int gl_ViewportMaskPerViewNV[][1]; // implicitly sized view dim +} gl_MeshPrimitivesNV[]; + +void main() +{ + uint iid = gl_LocalInvocationID.x; + uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS]; + + gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID] = vec4(1.0, 2.0, 3.0, 4.0); + gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2] = 5.0; + gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3] = 6.0; + gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID] = 7; + gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0] = 8; + + BARRIER(); + + gl_MeshVerticesNV[iid+1].gl_PositionPerViewNV[viewID] = gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID]; + gl_MeshVerticesNV[iid+1].gl_ClipDistancePerViewNV[viewID][2] = gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2]; + gl_MeshVerticesNV[iid+1].gl_CullDistancePerViewNV[viewID][3] = gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3]; + gl_MeshPrimitivesNV[iid+1].gl_LayerPerViewNV[viewID] = gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID]; + gl_MeshPrimitivesNV[iid+1].gl_ViewportMaskPerViewNV[viewID][0] = gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0]; + + BARRIER(); +} + diff --git a/core/deps/glslang/Test/spv.multiStruct.comp b/core/deps/glslang/Test/spv.multiStruct.comp index ac4b1b2eb..7462da43b 100644 --- a/core/deps/glslang/Test/spv.multiStruct.comp +++ b/core/deps/glslang/Test/spv.multiStruct.comp @@ -1,48 +1,48 @@ -#version 450 core - -struct MyStruct -{ - vec2 foo[2]; - bool sb; -}; - -layout(binding = 0, std430) buffer SSBO0 -{ - MyStruct a; -} inBuf; - -layout(binding = 1, std430) buffer SSBO1 -{ - MyStruct b; -} outBuf; - -layout(binding = 2, std140) uniform UBO -{ - MyStruct c; -} uBuf; - -struct Nested { - float f; - MyStruct S[2]; -}; - -layout(binding = 2, std140) uniform UBON -{ - Nested N1; -} uBufN; - -layout(binding = 1, std430) buffer SSBO1N -{ - Nested N2; -} outBufN; - -void main() -{ - MyStruct t = inBuf.a; - outBuf.b = t; - t = uBuf.c; - outBuf.b = t; - - Nested n = uBufN.N1; - outBufN.N2 = n; -} +#version 450 core + +struct MyStruct +{ + vec2 foo[2]; + bool sb; +}; + +layout(binding = 0, std430) buffer SSBO0 +{ + MyStruct a; +} inBuf; + +layout(binding = 1, std430) buffer SSBO1 +{ + MyStruct b; +} outBuf; + +layout(binding = 2, std140) uniform UBO +{ + MyStruct c; +} uBuf; + +struct Nested { + float f; + MyStruct S[2]; +}; + +layout(binding = 2, std140) uniform UBON +{ + Nested N1; +} uBufN; + +layout(binding = 1, std430) buffer SSBO1N +{ + Nested N2; +} outBufN; + +void main() +{ + MyStruct t = inBuf.a; + outBuf.b = t; + t = uBuf.c; + outBuf.b = t; + + Nested n = uBufN.N1; + outBufN.N2 = n; +} diff --git a/core/deps/glslang/Test/spv.multiStructFuncall.frag b/core/deps/glslang/Test/spv.multiStructFuncall.frag index 6176c4deb..7f9968dcf 100644 --- a/core/deps/glslang/Test/spv.multiStructFuncall.frag +++ b/core/deps/glslang/Test/spv.multiStructFuncall.frag @@ -1,21 +1,21 @@ -#version 450 - -struct S { mat4 m; }; -buffer blockName { S s1; }; // need an S with decoration -S s2; // no decorations on S - -void fooConst(const in S s) { } -void foo(in S s) { } -void fooOut(inout S s) { } - -void main() -{ - fooConst(s1); - fooConst(s2); - - foo(s1); - foo(s2); - - fooOut(s1); - fooOut(s2); +#version 450 + +struct S { mat4 m; }; +buffer blockName { S s1; }; // need an S with decoration +S s2; // no decorations on S + +void fooConst(const in S s) { } +void foo(in S s) { } +void fooOut(inout S s) { } + +void main() +{ + fooConst(s1); + fooConst(s2); + + foo(s1); + foo(s2); + + fooOut(s1); + fooOut(s2); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc b/core/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc index 2cb056e0b..117a1ad46 100644 --- a/core/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc +++ b/core/deps/glslang/Test/spv.multiviewPerViewAttributes.tesc @@ -1,14 +1,14 @@ -#version 450 - -#extension GL_NVX_multiview_per_view_attributes :require - -layout(vertices = 4) out; -out gl_PerVertex { - int gl_ViewportMaskPerViewNV[]; - vec4 gl_PositionPerViewNV[]; - } gl_out[]; -void main() -{ - gl_out[gl_InvocationID].gl_ViewportMaskPerViewNV[0] = 1; - gl_out[gl_InvocationID].gl_PositionPerViewNV[0] = gl_in[1].gl_Position + gl_in[1].gl_PositionPerViewNV[0]; -} +#version 450 + +#extension GL_NVX_multiview_per_view_attributes :require + +layout(vertices = 4) out; +out gl_PerVertex { + int gl_ViewportMaskPerViewNV[]; + vec4 gl_PositionPerViewNV[]; + } gl_out[]; +void main() +{ + gl_out[gl_InvocationID].gl_ViewportMaskPerViewNV[0] = 1; + gl_out[gl_InvocationID].gl_PositionPerViewNV[0] = gl_in[1].gl_Position + gl_in[1].gl_PositionPerViewNV[0]; +} diff --git a/core/deps/glslang/Test/spv.multiviewPerViewAttributes.vert b/core/deps/glslang/Test/spv.multiviewPerViewAttributes.vert index 089cb632e..dd64a16c3 100644 --- a/core/deps/glslang/Test/spv.multiviewPerViewAttributes.vert +++ b/core/deps/glslang/Test/spv.multiviewPerViewAttributes.vert @@ -1,10 +1,10 @@ -#version 450 - -#extension GL_NVX_multiview_per_view_attributes :require - -void main() -{ - gl_ViewportMaskPerViewNV[0] = 1; - gl_PositionPerViewNV[0] = gl_Position; -} - +#version 450 + +#extension GL_NVX_multiview_per_view_attributes :require + +void main() +{ + gl_ViewportMaskPerViewNV[0] = 1; + gl_PositionPerViewNV[0] = gl_Position; +} + diff --git a/core/deps/glslang/Test/spv.newTexture.frag b/core/deps/glslang/Test/spv.newTexture.frag index 1a2c8e6f2..6f5f67c0b 100644 --- a/core/deps/glslang/Test/spv.newTexture.frag +++ b/core/deps/glslang/Test/spv.newTexture.frag @@ -1,72 +1,72 @@ -#version 430 - -uniform sampler2D s2D; -uniform sampler2DRect sr; -uniform sampler3D s3D; -uniform samplerCube sCube; -uniform samplerCubeShadow sCubeShadow; -uniform samplerCubeArrayShadow sCubeArrayShadow; -uniform sampler2DShadow s2DShadow; -uniform sampler2DArray s2DArray; -uniform sampler2DArrayShadow s2DArrayShadow; - -uniform isampler2D is2D; -uniform isampler3D is3D; -uniform isamplerCube isCube; -uniform isampler2DArray is2DArray; -uniform isampler2DMS is2Dms; - -uniform usampler2D us2D; -uniform usampler3D us3D; -uniform usamplerCube usCube; -uniform usampler2DArray us2DArray; - -in float c1D; -in vec2 c2D; -in vec3 c3D; -in vec4 c4D; - -flat in int ic1D; -flat in ivec2 ic2D; -flat in ivec3 ic3D; -flat in ivec4 ic4D; - -out vec4 FragData; - -void main() -{ - vec4 v = texture(s2D, c2D); - v.y += texture(sCubeArrayShadow, c4D, c1D); - v += textureProj(s3D, c4D); - v += textureLod(s2DArray, c3D, 1.2); - v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); - v += texelFetch(s3D, ic3D, ic1D); - v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); - v += texelFetchOffset(sr, ic2D, ivec2(4)); - v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); - v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); - v += textureGrad(sCube, c3D, c3D, c3D); - v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ivec2(3)); - v += textureProjGrad(s3D, c4D, c3D, c3D); - v += textureProjGradOffset(s2D, c3D, c2D, c2D, ivec2(3)); - - ivec4 iv = texture(is2D, c2D); - v += vec4(iv); - iv = textureProjOffset(is2D, c4D, ivec2(3)); - v += vec4(iv); - iv = textureProjLod(is2D, c3D, c1D); - v += vec4(iv); - iv = textureProjGrad(is2D, c3D, c2D, c2D); - v += vec4(iv); - iv = texture(is3D, c3D, 4.2); - v += vec4(iv); - iv = textureLod(isCube, c3D, c1D); - v += vec4(iv); - iv = texelFetch(is2DArray, ic3D, ic1D); - v += vec4(iv); - - ivec2 iv2 = textureSize(sCubeShadow, 2); - // iv2 += textureSize(is2Dms); - - FragData = v + vec4(iv2, 0.0, 0.0); -} +#version 430 + +uniform sampler2D s2D; +uniform sampler2DRect sr; +uniform sampler3D s3D; +uniform samplerCube sCube; +uniform samplerCubeShadow sCubeShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; +uniform sampler2DShadow s2DShadow; +uniform sampler2DArray s2DArray; +uniform sampler2DArrayShadow s2DArrayShadow; + +uniform isampler2D is2D; +uniform isampler3D is3D; +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; +uniform isampler2DMS is2Dms; + +uniform usampler2D us2D; +uniform usampler3D us3D; +uniform usamplerCube usCube; +uniform usampler2DArray us2DArray; + +in float c1D; +in vec2 c2D; +in vec3 c3D; +in vec4 c4D; + +flat in int ic1D; +flat in ivec2 ic2D; +flat in ivec3 ic3D; +flat in ivec4 ic4D; + +out vec4 FragData; + +void main() +{ + vec4 v = texture(s2D, c2D); + v.y += texture(sCubeArrayShadow, c4D, c1D); + v += textureProj(s3D, c4D); + v += textureLod(s2DArray, c3D, 1.2); + v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); + v += texelFetch(s3D, ic3D, ic1D); + v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); + v += texelFetchOffset(sr, ic2D, ivec2(4)); + v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); + v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); + v += textureGrad(sCube, c3D, c3D, c3D); + v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ivec2(3)); + v += textureProjGrad(s3D, c4D, c3D, c3D); + v += textureProjGradOffset(s2D, c3D, c2D, c2D, ivec2(3)); + + ivec4 iv = texture(is2D, c2D); + v += vec4(iv); + iv = textureProjOffset(is2D, c4D, ivec2(3)); + v += vec4(iv); + iv = textureProjLod(is2D, c3D, c1D); + v += vec4(iv); + iv = textureProjGrad(is2D, c3D, c2D, c2D); + v += vec4(iv); + iv = texture(is3D, c3D, 4.2); + v += vec4(iv); + iv = textureLod(isCube, c3D, c1D); + v += vec4(iv); + iv = texelFetch(is2DArray, ic3D, ic1D); + v += vec4(iv); + + ivec2 iv2 = textureSize(sCubeShadow, 2); + // iv2 += textureSize(is2Dms); + + FragData = v + vec4(iv2, 0.0, 0.0); +} diff --git a/core/deps/glslang/Test/spv.noBuiltInLoc.vert b/core/deps/glslang/Test/spv.noBuiltInLoc.vert index 8d94d7af5..4087ab363 100644 --- a/core/deps/glslang/Test/spv.noBuiltInLoc.vert +++ b/core/deps/glslang/Test/spv.noBuiltInLoc.vert @@ -1,19 +1,19 @@ -#version 450 core - -layout(location = 0) -in vec4 foo; - -layout(location = 0) -out vec4 bar; - -uniform vec4 uv1; -uniform float uv2; -uniform vec3 uv3; - -layout(binding = 0) uniform atomic_uint a_uint; - -void main() -{ - bar = foo; - gl_Position = foo; +#version 450 core + +layout(location = 0) +in vec4 foo; + +layout(location = 0) +out vec4 bar; + +uniform vec4 uv1; +uniform float uv2; +uniform vec3 uv3; + +layout(binding = 0) uniform atomic_uint a_uint; + +void main() +{ + bar = foo; + gl_Position = foo; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.noLocation.vert b/core/deps/glslang/Test/spv.noLocation.vert index 6d9ae53b6..43998525e 100644 --- a/core/deps/glslang/Test/spv.noLocation.vert +++ b/core/deps/glslang/Test/spv.noLocation.vert @@ -1,39 +1,39 @@ -#version 450 - -layout(location = 1) in vec4 in1; -in vec4 in2; // ERROR -layout(location = 3) in vec4 in3; - -layout(location = 1) out vec4 out1; -out vec4 out2; // ERROR -layout(location = 3) out vec4 out3; - -layout(location = 10) out inb1 { - vec4 a; - vec4 b; -} inbi1; -out inb2 { - layout(location = 12) vec4 a; - layout(location = 13) vec4 b; -} inbi2; -out inb3 { // ERROR - vec4 a; - vec4 b; -} inbi3; - -layout(location = 14) out struct S1 { vec4 a; } s1; -out struct S2 { vec4 a; } s2; // ERROR - -struct SS { int a; }; -out layout(location = 15) SS ss1; -out SS ss2; // ERROR - -out gl_PerVertex { - vec4 gl_Position; - float gl_ClipDistance[2]; -}; - -void main() -{ - gl_ClipDistance[0] = 1.0; -} +#version 450 + +layout(location = 1) in vec4 in1; +in vec4 in2; // ERROR +layout(location = 3) in vec4 in3; + +layout(location = 1) out vec4 out1; +out vec4 out2; // ERROR +layout(location = 3) out vec4 out3; + +layout(location = 10) out inb1 { + vec4 a; + vec4 b; +} inbi1; +out inb2 { + layout(location = 12) vec4 a; + layout(location = 13) vec4 b; +} inbi2; +out inb3 { // ERROR + vec4 a; + vec4 b; +} inbi3; + +layout(location = 14) out struct S1 { vec4 a; } s1; +out struct S2 { vec4 a; } s2; // ERROR + +struct SS { int a; }; +out layout(location = 15) SS ss1; +out SS ss2; // ERROR + +out gl_PerVertex { + vec4 gl_Position; + float gl_ClipDistance[2]; +}; + +void main() +{ + gl_ClipDistance[0] = 1.0; +} diff --git a/core/deps/glslang/Test/spv.noWorkgroup.comp b/core/deps/glslang/Test/spv.noWorkgroup.comp index ce4ea7497..0c77f278f 100644 --- a/core/deps/glslang/Test/spv.noWorkgroup.comp +++ b/core/deps/glslang/Test/spv.noWorkgroup.comp @@ -1,7 +1,7 @@ -#version 450 - -layout(local_size_x_id = 18, local_size_y_id=10,local_size_z_id = 19) in; - -void main() -{ -} +#version 450 + +layout(local_size_x_id = 18, local_size_y_id=10,local_size_z_id = 19) in; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.nonSquare.vert b/core/deps/glslang/Test/spv.nonSquare.vert index 70682d013..9f7125bdf 100644 --- a/core/deps/glslang/Test/spv.nonSquare.vert +++ b/core/deps/glslang/Test/spv.nonSquare.vert @@ -1,25 +1,25 @@ -#version 140 - -in vec3 v3; -in vec4 v4; - -out mat3x2 m32; - -const vec2 cv2 = vec2(10.0, 20.0); -const mat2x4 m24 = mat2x4(3.0); -const mat4x2 m42 = mat4x2(1.0, 2.0, - 3.0, 4.0, - 5.0, 6.0, - 7.0, 8.0); - -void main() -{ - mat2x3 m23; - vec2 a, b; - - a = v3 * m23; - b = m32 * v3; - - gl_Position = vec4(m23 * m32 * v3, m24[1][3]) + - (m24 * m42) * v4 + cv2 * m42 + m24 * cv2 + vec4(cv2[1], cv2.x, m42[2][1], m42[2][0]); -} +#version 140 + +in vec3 v3; +in vec4 v4; + +out mat3x2 m32; + +const vec2 cv2 = vec2(10.0, 20.0); +const mat2x4 m24 = mat2x4(3.0); +const mat4x2 m42 = mat4x2(1.0, 2.0, + 3.0, 4.0, + 5.0, 6.0, + 7.0, 8.0); + +void main() +{ + mat2x3 m23; + vec2 a, b; + + a = v3 * m23; + b = m32 * v3; + + gl_Position = vec4(m23 * m32 * v3, m24[1][3]) + + (m24 * m42) * v4 + cv2 * m42 + m24 * cv2 + vec4(cv2[1], cv2.x, m42[2][1], m42[2][0]); +} diff --git a/core/deps/glslang/Test/spv.nonuniform.frag b/core/deps/glslang/Test/spv.nonuniform.frag index e5e60f892..d3b05a5ac 100644 --- a/core/deps/glslang/Test/spv.nonuniform.frag +++ b/core/deps/glslang/Test/spv.nonuniform.frag @@ -1,55 +1,55 @@ -#version 450 - -#extension GL_EXT_nonuniform_qualifier : enable - -layout(location=0) nonuniformEXT in vec4 nu_inv4; -nonuniformEXT float nu_gf; -layout(location=1) in nonuniformEXT flat int nu_ii; - -layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[]; -layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; -layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; -layout(binding=3) uniform uname { float a; } uniformBuffer[]; -layout(binding=4) buffer bname { float b; } storageBuffer[]; -layout(binding=5) uniform sampler2D sampledImage[]; -layout(binding=6, r32f) uniform image2D storageImage[]; -layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[]; -layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; -layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; - -nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) -{ - return nupi; -} - -void main() -{ - nonuniformEXT int nu_li; - int dyn_i; - - int a = foo(nu_li, nu_li); - nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); - - float b; - b = nu_inv4.x * nu_gf; - b += subpassLoad(inputAttachmentDyn[dyn_i]).x; - b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x; - b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x; - b += uniformBuffer[nu_ii].a; - b += storageBuffer[nu_ii].b; - b += texture(sampledImage[nu_ii], vec2(0.5)).x; - b += imageLoad(storageImage[nu_ii], ivec2(1)).x; - b += subpassLoad(inputAttachment[nu_ii]).x; - b += texelFetch(uniformTexelBuffer[nu_ii], 1).x; - b += imageLoad(storageTexelBuffer[nu_ii], 1).x; - - nonuniformEXT ivec4 v; - nonuniformEXT mat4 m; - nonuniformEXT struct S { int a; } s; - ivec4 uv; - b += uniformBuffer[v.y].a; - b += uniformBuffer[v[2]].a; - b += uniformBuffer[uv[nu_ii]].a; - b += uniformBuffer[int(m[2].z)].a; - b += uniformBuffer[s.a].a; -} +#version 450 + +#extension GL_EXT_nonuniform_qualifier : enable + +layout(location=0) nonuniformEXT in vec4 nu_inv4; +nonuniformEXT float nu_gf; +layout(location=1) in nonuniformEXT flat int nu_ii; + +layout(binding=0, input_attachment_index = 0) uniform subpassInput inputAttachmentDyn[]; +layout(binding=1) uniform samplerBuffer uniformTexelBufferDyn[]; +layout(binding=2, r32f) uniform imageBuffer storageTexelBufferDyn[]; +layout(binding=3) uniform uname { float a; } uniformBuffer[]; +layout(binding=4) buffer bname { float b; } storageBuffer[]; +layout(binding=5) uniform sampler2D sampledImage[]; +layout(binding=6, r32f) uniform image2D storageImage[]; +layout(binding=7, input_attachment_index = 1) uniform subpassInput inputAttachment[]; +layout(binding=8) uniform samplerBuffer uniformTexelBuffer[]; +layout(binding=9, r32f) uniform imageBuffer storageTexelBuffer[]; + +nonuniformEXT int foo(nonuniformEXT int nupi, nonuniformEXT out int f) +{ + return nupi; +} + +void main() +{ + nonuniformEXT int nu_li; + int dyn_i; + + int a = foo(nu_li, nu_li); + nu_li = nonuniformEXT(a) + nonuniformEXT(a * 2); + + float b; + b = nu_inv4.x * nu_gf; + b += subpassLoad(inputAttachmentDyn[dyn_i]).x; + b += texelFetch(uniformTexelBufferDyn[dyn_i], 1).x; + b += imageLoad(storageTexelBufferDyn[dyn_i], 1).x; + b += uniformBuffer[nu_ii].a; + b += storageBuffer[nu_ii].b; + b += texture(sampledImage[nu_ii], vec2(0.5)).x; + b += imageLoad(storageImage[nu_ii], ivec2(1)).x; + b += subpassLoad(inputAttachment[nu_ii]).x; + b += texelFetch(uniformTexelBuffer[nu_ii], 1).x; + b += imageLoad(storageTexelBuffer[nu_ii], 1).x; + + nonuniformEXT ivec4 v; + nonuniformEXT mat4 m; + nonuniformEXT struct S { int a; } s; + ivec4 uv; + b += uniformBuffer[v.y].a; + b += uniformBuffer[v[2]].a; + b += uniformBuffer[uv[nu_ii]].a; + b += uniformBuffer[int(m[2].z)].a; + b += uniformBuffer[s.a].a; +} diff --git a/core/deps/glslang/Test/spv.nonuniform2.frag b/core/deps/glslang/Test/spv.nonuniform2.frag index 085a99fc3..9bb7eaa37 100644 --- a/core/deps/glslang/Test/spv.nonuniform2.frag +++ b/core/deps/glslang/Test/spv.nonuniform2.frag @@ -1,9 +1,9 @@ -#version 450 -#extension GL_EXT_nonuniform_qualifier : require -layout(set=0,binding=4,rgba32f) uniform imageBuffer data[]; -layout(location = 0) out vec4 FragColor; -layout(location = 3) in flat int rIndex; -void main() -{ - FragColor = imageLoad(data[nonuniformEXT(rIndex)], 0); -} +#version 450 +#extension GL_EXT_nonuniform_qualifier : require +layout(set=0,binding=4,rgba32f) uniform imageBuffer data[]; +layout(location = 0) out vec4 FragColor; +layout(location = 3) in flat int rIndex; +void main() +{ + FragColor = imageLoad(data[nonuniformEXT(rIndex)], 0); +} diff --git a/core/deps/glslang/Test/spv.nonuniform3.frag b/core/deps/glslang/Test/spv.nonuniform3.frag new file mode 100644 index 000000000..e79865e35 --- /dev/null +++ b/core/deps/glslang/Test/spv.nonuniform3.frag @@ -0,0 +1,10 @@ +#version 450 +#extension GL_EXT_nonuniform_qualifier : require +layout(set = 0, binding = 0) uniform texture2D uTex[]; +layout(set = 1, binding = 0) uniform sampler uSamp; +layout(location = 0) flat in int Index; +layout(location = 0) out vec4 FragColor; +void main() +{ + FragColor = texture(nonuniformEXT(sampler2D(uTex[Index], uSamp)), vec2(0.5)); +} diff --git a/core/deps/glslang/Test/spv.nonuniform4.frag b/core/deps/glslang/Test/spv.nonuniform4.frag new file mode 100644 index 000000000..2eb98aa12 --- /dev/null +++ b/core/deps/glslang/Test/spv.nonuniform4.frag @@ -0,0 +1,8 @@ +#version 450 +#extension GL_EXT_nonuniform_qualifier : require +layout(set=0,binding=4,r32ui) uniform uimageBuffer data[]; +layout(location = 3) in flat int rIndex; +void main() +{ + imageAtomicAdd(data[nonuniformEXT(rIndex)], 0, 0); +} diff --git a/core/deps/glslang/Test/spv.nonuniform5.frag b/core/deps/glslang/Test/spv.nonuniform5.frag new file mode 100644 index 000000000..ef7077953 --- /dev/null +++ b/core/deps/glslang/Test/spv.nonuniform5.frag @@ -0,0 +1,15 @@ +#version 450 +#extension GL_EXT_nonuniform_qualifier : require + +layout(location = 0) flat in int Index; +layout(location = 0) out vec4 FragColor; + +layout(set = 0, binding = 0) uniform UBO +{ + vec4 v; +} ubos[]; + +void main() +{ + FragColor = ubos[nonuniformEXT(Index)].v; +} diff --git a/core/deps/glslang/Test/spv.offsets.frag b/core/deps/glslang/Test/spv.offsets.frag index 1c85da615..0a1c008c9 100644 --- a/core/deps/glslang/Test/spv.offsets.frag +++ b/core/deps/glslang/Test/spv.offsets.frag @@ -1,17 +1,17 @@ -#version 450 - -layout(set = 0, binding = 0, std140) uniform n1 { - layout(offset = 8) int a; - layout(offset = 4) int b; - layout(offset = 0) int c; - layout(offset = 12) int d; -} i1; - -layout(set = 0, binding = 1, std430) buffer n2 { - layout(offset = 32) vec3 e; - vec3 f; - layout(offset = 16) vec3 g; - layout(offset = 0) vec3 h; -} i2; - +#version 450 + +layout(set = 0, binding = 0, std140) uniform n1 { + layout(offset = 8) int a; + layout(offset = 4) int b; + layout(offset = 0) int c; + layout(offset = 12) int d; +} i1; + +layout(set = 0, binding = 1, std430) buffer n2 { + layout(offset = 32) vec3 e; + vec3 f; + layout(offset = 16) vec3 g; + layout(offset = 0) vec3 h; +} i2; + void main() {} \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.perprimitiveNV.frag b/core/deps/glslang/Test/spv.perprimitiveNV.frag index 720d922ba..56e00f546 100644 --- a/core/deps/glslang/Test/spv.perprimitiveNV.frag +++ b/core/deps/glslang/Test/spv.perprimitiveNV.frag @@ -1,21 +1,21 @@ -#version 460 - -#extension GL_NV_mesh_shader: require - -layout(location=0) -in B { - perprimitiveNV float f; -}; - -layout(location=4) -in C { - flat centroid float h; -}; - -layout(location=8) -out float g; - -void main() -{ - g = f + h; -} +#version 460 + +#extension GL_NV_mesh_shader: require + +layout(location=0) +in B { + perprimitiveNV float f; +}; + +layout(location=4) +in C { + flat centroid float h; +}; + +layout(location=8) +out float g; + +void main() +{ + g = f + h; +} diff --git a/core/deps/glslang/Test/spv.precision.frag b/core/deps/glslang/Test/spv.precision.frag index 0d282d740..090c1a6a1 100644 --- a/core/deps/glslang/Test/spv.precision.frag +++ b/core/deps/glslang/Test/spv.precision.frag @@ -1,60 +1,60 @@ -#version 310 es -precision mediump float; -in lowp float lowfin; -in mediump float mediumfin; -in highp vec4 highfin; - -highp int uniform_high; -mediump int uniform_medium; -lowp int uniform_low; -bvec2 ub2; - -out mediump vec4 mediumfout; - -highp float global_highp; - -lowp vec2 foo(mediump vec3 mv3) -{ - return highfin.xy; -} - -bool boolfun(bvec2 bv2) -{ - return bv2 == bvec2(false, true); -} - -struct S { - highp float a; - lowp float b; -}; - -in S s; - -void main() -{ - lowp int sum = uniform_medium + uniform_high; - - sum += uniform_high; - sum += uniform_low; - - // test maxing precisions of args to get precision of builtin - lowp float arg1 = 3.2; - mediump float arg2 = 1023908.2; - lowp float d = distance(lowfin, mediumfin); - - global_highp = length(highfin); - - highp vec4 local_highp = vec4(global_highp); - - mediumfout = vec4(sin(d)) + arg2 + local_highp; - - sum += 4 + ((ivec2(uniform_low) * ivec2(uniform_high) + ivec2((/* comma operator */uniform_low, uniform_high)))).x; - - mediumfout += vec4(sum); - - if (boolfun(ub2)) - ++mediumfout; - - mediumfout *= s.a; - mediumfout *= s.b; -} +#version 310 es +precision mediump float; +in lowp float lowfin; +in mediump float mediumfin; +in highp vec4 highfin; + +highp int uniform_high; +mediump int uniform_medium; +lowp int uniform_low; +bvec2 ub2; + +out mediump vec4 mediumfout; + +highp float global_highp; + +lowp vec2 foo(mediump vec3 mv3) +{ + return highfin.xy; +} + +bool boolfun(bvec2 bv2) +{ + return bv2 == bvec2(false, true); +} + +struct S { + highp float a; + lowp float b; +}; + +in S s; + +void main() +{ + lowp int sum = uniform_medium + uniform_high; + + sum += uniform_high; + sum += uniform_low; + + // test maxing precisions of args to get precision of builtin + lowp float arg1 = 3.2; + mediump float arg2 = 1023908.2; + lowp float d = distance(lowfin, mediumfin); + + global_highp = length(highfin); + + highp vec4 local_highp = vec4(global_highp); + + mediumfout = vec4(sin(d)) + arg2 + local_highp; + + sum += 4 + ((ivec2(uniform_low) * ivec2(uniform_high) + ivec2((/* comma operator */uniform_low, uniform_high)))).x; + + mediumfout += vec4(sum); + + if (boolfun(ub2)) + ++mediumfout; + + mediumfout *= s.a; + mediumfout *= s.b; +} diff --git a/core/deps/glslang/Test/spv.precisionNonESSamp.frag b/core/deps/glslang/Test/spv.precisionNonESSamp.frag index 3c65975f4..8abf839eb 100644 --- a/core/deps/glslang/Test/spv.precisionNonESSamp.frag +++ b/core/deps/glslang/Test/spv.precisionNonESSamp.frag @@ -1,24 +1,24 @@ -#version 450 - -precision lowp sampler2D; -precision lowp int; -precision lowp float; - -uniform lowp sampler2D s; -uniform highp sampler3D t; -layout(rgba32f) uniform lowp image2D i1; -layout(rgba32f) uniform highp image2D i2; - -layout(location = 0) in lowp vec2 v2; -layout(location = 1) in lowp vec3 v3; -layout(location = 3) flat in lowp ivec2 iv2; - -layout(location = 0) out lowp vec4 color; - -void main() -{ - color = texture(s, v2); - color = texture(t, v3); - lowp vec4 vi1 = imageLoad(i1, iv2); - lowp vec4 vi2 = imageLoad(i2, iv2); -} +#version 450 + +precision lowp sampler2D; +precision lowp int; +precision lowp float; + +uniform lowp sampler2D s; +uniform highp sampler3D t; +layout(rgba32f) uniform lowp image2D i1; +layout(rgba32f) uniform highp image2D i2; + +layout(location = 0) in lowp vec2 v2; +layout(location = 1) in lowp vec3 v3; +layout(location = 3) flat in lowp ivec2 iv2; + +layout(location = 0) out lowp vec4 color; + +void main() +{ + color = texture(s, v2); + color = texture(t, v3); + lowp vec4 vi1 = imageLoad(i1, iv2); + lowp vec4 vi2 = imageLoad(i2, iv2); +} diff --git a/core/deps/glslang/Test/spv.prepost.frag b/core/deps/glslang/Test/spv.prepost.frag index 9627b7e2d..dfd456660 100644 --- a/core/deps/glslang/Test/spv.prepost.frag +++ b/core/deps/glslang/Test/spv.prepost.frag @@ -1,38 +1,38 @@ -#version 140 - -void main() -{ - struct s { - float y[5]; - } str; - - float t; - int index = 5; // all indexing is 4 - - str.y[4] = 2.0; // 2.0 - t = ++str.y[--index]; // 3.0 - str.y[4] += t; // 6.0 - t = str.y[4]--; // 5.0 (t = 6.0) - str.y[index++] += t; // 11.0 - --str.y[--index]; // 10.0 - - float x = str.y[4]; - ++x; - --x; - x++; - x--; - - // x is 10.0 - - float y = x * ++x; // 10 * 11 - float z = y * x--; // 110 * 11 - - // x is 10.0 - // z is 1210.0 - - vec4 v = vec4(1.0, 2.0, 3.0, 4.0); - v.y = v.z--; // (1,3,2,4) - v.x = --v.w; // (3,3,2,3) - - gl_FragColor = z * v;// (3630.0, 3630.0, 2420.0, 3630.0) -} +#version 140 + +void main() +{ + struct s { + float y[5]; + } str; + + float t; + int index = 5; // all indexing is 4 + + str.y[4] = 2.0; // 2.0 + t = ++str.y[--index]; // 3.0 + str.y[4] += t; // 6.0 + t = str.y[4]--; // 5.0 (t = 6.0) + str.y[index++] += t; // 11.0 + --str.y[--index]; // 10.0 + + float x = str.y[4]; + ++x; + --x; + x++; + x--; + + // x is 10.0 + + float y = x * ++x; // 10 * 11 + float z = y * x--; // 110 * 11 + + // x is 10.0 + // z is 1210.0 + + vec4 v = vec4(1.0, 2.0, 3.0, 4.0); + v.y = v.z--; // (1,3,2,4) + v.x = --v.w; // (3,3,2,3) + + gl_FragColor = z * v;// (3630.0, 3630.0, 2420.0, 3630.0) +} diff --git a/core/deps/glslang/Test/spv.privateVariableTypes.frag b/core/deps/glslang/Test/spv.privateVariableTypes.frag index a0bfbd9c6..cb6981f7b 100644 --- a/core/deps/glslang/Test/spv.privateVariableTypes.frag +++ b/core/deps/glslang/Test/spv.privateVariableTypes.frag @@ -1,17 +1,17 @@ -#version 460 core -#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable - -int8_t i8; -uint8_t u8; -int16_t i16; -uint16_t u16; -int64_t i64; -uint64_t u64; -float16_t f16; - -void main() -{ -} +#version 460 core +#extension GL_EXT_shader_explicit_arithmetic_types_int64 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16 : enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16 : enable + +int8_t i8; +uint8_t u8; +int16_t i16; +uint16_t u16; +int64_t i64; +uint64_t u64; +float16_t f16; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.pushConstant.vert b/core/deps/glslang/Test/spv.pushConstant.vert index 5fb64adf7..b1721bc60 100644 --- a/core/deps/glslang/Test/spv.pushConstant.vert +++ b/core/deps/glslang/Test/spv.pushConstant.vert @@ -1,17 +1,17 @@ -#version 400 - -layout(push_constant) uniform Material { - int kind; - float fa[3]; -} matInst; - -out vec4 color; - -void main() -{ - switch (matInst.kind) { - case 1: color = vec4(0.2); break; - case 2: color = vec4(0.5); break; - default: color = vec4(0.0); break; - } -} +#version 400 + +layout(push_constant) uniform Material { + int kind; + float fa[3]; +} matInst; + +out vec4 color; + +void main() +{ + switch (matInst.kind) { + case 1: color = vec4(0.2); break; + case 2: color = vec4(0.5); break; + default: color = vec4(0.0); break; + } +} diff --git a/core/deps/glslang/Test/spv.pushConstantAnon.vert b/core/deps/glslang/Test/spv.pushConstantAnon.vert index cd76420fc..c4438b7c8 100644 --- a/core/deps/glslang/Test/spv.pushConstantAnon.vert +++ b/core/deps/glslang/Test/spv.pushConstantAnon.vert @@ -1,17 +1,17 @@ -#version 400 - -layout(push_constant) uniform Material { - int kind; - float fa[3]; -}; - -out vec4 color; - -void main() -{ - switch (kind) { - case 1: color = vec4(0.2); break; - case 2: color = vec4(0.5); break; - default: color = vec4(fa[1]); break; - } -} +#version 400 + +layout(push_constant) uniform Material { + int kind; + float fa[3]; +}; + +out vec4 color; + +void main() +{ + switch (kind) { + case 1: color = vec4(0.2); break; + case 2: color = vec4(0.5); break; + default: color = vec4(fa[1]); break; + } +} diff --git a/core/deps/glslang/Test/spv.qualifiers.vert b/core/deps/glslang/Test/spv.qualifiers.vert index ee3330f40..96eb17db1 100644 --- a/core/deps/glslang/Test/spv.qualifiers.vert +++ b/core/deps/glslang/Test/spv.qualifiers.vert @@ -1,19 +1,19 @@ -#version 430 core - -in vec4 inV; - -centroid out vec4 outVc; -smooth out vec4 outVs; -flat out vec4 outVf; -noperspective out vec4 outVn; - -centroid noperspective out vec4 outVcn; - -void main() -{ - outVc = inV; - outVs = inV; - outVf = inV; - outVn = inV; - outVcn = inV; -} +#version 430 core + +in vec4 inV; + +centroid out vec4 outVc; +smooth out vec4 outVs; +flat out vec4 outVf; +noperspective out vec4 outVn; + +centroid noperspective out vec4 outVcn; + +void main() +{ + outVc = inV; + outVs = inV; + outVf = inV; + outVn = inV; + outVcn = inV; +} diff --git a/core/deps/glslang/Test/spv.queryL.frag b/core/deps/glslang/Test/spv.queryL.frag index 91df38330..6f4ad5c88 100644 --- a/core/deps/glslang/Test/spv.queryL.frag +++ b/core/deps/glslang/Test/spv.queryL.frag @@ -1,64 +1,64 @@ #version 430 core -uniform sampler1D samp1D; -uniform isampler2D isamp2D; -uniform usampler2D usamp2D; -uniform isampler3D isamp3D; -uniform usampler3D usamp3D; -uniform samplerCube sampCube; -uniform isamplerCube isampCube; -uniform isampler1DArray isamp1DA; -uniform sampler2DArray samp2DA; -uniform usampler2DArray usamp2DA; -uniform isamplerCubeArray isampCubeA; -uniform usamplerCubeArray usampCubeA; - -uniform sampler1DShadow samp1Ds; -uniform sampler2DShadow samp2Ds; -uniform samplerCubeShadow sampCubes; -uniform sampler1DArrayShadow samp1DAs; -uniform sampler2DArrayShadow samp2DAs; -uniform samplerCubeArrayShadow sampCubeAs; - -uniform samplerBuffer sampBuf; -uniform sampler2DRect sampRect; - -void main() -{ - vec2 lod; - float pf; - vec2 pf2; - vec3 pf3; - - lod = textureQueryLod(samp1D, pf); - lod += textureQueryLod(isamp2D, pf2); - lod += textureQueryLod(usamp3D, pf3); - lod += textureQueryLod(sampCube, pf3); - lod += textureQueryLod(isamp1DA, pf); - lod += textureQueryLod(usamp2DA, pf2); - lod += textureQueryLod(isampCubeA, pf3); - - lod += textureQueryLod(samp1Ds, pf); - lod += textureQueryLod(samp2Ds, pf2); - lod += textureQueryLod(sampCubes, pf3); - lod += textureQueryLod(samp1DAs, pf); - lod += textureQueryLod(samp2DAs, pf2); - lod += textureQueryLod(sampCubeAs, pf3); - - int levels; - - levels = textureQueryLevels(samp1D); - levels += textureQueryLevels(usamp2D); - levels += textureQueryLevels(isamp3D); - levels += textureQueryLevels(isampCube); - levels += textureQueryLevels(isamp1DA); - levels += textureQueryLevels(samp2DA); - levels += textureQueryLevels(usampCubeA); - - levels = textureQueryLevels(samp1Ds); - levels += textureQueryLevels(samp2Ds); - levels += textureQueryLevels(sampCubes); - levels += textureQueryLevels(samp1DAs); - levels += textureQueryLevels(samp2DAs); - levels += textureQueryLevels(sampCubeAs); -} +uniform sampler1D samp1D; +uniform isampler2D isamp2D; +uniform usampler2D usamp2D; +uniform isampler3D isamp3D; +uniform usampler3D usamp3D; +uniform samplerCube sampCube; +uniform isamplerCube isampCube; +uniform isampler1DArray isamp1DA; +uniform sampler2DArray samp2DA; +uniform usampler2DArray usamp2DA; +uniform isamplerCubeArray isampCubeA; +uniform usamplerCubeArray usampCubeA; + +uniform sampler1DShadow samp1Ds; +uniform sampler2DShadow samp2Ds; +uniform samplerCubeShadow sampCubes; +uniform sampler1DArrayShadow samp1DAs; +uniform sampler2DArrayShadow samp2DAs; +uniform samplerCubeArrayShadow sampCubeAs; + +uniform samplerBuffer sampBuf; +uniform sampler2DRect sampRect; + +void main() +{ + vec2 lod; + float pf; + vec2 pf2; + vec3 pf3; + + lod = textureQueryLod(samp1D, pf); + lod += textureQueryLod(isamp2D, pf2); + lod += textureQueryLod(usamp3D, pf3); + lod += textureQueryLod(sampCube, pf3); + lod += textureQueryLod(isamp1DA, pf); + lod += textureQueryLod(usamp2DA, pf2); + lod += textureQueryLod(isampCubeA, pf3); + + lod += textureQueryLod(samp1Ds, pf); + lod += textureQueryLod(samp2Ds, pf2); + lod += textureQueryLod(sampCubes, pf3); + lod += textureQueryLod(samp1DAs, pf); + lod += textureQueryLod(samp2DAs, pf2); + lod += textureQueryLod(sampCubeAs, pf3); + + int levels; + + levels = textureQueryLevels(samp1D); + levels += textureQueryLevels(usamp2D); + levels += textureQueryLevels(isamp3D); + levels += textureQueryLevels(isampCube); + levels += textureQueryLevels(isamp1DA); + levels += textureQueryLevels(samp2DA); + levels += textureQueryLevels(usampCubeA); + + levels = textureQueryLevels(samp1Ds); + levels += textureQueryLevels(samp2Ds); + levels += textureQueryLevels(sampCubes); + levels += textureQueryLevels(samp1DAs); + levels += textureQueryLevels(samp2DAs); + levels += textureQueryLevels(sampCubeAs); +} diff --git a/core/deps/glslang/Test/spv.rankShift.comp b/core/deps/glslang/Test/spv.rankShift.comp index 4bed97c79..1761ad1f5 100644 --- a/core/deps/glslang/Test/spv.rankShift.comp +++ b/core/deps/glslang/Test/spv.rankShift.comp @@ -1,15 +1,15 @@ -#version 450 -#extension GL_ARB_gpu_shader_int64 : require - -layout(local_size_x = 54) in; - -layout(location=4) uniform int64_t arg0; -layout(location=5) uniform uint arg1; - -void main() -{ - uint64_t result = arg0 << arg1; - result = arg0 >> arg1; - result <<= arg1; - result >>= arg1; +#version 450 +#extension GL_ARB_gpu_shader_int64 : require + +layout(local_size_x = 54) in; + +layout(location=4) uniform int64_t arg0; +layout(location=5) uniform uint arg1; + +void main() +{ + uint64_t result = arg0 << arg1; + result = arg0 >> arg1; + result <<= arg1; + result >>= arg1; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.scalarlayout.frag b/core/deps/glslang/Test/spv.scalarlayout.frag index 15668babc..c7ecf5025 100644 --- a/core/deps/glslang/Test/spv.scalarlayout.frag +++ b/core/deps/glslang/Test/spv.scalarlayout.frag @@ -1,32 +1,32 @@ -#version 450 core - -#extension GL_EXT_scalar_block_layout : enable - -// Block memory layout -struct S -{ - float a; // offset 0 - vec2 b; // offset 4 - double c; // offset 16 - float d; // offset 24 - vec3 e; // offset 28 - float f; // offset 40 - // size = 44, align = 8 -}; - -layout(column_major, scalar) uniform B1 -{ - float a; // offset = 0 - vec2 b; // offset = 4 - vec3 c; // offset = 12 - float d[2]; // offset = 24 - mat2x3 e; // offset = 32, takes 24 bytes, matrixstride = 12 - mat2x3 f[2]; // offset = 56, takes 48 bytes, matrixstride = 12, arraystride = 24 - float g; // offset = 104 - S h; // offset = 112 (aligned to multiple of 8) - S i[2]; // offset = 160 (aligned to multiple of 8) stride = 48 -}; - -void main() -{ -} +#version 450 core + +#extension GL_EXT_scalar_block_layout : enable + +// Block memory layout +struct S +{ + float a; // offset 0 + vec2 b; // offset 4 + double c; // offset 16 + float d; // offset 24 + vec3 e; // offset 28 + float f; // offset 40 + // size = 44, align = 8 +}; + +layout(column_major, scalar) uniform B1 +{ + float a; // offset = 0 + vec2 b; // offset = 4 + vec3 c; // offset = 12 + float d[2]; // offset = 24 + mat2x3 e; // offset = 32, takes 24 bytes, matrixstride = 12 + mat2x3 f[2]; // offset = 56, takes 48 bytes, matrixstride = 12, arraystride = 24 + float g; // offset = 104 + S h; // offset = 112 (aligned to multiple of 8) + S i[2]; // offset = 160 (aligned to multiple of 8) stride = 48 +}; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.scalarlayoutfloat16.frag b/core/deps/glslang/Test/spv.scalarlayoutfloat16.frag index fd31e1c59..ff8709737 100644 --- a/core/deps/glslang/Test/spv.scalarlayoutfloat16.frag +++ b/core/deps/glslang/Test/spv.scalarlayoutfloat16.frag @@ -1,31 +1,31 @@ -#version 450 core - -#extension GL_EXT_shader_16bit_storage: enable -#extension GL_EXT_scalar_block_layout : enable - -// Block memory layout -struct S -{ - float16_t a; // offset 0 - f16vec2 b; // offset 2 - double c; // offset 8 - float16_t d; // offset 16 - f16vec3 e; // offset 18 - float16_t f; // offset 24 - // size = 26, align = 8 -}; - -layout(column_major, scalar) uniform B1 -{ - float16_t a; // offset = 0 - f16vec2 b; // offset = 2 - f16vec3 c; // offset = 6 - float16_t d[2]; // offset = 12 stride = 2 - float16_t g; // offset = 16 - S h; // offset = 24 (aligned to multiple of 8) - S i[2]; // offset = 56 (aligned to multiple of 8) stride = 32 -}; - -void main() -{ -} +#version 450 core + +#extension GL_EXT_shader_16bit_storage: enable +#extension GL_EXT_scalar_block_layout : enable + +// Block memory layout +struct S +{ + float16_t a; // offset 0 + f16vec2 b; // offset 2 + double c; // offset 8 + float16_t d; // offset 16 + f16vec3 e; // offset 18 + float16_t f; // offset 24 + // size = 26, align = 8 +}; + +layout(column_major, scalar) uniform B1 +{ + float16_t a; // offset = 0 + f16vec2 b; // offset = 2 + f16vec3 c; // offset = 6 + float16_t d[2]; // offset = 12 stride = 2 + float16_t g; // offset = 16 + S h; // offset = 24 (aligned to multiple of 8) + S i[2]; // offset = 56 (aligned to multiple of 8) stride = 32 +}; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.separate.frag b/core/deps/glslang/Test/spv.separate.frag index 10704509b..21e5db330 100644 --- a/core/deps/glslang/Test/spv.separate.frag +++ b/core/deps/glslang/Test/spv.separate.frag @@ -1,21 +1,21 @@ -#version 400 - -uniform sampler s; -uniform samplerShadow sShadow; -uniform sampler sA[4]; -uniform texture2D t2d; -uniform texture3D t3d[4]; -flat in int i; - -out vec4 color; - -void main() -{ - color = texture(sampler2D(t2d, s), vec2(0.5)); - color += texture(sampler3D(t3d[i], sA[2]), vec3(0.5)); - color += texture(sampler2D(t2d, s), vec2(0.5)); -} - +#version 400 + +uniform sampler s; +uniform samplerShadow sShadow; +uniform sampler sA[4]; +uniform texture2D t2d; +uniform texture3D t3d[4]; +flat in int i; + +out vec4 color; + +void main() +{ + color = texture(sampler2D(t2d, s), vec2(0.5)); + color += texture(sampler3D(t3d[i], sA[2]), vec3(0.5)); + color += texture(sampler2D(t2d, s), vec2(0.5)); +} + uniform texture2D tex2D; uniform textureCube texCube; uniform textureCubeArray texCubeArray; diff --git a/core/deps/glslang/Test/spv.set.vert b/core/deps/glslang/Test/spv.set.vert index e116c02bc..d211ef111 100644 --- a/core/deps/glslang/Test/spv.set.vert +++ b/core/deps/glslang/Test/spv.set.vert @@ -1,14 +1,14 @@ -#version 450 - -layout(set = 4, binding = 7) uniform sampler2D samp2D; - -layout(set = 0, binding = 8) buffer setBuf { - vec4 color; -} setBufInst; - -out vec4 color; - -void main() -{ - color = setBufInst.color; -} +#version 450 + +layout(set = 4, binding = 7) uniform sampler2D samp2D; + +layout(set = 0, binding = 8) buffer setBuf { + vec4 color; +} setBufInst; + +out vec4 color; + +void main() +{ + color = setBufInst.color; +} diff --git a/core/deps/glslang/Test/spv.shaderBallot.comp b/core/deps/glslang/Test/spv.shaderBallot.comp index 6b28c67c8..20059b1c3 100644 --- a/core/deps/glslang/Test/spv.shaderBallot.comp +++ b/core/deps/glslang/Test/spv.shaderBallot.comp @@ -1,59 +1,59 @@ -#version 450 - -#extension GL_ARB_gpu_shader_int64: enable -#extension GL_ARB_shader_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubGroupInvocationARB + gl_SubGroupSizeARB) % 4; - - uint64_t relMask = gl_SubGroupEqMaskARB + - gl_SubGroupGeMaskARB + - gl_SubGroupGtMaskARB + - gl_SubGroupLeMaskARB + - gl_SubGroupLtMaskARB; - - if (relMask == ballotARB(true)) - { - data[invocation].f4.x = readInvocationARB(data[0].f4.x, invocation); - data[invocation].f4.xy = readInvocationARB(data[1].f4.xy, invocation); - data[invocation].f4.xyz = readInvocationARB(data[2].f4.xyz, invocation); - data[invocation].f4 = readInvocationARB(data[3].f4, invocation); - - data[invocation].i4.x = readInvocationARB(data[0].i4.x, invocation); - data[invocation].i4.xy = readInvocationARB(data[1].i4.xy, invocation); - data[invocation].i4.xyz = readInvocationARB(data[2].i4.xyz, invocation); - data[invocation].i4 = readInvocationARB(data[3].i4, invocation); - - data[invocation].u4.x = readInvocationARB(data[0].u4.x, invocation); - data[invocation].u4.xy = readInvocationARB(data[1].u4.xy, invocation); - data[invocation].u4.xyz = readInvocationARB(data[2].u4.xyz, invocation); - data[invocation].u4 = readInvocationARB(data[3].u4, invocation); - } - else - { - data[invocation].f4.x = readFirstInvocationARB(data[0].f4.x); - data[invocation].f4.xy = readFirstInvocationARB(data[1].f4.xy); - data[invocation].f4.xyz = readFirstInvocationARB(data[2].f4.xyz); - data[invocation].f4 = readFirstInvocationARB(data[3].f4); - - data[invocation].i4.x = readFirstInvocationARB(data[0].i4.x); - data[invocation].i4.xy = readFirstInvocationARB(data[1].i4.xy); - data[invocation].i4.xyz = readFirstInvocationARB(data[2].i4.xyz); - data[invocation].i4 = readFirstInvocationARB(data[3].i4); - - data[invocation].u4.x = readFirstInvocationARB(data[0].u4.x); - data[invocation].u4.xy = readFirstInvocationARB(data[1].u4.xy); - data[invocation].u4.xyz = readFirstInvocationARB(data[2].u4.xyz); - data[invocation].u4 = readFirstInvocationARB(data[3].u4); - } +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_ARB_shader_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubGroupInvocationARB + gl_SubGroupSizeARB) % 4; + + uint64_t relMask = gl_SubGroupEqMaskARB + + gl_SubGroupGeMaskARB + + gl_SubGroupGtMaskARB + + gl_SubGroupLeMaskARB + + gl_SubGroupLtMaskARB; + + if (relMask == ballotARB(true)) + { + data[invocation].f4.x = readInvocationARB(data[0].f4.x, invocation); + data[invocation].f4.xy = readInvocationARB(data[1].f4.xy, invocation); + data[invocation].f4.xyz = readInvocationARB(data[2].f4.xyz, invocation); + data[invocation].f4 = readInvocationARB(data[3].f4, invocation); + + data[invocation].i4.x = readInvocationARB(data[0].i4.x, invocation); + data[invocation].i4.xy = readInvocationARB(data[1].i4.xy, invocation); + data[invocation].i4.xyz = readInvocationARB(data[2].i4.xyz, invocation); + data[invocation].i4 = readInvocationARB(data[3].i4, invocation); + + data[invocation].u4.x = readInvocationARB(data[0].u4.x, invocation); + data[invocation].u4.xy = readInvocationARB(data[1].u4.xy, invocation); + data[invocation].u4.xyz = readInvocationARB(data[2].u4.xyz, invocation); + data[invocation].u4 = readInvocationARB(data[3].u4, invocation); + } + else + { + data[invocation].f4.x = readFirstInvocationARB(data[0].f4.x); + data[invocation].f4.xy = readFirstInvocationARB(data[1].f4.xy); + data[invocation].f4.xyz = readFirstInvocationARB(data[2].f4.xyz); + data[invocation].f4 = readFirstInvocationARB(data[3].f4); + + data[invocation].i4.x = readFirstInvocationARB(data[0].i4.x); + data[invocation].i4.xy = readFirstInvocationARB(data[1].i4.xy); + data[invocation].i4.xyz = readFirstInvocationARB(data[2].i4.xyz); + data[invocation].i4 = readFirstInvocationARB(data[3].i4); + + data[invocation].u4.x = readFirstInvocationARB(data[0].u4.x); + data[invocation].u4.xy = readFirstInvocationARB(data[1].u4.xy); + data[invocation].u4.xyz = readFirstInvocationARB(data[2].u4.xyz); + data[invocation].u4 = readFirstInvocationARB(data[3].u4); + } } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.shaderBallotAMD.comp b/core/deps/glslang/Test/spv.shaderBallotAMD.comp index 4fac6f5f0..9cf9546e4 100644 --- a/core/deps/glslang/Test/spv.shaderBallotAMD.comp +++ b/core/deps/glslang/Test/spv.shaderBallotAMD.comp @@ -1,204 +1,204 @@ -#version 450 - -#extension GL_ARB_gpu_shader_int64: enable -#extension GL_AMD_gpu_shader_half_float: enable -#extension GL_AMD_gpu_shader_int16: enable -#extension GL_AMD_shader_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - int i; - uvec2 uv; - vec3 fv; - dvec4 dv; - int64_t i64; - u64vec2 u64v; - f16vec3 f16v; - i16vec4 i16v; - uint16_t u16; -}; - -void main() -{ - i = minInvocationsAMD(i); - uv = minInvocationsAMD(uv); - fv = minInvocationsAMD(fv); - dv = minInvocationsAMD(dv); - i64 = minInvocationsAMD(i64); - u64v = minInvocationsAMD(u64v); - f16v = minInvocationsAMD(f16v); - i16v = minInvocationsAMD(i16v); - u16 = minInvocationsAMD(u16); - - i = maxInvocationsAMD(i); - uv = maxInvocationsAMD(uv); - fv = maxInvocationsAMD(fv); - dv = maxInvocationsAMD(dv); - i64 = maxInvocationsAMD(i64); - u64v = maxInvocationsAMD(u64v); - f16v = maxInvocationsAMD(f16v); - i16v = maxInvocationsAMD(i16v); - u16 = maxInvocationsAMD(u16); - - i = addInvocationsAMD(i); - uv = addInvocationsAMD(uv); - fv = addInvocationsAMD(fv); - dv = addInvocationsAMD(dv); - i64 = addInvocationsAMD(i64); - u64v = addInvocationsAMD(u64v); - f16v = addInvocationsAMD(f16v); - i16v = addInvocationsAMD(i16v); - u16 = addInvocationsAMD(u16); - - i = minInvocationsNonUniformAMD(i); - uv = minInvocationsNonUniformAMD(uv); - fv = minInvocationsNonUniformAMD(fv); - dv = minInvocationsNonUniformAMD(dv); - i64 = minInvocationsNonUniformAMD(i64); - u64v = minInvocationsNonUniformAMD(u64v); - f16v = minInvocationsNonUniformAMD(f16v); - i16v = minInvocationsNonUniformAMD(i16v); - u16 = minInvocationsNonUniformAMD(u16); - - i = maxInvocationsNonUniformAMD(i); - uv = maxInvocationsNonUniformAMD(uv); - fv = maxInvocationsNonUniformAMD(fv); - dv = maxInvocationsNonUniformAMD(dv); - i64 = maxInvocationsNonUniformAMD(i64); - u64v = maxInvocationsNonUniformAMD(u64v); - f16v = maxInvocationsNonUniformAMD(f16v); - i16v = maxInvocationsNonUniformAMD(i16v); - u16 = maxInvocationsNonUniformAMD(u16); - - i = addInvocationsNonUniformAMD(i); - uv = addInvocationsNonUniformAMD(uv); - fv = addInvocationsNonUniformAMD(fv); - dv = addInvocationsNonUniformAMD(dv); - i64 = addInvocationsNonUniformAMD(i64); - u64v = addInvocationsNonUniformAMD(u64v); - f16v = addInvocationsNonUniformAMD(f16v); - i16v = addInvocationsNonUniformAMD(i16v); - u16 = addInvocationsNonUniformAMD(u16); - - i = minInvocationsInclusiveScanAMD(i); - uv = minInvocationsInclusiveScanAMD(uv); - fv = minInvocationsInclusiveScanAMD(fv); - dv = minInvocationsInclusiveScanAMD(dv); - i64 = minInvocationsInclusiveScanAMD(i64); - u64v = minInvocationsInclusiveScanAMD(u64v); - f16v = minInvocationsInclusiveScanAMD(f16v); - i16v = minInvocationsInclusiveScanAMD(i16v); - u16 = minInvocationsInclusiveScanAMD(u16); - - i = maxInvocationsInclusiveScanAMD(i); - uv = maxInvocationsInclusiveScanAMD(uv); - fv = maxInvocationsInclusiveScanAMD(fv); - dv = maxInvocationsInclusiveScanAMD(dv); - i64 = maxInvocationsInclusiveScanAMD(i64); - u64v = maxInvocationsInclusiveScanAMD(u64v); - f16v = maxInvocationsInclusiveScanAMD(f16v); - i16v = maxInvocationsInclusiveScanAMD(i16v); - u16 = maxInvocationsInclusiveScanAMD(u16); - - i = addInvocationsInclusiveScanAMD(i); - uv = addInvocationsInclusiveScanAMD(uv); - fv = addInvocationsInclusiveScanAMD(fv); - dv = addInvocationsInclusiveScanAMD(dv); - i64 = addInvocationsInclusiveScanAMD(i64); - u64v = addInvocationsInclusiveScanAMD(u64v); - f16v = addInvocationsInclusiveScanAMD(f16v); - i16v = addInvocationsInclusiveScanAMD(i16v); - u16 = addInvocationsInclusiveScanAMD(u16); - - i = minInvocationsExclusiveScanAMD(i); - uv = minInvocationsExclusiveScanAMD(uv); - fv = minInvocationsExclusiveScanAMD(fv); - dv = minInvocationsExclusiveScanAMD(dv); - i64 = minInvocationsExclusiveScanAMD(i64); - u64v = minInvocationsExclusiveScanAMD(u64v); - f16v = minInvocationsExclusiveScanAMD(f16v); - i16v = minInvocationsExclusiveScanAMD(i16v); - u16 = minInvocationsExclusiveScanAMD(u16); - - i = maxInvocationsExclusiveScanAMD(i); - uv = maxInvocationsExclusiveScanAMD(uv); - fv = maxInvocationsExclusiveScanAMD(fv); - dv = maxInvocationsExclusiveScanAMD(dv); - i64 = maxInvocationsExclusiveScanAMD(i64); - u64v = maxInvocationsExclusiveScanAMD(u64v); - f16v = maxInvocationsExclusiveScanAMD(f16v); - i16v = maxInvocationsExclusiveScanAMD(i16v); - u16 = maxInvocationsExclusiveScanAMD(u16); - - i = addInvocationsExclusiveScanAMD(i); - uv = addInvocationsExclusiveScanAMD(uv); - fv = addInvocationsExclusiveScanAMD(fv); - dv = addInvocationsExclusiveScanAMD(dv); - i64 = addInvocationsExclusiveScanAMD(i64); - u64v = addInvocationsExclusiveScanAMD(u64v); - f16v = addInvocationsExclusiveScanAMD(f16v); - i16v = addInvocationsExclusiveScanAMD(i16v); - u16 = addInvocationsExclusiveScanAMD(u16); - - i = minInvocationsInclusiveScanNonUniformAMD(i); - uv = minInvocationsInclusiveScanNonUniformAMD(uv); - fv = minInvocationsInclusiveScanNonUniformAMD(fv); - dv = minInvocationsInclusiveScanNonUniformAMD(dv); - i64 = minInvocationsInclusiveScanNonUniformAMD(i64); - u64v = minInvocationsInclusiveScanNonUniformAMD(u64v); - f16v = minInvocationsInclusiveScanNonUniformAMD(f16v); - i16v = minInvocationsInclusiveScanNonUniformAMD(i16v); - u16 = minInvocationsInclusiveScanNonUniformAMD(u16); - - i = maxInvocationsInclusiveScanNonUniformAMD(i); - uv = maxInvocationsInclusiveScanNonUniformAMD(uv); - fv = maxInvocationsInclusiveScanNonUniformAMD(fv); - dv = maxInvocationsInclusiveScanNonUniformAMD(dv); - i64 = maxInvocationsInclusiveScanNonUniformAMD(i64); - u64v = maxInvocationsInclusiveScanNonUniformAMD(u64v); - f16v = maxInvocationsInclusiveScanNonUniformAMD(f16v); - i16v = maxInvocationsInclusiveScanNonUniformAMD(i16v); - u16 = maxInvocationsInclusiveScanNonUniformAMD(u16); - - i = addInvocationsInclusiveScanNonUniformAMD(i); - uv = addInvocationsInclusiveScanNonUniformAMD(uv); - fv = addInvocationsInclusiveScanNonUniformAMD(fv); - dv = addInvocationsInclusiveScanNonUniformAMD(dv); - i64 = addInvocationsInclusiveScanNonUniformAMD(i64); - u64v = addInvocationsInclusiveScanNonUniformAMD(u64v); - f16v = addInvocationsInclusiveScanNonUniformAMD(f16v); - i16v = addInvocationsInclusiveScanNonUniformAMD(i16v); - u16 = addInvocationsInclusiveScanNonUniformAMD(u16); - - i = minInvocationsExclusiveScanNonUniformAMD(i); - uv = minInvocationsExclusiveScanNonUniformAMD(uv); - fv = minInvocationsExclusiveScanNonUniformAMD(fv); - dv = minInvocationsExclusiveScanNonUniformAMD(dv); - i64 = minInvocationsExclusiveScanNonUniformAMD(i64); - u64v = minInvocationsExclusiveScanNonUniformAMD(u64v); - f16v = minInvocationsExclusiveScanNonUniformAMD(f16v); - i16v = minInvocationsExclusiveScanNonUniformAMD(i16v); - u16 = minInvocationsExclusiveScanNonUniformAMD(u16); - - i = maxInvocationsExclusiveScanNonUniformAMD(i); - uv = maxInvocationsExclusiveScanNonUniformAMD(uv); - fv = maxInvocationsExclusiveScanNonUniformAMD(fv); - dv = maxInvocationsExclusiveScanNonUniformAMD(dv); - i64 = maxInvocationsExclusiveScanNonUniformAMD(i64); - u64v = maxInvocationsExclusiveScanNonUniformAMD(u64v); - f16v = maxInvocationsExclusiveScanNonUniformAMD(f16v); - i16v = maxInvocationsExclusiveScanNonUniformAMD(i16v); - u16 = maxInvocationsExclusiveScanNonUniformAMD(u16); - - i = addInvocationsExclusiveScanNonUniformAMD(i); - uv = addInvocationsExclusiveScanNonUniformAMD(uv); - fv = addInvocationsExclusiveScanNonUniformAMD(fv); - dv = addInvocationsExclusiveScanNonUniformAMD(dv); - i64 = addInvocationsExclusiveScanNonUniformAMD(i64); - u64v = addInvocationsExclusiveScanNonUniformAMD(u64v); - f16v = addInvocationsExclusiveScanNonUniformAMD(f16v); - i16v = addInvocationsExclusiveScanNonUniformAMD(i16v); - u16 = addInvocationsExclusiveScanNonUniformAMD(u16); -} +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_AMD_gpu_shader_half_float: enable +#extension GL_AMD_gpu_shader_int16: enable +#extension GL_AMD_shader_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + int i; + uvec2 uv; + vec3 fv; + dvec4 dv; + int64_t i64; + u64vec2 u64v; + f16vec3 f16v; + i16vec4 i16v; + uint16_t u16; +}; + +void main() +{ + i = minInvocationsAMD(i); + uv = minInvocationsAMD(uv); + fv = minInvocationsAMD(fv); + dv = minInvocationsAMD(dv); + i64 = minInvocationsAMD(i64); + u64v = minInvocationsAMD(u64v); + f16v = minInvocationsAMD(f16v); + i16v = minInvocationsAMD(i16v); + u16 = minInvocationsAMD(u16); + + i = maxInvocationsAMD(i); + uv = maxInvocationsAMD(uv); + fv = maxInvocationsAMD(fv); + dv = maxInvocationsAMD(dv); + i64 = maxInvocationsAMD(i64); + u64v = maxInvocationsAMD(u64v); + f16v = maxInvocationsAMD(f16v); + i16v = maxInvocationsAMD(i16v); + u16 = maxInvocationsAMD(u16); + + i = addInvocationsAMD(i); + uv = addInvocationsAMD(uv); + fv = addInvocationsAMD(fv); + dv = addInvocationsAMD(dv); + i64 = addInvocationsAMD(i64); + u64v = addInvocationsAMD(u64v); + f16v = addInvocationsAMD(f16v); + i16v = addInvocationsAMD(i16v); + u16 = addInvocationsAMD(u16); + + i = minInvocationsNonUniformAMD(i); + uv = minInvocationsNonUniformAMD(uv); + fv = minInvocationsNonUniformAMD(fv); + dv = minInvocationsNonUniformAMD(dv); + i64 = minInvocationsNonUniformAMD(i64); + u64v = minInvocationsNonUniformAMD(u64v); + f16v = minInvocationsNonUniformAMD(f16v); + i16v = minInvocationsNonUniformAMD(i16v); + u16 = minInvocationsNonUniformAMD(u16); + + i = maxInvocationsNonUniformAMD(i); + uv = maxInvocationsNonUniformAMD(uv); + fv = maxInvocationsNonUniformAMD(fv); + dv = maxInvocationsNonUniformAMD(dv); + i64 = maxInvocationsNonUniformAMD(i64); + u64v = maxInvocationsNonUniformAMD(u64v); + f16v = maxInvocationsNonUniformAMD(f16v); + i16v = maxInvocationsNonUniformAMD(i16v); + u16 = maxInvocationsNonUniformAMD(u16); + + i = addInvocationsNonUniformAMD(i); + uv = addInvocationsNonUniformAMD(uv); + fv = addInvocationsNonUniformAMD(fv); + dv = addInvocationsNonUniformAMD(dv); + i64 = addInvocationsNonUniformAMD(i64); + u64v = addInvocationsNonUniformAMD(u64v); + f16v = addInvocationsNonUniformAMD(f16v); + i16v = addInvocationsNonUniformAMD(i16v); + u16 = addInvocationsNonUniformAMD(u16); + + i = minInvocationsInclusiveScanAMD(i); + uv = minInvocationsInclusiveScanAMD(uv); + fv = minInvocationsInclusiveScanAMD(fv); + dv = minInvocationsInclusiveScanAMD(dv); + i64 = minInvocationsInclusiveScanAMD(i64); + u64v = minInvocationsInclusiveScanAMD(u64v); + f16v = minInvocationsInclusiveScanAMD(f16v); + i16v = minInvocationsInclusiveScanAMD(i16v); + u16 = minInvocationsInclusiveScanAMD(u16); + + i = maxInvocationsInclusiveScanAMD(i); + uv = maxInvocationsInclusiveScanAMD(uv); + fv = maxInvocationsInclusiveScanAMD(fv); + dv = maxInvocationsInclusiveScanAMD(dv); + i64 = maxInvocationsInclusiveScanAMD(i64); + u64v = maxInvocationsInclusiveScanAMD(u64v); + f16v = maxInvocationsInclusiveScanAMD(f16v); + i16v = maxInvocationsInclusiveScanAMD(i16v); + u16 = maxInvocationsInclusiveScanAMD(u16); + + i = addInvocationsInclusiveScanAMD(i); + uv = addInvocationsInclusiveScanAMD(uv); + fv = addInvocationsInclusiveScanAMD(fv); + dv = addInvocationsInclusiveScanAMD(dv); + i64 = addInvocationsInclusiveScanAMD(i64); + u64v = addInvocationsInclusiveScanAMD(u64v); + f16v = addInvocationsInclusiveScanAMD(f16v); + i16v = addInvocationsInclusiveScanAMD(i16v); + u16 = addInvocationsInclusiveScanAMD(u16); + + i = minInvocationsExclusiveScanAMD(i); + uv = minInvocationsExclusiveScanAMD(uv); + fv = minInvocationsExclusiveScanAMD(fv); + dv = minInvocationsExclusiveScanAMD(dv); + i64 = minInvocationsExclusiveScanAMD(i64); + u64v = minInvocationsExclusiveScanAMD(u64v); + f16v = minInvocationsExclusiveScanAMD(f16v); + i16v = minInvocationsExclusiveScanAMD(i16v); + u16 = minInvocationsExclusiveScanAMD(u16); + + i = maxInvocationsExclusiveScanAMD(i); + uv = maxInvocationsExclusiveScanAMD(uv); + fv = maxInvocationsExclusiveScanAMD(fv); + dv = maxInvocationsExclusiveScanAMD(dv); + i64 = maxInvocationsExclusiveScanAMD(i64); + u64v = maxInvocationsExclusiveScanAMD(u64v); + f16v = maxInvocationsExclusiveScanAMD(f16v); + i16v = maxInvocationsExclusiveScanAMD(i16v); + u16 = maxInvocationsExclusiveScanAMD(u16); + + i = addInvocationsExclusiveScanAMD(i); + uv = addInvocationsExclusiveScanAMD(uv); + fv = addInvocationsExclusiveScanAMD(fv); + dv = addInvocationsExclusiveScanAMD(dv); + i64 = addInvocationsExclusiveScanAMD(i64); + u64v = addInvocationsExclusiveScanAMD(u64v); + f16v = addInvocationsExclusiveScanAMD(f16v); + i16v = addInvocationsExclusiveScanAMD(i16v); + u16 = addInvocationsExclusiveScanAMD(u16); + + i = minInvocationsInclusiveScanNonUniformAMD(i); + uv = minInvocationsInclusiveScanNonUniformAMD(uv); + fv = minInvocationsInclusiveScanNonUniformAMD(fv); + dv = minInvocationsInclusiveScanNonUniformAMD(dv); + i64 = minInvocationsInclusiveScanNonUniformAMD(i64); + u64v = minInvocationsInclusiveScanNonUniformAMD(u64v); + f16v = minInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = minInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = minInvocationsInclusiveScanNonUniformAMD(u16); + + i = maxInvocationsInclusiveScanNonUniformAMD(i); + uv = maxInvocationsInclusiveScanNonUniformAMD(uv); + fv = maxInvocationsInclusiveScanNonUniformAMD(fv); + dv = maxInvocationsInclusiveScanNonUniformAMD(dv); + i64 = maxInvocationsInclusiveScanNonUniformAMD(i64); + u64v = maxInvocationsInclusiveScanNonUniformAMD(u64v); + f16v = maxInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = maxInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = maxInvocationsInclusiveScanNonUniformAMD(u16); + + i = addInvocationsInclusiveScanNonUniformAMD(i); + uv = addInvocationsInclusiveScanNonUniformAMD(uv); + fv = addInvocationsInclusiveScanNonUniformAMD(fv); + dv = addInvocationsInclusiveScanNonUniformAMD(dv); + i64 = addInvocationsInclusiveScanNonUniformAMD(i64); + u64v = addInvocationsInclusiveScanNonUniformAMD(u64v); + f16v = addInvocationsInclusiveScanNonUniformAMD(f16v); + i16v = addInvocationsInclusiveScanNonUniformAMD(i16v); + u16 = addInvocationsInclusiveScanNonUniformAMD(u16); + + i = minInvocationsExclusiveScanNonUniformAMD(i); + uv = minInvocationsExclusiveScanNonUniformAMD(uv); + fv = minInvocationsExclusiveScanNonUniformAMD(fv); + dv = minInvocationsExclusiveScanNonUniformAMD(dv); + i64 = minInvocationsExclusiveScanNonUniformAMD(i64); + u64v = minInvocationsExclusiveScanNonUniformAMD(u64v); + f16v = minInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = minInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = minInvocationsExclusiveScanNonUniformAMD(u16); + + i = maxInvocationsExclusiveScanNonUniformAMD(i); + uv = maxInvocationsExclusiveScanNonUniformAMD(uv); + fv = maxInvocationsExclusiveScanNonUniformAMD(fv); + dv = maxInvocationsExclusiveScanNonUniformAMD(dv); + i64 = maxInvocationsExclusiveScanNonUniformAMD(i64); + u64v = maxInvocationsExclusiveScanNonUniformAMD(u64v); + f16v = maxInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = maxInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = maxInvocationsExclusiveScanNonUniformAMD(u16); + + i = addInvocationsExclusiveScanNonUniformAMD(i); + uv = addInvocationsExclusiveScanNonUniformAMD(uv); + fv = addInvocationsExclusiveScanNonUniformAMD(fv); + dv = addInvocationsExclusiveScanNonUniformAMD(dv); + i64 = addInvocationsExclusiveScanNonUniformAMD(i64); + u64v = addInvocationsExclusiveScanNonUniformAMD(u64v); + f16v = addInvocationsExclusiveScanNonUniformAMD(f16v); + i16v = addInvocationsExclusiveScanNonUniformAMD(i16v); + u16 = addInvocationsExclusiveScanNonUniformAMD(u16); +} diff --git a/core/deps/glslang/Test/spv.shaderDrawParams.vert b/core/deps/glslang/Test/spv.shaderDrawParams.vert index c90c87169..15ae2953a 100644 --- a/core/deps/glslang/Test/spv.shaderDrawParams.vert +++ b/core/deps/glslang/Test/spv.shaderDrawParams.vert @@ -1,16 +1,16 @@ -#version 450 core - -#extension GL_ARB_shader_draw_parameters: enable - -layout(binding = 0) uniform Block -{ - vec4 pos[2][4]; -} block; - -void main() -{ - if ((gl_BaseVertexARB > 0) || (gl_BaseInstanceARB > 0)) - gl_Position = block.pos[0][gl_DrawIDARB % 4]; - else - gl_Position = block.pos[1][gl_DrawIDARB % 4]; -} +#version 450 core + +#extension GL_ARB_shader_draw_parameters: enable + +layout(binding = 0) uniform Block +{ + vec4 pos[2][4]; +} block; + +void main() +{ + if ((gl_BaseVertexARB > 0) || (gl_BaseInstanceARB > 0)) + gl_Position = block.pos[0][gl_DrawIDARB % 4]; + else + gl_Position = block.pos[1][gl_DrawIDARB % 4]; +} diff --git a/core/deps/glslang/Test/spv.shaderFragMaskAMD.frag b/core/deps/glslang/Test/spv.shaderFragMaskAMD.frag index e30682af2..b9e8ab059 100644 --- a/core/deps/glslang/Test/spv.shaderFragMaskAMD.frag +++ b/core/deps/glslang/Test/spv.shaderFragMaskAMD.frag @@ -1,29 +1,29 @@ -#version 450 core - -#extension GL_AMD_shader_fragment_mask: enable - -layout(binding = 0) uniform sampler2DMS s2DMS; -layout(binding = 1) uniform isampler2DMSArray is2DMSArray; - -layout(binding = 2, input_attachment_index = 0) uniform usubpassInputMS usubpassMS; - -layout(location = 0) out vec4 fragColor; - -void main() -{ - vec4 f4 = vec4(0.0); - - uint fragMask = fragmentMaskFetchAMD(s2DMS, ivec2(2, 3)); - uint fragIndex = (fragMask & 0xF0) >> 4; - f4 += fragmentFetchAMD(s2DMS, ivec2(2, 3), 1); - - fragMask = fragmentMaskFetchAMD(is2DMSArray, ivec3(2, 3, 1)); - fragIndex = (fragMask & 0xF0) >> 4; - f4 += fragmentFetchAMD(is2DMSArray, ivec3(2, 3, 1), fragIndex); - - fragMask = fragmentMaskFetchAMD(usubpassMS); - fragIndex = (fragMask & 0xF0) >> 4; - f4 += fragmentFetchAMD(usubpassMS, fragIndex); - - fragColor = f4; +#version 450 core + +#extension GL_AMD_shader_fragment_mask: enable + +layout(binding = 0) uniform sampler2DMS s2DMS; +layout(binding = 1) uniform isampler2DMSArray is2DMSArray; + +layout(binding = 2, input_attachment_index = 0) uniform usubpassInputMS usubpassMS; + +layout(location = 0) out vec4 fragColor; + +void main() +{ + vec4 f4 = vec4(0.0); + + uint fragMask = fragmentMaskFetchAMD(s2DMS, ivec2(2, 3)); + uint fragIndex = (fragMask & 0xF0) >> 4; + f4 += fragmentFetchAMD(s2DMS, ivec2(2, 3), 1); + + fragMask = fragmentMaskFetchAMD(is2DMSArray, ivec3(2, 3, 1)); + fragIndex = (fragMask & 0xF0) >> 4; + f4 += fragmentFetchAMD(is2DMSArray, ivec3(2, 3, 1), fragIndex); + + fragMask = fragmentMaskFetchAMD(usubpassMS); + fragIndex = (fragMask & 0xF0) >> 4; + f4 += fragmentFetchAMD(usubpassMS, fragIndex); + + fragColor = f4; } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.shaderGroupVote.comp b/core/deps/glslang/Test/spv.shaderGroupVote.comp index 513d06a63..c0b1fe724 100644 --- a/core/deps/glslang/Test/spv.shaderGroupVote.comp +++ b/core/deps/glslang/Test/spv.shaderGroupVote.comp @@ -1,21 +1,21 @@ -#version 450 - -#extension GL_ARB_shader_group_vote : enable - -layout(local_size_x = 4, local_size_y = 4) in; - -layout(std430, binding = 0) buffer Buffers -{ - bool b; -}; - -void main() -{ - bool b1 = b; - - b1 = anyInvocationARB(b1); - b1 = allInvocationsARB(b1); - b1 = allInvocationsEqualARB(b1); - - b = b1; -} +#version 450 + +#extension GL_ARB_shader_group_vote : enable + +layout(local_size_x = 4, local_size_y = 4) in; + +layout(std430, binding = 0) buffer Buffers +{ + bool b; +}; + +void main() +{ + bool b1 = b; + + b1 = anyInvocationARB(b1); + b1 = allInvocationsARB(b1); + b1 = allInvocationsEqualARB(b1); + + b = b1; +} diff --git a/core/deps/glslang/Test/spv.shaderStencilExport.frag b/core/deps/glslang/Test/spv.shaderStencilExport.frag index a660bc9ab..e3ad4d67f 100644 --- a/core/deps/glslang/Test/spv.shaderStencilExport.frag +++ b/core/deps/glslang/Test/spv.shaderStencilExport.frag @@ -1,10 +1,10 @@ -#version 450 core - -#extension GL_ARB_shader_stencil_export: enable - -out int gl_FragStencilRefARB; - -void main() -{ - gl_FragStencilRefARB = 100; -} +#version 450 core + +#extension GL_ARB_shader_stencil_export: enable + +out int gl_FragStencilRefARB; + +void main() +{ + gl_FragStencilRefARB = 100; +} diff --git a/core/deps/glslang/Test/spv.shiftOps.frag b/core/deps/glslang/Test/spv.shiftOps.frag index 5049cc84b..7fb937f43 100644 --- a/core/deps/glslang/Test/spv.shiftOps.frag +++ b/core/deps/glslang/Test/spv.shiftOps.frag @@ -1,18 +1,18 @@ -#version 450 - -flat in int i1; -flat in uint u1; -flat in ivec3 i3; -flat in uvec3 u3; - -out ivec3 icolor; -out uvec3 ucolor; - -void main() -{ - icolor = i3 << u1; - icolor <<= 4u; - - ucolor = u3 >> i1; - ucolor >>= 5; -} +#version 450 + +flat in int i1; +flat in uint u1; +flat in ivec3 i3; +flat in uvec3 u3; + +out ivec3 icolor; +out uvec3 ucolor; + +void main() +{ + icolor = i3 << u1; + icolor <<= 4u; + + ucolor = u3 >> i1; + ucolor >>= 5; +} diff --git a/core/deps/glslang/Test/spv.shortCircuit.frag b/core/deps/glslang/Test/spv.shortCircuit.frag index ca031c2d0..4a626417d 100644 --- a/core/deps/glslang/Test/spv.shortCircuit.frag +++ b/core/deps/glslang/Test/spv.shortCircuit.frag @@ -1,50 +1,50 @@ -#version 400 - -flat in ivec4 uiv4; -in vec4 uv4; -bool ub; -bool uba; -bvec4 ub41, ub42; -in float uf; -flat in int ui; - -out float of1; -out vec4 of4; - -bool foo() { ++of1; return of1 > 10.0; } - -void main() -{ - of1 = 0.0; - of4 = vec4(0.0); - - if (ub || ui > 2) // not worth short circuiting - ++of1; - - if (ub && !uba) // not worth short circuiting - ++of1; - - if (ub || foo()) // must short circuit - ++of1; - - if (ub && foo()) // must short circuit - ++of1; - - if (foo() || ub) // not worth short circuiting - ++of1; - - if (foo() && ub) // not worth short circuiting - ++of1; - - if (ub || ++of1 > 1.0) // must short circuit - ++of4; - - if (++of1 > 1.0 || ub) // not worth short circuiting - ++of4; - - if (ub || sin(uf) * 4.0 > of1) // worth short circuiting - ++of1; - - if (ub && sin(uf) * 4.0 > of1) // worth short circuiting - ++of1; -} +#version 400 + +flat in ivec4 uiv4; +in vec4 uv4; +bool ub; +bool uba; +bvec4 ub41, ub42; +in float uf; +flat in int ui; + +out float of1; +out vec4 of4; + +bool foo() { ++of1; return of1 > 10.0; } + +void main() +{ + of1 = 0.0; + of4 = vec4(0.0); + + if (ub || ui > 2) // not worth short circuiting + ++of1; + + if (ub && !uba) // not worth short circuiting + ++of1; + + if (ub || foo()) // must short circuit + ++of1; + + if (ub && foo()) // must short circuit + ++of1; + + if (foo() || ub) // not worth short circuiting + ++of1; + + if (foo() && ub) // not worth short circuiting + ++of1; + + if (ub || ++of1 > 1.0) // must short circuit + ++of4; + + if (++of1 > 1.0 || ub) // not worth short circuiting + ++of4; + + if (ub || sin(uf) * 4.0 > of1) // worth short circuiting + ++of1; + + if (ub && sin(uf) * 4.0 > of1) // worth short circuiting + ++of1; +} diff --git a/core/deps/glslang/Test/spv.simpleFunctionCall.frag b/core/deps/glslang/Test/spv.simpleFunctionCall.frag index 7513ce317..496bb93d7 100644 --- a/core/deps/glslang/Test/spv.simpleFunctionCall.frag +++ b/core/deps/glslang/Test/spv.simpleFunctionCall.frag @@ -1,13 +1,13 @@ -#version 150 - -in vec4 BaseColor; - -vec4 foo() -{ - return BaseColor; -} - -void main() -{ - gl_FragColor = foo(); -} +#version 150 + +in vec4 BaseColor; + +vec4 foo() +{ + return BaseColor; +} + +void main() +{ + gl_FragColor = foo(); +} diff --git a/core/deps/glslang/Test/spv.simpleMat.vert b/core/deps/glslang/Test/spv.simpleMat.vert index 22f5a3791..897a8986c 100644 --- a/core/deps/glslang/Test/spv.simpleMat.vert +++ b/core/deps/glslang/Test/spv.simpleMat.vert @@ -1,19 +1,19 @@ -#version 330 - -varying mat4 mvp; - -in vec4 v; -in mat3 am3; -in mat4 arraym[3]; - -out float f; -out vec4 glPos; -//out mat4 mout[2]; - -void main() -{ - //needs complex output blocks to work: gl_Position = mvp * v; - glPos = mvp * v; - f = am3[2][1] + arraym[1][2][3]; - //mout[1] = arraym[2]; -} +#version 330 + +varying mat4 mvp; + +in vec4 v; +in mat3 am3; +in mat4 arraym[3]; + +out float f; +out vec4 glPos; +//out mat4 mout[2]; + +void main() +{ + //needs complex output blocks to work: gl_Position = mvp * v; + glPos = mvp * v; + f = am3[2][1] + arraym[1][2][3]; + //mout[1] = arraym[2]; +} diff --git a/core/deps/glslang/Test/spv.sparseTexture.frag b/core/deps/glslang/Test/spv.sparseTexture.frag index 8f8c0cbf0..c995ee2ae 100644 --- a/core/deps/glslang/Test/spv.sparseTexture.frag +++ b/core/deps/glslang/Test/spv.sparseTexture.frag @@ -1,91 +1,91 @@ -#version 450 -#extension GL_ARB_sparse_texture2: enable - -uniform sampler2D s2D; -uniform sampler3D s3D; -uniform sampler2DShadow s2DShadow; -uniform samplerCubeShadow sCubeShadow; -uniform sampler2DArrayShadow s2DArrayShadow; -uniform sampler2DRectShadow s2DRectShadow; -uniform samplerCubeArrayShadow sCubeArrayShadow; -uniform sampler2DMS s2DMS; - -uniform isamplerCube isCube; -uniform isampler2DArray is2DArray; - -uniform usamplerCubeArray usCubeArray; -uniform usampler2DRect us2DRect; - -layout(rgba32f) uniform image2D i2D; -layout(rgba32i) uniform iimage3D ii3D; -layout(rgba32f) uniform image2DMS i2DMS; - -in vec2 c2; -in vec3 c3; -in vec4 c4; - -in flat ivec2 ic2; -in flat ivec3 ic3; - -in flat ivec2 offsets[4]; - -out vec4 outColor; - -void main() -{ - int resident = 0; - vec4 texel = vec4(0.0); - ivec4 itexel = ivec4(0); - uvec4 utexel = uvec4(0); - - resident |= sparseTextureARB(s2D, c2, texel); - resident |= sparseTextureARB(s3D, c3, texel, 2.0); - resident |= sparseTextureARB(isCube, c3, itexel); - resident |= sparseTextureARB(s2DShadow, c3, texel.x); - resident |= sparseTextureARB(sCubeArrayShadow, c4, 1.0, texel.x); - - resident |= sparseTextureLodARB(s2D, c2, 2.0, texel); - resident |= sparseTextureLodARB(usCubeArray, c4, 1.0, utexel); - resident |= sparseTextureLodARB(s2DShadow, c3, 2.0, texel.y); - - resident |= sparseTextureOffsetARB(s3D, c3, ivec3(2), texel, 2.0); - resident |= sparseTextureOffsetARB(us2DRect, c2, ivec2(3), utexel); - resident |= sparseTextureOffsetARB(s2DArrayShadow, c4, ivec2(5), texel.z); - - resident |= sparseTexelFetchARB(s2D, ivec2(c2), 2, texel); - resident |= sparseTexelFetchARB(us2DRect, ivec2(c2), utexel); - resident |= sparseTexelFetchARB(s2DMS, ivec2(c2), 4, texel); - - resident |= sparseTexelFetchOffsetARB(s3D, ivec3(c3), 2, ivec3(4), texel); - resident |= sparseTexelFetchOffsetARB(us2DRect, ivec2(c2), ivec2(3), utexel); - - resident |= sparseTextureLodOffsetARB(s2D, c2, 2.0, ivec2(5), texel); - resident |= sparseTextureLodOffsetARB(is2DArray, c3, 2.0, ivec2(6), itexel); - resident |= sparseTextureLodOffsetARB(s2DShadow, c3, 2.0, ivec2(7), texel.z); - - resident |= sparseTextureGradARB(s3D, c3, c3, c3, texel); - resident |= sparseTextureGradARB(sCubeShadow, c4, c3, c3, texel.y); - resident |= sparseTextureGradARB(usCubeArray, c4, c3, c3, utexel); - - resident |= sparseTextureGradOffsetARB(s2D, c2, c2, c2, ivec2(5), texel); - resident |= sparseTextureGradOffsetARB(s2DRectShadow, c3, c2, c2, ivec2(6), texel.w); - resident |= sparseTextureGradOffsetARB(is2DArray, c3, c2, c2, ivec2(2), itexel); - - resident |= sparseTextureGatherARB(s2D, c2, texel); - resident |= sparseTextureGatherARB(is2DArray, c3, itexel, 2); - resident |= sparseTextureGatherARB(s2DArrayShadow, c3, 2.0, texel); - - resident |= sparseTextureGatherOffsetARB(s2D, c2, ivec2(4), texel); - resident |= sparseTextureGatherOffsetARB(is2DArray, c3, ivec2(5), itexel, 2); - resident |= sparseTextureGatherOffsetARB(s2DRectShadow, c2, 2.0, ivec2(7), texel); - - resident |= sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel); - resident |= sparseTextureGatherOffsetsARB(is2DArray, c3, offsets, itexel, 2); - resident |= sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, offsets, texel); - - resident |= sparseImageLoadARB(i2D, ic2, texel); - resident |= sparseImageLoadARB(ii3D, ic3, itexel); - resident |= sparseImageLoadARB(i2DMS, ic2, 3, texel); - - outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +#version 450 +#extension GL_ARB_sparse_texture2: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; +uniform sampler2DMS s2DMS; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +layout(rgba32f) uniform image2D i2D; +layout(rgba32i) uniform iimage3D ii3D; +layout(rgba32f) uniform image2DMS i2DMS; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in flat ivec2 ic2; +in flat ivec3 ic3; + +in flat ivec2 offsets[4]; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureARB(s2D, c2, texel); + resident |= sparseTextureARB(s3D, c3, texel, 2.0); + resident |= sparseTextureARB(isCube, c3, itexel); + resident |= sparseTextureARB(s2DShadow, c3, texel.x); + resident |= sparseTextureARB(sCubeArrayShadow, c4, 1.0, texel.x); + + resident |= sparseTextureLodARB(s2D, c2, 2.0, texel); + resident |= sparseTextureLodARB(usCubeArray, c4, 1.0, utexel); + resident |= sparseTextureLodARB(s2DShadow, c3, 2.0, texel.y); + + resident |= sparseTextureOffsetARB(s3D, c3, ivec3(2), texel, 2.0); + resident |= sparseTextureOffsetARB(us2DRect, c2, ivec2(3), utexel); + resident |= sparseTextureOffsetARB(s2DArrayShadow, c4, ivec2(5), texel.z); + + resident |= sparseTexelFetchARB(s2D, ivec2(c2), 2, texel); + resident |= sparseTexelFetchARB(us2DRect, ivec2(c2), utexel); + resident |= sparseTexelFetchARB(s2DMS, ivec2(c2), 4, texel); + + resident |= sparseTexelFetchOffsetARB(s3D, ivec3(c3), 2, ivec3(4), texel); + resident |= sparseTexelFetchOffsetARB(us2DRect, ivec2(c2), ivec2(3), utexel); + + resident |= sparseTextureLodOffsetARB(s2D, c2, 2.0, ivec2(5), texel); + resident |= sparseTextureLodOffsetARB(is2DArray, c3, 2.0, ivec2(6), itexel); + resident |= sparseTextureLodOffsetARB(s2DShadow, c3, 2.0, ivec2(7), texel.z); + + resident |= sparseTextureGradARB(s3D, c3, c3, c3, texel); + resident |= sparseTextureGradARB(sCubeShadow, c4, c3, c3, texel.y); + resident |= sparseTextureGradARB(usCubeArray, c4, c3, c3, utexel); + + resident |= sparseTextureGradOffsetARB(s2D, c2, c2, c2, ivec2(5), texel); + resident |= sparseTextureGradOffsetARB(s2DRectShadow, c3, c2, c2, ivec2(6), texel.w); + resident |= sparseTextureGradOffsetARB(is2DArray, c3, c2, c2, ivec2(2), itexel); + + resident |= sparseTextureGatherARB(s2D, c2, texel); + resident |= sparseTextureGatherARB(is2DArray, c3, itexel, 2); + resident |= sparseTextureGatherARB(s2DArrayShadow, c3, 2.0, texel); + + resident |= sparseTextureGatherOffsetARB(s2D, c2, ivec2(4), texel); + resident |= sparseTextureGatherOffsetARB(is2DArray, c3, ivec2(5), itexel, 2); + resident |= sparseTextureGatherOffsetARB(s2DRectShadow, c2, 2.0, ivec2(7), texel); + + resident |= sparseTextureGatherOffsetsARB(s2D, c2, offsets, texel); + resident |= sparseTextureGatherOffsetsARB(is2DArray, c3, offsets, itexel, 2); + resident |= sparseTextureGatherOffsetsARB(s2DRectShadow, c2, 2.0, offsets, texel); + + resident |= sparseImageLoadARB(i2D, ic2, texel); + resident |= sparseImageLoadARB(ii3D, ic3, itexel); + resident |= sparseImageLoadARB(i2DMS, ic2, 3, texel); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.sparseTextureClamp.frag b/core/deps/glslang/Test/spv.sparseTextureClamp.frag index 5040782f2..97317938a 100644 --- a/core/deps/glslang/Test/spv.sparseTextureClamp.frag +++ b/core/deps/glslang/Test/spv.sparseTextureClamp.frag @@ -1,70 +1,70 @@ -#version 450 -#extension GL_ARB_sparse_texture_clamp: enable - -uniform sampler2D s2D; -uniform sampler3D s3D; -uniform sampler2DShadow s2DShadow; -uniform samplerCubeShadow sCubeShadow; -uniform sampler2DArrayShadow s2DArrayShadow; -uniform sampler2DRectShadow s2DRectShadow; -uniform samplerCubeArrayShadow sCubeArrayShadow; - -uniform isamplerCube isCube; -uniform isampler2DArray is2DArray; - -uniform usamplerCubeArray usCubeArray; -uniform usampler2DRect us2DRect; - -in vec2 c2; -in vec3 c3; -in vec4 c4; - -in float lodClamp; - -out vec4 outColor; - -void main() -{ - int resident = 0; - vec4 texel = vec4(0.0); - ivec4 itexel = ivec4(0); - uvec4 utexel = uvec4(0); - - resident |= sparseTextureClampARB(s2D, c2, lodClamp, texel); - resident |= sparseTextureClampARB(s3D, c3, lodClamp, texel, 2.0); - resident |= sparseTextureClampARB(isCube, c3, lodClamp, itexel); - resident |= sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); - resident |= sparseTextureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp, texel.x); - - texel += textureClampARB(s2D, c2, lodClamp); - texel += textureClampARB(s3D, c3, lodClamp, 2.0); - itexel += textureClampARB(isCube, c3, lodClamp); - texel.x += textureClampARB(s2DShadow, c3, lodClamp); - texel.x += textureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp); - - resident |= sparseTextureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, texel, 2.0); - resident |= sparseTextureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp, utexel); - resident |= sparseTextureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp, texel.z); - - texel += textureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, 2.0); - utexel += textureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp); - texel.z += textureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp); - - resident |= sparseTextureGradClampARB(s3D, c3, c3, c3, lodClamp, texel); - resident |= sparseTextureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp, texel.y); - resident |= sparseTextureGradClampARB(usCubeArray, c4, c3, c3, lodClamp, utexel); - - texel += textureGradClampARB(s3D, c3, c3, c3, lodClamp); - texel.y += textureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp); - utexel += textureGradClampARB(usCubeArray, c4, c3, c3, lodClamp); - - resident |= sparseTextureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp, texel); - resident |= sparseTextureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp, texel.w); - resident |= sparseTextureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp, itexel); - - texel += textureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp); - texel.w += textureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp); - itexel += textureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp); - - outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); +#version 450 +#extension GL_ARB_sparse_texture_clamp: enable + +uniform sampler2D s2D; +uniform sampler3D s3D; +uniform sampler2DShadow s2DShadow; +uniform samplerCubeShadow sCubeShadow; +uniform sampler2DArrayShadow s2DArrayShadow; +uniform sampler2DRectShadow s2DRectShadow; +uniform samplerCubeArrayShadow sCubeArrayShadow; + +uniform isamplerCube isCube; +uniform isampler2DArray is2DArray; + +uniform usamplerCubeArray usCubeArray; +uniform usampler2DRect us2DRect; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in float lodClamp; + +out vec4 outColor; + +void main() +{ + int resident = 0; + vec4 texel = vec4(0.0); + ivec4 itexel = ivec4(0); + uvec4 utexel = uvec4(0); + + resident |= sparseTextureClampARB(s2D, c2, lodClamp, texel); + resident |= sparseTextureClampARB(s3D, c3, lodClamp, texel, 2.0); + resident |= sparseTextureClampARB(isCube, c3, lodClamp, itexel); + resident |= sparseTextureClampARB(s2DShadow, c3, lodClamp, texel.x); + resident |= sparseTextureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp, texel.x); + + texel += textureClampARB(s2D, c2, lodClamp); + texel += textureClampARB(s3D, c3, lodClamp, 2.0); + itexel += textureClampARB(isCube, c3, lodClamp); + texel.x += textureClampARB(s2DShadow, c3, lodClamp); + texel.x += textureClampARB(sCubeArrayShadow, c4, 1.0, lodClamp); + + resident |= sparseTextureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, texel, 2.0); + resident |= sparseTextureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp, utexel); + resident |= sparseTextureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp, texel.z); + + texel += textureOffsetClampARB(s3D, c3, ivec3(2), lodClamp, 2.0); + utexel += textureOffsetClampARB(us2DRect, c2, ivec2(3), lodClamp); + texel.z += textureOffsetClampARB(s2DArrayShadow, c4, ivec2(5), lodClamp); + + resident |= sparseTextureGradClampARB(s3D, c3, c3, c3, lodClamp, texel); + resident |= sparseTextureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp, texel.y); + resident |= sparseTextureGradClampARB(usCubeArray, c4, c3, c3, lodClamp, utexel); + + texel += textureGradClampARB(s3D, c3, c3, c3, lodClamp); + texel.y += textureGradClampARB(sCubeShadow, c4, c3, c3, lodClamp); + utexel += textureGradClampARB(usCubeArray, c4, c3, c3, lodClamp); + + resident |= sparseTextureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp, texel); + resident |= sparseTextureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp, texel.w); + resident |= sparseTextureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp, itexel); + + texel += textureGradOffsetClampARB(s2D, c2, c2, c2, ivec2(5), lodClamp); + texel.w += textureGradOffsetClampARB(s2DRectShadow, c3, c2, c2, ivec2(6), lodClamp); + itexel += textureGradOffsetClampARB(is2DArray, c3, c2, c2, ivec2(2), lodClamp); + + outColor = sparseTexelsResidentARB(resident) ? texel : vec4(itexel) + vec4(utexel); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.specConst.vert b/core/deps/glslang/Test/spv.specConst.vert index 459e28eed..3ea249802 100644 --- a/core/deps/glslang/Test/spv.specConst.vert +++ b/core/deps/glslang/Test/spv.specConst.vert @@ -1,8 +1,8 @@ -#version 450 - -layout(constant_id = 11) const int a = 8; - -void main() -{ - gl_Position = vec4(1.0) / a; -} +#version 450 + +layout(constant_id = 11) const int a = 8; + +void main() +{ + gl_Position = vec4(1.0) / a; +} diff --git a/core/deps/glslang/Test/spv.specConstArrayCheck.vert b/core/deps/glslang/Test/spv.specConstArrayCheck.vert index 03093888a..9f0dc0b0b 100755 --- a/core/deps/glslang/Test/spv.specConstArrayCheck.vert +++ b/core/deps/glslang/Test/spv.specConstArrayCheck.vert @@ -1,14 +1,14 @@ -#version 450 - -layout(constant_id = 0) const uint a = 1; -layout(constant_id = 1) const uint b = 2; -layout(location = 0) out uint o; - -void main() { - uint arr1[a+a]; - uint arr2[b]; - o = arr1[1]; - o = arr2[1]; - o = arr1[6]; - o = arr2[6]; -} +#version 450 + +layout(constant_id = 0) const uint a = 1; +layout(constant_id = 1) const uint b = 2; +layout(location = 0) out uint o; + +void main() { + uint arr1[a+a]; + uint arr2[b]; + o = arr1[1]; + o = arr2[1]; + o = arr1[6]; + o = arr2[6]; +} diff --git a/core/deps/glslang/Test/spv.specConstant.comp b/core/deps/glslang/Test/spv.specConstant.comp index e50f40d84..ae8ae19d1 100644 --- a/core/deps/glslang/Test/spv.specConstant.comp +++ b/core/deps/glslang/Test/spv.specConstant.comp @@ -1,13 +1,13 @@ -#version 450 - -layout(local_size_x_id = 18, local_size_z_id = 19) in; -layout(local_size_x = 32, local_size_y = 32) in; - -buffer bn { - uint a; -} bi; - -void main() -{ - bi.a = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z; -} +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; + +buffer bn { + uint a; +} bi; + +void main() +{ + bi.a = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z; +} diff --git a/core/deps/glslang/Test/spv.specConstant.vert b/core/deps/glslang/Test/spv.specConstant.vert index 871220a2a..9813bf5fa 100644 --- a/core/deps/glslang/Test/spv.specConstant.vert +++ b/core/deps/glslang/Test/spv.specConstant.vert @@ -1,51 +1,51 @@ -#version 400 - -layout(constant_id = 16) const int arraySize = 5; -in vec4 ucol[arraySize]; - -layout(constant_id = 17) const bool spBool = true; -layout(constant_id = 18) const float spFloat = 3.14; -layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; -layout(constant_id = 22) const uint scale = 2; - -layout(constant_id = 24) gl_MaxImageUnits; - -out vec4 color; -out int size; - -// parameter should be considered same type as ucol -void foo(vec4 p[arraySize]); - -void main() -{ - color = ucol[2]; - size = arraySize; - if (spBool) - color *= scale; - color += float(spDouble / spFloat); - - foo(ucol); -} - -layout(constant_id = 116) const int dupArraySize = 12; -in vec4 dupUcol[dupArraySize]; - -layout(constant_id = 117) const bool spDupBool = true; -layout(constant_id = 118) const float spDupFloat = 3.14; -layout(constant_id = 119) const double spDupDouble = 3.1415926535897932384626433832795; -layout(constant_id = 122) const uint dupScale = 2; - -void foo(vec4 p[arraySize]) -{ - color += dupUcol[2]; - size += dupArraySize; - if (spDupBool) - color *= dupScale; - color += float(spDupDouble / spDupFloat); -} - -int builtin_spec_constant() -{ - int result = gl_MaxImageUnits; - return result; -} +#version 400 + +layout(constant_id = 16) const int arraySize = 5; +in vec4 ucol[arraySize]; + +layout(constant_id = 17) const bool spBool = true; +layout(constant_id = 18) const float spFloat = 3.14; +layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; +layout(constant_id = 22) const uint scale = 2; + +layout(constant_id = 24) gl_MaxImageUnits; + +out vec4 color; +out int size; + +// parameter should be considered same type as ucol +void foo(vec4 p[arraySize]); + +void main() +{ + color = ucol[2]; + size = arraySize; + if (spBool) + color *= scale; + color += float(spDouble / spFloat); + + foo(ucol); +} + +layout(constant_id = 116) const int dupArraySize = 12; +in vec4 dupUcol[dupArraySize]; + +layout(constant_id = 117) const bool spDupBool = true; +layout(constant_id = 118) const float spDupFloat = 3.14; +layout(constant_id = 119) const double spDupDouble = 3.1415926535897932384626433832795; +layout(constant_id = 122) const uint dupScale = 2; + +void foo(vec4 p[arraySize]) +{ + color += dupUcol[2]; + size += dupArraySize; + if (spDupBool) + color *= dupScale; + color += float(spDupDouble / spDupFloat); +} + +int builtin_spec_constant() +{ + int result = gl_MaxImageUnits; + return result; +} diff --git a/core/deps/glslang/Test/spv.specConstantOperations.vert b/core/deps/glslang/Test/spv.specConstantOperations.vert index 691bb4d0b..93be12c58 100644 --- a/core/deps/glslang/Test/spv.specConstantOperations.vert +++ b/core/deps/glslang/Test/spv.specConstantOperations.vert @@ -111,13 +111,13 @@ int non_const_array_size_from_spec_const() { } // ternary -layout(constant_id = 210) const int a = 4; -layout(constant_id = 211) const int b = 6; -layout(constant_id = 212) const bool c = true; -int ternayArray1[a > b ? a : b]; -const int t1 = c ? 13 : 17; -const int t2 = c ? a : 17; -const int t3 = true ? a : 17; +layout(constant_id = 210) const int a = 4; +layout(constant_id = 211) const int b = 6; +layout(constant_id = 212) const bool c = true; +int ternayArray1[a > b ? a : b]; +const int t1 = c ? 13 : 17; +const int t2 = c ? a : 17; +const int t3 = true ? a : 17; const int t4 = a > b ? 13 + a : 17 * b; const vec2 v2 = !c ? vec2(1.0) : vec2(2.0); diff --git a/core/deps/glslang/Test/spv.specTexture.frag b/core/deps/glslang/Test/spv.specTexture.frag new file mode 100644 index 000000000..7fd89f5ed --- /dev/null +++ b/core/deps/glslang/Test/spv.specTexture.frag @@ -0,0 +1,10 @@ +#version 450 + +layout(constant_id = 1) const int offs = 0; +layout(binding = 0) uniform sampler2D tex; +layout(location = 0) out vec4 color_out; + +void main(void) +{ + color_out = textureLodOffset(tex, vec2(0.0, 0.0), 0.0, ivec2(offs, offs)); +} \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.stereoViewRendering.tesc b/core/deps/glslang/Test/spv.stereoViewRendering.tesc index df6dc7892..ec1076f8e 100644 --- a/core/deps/glslang/Test/spv.stereoViewRendering.tesc +++ b/core/deps/glslang/Test/spv.stereoViewRendering.tesc @@ -1,19 +1,19 @@ -#version 450 - -#extension GL_NV_viewport_array2 :require -#extension GL_NV_stereo_view_rendering : require - -layout(vertices = 4) out; - -out gl_PerVertex { - int gl_SecondaryViewportMaskNV[2]; - vec4 gl_SecondaryPositionNV; -} gl_out[4]; - -layout (viewport_relative, secondary_view_offset = 1) out highp int gl_Layer; - -void main() -{ - gl_out[gl_InvocationID].gl_SecondaryViewportMaskNV[0] = 1; - gl_out[gl_InvocationID].gl_SecondaryPositionNV = gl_in[1].gl_Position + gl_in[1].gl_SecondaryPositionNV; -} +#version 450 + +#extension GL_NV_viewport_array2 :require +#extension GL_NV_stereo_view_rendering : require + +layout(vertices = 4) out; + +out gl_PerVertex { + int gl_SecondaryViewportMaskNV[2]; + vec4 gl_SecondaryPositionNV; +} gl_out[4]; + +layout (viewport_relative, secondary_view_offset = 1) out highp int gl_Layer; + +void main() +{ + gl_out[gl_InvocationID].gl_SecondaryViewportMaskNV[0] = 1; + gl_out[gl_InvocationID].gl_SecondaryPositionNV = gl_in[1].gl_Position + gl_in[1].gl_SecondaryPositionNV; +} diff --git a/core/deps/glslang/Test/spv.stereoViewRendering.vert b/core/deps/glslang/Test/spv.stereoViewRendering.vert index 2684133b8..fc7d52e24 100644 --- a/core/deps/glslang/Test/spv.stereoViewRendering.vert +++ b/core/deps/glslang/Test/spv.stereoViewRendering.vert @@ -1,12 +1,12 @@ -#version 450 - -#extension GL_NV_viewport_array2 :require -#extension GL_NV_stereo_view_rendering : require - -layout (viewport_relative, secondary_view_offset = 2) out highp int gl_Layer; -void main() -{ - gl_SecondaryViewportMaskNV[0] = 1; - gl_SecondaryPositionNV = gl_Position; -} - +#version 450 + +#extension GL_NV_viewport_array2 :require +#extension GL_NV_stereo_view_rendering : require + +layout (viewport_relative, secondary_view_offset = 2) out highp int gl_Layer; +void main() +{ + gl_SecondaryViewportMaskNV[0] = 1; + gl_SecondaryPositionNV = gl_Position; +} + diff --git a/core/deps/glslang/Test/spv.storageBuffer.vert b/core/deps/glslang/Test/spv.storageBuffer.vert index 0a85b800d..6dd629e81 100644 --- a/core/deps/glslang/Test/spv.storageBuffer.vert +++ b/core/deps/glslang/Test/spv.storageBuffer.vert @@ -1,16 +1,16 @@ -#version 450 - -#pragma use_storage_buffer - -uniform ub { - vec4 a; -} ubi; - -buffer bb { - vec4 b; -} bbi; - -void main() -{ - gl_Position = ubi.a + bbi.b; -} +#version 450 + +#pragma use_storage_buffer + +uniform ub { + vec4 a; +} ubi; + +buffer bb { + vec4 b; +} bbi; + +void main() +{ + gl_Position = ubi.a + bbi.b; +} diff --git a/core/deps/glslang/Test/spv.structAssignment.frag b/core/deps/glslang/Test/spv.structAssignment.frag index 18734b24e..ca95ec37d 100644 --- a/core/deps/glslang/Test/spv.structAssignment.frag +++ b/core/deps/glslang/Test/spv.structAssignment.frag @@ -1,41 +1,41 @@ -#version 140 - -precision mediump int; - -uniform sampler2D samp2D; -in mediump vec2 coord; - -struct lunarStruct1 { - int i; - float f; -}; - -struct lunarStruct2 { - int i; - float f; - lunarStruct1 s1_1; -}; - -struct lunarStruct3 { - lunarStruct2 s2_1; - int i; - float f; - lunarStruct1 s1_1; -}; - - -lunarStruct1 foo; -lunarStruct2 foo2; -lunarStruct3 foo3; - -void main() -{ - lunarStruct2 locals2; - - if (foo3.s2_1.i > 0) - locals2 = foo3.s2_1; - else - locals2 = foo2; - - gl_FragColor = locals2.s1_1.f * texture(samp2D, coord); -} +#version 140 + +precision mediump int; + +uniform sampler2D samp2D; +in mediump vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1; + int i; + float f; + lunarStruct1 s1_1; +}; + + +lunarStruct1 foo; +lunarStruct2 foo2; +lunarStruct3 foo3; + +void main() +{ + lunarStruct2 locals2; + + if (foo3.s2_1.i > 0) + locals2 = foo3.s2_1; + else + locals2 = foo2; + + gl_FragColor = locals2.s1_1.f * texture(samp2D, coord); +} diff --git a/core/deps/glslang/Test/spv.structDeref.frag b/core/deps/glslang/Test/spv.structDeref.frag index 94232ad20..11822cdcb 100644 --- a/core/deps/glslang/Test/spv.structDeref.frag +++ b/core/deps/glslang/Test/spv.structDeref.frag @@ -1,71 +1,71 @@ -#version 140 - -uniform sampler2D samp2D; -in vec2 coord; - -struct s0 { - int i; -}; - -struct s00 { - s0 s0_0; -}; - -struct s1 { - int i; - float f; - s0 s0_1; -}; - -struct s2 { - int i; - float f; - s1 s1_1; -}; - -struct s3 { - s2[12] s2_1; - int i; - float f; - s1 s1_1; -}; - - -s0 foo0; -s1 foo1; -s2 foo2; -s3 foo3; - -s00 foo00; - -void main() -{ - s0 locals0; - s2 locals2; - s00 locals00; - - float[6] fArray; - - s1[10] locals1Array; - - if (foo3.s2_1[9].i > 0) { - locals2.f = 1.0; - locals2.s1_1 = s1(0, 1.0, s0(0)); - fArray = float[6]( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - locals1Array[6] = foo1; - locals0 = s0(0); - locals00 = s00(s0(0)); - } else { - locals2.f = coord.x; - locals2.s1_1 = s1(1, coord.y, foo0); - fArray = float[6]( 0.0, 1.0, 2.0, 3.0, 4.0, 5.0); - locals1Array[6] = locals2.s1_1; - locals0 = foo1.s0_1; - locals00 = foo00; - } - - if (locals0.i > 5) - locals0 = locals00.s0_0; - - gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture(samp2D, coord); -} +#version 140 + +uniform sampler2D samp2D; +in vec2 coord; + +struct s0 { + int i; +}; + +struct s00 { + s0 s0_0; +}; + +struct s1 { + int i; + float f; + s0 s0_1; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +struct s3 { + s2[12] s2_1; + int i; + float f; + s1 s1_1; +}; + + +s0 foo0; +s1 foo1; +s2 foo2; +s3 foo3; + +s00 foo00; + +void main() +{ + s0 locals0; + s2 locals2; + s00 locals00; + + float[6] fArray; + + s1[10] locals1Array; + + if (foo3.s2_1[9].i > 0) { + locals2.f = 1.0; + locals2.s1_1 = s1(0, 1.0, s0(0)); + fArray = float[6]( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + locals1Array[6] = foo1; + locals0 = s0(0); + locals00 = s00(s0(0)); + } else { + locals2.f = coord.x; + locals2.s1_1 = s1(1, coord.y, foo0); + fArray = float[6]( 0.0, 1.0, 2.0, 3.0, 4.0, 5.0); + locals1Array[6] = locals2.s1_1; + locals0 = foo1.s0_1; + locals00 = foo00; + } + + if (locals0.i > 5) + locals0 = locals00.s0_0; + + gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture(samp2D, coord); +} diff --git a/core/deps/glslang/Test/spv.structure.frag b/core/deps/glslang/Test/spv.structure.frag index 76751a7f9..b81b9547a 100644 --- a/core/deps/glslang/Test/spv.structure.frag +++ b/core/deps/glslang/Test/spv.structure.frag @@ -1,31 +1,31 @@ -#version 140 -uniform sampler2D samp2D; -in vec2 coord; - -struct lunarStruct1 { - int i; - float f[4]; - vec4 color[5]; -}; - -struct lunarStruct2 { - int i[5]; - float f; - lunarStruct1 s1_1[7]; -}; - -lunarStruct1 foo; -lunarStruct2 foo2[5]; - -void main() -{ - float scale = 0.0; - - if (foo2[3].i[4] > 0) - scale = foo2[3].s1_1[2].color[3].x; - else - scale = foo2[3].s1_1[2].f[3]; - - gl_FragColor = scale * texture(samp2D, coord); -} - +#version 140 +uniform sampler2D samp2D; +in vec2 coord; + +struct lunarStruct1 { + int i; + float f[4]; + vec4 color[5]; +}; + +struct lunarStruct2 { + int i[5]; + float f; + lunarStruct1 s1_1[7]; +}; + +lunarStruct1 foo; +lunarStruct2 foo2[5]; + +void main() +{ + float scale = 0.0; + + if (foo2[3].i[4] > 0) + scale = foo2[3].s1_1[2].color[3].x; + else + scale = foo2[3].s1_1[2].f[3]; + + gl_FragColor = scale * texture(samp2D, coord); +} + diff --git a/core/deps/glslang/Test/spv.subgroup.frag b/core/deps/glslang/Test/spv.subgroup.frag index 311a79138..520052faa 100644 --- a/core/deps/glslang/Test/spv.subgroup.frag +++ b/core/deps/glslang/Test/spv.subgroup.frag @@ -1,7 +1,7 @@ -#version 450 -#extension GL_KHR_shader_subgroup_basic: enable -layout(location = 0) out uvec4 data; -void main (void) -{ - data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(location = 0) out uvec4 data; +void main (void) +{ + data = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/spv.subgroup.geom b/core/deps/glslang/Test/spv.subgroup.geom index fd274c706..70e9dd489 100644 --- a/core/deps/glslang/Test/spv.subgroup.geom +++ b/core/deps/glslang/Test/spv.subgroup.geom @@ -1,13 +1,13 @@ -#version 450 -#extension GL_KHR_shader_subgroup_basic: enable -layout(points) in; -layout(points, max_vertices = 1) out; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(points) in; +layout(points, max_vertices = 1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/spv.subgroup.tesc b/core/deps/glslang/Test/spv.subgroup.tesc index 1a60a517f..63bf5e559 100644 --- a/core/deps/glslang/Test/spv.subgroup.tesc +++ b/core/deps/glslang/Test/spv.subgroup.tesc @@ -1,12 +1,12 @@ -#version 450 -#extension GL_KHR_shader_subgroup_basic: enable -layout(vertices=1) out; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(vertices=1) out; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/spv.subgroup.tese b/core/deps/glslang/Test/spv.subgroup.tese index fce9e2e82..e504df79a 100644 --- a/core/deps/glslang/Test/spv.subgroup.tese +++ b/core/deps/glslang/Test/spv.subgroup.tese @@ -1,12 +1,12 @@ -#version 450 -#extension GL_KHR_shader_subgroup_basic: enable -layout(isolines) in; -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(isolines) in; +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_PrimitiveID] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/spv.subgroup.vert b/core/deps/glslang/Test/spv.subgroup.vert index e2e0a08cd..779b7584c 100644 --- a/core/deps/glslang/Test/spv.subgroup.vert +++ b/core/deps/glslang/Test/spv.subgroup.vert @@ -1,11 +1,11 @@ -#version 450 -#extension GL_KHR_shader_subgroup_basic: enable -layout(set = 0, binding = 0, std430) buffer Output -{ - uvec4 result[]; -}; - -void main (void) -{ - result[gl_VertexIndex] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); -} +#version 450 +#extension GL_KHR_shader_subgroup_basic: enable +layout(set = 0, binding = 0, std430) buffer Output +{ + uvec4 result[]; +}; + +void main (void) +{ + result[gl_VertexIndex] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0); +} diff --git a/core/deps/glslang/Test/spv.subgroupArithmetic.comp b/core/deps/glslang/Test/spv.subgroupArithmetic.comp index c17a2592f..6cc9337b6 100644 --- a/core/deps/glslang/Test/spv.subgroupArithmetic.comp +++ b/core/deps/glslang/Test/spv.subgroupArithmetic.comp @@ -1,393 +1,393 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_arithmetic: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupAdd(data[3].f4); - - data[invocation].i4.x = subgroupAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupAdd(data[3].i4); - - data[invocation].u4.x = subgroupAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupAdd(data[3].u4); - - data[invocation].d4.x = subgroupAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupAdd(data[3].d4); - - data[invocation].f4.x = subgroupMul(data[0].f4.x); - data[invocation].f4.xy = subgroupMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); - data[invocation].f4 = subgroupMul(data[3].f4); - - data[invocation].i4.x = subgroupMul(data[0].i4.x); - data[invocation].i4.xy = subgroupMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); - data[invocation].i4 = subgroupMul(data[3].i4); - - data[invocation].u4.x = subgroupMul(data[0].u4.x); - data[invocation].u4.xy = subgroupMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); - data[invocation].u4 = subgroupMul(data[3].u4); - - data[invocation].d4.x = subgroupMul(data[0].d4.x); - data[invocation].d4.xy = subgroupMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); - data[invocation].d4 = subgroupMul(data[3].d4); - - data[invocation].f4.x = subgroupMin(data[0].f4.x); - data[invocation].f4.xy = subgroupMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); - data[invocation].f4 = subgroupMin(data[3].f4); - - data[invocation].i4.x = subgroupMin(data[0].i4.x); - data[invocation].i4.xy = subgroupMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); - data[invocation].i4 = subgroupMin(data[3].i4); - - data[invocation].u4.x = subgroupMin(data[0].u4.x); - data[invocation].u4.xy = subgroupMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); - data[invocation].u4 = subgroupMin(data[3].u4); - - data[invocation].d4.x = subgroupMin(data[0].d4.x); - data[invocation].d4.xy = subgroupMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); - data[invocation].d4 = subgroupMin(data[3].d4); - - data[invocation].f4.x = subgroupMax(data[0].f4.x); - data[invocation].f4.xy = subgroupMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); - data[invocation].f4 = subgroupMax(data[3].f4); - - data[invocation].i4.x = subgroupMax(data[0].i4.x); - data[invocation].i4.xy = subgroupMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); - data[invocation].i4 = subgroupMax(data[3].i4); - - data[invocation].u4.x = subgroupMax(data[0].u4.x); - data[invocation].u4.xy = subgroupMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); - data[invocation].u4 = subgroupMax(data[3].u4); - - data[invocation].d4.x = subgroupMax(data[0].d4.x); - data[invocation].d4.xy = subgroupMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); - data[invocation].d4 = subgroupMax(data[3].d4); - - data[invocation].i4.x = subgroupAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupAnd(data[3].i4); - - data[invocation].u4.x = subgroupAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupOr(data[0].i4.x); - data[invocation].i4.xy = subgroupOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); - data[invocation].i4 = subgroupOr(data[3].i4); - - data[invocation].u4.x = subgroupOr(data[0].u4.x); - data[invocation].u4.xy = subgroupOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); - data[invocation].u4 = subgroupOr(data[3].u4); - - data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupXor(data[0].i4.x); - data[invocation].i4.xy = subgroupXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); - data[invocation].i4 = subgroupXor(data[3].i4); - - data[invocation].u4.x = subgroupXor(data[0].u4.x); - data[invocation].u4.xy = subgroupXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); - data[invocation].u4 = subgroupXor(data[3].u4); - - data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMul(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMul(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMul(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMul(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMin(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMin(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMin(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMin(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMax(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMax(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMax(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMax(data[3].d4); - - data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveOr(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveOr(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveXor(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveXor(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMul(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMul(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMul(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMul(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMin(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMin(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMin(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMin(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMax(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMax(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMax(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMax(data[3].d4); - - data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveOr(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveOr(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveXor(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveXor(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); -} +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/spv.subgroupBallot.comp b/core/deps/glslang/Test/spv.subgroupBallot.comp index 94e099dc4..bb9dc3e4d 100644 --- a/core/deps/glslang/Test/spv.subgroupBallot.comp +++ b/core/deps/glslang/Test/spv.subgroupBallot.comp @@ -1,86 +1,86 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 relMask = gl_SubgroupEqMask + - gl_SubgroupGeMask + - gl_SubgroupGtMask + - gl_SubgroupLeMask + - gl_SubgroupLtMask; - - uvec4 result = subgroupBallot(true); - - data[invocation].u4.x = subgroupBallotBitCount(result); - data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; - data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); - data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); - - if ((relMask == result) && subgroupInverseBallot(data[0].u4)) - { - data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, 3); - data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, 3); - data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3); - data[invocation].f4 = subgroupBroadcast(data[3].f4, 3); - - data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, 2); - data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, 2); - data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2); - data[invocation].i4 = subgroupBroadcast(data[3].i4, 2); - - data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupBroadcast(data[3].u4, 1); - - data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, 0); - data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, 0); - data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, 0); - data[invocation].d4 = subgroupBroadcast(data[3].d4, 0); - - data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); - } - else - { - data[invocation].f4.x = subgroupBroadcastFirst(data[0].f4.x); - data[invocation].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); - data[invocation].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); - data[invocation].f4 = subgroupBroadcastFirst(data[3].f4); - - data[invocation].i4.x = subgroupBroadcastFirst(data[0].i4.x); - data[invocation].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); - data[invocation].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); - data[invocation].i4 = subgroupBroadcastFirst(data[3].i4); - - data[invocation].u4.x = subgroupBroadcastFirst(data[0].u4.x); - data[invocation].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); - data[invocation].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); - data[invocation].u4 = subgroupBroadcastFirst(data[3].u4); - - data[invocation].d4.x = subgroupBroadcastFirst(data[0].d4.x); - data[invocation].d4.xy = subgroupBroadcastFirst(data[1].d4.xy); - data[invocation].d4.xyz = subgroupBroadcastFirst(data[2].d4.xyz); - data[invocation].d4 = subgroupBroadcastFirst(data[3].d4); - - data[invocation].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); - } -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + if ((relMask == result) && subgroupInverseBallot(data[0].u4)) + { + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, 3); + data[invocation].f4.xy = subgroupBroadcast(data[1].f4.xy, 3); + data[invocation].f4.xyz = subgroupBroadcast(data[2].f4.xyz, 3); + data[invocation].f4 = subgroupBroadcast(data[3].f4, 3); + + data[invocation].i4.x = subgroupBroadcast(data[0].i4.x, 2); + data[invocation].i4.xy = subgroupBroadcast(data[1].i4.xy, 2); + data[invocation].i4.xyz = subgroupBroadcast(data[2].i4.xyz, 2); + data[invocation].i4 = subgroupBroadcast(data[3].i4, 2); + + data[invocation].u4.x = subgroupBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupBroadcast(data[0].d4.x, 0); + data[invocation].d4.xy = subgroupBroadcast(data[1].d4.xy, 0); + data[invocation].d4.xyz = subgroupBroadcast(data[2].d4.xyz, 0); + data[invocation].d4 = subgroupBroadcast(data[3].d4, 0); + + data[invocation].i4.x = int(subgroupBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); + } + else + { + data[invocation].f4.x = subgroupBroadcastFirst(data[0].f4.x); + data[invocation].f4.xy = subgroupBroadcastFirst(data[1].f4.xy); + data[invocation].f4.xyz = subgroupBroadcastFirst(data[2].f4.xyz); + data[invocation].f4 = subgroupBroadcastFirst(data[3].f4); + + data[invocation].i4.x = subgroupBroadcastFirst(data[0].i4.x); + data[invocation].i4.xy = subgroupBroadcastFirst(data[1].i4.xy); + data[invocation].i4.xyz = subgroupBroadcastFirst(data[2].i4.xyz); + data[invocation].i4 = subgroupBroadcastFirst(data[3].i4); + + data[invocation].u4.x = subgroupBroadcastFirst(data[0].u4.x); + data[invocation].u4.xy = subgroupBroadcastFirst(data[1].u4.xy); + data[invocation].u4.xyz = subgroupBroadcastFirst(data[2].u4.xyz); + data[invocation].u4 = subgroupBroadcastFirst(data[3].u4); + + data[invocation].d4.x = subgroupBroadcastFirst(data[0].d4.x); + data[invocation].d4.xy = subgroupBroadcastFirst(data[1].d4.xy); + data[invocation].d4.xyz = subgroupBroadcastFirst(data[2].d4.xyz); + data[invocation].d4 = subgroupBroadcastFirst(data[3].d4); + + data[invocation].i4.x = int(subgroupBroadcastFirst(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupBroadcastFirst(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupBroadcastFirst(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupBroadcastFirst(lessThan(data[1].i4, ivec4(0)))); + } +} diff --git a/core/deps/glslang/Test/spv.subgroupBallotNeg.comp b/core/deps/glslang/Test/spv.subgroupBallotNeg.comp index f6836e22a..4020adf11 100644 --- a/core/deps/glslang/Test/spv.subgroupBallotNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupBallotNeg.comp @@ -1,33 +1,33 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 relMask = gl_SubgroupEqMask + - gl_SubgroupGeMask + - gl_SubgroupGtMask + - gl_SubgroupLeMask + - gl_SubgroupLtMask; - - uvec4 result = subgroupBallot(true); - - data[invocation].u4.x = subgroupBallotBitCount(result); - data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; - data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); - data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); - - data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 relMask = gl_SubgroupEqMask + + gl_SubgroupGeMask + + gl_SubgroupGtMask + + gl_SubgroupLeMask + + gl_SubgroupLtMask; + + uvec4 result = subgroupBallot(true); + + data[invocation].u4.x = subgroupBallotBitCount(result); + data[invocation].u4.y = subgroupBallotBitExtract(result, 0) ? 1 : 0; + data[invocation].u4.z = subgroupBallotInclusiveBitCount(result) + subgroupBallotExclusiveBitCount(result); + data[invocation].u4.w = subgroupBallotFindLSB(result) + subgroupBallotFindMSB(result); + + data[invocation].f4.x = subgroupBroadcast(data[0].f4.x, invocation); // ERROR: not constant +} diff --git a/core/deps/glslang/Test/spv.subgroupBasic.comp b/core/deps/glslang/Test/spv.subgroupBasic.comp index b66dd2a09..4801c1070 100644 --- a/core/deps/glslang/Test/spv.subgroupBasic.comp +++ b/core/deps/glslang/Test/spv.subgroupBasic.comp @@ -1,23 +1,23 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_basic: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffer -{ - int a[]; -} data; - -void main() -{ - data.a[gl_SubgroupSize] = 1; - data.a[gl_SubgroupInvocationID] = 1; - data.a[gl_NumSubgroups] = 1; - data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; - subgroupBarrier(); - subgroupMemoryBarrier(); - subgroupMemoryBarrierBuffer(); - subgroupMemoryBarrierShared(); - subgroupMemoryBarrierImage(); -} +#version 450 + +#extension GL_KHR_shader_subgroup_basic: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffer +{ + int a[]; +} data; + +void main() +{ + data.a[gl_SubgroupSize] = 1; + data.a[gl_SubgroupInvocationID] = 1; + data.a[gl_NumSubgroups] = 1; + data.a[gl_SubgroupID] = (subgroupElect()) ? 1 : 0; + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); +} diff --git a/core/deps/glslang/Test/spv.subgroupClustered.comp b/core/deps/glslang/Test/spv.subgroupClustered.comp index dc63ed969..128a24c88 100644 --- a/core/deps/glslang/Test/spv.subgroupClustered.comp +++ b/core/deps/glslang/Test/spv.subgroupClustered.comp @@ -1,143 +1,143 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_clustered: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupClusteredAdd(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredAdd(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredAdd(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredAdd(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredAdd(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredAdd(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredAdd(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredAdd(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredAdd(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredAdd(data[3].d4, 1); - - data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredMul(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredMul(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredMul(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredMul(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredMul(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredMul(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredMul(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredMul(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredMul(data[3].d4, 1); - - data[invocation].f4.x = subgroupClusteredMin(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredMin(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredMin(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredMin(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredMin(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredMin(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredMin(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredMin(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredMin(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredMin(data[3].d4, 1); - - data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupClusteredMax(data[3].f4, 1); - - data[invocation].i4.x = subgroupClusteredMax(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredMax(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredMax(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredMax(data[3].u4, 1); - - data[invocation].d4.x = subgroupClusteredMax(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupClusteredMax(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupClusteredMax(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupClusteredMax(data[3].d4, 1); - - data[invocation].i4.x = subgroupClusteredAnd(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredAnd(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredAnd(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredAnd(data[3].u4, 1); - - data[invocation].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1)); - - data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredOr(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredOr(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredOr(data[3].u4, 1); - - data[invocation].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1)); - - data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupClusteredXor(data[3].i4, 1); - - data[invocation].u4.x = subgroupClusteredXor(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupClusteredXor(data[3].u4, 1); - - data[invocation].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1)); -} +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupClusteredAdd(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredAdd(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredAdd(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredAdd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAdd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAdd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAdd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAdd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAdd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAdd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAdd(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredAdd(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredAdd(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredAdd(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredAdd(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMul(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMul(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMul(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMul(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMul(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMul(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMul(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMul(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMul(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMul(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMul(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMul(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMul(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMul(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMul(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMin(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMin(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMin(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMin(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMin(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMin(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMin(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMin(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMin(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMin(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMin(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMin(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMin(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMin(data[3].d4, 1); + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupClusteredMax(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupClusteredMax(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupClusteredMax(data[3].f4, 1); + + data[invocation].i4.x = subgroupClusteredMax(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredMax(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredMax(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredMax(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredMax(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredMax(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredMax(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredMax(data[3].u4, 1); + + data[invocation].d4.x = subgroupClusteredMax(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupClusteredMax(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupClusteredMax(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupClusteredMax(data[3].d4, 1); + + data[invocation].i4.x = subgroupClusteredAnd(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredAnd(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredAnd(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredAnd(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredAnd(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredAnd(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredAnd(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredAnd(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredAnd(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredAnd(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredAnd(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredOr(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredOr(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredOr(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredOr(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredOr(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredOr(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredOr(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredOr(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredOr(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredOr(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupClusteredXor(data[3].i4, 1); + + data[invocation].u4.x = subgroupClusteredXor(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupClusteredXor(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupClusteredXor(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupClusteredXor(data[3].u4, 1); + + data[invocation].i4.x = int(subgroupClusteredXor(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupClusteredXor(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupClusteredXor(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupClusteredXor(lessThan(data[1].i4, ivec4(0)), 1)); +} diff --git a/core/deps/glslang/Test/spv.subgroupClusteredNeg.comp b/core/deps/glslang/Test/spv.subgroupClusteredNeg.comp index d6169c9b5..ec15413e3 100644 --- a/core/deps/glslang/Test/spv.subgroupClusteredNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupClusteredNeg.comp @@ -1,39 +1,39 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_clustered: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - int a = 1; - const int aConst = 1; - - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1 - - data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2 - - data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8); - data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2 - - data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1 - - data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1 - - data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant - data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst); - - data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant - data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant - data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst); -} +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + int a = 1; + const int aConst = 1; + + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.xy = subgroupClusteredAdd(data[1].f4.xy, 0); // ERROR, less than 1 + + data[invocation].f4.x = subgroupClusteredMul(data[0].f4.x, 3); // ERROR, not a power of 2 + + data[invocation].i4.xy = subgroupClusteredMin(data[1].i4.xy, 8); + data[invocation].i4.xyz = subgroupClusteredMin(data[2].i4.xyz, 6); // ERROR, not a power of 2 + + data[invocation].f4.x = subgroupClusteredMax(data[0].f4.x, -1); // ERROR, less than 1 + + data[invocation].i4 = subgroupClusteredAnd(data[3].i4, -3); // ERROR, less than 1 + + data[invocation].i4.x = subgroupClusteredOr(data[0].i4.x, a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredOr(data[1].i4.xy, aConst); + + data[invocation].i4.x = subgroupClusteredXor(data[0].i4.x, 1 + a); // ERROR, not constant + data[invocation].i4.xy = subgroupClusteredXor(data[1].i4.xy, aConst + a); // ERROR, not constant + data[invocation].i4.xyz = subgroupClusteredXor(data[2].i4.xyz, 1 + aConst); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmetic.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmetic.comp index a6c1e5571..f58268f5f 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmetic.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmetic.comp @@ -1,715 +1,715 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_arithmetic: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupAdd(data[0].i8.x); - data[invocation].i8.xy = subgroupAdd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupAdd(data[2].i8.xyz); - data[invocation].i8 = subgroupAdd(data[3].i8); - - data[invocation].i8.x = subgroupMul(data[0].i8.x); - data[invocation].i8.xy = subgroupMul(data[1].i8.xy); - data[invocation].i8.xyz = subgroupMul(data[2].i8.xyz); - data[invocation].i8 = subgroupMul(data[3].i8); - - data[invocation].i8.x = subgroupMin(data[0].i8.x); - data[invocation].i8.xy = subgroupMin(data[1].i8.xy); - data[invocation].i8.xyz = subgroupMin(data[2].i8.xyz); - data[invocation].i8 = subgroupMin(data[3].i8); - - data[invocation].i8.x = subgroupMax(data[0].i8.x); - data[invocation].i8.xy = subgroupMax(data[1].i8.xy); - data[invocation].i8.xyz = subgroupMax(data[2].i8.xyz); - data[invocation].i8 = subgroupMax(data[3].i8); - - data[invocation].i8.x = subgroupAnd(data[0].i8.x); - data[invocation].i8.xy = subgroupAnd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupAnd(data[2].i8.xyz); - data[invocation].i8 = subgroupAnd(data[3].i8); - - data[invocation].i8.x = subgroupOr(data[0].i8.x); - data[invocation].i8.xy = subgroupOr(data[1].i8.xy); - data[invocation].i8.xyz = subgroupOr(data[2].i8.xyz); - data[invocation].i8 = subgroupOr(data[3].i8); - - data[invocation].i8.x = subgroupXor(data[0].i8.x); - data[invocation].i8.xy = subgroupXor(data[1].i8.xy); - data[invocation].i8.xyz = subgroupXor(data[2].i8.xyz); - data[invocation].i8 = subgroupXor(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveAdd(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveAdd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveAdd(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveAdd(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveMul(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveMul(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveMul(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveMul(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveMin(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveMin(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveMin(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveMin(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveMax(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveMax(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveMax(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveMax(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveAnd(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveAnd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveAnd(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveAnd(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveOr(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveOr(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveOr(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveOr(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveXor(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveXor(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveXor(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveXor(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveAdd(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveAdd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveAdd(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveAdd(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveMul(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveMul(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveMul(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveMul(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveMin(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveMin(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveMin(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveMin(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveMax(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveMax(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveMax(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveMax(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveAnd(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveAnd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveAnd(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveAnd(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveOr(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveOr(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveOr(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveOr(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveXor(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveXor(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveXor(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveXor(data[3].i8); - - data[invocation].u8.x = subgroupAdd(data[0].u8.x); - data[invocation].u8.xy = subgroupAdd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupAdd(data[2].u8.xyz); - data[invocation].u8 = subgroupAdd(data[3].u8); - - data[invocation].u8.x = subgroupMul(data[0].u8.x); - data[invocation].u8.xy = subgroupMul(data[1].u8.xy); - data[invocation].u8.xyz = subgroupMul(data[2].u8.xyz); - data[invocation].u8 = subgroupMul(data[3].u8); - - data[invocation].u8.x = subgroupMin(data[0].u8.x); - data[invocation].u8.xy = subgroupMin(data[1].u8.xy); - data[invocation].u8.xyz = subgroupMin(data[2].u8.xyz); - data[invocation].u8 = subgroupMin(data[3].u8); - - data[invocation].u8.x = subgroupMax(data[0].u8.x); - data[invocation].u8.xy = subgroupMax(data[1].u8.xy); - data[invocation].u8.xyz = subgroupMax(data[2].u8.xyz); - data[invocation].u8 = subgroupMax(data[3].u8); - - data[invocation].u8.x = subgroupAnd(data[0].u8.x); - data[invocation].u8.xy = subgroupAnd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupAnd(data[2].u8.xyz); - data[invocation].u8 = subgroupAnd(data[3].u8); - - data[invocation].u8.x = subgroupOr(data[0].u8.x); - data[invocation].u8.xy = subgroupOr(data[1].u8.xy); - data[invocation].u8.xyz = subgroupOr(data[2].u8.xyz); - data[invocation].u8 = subgroupOr(data[3].u8); - - data[invocation].u8.x = subgroupXor(data[0].u8.x); - data[invocation].u8.xy = subgroupXor(data[1].u8.xy); - data[invocation].u8.xyz = subgroupXor(data[2].u8.xyz); - data[invocation].u8 = subgroupXor(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveAdd(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveAdd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveAdd(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveAdd(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveMul(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveMul(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveMul(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveMul(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveMin(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveMin(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveMin(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveMin(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveMax(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveMax(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveMax(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveMax(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveAnd(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveAnd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveAnd(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveAnd(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveOr(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveOr(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveOr(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveOr(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveXor(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveXor(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveXor(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveXor(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveAdd(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveAdd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveAdd(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveAdd(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveMul(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveMul(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveMul(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveMul(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveMin(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveMin(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveMin(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveMin(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveMax(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveMax(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveMax(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveMax(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveAnd(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveAnd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveAnd(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveAnd(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveOr(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveOr(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveOr(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveOr(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveXor(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveXor(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveXor(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveXor(data[3].u8); - - data[invocation].i16.x = subgroupAdd(data[0].i16.x); - data[invocation].i16.xy = subgroupAdd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupAdd(data[2].i16.xyz); - data[invocation].i16 = subgroupAdd(data[3].i16); - - data[invocation].i16.x = subgroupMul(data[0].i16.x); - data[invocation].i16.xy = subgroupMul(data[1].i16.xy); - data[invocation].i16.xyz = subgroupMul(data[2].i16.xyz); - data[invocation].i16 = subgroupMul(data[3].i16); - - data[invocation].i16.x = subgroupMin(data[0].i16.x); - data[invocation].i16.xy = subgroupMin(data[1].i16.xy); - data[invocation].i16.xyz = subgroupMin(data[2].i16.xyz); - data[invocation].i16 = subgroupMin(data[3].i16); - - data[invocation].i16.x = subgroupMax(data[0].i16.x); - data[invocation].i16.xy = subgroupMax(data[1].i16.xy); - data[invocation].i16.xyz = subgroupMax(data[2].i16.xyz); - data[invocation].i16 = subgroupMax(data[3].i16); - - data[invocation].i16.x = subgroupAnd(data[0].i16.x); - data[invocation].i16.xy = subgroupAnd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupAnd(data[2].i16.xyz); - data[invocation].i16 = subgroupAnd(data[3].i16); - - data[invocation].i16.x = subgroupOr(data[0].i16.x); - data[invocation].i16.xy = subgroupOr(data[1].i16.xy); - data[invocation].i16.xyz = subgroupOr(data[2].i16.xyz); - data[invocation].i16 = subgroupOr(data[3].i16); - - data[invocation].i16.x = subgroupXor(data[0].i16.x); - data[invocation].i16.xy = subgroupXor(data[1].i16.xy); - data[invocation].i16.xyz = subgroupXor(data[2].i16.xyz); - data[invocation].i16 = subgroupXor(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveAdd(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveAdd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveAdd(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveAdd(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveMul(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveMul(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveMul(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveMul(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveMin(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveMin(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveMin(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveMin(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveMax(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveMax(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveMax(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveMax(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveAnd(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveAnd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveAnd(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveAnd(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveOr(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveOr(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveOr(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveOr(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveXor(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveXor(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveXor(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveXor(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveAdd(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveAdd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveAdd(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveAdd(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveMul(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveMul(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveMul(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveMul(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveMin(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveMin(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveMin(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveMin(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveMax(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveMax(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveMax(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveMax(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveAnd(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveAnd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveAnd(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveAnd(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveOr(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveOr(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveOr(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveOr(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveXor(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveXor(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveXor(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveXor(data[3].i16); - - data[invocation].u16.x = subgroupAdd(data[0].u16.x); - data[invocation].u16.xy = subgroupAdd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupAdd(data[2].u16.xyz); - data[invocation].u16 = subgroupAdd(data[3].u16); - - data[invocation].u16.x = subgroupMul(data[0].u16.x); - data[invocation].u16.xy = subgroupMul(data[1].u16.xy); - data[invocation].u16.xyz = subgroupMul(data[2].u16.xyz); - data[invocation].u16 = subgroupMul(data[3].u16); - - data[invocation].u16.x = subgroupMin(data[0].u16.x); - data[invocation].u16.xy = subgroupMin(data[1].u16.xy); - data[invocation].u16.xyz = subgroupMin(data[2].u16.xyz); - data[invocation].u16 = subgroupMin(data[3].u16); - - data[invocation].u16.x = subgroupMax(data[0].u16.x); - data[invocation].u16.xy = subgroupMax(data[1].u16.xy); - data[invocation].u16.xyz = subgroupMax(data[2].u16.xyz); - data[invocation].u16 = subgroupMax(data[3].u16); - - data[invocation].u16.x = subgroupAnd(data[0].u16.x); - data[invocation].u16.xy = subgroupAnd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupAnd(data[2].u16.xyz); - data[invocation].u16 = subgroupAnd(data[3].u16); - - data[invocation].u16.x = subgroupOr(data[0].u16.x); - data[invocation].u16.xy = subgroupOr(data[1].u16.xy); - data[invocation].u16.xyz = subgroupOr(data[2].u16.xyz); - data[invocation].u16 = subgroupOr(data[3].u16); - - data[invocation].u16.x = subgroupXor(data[0].u16.x); - data[invocation].u16.xy = subgroupXor(data[1].u16.xy); - data[invocation].u16.xyz = subgroupXor(data[2].u16.xyz); - data[invocation].u16 = subgroupXor(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveAdd(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveAdd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveAdd(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveAdd(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveMul(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveMul(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveMul(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveMul(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveMin(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveMin(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveMin(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveMin(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveMax(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveMax(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveMax(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveMax(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveAnd(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveAnd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveAnd(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveAnd(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveOr(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveOr(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveOr(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveOr(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveXor(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveXor(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveXor(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveXor(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveAdd(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveAdd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveAdd(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveAdd(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveMul(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveMul(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveMul(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveMul(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveMin(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveMin(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveMin(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveMin(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveMax(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveMax(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveMax(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveMax(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveAnd(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveAnd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveAnd(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveAnd(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveOr(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveOr(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveOr(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveOr(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveXor(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveXor(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveXor(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveXor(data[3].u16); - - data[invocation].i64.x = subgroupAdd(data[0].i64.x); - data[invocation].i64.xy = subgroupAdd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupAdd(data[2].i64.xyz); - data[invocation].i64 = subgroupAdd(data[3].i64); - - data[invocation].i64.x = subgroupMul(data[0].i64.x); - data[invocation].i64.xy = subgroupMul(data[1].i64.xy); - data[invocation].i64.xyz = subgroupMul(data[2].i64.xyz); - data[invocation].i64 = subgroupMul(data[3].i64); - - data[invocation].i64.x = subgroupMin(data[0].i64.x); - data[invocation].i64.xy = subgroupMin(data[1].i64.xy); - data[invocation].i64.xyz = subgroupMin(data[2].i64.xyz); - data[invocation].i64 = subgroupMin(data[3].i64); - - data[invocation].i64.x = subgroupMax(data[0].i64.x); - data[invocation].i64.xy = subgroupMax(data[1].i64.xy); - data[invocation].i64.xyz = subgroupMax(data[2].i64.xyz); - data[invocation].i64 = subgroupMax(data[3].i64); - - data[invocation].i64.x = subgroupAnd(data[0].i64.x); - data[invocation].i64.xy = subgroupAnd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupAnd(data[2].i64.xyz); - data[invocation].i64 = subgroupAnd(data[3].i64); - - data[invocation].i64.x = subgroupOr(data[0].i64.x); - data[invocation].i64.xy = subgroupOr(data[1].i64.xy); - data[invocation].i64.xyz = subgroupOr(data[2].i64.xyz); - data[invocation].i64 = subgroupOr(data[3].i64); - - data[invocation].i64.x = subgroupXor(data[0].i64.x); - data[invocation].i64.xy = subgroupXor(data[1].i64.xy); - data[invocation].i64.xyz = subgroupXor(data[2].i64.xyz); - data[invocation].i64 = subgroupXor(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveAdd(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveAdd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveAdd(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveAdd(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveMul(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveMul(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveMul(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveMul(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveMin(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveMin(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveMin(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveMin(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveMax(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveMax(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveMax(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveMax(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveAnd(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveAnd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveAnd(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveAnd(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveOr(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveOr(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveOr(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveOr(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveXor(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveXor(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveXor(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveXor(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveAdd(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveAdd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveAdd(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveAdd(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveMul(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveMul(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveMul(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveMul(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveMin(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveMin(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveMin(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveMin(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveMax(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveMax(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveMax(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveMax(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveAnd(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveAnd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveAnd(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveAnd(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveOr(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveOr(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveOr(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveOr(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveXor(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveXor(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveXor(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveXor(data[3].i64); - - data[invocation].u64.x = subgroupAdd(data[0].u64.x); - data[invocation].u64.xy = subgroupAdd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupAdd(data[2].u64.xyz); - data[invocation].u64 = subgroupAdd(data[3].u64); - - data[invocation].u64.x = subgroupMul(data[0].u64.x); - data[invocation].u64.xy = subgroupMul(data[1].u64.xy); - data[invocation].u64.xyz = subgroupMul(data[2].u64.xyz); - data[invocation].u64 = subgroupMul(data[3].u64); - - data[invocation].u64.x = subgroupMin(data[0].u64.x); - data[invocation].u64.xy = subgroupMin(data[1].u64.xy); - data[invocation].u64.xyz = subgroupMin(data[2].u64.xyz); - data[invocation].u64 = subgroupMin(data[3].u64); - - data[invocation].u64.x = subgroupMax(data[0].u64.x); - data[invocation].u64.xy = subgroupMax(data[1].u64.xy); - data[invocation].u64.xyz = subgroupMax(data[2].u64.xyz); - data[invocation].u64 = subgroupMax(data[3].u64); - - data[invocation].u64.x = subgroupAnd(data[0].u64.x); - data[invocation].u64.xy = subgroupAnd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupAnd(data[2].u64.xyz); - data[invocation].u64 = subgroupAnd(data[3].u64); - - data[invocation].u64.x = subgroupOr(data[0].u64.x); - data[invocation].u64.xy = subgroupOr(data[1].u64.xy); - data[invocation].u64.xyz = subgroupOr(data[2].u64.xyz); - data[invocation].u64 = subgroupOr(data[3].u64); - - data[invocation].u64.x = subgroupXor(data[0].u64.x); - data[invocation].u64.xy = subgroupXor(data[1].u64.xy); - data[invocation].u64.xyz = subgroupXor(data[2].u64.xyz); - data[invocation].u64 = subgroupXor(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveAdd(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveAdd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveAdd(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveAdd(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveMul(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveMul(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveMul(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveMul(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveMin(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveMin(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveMin(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveMin(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveMax(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveMax(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveMax(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveMax(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveAnd(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveAnd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveAnd(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveAnd(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveOr(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveOr(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveOr(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveOr(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveXor(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveXor(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveXor(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveXor(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveAdd(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveAdd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveAdd(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveAdd(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveMul(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveMul(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveMul(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveMul(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveMin(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveMin(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveMin(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveMin(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveMax(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveMax(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveMax(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveMax(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveAnd(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveAnd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveAnd(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveAnd(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveOr(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveOr(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveOr(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveOr(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveXor(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveXor(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveXor(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveXor(data[3].u64); - - data[invocation].f16.x = subgroupAdd(data[0].f16.x); - data[invocation].f16.xy = subgroupAdd(data[1].f16.xy); - data[invocation].f16.xyz = subgroupAdd(data[2].f16.xyz); - data[invocation].f16 = subgroupAdd(data[3].f16); - - data[invocation].f16.x = subgroupMul(data[0].f16.x); - data[invocation].f16.xy = subgroupMul(data[1].f16.xy); - data[invocation].f16.xyz = subgroupMul(data[2].f16.xyz); - data[invocation].f16 = subgroupMul(data[3].f16); - - data[invocation].f16.x = subgroupMin(data[0].f16.x); - data[invocation].f16.xy = subgroupMin(data[1].f16.xy); - data[invocation].f16.xyz = subgroupMin(data[2].f16.xyz); - data[invocation].f16 = subgroupMin(data[3].f16); - - data[invocation].f16.x = subgroupMax(data[0].f16.x); - data[invocation].f16.xy = subgroupMax(data[1].f16.xy); - data[invocation].f16.xyz = subgroupMax(data[2].f16.xyz); - data[invocation].f16 = subgroupMax(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveAdd(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveAdd(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveAdd(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveAdd(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveMul(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveMul(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveMul(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveMul(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveMin(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveMin(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveMin(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveMin(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveMax(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveMax(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveMax(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveMax(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveAdd(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveAdd(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveAdd(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveAdd(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveMul(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveMul(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveMul(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveMul(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveMin(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveMin(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveMin(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveMin(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveMax(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveMax(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveMax(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveMax(data[3].f16); -} +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupAdd(data[0].i8.x); + data[invocation].i8.xy = subgroupAdd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupAdd(data[2].i8.xyz); + data[invocation].i8 = subgroupAdd(data[3].i8); + + data[invocation].i8.x = subgroupMul(data[0].i8.x); + data[invocation].i8.xy = subgroupMul(data[1].i8.xy); + data[invocation].i8.xyz = subgroupMul(data[2].i8.xyz); + data[invocation].i8 = subgroupMul(data[3].i8); + + data[invocation].i8.x = subgroupMin(data[0].i8.x); + data[invocation].i8.xy = subgroupMin(data[1].i8.xy); + data[invocation].i8.xyz = subgroupMin(data[2].i8.xyz); + data[invocation].i8 = subgroupMin(data[3].i8); + + data[invocation].i8.x = subgroupMax(data[0].i8.x); + data[invocation].i8.xy = subgroupMax(data[1].i8.xy); + data[invocation].i8.xyz = subgroupMax(data[2].i8.xyz); + data[invocation].i8 = subgroupMax(data[3].i8); + + data[invocation].i8.x = subgroupAnd(data[0].i8.x); + data[invocation].i8.xy = subgroupAnd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupAnd(data[2].i8.xyz); + data[invocation].i8 = subgroupAnd(data[3].i8); + + data[invocation].i8.x = subgroupOr(data[0].i8.x); + data[invocation].i8.xy = subgroupOr(data[1].i8.xy); + data[invocation].i8.xyz = subgroupOr(data[2].i8.xyz); + data[invocation].i8 = subgroupOr(data[3].i8); + + data[invocation].i8.x = subgroupXor(data[0].i8.x); + data[invocation].i8.xy = subgroupXor(data[1].i8.xy); + data[invocation].i8.xyz = subgroupXor(data[2].i8.xyz); + data[invocation].i8 = subgroupXor(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveAdd(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveAdd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveAdd(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveAdd(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveMul(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveMul(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveMul(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveMul(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveMin(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveMin(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveMin(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveMin(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveMax(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveMax(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveMax(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveMax(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveAnd(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveAnd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveAnd(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveAnd(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveOr(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveOr(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveOr(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveOr(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveXor(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveXor(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveXor(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveXor(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveAdd(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveAdd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveAdd(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveAdd(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveMul(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveMul(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveMul(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveMul(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveMin(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveMin(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveMin(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveMin(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveMax(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveMax(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveMax(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveMax(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveAnd(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveAnd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveAnd(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveAnd(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveOr(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveOr(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveOr(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveOr(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveXor(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveXor(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveXor(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveXor(data[3].i8); + + data[invocation].u8.x = subgroupAdd(data[0].u8.x); + data[invocation].u8.xy = subgroupAdd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupAdd(data[2].u8.xyz); + data[invocation].u8 = subgroupAdd(data[3].u8); + + data[invocation].u8.x = subgroupMul(data[0].u8.x); + data[invocation].u8.xy = subgroupMul(data[1].u8.xy); + data[invocation].u8.xyz = subgroupMul(data[2].u8.xyz); + data[invocation].u8 = subgroupMul(data[3].u8); + + data[invocation].u8.x = subgroupMin(data[0].u8.x); + data[invocation].u8.xy = subgroupMin(data[1].u8.xy); + data[invocation].u8.xyz = subgroupMin(data[2].u8.xyz); + data[invocation].u8 = subgroupMin(data[3].u8); + + data[invocation].u8.x = subgroupMax(data[0].u8.x); + data[invocation].u8.xy = subgroupMax(data[1].u8.xy); + data[invocation].u8.xyz = subgroupMax(data[2].u8.xyz); + data[invocation].u8 = subgroupMax(data[3].u8); + + data[invocation].u8.x = subgroupAnd(data[0].u8.x); + data[invocation].u8.xy = subgroupAnd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupAnd(data[2].u8.xyz); + data[invocation].u8 = subgroupAnd(data[3].u8); + + data[invocation].u8.x = subgroupOr(data[0].u8.x); + data[invocation].u8.xy = subgroupOr(data[1].u8.xy); + data[invocation].u8.xyz = subgroupOr(data[2].u8.xyz); + data[invocation].u8 = subgroupOr(data[3].u8); + + data[invocation].u8.x = subgroupXor(data[0].u8.x); + data[invocation].u8.xy = subgroupXor(data[1].u8.xy); + data[invocation].u8.xyz = subgroupXor(data[2].u8.xyz); + data[invocation].u8 = subgroupXor(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveAdd(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveAdd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveAdd(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveAdd(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveMul(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveMul(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveMul(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveMul(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveMin(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveMin(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveMin(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveMin(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveMax(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveMax(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveMax(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveMax(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveAnd(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveAnd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveAnd(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveAnd(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveOr(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveOr(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveOr(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveOr(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveXor(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveXor(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveXor(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveXor(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveAdd(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveAdd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveAdd(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveAdd(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveMul(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveMul(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveMul(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveMul(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveMin(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveMin(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveMin(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveMin(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveMax(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveMax(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveMax(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveMax(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveAnd(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveAnd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveAnd(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveAnd(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveOr(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveOr(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveOr(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveOr(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveXor(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveXor(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveXor(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveXor(data[3].u8); + + data[invocation].i16.x = subgroupAdd(data[0].i16.x); + data[invocation].i16.xy = subgroupAdd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupAdd(data[2].i16.xyz); + data[invocation].i16 = subgroupAdd(data[3].i16); + + data[invocation].i16.x = subgroupMul(data[0].i16.x); + data[invocation].i16.xy = subgroupMul(data[1].i16.xy); + data[invocation].i16.xyz = subgroupMul(data[2].i16.xyz); + data[invocation].i16 = subgroupMul(data[3].i16); + + data[invocation].i16.x = subgroupMin(data[0].i16.x); + data[invocation].i16.xy = subgroupMin(data[1].i16.xy); + data[invocation].i16.xyz = subgroupMin(data[2].i16.xyz); + data[invocation].i16 = subgroupMin(data[3].i16); + + data[invocation].i16.x = subgroupMax(data[0].i16.x); + data[invocation].i16.xy = subgroupMax(data[1].i16.xy); + data[invocation].i16.xyz = subgroupMax(data[2].i16.xyz); + data[invocation].i16 = subgroupMax(data[3].i16); + + data[invocation].i16.x = subgroupAnd(data[0].i16.x); + data[invocation].i16.xy = subgroupAnd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupAnd(data[2].i16.xyz); + data[invocation].i16 = subgroupAnd(data[3].i16); + + data[invocation].i16.x = subgroupOr(data[0].i16.x); + data[invocation].i16.xy = subgroupOr(data[1].i16.xy); + data[invocation].i16.xyz = subgroupOr(data[2].i16.xyz); + data[invocation].i16 = subgroupOr(data[3].i16); + + data[invocation].i16.x = subgroupXor(data[0].i16.x); + data[invocation].i16.xy = subgroupXor(data[1].i16.xy); + data[invocation].i16.xyz = subgroupXor(data[2].i16.xyz); + data[invocation].i16 = subgroupXor(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveAdd(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveAdd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveAdd(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveAdd(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveMul(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveMul(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveMul(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveMul(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveMin(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveMin(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveMin(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveMin(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveMax(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveMax(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveMax(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveMax(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveAnd(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveAnd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveAnd(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveAnd(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveOr(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveOr(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveOr(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveOr(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveXor(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveXor(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveXor(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveXor(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveAdd(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveAdd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveAdd(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveAdd(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveMul(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveMul(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveMul(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveMul(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveMin(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveMin(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveMin(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveMin(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveMax(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveMax(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveMax(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveMax(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveAnd(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveAnd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveAnd(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveAnd(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveOr(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveOr(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveOr(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveOr(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveXor(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveXor(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveXor(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveXor(data[3].i16); + + data[invocation].u16.x = subgroupAdd(data[0].u16.x); + data[invocation].u16.xy = subgroupAdd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupAdd(data[2].u16.xyz); + data[invocation].u16 = subgroupAdd(data[3].u16); + + data[invocation].u16.x = subgroupMul(data[0].u16.x); + data[invocation].u16.xy = subgroupMul(data[1].u16.xy); + data[invocation].u16.xyz = subgroupMul(data[2].u16.xyz); + data[invocation].u16 = subgroupMul(data[3].u16); + + data[invocation].u16.x = subgroupMin(data[0].u16.x); + data[invocation].u16.xy = subgroupMin(data[1].u16.xy); + data[invocation].u16.xyz = subgroupMin(data[2].u16.xyz); + data[invocation].u16 = subgroupMin(data[3].u16); + + data[invocation].u16.x = subgroupMax(data[0].u16.x); + data[invocation].u16.xy = subgroupMax(data[1].u16.xy); + data[invocation].u16.xyz = subgroupMax(data[2].u16.xyz); + data[invocation].u16 = subgroupMax(data[3].u16); + + data[invocation].u16.x = subgroupAnd(data[0].u16.x); + data[invocation].u16.xy = subgroupAnd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupAnd(data[2].u16.xyz); + data[invocation].u16 = subgroupAnd(data[3].u16); + + data[invocation].u16.x = subgroupOr(data[0].u16.x); + data[invocation].u16.xy = subgroupOr(data[1].u16.xy); + data[invocation].u16.xyz = subgroupOr(data[2].u16.xyz); + data[invocation].u16 = subgroupOr(data[3].u16); + + data[invocation].u16.x = subgroupXor(data[0].u16.x); + data[invocation].u16.xy = subgroupXor(data[1].u16.xy); + data[invocation].u16.xyz = subgroupXor(data[2].u16.xyz); + data[invocation].u16 = subgroupXor(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveAdd(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveAdd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveAdd(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveAdd(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveMul(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveMul(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveMul(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveMul(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveMin(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveMin(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveMin(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveMin(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveMax(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveMax(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveMax(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveMax(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveAnd(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveAnd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveAnd(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveAnd(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveOr(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveOr(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveOr(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveOr(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveXor(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveXor(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveXor(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveXor(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveAdd(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveAdd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveAdd(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveAdd(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveMul(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveMul(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveMul(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveMul(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveMin(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveMin(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveMin(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveMin(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveMax(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveMax(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveMax(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveMax(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveAnd(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveAnd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveAnd(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveAnd(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveOr(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveOr(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveOr(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveOr(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveXor(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveXor(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveXor(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveXor(data[3].u16); + + data[invocation].i64.x = subgroupAdd(data[0].i64.x); + data[invocation].i64.xy = subgroupAdd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupAdd(data[2].i64.xyz); + data[invocation].i64 = subgroupAdd(data[3].i64); + + data[invocation].i64.x = subgroupMul(data[0].i64.x); + data[invocation].i64.xy = subgroupMul(data[1].i64.xy); + data[invocation].i64.xyz = subgroupMul(data[2].i64.xyz); + data[invocation].i64 = subgroupMul(data[3].i64); + + data[invocation].i64.x = subgroupMin(data[0].i64.x); + data[invocation].i64.xy = subgroupMin(data[1].i64.xy); + data[invocation].i64.xyz = subgroupMin(data[2].i64.xyz); + data[invocation].i64 = subgroupMin(data[3].i64); + + data[invocation].i64.x = subgroupMax(data[0].i64.x); + data[invocation].i64.xy = subgroupMax(data[1].i64.xy); + data[invocation].i64.xyz = subgroupMax(data[2].i64.xyz); + data[invocation].i64 = subgroupMax(data[3].i64); + + data[invocation].i64.x = subgroupAnd(data[0].i64.x); + data[invocation].i64.xy = subgroupAnd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupAnd(data[2].i64.xyz); + data[invocation].i64 = subgroupAnd(data[3].i64); + + data[invocation].i64.x = subgroupOr(data[0].i64.x); + data[invocation].i64.xy = subgroupOr(data[1].i64.xy); + data[invocation].i64.xyz = subgroupOr(data[2].i64.xyz); + data[invocation].i64 = subgroupOr(data[3].i64); + + data[invocation].i64.x = subgroupXor(data[0].i64.x); + data[invocation].i64.xy = subgroupXor(data[1].i64.xy); + data[invocation].i64.xyz = subgroupXor(data[2].i64.xyz); + data[invocation].i64 = subgroupXor(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveAdd(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveAdd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveAdd(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveAdd(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveMul(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveMul(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveMul(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveMul(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveMin(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveMin(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveMin(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveMin(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveMax(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveMax(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveMax(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveMax(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveAnd(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveAnd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveAnd(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveAnd(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveOr(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveOr(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveOr(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveOr(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveXor(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveXor(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveXor(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveXor(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveAdd(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveAdd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveAdd(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveAdd(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveMul(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveMul(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveMul(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveMul(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveMin(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveMin(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveMin(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveMin(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveMax(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveMax(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveMax(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveMax(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveAnd(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveAnd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveAnd(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveAnd(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveOr(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveOr(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveOr(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveOr(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveXor(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveXor(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveXor(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveXor(data[3].i64); + + data[invocation].u64.x = subgroupAdd(data[0].u64.x); + data[invocation].u64.xy = subgroupAdd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupAdd(data[2].u64.xyz); + data[invocation].u64 = subgroupAdd(data[3].u64); + + data[invocation].u64.x = subgroupMul(data[0].u64.x); + data[invocation].u64.xy = subgroupMul(data[1].u64.xy); + data[invocation].u64.xyz = subgroupMul(data[2].u64.xyz); + data[invocation].u64 = subgroupMul(data[3].u64); + + data[invocation].u64.x = subgroupMin(data[0].u64.x); + data[invocation].u64.xy = subgroupMin(data[1].u64.xy); + data[invocation].u64.xyz = subgroupMin(data[2].u64.xyz); + data[invocation].u64 = subgroupMin(data[3].u64); + + data[invocation].u64.x = subgroupMax(data[0].u64.x); + data[invocation].u64.xy = subgroupMax(data[1].u64.xy); + data[invocation].u64.xyz = subgroupMax(data[2].u64.xyz); + data[invocation].u64 = subgroupMax(data[3].u64); + + data[invocation].u64.x = subgroupAnd(data[0].u64.x); + data[invocation].u64.xy = subgroupAnd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupAnd(data[2].u64.xyz); + data[invocation].u64 = subgroupAnd(data[3].u64); + + data[invocation].u64.x = subgroupOr(data[0].u64.x); + data[invocation].u64.xy = subgroupOr(data[1].u64.xy); + data[invocation].u64.xyz = subgroupOr(data[2].u64.xyz); + data[invocation].u64 = subgroupOr(data[3].u64); + + data[invocation].u64.x = subgroupXor(data[0].u64.x); + data[invocation].u64.xy = subgroupXor(data[1].u64.xy); + data[invocation].u64.xyz = subgroupXor(data[2].u64.xyz); + data[invocation].u64 = subgroupXor(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveAdd(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveAdd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveAdd(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveAdd(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveMul(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveMul(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveMul(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveMul(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveMin(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveMin(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveMin(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveMin(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveMax(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveMax(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveMax(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveMax(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveAnd(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveAnd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveAnd(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveAnd(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveOr(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveOr(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveOr(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveOr(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveXor(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveXor(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveXor(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveXor(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveAdd(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveAdd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveAdd(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveAdd(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveMul(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveMul(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveMul(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveMul(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveMin(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveMin(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveMin(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveMin(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveMax(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveMax(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveMax(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveMax(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveAnd(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveAnd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveAnd(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveAnd(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveOr(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveOr(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveOr(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveOr(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveXor(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveXor(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveXor(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveXor(data[3].u64); + + data[invocation].f16.x = subgroupAdd(data[0].f16.x); + data[invocation].f16.xy = subgroupAdd(data[1].f16.xy); + data[invocation].f16.xyz = subgroupAdd(data[2].f16.xyz); + data[invocation].f16 = subgroupAdd(data[3].f16); + + data[invocation].f16.x = subgroupMul(data[0].f16.x); + data[invocation].f16.xy = subgroupMul(data[1].f16.xy); + data[invocation].f16.xyz = subgroupMul(data[2].f16.xyz); + data[invocation].f16 = subgroupMul(data[3].f16); + + data[invocation].f16.x = subgroupMin(data[0].f16.x); + data[invocation].f16.xy = subgroupMin(data[1].f16.xy); + data[invocation].f16.xyz = subgroupMin(data[2].f16.xyz); + data[invocation].f16 = subgroupMin(data[3].f16); + + data[invocation].f16.x = subgroupMax(data[0].f16.x); + data[invocation].f16.xy = subgroupMax(data[1].f16.xy); + data[invocation].f16.xyz = subgroupMax(data[2].f16.xyz); + data[invocation].f16 = subgroupMax(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveAdd(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveAdd(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveAdd(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveAdd(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveMul(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveMul(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveMul(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveMul(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveMin(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveMin(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveMin(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveMin(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveMax(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveMax(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveMax(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveMax(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveAdd(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveAdd(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveAdd(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveAdd(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveMul(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveMul(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveMul(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveMul(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveMin(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveMin(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveMin(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveMin(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveMax(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveMax(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveMax(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveMax(data[3].f16); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmeticNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmeticNeg.comp index 8523cbab2..eb22cabfb 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmeticNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesArithmeticNeg.comp @@ -1,715 +1,715 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_arithmetic: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupAdd(data[0].i8.x); - data[invocation].i8.xy = subgroupAdd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupAdd(data[2].i8.xyz); - data[invocation].i8 = subgroupAdd(data[3].i8); - - data[invocation].i8.x = subgroupMul(data[0].i8.x); - data[invocation].i8.xy = subgroupMul(data[1].i8.xy); - data[invocation].i8.xyz = subgroupMul(data[2].i8.xyz); - data[invocation].i8 = subgroupMul(data[3].i8); - - data[invocation].i8.x = subgroupMin(data[0].i8.x); - data[invocation].i8.xy = subgroupMin(data[1].i8.xy); - data[invocation].i8.xyz = subgroupMin(data[2].i8.xyz); - data[invocation].i8 = subgroupMin(data[3].i8); - - data[invocation].i8.x = subgroupMax(data[0].i8.x); - data[invocation].i8.xy = subgroupMax(data[1].i8.xy); - data[invocation].i8.xyz = subgroupMax(data[2].i8.xyz); - data[invocation].i8 = subgroupMax(data[3].i8); - - data[invocation].i8.x = subgroupAnd(data[0].i8.x); - data[invocation].i8.xy = subgroupAnd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupAnd(data[2].i8.xyz); - data[invocation].i8 = subgroupAnd(data[3].i8); - - data[invocation].i8.x = subgroupOr(data[0].i8.x); - data[invocation].i8.xy = subgroupOr(data[1].i8.xy); - data[invocation].i8.xyz = subgroupOr(data[2].i8.xyz); - data[invocation].i8 = subgroupOr(data[3].i8); - - data[invocation].i8.x = subgroupXor(data[0].i8.x); - data[invocation].i8.xy = subgroupXor(data[1].i8.xy); - data[invocation].i8.xyz = subgroupXor(data[2].i8.xyz); - data[invocation].i8 = subgroupXor(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveAdd(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveAdd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveAdd(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveAdd(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveMul(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveMul(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveMul(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveMul(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveMin(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveMin(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveMin(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveMin(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveMax(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveMax(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveMax(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveMax(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveAnd(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveAnd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveAnd(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveAnd(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveOr(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveOr(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveOr(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveOr(data[3].i8); - - data[invocation].i8.x = subgroupInclusiveXor(data[0].i8.x); - data[invocation].i8.xy = subgroupInclusiveXor(data[1].i8.xy); - data[invocation].i8.xyz = subgroupInclusiveXor(data[2].i8.xyz); - data[invocation].i8 = subgroupInclusiveXor(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveAdd(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveAdd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveAdd(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveAdd(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveMul(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveMul(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveMul(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveMul(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveMin(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveMin(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveMin(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveMin(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveMax(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveMax(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveMax(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveMax(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveAnd(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveAnd(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveAnd(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveAnd(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveOr(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveOr(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveOr(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveOr(data[3].i8); - - data[invocation].i8.x = subgroupExclusiveXor(data[0].i8.x); - data[invocation].i8.xy = subgroupExclusiveXor(data[1].i8.xy); - data[invocation].i8.xyz = subgroupExclusiveXor(data[2].i8.xyz); - data[invocation].i8 = subgroupExclusiveXor(data[3].i8); - - data[invocation].u8.x = subgroupAdd(data[0].u8.x); - data[invocation].u8.xy = subgroupAdd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupAdd(data[2].u8.xyz); - data[invocation].u8 = subgroupAdd(data[3].u8); - - data[invocation].u8.x = subgroupMul(data[0].u8.x); - data[invocation].u8.xy = subgroupMul(data[1].u8.xy); - data[invocation].u8.xyz = subgroupMul(data[2].u8.xyz); - data[invocation].u8 = subgroupMul(data[3].u8); - - data[invocation].u8.x = subgroupMin(data[0].u8.x); - data[invocation].u8.xy = subgroupMin(data[1].u8.xy); - data[invocation].u8.xyz = subgroupMin(data[2].u8.xyz); - data[invocation].u8 = subgroupMin(data[3].u8); - - data[invocation].u8.x = subgroupMax(data[0].u8.x); - data[invocation].u8.xy = subgroupMax(data[1].u8.xy); - data[invocation].u8.xyz = subgroupMax(data[2].u8.xyz); - data[invocation].u8 = subgroupMax(data[3].u8); - - data[invocation].u8.x = subgroupAnd(data[0].u8.x); - data[invocation].u8.xy = subgroupAnd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupAnd(data[2].u8.xyz); - data[invocation].u8 = subgroupAnd(data[3].u8); - - data[invocation].u8.x = subgroupOr(data[0].u8.x); - data[invocation].u8.xy = subgroupOr(data[1].u8.xy); - data[invocation].u8.xyz = subgroupOr(data[2].u8.xyz); - data[invocation].u8 = subgroupOr(data[3].u8); - - data[invocation].u8.x = subgroupXor(data[0].u8.x); - data[invocation].u8.xy = subgroupXor(data[1].u8.xy); - data[invocation].u8.xyz = subgroupXor(data[2].u8.xyz); - data[invocation].u8 = subgroupXor(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveAdd(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveAdd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveAdd(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveAdd(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveMul(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveMul(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveMul(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveMul(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveMin(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveMin(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveMin(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveMin(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveMax(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveMax(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveMax(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveMax(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveAnd(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveAnd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveAnd(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveAnd(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveOr(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveOr(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveOr(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveOr(data[3].u8); - - data[invocation].u8.x = subgroupInclusiveXor(data[0].u8.x); - data[invocation].u8.xy = subgroupInclusiveXor(data[1].u8.xy); - data[invocation].u8.xyz = subgroupInclusiveXor(data[2].u8.xyz); - data[invocation].u8 = subgroupInclusiveXor(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveAdd(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveAdd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveAdd(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveAdd(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveMul(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveMul(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveMul(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveMul(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveMin(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveMin(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveMin(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveMin(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveMax(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveMax(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveMax(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveMax(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveAnd(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveAnd(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveAnd(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveAnd(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveOr(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveOr(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveOr(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveOr(data[3].u8); - - data[invocation].u8.x = subgroupExclusiveXor(data[0].u8.x); - data[invocation].u8.xy = subgroupExclusiveXor(data[1].u8.xy); - data[invocation].u8.xyz = subgroupExclusiveXor(data[2].u8.xyz); - data[invocation].u8 = subgroupExclusiveXor(data[3].u8); - - data[invocation].i16.x = subgroupAdd(data[0].i16.x); - data[invocation].i16.xy = subgroupAdd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupAdd(data[2].i16.xyz); - data[invocation].i16 = subgroupAdd(data[3].i16); - - data[invocation].i16.x = subgroupMul(data[0].i16.x); - data[invocation].i16.xy = subgroupMul(data[1].i16.xy); - data[invocation].i16.xyz = subgroupMul(data[2].i16.xyz); - data[invocation].i16 = subgroupMul(data[3].i16); - - data[invocation].i16.x = subgroupMin(data[0].i16.x); - data[invocation].i16.xy = subgroupMin(data[1].i16.xy); - data[invocation].i16.xyz = subgroupMin(data[2].i16.xyz); - data[invocation].i16 = subgroupMin(data[3].i16); - - data[invocation].i16.x = subgroupMax(data[0].i16.x); - data[invocation].i16.xy = subgroupMax(data[1].i16.xy); - data[invocation].i16.xyz = subgroupMax(data[2].i16.xyz); - data[invocation].i16 = subgroupMax(data[3].i16); - - data[invocation].i16.x = subgroupAnd(data[0].i16.x); - data[invocation].i16.xy = subgroupAnd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupAnd(data[2].i16.xyz); - data[invocation].i16 = subgroupAnd(data[3].i16); - - data[invocation].i16.x = subgroupOr(data[0].i16.x); - data[invocation].i16.xy = subgroupOr(data[1].i16.xy); - data[invocation].i16.xyz = subgroupOr(data[2].i16.xyz); - data[invocation].i16 = subgroupOr(data[3].i16); - - data[invocation].i16.x = subgroupXor(data[0].i16.x); - data[invocation].i16.xy = subgroupXor(data[1].i16.xy); - data[invocation].i16.xyz = subgroupXor(data[2].i16.xyz); - data[invocation].i16 = subgroupXor(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveAdd(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveAdd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveAdd(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveAdd(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveMul(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveMul(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveMul(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveMul(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveMin(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveMin(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveMin(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveMin(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveMax(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveMax(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveMax(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveMax(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveAnd(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveAnd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveAnd(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveAnd(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveOr(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveOr(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveOr(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveOr(data[3].i16); - - data[invocation].i16.x = subgroupInclusiveXor(data[0].i16.x); - data[invocation].i16.xy = subgroupInclusiveXor(data[1].i16.xy); - data[invocation].i16.xyz = subgroupInclusiveXor(data[2].i16.xyz); - data[invocation].i16 = subgroupInclusiveXor(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveAdd(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveAdd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveAdd(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveAdd(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveMul(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveMul(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveMul(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveMul(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveMin(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveMin(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveMin(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveMin(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveMax(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveMax(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveMax(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveMax(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveAnd(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveAnd(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveAnd(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveAnd(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveOr(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveOr(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveOr(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveOr(data[3].i16); - - data[invocation].i16.x = subgroupExclusiveXor(data[0].i16.x); - data[invocation].i16.xy = subgroupExclusiveXor(data[1].i16.xy); - data[invocation].i16.xyz = subgroupExclusiveXor(data[2].i16.xyz); - data[invocation].i16 = subgroupExclusiveXor(data[3].i16); - - data[invocation].u16.x = subgroupAdd(data[0].u16.x); - data[invocation].u16.xy = subgroupAdd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupAdd(data[2].u16.xyz); - data[invocation].u16 = subgroupAdd(data[3].u16); - - data[invocation].u16.x = subgroupMul(data[0].u16.x); - data[invocation].u16.xy = subgroupMul(data[1].u16.xy); - data[invocation].u16.xyz = subgroupMul(data[2].u16.xyz); - data[invocation].u16 = subgroupMul(data[3].u16); - - data[invocation].u16.x = subgroupMin(data[0].u16.x); - data[invocation].u16.xy = subgroupMin(data[1].u16.xy); - data[invocation].u16.xyz = subgroupMin(data[2].u16.xyz); - data[invocation].u16 = subgroupMin(data[3].u16); - - data[invocation].u16.x = subgroupMax(data[0].u16.x); - data[invocation].u16.xy = subgroupMax(data[1].u16.xy); - data[invocation].u16.xyz = subgroupMax(data[2].u16.xyz); - data[invocation].u16 = subgroupMax(data[3].u16); - - data[invocation].u16.x = subgroupAnd(data[0].u16.x); - data[invocation].u16.xy = subgroupAnd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupAnd(data[2].u16.xyz); - data[invocation].u16 = subgroupAnd(data[3].u16); - - data[invocation].u16.x = subgroupOr(data[0].u16.x); - data[invocation].u16.xy = subgroupOr(data[1].u16.xy); - data[invocation].u16.xyz = subgroupOr(data[2].u16.xyz); - data[invocation].u16 = subgroupOr(data[3].u16); - - data[invocation].u16.x = subgroupXor(data[0].u16.x); - data[invocation].u16.xy = subgroupXor(data[1].u16.xy); - data[invocation].u16.xyz = subgroupXor(data[2].u16.xyz); - data[invocation].u16 = subgroupXor(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveAdd(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveAdd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveAdd(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveAdd(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveMul(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveMul(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveMul(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveMul(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveMin(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveMin(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveMin(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveMin(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveMax(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveMax(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveMax(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveMax(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveAnd(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveAnd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveAnd(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveAnd(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveOr(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveOr(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveOr(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveOr(data[3].u16); - - data[invocation].u16.x = subgroupInclusiveXor(data[0].u16.x); - data[invocation].u16.xy = subgroupInclusiveXor(data[1].u16.xy); - data[invocation].u16.xyz = subgroupInclusiveXor(data[2].u16.xyz); - data[invocation].u16 = subgroupInclusiveXor(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveAdd(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveAdd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveAdd(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveAdd(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveMul(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveMul(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveMul(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveMul(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveMin(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveMin(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveMin(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveMin(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveMax(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveMax(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveMax(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveMax(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveAnd(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveAnd(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveAnd(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveAnd(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveOr(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveOr(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveOr(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveOr(data[3].u16); - - data[invocation].u16.x = subgroupExclusiveXor(data[0].u16.x); - data[invocation].u16.xy = subgroupExclusiveXor(data[1].u16.xy); - data[invocation].u16.xyz = subgroupExclusiveXor(data[2].u16.xyz); - data[invocation].u16 = subgroupExclusiveXor(data[3].u16); - - data[invocation].i64.x = subgroupAdd(data[0].i64.x); - data[invocation].i64.xy = subgroupAdd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupAdd(data[2].i64.xyz); - data[invocation].i64 = subgroupAdd(data[3].i64); - - data[invocation].i64.x = subgroupMul(data[0].i64.x); - data[invocation].i64.xy = subgroupMul(data[1].i64.xy); - data[invocation].i64.xyz = subgroupMul(data[2].i64.xyz); - data[invocation].i64 = subgroupMul(data[3].i64); - - data[invocation].i64.x = subgroupMin(data[0].i64.x); - data[invocation].i64.xy = subgroupMin(data[1].i64.xy); - data[invocation].i64.xyz = subgroupMin(data[2].i64.xyz); - data[invocation].i64 = subgroupMin(data[3].i64); - - data[invocation].i64.x = subgroupMax(data[0].i64.x); - data[invocation].i64.xy = subgroupMax(data[1].i64.xy); - data[invocation].i64.xyz = subgroupMax(data[2].i64.xyz); - data[invocation].i64 = subgroupMax(data[3].i64); - - data[invocation].i64.x = subgroupAnd(data[0].i64.x); - data[invocation].i64.xy = subgroupAnd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupAnd(data[2].i64.xyz); - data[invocation].i64 = subgroupAnd(data[3].i64); - - data[invocation].i64.x = subgroupOr(data[0].i64.x); - data[invocation].i64.xy = subgroupOr(data[1].i64.xy); - data[invocation].i64.xyz = subgroupOr(data[2].i64.xyz); - data[invocation].i64 = subgroupOr(data[3].i64); - - data[invocation].i64.x = subgroupXor(data[0].i64.x); - data[invocation].i64.xy = subgroupXor(data[1].i64.xy); - data[invocation].i64.xyz = subgroupXor(data[2].i64.xyz); - data[invocation].i64 = subgroupXor(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveAdd(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveAdd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveAdd(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveAdd(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveMul(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveMul(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveMul(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveMul(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveMin(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveMin(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveMin(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveMin(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveMax(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveMax(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveMax(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveMax(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveAnd(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveAnd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveAnd(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveAnd(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveOr(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveOr(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveOr(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveOr(data[3].i64); - - data[invocation].i64.x = subgroupInclusiveXor(data[0].i64.x); - data[invocation].i64.xy = subgroupInclusiveXor(data[1].i64.xy); - data[invocation].i64.xyz = subgroupInclusiveXor(data[2].i64.xyz); - data[invocation].i64 = subgroupInclusiveXor(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveAdd(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveAdd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveAdd(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveAdd(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveMul(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveMul(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveMul(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveMul(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveMin(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveMin(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveMin(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveMin(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveMax(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveMax(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveMax(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveMax(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveAnd(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveAnd(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveAnd(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveAnd(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveOr(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveOr(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveOr(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveOr(data[3].i64); - - data[invocation].i64.x = subgroupExclusiveXor(data[0].i64.x); - data[invocation].i64.xy = subgroupExclusiveXor(data[1].i64.xy); - data[invocation].i64.xyz = subgroupExclusiveXor(data[2].i64.xyz); - data[invocation].i64 = subgroupExclusiveXor(data[3].i64); - - data[invocation].u64.x = subgroupAdd(data[0].u64.x); - data[invocation].u64.xy = subgroupAdd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupAdd(data[2].u64.xyz); - data[invocation].u64 = subgroupAdd(data[3].u64); - - data[invocation].u64.x = subgroupMul(data[0].u64.x); - data[invocation].u64.xy = subgroupMul(data[1].u64.xy); - data[invocation].u64.xyz = subgroupMul(data[2].u64.xyz); - data[invocation].u64 = subgroupMul(data[3].u64); - - data[invocation].u64.x = subgroupMin(data[0].u64.x); - data[invocation].u64.xy = subgroupMin(data[1].u64.xy); - data[invocation].u64.xyz = subgroupMin(data[2].u64.xyz); - data[invocation].u64 = subgroupMin(data[3].u64); - - data[invocation].u64.x = subgroupMax(data[0].u64.x); - data[invocation].u64.xy = subgroupMax(data[1].u64.xy); - data[invocation].u64.xyz = subgroupMax(data[2].u64.xyz); - data[invocation].u64 = subgroupMax(data[3].u64); - - data[invocation].u64.x = subgroupAnd(data[0].u64.x); - data[invocation].u64.xy = subgroupAnd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupAnd(data[2].u64.xyz); - data[invocation].u64 = subgroupAnd(data[3].u64); - - data[invocation].u64.x = subgroupOr(data[0].u64.x); - data[invocation].u64.xy = subgroupOr(data[1].u64.xy); - data[invocation].u64.xyz = subgroupOr(data[2].u64.xyz); - data[invocation].u64 = subgroupOr(data[3].u64); - - data[invocation].u64.x = subgroupXor(data[0].u64.x); - data[invocation].u64.xy = subgroupXor(data[1].u64.xy); - data[invocation].u64.xyz = subgroupXor(data[2].u64.xyz); - data[invocation].u64 = subgroupXor(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveAdd(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveAdd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveAdd(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveAdd(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveMul(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveMul(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveMul(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveMul(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveMin(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveMin(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveMin(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveMin(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveMax(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveMax(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveMax(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveMax(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveAnd(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveAnd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveAnd(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveAnd(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveOr(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveOr(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveOr(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveOr(data[3].u64); - - data[invocation].u64.x = subgroupInclusiveXor(data[0].u64.x); - data[invocation].u64.xy = subgroupInclusiveXor(data[1].u64.xy); - data[invocation].u64.xyz = subgroupInclusiveXor(data[2].u64.xyz); - data[invocation].u64 = subgroupInclusiveXor(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveAdd(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveAdd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveAdd(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveAdd(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveMul(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveMul(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveMul(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveMul(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveMin(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveMin(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveMin(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveMin(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveMax(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveMax(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveMax(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveMax(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveAnd(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveAnd(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveAnd(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveAnd(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveOr(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveOr(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveOr(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveOr(data[3].u64); - - data[invocation].u64.x = subgroupExclusiveXor(data[0].u64.x); - data[invocation].u64.xy = subgroupExclusiveXor(data[1].u64.xy); - data[invocation].u64.xyz = subgroupExclusiveXor(data[2].u64.xyz); - data[invocation].u64 = subgroupExclusiveXor(data[3].u64); - - data[invocation].f16.x = subgroupAdd(data[0].f16.x); - data[invocation].f16.xy = subgroupAdd(data[1].f16.xy); - data[invocation].f16.xyz = subgroupAdd(data[2].f16.xyz); - data[invocation].f16 = subgroupAdd(data[3].f16); - - data[invocation].f16.x = subgroupMul(data[0].f16.x); - data[invocation].f16.xy = subgroupMul(data[1].f16.xy); - data[invocation].f16.xyz = subgroupMul(data[2].f16.xyz); - data[invocation].f16 = subgroupMul(data[3].f16); - - data[invocation].f16.x = subgroupMin(data[0].f16.x); - data[invocation].f16.xy = subgroupMin(data[1].f16.xy); - data[invocation].f16.xyz = subgroupMin(data[2].f16.xyz); - data[invocation].f16 = subgroupMin(data[3].f16); - - data[invocation].f16.x = subgroupMax(data[0].f16.x); - data[invocation].f16.xy = subgroupMax(data[1].f16.xy); - data[invocation].f16.xyz = subgroupMax(data[2].f16.xyz); - data[invocation].f16 = subgroupMax(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveAdd(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveAdd(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveAdd(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveAdd(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveMul(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveMul(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveMul(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveMul(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveMin(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveMin(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveMin(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveMin(data[3].f16); - - data[invocation].f16.x = subgroupInclusiveMax(data[0].f16.x); - data[invocation].f16.xy = subgroupInclusiveMax(data[1].f16.xy); - data[invocation].f16.xyz = subgroupInclusiveMax(data[2].f16.xyz); - data[invocation].f16 = subgroupInclusiveMax(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveAdd(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveAdd(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveAdd(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveAdd(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveMul(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveMul(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveMul(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveMul(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveMin(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveMin(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveMin(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveMin(data[3].f16); - - data[invocation].f16.x = subgroupExclusiveMax(data[0].f16.x); - data[invocation].f16.xy = subgroupExclusiveMax(data[1].f16.xy); - data[invocation].f16.xyz = subgroupExclusiveMax(data[2].f16.xyz); - data[invocation].f16 = subgroupExclusiveMax(data[3].f16); -} +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupAdd(data[0].i8.x); + data[invocation].i8.xy = subgroupAdd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupAdd(data[2].i8.xyz); + data[invocation].i8 = subgroupAdd(data[3].i8); + + data[invocation].i8.x = subgroupMul(data[0].i8.x); + data[invocation].i8.xy = subgroupMul(data[1].i8.xy); + data[invocation].i8.xyz = subgroupMul(data[2].i8.xyz); + data[invocation].i8 = subgroupMul(data[3].i8); + + data[invocation].i8.x = subgroupMin(data[0].i8.x); + data[invocation].i8.xy = subgroupMin(data[1].i8.xy); + data[invocation].i8.xyz = subgroupMin(data[2].i8.xyz); + data[invocation].i8 = subgroupMin(data[3].i8); + + data[invocation].i8.x = subgroupMax(data[0].i8.x); + data[invocation].i8.xy = subgroupMax(data[1].i8.xy); + data[invocation].i8.xyz = subgroupMax(data[2].i8.xyz); + data[invocation].i8 = subgroupMax(data[3].i8); + + data[invocation].i8.x = subgroupAnd(data[0].i8.x); + data[invocation].i8.xy = subgroupAnd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupAnd(data[2].i8.xyz); + data[invocation].i8 = subgroupAnd(data[3].i8); + + data[invocation].i8.x = subgroupOr(data[0].i8.x); + data[invocation].i8.xy = subgroupOr(data[1].i8.xy); + data[invocation].i8.xyz = subgroupOr(data[2].i8.xyz); + data[invocation].i8 = subgroupOr(data[3].i8); + + data[invocation].i8.x = subgroupXor(data[0].i8.x); + data[invocation].i8.xy = subgroupXor(data[1].i8.xy); + data[invocation].i8.xyz = subgroupXor(data[2].i8.xyz); + data[invocation].i8 = subgroupXor(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveAdd(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveAdd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveAdd(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveAdd(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveMul(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveMul(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveMul(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveMul(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveMin(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveMin(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveMin(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveMin(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveMax(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveMax(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveMax(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveMax(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveAnd(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveAnd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveAnd(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveAnd(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveOr(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveOr(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveOr(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveOr(data[3].i8); + + data[invocation].i8.x = subgroupInclusiveXor(data[0].i8.x); + data[invocation].i8.xy = subgroupInclusiveXor(data[1].i8.xy); + data[invocation].i8.xyz = subgroupInclusiveXor(data[2].i8.xyz); + data[invocation].i8 = subgroupInclusiveXor(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveAdd(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveAdd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveAdd(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveAdd(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveMul(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveMul(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveMul(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveMul(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveMin(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveMin(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveMin(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveMin(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveMax(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveMax(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveMax(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveMax(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveAnd(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveAnd(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveAnd(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveAnd(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveOr(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveOr(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveOr(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveOr(data[3].i8); + + data[invocation].i8.x = subgroupExclusiveXor(data[0].i8.x); + data[invocation].i8.xy = subgroupExclusiveXor(data[1].i8.xy); + data[invocation].i8.xyz = subgroupExclusiveXor(data[2].i8.xyz); + data[invocation].i8 = subgroupExclusiveXor(data[3].i8); + + data[invocation].u8.x = subgroupAdd(data[0].u8.x); + data[invocation].u8.xy = subgroupAdd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupAdd(data[2].u8.xyz); + data[invocation].u8 = subgroupAdd(data[3].u8); + + data[invocation].u8.x = subgroupMul(data[0].u8.x); + data[invocation].u8.xy = subgroupMul(data[1].u8.xy); + data[invocation].u8.xyz = subgroupMul(data[2].u8.xyz); + data[invocation].u8 = subgroupMul(data[3].u8); + + data[invocation].u8.x = subgroupMin(data[0].u8.x); + data[invocation].u8.xy = subgroupMin(data[1].u8.xy); + data[invocation].u8.xyz = subgroupMin(data[2].u8.xyz); + data[invocation].u8 = subgroupMin(data[3].u8); + + data[invocation].u8.x = subgroupMax(data[0].u8.x); + data[invocation].u8.xy = subgroupMax(data[1].u8.xy); + data[invocation].u8.xyz = subgroupMax(data[2].u8.xyz); + data[invocation].u8 = subgroupMax(data[3].u8); + + data[invocation].u8.x = subgroupAnd(data[0].u8.x); + data[invocation].u8.xy = subgroupAnd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupAnd(data[2].u8.xyz); + data[invocation].u8 = subgroupAnd(data[3].u8); + + data[invocation].u8.x = subgroupOr(data[0].u8.x); + data[invocation].u8.xy = subgroupOr(data[1].u8.xy); + data[invocation].u8.xyz = subgroupOr(data[2].u8.xyz); + data[invocation].u8 = subgroupOr(data[3].u8); + + data[invocation].u8.x = subgroupXor(data[0].u8.x); + data[invocation].u8.xy = subgroupXor(data[1].u8.xy); + data[invocation].u8.xyz = subgroupXor(data[2].u8.xyz); + data[invocation].u8 = subgroupXor(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveAdd(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveAdd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveAdd(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveAdd(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveMul(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveMul(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveMul(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveMul(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveMin(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveMin(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveMin(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveMin(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveMax(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveMax(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveMax(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveMax(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveAnd(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveAnd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveAnd(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveAnd(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveOr(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveOr(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveOr(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveOr(data[3].u8); + + data[invocation].u8.x = subgroupInclusiveXor(data[0].u8.x); + data[invocation].u8.xy = subgroupInclusiveXor(data[1].u8.xy); + data[invocation].u8.xyz = subgroupInclusiveXor(data[2].u8.xyz); + data[invocation].u8 = subgroupInclusiveXor(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveAdd(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveAdd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveAdd(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveAdd(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveMul(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveMul(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveMul(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveMul(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveMin(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveMin(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveMin(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveMin(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveMax(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveMax(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveMax(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveMax(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveAnd(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveAnd(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveAnd(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveAnd(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveOr(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveOr(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveOr(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveOr(data[3].u8); + + data[invocation].u8.x = subgroupExclusiveXor(data[0].u8.x); + data[invocation].u8.xy = subgroupExclusiveXor(data[1].u8.xy); + data[invocation].u8.xyz = subgroupExclusiveXor(data[2].u8.xyz); + data[invocation].u8 = subgroupExclusiveXor(data[3].u8); + + data[invocation].i16.x = subgroupAdd(data[0].i16.x); + data[invocation].i16.xy = subgroupAdd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupAdd(data[2].i16.xyz); + data[invocation].i16 = subgroupAdd(data[3].i16); + + data[invocation].i16.x = subgroupMul(data[0].i16.x); + data[invocation].i16.xy = subgroupMul(data[1].i16.xy); + data[invocation].i16.xyz = subgroupMul(data[2].i16.xyz); + data[invocation].i16 = subgroupMul(data[3].i16); + + data[invocation].i16.x = subgroupMin(data[0].i16.x); + data[invocation].i16.xy = subgroupMin(data[1].i16.xy); + data[invocation].i16.xyz = subgroupMin(data[2].i16.xyz); + data[invocation].i16 = subgroupMin(data[3].i16); + + data[invocation].i16.x = subgroupMax(data[0].i16.x); + data[invocation].i16.xy = subgroupMax(data[1].i16.xy); + data[invocation].i16.xyz = subgroupMax(data[2].i16.xyz); + data[invocation].i16 = subgroupMax(data[3].i16); + + data[invocation].i16.x = subgroupAnd(data[0].i16.x); + data[invocation].i16.xy = subgroupAnd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupAnd(data[2].i16.xyz); + data[invocation].i16 = subgroupAnd(data[3].i16); + + data[invocation].i16.x = subgroupOr(data[0].i16.x); + data[invocation].i16.xy = subgroupOr(data[1].i16.xy); + data[invocation].i16.xyz = subgroupOr(data[2].i16.xyz); + data[invocation].i16 = subgroupOr(data[3].i16); + + data[invocation].i16.x = subgroupXor(data[0].i16.x); + data[invocation].i16.xy = subgroupXor(data[1].i16.xy); + data[invocation].i16.xyz = subgroupXor(data[2].i16.xyz); + data[invocation].i16 = subgroupXor(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveAdd(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveAdd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveAdd(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveAdd(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveMul(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveMul(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveMul(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveMul(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveMin(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveMin(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveMin(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveMin(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveMax(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveMax(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveMax(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveMax(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveAnd(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveAnd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveAnd(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveAnd(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveOr(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveOr(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveOr(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveOr(data[3].i16); + + data[invocation].i16.x = subgroupInclusiveXor(data[0].i16.x); + data[invocation].i16.xy = subgroupInclusiveXor(data[1].i16.xy); + data[invocation].i16.xyz = subgroupInclusiveXor(data[2].i16.xyz); + data[invocation].i16 = subgroupInclusiveXor(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveAdd(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveAdd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveAdd(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveAdd(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveMul(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveMul(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveMul(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveMul(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveMin(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveMin(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveMin(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveMin(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveMax(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveMax(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveMax(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveMax(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveAnd(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveAnd(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveAnd(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveAnd(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveOr(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveOr(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveOr(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveOr(data[3].i16); + + data[invocation].i16.x = subgroupExclusiveXor(data[0].i16.x); + data[invocation].i16.xy = subgroupExclusiveXor(data[1].i16.xy); + data[invocation].i16.xyz = subgroupExclusiveXor(data[2].i16.xyz); + data[invocation].i16 = subgroupExclusiveXor(data[3].i16); + + data[invocation].u16.x = subgroupAdd(data[0].u16.x); + data[invocation].u16.xy = subgroupAdd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupAdd(data[2].u16.xyz); + data[invocation].u16 = subgroupAdd(data[3].u16); + + data[invocation].u16.x = subgroupMul(data[0].u16.x); + data[invocation].u16.xy = subgroupMul(data[1].u16.xy); + data[invocation].u16.xyz = subgroupMul(data[2].u16.xyz); + data[invocation].u16 = subgroupMul(data[3].u16); + + data[invocation].u16.x = subgroupMin(data[0].u16.x); + data[invocation].u16.xy = subgroupMin(data[1].u16.xy); + data[invocation].u16.xyz = subgroupMin(data[2].u16.xyz); + data[invocation].u16 = subgroupMin(data[3].u16); + + data[invocation].u16.x = subgroupMax(data[0].u16.x); + data[invocation].u16.xy = subgroupMax(data[1].u16.xy); + data[invocation].u16.xyz = subgroupMax(data[2].u16.xyz); + data[invocation].u16 = subgroupMax(data[3].u16); + + data[invocation].u16.x = subgroupAnd(data[0].u16.x); + data[invocation].u16.xy = subgroupAnd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupAnd(data[2].u16.xyz); + data[invocation].u16 = subgroupAnd(data[3].u16); + + data[invocation].u16.x = subgroupOr(data[0].u16.x); + data[invocation].u16.xy = subgroupOr(data[1].u16.xy); + data[invocation].u16.xyz = subgroupOr(data[2].u16.xyz); + data[invocation].u16 = subgroupOr(data[3].u16); + + data[invocation].u16.x = subgroupXor(data[0].u16.x); + data[invocation].u16.xy = subgroupXor(data[1].u16.xy); + data[invocation].u16.xyz = subgroupXor(data[2].u16.xyz); + data[invocation].u16 = subgroupXor(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveAdd(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveAdd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveAdd(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveAdd(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveMul(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveMul(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveMul(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveMul(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveMin(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveMin(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveMin(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveMin(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveMax(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveMax(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveMax(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveMax(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveAnd(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveAnd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveAnd(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveAnd(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveOr(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveOr(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveOr(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveOr(data[3].u16); + + data[invocation].u16.x = subgroupInclusiveXor(data[0].u16.x); + data[invocation].u16.xy = subgroupInclusiveXor(data[1].u16.xy); + data[invocation].u16.xyz = subgroupInclusiveXor(data[2].u16.xyz); + data[invocation].u16 = subgroupInclusiveXor(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveAdd(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveAdd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveAdd(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveAdd(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveMul(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveMul(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveMul(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveMul(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveMin(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveMin(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveMin(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveMin(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveMax(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveMax(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveMax(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveMax(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveAnd(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveAnd(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveAnd(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveAnd(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveOr(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveOr(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveOr(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveOr(data[3].u16); + + data[invocation].u16.x = subgroupExclusiveXor(data[0].u16.x); + data[invocation].u16.xy = subgroupExclusiveXor(data[1].u16.xy); + data[invocation].u16.xyz = subgroupExclusiveXor(data[2].u16.xyz); + data[invocation].u16 = subgroupExclusiveXor(data[3].u16); + + data[invocation].i64.x = subgroupAdd(data[0].i64.x); + data[invocation].i64.xy = subgroupAdd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupAdd(data[2].i64.xyz); + data[invocation].i64 = subgroupAdd(data[3].i64); + + data[invocation].i64.x = subgroupMul(data[0].i64.x); + data[invocation].i64.xy = subgroupMul(data[1].i64.xy); + data[invocation].i64.xyz = subgroupMul(data[2].i64.xyz); + data[invocation].i64 = subgroupMul(data[3].i64); + + data[invocation].i64.x = subgroupMin(data[0].i64.x); + data[invocation].i64.xy = subgroupMin(data[1].i64.xy); + data[invocation].i64.xyz = subgroupMin(data[2].i64.xyz); + data[invocation].i64 = subgroupMin(data[3].i64); + + data[invocation].i64.x = subgroupMax(data[0].i64.x); + data[invocation].i64.xy = subgroupMax(data[1].i64.xy); + data[invocation].i64.xyz = subgroupMax(data[2].i64.xyz); + data[invocation].i64 = subgroupMax(data[3].i64); + + data[invocation].i64.x = subgroupAnd(data[0].i64.x); + data[invocation].i64.xy = subgroupAnd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupAnd(data[2].i64.xyz); + data[invocation].i64 = subgroupAnd(data[3].i64); + + data[invocation].i64.x = subgroupOr(data[0].i64.x); + data[invocation].i64.xy = subgroupOr(data[1].i64.xy); + data[invocation].i64.xyz = subgroupOr(data[2].i64.xyz); + data[invocation].i64 = subgroupOr(data[3].i64); + + data[invocation].i64.x = subgroupXor(data[0].i64.x); + data[invocation].i64.xy = subgroupXor(data[1].i64.xy); + data[invocation].i64.xyz = subgroupXor(data[2].i64.xyz); + data[invocation].i64 = subgroupXor(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveAdd(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveAdd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveAdd(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveAdd(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveMul(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveMul(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveMul(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveMul(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveMin(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveMin(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveMin(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveMin(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveMax(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveMax(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveMax(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveMax(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveAnd(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveAnd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveAnd(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveAnd(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveOr(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveOr(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveOr(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveOr(data[3].i64); + + data[invocation].i64.x = subgroupInclusiveXor(data[0].i64.x); + data[invocation].i64.xy = subgroupInclusiveXor(data[1].i64.xy); + data[invocation].i64.xyz = subgroupInclusiveXor(data[2].i64.xyz); + data[invocation].i64 = subgroupInclusiveXor(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveAdd(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveAdd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveAdd(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveAdd(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveMul(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveMul(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveMul(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveMul(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveMin(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveMin(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveMin(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveMin(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveMax(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveMax(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveMax(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveMax(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveAnd(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveAnd(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveAnd(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveAnd(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveOr(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveOr(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveOr(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveOr(data[3].i64); + + data[invocation].i64.x = subgroupExclusiveXor(data[0].i64.x); + data[invocation].i64.xy = subgroupExclusiveXor(data[1].i64.xy); + data[invocation].i64.xyz = subgroupExclusiveXor(data[2].i64.xyz); + data[invocation].i64 = subgroupExclusiveXor(data[3].i64); + + data[invocation].u64.x = subgroupAdd(data[0].u64.x); + data[invocation].u64.xy = subgroupAdd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupAdd(data[2].u64.xyz); + data[invocation].u64 = subgroupAdd(data[3].u64); + + data[invocation].u64.x = subgroupMul(data[0].u64.x); + data[invocation].u64.xy = subgroupMul(data[1].u64.xy); + data[invocation].u64.xyz = subgroupMul(data[2].u64.xyz); + data[invocation].u64 = subgroupMul(data[3].u64); + + data[invocation].u64.x = subgroupMin(data[0].u64.x); + data[invocation].u64.xy = subgroupMin(data[1].u64.xy); + data[invocation].u64.xyz = subgroupMin(data[2].u64.xyz); + data[invocation].u64 = subgroupMin(data[3].u64); + + data[invocation].u64.x = subgroupMax(data[0].u64.x); + data[invocation].u64.xy = subgroupMax(data[1].u64.xy); + data[invocation].u64.xyz = subgroupMax(data[2].u64.xyz); + data[invocation].u64 = subgroupMax(data[3].u64); + + data[invocation].u64.x = subgroupAnd(data[0].u64.x); + data[invocation].u64.xy = subgroupAnd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupAnd(data[2].u64.xyz); + data[invocation].u64 = subgroupAnd(data[3].u64); + + data[invocation].u64.x = subgroupOr(data[0].u64.x); + data[invocation].u64.xy = subgroupOr(data[1].u64.xy); + data[invocation].u64.xyz = subgroupOr(data[2].u64.xyz); + data[invocation].u64 = subgroupOr(data[3].u64); + + data[invocation].u64.x = subgroupXor(data[0].u64.x); + data[invocation].u64.xy = subgroupXor(data[1].u64.xy); + data[invocation].u64.xyz = subgroupXor(data[2].u64.xyz); + data[invocation].u64 = subgroupXor(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveAdd(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveAdd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveAdd(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveAdd(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveMul(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveMul(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveMul(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveMul(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveMin(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveMin(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveMin(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveMin(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveMax(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveMax(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveMax(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveMax(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveAnd(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveAnd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveAnd(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveAnd(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveOr(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveOr(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveOr(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveOr(data[3].u64); + + data[invocation].u64.x = subgroupInclusiveXor(data[0].u64.x); + data[invocation].u64.xy = subgroupInclusiveXor(data[1].u64.xy); + data[invocation].u64.xyz = subgroupInclusiveXor(data[2].u64.xyz); + data[invocation].u64 = subgroupInclusiveXor(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveAdd(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveAdd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveAdd(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveAdd(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveMul(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveMul(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveMul(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveMul(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveMin(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveMin(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveMin(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveMin(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveMax(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveMax(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveMax(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveMax(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveAnd(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveAnd(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveAnd(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveAnd(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveOr(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveOr(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveOr(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveOr(data[3].u64); + + data[invocation].u64.x = subgroupExclusiveXor(data[0].u64.x); + data[invocation].u64.xy = subgroupExclusiveXor(data[1].u64.xy); + data[invocation].u64.xyz = subgroupExclusiveXor(data[2].u64.xyz); + data[invocation].u64 = subgroupExclusiveXor(data[3].u64); + + data[invocation].f16.x = subgroupAdd(data[0].f16.x); + data[invocation].f16.xy = subgroupAdd(data[1].f16.xy); + data[invocation].f16.xyz = subgroupAdd(data[2].f16.xyz); + data[invocation].f16 = subgroupAdd(data[3].f16); + + data[invocation].f16.x = subgroupMul(data[0].f16.x); + data[invocation].f16.xy = subgroupMul(data[1].f16.xy); + data[invocation].f16.xyz = subgroupMul(data[2].f16.xyz); + data[invocation].f16 = subgroupMul(data[3].f16); + + data[invocation].f16.x = subgroupMin(data[0].f16.x); + data[invocation].f16.xy = subgroupMin(data[1].f16.xy); + data[invocation].f16.xyz = subgroupMin(data[2].f16.xyz); + data[invocation].f16 = subgroupMin(data[3].f16); + + data[invocation].f16.x = subgroupMax(data[0].f16.x); + data[invocation].f16.xy = subgroupMax(data[1].f16.xy); + data[invocation].f16.xyz = subgroupMax(data[2].f16.xyz); + data[invocation].f16 = subgroupMax(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveAdd(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveAdd(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveAdd(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveAdd(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveMul(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveMul(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveMul(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveMul(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveMin(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveMin(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveMin(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveMin(data[3].f16); + + data[invocation].f16.x = subgroupInclusiveMax(data[0].f16.x); + data[invocation].f16.xy = subgroupInclusiveMax(data[1].f16.xy); + data[invocation].f16.xyz = subgroupInclusiveMax(data[2].f16.xyz); + data[invocation].f16 = subgroupInclusiveMax(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveAdd(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveAdd(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveAdd(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveAdd(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveMul(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveMul(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveMul(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveMul(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveMin(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveMin(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveMin(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveMin(data[3].f16); + + data[invocation].f16.x = subgroupExclusiveMax(data[0].f16.x); + data[invocation].f16.xy = subgroupExclusiveMax(data[1].f16.xy); + data[invocation].f16.xyz = subgroupExclusiveMax(data[2].f16.xyz); + data[invocation].f16 = subgroupExclusiveMax(data[3].f16); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesBallot.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesBallot.comp index 64469efd3..22d29cb7c 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesBallot.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesBallot.comp @@ -1,88 +1,88 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupBroadcast(data[0].i8.x, 3); - data[invocation].i8.xy = subgroupBroadcast(data[1].i8.xy, 3); - data[invocation].i8.xyz = subgroupBroadcast(data[2].i8.xyz, 3); - data[invocation].i8 = subgroupBroadcast(data[3].i8, 3); - data[invocation].i8.x = subgroupBroadcastFirst(data[0].i8.x); - data[invocation].i8.xy = subgroupBroadcastFirst(data[1].i8.xy); - data[invocation].i8.xyz = subgroupBroadcastFirst(data[2].i8.xyz); - data[invocation].i8 = subgroupBroadcastFirst(data[3].i8); - - data[invocation].u8.x = subgroupBroadcast(data[0].u8.x, 3); - data[invocation].u8.xy = subgroupBroadcast(data[1].u8.xy, 3); - data[invocation].u8.xyz = subgroupBroadcast(data[2].u8.xyz, 3); - data[invocation].u8 = subgroupBroadcast(data[3].u8, 3); - data[invocation].u8.x = subgroupBroadcastFirst(data[0].u8.x); - data[invocation].u8.xy = subgroupBroadcastFirst(data[1].u8.xy); - data[invocation].u8.xyz = subgroupBroadcastFirst(data[2].u8.xyz); - data[invocation].u8 = subgroupBroadcastFirst(data[3].u8); - - data[invocation].i16.x = subgroupBroadcast(data[0].i16.x, 3); - data[invocation].i16.xy = subgroupBroadcast(data[1].i16.xy, 3); - data[invocation].i16.xyz = subgroupBroadcast(data[2].i16.xyz, 3); - data[invocation].i16 = subgroupBroadcast(data[3].i16, 3); - data[invocation].i16.x = subgroupBroadcastFirst(data[0].i16.x); - data[invocation].i16.xy = subgroupBroadcastFirst(data[1].i16.xy); - data[invocation].i16.xyz = subgroupBroadcastFirst(data[2].i16.xyz); - data[invocation].i16 = subgroupBroadcastFirst(data[3].i16); - - data[invocation].u16.x = subgroupBroadcast(data[0].u16.x, 3); - data[invocation].u16.xy = subgroupBroadcast(data[1].u16.xy, 3); - data[invocation].u16.xyz = subgroupBroadcast(data[2].u16.xyz, 3); - data[invocation].u16 = subgroupBroadcast(data[3].u16, 3); - data[invocation].u16.x = subgroupBroadcastFirst(data[0].u16.x); - data[invocation].u16.xy = subgroupBroadcastFirst(data[1].u16.xy); - data[invocation].u16.xyz = subgroupBroadcastFirst(data[2].u16.xyz); - data[invocation].u16 = subgroupBroadcastFirst(data[3].u16); - - data[invocation].i64.x = subgroupBroadcast(data[0].i64.x, 3); - data[invocation].i64.xy = subgroupBroadcast(data[1].i64.xy, 3); - data[invocation].i64.xyz = subgroupBroadcast(data[2].i64.xyz, 3); - data[invocation].i64 = subgroupBroadcast(data[3].i64, 3); - data[invocation].i64.x = subgroupBroadcastFirst(data[0].i64.x); - data[invocation].i64.xy = subgroupBroadcastFirst(data[1].i64.xy); - data[invocation].i64.xyz = subgroupBroadcastFirst(data[2].i64.xyz); - data[invocation].i64 = subgroupBroadcastFirst(data[3].i64); - - data[invocation].u64.x = subgroupBroadcast(data[0].u64.x, 3); - data[invocation].u64.xy = subgroupBroadcast(data[1].u64.xy, 3); - data[invocation].u64.xyz = subgroupBroadcast(data[2].u64.xyz, 3); - data[invocation].u64 = subgroupBroadcast(data[3].u64, 3); - data[invocation].u64.x = subgroupBroadcastFirst(data[0].u64.x); - data[invocation].u64.xy = subgroupBroadcastFirst(data[1].u64.xy); - data[invocation].u64.xyz = subgroupBroadcastFirst(data[2].u64.xyz); - data[invocation].u64 = subgroupBroadcastFirst(data[3].u64); - - data[invocation].f16.x = subgroupBroadcast(data[0].f16.x, 3); - data[invocation].f16.xy = subgroupBroadcast(data[1].f16.xy, 3); - data[invocation].f16.xyz = subgroupBroadcast(data[2].f16.xyz, 3); - data[invocation].f16 = subgroupBroadcast(data[3].f16, 3); - data[invocation].f16.x = subgroupBroadcastFirst(data[0].f16.x); - data[invocation].f16.xy = subgroupBroadcastFirst(data[1].f16.xy); - data[invocation].f16.xyz = subgroupBroadcastFirst(data[2].f16.xyz); - data[invocation].f16 = subgroupBroadcastFirst(data[3].f16); -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupBroadcast(data[0].i8.x, 3); + data[invocation].i8.xy = subgroupBroadcast(data[1].i8.xy, 3); + data[invocation].i8.xyz = subgroupBroadcast(data[2].i8.xyz, 3); + data[invocation].i8 = subgroupBroadcast(data[3].i8, 3); + data[invocation].i8.x = subgroupBroadcastFirst(data[0].i8.x); + data[invocation].i8.xy = subgroupBroadcastFirst(data[1].i8.xy); + data[invocation].i8.xyz = subgroupBroadcastFirst(data[2].i8.xyz); + data[invocation].i8 = subgroupBroadcastFirst(data[3].i8); + + data[invocation].u8.x = subgroupBroadcast(data[0].u8.x, 3); + data[invocation].u8.xy = subgroupBroadcast(data[1].u8.xy, 3); + data[invocation].u8.xyz = subgroupBroadcast(data[2].u8.xyz, 3); + data[invocation].u8 = subgroupBroadcast(data[3].u8, 3); + data[invocation].u8.x = subgroupBroadcastFirst(data[0].u8.x); + data[invocation].u8.xy = subgroupBroadcastFirst(data[1].u8.xy); + data[invocation].u8.xyz = subgroupBroadcastFirst(data[2].u8.xyz); + data[invocation].u8 = subgroupBroadcastFirst(data[3].u8); + + data[invocation].i16.x = subgroupBroadcast(data[0].i16.x, 3); + data[invocation].i16.xy = subgroupBroadcast(data[1].i16.xy, 3); + data[invocation].i16.xyz = subgroupBroadcast(data[2].i16.xyz, 3); + data[invocation].i16 = subgroupBroadcast(data[3].i16, 3); + data[invocation].i16.x = subgroupBroadcastFirst(data[0].i16.x); + data[invocation].i16.xy = subgroupBroadcastFirst(data[1].i16.xy); + data[invocation].i16.xyz = subgroupBroadcastFirst(data[2].i16.xyz); + data[invocation].i16 = subgroupBroadcastFirst(data[3].i16); + + data[invocation].u16.x = subgroupBroadcast(data[0].u16.x, 3); + data[invocation].u16.xy = subgroupBroadcast(data[1].u16.xy, 3); + data[invocation].u16.xyz = subgroupBroadcast(data[2].u16.xyz, 3); + data[invocation].u16 = subgroupBroadcast(data[3].u16, 3); + data[invocation].u16.x = subgroupBroadcastFirst(data[0].u16.x); + data[invocation].u16.xy = subgroupBroadcastFirst(data[1].u16.xy); + data[invocation].u16.xyz = subgroupBroadcastFirst(data[2].u16.xyz); + data[invocation].u16 = subgroupBroadcastFirst(data[3].u16); + + data[invocation].i64.x = subgroupBroadcast(data[0].i64.x, 3); + data[invocation].i64.xy = subgroupBroadcast(data[1].i64.xy, 3); + data[invocation].i64.xyz = subgroupBroadcast(data[2].i64.xyz, 3); + data[invocation].i64 = subgroupBroadcast(data[3].i64, 3); + data[invocation].i64.x = subgroupBroadcastFirst(data[0].i64.x); + data[invocation].i64.xy = subgroupBroadcastFirst(data[1].i64.xy); + data[invocation].i64.xyz = subgroupBroadcastFirst(data[2].i64.xyz); + data[invocation].i64 = subgroupBroadcastFirst(data[3].i64); + + data[invocation].u64.x = subgroupBroadcast(data[0].u64.x, 3); + data[invocation].u64.xy = subgroupBroadcast(data[1].u64.xy, 3); + data[invocation].u64.xyz = subgroupBroadcast(data[2].u64.xyz, 3); + data[invocation].u64 = subgroupBroadcast(data[3].u64, 3); + data[invocation].u64.x = subgroupBroadcastFirst(data[0].u64.x); + data[invocation].u64.xy = subgroupBroadcastFirst(data[1].u64.xy); + data[invocation].u64.xyz = subgroupBroadcastFirst(data[2].u64.xyz); + data[invocation].u64 = subgroupBroadcastFirst(data[3].u64); + + data[invocation].f16.x = subgroupBroadcast(data[0].f16.x, 3); + data[invocation].f16.xy = subgroupBroadcast(data[1].f16.xy, 3); + data[invocation].f16.xyz = subgroupBroadcast(data[2].f16.xyz, 3); + data[invocation].f16 = subgroupBroadcast(data[3].f16, 3); + data[invocation].f16.x = subgroupBroadcastFirst(data[0].f16.x); + data[invocation].f16.xy = subgroupBroadcastFirst(data[1].f16.xy); + data[invocation].f16.xyz = subgroupBroadcastFirst(data[2].f16.xyz); + data[invocation].f16 = subgroupBroadcastFirst(data[3].f16); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesBallotNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesBallotNeg.comp index 32d6c2da3..240ab593f 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesBallotNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesBallotNeg.comp @@ -1,88 +1,88 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_ballot: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupBroadcast(data[0].i8.x, 3); - data[invocation].i8.xy = subgroupBroadcast(data[1].i8.xy, 3); - data[invocation].i8.xyz = subgroupBroadcast(data[2].i8.xyz, 3); - data[invocation].i8 = subgroupBroadcast(data[3].i8, 3); - data[invocation].i8.x = subgroupBroadcastFirst(data[0].i8.x); - data[invocation].i8.xy = subgroupBroadcastFirst(data[1].i8.xy); - data[invocation].i8.xyz = subgroupBroadcastFirst(data[2].i8.xyz); - data[invocation].i8 = subgroupBroadcastFirst(data[3].i8); - - data[invocation].u8.x = subgroupBroadcast(data[0].u8.x, 3); - data[invocation].u8.xy = subgroupBroadcast(data[1].u8.xy, 3); - data[invocation].u8.xyz = subgroupBroadcast(data[2].u8.xyz, 3); - data[invocation].u8 = subgroupBroadcast(data[3].u8, 3); - data[invocation].u8.x = subgroupBroadcastFirst(data[0].u8.x); - data[invocation].u8.xy = subgroupBroadcastFirst(data[1].u8.xy); - data[invocation].u8.xyz = subgroupBroadcastFirst(data[2].u8.xyz); - data[invocation].u8 = subgroupBroadcastFirst(data[3].u8); - - data[invocation].i16.x = subgroupBroadcast(data[0].i16.x, 3); - data[invocation].i16.xy = subgroupBroadcast(data[1].i16.xy, 3); - data[invocation].i16.xyz = subgroupBroadcast(data[2].i16.xyz, 3); - data[invocation].i16 = subgroupBroadcast(data[3].i16, 3); - data[invocation].i16.x = subgroupBroadcastFirst(data[0].i16.x); - data[invocation].i16.xy = subgroupBroadcastFirst(data[1].i16.xy); - data[invocation].i16.xyz = subgroupBroadcastFirst(data[2].i16.xyz); - data[invocation].i16 = subgroupBroadcastFirst(data[3].i16); - - data[invocation].u16.x = subgroupBroadcast(data[0].u16.x, 3); - data[invocation].u16.xy = subgroupBroadcast(data[1].u16.xy, 3); - data[invocation].u16.xyz = subgroupBroadcast(data[2].u16.xyz, 3); - data[invocation].u16 = subgroupBroadcast(data[3].u16, 3); - data[invocation].u16.x = subgroupBroadcastFirst(data[0].u16.x); - data[invocation].u16.xy = subgroupBroadcastFirst(data[1].u16.xy); - data[invocation].u16.xyz = subgroupBroadcastFirst(data[2].u16.xyz); - data[invocation].u16 = subgroupBroadcastFirst(data[3].u16); - - data[invocation].i64.x = subgroupBroadcast(data[0].i64.x, 3); - data[invocation].i64.xy = subgroupBroadcast(data[1].i64.xy, 3); - data[invocation].i64.xyz = subgroupBroadcast(data[2].i64.xyz, 3); - data[invocation].i64 = subgroupBroadcast(data[3].i64, 3); - data[invocation].i64.x = subgroupBroadcastFirst(data[0].i64.x); - data[invocation].i64.xy = subgroupBroadcastFirst(data[1].i64.xy); - data[invocation].i64.xyz = subgroupBroadcastFirst(data[2].i64.xyz); - data[invocation].i64 = subgroupBroadcastFirst(data[3].i64); - - data[invocation].u64.x = subgroupBroadcast(data[0].u64.x, 3); - data[invocation].u64.xy = subgroupBroadcast(data[1].u64.xy, 3); - data[invocation].u64.xyz = subgroupBroadcast(data[2].u64.xyz, 3); - data[invocation].u64 = subgroupBroadcast(data[3].u64, 3); - data[invocation].u64.x = subgroupBroadcastFirst(data[0].u64.x); - data[invocation].u64.xy = subgroupBroadcastFirst(data[1].u64.xy); - data[invocation].u64.xyz = subgroupBroadcastFirst(data[2].u64.xyz); - data[invocation].u64 = subgroupBroadcastFirst(data[3].u64); - - data[invocation].f16.x = subgroupBroadcast(data[0].f16.x, 3); - data[invocation].f16.xy = subgroupBroadcast(data[1].f16.xy, 3); - data[invocation].f16.xyz = subgroupBroadcast(data[2].f16.xyz, 3); - data[invocation].f16 = subgroupBroadcast(data[3].f16, 3); - data[invocation].f16.x = subgroupBroadcastFirst(data[0].f16.x); - data[invocation].f16.xy = subgroupBroadcastFirst(data[1].f16.xy); - data[invocation].f16.xyz = subgroupBroadcastFirst(data[2].f16.xyz); - data[invocation].f16 = subgroupBroadcastFirst(data[3].f16); -} +#version 450 + +#extension GL_KHR_shader_subgroup_ballot: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupBroadcast(data[0].i8.x, 3); + data[invocation].i8.xy = subgroupBroadcast(data[1].i8.xy, 3); + data[invocation].i8.xyz = subgroupBroadcast(data[2].i8.xyz, 3); + data[invocation].i8 = subgroupBroadcast(data[3].i8, 3); + data[invocation].i8.x = subgroupBroadcastFirst(data[0].i8.x); + data[invocation].i8.xy = subgroupBroadcastFirst(data[1].i8.xy); + data[invocation].i8.xyz = subgroupBroadcastFirst(data[2].i8.xyz); + data[invocation].i8 = subgroupBroadcastFirst(data[3].i8); + + data[invocation].u8.x = subgroupBroadcast(data[0].u8.x, 3); + data[invocation].u8.xy = subgroupBroadcast(data[1].u8.xy, 3); + data[invocation].u8.xyz = subgroupBroadcast(data[2].u8.xyz, 3); + data[invocation].u8 = subgroupBroadcast(data[3].u8, 3); + data[invocation].u8.x = subgroupBroadcastFirst(data[0].u8.x); + data[invocation].u8.xy = subgroupBroadcastFirst(data[1].u8.xy); + data[invocation].u8.xyz = subgroupBroadcastFirst(data[2].u8.xyz); + data[invocation].u8 = subgroupBroadcastFirst(data[3].u8); + + data[invocation].i16.x = subgroupBroadcast(data[0].i16.x, 3); + data[invocation].i16.xy = subgroupBroadcast(data[1].i16.xy, 3); + data[invocation].i16.xyz = subgroupBroadcast(data[2].i16.xyz, 3); + data[invocation].i16 = subgroupBroadcast(data[3].i16, 3); + data[invocation].i16.x = subgroupBroadcastFirst(data[0].i16.x); + data[invocation].i16.xy = subgroupBroadcastFirst(data[1].i16.xy); + data[invocation].i16.xyz = subgroupBroadcastFirst(data[2].i16.xyz); + data[invocation].i16 = subgroupBroadcastFirst(data[3].i16); + + data[invocation].u16.x = subgroupBroadcast(data[0].u16.x, 3); + data[invocation].u16.xy = subgroupBroadcast(data[1].u16.xy, 3); + data[invocation].u16.xyz = subgroupBroadcast(data[2].u16.xyz, 3); + data[invocation].u16 = subgroupBroadcast(data[3].u16, 3); + data[invocation].u16.x = subgroupBroadcastFirst(data[0].u16.x); + data[invocation].u16.xy = subgroupBroadcastFirst(data[1].u16.xy); + data[invocation].u16.xyz = subgroupBroadcastFirst(data[2].u16.xyz); + data[invocation].u16 = subgroupBroadcastFirst(data[3].u16); + + data[invocation].i64.x = subgroupBroadcast(data[0].i64.x, 3); + data[invocation].i64.xy = subgroupBroadcast(data[1].i64.xy, 3); + data[invocation].i64.xyz = subgroupBroadcast(data[2].i64.xyz, 3); + data[invocation].i64 = subgroupBroadcast(data[3].i64, 3); + data[invocation].i64.x = subgroupBroadcastFirst(data[0].i64.x); + data[invocation].i64.xy = subgroupBroadcastFirst(data[1].i64.xy); + data[invocation].i64.xyz = subgroupBroadcastFirst(data[2].i64.xyz); + data[invocation].i64 = subgroupBroadcastFirst(data[3].i64); + + data[invocation].u64.x = subgroupBroadcast(data[0].u64.x, 3); + data[invocation].u64.xy = subgroupBroadcast(data[1].u64.xy, 3); + data[invocation].u64.xyz = subgroupBroadcast(data[2].u64.xyz, 3); + data[invocation].u64 = subgroupBroadcast(data[3].u64, 3); + data[invocation].u64.x = subgroupBroadcastFirst(data[0].u64.x); + data[invocation].u64.xy = subgroupBroadcastFirst(data[1].u64.xy); + data[invocation].u64.xyz = subgroupBroadcastFirst(data[2].u64.xyz); + data[invocation].u64 = subgroupBroadcastFirst(data[3].u64); + + data[invocation].f16.x = subgroupBroadcast(data[0].f16.x, 3); + data[invocation].f16.xy = subgroupBroadcast(data[1].f16.xy, 3); + data[invocation].f16.xyz = subgroupBroadcast(data[2].f16.xyz, 3); + data[invocation].f16 = subgroupBroadcast(data[3].f16, 3); + data[invocation].f16.x = subgroupBroadcastFirst(data[0].f16.x); + data[invocation].f16.xy = subgroupBroadcastFirst(data[1].f16.xy); + data[invocation].f16.xyz = subgroupBroadcastFirst(data[2].f16.xyz); + data[invocation].f16 = subgroupBroadcastFirst(data[3].f16); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesClustered.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesClustered.comp index 82097e3bf..a215cbf0b 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesClustered.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesClustered.comp @@ -1,255 +1,255 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_clustered: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupClusteredAdd(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredAdd(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredAdd(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredAdd(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredMul(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredMul(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredMul(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredMul(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredMin(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredMin(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredMin(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredMin(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredMax(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredMax(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredMax(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredMax(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredAnd(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredAnd(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredAnd(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredAnd(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredOr(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredOr(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredOr(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredOr(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredXor(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredXor(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredXor(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredXor(data[3].i8, 1); - - data[invocation].u8.x = subgroupClusteredAdd(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredAdd(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredAdd(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredAdd(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredMul(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredMul(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredMul(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredMul(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredMin(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredMin(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredMin(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredMin(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredMax(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredMax(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredMax(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredMax(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredAnd(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredAnd(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredAnd(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredAnd(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredOr(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredOr(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredOr(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredOr(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredXor(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredXor(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredXor(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredXor(data[3].u8, 1); - - data[invocation].i16.x = subgroupClusteredAdd(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredAdd(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredAdd(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredAdd(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredMul(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredMul(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredMul(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredMul(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredMin(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredMin(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredMin(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredMin(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredMax(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredMax(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredMax(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredMax(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredAnd(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredAnd(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredAnd(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredAnd(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredOr(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredOr(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredOr(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredOr(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredXor(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredXor(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredXor(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredXor(data[3].i16, 1); - - data[invocation].u16.x = subgroupClusteredAdd(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredAdd(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredAdd(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredAdd(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredMul(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredMul(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredMul(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredMul(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredMin(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredMin(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredMin(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredMin(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredMax(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredMax(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredMax(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredMax(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredAnd(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredAnd(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredAnd(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredAnd(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredOr(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredOr(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredOr(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredOr(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredXor(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredXor(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredXor(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredXor(data[3].u16, 1); - - data[invocation].i64.x = subgroupClusteredAdd(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredAdd(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredAdd(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredAdd(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredMul(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredMul(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredMul(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredMul(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredMin(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredMin(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredMin(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredMin(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredMax(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredMax(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredMax(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredMax(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredAnd(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredAnd(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredAnd(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredAnd(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredOr(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredOr(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredOr(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredOr(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredXor(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredXor(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredXor(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredXor(data[3].i64, 1); - - data[invocation].u64.x = subgroupClusteredAdd(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredAdd(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredAdd(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredAdd(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredMul(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredMul(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredMul(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredMul(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredMin(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredMin(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredMin(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredMin(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredMax(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredMax(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredMax(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredMax(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredAnd(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredAnd(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredAnd(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredAnd(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredOr(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredOr(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredOr(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredOr(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredXor(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredXor(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredXor(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredXor(data[3].u64, 1); - - data[invocation].f16.x = subgroupClusteredAdd(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredAdd(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredAdd(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredAdd(data[3].f16, 1); - - data[invocation].f16.x = subgroupClusteredMul(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredMul(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredMul(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredMul(data[3].f16, 1); - - data[invocation].f16.x = subgroupClusteredMin(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredMin(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredMin(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredMin(data[3].f16, 1); - - data[invocation].f16.x = subgroupClusteredMax(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredMax(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredMax(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredMax(data[3].f16, 1); -} +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupClusteredAdd(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredAdd(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredAdd(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredAdd(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredMul(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredMul(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredMul(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredMul(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredMin(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredMin(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredMin(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredMin(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredMax(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredMax(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredMax(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredMax(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredAnd(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredAnd(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredAnd(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredAnd(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredOr(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredOr(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredOr(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredOr(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredXor(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredXor(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredXor(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredXor(data[3].i8, 1); + + data[invocation].u8.x = subgroupClusteredAdd(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredAdd(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredAdd(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredAdd(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredMul(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredMul(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredMul(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredMul(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredMin(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredMin(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredMin(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredMin(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredMax(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredMax(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredMax(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredMax(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredAnd(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredAnd(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredAnd(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredAnd(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredOr(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredOr(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredOr(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredOr(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredXor(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredXor(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredXor(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredXor(data[3].u8, 1); + + data[invocation].i16.x = subgroupClusteredAdd(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredAdd(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredAdd(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredAdd(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredMul(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredMul(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredMul(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredMul(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredMin(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredMin(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredMin(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredMin(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredMax(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredMax(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredMax(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredMax(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredAnd(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredAnd(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredAnd(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredAnd(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredOr(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredOr(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredOr(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredOr(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredXor(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredXor(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredXor(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredXor(data[3].i16, 1); + + data[invocation].u16.x = subgroupClusteredAdd(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredAdd(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredAdd(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredAdd(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredMul(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredMul(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredMul(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredMul(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredMin(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredMin(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredMin(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredMin(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredMax(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredMax(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredMax(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredMax(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredAnd(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredAnd(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredAnd(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredAnd(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredOr(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredOr(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredOr(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredOr(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredXor(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredXor(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredXor(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredXor(data[3].u16, 1); + + data[invocation].i64.x = subgroupClusteredAdd(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredAdd(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredAdd(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredAdd(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredMul(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredMul(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredMul(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredMul(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredMin(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredMin(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredMin(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredMin(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredMax(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredMax(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredMax(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredMax(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredAnd(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredAnd(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredAnd(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredAnd(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredOr(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredOr(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredOr(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredOr(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredXor(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredXor(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredXor(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredXor(data[3].i64, 1); + + data[invocation].u64.x = subgroupClusteredAdd(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredAdd(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredAdd(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredAdd(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredMul(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredMul(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredMul(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredMul(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredMin(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredMin(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredMin(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredMin(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredMax(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredMax(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredMax(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredMax(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredAnd(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredAnd(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredAnd(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredAnd(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredOr(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredOr(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredOr(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredOr(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredXor(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredXor(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredXor(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredXor(data[3].u64, 1); + + data[invocation].f16.x = subgroupClusteredAdd(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredAdd(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredAdd(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredAdd(data[3].f16, 1); + + data[invocation].f16.x = subgroupClusteredMul(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredMul(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredMul(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredMul(data[3].f16, 1); + + data[invocation].f16.x = subgroupClusteredMin(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredMin(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredMin(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredMin(data[3].f16, 1); + + data[invocation].f16.x = subgroupClusteredMax(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredMax(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredMax(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredMax(data[3].f16, 1); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesClusteredNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesClusteredNeg.comp index 845ca4b23..d5215115f 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesClusteredNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesClusteredNeg.comp @@ -1,255 +1,255 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_clustered: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupClusteredAdd(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredAdd(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredAdd(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredAdd(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredMul(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredMul(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredMul(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredMul(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredMin(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredMin(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredMin(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredMin(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredMax(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredMax(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredMax(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredMax(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredAnd(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredAnd(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredAnd(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredAnd(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredOr(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredOr(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredOr(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredOr(data[3].i8, 1); - - data[invocation].i8.x = subgroupClusteredXor(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupClusteredXor(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupClusteredXor(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupClusteredXor(data[3].i8, 1); - - data[invocation].u8.x = subgroupClusteredAdd(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredAdd(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredAdd(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredAdd(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredMul(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredMul(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredMul(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredMul(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredMin(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredMin(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredMin(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredMin(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredMax(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredMax(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredMax(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredMax(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredAnd(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredAnd(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredAnd(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredAnd(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredOr(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredOr(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredOr(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredOr(data[3].u8, 1); - - data[invocation].u8.x = subgroupClusteredXor(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupClusteredXor(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupClusteredXor(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupClusteredXor(data[3].u8, 1); - - data[invocation].i16.x = subgroupClusteredAdd(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredAdd(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredAdd(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredAdd(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredMul(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredMul(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredMul(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredMul(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredMin(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredMin(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredMin(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredMin(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredMax(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredMax(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredMax(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredMax(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredAnd(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredAnd(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredAnd(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredAnd(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredOr(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredOr(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredOr(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredOr(data[3].i16, 1); - - data[invocation].i16.x = subgroupClusteredXor(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupClusteredXor(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupClusteredXor(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupClusteredXor(data[3].i16, 1); - - data[invocation].u16.x = subgroupClusteredAdd(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredAdd(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredAdd(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredAdd(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredMul(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredMul(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredMul(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredMul(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredMin(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredMin(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredMin(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredMin(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredMax(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredMax(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredMax(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredMax(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredAnd(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredAnd(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredAnd(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredAnd(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredOr(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredOr(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredOr(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredOr(data[3].u16, 1); - - data[invocation].u16.x = subgroupClusteredXor(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupClusteredXor(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupClusteredXor(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupClusteredXor(data[3].u16, 1); - - data[invocation].i64.x = subgroupClusteredAdd(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredAdd(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredAdd(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredAdd(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredMul(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredMul(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredMul(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredMul(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredMin(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredMin(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredMin(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredMin(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredMax(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredMax(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredMax(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredMax(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredAnd(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredAnd(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredAnd(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredAnd(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredOr(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredOr(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredOr(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredOr(data[3].i64, 1); - - data[invocation].i64.x = subgroupClusteredXor(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupClusteredXor(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupClusteredXor(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupClusteredXor(data[3].i64, 1); - - data[invocation].u64.x = subgroupClusteredAdd(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredAdd(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredAdd(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredAdd(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredMul(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredMul(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredMul(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredMul(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredMin(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredMin(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredMin(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredMin(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredMax(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredMax(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredMax(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredMax(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredAnd(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredAnd(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredAnd(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredAnd(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredOr(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredOr(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredOr(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredOr(data[3].u64, 1); - - data[invocation].u64.x = subgroupClusteredXor(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupClusteredXor(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupClusteredXor(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupClusteredXor(data[3].u64, 1); - - data[invocation].f16.x = subgroupClusteredAdd(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredAdd(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredAdd(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredAdd(data[3].f16, 1); - - data[invocation].f16.x = subgroupClusteredMul(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredMul(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredMul(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredMul(data[3].f16, 1); - - data[invocation].f16.x = subgroupClusteredMin(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredMin(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredMin(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredMin(data[3].f16, 1); - - data[invocation].f16.x = subgroupClusteredMax(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupClusteredMax(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupClusteredMax(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupClusteredMax(data[3].f16, 1); -} +#version 450 + +#extension GL_KHR_shader_subgroup_clustered: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupClusteredAdd(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredAdd(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredAdd(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredAdd(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredMul(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredMul(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredMul(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredMul(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredMin(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredMin(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredMin(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredMin(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredMax(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredMax(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredMax(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredMax(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredAnd(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredAnd(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredAnd(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredAnd(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredOr(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredOr(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredOr(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredOr(data[3].i8, 1); + + data[invocation].i8.x = subgroupClusteredXor(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupClusteredXor(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupClusteredXor(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupClusteredXor(data[3].i8, 1); + + data[invocation].u8.x = subgroupClusteredAdd(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredAdd(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredAdd(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredAdd(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredMul(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredMul(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredMul(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredMul(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredMin(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredMin(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredMin(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredMin(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredMax(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredMax(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredMax(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredMax(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredAnd(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredAnd(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredAnd(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredAnd(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredOr(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredOr(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredOr(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredOr(data[3].u8, 1); + + data[invocation].u8.x = subgroupClusteredXor(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupClusteredXor(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupClusteredXor(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupClusteredXor(data[3].u8, 1); + + data[invocation].i16.x = subgroupClusteredAdd(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredAdd(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredAdd(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredAdd(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredMul(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredMul(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredMul(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredMul(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredMin(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredMin(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredMin(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredMin(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredMax(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredMax(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredMax(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredMax(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredAnd(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredAnd(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredAnd(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredAnd(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredOr(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredOr(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredOr(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredOr(data[3].i16, 1); + + data[invocation].i16.x = subgroupClusteredXor(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupClusteredXor(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupClusteredXor(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupClusteredXor(data[3].i16, 1); + + data[invocation].u16.x = subgroupClusteredAdd(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredAdd(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredAdd(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredAdd(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredMul(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredMul(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredMul(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredMul(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredMin(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredMin(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredMin(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredMin(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredMax(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredMax(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredMax(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredMax(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredAnd(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredAnd(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredAnd(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredAnd(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredOr(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredOr(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredOr(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredOr(data[3].u16, 1); + + data[invocation].u16.x = subgroupClusteredXor(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupClusteredXor(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupClusteredXor(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupClusteredXor(data[3].u16, 1); + + data[invocation].i64.x = subgroupClusteredAdd(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredAdd(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredAdd(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredAdd(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredMul(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredMul(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredMul(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredMul(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredMin(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredMin(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredMin(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredMin(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredMax(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredMax(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredMax(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredMax(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredAnd(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredAnd(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredAnd(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredAnd(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredOr(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredOr(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredOr(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredOr(data[3].i64, 1); + + data[invocation].i64.x = subgroupClusteredXor(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupClusteredXor(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupClusteredXor(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupClusteredXor(data[3].i64, 1); + + data[invocation].u64.x = subgroupClusteredAdd(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredAdd(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredAdd(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredAdd(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredMul(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredMul(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredMul(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredMul(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredMin(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredMin(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredMin(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredMin(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredMax(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredMax(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredMax(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredMax(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredAnd(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredAnd(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredAnd(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredAnd(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredOr(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredOr(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredOr(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredOr(data[3].u64, 1); + + data[invocation].u64.x = subgroupClusteredXor(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupClusteredXor(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupClusteredXor(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupClusteredXor(data[3].u64, 1); + + data[invocation].f16.x = subgroupClusteredAdd(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredAdd(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredAdd(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredAdd(data[3].f16, 1); + + data[invocation].f16.x = subgroupClusteredMul(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredMul(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredMul(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredMul(data[3].f16, 1); + + data[invocation].f16.x = subgroupClusteredMin(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredMin(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredMin(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredMin(data[3].f16, 1); + + data[invocation].f16.x = subgroupClusteredMax(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupClusteredMax(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupClusteredMax(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupClusteredMax(data[3].f16, 1); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitioned.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitioned.comp index bfdef75cb..382a5b366 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitioned.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitioned.comp @@ -1,291 +1,291 @@ -#version 450 - -#extension GL_NV_shader_subgroup_partitioned: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 ballot; - ballot = subgroupPartitionNV(data[0].i8.x); - ballot = subgroupPartitionNV(data[1].i8.xy); - ballot = subgroupPartitionNV(data[2].i8.xyz); - ballot = subgroupPartitionNV(data[3].i8); - - ballot = subgroupPartitionNV(data[0].u8.x); - ballot = subgroupPartitionNV(data[1].u8.xy); - ballot = subgroupPartitionNV(data[2].u8.xyz); - ballot = subgroupPartitionNV(data[3].u8); - - ballot = subgroupPartitionNV(data[0].i16.x); - ballot = subgroupPartitionNV(data[1].i16.xy); - ballot = subgroupPartitionNV(data[2].i16.xyz); - ballot = subgroupPartitionNV(data[3].i16); - - ballot = subgroupPartitionNV(data[0].u16.x); - ballot = subgroupPartitionNV(data[1].u16.xy); - ballot = subgroupPartitionNV(data[2].u16.xyz); - ballot = subgroupPartitionNV(data[3].u16); - - ballot = subgroupPartitionNV(data[0].i64.x); - ballot = subgroupPartitionNV(data[1].i64.xy); - ballot = subgroupPartitionNV(data[2].i64.xyz); - ballot = subgroupPartitionNV(data[3].i64); - - ballot = subgroupPartitionNV(data[0].u64.x); - ballot = subgroupPartitionNV(data[1].u64.xy); - ballot = subgroupPartitionNV(data[2].u64.xyz); - ballot = subgroupPartitionNV(data[3].u64); - - ballot = subgroupPartitionNV(data[0].f16.x); - ballot = subgroupPartitionNV(data[1].f16.xy); - ballot = subgroupPartitionNV(data[2].f16.xyz); - ballot = subgroupPartitionNV(data[3].f16); - - data[invocation].i8.x = subgroupPartitionedAddNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedAddNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedAddNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedAddNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedMulNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedMulNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedMulNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedMulNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedMinNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedMinNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedMinNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedMinNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedMaxNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedMaxNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedMaxNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedMaxNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedAndNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedAndNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedAndNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedAndNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedOrNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedOrNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedOrNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedOrNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedXorNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedXorNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedXorNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedXorNV(data[3].i8, ballot); - - data[invocation].u8.x = subgroupPartitionedAddNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedAddNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedAddNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedAddNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedMulNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedMulNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedMulNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedMulNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedMinNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedMinNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedMinNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedMinNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedMaxNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedMaxNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedMaxNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedMaxNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedAndNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedAndNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedAndNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedAndNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedOrNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedOrNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedOrNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedOrNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedXorNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedXorNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedXorNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedXorNV(data[3].u8, ballot); - - data[invocation].i16.x = subgroupPartitionedAddNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedAddNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedAddNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedAddNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedMulNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedMulNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedMulNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedMulNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedMinNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedMinNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedMinNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedMinNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedMaxNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedMaxNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedMaxNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedMaxNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedAndNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedAndNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedAndNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedAndNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedOrNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedOrNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedOrNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedOrNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedXorNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedXorNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedXorNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedXorNV(data[3].i16, ballot); - - data[invocation].u16.x = subgroupPartitionedAddNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedAddNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedAddNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedAddNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedMulNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedMulNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedMulNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedMulNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedMinNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedMinNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedMinNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedMinNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedMaxNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedMaxNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedMaxNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedMaxNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedAndNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedAndNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedAndNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedAndNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedOrNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedOrNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedOrNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedOrNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedXorNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedXorNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedXorNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedXorNV(data[3].u16, ballot); - - data[invocation].i64.x = subgroupPartitionedAddNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedAddNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedAddNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedAddNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedMulNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedMulNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedMulNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedMulNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedMinNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedMinNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedMinNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedMinNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedMaxNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedMaxNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedMaxNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedMaxNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedAndNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedAndNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedAndNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedAndNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedOrNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedOrNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedOrNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedOrNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedXorNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedXorNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedXorNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedXorNV(data[3].i64, ballot); - - data[invocation].u64.x = subgroupPartitionedAddNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedAddNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedAddNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedAddNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedMulNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedMulNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedMulNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedMulNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedMinNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedMinNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedMinNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedMinNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedMaxNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedMaxNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedMaxNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedMaxNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedAndNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedAndNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedAndNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedAndNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedOrNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedOrNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedOrNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedOrNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedXorNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedXorNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedXorNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedXorNV(data[3].u64, ballot); - - data[invocation].f16.x = subgroupPartitionedAddNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedAddNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedAddNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedAddNV(data[3].f16, ballot); - - data[invocation].f16.x = subgroupPartitionedMulNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedMulNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedMulNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedMulNV(data[3].f16, ballot); - - data[invocation].f16.x = subgroupPartitionedMinNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedMinNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedMinNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedMinNV(data[3].f16, ballot); - - data[invocation].f16.x = subgroupPartitionedMaxNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedMaxNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedMaxNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedMaxNV(data[3].f16, ballot); -} +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot; + ballot = subgroupPartitionNV(data[0].i8.x); + ballot = subgroupPartitionNV(data[1].i8.xy); + ballot = subgroupPartitionNV(data[2].i8.xyz); + ballot = subgroupPartitionNV(data[3].i8); + + ballot = subgroupPartitionNV(data[0].u8.x); + ballot = subgroupPartitionNV(data[1].u8.xy); + ballot = subgroupPartitionNV(data[2].u8.xyz); + ballot = subgroupPartitionNV(data[3].u8); + + ballot = subgroupPartitionNV(data[0].i16.x); + ballot = subgroupPartitionNV(data[1].i16.xy); + ballot = subgroupPartitionNV(data[2].i16.xyz); + ballot = subgroupPartitionNV(data[3].i16); + + ballot = subgroupPartitionNV(data[0].u16.x); + ballot = subgroupPartitionNV(data[1].u16.xy); + ballot = subgroupPartitionNV(data[2].u16.xyz); + ballot = subgroupPartitionNV(data[3].u16); + + ballot = subgroupPartitionNV(data[0].i64.x); + ballot = subgroupPartitionNV(data[1].i64.xy); + ballot = subgroupPartitionNV(data[2].i64.xyz); + ballot = subgroupPartitionNV(data[3].i64); + + ballot = subgroupPartitionNV(data[0].u64.x); + ballot = subgroupPartitionNV(data[1].u64.xy); + ballot = subgroupPartitionNV(data[2].u64.xyz); + ballot = subgroupPartitionNV(data[3].u64); + + ballot = subgroupPartitionNV(data[0].f16.x); + ballot = subgroupPartitionNV(data[1].f16.xy); + ballot = subgroupPartitionNV(data[2].f16.xyz); + ballot = subgroupPartitionNV(data[3].f16); + + data[invocation].i8.x = subgroupPartitionedAddNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedAddNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedAddNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedAddNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedMulNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedMulNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedMulNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedMulNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedMinNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedMinNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedMinNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedMinNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedMaxNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedMaxNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedMaxNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedMaxNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedAndNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedAndNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedAndNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedAndNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedOrNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedOrNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedOrNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedOrNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedXorNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedXorNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedXorNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedXorNV(data[3].i8, ballot); + + data[invocation].u8.x = subgroupPartitionedAddNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedAddNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedAddNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedAddNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedMulNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedMulNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedMulNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedMulNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedMinNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedMinNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedMinNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedMinNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedMaxNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedMaxNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedMaxNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedMaxNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedAndNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedAndNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedAndNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedAndNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedOrNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedOrNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedOrNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedOrNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedXorNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedXorNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedXorNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedXorNV(data[3].u8, ballot); + + data[invocation].i16.x = subgroupPartitionedAddNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedAddNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedAddNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedAddNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedMulNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedMulNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedMulNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedMulNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedMinNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedMinNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedMinNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedMinNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedMaxNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedMaxNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedMaxNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedMaxNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedAndNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedAndNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedAndNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedAndNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedOrNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedOrNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedOrNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedOrNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedXorNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedXorNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedXorNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedXorNV(data[3].i16, ballot); + + data[invocation].u16.x = subgroupPartitionedAddNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedAddNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedAddNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedAddNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedMulNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedMulNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedMulNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedMulNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedMinNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedMinNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedMinNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedMinNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedMaxNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedMaxNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedMaxNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedMaxNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedAndNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedAndNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedAndNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedAndNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedOrNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedOrNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedOrNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedOrNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedXorNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedXorNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedXorNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedXorNV(data[3].u16, ballot); + + data[invocation].i64.x = subgroupPartitionedAddNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedAddNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedAddNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedAddNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedMulNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedMulNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedMulNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedMulNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedMinNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedMinNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedMinNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedMinNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedMaxNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedMaxNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedMaxNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedMaxNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedAndNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedAndNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedAndNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedAndNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedOrNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedOrNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedOrNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedOrNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedXorNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedXorNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedXorNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedXorNV(data[3].i64, ballot); + + data[invocation].u64.x = subgroupPartitionedAddNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedAddNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedAddNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedAddNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedMulNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedMulNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedMulNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedMulNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedMinNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedMinNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedMinNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedMinNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedMaxNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedMaxNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedMaxNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedMaxNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedAndNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedAndNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedAndNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedAndNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedOrNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedOrNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedOrNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedOrNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedXorNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedXorNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedXorNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedXorNV(data[3].u64, ballot); + + data[invocation].f16.x = subgroupPartitionedAddNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedAddNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedAddNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedAddNV(data[3].f16, ballot); + + data[invocation].f16.x = subgroupPartitionedMulNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedMulNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedMulNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedMulNV(data[3].f16, ballot); + + data[invocation].f16.x = subgroupPartitionedMinNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedMinNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedMinNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedMinNV(data[3].f16, ballot); + + data[invocation].f16.x = subgroupPartitionedMaxNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedMaxNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedMaxNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedMaxNV(data[3].f16, ballot); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitionedNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitionedNeg.comp index f2f6a4f41..ad94e35de 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitionedNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesPartitionedNeg.comp @@ -1,291 +1,291 @@ -#version 450 - -#extension GL_NV_shader_subgroup_partitioned: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 ballot; - ballot = subgroupPartitionNV(data[0].i8.x); - ballot = subgroupPartitionNV(data[1].i8.xy); - ballot = subgroupPartitionNV(data[2].i8.xyz); - ballot = subgroupPartitionNV(data[3].i8); - - ballot = subgroupPartitionNV(data[0].u8.x); - ballot = subgroupPartitionNV(data[1].u8.xy); - ballot = subgroupPartitionNV(data[2].u8.xyz); - ballot = subgroupPartitionNV(data[3].u8); - - ballot = subgroupPartitionNV(data[0].i16.x); - ballot = subgroupPartitionNV(data[1].i16.xy); - ballot = subgroupPartitionNV(data[2].i16.xyz); - ballot = subgroupPartitionNV(data[3].i16); - - ballot = subgroupPartitionNV(data[0].u16.x); - ballot = subgroupPartitionNV(data[1].u16.xy); - ballot = subgroupPartitionNV(data[2].u16.xyz); - ballot = subgroupPartitionNV(data[3].u16); - - ballot = subgroupPartitionNV(data[0].i64.x); - ballot = subgroupPartitionNV(data[1].i64.xy); - ballot = subgroupPartitionNV(data[2].i64.xyz); - ballot = subgroupPartitionNV(data[3].i64); - - ballot = subgroupPartitionNV(data[0].u64.x); - ballot = subgroupPartitionNV(data[1].u64.xy); - ballot = subgroupPartitionNV(data[2].u64.xyz); - ballot = subgroupPartitionNV(data[3].u64); - - ballot = subgroupPartitionNV(data[0].f16.x); - ballot = subgroupPartitionNV(data[1].f16.xy); - ballot = subgroupPartitionNV(data[2].f16.xyz); - ballot = subgroupPartitionNV(data[3].f16); - - data[invocation].i8.x = subgroupPartitionedAddNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedAddNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedAddNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedAddNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedMulNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedMulNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedMulNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedMulNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedMinNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedMinNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedMinNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedMinNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedMaxNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedMaxNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedMaxNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedMaxNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedAndNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedAndNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedAndNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedAndNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedOrNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedOrNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedOrNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedOrNV(data[3].i8, ballot); - - data[invocation].i8.x = subgroupPartitionedXorNV(data[0].i8.x, ballot); - data[invocation].i8.xy = subgroupPartitionedXorNV(data[1].i8.xy, ballot); - data[invocation].i8.xyz = subgroupPartitionedXorNV(data[2].i8.xyz, ballot); - data[invocation].i8 = subgroupPartitionedXorNV(data[3].i8, ballot); - - data[invocation].u8.x = subgroupPartitionedAddNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedAddNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedAddNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedAddNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedMulNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedMulNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedMulNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedMulNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedMinNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedMinNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedMinNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedMinNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedMaxNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedMaxNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedMaxNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedMaxNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedAndNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedAndNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedAndNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedAndNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedOrNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedOrNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedOrNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedOrNV(data[3].u8, ballot); - - data[invocation].u8.x = subgroupPartitionedXorNV(data[0].u8.x, ballot); - data[invocation].u8.xy = subgroupPartitionedXorNV(data[1].u8.xy, ballot); - data[invocation].u8.xyz = subgroupPartitionedXorNV(data[2].u8.xyz, ballot); - data[invocation].u8 = subgroupPartitionedXorNV(data[3].u8, ballot); - - data[invocation].i16.x = subgroupPartitionedAddNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedAddNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedAddNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedAddNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedMulNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedMulNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedMulNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedMulNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedMinNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedMinNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedMinNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedMinNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedMaxNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedMaxNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedMaxNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedMaxNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedAndNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedAndNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedAndNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedAndNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedOrNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedOrNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedOrNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedOrNV(data[3].i16, ballot); - - data[invocation].i16.x = subgroupPartitionedXorNV(data[0].i16.x, ballot); - data[invocation].i16.xy = subgroupPartitionedXorNV(data[1].i16.xy, ballot); - data[invocation].i16.xyz = subgroupPartitionedXorNV(data[2].i16.xyz, ballot); - data[invocation].i16 = subgroupPartitionedXorNV(data[3].i16, ballot); - - data[invocation].u16.x = subgroupPartitionedAddNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedAddNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedAddNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedAddNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedMulNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedMulNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedMulNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedMulNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedMinNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedMinNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedMinNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedMinNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedMaxNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedMaxNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedMaxNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedMaxNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedAndNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedAndNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedAndNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedAndNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedOrNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedOrNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedOrNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedOrNV(data[3].u16, ballot); - - data[invocation].u16.x = subgroupPartitionedXorNV(data[0].u16.x, ballot); - data[invocation].u16.xy = subgroupPartitionedXorNV(data[1].u16.xy, ballot); - data[invocation].u16.xyz = subgroupPartitionedXorNV(data[2].u16.xyz, ballot); - data[invocation].u16 = subgroupPartitionedXorNV(data[3].u16, ballot); - - data[invocation].i64.x = subgroupPartitionedAddNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedAddNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedAddNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedAddNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedMulNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedMulNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedMulNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedMulNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedMinNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedMinNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedMinNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedMinNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedMaxNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedMaxNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedMaxNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedMaxNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedAndNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedAndNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedAndNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedAndNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedOrNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedOrNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedOrNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedOrNV(data[3].i64, ballot); - - data[invocation].i64.x = subgroupPartitionedXorNV(data[0].i64.x, ballot); - data[invocation].i64.xy = subgroupPartitionedXorNV(data[1].i64.xy, ballot); - data[invocation].i64.xyz = subgroupPartitionedXorNV(data[2].i64.xyz, ballot); - data[invocation].i64 = subgroupPartitionedXorNV(data[3].i64, ballot); - - data[invocation].u64.x = subgroupPartitionedAddNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedAddNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedAddNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedAddNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedMulNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedMulNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedMulNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedMulNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedMinNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedMinNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedMinNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedMinNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedMaxNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedMaxNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedMaxNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedMaxNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedAndNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedAndNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedAndNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedAndNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedOrNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedOrNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedOrNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedOrNV(data[3].u64, ballot); - - data[invocation].u64.x = subgroupPartitionedXorNV(data[0].u64.x, ballot); - data[invocation].u64.xy = subgroupPartitionedXorNV(data[1].u64.xy, ballot); - data[invocation].u64.xyz = subgroupPartitionedXorNV(data[2].u64.xyz, ballot); - data[invocation].u64 = subgroupPartitionedXorNV(data[3].u64, ballot); - - data[invocation].f16.x = subgroupPartitionedAddNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedAddNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedAddNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedAddNV(data[3].f16, ballot); - - data[invocation].f16.x = subgroupPartitionedMulNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedMulNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedMulNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedMulNV(data[3].f16, ballot); - - data[invocation].f16.x = subgroupPartitionedMinNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedMinNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedMinNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedMinNV(data[3].f16, ballot); - - data[invocation].f16.x = subgroupPartitionedMaxNV(data[0].f16.x, ballot); - data[invocation].f16.xy = subgroupPartitionedMaxNV(data[1].f16.xy, ballot); - data[invocation].f16.xyz = subgroupPartitionedMaxNV(data[2].f16.xyz, ballot); - data[invocation].f16 = subgroupPartitionedMaxNV(data[3].f16, ballot); -} +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot; + ballot = subgroupPartitionNV(data[0].i8.x); + ballot = subgroupPartitionNV(data[1].i8.xy); + ballot = subgroupPartitionNV(data[2].i8.xyz); + ballot = subgroupPartitionNV(data[3].i8); + + ballot = subgroupPartitionNV(data[0].u8.x); + ballot = subgroupPartitionNV(data[1].u8.xy); + ballot = subgroupPartitionNV(data[2].u8.xyz); + ballot = subgroupPartitionNV(data[3].u8); + + ballot = subgroupPartitionNV(data[0].i16.x); + ballot = subgroupPartitionNV(data[1].i16.xy); + ballot = subgroupPartitionNV(data[2].i16.xyz); + ballot = subgroupPartitionNV(data[3].i16); + + ballot = subgroupPartitionNV(data[0].u16.x); + ballot = subgroupPartitionNV(data[1].u16.xy); + ballot = subgroupPartitionNV(data[2].u16.xyz); + ballot = subgroupPartitionNV(data[3].u16); + + ballot = subgroupPartitionNV(data[0].i64.x); + ballot = subgroupPartitionNV(data[1].i64.xy); + ballot = subgroupPartitionNV(data[2].i64.xyz); + ballot = subgroupPartitionNV(data[3].i64); + + ballot = subgroupPartitionNV(data[0].u64.x); + ballot = subgroupPartitionNV(data[1].u64.xy); + ballot = subgroupPartitionNV(data[2].u64.xyz); + ballot = subgroupPartitionNV(data[3].u64); + + ballot = subgroupPartitionNV(data[0].f16.x); + ballot = subgroupPartitionNV(data[1].f16.xy); + ballot = subgroupPartitionNV(data[2].f16.xyz); + ballot = subgroupPartitionNV(data[3].f16); + + data[invocation].i8.x = subgroupPartitionedAddNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedAddNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedAddNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedAddNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedMulNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedMulNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedMulNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedMulNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedMinNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedMinNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedMinNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedMinNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedMaxNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedMaxNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedMaxNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedMaxNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedAndNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedAndNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedAndNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedAndNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedOrNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedOrNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedOrNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedOrNV(data[3].i8, ballot); + + data[invocation].i8.x = subgroupPartitionedXorNV(data[0].i8.x, ballot); + data[invocation].i8.xy = subgroupPartitionedXorNV(data[1].i8.xy, ballot); + data[invocation].i8.xyz = subgroupPartitionedXorNV(data[2].i8.xyz, ballot); + data[invocation].i8 = subgroupPartitionedXorNV(data[3].i8, ballot); + + data[invocation].u8.x = subgroupPartitionedAddNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedAddNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedAddNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedAddNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedMulNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedMulNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedMulNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedMulNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedMinNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedMinNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedMinNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedMinNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedMaxNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedMaxNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedMaxNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedMaxNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedAndNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedAndNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedAndNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedAndNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedOrNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedOrNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedOrNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedOrNV(data[3].u8, ballot); + + data[invocation].u8.x = subgroupPartitionedXorNV(data[0].u8.x, ballot); + data[invocation].u8.xy = subgroupPartitionedXorNV(data[1].u8.xy, ballot); + data[invocation].u8.xyz = subgroupPartitionedXorNV(data[2].u8.xyz, ballot); + data[invocation].u8 = subgroupPartitionedXorNV(data[3].u8, ballot); + + data[invocation].i16.x = subgroupPartitionedAddNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedAddNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedAddNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedAddNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedMulNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedMulNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedMulNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedMulNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedMinNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedMinNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedMinNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedMinNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedMaxNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedMaxNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedMaxNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedMaxNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedAndNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedAndNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedAndNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedAndNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedOrNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedOrNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedOrNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedOrNV(data[3].i16, ballot); + + data[invocation].i16.x = subgroupPartitionedXorNV(data[0].i16.x, ballot); + data[invocation].i16.xy = subgroupPartitionedXorNV(data[1].i16.xy, ballot); + data[invocation].i16.xyz = subgroupPartitionedXorNV(data[2].i16.xyz, ballot); + data[invocation].i16 = subgroupPartitionedXorNV(data[3].i16, ballot); + + data[invocation].u16.x = subgroupPartitionedAddNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedAddNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedAddNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedAddNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedMulNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedMulNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedMulNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedMulNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedMinNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedMinNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedMinNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedMinNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedMaxNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedMaxNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedMaxNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedMaxNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedAndNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedAndNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedAndNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedAndNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedOrNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedOrNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedOrNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedOrNV(data[3].u16, ballot); + + data[invocation].u16.x = subgroupPartitionedXorNV(data[0].u16.x, ballot); + data[invocation].u16.xy = subgroupPartitionedXorNV(data[1].u16.xy, ballot); + data[invocation].u16.xyz = subgroupPartitionedXorNV(data[2].u16.xyz, ballot); + data[invocation].u16 = subgroupPartitionedXorNV(data[3].u16, ballot); + + data[invocation].i64.x = subgroupPartitionedAddNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedAddNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedAddNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedAddNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedMulNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedMulNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedMulNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedMulNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedMinNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedMinNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedMinNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedMinNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedMaxNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedMaxNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedMaxNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedMaxNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedAndNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedAndNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedAndNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedAndNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedOrNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedOrNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedOrNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedOrNV(data[3].i64, ballot); + + data[invocation].i64.x = subgroupPartitionedXorNV(data[0].i64.x, ballot); + data[invocation].i64.xy = subgroupPartitionedXorNV(data[1].i64.xy, ballot); + data[invocation].i64.xyz = subgroupPartitionedXorNV(data[2].i64.xyz, ballot); + data[invocation].i64 = subgroupPartitionedXorNV(data[3].i64, ballot); + + data[invocation].u64.x = subgroupPartitionedAddNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedAddNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedAddNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedAddNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedMulNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedMulNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedMulNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedMulNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedMinNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedMinNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedMinNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedMinNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedMaxNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedMaxNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedMaxNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedMaxNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedAndNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedAndNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedAndNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedAndNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedOrNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedOrNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedOrNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedOrNV(data[3].u64, ballot); + + data[invocation].u64.x = subgroupPartitionedXorNV(data[0].u64.x, ballot); + data[invocation].u64.xy = subgroupPartitionedXorNV(data[1].u64.xy, ballot); + data[invocation].u64.xyz = subgroupPartitionedXorNV(data[2].u64.xyz, ballot); + data[invocation].u64 = subgroupPartitionedXorNV(data[3].u64, ballot); + + data[invocation].f16.x = subgroupPartitionedAddNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedAddNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedAddNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedAddNV(data[3].f16, ballot); + + data[invocation].f16.x = subgroupPartitionedMulNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedMulNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedMulNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedMulNV(data[3].f16, ballot); + + data[invocation].f16.x = subgroupPartitionedMinNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedMinNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedMinNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedMinNV(data[3].f16, ballot); + + data[invocation].f16.x = subgroupPartitionedMaxNV(data[0].f16.x, ballot); + data[invocation].f16.xy = subgroupPartitionedMaxNV(data[1].f16.xy, ballot); + data[invocation].f16.xyz = subgroupPartitionedMaxNV(data[2].f16.xyz, ballot); + data[invocation].f16 = subgroupPartitionedMaxNV(data[3].f16, ballot); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesQuad.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesQuad.comp index 3a7b169ef..1ef2ecf97 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesQuad.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesQuad.comp @@ -1,165 +1,165 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_quad: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupQuadBroadcast(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupQuadBroadcast(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupQuadBroadcast(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupQuadBroadcast(data[3].i8, 1); - - data[invocation].i8.x = subgroupQuadSwapHorizontal(data[0].i8.x); - data[invocation].i8.xy = subgroupQuadSwapHorizontal(data[1].i8.xy); - data[invocation].i8.xyz = subgroupQuadSwapHorizontal(data[2].i8.xyz); - data[invocation].i8 = subgroupQuadSwapHorizontal(data[3].i8); - - data[invocation].i8.x = subgroupQuadSwapVertical(data[0].i8.x); - data[invocation].i8.xy = subgroupQuadSwapVertical(data[1].i8.xy); - data[invocation].i8.xyz = subgroupQuadSwapVertical(data[2].i8.xyz); - data[invocation].i8 = subgroupQuadSwapVertical(data[3].i8); - - data[invocation].i8.x = subgroupQuadSwapDiagonal(data[0].i8.x); - data[invocation].i8.xy = subgroupQuadSwapDiagonal(data[1].i8.xy); - data[invocation].i8.xyz = subgroupQuadSwapDiagonal(data[2].i8.xyz); - data[invocation].i8 = subgroupQuadSwapDiagonal(data[3].i8); - - data[invocation].u8.x = subgroupQuadBroadcast(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupQuadBroadcast(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupQuadBroadcast(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupQuadBroadcast(data[3].u8, 1); - - data[invocation].u8.x = subgroupQuadSwapHorizontal(data[0].u8.x); - data[invocation].u8.xy = subgroupQuadSwapHorizontal(data[1].u8.xy); - data[invocation].u8.xyz = subgroupQuadSwapHorizontal(data[2].u8.xyz); - data[invocation].u8 = subgroupQuadSwapHorizontal(data[3].u8); - - data[invocation].u8.x = subgroupQuadSwapVertical(data[0].u8.x); - data[invocation].u8.xy = subgroupQuadSwapVertical(data[1].u8.xy); - data[invocation].u8.xyz = subgroupQuadSwapVertical(data[2].u8.xyz); - data[invocation].u8 = subgroupQuadSwapVertical(data[3].u8); - - data[invocation].u8.x = subgroupQuadSwapDiagonal(data[0].u8.x); - data[invocation].u8.xy = subgroupQuadSwapDiagonal(data[1].u8.xy); - data[invocation].u8.xyz = subgroupQuadSwapDiagonal(data[2].u8.xyz); - data[invocation].u8 = subgroupQuadSwapDiagonal(data[3].u8); - - data[invocation].i16.x = subgroupQuadBroadcast(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupQuadBroadcast(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupQuadBroadcast(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupQuadBroadcast(data[3].i16, 1); - - data[invocation].i16.x = subgroupQuadSwapHorizontal(data[0].i16.x); - data[invocation].i16.xy = subgroupQuadSwapHorizontal(data[1].i16.xy); - data[invocation].i16.xyz = subgroupQuadSwapHorizontal(data[2].i16.xyz); - data[invocation].i16 = subgroupQuadSwapHorizontal(data[3].i16); - - data[invocation].i16.x = subgroupQuadSwapVertical(data[0].i16.x); - data[invocation].i16.xy = subgroupQuadSwapVertical(data[1].i16.xy); - data[invocation].i16.xyz = subgroupQuadSwapVertical(data[2].i16.xyz); - data[invocation].i16 = subgroupQuadSwapVertical(data[3].i16); - - data[invocation].i16.x = subgroupQuadSwapDiagonal(data[0].i16.x); - data[invocation].i16.xy = subgroupQuadSwapDiagonal(data[1].i16.xy); - data[invocation].i16.xyz = subgroupQuadSwapDiagonal(data[2].i16.xyz); - data[invocation].i16 = subgroupQuadSwapDiagonal(data[3].i16); - - data[invocation].u16.x = subgroupQuadBroadcast(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupQuadBroadcast(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupQuadBroadcast(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupQuadBroadcast(data[3].u16, 1); - - data[invocation].u16.x = subgroupQuadSwapHorizontal(data[0].u16.x); - data[invocation].u16.xy = subgroupQuadSwapHorizontal(data[1].u16.xy); - data[invocation].u16.xyz = subgroupQuadSwapHorizontal(data[2].u16.xyz); - data[invocation].u16 = subgroupQuadSwapHorizontal(data[3].u16); - - data[invocation].u16.x = subgroupQuadSwapVertical(data[0].u16.x); - data[invocation].u16.xy = subgroupQuadSwapVertical(data[1].u16.xy); - data[invocation].u16.xyz = subgroupQuadSwapVertical(data[2].u16.xyz); - data[invocation].u16 = subgroupQuadSwapVertical(data[3].u16); - - data[invocation].u16.x = subgroupQuadSwapDiagonal(data[0].u16.x); - data[invocation].u16.xy = subgroupQuadSwapDiagonal(data[1].u16.xy); - data[invocation].u16.xyz = subgroupQuadSwapDiagonal(data[2].u16.xyz); - data[invocation].u16 = subgroupQuadSwapDiagonal(data[3].u16); - - data[invocation].i64.x = subgroupQuadBroadcast(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupQuadBroadcast(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupQuadBroadcast(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupQuadBroadcast(data[3].i64, 1); - - data[invocation].i64.x = subgroupQuadSwapHorizontal(data[0].i64.x); - data[invocation].i64.xy = subgroupQuadSwapHorizontal(data[1].i64.xy); - data[invocation].i64.xyz = subgroupQuadSwapHorizontal(data[2].i64.xyz); - data[invocation].i64 = subgroupQuadSwapHorizontal(data[3].i64); - - data[invocation].i64.x = subgroupQuadSwapVertical(data[0].i64.x); - data[invocation].i64.xy = subgroupQuadSwapVertical(data[1].i64.xy); - data[invocation].i64.xyz = subgroupQuadSwapVertical(data[2].i64.xyz); - data[invocation].i64 = subgroupQuadSwapVertical(data[3].i64); - - data[invocation].i64.x = subgroupQuadSwapDiagonal(data[0].i64.x); - data[invocation].i64.xy = subgroupQuadSwapDiagonal(data[1].i64.xy); - data[invocation].i64.xyz = subgroupQuadSwapDiagonal(data[2].i64.xyz); - data[invocation].i64 = subgroupQuadSwapDiagonal(data[3].i64); - - data[invocation].u64.x = subgroupQuadBroadcast(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupQuadBroadcast(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupQuadBroadcast(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupQuadBroadcast(data[3].u64, 1); - - data[invocation].u64.x = subgroupQuadSwapHorizontal(data[0].u64.x); - data[invocation].u64.xy = subgroupQuadSwapHorizontal(data[1].u64.xy); - data[invocation].u64.xyz = subgroupQuadSwapHorizontal(data[2].u64.xyz); - data[invocation].u64 = subgroupQuadSwapHorizontal(data[3].u64); - - data[invocation].u64.x = subgroupQuadSwapVertical(data[0].u64.x); - data[invocation].u64.xy = subgroupQuadSwapVertical(data[1].u64.xy); - data[invocation].u64.xyz = subgroupQuadSwapVertical(data[2].u64.xyz); - data[invocation].u64 = subgroupQuadSwapVertical(data[3].u64); - - data[invocation].u64.x = subgroupQuadSwapDiagonal(data[0].u64.x); - data[invocation].u64.xy = subgroupQuadSwapDiagonal(data[1].u64.xy); - data[invocation].u64.xyz = subgroupQuadSwapDiagonal(data[2].u64.xyz); - data[invocation].u64 = subgroupQuadSwapDiagonal(data[3].u64); - - data[invocation].f16.x = subgroupQuadBroadcast(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupQuadBroadcast(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupQuadBroadcast(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupQuadBroadcast(data[3].f16, 1); - - data[invocation].f16.x = subgroupQuadSwapHorizontal(data[0].f16.x); - data[invocation].f16.xy = subgroupQuadSwapHorizontal(data[1].f16.xy); - data[invocation].f16.xyz = subgroupQuadSwapHorizontal(data[2].f16.xyz); - data[invocation].f16 = subgroupQuadSwapHorizontal(data[3].f16); - - data[invocation].f16.x = subgroupQuadSwapVertical(data[0].f16.x); - data[invocation].f16.xy = subgroupQuadSwapVertical(data[1].f16.xy); - data[invocation].f16.xyz = subgroupQuadSwapVertical(data[2].f16.xyz); - data[invocation].f16 = subgroupQuadSwapVertical(data[3].f16); - - data[invocation].f16.x = subgroupQuadSwapDiagonal(data[0].f16.x); - data[invocation].f16.xy = subgroupQuadSwapDiagonal(data[1].f16.xy); - data[invocation].f16.xyz = subgroupQuadSwapDiagonal(data[2].f16.xyz); - data[invocation].f16 = subgroupQuadSwapDiagonal(data[3].f16); -} +#version 450 + +#extension GL_KHR_shader_subgroup_quad: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupQuadBroadcast(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupQuadBroadcast(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupQuadBroadcast(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupQuadBroadcast(data[3].i8, 1); + + data[invocation].i8.x = subgroupQuadSwapHorizontal(data[0].i8.x); + data[invocation].i8.xy = subgroupQuadSwapHorizontal(data[1].i8.xy); + data[invocation].i8.xyz = subgroupQuadSwapHorizontal(data[2].i8.xyz); + data[invocation].i8 = subgroupQuadSwapHorizontal(data[3].i8); + + data[invocation].i8.x = subgroupQuadSwapVertical(data[0].i8.x); + data[invocation].i8.xy = subgroupQuadSwapVertical(data[1].i8.xy); + data[invocation].i8.xyz = subgroupQuadSwapVertical(data[2].i8.xyz); + data[invocation].i8 = subgroupQuadSwapVertical(data[3].i8); + + data[invocation].i8.x = subgroupQuadSwapDiagonal(data[0].i8.x); + data[invocation].i8.xy = subgroupQuadSwapDiagonal(data[1].i8.xy); + data[invocation].i8.xyz = subgroupQuadSwapDiagonal(data[2].i8.xyz); + data[invocation].i8 = subgroupQuadSwapDiagonal(data[3].i8); + + data[invocation].u8.x = subgroupQuadBroadcast(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupQuadBroadcast(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupQuadBroadcast(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupQuadBroadcast(data[3].u8, 1); + + data[invocation].u8.x = subgroupQuadSwapHorizontal(data[0].u8.x); + data[invocation].u8.xy = subgroupQuadSwapHorizontal(data[1].u8.xy); + data[invocation].u8.xyz = subgroupQuadSwapHorizontal(data[2].u8.xyz); + data[invocation].u8 = subgroupQuadSwapHorizontal(data[3].u8); + + data[invocation].u8.x = subgroupQuadSwapVertical(data[0].u8.x); + data[invocation].u8.xy = subgroupQuadSwapVertical(data[1].u8.xy); + data[invocation].u8.xyz = subgroupQuadSwapVertical(data[2].u8.xyz); + data[invocation].u8 = subgroupQuadSwapVertical(data[3].u8); + + data[invocation].u8.x = subgroupQuadSwapDiagonal(data[0].u8.x); + data[invocation].u8.xy = subgroupQuadSwapDiagonal(data[1].u8.xy); + data[invocation].u8.xyz = subgroupQuadSwapDiagonal(data[2].u8.xyz); + data[invocation].u8 = subgroupQuadSwapDiagonal(data[3].u8); + + data[invocation].i16.x = subgroupQuadBroadcast(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupQuadBroadcast(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupQuadBroadcast(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupQuadBroadcast(data[3].i16, 1); + + data[invocation].i16.x = subgroupQuadSwapHorizontal(data[0].i16.x); + data[invocation].i16.xy = subgroupQuadSwapHorizontal(data[1].i16.xy); + data[invocation].i16.xyz = subgroupQuadSwapHorizontal(data[2].i16.xyz); + data[invocation].i16 = subgroupQuadSwapHorizontal(data[3].i16); + + data[invocation].i16.x = subgroupQuadSwapVertical(data[0].i16.x); + data[invocation].i16.xy = subgroupQuadSwapVertical(data[1].i16.xy); + data[invocation].i16.xyz = subgroupQuadSwapVertical(data[2].i16.xyz); + data[invocation].i16 = subgroupQuadSwapVertical(data[3].i16); + + data[invocation].i16.x = subgroupQuadSwapDiagonal(data[0].i16.x); + data[invocation].i16.xy = subgroupQuadSwapDiagonal(data[1].i16.xy); + data[invocation].i16.xyz = subgroupQuadSwapDiagonal(data[2].i16.xyz); + data[invocation].i16 = subgroupQuadSwapDiagonal(data[3].i16); + + data[invocation].u16.x = subgroupQuadBroadcast(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupQuadBroadcast(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupQuadBroadcast(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupQuadBroadcast(data[3].u16, 1); + + data[invocation].u16.x = subgroupQuadSwapHorizontal(data[0].u16.x); + data[invocation].u16.xy = subgroupQuadSwapHorizontal(data[1].u16.xy); + data[invocation].u16.xyz = subgroupQuadSwapHorizontal(data[2].u16.xyz); + data[invocation].u16 = subgroupQuadSwapHorizontal(data[3].u16); + + data[invocation].u16.x = subgroupQuadSwapVertical(data[0].u16.x); + data[invocation].u16.xy = subgroupQuadSwapVertical(data[1].u16.xy); + data[invocation].u16.xyz = subgroupQuadSwapVertical(data[2].u16.xyz); + data[invocation].u16 = subgroupQuadSwapVertical(data[3].u16); + + data[invocation].u16.x = subgroupQuadSwapDiagonal(data[0].u16.x); + data[invocation].u16.xy = subgroupQuadSwapDiagonal(data[1].u16.xy); + data[invocation].u16.xyz = subgroupQuadSwapDiagonal(data[2].u16.xyz); + data[invocation].u16 = subgroupQuadSwapDiagonal(data[3].u16); + + data[invocation].i64.x = subgroupQuadBroadcast(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupQuadBroadcast(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupQuadBroadcast(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupQuadBroadcast(data[3].i64, 1); + + data[invocation].i64.x = subgroupQuadSwapHorizontal(data[0].i64.x); + data[invocation].i64.xy = subgroupQuadSwapHorizontal(data[1].i64.xy); + data[invocation].i64.xyz = subgroupQuadSwapHorizontal(data[2].i64.xyz); + data[invocation].i64 = subgroupQuadSwapHorizontal(data[3].i64); + + data[invocation].i64.x = subgroupQuadSwapVertical(data[0].i64.x); + data[invocation].i64.xy = subgroupQuadSwapVertical(data[1].i64.xy); + data[invocation].i64.xyz = subgroupQuadSwapVertical(data[2].i64.xyz); + data[invocation].i64 = subgroupQuadSwapVertical(data[3].i64); + + data[invocation].i64.x = subgroupQuadSwapDiagonal(data[0].i64.x); + data[invocation].i64.xy = subgroupQuadSwapDiagonal(data[1].i64.xy); + data[invocation].i64.xyz = subgroupQuadSwapDiagonal(data[2].i64.xyz); + data[invocation].i64 = subgroupQuadSwapDiagonal(data[3].i64); + + data[invocation].u64.x = subgroupQuadBroadcast(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupQuadBroadcast(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupQuadBroadcast(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupQuadBroadcast(data[3].u64, 1); + + data[invocation].u64.x = subgroupQuadSwapHorizontal(data[0].u64.x); + data[invocation].u64.xy = subgroupQuadSwapHorizontal(data[1].u64.xy); + data[invocation].u64.xyz = subgroupQuadSwapHorizontal(data[2].u64.xyz); + data[invocation].u64 = subgroupQuadSwapHorizontal(data[3].u64); + + data[invocation].u64.x = subgroupQuadSwapVertical(data[0].u64.x); + data[invocation].u64.xy = subgroupQuadSwapVertical(data[1].u64.xy); + data[invocation].u64.xyz = subgroupQuadSwapVertical(data[2].u64.xyz); + data[invocation].u64 = subgroupQuadSwapVertical(data[3].u64); + + data[invocation].u64.x = subgroupQuadSwapDiagonal(data[0].u64.x); + data[invocation].u64.xy = subgroupQuadSwapDiagonal(data[1].u64.xy); + data[invocation].u64.xyz = subgroupQuadSwapDiagonal(data[2].u64.xyz); + data[invocation].u64 = subgroupQuadSwapDiagonal(data[3].u64); + + data[invocation].f16.x = subgroupQuadBroadcast(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupQuadBroadcast(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupQuadBroadcast(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupQuadBroadcast(data[3].f16, 1); + + data[invocation].f16.x = subgroupQuadSwapHorizontal(data[0].f16.x); + data[invocation].f16.xy = subgroupQuadSwapHorizontal(data[1].f16.xy); + data[invocation].f16.xyz = subgroupQuadSwapHorizontal(data[2].f16.xyz); + data[invocation].f16 = subgroupQuadSwapHorizontal(data[3].f16); + + data[invocation].f16.x = subgroupQuadSwapVertical(data[0].f16.x); + data[invocation].f16.xy = subgroupQuadSwapVertical(data[1].f16.xy); + data[invocation].f16.xyz = subgroupQuadSwapVertical(data[2].f16.xyz); + data[invocation].f16 = subgroupQuadSwapVertical(data[3].f16); + + data[invocation].f16.x = subgroupQuadSwapDiagonal(data[0].f16.x); + data[invocation].f16.xy = subgroupQuadSwapDiagonal(data[1].f16.xy); + data[invocation].f16.xyz = subgroupQuadSwapDiagonal(data[2].f16.xyz); + data[invocation].f16 = subgroupQuadSwapDiagonal(data[3].f16); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesQuadNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesQuadNeg.comp index a2d02d081..07247767b 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesQuadNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesQuadNeg.comp @@ -1,165 +1,165 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_quad: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupQuadBroadcast(data[0].i8.x, 1); - data[invocation].i8.xy = subgroupQuadBroadcast(data[1].i8.xy, 1); - data[invocation].i8.xyz = subgroupQuadBroadcast(data[2].i8.xyz, 1); - data[invocation].i8 = subgroupQuadBroadcast(data[3].i8, 1); - - data[invocation].i8.x = subgroupQuadSwapHorizontal(data[0].i8.x); - data[invocation].i8.xy = subgroupQuadSwapHorizontal(data[1].i8.xy); - data[invocation].i8.xyz = subgroupQuadSwapHorizontal(data[2].i8.xyz); - data[invocation].i8 = subgroupQuadSwapHorizontal(data[3].i8); - - data[invocation].i8.x = subgroupQuadSwapVertical(data[0].i8.x); - data[invocation].i8.xy = subgroupQuadSwapVertical(data[1].i8.xy); - data[invocation].i8.xyz = subgroupQuadSwapVertical(data[2].i8.xyz); - data[invocation].i8 = subgroupQuadSwapVertical(data[3].i8); - - data[invocation].i8.x = subgroupQuadSwapDiagonal(data[0].i8.x); - data[invocation].i8.xy = subgroupQuadSwapDiagonal(data[1].i8.xy); - data[invocation].i8.xyz = subgroupQuadSwapDiagonal(data[2].i8.xyz); - data[invocation].i8 = subgroupQuadSwapDiagonal(data[3].i8); - - data[invocation].u8.x = subgroupQuadBroadcast(data[0].u8.x, 1); - data[invocation].u8.xy = subgroupQuadBroadcast(data[1].u8.xy, 1); - data[invocation].u8.xyz = subgroupQuadBroadcast(data[2].u8.xyz, 1); - data[invocation].u8 = subgroupQuadBroadcast(data[3].u8, 1); - - data[invocation].u8.x = subgroupQuadSwapHorizontal(data[0].u8.x); - data[invocation].u8.xy = subgroupQuadSwapHorizontal(data[1].u8.xy); - data[invocation].u8.xyz = subgroupQuadSwapHorizontal(data[2].u8.xyz); - data[invocation].u8 = subgroupQuadSwapHorizontal(data[3].u8); - - data[invocation].u8.x = subgroupQuadSwapVertical(data[0].u8.x); - data[invocation].u8.xy = subgroupQuadSwapVertical(data[1].u8.xy); - data[invocation].u8.xyz = subgroupQuadSwapVertical(data[2].u8.xyz); - data[invocation].u8 = subgroupQuadSwapVertical(data[3].u8); - - data[invocation].u8.x = subgroupQuadSwapDiagonal(data[0].u8.x); - data[invocation].u8.xy = subgroupQuadSwapDiagonal(data[1].u8.xy); - data[invocation].u8.xyz = subgroupQuadSwapDiagonal(data[2].u8.xyz); - data[invocation].u8 = subgroupQuadSwapDiagonal(data[3].u8); - - data[invocation].i16.x = subgroupQuadBroadcast(data[0].i16.x, 1); - data[invocation].i16.xy = subgroupQuadBroadcast(data[1].i16.xy, 1); - data[invocation].i16.xyz = subgroupQuadBroadcast(data[2].i16.xyz, 1); - data[invocation].i16 = subgroupQuadBroadcast(data[3].i16, 1); - - data[invocation].i16.x = subgroupQuadSwapHorizontal(data[0].i16.x); - data[invocation].i16.xy = subgroupQuadSwapHorizontal(data[1].i16.xy); - data[invocation].i16.xyz = subgroupQuadSwapHorizontal(data[2].i16.xyz); - data[invocation].i16 = subgroupQuadSwapHorizontal(data[3].i16); - - data[invocation].i16.x = subgroupQuadSwapVertical(data[0].i16.x); - data[invocation].i16.xy = subgroupQuadSwapVertical(data[1].i16.xy); - data[invocation].i16.xyz = subgroupQuadSwapVertical(data[2].i16.xyz); - data[invocation].i16 = subgroupQuadSwapVertical(data[3].i16); - - data[invocation].i16.x = subgroupQuadSwapDiagonal(data[0].i16.x); - data[invocation].i16.xy = subgroupQuadSwapDiagonal(data[1].i16.xy); - data[invocation].i16.xyz = subgroupQuadSwapDiagonal(data[2].i16.xyz); - data[invocation].i16 = subgroupQuadSwapDiagonal(data[3].i16); - - data[invocation].u16.x = subgroupQuadBroadcast(data[0].u16.x, 1); - data[invocation].u16.xy = subgroupQuadBroadcast(data[1].u16.xy, 1); - data[invocation].u16.xyz = subgroupQuadBroadcast(data[2].u16.xyz, 1); - data[invocation].u16 = subgroupQuadBroadcast(data[3].u16, 1); - - data[invocation].u16.x = subgroupQuadSwapHorizontal(data[0].u16.x); - data[invocation].u16.xy = subgroupQuadSwapHorizontal(data[1].u16.xy); - data[invocation].u16.xyz = subgroupQuadSwapHorizontal(data[2].u16.xyz); - data[invocation].u16 = subgroupQuadSwapHorizontal(data[3].u16); - - data[invocation].u16.x = subgroupQuadSwapVertical(data[0].u16.x); - data[invocation].u16.xy = subgroupQuadSwapVertical(data[1].u16.xy); - data[invocation].u16.xyz = subgroupQuadSwapVertical(data[2].u16.xyz); - data[invocation].u16 = subgroupQuadSwapVertical(data[3].u16); - - data[invocation].u16.x = subgroupQuadSwapDiagonal(data[0].u16.x); - data[invocation].u16.xy = subgroupQuadSwapDiagonal(data[1].u16.xy); - data[invocation].u16.xyz = subgroupQuadSwapDiagonal(data[2].u16.xyz); - data[invocation].u16 = subgroupQuadSwapDiagonal(data[3].u16); - - data[invocation].i64.x = subgroupQuadBroadcast(data[0].i64.x, 1); - data[invocation].i64.xy = subgroupQuadBroadcast(data[1].i64.xy, 1); - data[invocation].i64.xyz = subgroupQuadBroadcast(data[2].i64.xyz, 1); - data[invocation].i64 = subgroupQuadBroadcast(data[3].i64, 1); - - data[invocation].i64.x = subgroupQuadSwapHorizontal(data[0].i64.x); - data[invocation].i64.xy = subgroupQuadSwapHorizontal(data[1].i64.xy); - data[invocation].i64.xyz = subgroupQuadSwapHorizontal(data[2].i64.xyz); - data[invocation].i64 = subgroupQuadSwapHorizontal(data[3].i64); - - data[invocation].i64.x = subgroupQuadSwapVertical(data[0].i64.x); - data[invocation].i64.xy = subgroupQuadSwapVertical(data[1].i64.xy); - data[invocation].i64.xyz = subgroupQuadSwapVertical(data[2].i64.xyz); - data[invocation].i64 = subgroupQuadSwapVertical(data[3].i64); - - data[invocation].i64.x = subgroupQuadSwapDiagonal(data[0].i64.x); - data[invocation].i64.xy = subgroupQuadSwapDiagonal(data[1].i64.xy); - data[invocation].i64.xyz = subgroupQuadSwapDiagonal(data[2].i64.xyz); - data[invocation].i64 = subgroupQuadSwapDiagonal(data[3].i64); - - data[invocation].u64.x = subgroupQuadBroadcast(data[0].u64.x, 1); - data[invocation].u64.xy = subgroupQuadBroadcast(data[1].u64.xy, 1); - data[invocation].u64.xyz = subgroupQuadBroadcast(data[2].u64.xyz, 1); - data[invocation].u64 = subgroupQuadBroadcast(data[3].u64, 1); - - data[invocation].u64.x = subgroupQuadSwapHorizontal(data[0].u64.x); - data[invocation].u64.xy = subgroupQuadSwapHorizontal(data[1].u64.xy); - data[invocation].u64.xyz = subgroupQuadSwapHorizontal(data[2].u64.xyz); - data[invocation].u64 = subgroupQuadSwapHorizontal(data[3].u64); - - data[invocation].u64.x = subgroupQuadSwapVertical(data[0].u64.x); - data[invocation].u64.xy = subgroupQuadSwapVertical(data[1].u64.xy); - data[invocation].u64.xyz = subgroupQuadSwapVertical(data[2].u64.xyz); - data[invocation].u64 = subgroupQuadSwapVertical(data[3].u64); - - data[invocation].u64.x = subgroupQuadSwapDiagonal(data[0].u64.x); - data[invocation].u64.xy = subgroupQuadSwapDiagonal(data[1].u64.xy); - data[invocation].u64.xyz = subgroupQuadSwapDiagonal(data[2].u64.xyz); - data[invocation].u64 = subgroupQuadSwapDiagonal(data[3].u64); - - data[invocation].f16.x = subgroupQuadBroadcast(data[0].f16.x, 1); - data[invocation].f16.xy = subgroupQuadBroadcast(data[1].f16.xy, 1); - data[invocation].f16.xyz = subgroupQuadBroadcast(data[2].f16.xyz, 1); - data[invocation].f16 = subgroupQuadBroadcast(data[3].f16, 1); - - data[invocation].f16.x = subgroupQuadSwapHorizontal(data[0].f16.x); - data[invocation].f16.xy = subgroupQuadSwapHorizontal(data[1].f16.xy); - data[invocation].f16.xyz = subgroupQuadSwapHorizontal(data[2].f16.xyz); - data[invocation].f16 = subgroupQuadSwapHorizontal(data[3].f16); - - data[invocation].f16.x = subgroupQuadSwapVertical(data[0].f16.x); - data[invocation].f16.xy = subgroupQuadSwapVertical(data[1].f16.xy); - data[invocation].f16.xyz = subgroupQuadSwapVertical(data[2].f16.xyz); - data[invocation].f16 = subgroupQuadSwapVertical(data[3].f16); - - data[invocation].f16.x = subgroupQuadSwapDiagonal(data[0].f16.x); - data[invocation].f16.xy = subgroupQuadSwapDiagonal(data[1].f16.xy); - data[invocation].f16.xyz = subgroupQuadSwapDiagonal(data[2].f16.xyz); - data[invocation].f16 = subgroupQuadSwapDiagonal(data[3].f16); -} +#version 450 + +#extension GL_KHR_shader_subgroup_quad: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupQuadBroadcast(data[0].i8.x, 1); + data[invocation].i8.xy = subgroupQuadBroadcast(data[1].i8.xy, 1); + data[invocation].i8.xyz = subgroupQuadBroadcast(data[2].i8.xyz, 1); + data[invocation].i8 = subgroupQuadBroadcast(data[3].i8, 1); + + data[invocation].i8.x = subgroupQuadSwapHorizontal(data[0].i8.x); + data[invocation].i8.xy = subgroupQuadSwapHorizontal(data[1].i8.xy); + data[invocation].i8.xyz = subgroupQuadSwapHorizontal(data[2].i8.xyz); + data[invocation].i8 = subgroupQuadSwapHorizontal(data[3].i8); + + data[invocation].i8.x = subgroupQuadSwapVertical(data[0].i8.x); + data[invocation].i8.xy = subgroupQuadSwapVertical(data[1].i8.xy); + data[invocation].i8.xyz = subgroupQuadSwapVertical(data[2].i8.xyz); + data[invocation].i8 = subgroupQuadSwapVertical(data[3].i8); + + data[invocation].i8.x = subgroupQuadSwapDiagonal(data[0].i8.x); + data[invocation].i8.xy = subgroupQuadSwapDiagonal(data[1].i8.xy); + data[invocation].i8.xyz = subgroupQuadSwapDiagonal(data[2].i8.xyz); + data[invocation].i8 = subgroupQuadSwapDiagonal(data[3].i8); + + data[invocation].u8.x = subgroupQuadBroadcast(data[0].u8.x, 1); + data[invocation].u8.xy = subgroupQuadBroadcast(data[1].u8.xy, 1); + data[invocation].u8.xyz = subgroupQuadBroadcast(data[2].u8.xyz, 1); + data[invocation].u8 = subgroupQuadBroadcast(data[3].u8, 1); + + data[invocation].u8.x = subgroupQuadSwapHorizontal(data[0].u8.x); + data[invocation].u8.xy = subgroupQuadSwapHorizontal(data[1].u8.xy); + data[invocation].u8.xyz = subgroupQuadSwapHorizontal(data[2].u8.xyz); + data[invocation].u8 = subgroupQuadSwapHorizontal(data[3].u8); + + data[invocation].u8.x = subgroupQuadSwapVertical(data[0].u8.x); + data[invocation].u8.xy = subgroupQuadSwapVertical(data[1].u8.xy); + data[invocation].u8.xyz = subgroupQuadSwapVertical(data[2].u8.xyz); + data[invocation].u8 = subgroupQuadSwapVertical(data[3].u8); + + data[invocation].u8.x = subgroupQuadSwapDiagonal(data[0].u8.x); + data[invocation].u8.xy = subgroupQuadSwapDiagonal(data[1].u8.xy); + data[invocation].u8.xyz = subgroupQuadSwapDiagonal(data[2].u8.xyz); + data[invocation].u8 = subgroupQuadSwapDiagonal(data[3].u8); + + data[invocation].i16.x = subgroupQuadBroadcast(data[0].i16.x, 1); + data[invocation].i16.xy = subgroupQuadBroadcast(data[1].i16.xy, 1); + data[invocation].i16.xyz = subgroupQuadBroadcast(data[2].i16.xyz, 1); + data[invocation].i16 = subgroupQuadBroadcast(data[3].i16, 1); + + data[invocation].i16.x = subgroupQuadSwapHorizontal(data[0].i16.x); + data[invocation].i16.xy = subgroupQuadSwapHorizontal(data[1].i16.xy); + data[invocation].i16.xyz = subgroupQuadSwapHorizontal(data[2].i16.xyz); + data[invocation].i16 = subgroupQuadSwapHorizontal(data[3].i16); + + data[invocation].i16.x = subgroupQuadSwapVertical(data[0].i16.x); + data[invocation].i16.xy = subgroupQuadSwapVertical(data[1].i16.xy); + data[invocation].i16.xyz = subgroupQuadSwapVertical(data[2].i16.xyz); + data[invocation].i16 = subgroupQuadSwapVertical(data[3].i16); + + data[invocation].i16.x = subgroupQuadSwapDiagonal(data[0].i16.x); + data[invocation].i16.xy = subgroupQuadSwapDiagonal(data[1].i16.xy); + data[invocation].i16.xyz = subgroupQuadSwapDiagonal(data[2].i16.xyz); + data[invocation].i16 = subgroupQuadSwapDiagonal(data[3].i16); + + data[invocation].u16.x = subgroupQuadBroadcast(data[0].u16.x, 1); + data[invocation].u16.xy = subgroupQuadBroadcast(data[1].u16.xy, 1); + data[invocation].u16.xyz = subgroupQuadBroadcast(data[2].u16.xyz, 1); + data[invocation].u16 = subgroupQuadBroadcast(data[3].u16, 1); + + data[invocation].u16.x = subgroupQuadSwapHorizontal(data[0].u16.x); + data[invocation].u16.xy = subgroupQuadSwapHorizontal(data[1].u16.xy); + data[invocation].u16.xyz = subgroupQuadSwapHorizontal(data[2].u16.xyz); + data[invocation].u16 = subgroupQuadSwapHorizontal(data[3].u16); + + data[invocation].u16.x = subgroupQuadSwapVertical(data[0].u16.x); + data[invocation].u16.xy = subgroupQuadSwapVertical(data[1].u16.xy); + data[invocation].u16.xyz = subgroupQuadSwapVertical(data[2].u16.xyz); + data[invocation].u16 = subgroupQuadSwapVertical(data[3].u16); + + data[invocation].u16.x = subgroupQuadSwapDiagonal(data[0].u16.x); + data[invocation].u16.xy = subgroupQuadSwapDiagonal(data[1].u16.xy); + data[invocation].u16.xyz = subgroupQuadSwapDiagonal(data[2].u16.xyz); + data[invocation].u16 = subgroupQuadSwapDiagonal(data[3].u16); + + data[invocation].i64.x = subgroupQuadBroadcast(data[0].i64.x, 1); + data[invocation].i64.xy = subgroupQuadBroadcast(data[1].i64.xy, 1); + data[invocation].i64.xyz = subgroupQuadBroadcast(data[2].i64.xyz, 1); + data[invocation].i64 = subgroupQuadBroadcast(data[3].i64, 1); + + data[invocation].i64.x = subgroupQuadSwapHorizontal(data[0].i64.x); + data[invocation].i64.xy = subgroupQuadSwapHorizontal(data[1].i64.xy); + data[invocation].i64.xyz = subgroupQuadSwapHorizontal(data[2].i64.xyz); + data[invocation].i64 = subgroupQuadSwapHorizontal(data[3].i64); + + data[invocation].i64.x = subgroupQuadSwapVertical(data[0].i64.x); + data[invocation].i64.xy = subgroupQuadSwapVertical(data[1].i64.xy); + data[invocation].i64.xyz = subgroupQuadSwapVertical(data[2].i64.xyz); + data[invocation].i64 = subgroupQuadSwapVertical(data[3].i64); + + data[invocation].i64.x = subgroupQuadSwapDiagonal(data[0].i64.x); + data[invocation].i64.xy = subgroupQuadSwapDiagonal(data[1].i64.xy); + data[invocation].i64.xyz = subgroupQuadSwapDiagonal(data[2].i64.xyz); + data[invocation].i64 = subgroupQuadSwapDiagonal(data[3].i64); + + data[invocation].u64.x = subgroupQuadBroadcast(data[0].u64.x, 1); + data[invocation].u64.xy = subgroupQuadBroadcast(data[1].u64.xy, 1); + data[invocation].u64.xyz = subgroupQuadBroadcast(data[2].u64.xyz, 1); + data[invocation].u64 = subgroupQuadBroadcast(data[3].u64, 1); + + data[invocation].u64.x = subgroupQuadSwapHorizontal(data[0].u64.x); + data[invocation].u64.xy = subgroupQuadSwapHorizontal(data[1].u64.xy); + data[invocation].u64.xyz = subgroupQuadSwapHorizontal(data[2].u64.xyz); + data[invocation].u64 = subgroupQuadSwapHorizontal(data[3].u64); + + data[invocation].u64.x = subgroupQuadSwapVertical(data[0].u64.x); + data[invocation].u64.xy = subgroupQuadSwapVertical(data[1].u64.xy); + data[invocation].u64.xyz = subgroupQuadSwapVertical(data[2].u64.xyz); + data[invocation].u64 = subgroupQuadSwapVertical(data[3].u64); + + data[invocation].u64.x = subgroupQuadSwapDiagonal(data[0].u64.x); + data[invocation].u64.xy = subgroupQuadSwapDiagonal(data[1].u64.xy); + data[invocation].u64.xyz = subgroupQuadSwapDiagonal(data[2].u64.xyz); + data[invocation].u64 = subgroupQuadSwapDiagonal(data[3].u64); + + data[invocation].f16.x = subgroupQuadBroadcast(data[0].f16.x, 1); + data[invocation].f16.xy = subgroupQuadBroadcast(data[1].f16.xy, 1); + data[invocation].f16.xyz = subgroupQuadBroadcast(data[2].f16.xyz, 1); + data[invocation].f16 = subgroupQuadBroadcast(data[3].f16, 1); + + data[invocation].f16.x = subgroupQuadSwapHorizontal(data[0].f16.x); + data[invocation].f16.xy = subgroupQuadSwapHorizontal(data[1].f16.xy); + data[invocation].f16.xyz = subgroupQuadSwapHorizontal(data[2].f16.xyz); + data[invocation].f16 = subgroupQuadSwapHorizontal(data[3].f16); + + data[invocation].f16.x = subgroupQuadSwapVertical(data[0].f16.x); + data[invocation].f16.xy = subgroupQuadSwapVertical(data[1].f16.xy); + data[invocation].f16.xyz = subgroupQuadSwapVertical(data[2].f16.xyz); + data[invocation].f16 = subgroupQuadSwapVertical(data[3].f16); + + data[invocation].f16.x = subgroupQuadSwapDiagonal(data[0].f16.x); + data[invocation].f16.xy = subgroupQuadSwapDiagonal(data[1].f16.xy); + data[invocation].f16.xyz = subgroupQuadSwapDiagonal(data[2].f16.xyz); + data[invocation].f16 = subgroupQuadSwapDiagonal(data[3].f16); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffle.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffle.comp index 5edbaea62..de733e6c6 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffle.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffle.comp @@ -1,95 +1,95 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupShuffle(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffle(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffle(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffle(data[3].i8, invocation); - - data[invocation].i8.x = subgroupShuffleXor(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffleXor(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffleXor(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffleXor(data[3].i8, invocation); - - data[invocation].u8.x = subgroupShuffle(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffle(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffle(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffle(data[3].u8, invocation); - - data[invocation].u8.x = subgroupShuffleXor(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffleXor(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffleXor(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffleXor(data[3].u8, invocation); - - data[invocation].i16.x = subgroupShuffle(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffle(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffle(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffle(data[3].i16, invocation); - - data[invocation].i16.x = subgroupShuffleXor(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffleXor(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffleXor(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffleXor(data[3].i16, invocation); - - data[invocation].u16.x = subgroupShuffle(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffle(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffle(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffle(data[3].u16, invocation); - - data[invocation].u16.x = subgroupShuffleXor(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffleXor(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffleXor(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffleXor(data[3].u16, invocation); - - data[invocation].i64.x = subgroupShuffle(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffle(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffle(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffle(data[3].i64, invocation); - - data[invocation].i64.x = subgroupShuffleXor(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffleXor(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffleXor(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffleXor(data[3].i64, invocation); - - data[invocation].u64.x = subgroupShuffle(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffle(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffle(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffle(data[3].u64, invocation); - - data[invocation].u64.x = subgroupShuffleXor(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffleXor(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffleXor(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffleXor(data[3].u64, invocation); - - data[invocation].f16.x = subgroupShuffle(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffle(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffle(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffle(data[3].f16, invocation); - - data[invocation].f16.x = subgroupShuffleXor(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffleXor(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffleXor(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffleXor(data[3].f16, invocation); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupShuffle(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffle(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffle(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffle(data[3].i8, invocation); + + data[invocation].i8.x = subgroupShuffleXor(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffleXor(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffleXor(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffleXor(data[3].i8, invocation); + + data[invocation].u8.x = subgroupShuffle(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffle(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffle(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffle(data[3].u8, invocation); + + data[invocation].u8.x = subgroupShuffleXor(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffleXor(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffleXor(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffleXor(data[3].u8, invocation); + + data[invocation].i16.x = subgroupShuffle(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffle(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffle(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffle(data[3].i16, invocation); + + data[invocation].i16.x = subgroupShuffleXor(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffleXor(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffleXor(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffleXor(data[3].i16, invocation); + + data[invocation].u16.x = subgroupShuffle(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffle(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffle(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffle(data[3].u16, invocation); + + data[invocation].u16.x = subgroupShuffleXor(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffleXor(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffleXor(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffleXor(data[3].u16, invocation); + + data[invocation].i64.x = subgroupShuffle(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffle(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffle(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffle(data[3].i64, invocation); + + data[invocation].i64.x = subgroupShuffleXor(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffleXor(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffleXor(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffleXor(data[3].i64, invocation); + + data[invocation].u64.x = subgroupShuffle(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffle(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffle(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffle(data[3].u64, invocation); + + data[invocation].u64.x = subgroupShuffleXor(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffleXor(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffleXor(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffleXor(data[3].u64, invocation); + + data[invocation].f16.x = subgroupShuffle(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffle(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffle(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffle(data[3].f16, invocation); + + data[invocation].f16.x = subgroupShuffleXor(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffleXor(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffleXor(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffleXor(data[3].f16, invocation); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleNeg.comp index bc892ad0b..af73b54c6 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleNeg.comp @@ -1,95 +1,95 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupShuffle(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffle(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffle(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffle(data[3].i8, invocation); - - data[invocation].i8.x = subgroupShuffleXor(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffleXor(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffleXor(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffleXor(data[3].i8, invocation); - - data[invocation].u8.x = subgroupShuffle(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffle(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffle(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffle(data[3].u8, invocation); - - data[invocation].u8.x = subgroupShuffleXor(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffleXor(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffleXor(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffleXor(data[3].u8, invocation); - - data[invocation].i16.x = subgroupShuffle(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffle(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffle(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffle(data[3].i16, invocation); - - data[invocation].i16.x = subgroupShuffleXor(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffleXor(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffleXor(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffleXor(data[3].i16, invocation); - - data[invocation].u16.x = subgroupShuffle(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffle(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffle(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffle(data[3].u16, invocation); - - data[invocation].u16.x = subgroupShuffleXor(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffleXor(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffleXor(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffleXor(data[3].u16, invocation); - - data[invocation].i64.x = subgroupShuffle(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffle(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffle(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffle(data[3].i64, invocation); - - data[invocation].i64.x = subgroupShuffleXor(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffleXor(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffleXor(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffleXor(data[3].i64, invocation); - - data[invocation].u64.x = subgroupShuffle(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffle(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffle(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffle(data[3].u64, invocation); - - data[invocation].u64.x = subgroupShuffleXor(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffleXor(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffleXor(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffleXor(data[3].u64, invocation); - - data[invocation].f16.x = subgroupShuffle(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffle(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffle(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffle(data[3].f16, invocation); - - data[invocation].f16.x = subgroupShuffleXor(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffleXor(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffleXor(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffleXor(data[3].f16, invocation); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupShuffle(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffle(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffle(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffle(data[3].i8, invocation); + + data[invocation].i8.x = subgroupShuffleXor(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffleXor(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffleXor(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffleXor(data[3].i8, invocation); + + data[invocation].u8.x = subgroupShuffle(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffle(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffle(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffle(data[3].u8, invocation); + + data[invocation].u8.x = subgroupShuffleXor(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffleXor(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffleXor(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffleXor(data[3].u8, invocation); + + data[invocation].i16.x = subgroupShuffle(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffle(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffle(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffle(data[3].i16, invocation); + + data[invocation].i16.x = subgroupShuffleXor(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffleXor(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffleXor(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffleXor(data[3].i16, invocation); + + data[invocation].u16.x = subgroupShuffle(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffle(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffle(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffle(data[3].u16, invocation); + + data[invocation].u16.x = subgroupShuffleXor(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffleXor(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffleXor(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffleXor(data[3].u16, invocation); + + data[invocation].i64.x = subgroupShuffle(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffle(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffle(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffle(data[3].i64, invocation); + + data[invocation].i64.x = subgroupShuffleXor(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffleXor(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffleXor(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffleXor(data[3].i64, invocation); + + data[invocation].u64.x = subgroupShuffle(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffle(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffle(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffle(data[3].u64, invocation); + + data[invocation].u64.x = subgroupShuffleXor(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffleXor(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffleXor(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffleXor(data[3].u64, invocation); + + data[invocation].f16.x = subgroupShuffle(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffle(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffle(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffle(data[3].f16, invocation); + + data[invocation].f16.x = subgroupShuffleXor(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffleXor(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffleXor(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffleXor(data[3].f16, invocation); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelative.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelative.comp index 35e906493..73f5970c6 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelative.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelative.comp @@ -1,95 +1,95 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupShuffleUp(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffleUp(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffleUp(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffleUp(data[3].i8, invocation); - - data[invocation].i8.x = subgroupShuffleDown(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffleDown(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffleDown(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffleDown(data[3].i8, invocation); - - data[invocation].u8.x = subgroupShuffleUp(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffleUp(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffleUp(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffleUp(data[3].u8, invocation); - - data[invocation].u8.x = subgroupShuffleDown(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffleDown(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffleDown(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffleDown(data[3].u8, invocation); - - data[invocation].i16.x = subgroupShuffleUp(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffleUp(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffleUp(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffleUp(data[3].i16, invocation); - - data[invocation].i16.x = subgroupShuffleDown(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffleDown(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffleDown(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffleDown(data[3].i16, invocation); - - data[invocation].u16.x = subgroupShuffleUp(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffleUp(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffleUp(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffleUp(data[3].u16, invocation); - - data[invocation].u16.x = subgroupShuffleDown(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffleDown(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffleDown(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffleDown(data[3].u16, invocation); - - data[invocation].i64.x = subgroupShuffleUp(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffleUp(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffleUp(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffleUp(data[3].i64, invocation); - - data[invocation].i64.x = subgroupShuffleDown(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffleDown(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffleDown(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffleDown(data[3].i64, invocation); - - data[invocation].u64.x = subgroupShuffleUp(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffleUp(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffleUp(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffleUp(data[3].u64, invocation); - - data[invocation].u64.x = subgroupShuffleDown(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffleDown(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffleDown(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffleDown(data[3].u64, invocation); - - data[invocation].f16.x = subgroupShuffleUp(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffleUp(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffleUp(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffleUp(data[3].f16, invocation); - - data[invocation].f16.x = subgroupShuffleDown(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffleDown(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffleDown(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffleDown(data[3].f16, invocation); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupShuffleUp(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffleUp(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffleUp(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffleUp(data[3].i8, invocation); + + data[invocation].i8.x = subgroupShuffleDown(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffleDown(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffleDown(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffleDown(data[3].i8, invocation); + + data[invocation].u8.x = subgroupShuffleUp(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffleUp(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffleUp(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffleUp(data[3].u8, invocation); + + data[invocation].u8.x = subgroupShuffleDown(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffleDown(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffleDown(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffleDown(data[3].u8, invocation); + + data[invocation].i16.x = subgroupShuffleUp(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffleUp(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffleUp(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffleUp(data[3].i16, invocation); + + data[invocation].i16.x = subgroupShuffleDown(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffleDown(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffleDown(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffleDown(data[3].i16, invocation); + + data[invocation].u16.x = subgroupShuffleUp(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffleUp(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffleUp(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffleUp(data[3].u16, invocation); + + data[invocation].u16.x = subgroupShuffleDown(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffleDown(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffleDown(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffleDown(data[3].u16, invocation); + + data[invocation].i64.x = subgroupShuffleUp(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffleUp(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffleUp(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffleUp(data[3].i64, invocation); + + data[invocation].i64.x = subgroupShuffleDown(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffleDown(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffleDown(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffleDown(data[3].i64, invocation); + + data[invocation].u64.x = subgroupShuffleUp(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffleUp(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffleUp(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffleUp(data[3].u64, invocation); + + data[invocation].u64.x = subgroupShuffleDown(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffleDown(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffleDown(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffleDown(data[3].u64, invocation); + + data[invocation].f16.x = subgroupShuffleUp(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffleUp(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffleUp(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffleUp(data[3].f16, invocation); + + data[invocation].f16.x = subgroupShuffleDown(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffleDown(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffleDown(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffleDown(data[3].f16, invocation); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelativeNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelativeNeg.comp index cc322383e..9857444a0 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelativeNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesShuffleRelativeNeg.comp @@ -1,95 +1,95 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle_relative: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].i8.x = subgroupShuffleUp(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffleUp(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffleUp(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffleUp(data[3].i8, invocation); - - data[invocation].i8.x = subgroupShuffleDown(data[0].i8.x, invocation); - data[invocation].i8.xy = subgroupShuffleDown(data[1].i8.xy, invocation); - data[invocation].i8.xyz = subgroupShuffleDown(data[2].i8.xyz, invocation); - data[invocation].i8 = subgroupShuffleDown(data[3].i8, invocation); - - data[invocation].u8.x = subgroupShuffleUp(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffleUp(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffleUp(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffleUp(data[3].u8, invocation); - - data[invocation].u8.x = subgroupShuffleDown(data[0].u8.x, invocation); - data[invocation].u8.xy = subgroupShuffleDown(data[1].u8.xy, invocation); - data[invocation].u8.xyz = subgroupShuffleDown(data[2].u8.xyz, invocation); - data[invocation].u8 = subgroupShuffleDown(data[3].u8, invocation); - - data[invocation].i16.x = subgroupShuffleUp(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffleUp(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffleUp(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffleUp(data[3].i16, invocation); - - data[invocation].i16.x = subgroupShuffleDown(data[0].i16.x, invocation); - data[invocation].i16.xy = subgroupShuffleDown(data[1].i16.xy, invocation); - data[invocation].i16.xyz = subgroupShuffleDown(data[2].i16.xyz, invocation); - data[invocation].i16 = subgroupShuffleDown(data[3].i16, invocation); - - data[invocation].u16.x = subgroupShuffleUp(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffleUp(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffleUp(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffleUp(data[3].u16, invocation); - - data[invocation].u16.x = subgroupShuffleDown(data[0].u16.x, invocation); - data[invocation].u16.xy = subgroupShuffleDown(data[1].u16.xy, invocation); - data[invocation].u16.xyz = subgroupShuffleDown(data[2].u16.xyz, invocation); - data[invocation].u16 = subgroupShuffleDown(data[3].u16, invocation); - - data[invocation].i64.x = subgroupShuffleUp(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffleUp(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffleUp(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffleUp(data[3].i64, invocation); - - data[invocation].i64.x = subgroupShuffleDown(data[0].i64.x, invocation); - data[invocation].i64.xy = subgroupShuffleDown(data[1].i64.xy, invocation); - data[invocation].i64.xyz = subgroupShuffleDown(data[2].i64.xyz, invocation); - data[invocation].i64 = subgroupShuffleDown(data[3].i64, invocation); - - data[invocation].u64.x = subgroupShuffleUp(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffleUp(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffleUp(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffleUp(data[3].u64, invocation); - - data[invocation].u64.x = subgroupShuffleDown(data[0].u64.x, invocation); - data[invocation].u64.xy = subgroupShuffleDown(data[1].u64.xy, invocation); - data[invocation].u64.xyz = subgroupShuffleDown(data[2].u64.xyz, invocation); - data[invocation].u64 = subgroupShuffleDown(data[3].u64, invocation); - - data[invocation].f16.x = subgroupShuffleUp(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffleUp(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffleUp(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffleUp(data[3].f16, invocation); - - data[invocation].f16.x = subgroupShuffleDown(data[0].f16.x, invocation); - data[invocation].f16.xy = subgroupShuffleDown(data[1].f16.xy, invocation); - data[invocation].f16.xyz = subgroupShuffleDown(data[2].f16.xyz, invocation); - data[invocation].f16 = subgroupShuffleDown(data[3].f16, invocation); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].i8.x = subgroupShuffleUp(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffleUp(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffleUp(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffleUp(data[3].i8, invocation); + + data[invocation].i8.x = subgroupShuffleDown(data[0].i8.x, invocation); + data[invocation].i8.xy = subgroupShuffleDown(data[1].i8.xy, invocation); + data[invocation].i8.xyz = subgroupShuffleDown(data[2].i8.xyz, invocation); + data[invocation].i8 = subgroupShuffleDown(data[3].i8, invocation); + + data[invocation].u8.x = subgroupShuffleUp(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffleUp(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffleUp(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffleUp(data[3].u8, invocation); + + data[invocation].u8.x = subgroupShuffleDown(data[0].u8.x, invocation); + data[invocation].u8.xy = subgroupShuffleDown(data[1].u8.xy, invocation); + data[invocation].u8.xyz = subgroupShuffleDown(data[2].u8.xyz, invocation); + data[invocation].u8 = subgroupShuffleDown(data[3].u8, invocation); + + data[invocation].i16.x = subgroupShuffleUp(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffleUp(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffleUp(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffleUp(data[3].i16, invocation); + + data[invocation].i16.x = subgroupShuffleDown(data[0].i16.x, invocation); + data[invocation].i16.xy = subgroupShuffleDown(data[1].i16.xy, invocation); + data[invocation].i16.xyz = subgroupShuffleDown(data[2].i16.xyz, invocation); + data[invocation].i16 = subgroupShuffleDown(data[3].i16, invocation); + + data[invocation].u16.x = subgroupShuffleUp(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffleUp(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffleUp(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffleUp(data[3].u16, invocation); + + data[invocation].u16.x = subgroupShuffleDown(data[0].u16.x, invocation); + data[invocation].u16.xy = subgroupShuffleDown(data[1].u16.xy, invocation); + data[invocation].u16.xyz = subgroupShuffleDown(data[2].u16.xyz, invocation); + data[invocation].u16 = subgroupShuffleDown(data[3].u16, invocation); + + data[invocation].i64.x = subgroupShuffleUp(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffleUp(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffleUp(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffleUp(data[3].i64, invocation); + + data[invocation].i64.x = subgroupShuffleDown(data[0].i64.x, invocation); + data[invocation].i64.xy = subgroupShuffleDown(data[1].i64.xy, invocation); + data[invocation].i64.xyz = subgroupShuffleDown(data[2].i64.xyz, invocation); + data[invocation].i64 = subgroupShuffleDown(data[3].i64, invocation); + + data[invocation].u64.x = subgroupShuffleUp(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffleUp(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffleUp(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffleUp(data[3].u64, invocation); + + data[invocation].u64.x = subgroupShuffleDown(data[0].u64.x, invocation); + data[invocation].u64.xy = subgroupShuffleDown(data[1].u64.xy, invocation); + data[invocation].u64.xyz = subgroupShuffleDown(data[2].u64.xyz, invocation); + data[invocation].u64 = subgroupShuffleDown(data[3].u64, invocation); + + data[invocation].f16.x = subgroupShuffleUp(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffleUp(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffleUp(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffleUp(data[3].f16, invocation); + + data[invocation].f16.x = subgroupShuffleDown(data[0].f16.x, invocation); + data[invocation].f16.xy = subgroupShuffleDown(data[1].f16.xy, invocation); + data[invocation].f16.xyz = subgroupShuffleDown(data[2].f16.xyz, invocation); + data[invocation].f16 = subgroupShuffleDown(data[3].f16, invocation); +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesVote.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesVote.comp index 7f5586370..960156a64 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesVote.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesVote.comp @@ -1,66 +1,66 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_vote: enable -#extension GL_EXT_shader_subgroup_extended_types_int8: enable -#extension GL_EXT_shader_subgroup_extended_types_int16: enable -#extension GL_EXT_shader_subgroup_extended_types_int64: enable -#extension GL_EXT_shader_subgroup_extended_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; - int r; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - if (subgroupAll(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].i8.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i8.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i8.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i8)); - - data[invocation].r = int(subgroupAllEqual(data[0].u8.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u8.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u8.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u8)); - - data[invocation].r = int(subgroupAllEqual(data[0].i16.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i16.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i16.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i16)); - - data[invocation].r = int(subgroupAllEqual(data[0].u16.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u16.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u16.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u16)); - } - else if (subgroupAny(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].i64.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i64.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i64.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i64)); - - data[invocation].r = int(subgroupAllEqual(data[0].u64.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u64.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u64.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u64)); - - data[invocation].r = int(subgroupAllEqual(data[0].f16.x)); - data[invocation].r = int(subgroupAllEqual(data[1].f16.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].f16.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].f16)); - } -} +#version 450 + +#extension GL_KHR_shader_subgroup_vote: enable +#extension GL_EXT_shader_subgroup_extended_types_int8: enable +#extension GL_EXT_shader_subgroup_extended_types_int16: enable +#extension GL_EXT_shader_subgroup_extended_types_int64: enable +#extension GL_EXT_shader_subgroup_extended_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + if (subgroupAll(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].i8.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i8.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i8.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i8)); + + data[invocation].r = int(subgroupAllEqual(data[0].u8.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u8.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u8.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u8)); + + data[invocation].r = int(subgroupAllEqual(data[0].i16.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i16.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i16.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i16)); + + data[invocation].r = int(subgroupAllEqual(data[0].u16.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u16.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u16.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u16)); + } + else if (subgroupAny(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].i64.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i64.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i64.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i64)); + + data[invocation].r = int(subgroupAllEqual(data[0].u64.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u64.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u64.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u64)); + + data[invocation].r = int(subgroupAllEqual(data[0].f16.x)); + data[invocation].r = int(subgroupAllEqual(data[1].f16.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].f16.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].f16)); + } +} diff --git a/core/deps/glslang/Test/spv.subgroupExtendedTypesVoteNeg.comp b/core/deps/glslang/Test/spv.subgroupExtendedTypesVoteNeg.comp index 6d3ad7718..be8d1bb11 100644 --- a/core/deps/glslang/Test/spv.subgroupExtendedTypesVoteNeg.comp +++ b/core/deps/glslang/Test/spv.subgroupExtendedTypesVoteNeg.comp @@ -1,66 +1,66 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_vote: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable -#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable -#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - i8vec4 i8; - u8vec4 u8; - i16vec4 i16; - u16vec4 u16; - i64vec4 i64; - u64vec4 u64; - f16vec4 f16; - int r; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - if (subgroupAll(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].i8.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i8.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i8.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i8)); - - data[invocation].r = int(subgroupAllEqual(data[0].u8.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u8.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u8.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u8)); - - data[invocation].r = int(subgroupAllEqual(data[0].i16.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i16.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i16.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i16)); - - data[invocation].r = int(subgroupAllEqual(data[0].u16.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u16.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u16.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u16)); - } - else if (subgroupAny(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].i64.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i64.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i64.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i64)); - - data[invocation].r = int(subgroupAllEqual(data[0].u64.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u64.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u64.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u64)); - - data[invocation].r = int(subgroupAllEqual(data[0].f16.x)); - data[invocation].r = int(subgroupAllEqual(data[1].f16.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].f16.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].f16)); - } -} +#version 450 + +#extension GL_KHR_shader_subgroup_vote: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int8: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int16: enable +#extension GL_EXT_shader_explicit_arithmetic_types_int64: enable +#extension GL_EXT_shader_explicit_arithmetic_types_float16: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + i8vec4 i8; + u8vec4 u8; + i16vec4 i16; + u16vec4 u16; + i64vec4 i64; + u64vec4 u64; + f16vec4 f16; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + if (subgroupAll(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].i8.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i8.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i8.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i8)); + + data[invocation].r = int(subgroupAllEqual(data[0].u8.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u8.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u8.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u8)); + + data[invocation].r = int(subgroupAllEqual(data[0].i16.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i16.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i16.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i16)); + + data[invocation].r = int(subgroupAllEqual(data[0].u16.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u16.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u16.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u16)); + } + else if (subgroupAny(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].i64.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i64.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i64.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i64)); + + data[invocation].r = int(subgroupAllEqual(data[0].u64.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u64.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u64.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u64)); + + data[invocation].r = int(subgroupAllEqual(data[0].f16.x)); + data[invocation].r = int(subgroupAllEqual(data[1].f16.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].f16.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].f16)); + } +} diff --git a/core/deps/glslang/Test/spv.subgroupPartitioned.comp b/core/deps/glslang/Test/spv.subgroupPartitioned.comp index 88e247b93..604833e05 100644 --- a/core/deps/glslang/Test/spv.subgroupPartitioned.comp +++ b/core/deps/glslang/Test/spv.subgroupPartitioned.comp @@ -1,420 +1,420 @@ -#version 450 - -#extension GL_NV_shader_subgroup_partitioned: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 ballot = subgroupPartitionNV(invocation); - - data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].f4); - - data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].i4); - - data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].u4); - - data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].d4); - - data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); - data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); - data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); - data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); - - data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); -} +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff --git a/core/deps/glslang/Test/spv.subgroupQuad.comp b/core/deps/glslang/Test/spv.subgroupQuad.comp index f7b177f78..223a7cdac 100644 --- a/core/deps/glslang/Test/spv.subgroupQuad.comp +++ b/core/deps/glslang/Test/spv.subgroupQuad.comp @@ -1,118 +1,118 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_quad: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1); - data[invocation].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1); - data[invocation].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1); - data[invocation].f4 = subgroupQuadBroadcast(data[3].f4, 1); - - data[invocation].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1); - data[invocation].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1); - data[invocation].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1); - data[invocation].i4 = subgroupQuadBroadcast(data[3].i4, 1); - - data[invocation].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1); - data[invocation].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1); - data[invocation].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1); - data[invocation].u4 = subgroupQuadBroadcast(data[3].u4, 1); - - data[invocation].d4.x = subgroupQuadBroadcast(data[0].d4.x, 1); - data[invocation].d4.xy = subgroupQuadBroadcast(data[1].d4.xy, 1); - data[invocation].d4.xyz = subgroupQuadBroadcast(data[2].d4.xyz, 1); - data[invocation].d4 = subgroupQuadBroadcast(data[3].d4, 1); - - data[invocation].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1)); - data[invocation].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); - data[invocation].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); - data[invocation].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); - - data[invocation].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); - data[invocation].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); - data[invocation].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); - data[invocation].f4 = subgroupQuadSwapHorizontal(data[3].f4); - - data[invocation].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); - data[invocation].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); - data[invocation].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); - data[invocation].i4 = subgroupQuadSwapHorizontal(data[3].i4); - - data[invocation].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); - data[invocation].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); - data[invocation].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); - data[invocation].u4 = subgroupQuadSwapHorizontal(data[3].u4); - - data[invocation].d4.x = subgroupQuadSwapHorizontal(data[0].d4.x); - data[invocation].d4.xy = subgroupQuadSwapHorizontal(data[1].d4.xy); - data[invocation].d4.xyz = subgroupQuadSwapHorizontal(data[2].d4.xyz); - data[invocation].d4 = subgroupQuadSwapHorizontal(data[3].d4); - - data[invocation].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupQuadSwapVertical(data[0].f4.x); - data[invocation].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); - data[invocation].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); - data[invocation].f4 = subgroupQuadSwapVertical(data[3].f4); - - data[invocation].i4.x = subgroupQuadSwapVertical(data[0].i4.x); - data[invocation].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); - data[invocation].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); - data[invocation].i4 = subgroupQuadSwapVertical(data[3].i4); - - data[invocation].u4.x = subgroupQuadSwapVertical(data[0].u4.x); - data[invocation].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); - data[invocation].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); - data[invocation].u4 = subgroupQuadSwapVertical(data[3].u4); - - data[invocation].d4.x = subgroupQuadSwapVertical(data[0].d4.x); - data[invocation].d4.xy = subgroupQuadSwapVertical(data[1].d4.xy); - data[invocation].d4.xyz = subgroupQuadSwapVertical(data[2].d4.xyz); - data[invocation].d4 = subgroupQuadSwapVertical(data[3].d4); - - data[invocation].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); - data[invocation].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); - data[invocation].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); - data[invocation].f4 = subgroupQuadSwapDiagonal(data[3].f4); - - data[invocation].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); - data[invocation].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); - data[invocation].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); - data[invocation].i4 = subgroupQuadSwapDiagonal(data[3].i4); - - data[invocation].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); - data[invocation].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); - data[invocation].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); - data[invocation].u4 = subgroupQuadSwapDiagonal(data[3].u4); - - data[invocation].d4.x = subgroupQuadSwapDiagonal(data[0].d4.x); - data[invocation].d4.xy = subgroupQuadSwapDiagonal(data[1].d4.xy); - data[invocation].d4.xyz = subgroupQuadSwapDiagonal(data[2].d4.xyz); - data[invocation].d4 = subgroupQuadSwapDiagonal(data[3].d4); - - data[invocation].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); -} +#version 450 + +#extension GL_KHR_shader_subgroup_quad: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupQuadBroadcast(data[0].f4.x, 1); + data[invocation].f4.xy = subgroupQuadBroadcast(data[1].f4.xy, 1); + data[invocation].f4.xyz = subgroupQuadBroadcast(data[2].f4.xyz, 1); + data[invocation].f4 = subgroupQuadBroadcast(data[3].f4, 1); + + data[invocation].i4.x = subgroupQuadBroadcast(data[0].i4.x, 1); + data[invocation].i4.xy = subgroupQuadBroadcast(data[1].i4.xy, 1); + data[invocation].i4.xyz = subgroupQuadBroadcast(data[2].i4.xyz, 1); + data[invocation].i4 = subgroupQuadBroadcast(data[3].i4, 1); + + data[invocation].u4.x = subgroupQuadBroadcast(data[0].u4.x, 1); + data[invocation].u4.xy = subgroupQuadBroadcast(data[1].u4.xy, 1); + data[invocation].u4.xyz = subgroupQuadBroadcast(data[2].u4.xyz, 1); + data[invocation].u4 = subgroupQuadBroadcast(data[3].u4, 1); + + data[invocation].d4.x = subgroupQuadBroadcast(data[0].d4.x, 1); + data[invocation].d4.xy = subgroupQuadBroadcast(data[1].d4.xy, 1); + data[invocation].d4.xyz = subgroupQuadBroadcast(data[2].d4.xyz, 1); + data[invocation].d4 = subgroupQuadBroadcast(data[3].d4, 1); + + data[invocation].i4.x = int(subgroupQuadBroadcast(data[0].i4.x < 0, 1)); + data[invocation].i4.xy = ivec2(subgroupQuadBroadcast(lessThan(data[1].i4.xy, ivec2(0)), 1)); + data[invocation].i4.xyz = ivec3(subgroupQuadBroadcast(lessThan(data[1].i4.xyz, ivec3(0)), 1)); + data[invocation].i4 = ivec4(subgroupQuadBroadcast(lessThan(data[1].i4, ivec4(0)), 1)); + + data[invocation].f4.x = subgroupQuadSwapHorizontal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapHorizontal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapHorizontal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapHorizontal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapHorizontal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapHorizontal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapHorizontal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapHorizontal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapHorizontal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapHorizontal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapHorizontal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapHorizontal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapHorizontal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapHorizontal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapHorizontal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapHorizontal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapHorizontal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapHorizontal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapHorizontal(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapVertical(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapVertical(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapVertical(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapVertical(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapVertical(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapVertical(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapVertical(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapVertical(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapVertical(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapVertical(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapVertical(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapVertical(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapVertical(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapVertical(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapVertical(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapVertical(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapVertical(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapVertical(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapVertical(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapVertical(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupQuadSwapDiagonal(data[0].f4.x); + data[invocation].f4.xy = subgroupQuadSwapDiagonal(data[1].f4.xy); + data[invocation].f4.xyz = subgroupQuadSwapDiagonal(data[2].f4.xyz); + data[invocation].f4 = subgroupQuadSwapDiagonal(data[3].f4); + + data[invocation].i4.x = subgroupQuadSwapDiagonal(data[0].i4.x); + data[invocation].i4.xy = subgroupQuadSwapDiagonal(data[1].i4.xy); + data[invocation].i4.xyz = subgroupQuadSwapDiagonal(data[2].i4.xyz); + data[invocation].i4 = subgroupQuadSwapDiagonal(data[3].i4); + + data[invocation].u4.x = subgroupQuadSwapDiagonal(data[0].u4.x); + data[invocation].u4.xy = subgroupQuadSwapDiagonal(data[1].u4.xy); + data[invocation].u4.xyz = subgroupQuadSwapDiagonal(data[2].u4.xyz); + data[invocation].u4 = subgroupQuadSwapDiagonal(data[3].u4); + + data[invocation].d4.x = subgroupQuadSwapDiagonal(data[0].d4.x); + data[invocation].d4.xy = subgroupQuadSwapDiagonal(data[1].d4.xy); + data[invocation].d4.xyz = subgroupQuadSwapDiagonal(data[2].d4.xyz); + data[invocation].d4 = subgroupQuadSwapDiagonal(data[3].d4); + + data[invocation].i4.x = int(subgroupQuadSwapDiagonal(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupQuadSwapDiagonal(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupQuadSwapDiagonal(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/spv.subgroupShuffle.comp b/core/deps/glslang/Test/spv.subgroupShuffle.comp index f48f4c514..6d264882a 100644 --- a/core/deps/glslang/Test/spv.subgroupShuffle.comp +++ b/core/deps/glslang/Test/spv.subgroupShuffle.comp @@ -1,68 +1,68 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupShuffle(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffle(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffle(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffle(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffle(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffle(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffle(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffle(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffle(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffle(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); - - data[invocation].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffleXor(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffleXor(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffleXor(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffleXor(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffleXor(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffleXor(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffleXor(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffle(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffle(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffle(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffle(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffle(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffle(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffle(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffle(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffle(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffle(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffle(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffle(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffle(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffle(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffle(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffle(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffle(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffle(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffle(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffle(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleXor(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleXor(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleXor(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleXor(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleXor(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleXor(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleXor(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleXor(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleXor(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleXor(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleXor(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleXor(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleXor(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleXor(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleXor(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleXor(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleXor(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleXor(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleXor(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleXor(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/core/deps/glslang/Test/spv.subgroupShuffleRelative.comp b/core/deps/glslang/Test/spv.subgroupShuffleRelative.comp index 30c6e430e..1864de10a 100644 --- a/core/deps/glslang/Test/spv.subgroupShuffleRelative.comp +++ b/core/deps/glslang/Test/spv.subgroupShuffleRelative.comp @@ -1,68 +1,68 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_shuffle_relative: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffleUp(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffleUp(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffleUp(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffleUp(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffleUp(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffleUp(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffleUp(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); - - data[invocation].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); - data[invocation].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); - data[invocation].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); - data[invocation].f4 = subgroupShuffleDown(data[3].f4, invocation); - - data[invocation].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); - data[invocation].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); - data[invocation].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); - data[invocation].i4 = subgroupShuffleDown(data[3].i4, invocation); - - data[invocation].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); - data[invocation].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); - data[invocation].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); - data[invocation].u4 = subgroupShuffleDown(data[3].u4, invocation); - - data[invocation].d4.x = subgroupShuffleDown(data[0].d4.x, invocation); - data[invocation].d4.xy = subgroupShuffleDown(data[1].d4.xy, invocation); - data[invocation].d4.xyz = subgroupShuffleDown(data[2].d4.xyz, invocation); - data[invocation].d4 = subgroupShuffleDown(data[3].d4, invocation); - - data[invocation].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); - data[invocation].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); - data[invocation].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); - data[invocation].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); -} +#version 450 + +#extension GL_KHR_shader_subgroup_shuffle_relative: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupShuffleUp(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleUp(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleUp(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleUp(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleUp(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleUp(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleUp(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleUp(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleUp(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleUp(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleUp(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleUp(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleUp(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleUp(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleUp(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleUp(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleUp(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleUp(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleUp(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleUp(lessThan(data[1].i4, ivec4(0)), invocation)); + + data[invocation].f4.x = subgroupShuffleDown(data[0].f4.x, invocation); + data[invocation].f4.xy = subgroupShuffleDown(data[1].f4.xy, invocation); + data[invocation].f4.xyz = subgroupShuffleDown(data[2].f4.xyz, invocation); + data[invocation].f4 = subgroupShuffleDown(data[3].f4, invocation); + + data[invocation].i4.x = subgroupShuffleDown(data[0].i4.x, invocation); + data[invocation].i4.xy = subgroupShuffleDown(data[1].i4.xy, invocation); + data[invocation].i4.xyz = subgroupShuffleDown(data[2].i4.xyz, invocation); + data[invocation].i4 = subgroupShuffleDown(data[3].i4, invocation); + + data[invocation].u4.x = subgroupShuffleDown(data[0].u4.x, invocation); + data[invocation].u4.xy = subgroupShuffleDown(data[1].u4.xy, invocation); + data[invocation].u4.xyz = subgroupShuffleDown(data[2].u4.xyz, invocation); + data[invocation].u4 = subgroupShuffleDown(data[3].u4, invocation); + + data[invocation].d4.x = subgroupShuffleDown(data[0].d4.x, invocation); + data[invocation].d4.xy = subgroupShuffleDown(data[1].d4.xy, invocation); + data[invocation].d4.xyz = subgroupShuffleDown(data[2].d4.xyz, invocation); + data[invocation].d4 = subgroupShuffleDown(data[3].d4, invocation); + + data[invocation].i4.x = int(subgroupShuffleDown(data[0].i4.x < 0, invocation)); + data[invocation].i4.xy = ivec2(subgroupShuffleDown(lessThan(data[1].i4.xy, ivec2(0)), invocation)); + data[invocation].i4.xyz = ivec3(subgroupShuffleDown(lessThan(data[1].i4.xyz, ivec3(0)), invocation)); + data[invocation].i4 = ivec4(subgroupShuffleDown(lessThan(data[1].i4, ivec4(0)), invocation)); +} diff --git a/core/deps/glslang/Test/spv.subgroupVote.comp b/core/deps/glslang/Test/spv.subgroupVote.comp index 18348fd95..c1c877af3 100644 --- a/core/deps/glslang/Test/spv.subgroupVote.comp +++ b/core/deps/glslang/Test/spv.subgroupVote.comp @@ -1,49 +1,49 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_vote: enable - -layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; - int r; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - if (subgroupAll(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].f4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].f4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].f4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].f4)); - - data[invocation].r = int(subgroupAllEqual(data[0].i4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].i4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].i4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].i4)); - - data[invocation].r = int(subgroupAllEqual(data[0].u4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].u4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].u4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].u4)); - } - else if (subgroupAny(data[invocation].r < 0)) - { - data[invocation].r = int(subgroupAllEqual(data[0].d4.x)); - data[invocation].r = int(subgroupAllEqual(data[1].d4.xy)); - data[invocation].r = int(subgroupAllEqual(data[2].d4.xyz)); - data[invocation].r = int(subgroupAllEqual(data[3].d4)); - - data[invocation].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); - data[invocation].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); - data[invocation].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); - data[invocation].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); - } -} +#version 450 + +#extension GL_KHR_shader_subgroup_vote: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; + int r; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + if (subgroupAll(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].f4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].f4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].f4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].f4)); + + data[invocation].r = int(subgroupAllEqual(data[0].i4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].i4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].i4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].i4)); + + data[invocation].r = int(subgroupAllEqual(data[0].u4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].u4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].u4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].u4)); + } + else if (subgroupAny(data[invocation].r < 0)) + { + data[invocation].r = int(subgroupAllEqual(data[0].d4.x)); + data[invocation].r = int(subgroupAllEqual(data[1].d4.xy)); + data[invocation].r = int(subgroupAllEqual(data[2].d4.xyz)); + data[invocation].r = int(subgroupAllEqual(data[3].d4)); + + data[invocation].r = int(int(subgroupAllEqual(data[0].i4.x < 0))); + data[invocation].r = int(ivec2(subgroupAllEqual(lessThan(data[1].i4.xy, ivec2(0))))); + data[invocation].r = int(ivec3(subgroupAllEqual(lessThan(data[1].i4.xyz, ivec3(0))))); + data[invocation].r = int(ivec4(subgroupAllEqual(lessThan(data[1].i4, ivec4(0))))); + } +} diff --git a/core/deps/glslang/Test/spv.subpass.frag b/core/deps/glslang/Test/spv.subpass.frag index 7856c64cd..42411d99c 100644 --- a/core/deps/glslang/Test/spv.subpass.frag +++ b/core/deps/glslang/Test/spv.subpass.frag @@ -1,29 +1,29 @@ -#version 400 - -layout(input_attachment_index = 1) uniform subpassInput sub; -layout(input_attachment_index = 2) uniform subpassInputMS subMS; -layout(input_attachment_index = 3) uniform isubpassInput isub; -layout(input_attachment_index = 4) uniform isubpassInputMS isubMS; -layout(input_attachment_index = 5) uniform usubpassInput usub; -layout(input_attachment_index = 6) uniform usubpassInputMS usubMS; - -out vec4 color; -out ivec4 icolor; -out uvec4 ucolor; - -void foo(isubpassInputMS sb) -{ - icolor += subpassLoad(sb, 3); -} - -void main() -{ - color = subpassLoad(sub); - color += subpassLoad(subMS, 3); - icolor = subpassLoad(isub); - icolor += subpassLoad(isubMS, 3); - ucolor = subpassLoad(usub); - ucolor += subpassLoad(usubMS, 3); - - foo(isubMS); -} +#version 400 + +layout(input_attachment_index = 1) uniform subpassInput sub; +layout(input_attachment_index = 2) uniform subpassInputMS subMS; +layout(input_attachment_index = 3) uniform isubpassInput isub; +layout(input_attachment_index = 4) uniform isubpassInputMS isubMS; +layout(input_attachment_index = 5) uniform usubpassInput usub; +layout(input_attachment_index = 6) uniform usubpassInputMS usubMS; + +out vec4 color; +out ivec4 icolor; +out uvec4 ucolor; + +void foo(isubpassInputMS sb) +{ + icolor += subpassLoad(sb, 3); +} + +void main() +{ + color = subpassLoad(sub); + color += subpassLoad(subMS, 3); + icolor = subpassLoad(isub); + icolor += subpassLoad(isubMS, 3); + ucolor = subpassLoad(usub); + ucolor += subpassLoad(usubMS, 3); + + foo(isubMS); +} diff --git a/core/deps/glslang/Test/spv.switch.frag b/core/deps/glslang/Test/spv.switch.frag index c01a3ef0d..1808086a4 100644 --- a/core/deps/glslang/Test/spv.switch.frag +++ b/core/deps/glslang/Test/spv.switch.frag @@ -1,142 +1,142 @@ -#version 310 es -precision mediump float; -flat in int c, d; -in float x; -out float color; -in vec4 v; - -vec4 foo1(vec4 v1, vec4 v2, int i1) -{ - switch (i1) - { - case 0: - return v1; - case 2: - case 1: - return v2; - case 3: - return v1 * v2; - } - - return vec4(0.0); -} - -vec4 foo2(vec4 v1, vec4 v2, int i1) -{ - switch (i1) - { - case 0: - return v1; - case 2: - return vec4(1.0); - case 1: - return v2; - case 3: - return v1 * v2; - } - - return vec4(0.0); -} - -void main() -{ - float f; - int a[2]; - int local = c; - - switch(++local) - { - } - - switch (c) { - case 1: - f = sin(x); - break; - case 2: - f = cos(x); - break; - default: - f = tan(x); - } - - switch (c) { - case 1: - f += sin(x); - case 2: - f += cos(x); - break; - default: - f += tan(x); - } - - switch (c) { - case 1: - f += sin(x); - break; - case 2: - f += cos(x); - break; - } - - switch (c) { - case 1: - f += sin(x); - break; - case 2: - switch (d) { - case 1: - f += x * x * x; - break; - case 2: - f += x * x; - break; - } - break; - default: - f += tan(x); - } - - for (int i = 0; i < 10; ++i) { - switch (c) { - case 1: - f += sin(x); - for (int j = 20; j < 30; ++j) { - ++f; - if (f < 100.2) - break; - } - break; - case 2: - f += cos(x); - break; - break; - default: - f += tan(x); - } - - if (f < 3.43) - break; - } - - switch (c) { - case 1: - f += sin(x); - break; - case 2: - // test no statements at end - } - - color = f + float(local); - - color += foo1(v,v,c).y; - color += foo2(v,v,c).z; - - switch (c) { - case 0: break; - default: - } - - switch (c) { - default: - } -} +#version 310 es +precision mediump float; +flat in int c, d; +in float x; +out float color; +in vec4 v; + +vec4 foo1(vec4 v1, vec4 v2, int i1) +{ + switch (i1) + { + case 0: + return v1; + case 2: + case 1: + return v2; + case 3: + return v1 * v2; + } + + return vec4(0.0); +} + +vec4 foo2(vec4 v1, vec4 v2, int i1) +{ + switch (i1) + { + case 0: + return v1; + case 2: + return vec4(1.0); + case 1: + return v2; + case 3: + return v1 * v2; + } + + return vec4(0.0); +} + +void main() +{ + float f; + int a[2]; + int local = c; + + switch(++local) + { + } + + switch (c) { + case 1: + f = sin(x); + break; + case 2: + f = cos(x); + break; + default: + f = tan(x); + } + + switch (c) { + case 1: + f += sin(x); + case 2: + f += cos(x); + break; + default: + f += tan(x); + } + + switch (c) { + case 1: + f += sin(x); + break; + case 2: + f += cos(x); + break; + } + + switch (c) { + case 1: + f += sin(x); + break; + case 2: + switch (d) { + case 1: + f += x * x * x; + break; + case 2: + f += x * x; + break; + } + break; + default: + f += tan(x); + } + + for (int i = 0; i < 10; ++i) { + switch (c) { + case 1: + f += sin(x); + for (int j = 20; j < 30; ++j) { + ++f; + if (f < 100.2) + break; + } + break; + case 2: + f += cos(x); + break; + break; + default: + f += tan(x); + } + + if (f < 3.43) + break; + } + + switch (c) { + case 1: + f += sin(x); + break; + case 2: + // test no statements at end + } + + color = f + float(local); + + color += foo1(v,v,c).y; + color += foo2(v,v,c).z; + + switch (c) { + case 0: break; + default: + } + + switch (c) { + default: + } +} diff --git a/core/deps/glslang/Test/spv.swizzle.frag b/core/deps/glslang/Test/spv.swizzle.frag index 3f3431123..5a5a203c3 100644 --- a/core/deps/glslang/Test/spv.swizzle.frag +++ b/core/deps/glslang/Test/spv.swizzle.frag @@ -1,52 +1,52 @@ -#version 140 - -in float blend; -in vec4 u; -bool p; - -in vec2 t; - -void main() -{ - float blendscale = 1.789; - - vec4 w = u; - vec4 w_undef; // test undef - vec4 w_dep = u; // test dependent swizzles - vec4 w_reorder = u; // test reordering - vec4 w2 = u; - vec4 w_flow = u; // test flowControl - - w_reorder.z = blendscale; - - w.wy = t; - - w_reorder.x = blendscale; - - w2.xyzw = u.zwxy; - - w_reorder.y = blendscale; - - w_dep.xy = w2.xz; - w_dep.zw = t; - - w_undef.xy = u.zw; - - if (p) - w_flow.x = t.x; - else - w_flow.x = t.y; - - gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow); - - vec2 c = t; - vec4 rep = vec4(0.0, 0.0, 0.0, 1.0); - - if (c.x < 0.0) - c.x *= -1.0; - - if (c.x <= 1.0) - rep.x = 3.4; - - gl_FragColor += rep; -} +#version 140 + +in float blend; +in vec4 u; +bool p; + +in vec2 t; + +void main() +{ + float blendscale = 1.789; + + vec4 w = u; + vec4 w_undef; // test undef + vec4 w_dep = u; // test dependent swizzles + vec4 w_reorder = u; // test reordering + vec4 w2 = u; + vec4 w_flow = u; // test flowControl + + w_reorder.z = blendscale; + + w.wy = t; + + w_reorder.x = blendscale; + + w2.xyzw = u.zwxy; + + w_reorder.y = blendscale; + + w_dep.xy = w2.xz; + w_dep.zw = t; + + w_undef.xy = u.zw; + + if (p) + w_flow.x = t.x; + else + w_flow.x = t.y; + + gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow); + + vec2 c = t; + vec4 rep = vec4(0.0, 0.0, 0.0, 1.0); + + if (c.x < 0.0) + c.x *= -1.0; + + if (c.x <= 1.0) + rep.x = 3.4; + + gl_FragColor += rep; +} diff --git a/core/deps/glslang/Test/spv.swizzleInversion.frag b/core/deps/glslang/Test/spv.swizzleInversion.frag index 3fb0709e4..9dca62f8b 100644 --- a/core/deps/glslang/Test/spv.swizzleInversion.frag +++ b/core/deps/glslang/Test/spv.swizzleInversion.frag @@ -1,16 +1,16 @@ -#version 450 - -in vec4 in4; -in vec3 in3; - -void main() -{ - vec3 v43 = interpolateAtCentroid(in4.wzx); - vec2 v42 = interpolateAtSample(in4.zx, 1); - vec4 v44 = interpolateAtOffset(in4.zyxw, vec2(2.0)); - float v41 = interpolateAtOffset(in4.y, vec2(2.0)); - - vec3 v33 = interpolateAtCentroid(in3.yzx); - vec2 v32 = interpolateAtSample(in3.zx, 1); - float v31 = interpolateAtOffset(in4.y, vec2(2.0)); -} +#version 450 + +in vec4 in4; +in vec3 in3; + +void main() +{ + vec3 v43 = interpolateAtCentroid(in4.wzx); + vec2 v42 = interpolateAtSample(in4.zx, 1); + vec4 v44 = interpolateAtOffset(in4.zyxw, vec2(2.0)); + float v41 = interpolateAtOffset(in4.y, vec2(2.0)); + + vec3 v33 = interpolateAtCentroid(in3.yzx); + vec2 v32 = interpolateAtSample(in3.zx, 1); + float v31 = interpolateAtOffset(in4.y, vec2(2.0)); +} diff --git a/core/deps/glslang/Test/spv.targetOpenGL.vert b/core/deps/glslang/Test/spv.targetOpenGL.vert index 2a2cef9c1..501a3e564 100644 --- a/core/deps/glslang/Test/spv.targetOpenGL.vert +++ b/core/deps/glslang/Test/spv.targetOpenGL.vert @@ -1,10 +1,10 @@ -#version 450 - -layout(constant_id = 3) const int a = 2; -layout(location = 2) uniform float f; -layout(location = 4, binding = 1) uniform sampler2D s1; -layout(binding = 2) uniform sampler2D s2; - -void main() -{ -} +#version 450 + +layout(constant_id = 3) const int a = 2; +layout(location = 2) uniform float f; +layout(location = 4, binding = 1) uniform sampler2D s1; +layout(binding = 2) uniform sampler2D s2; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.targetVulkan.vert b/core/deps/glslang/Test/spv.targetVulkan.vert index 8c4598cd9..d879122b0 100644 --- a/core/deps/glslang/Test/spv.targetVulkan.vert +++ b/core/deps/glslang/Test/spv.targetVulkan.vert @@ -1,9 +1,9 @@ -#version 450 - -layout(constant_id = 3) const int a = 2; - -layout(push_constant) uniform pc { float f; }; - -void main() -{ -} +#version 450 + +layout(constant_id = 3) const int a = 2; + +layout(push_constant) uniform pc { float f; }; + +void main() +{ +} diff --git a/core/deps/glslang/Test/spv.test.frag b/core/deps/glslang/Test/spv.test.frag index 68e712824..3d4d8f960 100644 --- a/core/deps/glslang/Test/spv.test.frag +++ b/core/deps/glslang/Test/spv.test.frag @@ -1,22 +1,22 @@ -#version 400 - -uniform sampler2D texSampler2D; -uniform sampler3D texSampler3D; - -in float blend; -in vec2 scale; -in vec4 u; - -in vec2 t; -in vec3 coords; - -void main() -{ - float blendscale = 1.789; - - vec4 v = texture(texSampler2D, (t + scale) / scale ).wzyx; - - vec4 w = texture(texSampler3D, coords) + v; - - gl_FragColor = mix(w, u, blend * blendscale); -} +#version 400 + +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; + +in float blend; +in vec2 scale; +in vec4 u; + +in vec2 t; +in vec3 coords; + +void main() +{ + float blendscale = 1.789; + + vec4 v = texture(texSampler2D, (t + scale) / scale ).wzyx; + + vec4 w = texture(texSampler3D, coords) + v; + + gl_FragColor = mix(w, u, blend * blendscale); +} diff --git a/core/deps/glslang/Test/spv.test.vert b/core/deps/glslang/Test/spv.test.vert index e917f6d79..e2e16aa52 100644 --- a/core/deps/glslang/Test/spv.test.vert +++ b/core/deps/glslang/Test/spv.test.vert @@ -1,14 +1,14 @@ -#version 140 - -in mat4 transform; - -attribute vec4 position; -in vec2 uv_in; - -out vec2 uv; - -void main() -{ - uv = uv_in; - gl_Position = transform * position; -} +#version 140 + +in mat4 transform; + +attribute vec4 position; +in vec2 uv_in; + +out vec2 uv; + +void main() +{ + uv = uv_in; + gl_Position = transform * position; +} diff --git a/core/deps/glslang/Test/spv.texture.frag b/core/deps/glslang/Test/spv.texture.frag index 883c3124f..73884d1c2 100644 --- a/core/deps/glslang/Test/spv.texture.frag +++ b/core/deps/glslang/Test/spv.texture.frag @@ -1,73 +1,73 @@ -#version 140 - -uniform sampler1D texSampler1D; -uniform sampler2D texSampler2D; -uniform sampler3D texSampler3D; -uniform samplerCube texSamplerCube; -uniform sampler1DShadow shadowSampler1D; -uniform sampler2DShadow shadowSampler2D; - -varying float blend; -varying vec2 scale; -varying vec4 u; - -in vec2 t; -in vec2 coords2D; - -void main() -{ - float blendscale = 1.789; - float bias = 2.0; - float lod = 3.0; - float proj = 2.0; - float coords1D = 1.789; - vec3 coords3D = vec3(1.789, 2.718, 3.453); - vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - - color += texture (texSampler1D, coords1D); - color += texture (texSampler1D, coords1D, bias); - color += textureProj(texSampler1D, coords2D); - color += textureProj(texSampler1D, coords4D); - color += textureProj(texSampler1D, coords2D, bias); - color += textureProj(texSampler1D, coords4D, bias); - - color += texture (texSampler2D, coords2D); - color += texture (texSampler2D, coords2D, bias); - color += textureProj (texSampler2D, coords3D); - color += textureProj (texSampler2D, coords4D, bias); - - color += texture (texSampler3D, coords3D); - color += texture (texSampler3D, coords3D, bias); - color += textureProj (texSampler3D, coords4D); - color += textureProj (texSampler3D, coords4D, bias); - - color += texture (texSamplerCube, coords3D); - color += texture (texSamplerCube, coords3D, bias); - - color += texture (shadowSampler1D, coords3D); - color += texture (shadowSampler1D, coords3D, bias); - color += texture (shadowSampler2D, coords3D); - color += texture (shadowSampler2D, coords3D, bias); - color += textureProj (shadowSampler1D, coords4D); - color += textureProj (shadowSampler1D, coords4D, bias); - color += textureProj (shadowSampler2D, coords4D); - color += textureProj (shadowSampler2D, coords4D, bias); - - ivec2 iCoords2D = ivec2(0, 5); - int iLod = 1; - - color += texelFetch(texSampler2D, iCoords2D, iLod); - - vec2 gradX = dFdx(coords2D); - vec2 gradY = dFdy(coords2D); - const ivec2 offset = ivec2(3, -7); - - color += textureGrad(texSampler2D, coords2D, gradX, gradY); - color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY); - color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset); - color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset); - color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY); - - gl_FragColor = mix(color, u, blend * blendscale); +#version 140 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; +uniform samplerCube texSamplerCube; +uniform sampler1DShadow shadowSampler1D; +uniform sampler2DShadow shadowSampler2D; + +varying float blend; +varying vec2 scale; +varying vec4 u; + +in vec2 t; +in vec2 coords2D; + +void main() +{ + float blendscale = 1.789; + float bias = 2.0; + float lod = 3.0; + float proj = 2.0; + float coords1D = 1.789; + vec3 coords3D = vec3(1.789, 2.718, 3.453); + vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += texture (texSampler1D, coords1D); + color += texture (texSampler1D, coords1D, bias); + color += textureProj(texSampler1D, coords2D); + color += textureProj(texSampler1D, coords4D); + color += textureProj(texSampler1D, coords2D, bias); + color += textureProj(texSampler1D, coords4D, bias); + + color += texture (texSampler2D, coords2D); + color += texture (texSampler2D, coords2D, bias); + color += textureProj (texSampler2D, coords3D); + color += textureProj (texSampler2D, coords4D, bias); + + color += texture (texSampler3D, coords3D); + color += texture (texSampler3D, coords3D, bias); + color += textureProj (texSampler3D, coords4D); + color += textureProj (texSampler3D, coords4D, bias); + + color += texture (texSamplerCube, coords3D); + color += texture (texSamplerCube, coords3D, bias); + + color += texture (shadowSampler1D, coords3D); + color += texture (shadowSampler1D, coords3D, bias); + color += texture (shadowSampler2D, coords3D); + color += texture (shadowSampler2D, coords3D, bias); + color += textureProj (shadowSampler1D, coords4D); + color += textureProj (shadowSampler1D, coords4D, bias); + color += textureProj (shadowSampler2D, coords4D); + color += textureProj (shadowSampler2D, coords4D, bias); + + ivec2 iCoords2D = ivec2(0, 5); + int iLod = 1; + + color += texelFetch(texSampler2D, iCoords2D, iLod); + + vec2 gradX = dFdx(coords2D); + vec2 gradY = dFdy(coords2D); + const ivec2 offset = ivec2(3, -7); + + color += textureGrad(texSampler2D, coords2D, gradX, gradY); + color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY); + color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset); + color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset); + color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY); + + gl_FragColor = mix(color, u, blend * blendscale); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.texture.sampler.transform.frag b/core/deps/glslang/Test/spv.texture.sampler.transform.frag index 6e9363368..872d9b04d 100644 --- a/core/deps/glslang/Test/spv.texture.sampler.transform.frag +++ b/core/deps/glslang/Test/spv.texture.sampler.transform.frag @@ -1,13 +1,13 @@ -#version 440 - -uniform sampler smp; -uniform texture2D tex; - -in vec2 coord; - -out vec4 color; - -void main() -{ - color = texture(sampler2D(tex, smp), coord); -} +#version 440 + +uniform sampler smp; +uniform texture2D tex; + +in vec2 coord; + +out vec4 color; + +void main() +{ + color = texture(sampler2D(tex, smp), coord); +} diff --git a/core/deps/glslang/Test/spv.texture.vert b/core/deps/glslang/Test/spv.texture.vert index f571a7cd3..9b03bba08 100644 --- a/core/deps/glslang/Test/spv.texture.vert +++ b/core/deps/glslang/Test/spv.texture.vert @@ -1,39 +1,39 @@ -#version 140 - -uniform sampler1D texSampler1D; -uniform sampler2D texSampler2D; -uniform sampler3D texSampler3D; -uniform samplerCube texSamplerCube; -uniform sampler1DShadow shadowSampler1D; -uniform sampler2DShadow shadowSampler2D; - -in vec2 coords2D; - -void main() -{ - float lod = 3.0; - float coords1D = 1.789; - vec3 coords3D = vec3(1.789, 2.718, 3.453); - vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - - color += textureLod(texSampler1D, coords1D, lod); - color += textureProjLod(texSampler1D, coords2D, lod); - color += textureProjLod(texSampler1D, coords4D, lod); - - color += textureLod (texSampler2D, coords2D, lod); - color += textureProjLod (texSampler2D, coords3D, lod); - color += textureProjLod (texSampler2D, coords4D, lod); - - color += textureLod (texSampler3D, coords3D, lod); - color += textureProjLod (texSampler3D, coords4D, lod); - - color += textureLod (texSamplerCube, coords3D, lod); - - color += textureLod (shadowSampler1D, coords3D, lod); - color += textureLod (shadowSampler2D, coords3D, lod); - color += textureProjLod(shadowSampler1D, coords4D, lod); - color += textureProjLod(shadowSampler2D, coords4D, lod); - - gl_Position = color; -} +#version 140 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; +uniform samplerCube texSamplerCube; +uniform sampler1DShadow shadowSampler1D; +uniform sampler2DShadow shadowSampler2D; + +in vec2 coords2D; + +void main() +{ + float lod = 3.0; + float coords1D = 1.789; + vec3 coords3D = vec3(1.789, 2.718, 3.453); + vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += textureLod(texSampler1D, coords1D, lod); + color += textureProjLod(texSampler1D, coords2D, lod); + color += textureProjLod(texSampler1D, coords4D, lod); + + color += textureLod (texSampler2D, coords2D, lod); + color += textureProjLod (texSampler2D, coords3D, lod); + color += textureProjLod (texSampler2D, coords4D, lod); + + color += textureLod (texSampler3D, coords3D, lod); + color += textureProjLod (texSampler3D, coords4D, lod); + + color += textureLod (texSamplerCube, coords3D, lod); + + color += textureLod (shadowSampler1D, coords3D, lod); + color += textureLod (shadowSampler2D, coords3D, lod); + color += textureProjLod(shadowSampler1D, coords4D, lod); + color += textureProjLod(shadowSampler2D, coords4D, lod); + + gl_Position = color; +} diff --git a/core/deps/glslang/Test/spv.textureBuffer.vert b/core/deps/glslang/Test/spv.textureBuffer.vert index c8d8b0328..fc6fa3aca 100644 --- a/core/deps/glslang/Test/spv.textureBuffer.vert +++ b/core/deps/glslang/Test/spv.textureBuffer.vert @@ -1,17 +1,17 @@ -#version 450 - -uniform textureBuffer tBuf; -uniform sampler s; -uniform samplerBuffer sBuf; - -uniform utextureBuffer utBuf; -uniform itextureBuffer itBuf; - -void main() -{ - texelFetch(samplerBuffer(tBuf, s), 13); - texelFetch(sBuf, 13); - texelFetch(tBuf, 13); - texelFetch(utBuf, 13); - texelFetch(itBuf, 13); -} +#version 450 + +uniform textureBuffer tBuf; +uniform sampler s; +uniform samplerBuffer sBuf; + +uniform utextureBuffer utBuf; +uniform itextureBuffer itBuf; + +void main() +{ + texelFetch(samplerBuffer(tBuf, s), 13); + texelFetch(sBuf, 13); + texelFetch(tBuf, 13); + texelFetch(utBuf, 13); + texelFetch(itBuf, 13); +} diff --git a/core/deps/glslang/Test/spv.textureGatherBiasLod.frag b/core/deps/glslang/Test/spv.textureGatherBiasLod.frag index 3b2ac17b6..35bd035aa 100644 --- a/core/deps/glslang/Test/spv.textureGatherBiasLod.frag +++ b/core/deps/glslang/Test/spv.textureGatherBiasLod.frag @@ -1,88 +1,88 @@ -#version 450 core - -#extension GL_ARB_sparse_texture2: enable -#extension GL_AMD_texture_gather_bias_lod: enable - -uniform sampler2D s2D; -uniform sampler2DArray s2DArray; -uniform samplerCube sCube; -uniform samplerCubeArray sCubeArray; - -in vec2 c2; -in vec3 c3; -in vec4 c4; - -in float lod; -in float bias; - -out vec4 fragColor; - -void main() -{ - vec4 texel = vec4(0.0); - vec4 result = vec4(0.0); - - const ivec2 offsets[4] = { ivec2(0, 0), ivec2(0, 1), ivec2(1, 0), ivec2(1, 1) }; - - texel += textureGather(s2D, c2, 0, bias); - texel += textureGather(s2DArray, c3, 1, bias); - texel += textureGather(sCube, c3, 2, bias); - texel += textureGather(sCubeArray, c4, 3, bias); - - texel += textureGatherOffset(s2D, c2, offsets[0], 0, bias); - texel += textureGatherOffset(s2DArray, c3, offsets[1], 1, bias); - - texel += textureGatherOffsets(s2D, c2, offsets, 0, bias); - texel += textureGatherOffsets(s2DArray, c3, offsets, 1, bias); - - sparseTextureGatherARB(s2D, c2, result, 0, bias); - texel += result; - sparseTextureGatherARB(s2DArray, c3, result, 1, bias); - texel += result; - sparseTextureGatherARB(sCube, c3, result, 2, bias); - texel += result; - sparseTextureGatherARB(sCubeArray, c4, result, 2, bias); - texel += result; - - sparseTextureGatherOffsetARB(s2D, c2, offsets[0], result, 0, bias); - texel += result; - sparseTextureGatherOffsetARB(s2DArray, c3, offsets[1], result, 1, bias); - texel += result; - - sparseTextureGatherOffsetsARB(s2D, c2, offsets, result, 0, bias); - texel += result; - sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, result, 1, bias); - texel += result; - - texel += textureGatherLodAMD(s2D, c2, lod); - texel += textureGatherLodAMD(s2DArray, c3, lod, 1); - texel += textureGatherLodAMD(sCube, c3, lod, 2); - texel += textureGatherLodAMD(sCubeArray, c4, lod, 3); - - texel += textureGatherLodOffsetAMD(s2D, c2, lod, offsets[0]); - texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offsets[1], 1); - - texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets); - texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 1); - - sparseTextureGatherLodAMD(s2D, c2, lod, result); - texel += result; - sparseTextureGatherLodAMD(s2DArray, c3, lod, result, 1); - texel += result; - sparseTextureGatherLodAMD(sCube, c3, lod, result, 2); - texel += result; - sparseTextureGatherLodAMD(sCubeArray, c4, lod, result, 2); - texel += result; - - sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offsets[0], result); - texel += result; - sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offsets[1], result, 1); - texel += result; - - sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, result); - texel += result; - sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, result, 1); - texel += result; - - fragColor = texel; -} +#version 450 core + +#extension GL_ARB_sparse_texture2: enable +#extension GL_AMD_texture_gather_bias_lod: enable + +uniform sampler2D s2D; +uniform sampler2DArray s2DArray; +uniform samplerCube sCube; +uniform samplerCubeArray sCubeArray; + +in vec2 c2; +in vec3 c3; +in vec4 c4; + +in float lod; +in float bias; + +out vec4 fragColor; + +void main() +{ + vec4 texel = vec4(0.0); + vec4 result = vec4(0.0); + + const ivec2 offsets[4] = { ivec2(0, 0), ivec2(0, 1), ivec2(1, 0), ivec2(1, 1) }; + + texel += textureGather(s2D, c2, 0, bias); + texel += textureGather(s2DArray, c3, 1, bias); + texel += textureGather(sCube, c3, 2, bias); + texel += textureGather(sCubeArray, c4, 3, bias); + + texel += textureGatherOffset(s2D, c2, offsets[0], 0, bias); + texel += textureGatherOffset(s2DArray, c3, offsets[1], 1, bias); + + texel += textureGatherOffsets(s2D, c2, offsets, 0, bias); + texel += textureGatherOffsets(s2DArray, c3, offsets, 1, bias); + + sparseTextureGatherARB(s2D, c2, result, 0, bias); + texel += result; + sparseTextureGatherARB(s2DArray, c3, result, 1, bias); + texel += result; + sparseTextureGatherARB(sCube, c3, result, 2, bias); + texel += result; + sparseTextureGatherARB(sCubeArray, c4, result, 2, bias); + texel += result; + + sparseTextureGatherOffsetARB(s2D, c2, offsets[0], result, 0, bias); + texel += result; + sparseTextureGatherOffsetARB(s2DArray, c3, offsets[1], result, 1, bias); + texel += result; + + sparseTextureGatherOffsetsARB(s2D, c2, offsets, result, 0, bias); + texel += result; + sparseTextureGatherOffsetsARB(s2DArray, c3, offsets, result, 1, bias); + texel += result; + + texel += textureGatherLodAMD(s2D, c2, lod); + texel += textureGatherLodAMD(s2DArray, c3, lod, 1); + texel += textureGatherLodAMD(sCube, c3, lod, 2); + texel += textureGatherLodAMD(sCubeArray, c4, lod, 3); + + texel += textureGatherLodOffsetAMD(s2D, c2, lod, offsets[0]); + texel += textureGatherLodOffsetAMD(s2DArray, c3, lod, offsets[1], 1); + + texel += textureGatherLodOffsetsAMD(s2D, c2, lod, offsets); + texel += textureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, 1); + + sparseTextureGatherLodAMD(s2D, c2, lod, result); + texel += result; + sparseTextureGatherLodAMD(s2DArray, c3, lod, result, 1); + texel += result; + sparseTextureGatherLodAMD(sCube, c3, lod, result, 2); + texel += result; + sparseTextureGatherLodAMD(sCubeArray, c4, lod, result, 2); + texel += result; + + sparseTextureGatherLodOffsetAMD(s2D, c2, lod, offsets[0], result); + texel += result; + sparseTextureGatherLodOffsetAMD(s2DArray, c3, lod, offsets[1], result, 1); + texel += result; + + sparseTextureGatherLodOffsetsAMD(s2D, c2, lod, offsets, result); + texel += result; + sparseTextureGatherLodOffsetsAMD(s2DArray, c3, lod, offsets, result, 1); + texel += result; + + fragColor = texel; +} diff --git a/core/deps/glslang/Test/spv.types.frag b/core/deps/glslang/Test/spv.types.frag index fe0bf4cb6..a2ab1d324 100644 --- a/core/deps/glslang/Test/spv.types.frag +++ b/core/deps/glslang/Test/spv.types.frag @@ -1,78 +1,78 @@ -#version 140 - -bool u_b; -bvec2 u_b2; -bvec3 u_b3; -bvec4 u_b4; -flat in int u_i; -flat in ivec2 u_i2; -flat in ivec3 u_i3; -flat in ivec4 u_i4; - in float u_f; - in vec2 u_f2; - in vec3 u_f3; - in vec4 u_f4; -bool i_b; -bvec2 i_b2; -bvec3 i_b3; -bvec4 i_b4; - -flat in int i_i; -flat in ivec2 i_i2; -flat in ivec3 i_i3; -flat in ivec4 i_i4; - -in float i_f; -in vec2 i_f2; -in vec3 i_f3; -in vec4 i_f4; - -void main() -{ - bool b = u_b && i_b; - bvec2 b2 = bvec2(u_b2.x && i_b2.x && u_b2.y && i_b2.y); - bvec3 b3 = bvec3(u_b3.x && i_b3.x && u_b3.y && i_b3.y && u_b3.z && i_b3.z); - bvec4 b4 = bvec4(u_b4.x && i_b4.x && u_b4.y && i_b4.y && u_b4.z && i_b4.z && u_b4.w && i_b4.w); - - int i = u_i + i_i; - ivec2 i2 = u_i2 + i_i2; - ivec3 i3 = u_i3 + i_i3; - ivec4 i4 = u_i4 + i_i4; - - float f = u_f + i_f; - vec2 f2 = u_f2 + i_f2; - vec3 f3 = u_f3 + i_f3; - vec4 f4 = u_f4 + i_f4; - - gl_FragColor = - b || - b2.x || - b2.y || - b3.x || - b3.y || - b3.z || - b4.x || - b4.y || - b4.z || - b4.w ? vec4( - i + - i2.x + - i2.y + - i3.x + - i3.y + - i3.z + - i4.x + - i4.y + - i4.z + - i4.w + - f + - f2.x + - f2.y + - f3.x + - f3.y + - f3.z + - f4.x + - f4.y + - f4.z + - f4.w) : vec4(1.0); -} +#version 140 + +bool u_b; +bvec2 u_b2; +bvec3 u_b3; +bvec4 u_b4; +flat in int u_i; +flat in ivec2 u_i2; +flat in ivec3 u_i3; +flat in ivec4 u_i4; + in float u_f; + in vec2 u_f2; + in vec3 u_f3; + in vec4 u_f4; +bool i_b; +bvec2 i_b2; +bvec3 i_b3; +bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = u_b && i_b; + bvec2 b2 = bvec2(u_b2.x && i_b2.x && u_b2.y && i_b2.y); + bvec3 b3 = bvec3(u_b3.x && i_b3.x && u_b3.y && i_b3.y && u_b3.z && i_b3.z); + bvec4 b4 = bvec4(u_b4.x && i_b4.x && u_b4.y && i_b4.y && u_b4.z && i_b4.z && u_b4.w && i_b4.w); + + int i = u_i + i_i; + ivec2 i2 = u_i2 + i_i2; + ivec3 i3 = u_i3 + i_i3; + ivec4 i4 = u_i4 + i_i4; + + float f = u_f + i_f; + vec2 f2 = u_f2 + i_f2; + vec3 f3 = u_f3 + i_f3; + vec4 f4 = u_f4 + i_f4; + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); +} diff --git a/core/deps/glslang/Test/spv.uint.frag b/core/deps/glslang/Test/spv.uint.frag index 48f29fe43..853de7c4a 100644 --- a/core/deps/glslang/Test/spv.uint.frag +++ b/core/deps/glslang/Test/spv.uint.frag @@ -1,102 +1,102 @@ -#version 310 es -precision mediump float; -flat in uvec2 t; -in float f; -in vec2 tc; - -flat in uvec4 v; -flat in int i; -bool b; - -out uvec4 c; - -uniform mediump usampler2D usampler; - -void main() -{ - int count = 1; - - uint u = t.y + 3u; - const uint cu1 = 0xFFFFFFFFU; - const uint cu2 = -1u; // 0xFFFFFFFF - const uint cu3 = 1U; - const uint cu4 = 1u; - - if (cu1 == cu2) - count *= 2; // 2 - if (cu3 == cu4) - count *= 3; // 6 - if (cu2 == cu3) - count *= 5; // not done - - const int cshiftedii = 0xFFFFFFFF >> 10; - const uint cushiftedui = 0xFFFFFFFFu >> 10; - const int cshiftediu = 0xFFFFFFFF >> 10u; - const uint cushifteduu = 0xFFFFFFFFu >> 10u; - - if (cshiftedii == cshiftediu) - count *= 7; // 42 - if (cushiftedui == cushifteduu) - count *= 11; // 462 - if (cshiftedii == int(cushiftedui)) - count *= 13; // not done - - int shiftedii = 0xFFFFFFFF >> 10; - uint shiftedui = 0xFFFFFFFFu >> 10; - int shiftediu = 0xFFFFFFFF >> 10u; - uint shifteduu = 0xFFFFFFFFu >> 10u; - - if (shiftedii == shiftediu) - c = texture(usampler, tc); - if (shiftedui == shifteduu) - c = texture(usampler, tc + float(1u)); - if (shiftedii == int(shiftedui)) - c = texture(usampler, tc - vec2(2u)); - - if (t.x > 4u) { - float af = float(u); - bool ab = bool(u); - int ai = int(u); - - c += uvec4(uint(af), uint(ab), uint(ai), count); - } - - const uint cmask1 = 0x0A1u; - const uint cmask2 = 0xA10u; - const uint cmask3 = cmask1 << 4; - const uint cmask4 = 0xAB1u; - - if (cmask3 == cmask2) - count *= 17; // 7854 - - if ((cmask3 & cmask1) != 0u) - count *= 19; // not done - - if ((cmask1 | cmask3) == cmask4) - count *= 23; // 180642 - - if ((cmask1 ^ cmask4) == 0xA10u) - count *= 27; // 4877334 - - uint mask1 = 0x0A1u; - uint mask2 = 0xA10u; - uint mask3 = mask1 << 4; - uint mask4 = 0xAB1u; - - if (mask3 == mask2) - count *= 2; // 9754668 - - if ((mask3 & mask1) != 0u) - count *= 3; // not done - - if ((mask1 | mask3) == mask4) - count *= 5; // 48773340 - - if ((mask1 ^ mask4) == 0xA10u) - count *= 7; // 341413380 - - c += uvec4(count); - - #define UINT_MAX 4294967295u - c.x += UINT_MAX; -} +#version 310 es +precision mediump float; +flat in uvec2 t; +in float f; +in vec2 tc; + +flat in uvec4 v; +flat in int i; +bool b; + +out uvec4 c; + +uniform mediump usampler2D usampler; + +void main() +{ + int count = 1; + + uint u = t.y + 3u; + const uint cu1 = 0xFFFFFFFFU; + const uint cu2 = -1u; // 0xFFFFFFFF + const uint cu3 = 1U; + const uint cu4 = 1u; + + if (cu1 == cu2) + count *= 2; // 2 + if (cu3 == cu4) + count *= 3; // 6 + if (cu2 == cu3) + count *= 5; // not done + + const int cshiftedii = 0xFFFFFFFF >> 10; + const uint cushiftedui = 0xFFFFFFFFu >> 10; + const int cshiftediu = 0xFFFFFFFF >> 10u; + const uint cushifteduu = 0xFFFFFFFFu >> 10u; + + if (cshiftedii == cshiftediu) + count *= 7; // 42 + if (cushiftedui == cushifteduu) + count *= 11; // 462 + if (cshiftedii == int(cushiftedui)) + count *= 13; // not done + + int shiftedii = 0xFFFFFFFF >> 10; + uint shiftedui = 0xFFFFFFFFu >> 10; + int shiftediu = 0xFFFFFFFF >> 10u; + uint shifteduu = 0xFFFFFFFFu >> 10u; + + if (shiftedii == shiftediu) + c = texture(usampler, tc); + if (shiftedui == shifteduu) + c = texture(usampler, tc + float(1u)); + if (shiftedii == int(shiftedui)) + c = texture(usampler, tc - vec2(2u)); + + if (t.x > 4u) { + float af = float(u); + bool ab = bool(u); + int ai = int(u); + + c += uvec4(uint(af), uint(ab), uint(ai), count); + } + + const uint cmask1 = 0x0A1u; + const uint cmask2 = 0xA10u; + const uint cmask3 = cmask1 << 4; + const uint cmask4 = 0xAB1u; + + if (cmask3 == cmask2) + count *= 17; // 7854 + + if ((cmask3 & cmask1) != 0u) + count *= 19; // not done + + if ((cmask1 | cmask3) == cmask4) + count *= 23; // 180642 + + if ((cmask1 ^ cmask4) == 0xA10u) + count *= 27; // 4877334 + + uint mask1 = 0x0A1u; + uint mask2 = 0xA10u; + uint mask3 = mask1 << 4; + uint mask4 = 0xAB1u; + + if (mask3 == mask2) + count *= 2; // 9754668 + + if ((mask3 & mask1) != 0u) + count *= 3; // not done + + if ((mask1 | mask3) == mask4) + count *= 5; // 48773340 + + if ((mask1 ^ mask4) == 0xA10u) + count *= 7; // 341413380 + + c += uvec4(count); + + #define UINT_MAX 4294967295u + c.x += UINT_MAX; +} diff --git a/core/deps/glslang/Test/spv.uniformArray.frag b/core/deps/glslang/Test/spv.uniformArray.frag index 4f642e6e9..b7625afe8 100644 --- a/core/deps/glslang/Test/spv.uniformArray.frag +++ b/core/deps/glslang/Test/spv.uniformArray.frag @@ -1,17 +1,17 @@ -#version 140 - -uniform sampler2D texSampler2D; -in vec3 inColor; -in vec4 color[6]; -in float alpha[16]; - -void main() -{ - vec4 texColor = color[1] + color[1]; - - texColor.xyz += inColor; - - texColor.a += alpha[12]; - - gl_FragColor = texColor; -} +#version 140 + +uniform sampler2D texSampler2D; +in vec3 inColor; +in vec4 color[6]; +in float alpha[16]; + +void main() +{ + vec4 texColor = color[1] + color[1]; + + texColor.xyz += inColor; + + texColor.a += alpha[12]; + + gl_FragColor = texColor; +} diff --git a/core/deps/glslang/Test/spv.variableArrayIndex.frag b/core/deps/glslang/Test/spv.variableArrayIndex.frag index ab52f548e..cc304b8ef 100644 --- a/core/deps/glslang/Test/spv.variableArrayIndex.frag +++ b/core/deps/glslang/Test/spv.variableArrayIndex.frag @@ -1,49 +1,49 @@ -#version 400 - -uniform sampler2D samp2D; -in vec2 coord; - -struct lunarStruct1 { - int i; - float f; -}; - -struct lunarStruct2 { - int i; - float f; - lunarStruct1 s1_1; -}; - -struct lunarStruct3 { - lunarStruct2 s2_1[3]; - int i; - float f; - lunarStruct1 s1_1; -}; - - -flat in lunarStruct1 foo; -flat in lunarStruct2 foo2[5]; -flat in lunarStruct3 foo3; -flat in int Count; - -void main() -{ - float scale; - int iLocal = Count; - - if (foo3.s2_1[1].i > 0) - scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f; - else - scale = foo3.s2_1[0].s1_1.f; - - //for (int i = 0; i < iLocal; ++i) { - // scale += foo2[i].f; - //} - - gl_FragColor = scale * texture(samp2D, coord); - - vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); - gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); -} - +#version 400 + +uniform sampler2D samp2D; +in vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1[3]; + int i; + float f; + lunarStruct1 s1_1; +}; + + +flat in lunarStruct1 foo; +flat in lunarStruct2 foo2[5]; +flat in lunarStruct3 foo3; +flat in int Count; + +void main() +{ + float scale; + int iLocal = Count; + + if (foo3.s2_1[1].i > 0) + scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f; + else + scale = foo3.s2_1[0].s1_1.f; + + //for (int i = 0; i < iLocal; ++i) { + // scale += foo2[i].f; + //} + + gl_FragColor = scale * texture(samp2D, coord); + + vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); + gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); +} + diff --git a/core/deps/glslang/Test/spv.varyingArray.frag b/core/deps/glslang/Test/spv.varyingArray.frag index 9baa34674..f6e043f22 100644 --- a/core/deps/glslang/Test/spv.varyingArray.frag +++ b/core/deps/glslang/Test/spv.varyingArray.frag @@ -1,19 +1,19 @@ -#version 140 -uniform sampler2D texSampler2D; -in vec4 color; -in float alpha; - -in vec4 TexCoord[6]; - -in vec4 foo[3]; - -void main() -{ - vec4 texColor = texture(texSampler2D, vec2(TexCoord[4] + TexCoord[5])); - - texColor += color; - - texColor.a = alpha; - - gl_FragColor = foo[1] + TexCoord[0] + TexCoord[4] + texColor; -} +#version 140 +uniform sampler2D texSampler2D; +in vec4 color; +in float alpha; + +in vec4 TexCoord[6]; + +in vec4 foo[3]; + +void main() +{ + vec4 texColor = texture(texSampler2D, vec2(TexCoord[4] + TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = foo[1] + TexCoord[0] + TexCoord[4] + texColor; +} diff --git a/core/deps/glslang/Test/spv.varyingArrayIndirect.frag b/core/deps/glslang/Test/spv.varyingArrayIndirect.frag index 34733ed9d..a556c9eb5 100644 --- a/core/deps/glslang/Test/spv.varyingArrayIndirect.frag +++ b/core/deps/glslang/Test/spv.varyingArrayIndirect.frag @@ -1,21 +1,21 @@ -#version 140 -uniform sampler2D texSampler2D; -in vec4 color; -in float alpha; - -in vec4 TexCoord[6]; - -in vec4 userIn[2]; - -flat in int a, b; - -void main() -{ - vec4 texColor = texture(texSampler2D, vec2(userIn[b] + TexCoord[a] + TexCoord[5])); - - texColor += color; - - texColor.a = alpha; - - gl_FragColor = TexCoord[0] + TexCoord[b] + texColor + userIn[a]; -} +#version 140 +uniform sampler2D texSampler2D; +in vec4 color; +in float alpha; + +in vec4 TexCoord[6]; + +in vec4 userIn[2]; + +flat in int a, b; + +void main() +{ + vec4 texColor = texture(texSampler2D, vec2(userIn[b] + TexCoord[a] + TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = TexCoord[0] + TexCoord[b] + texColor + userIn[a]; +} diff --git a/core/deps/glslang/Test/spv.vecMatConstruct.frag b/core/deps/glslang/Test/spv.vecMatConstruct.frag index 896e324bb..54a001707 100644 --- a/core/deps/glslang/Test/spv.vecMatConstruct.frag +++ b/core/deps/glslang/Test/spv.vecMatConstruct.frag @@ -1,14 +1,14 @@ -#version 450 - -void main() -{ - mat4x3 m; - - vec2 v2 = vec2(m); - vec3 v3 = vec3(m); - vec4 v4 = vec4(m); - - ivec2 iv2 = ivec2(m); - ivec3 iv3 = ivec3(m); - ivec4 iv4 = ivec4(m); -} +#version 450 + +void main() +{ + mat4x3 m; + + vec2 v2 = vec2(m); + vec3 v3 = vec3(m); + vec4 v4 = vec4(m); + + ivec2 iv2 = ivec2(m); + ivec3 iv3 = ivec3(m); + ivec4 iv4 = ivec4(m); +} diff --git a/core/deps/glslang/Test/spv.viewportArray2.tesc b/core/deps/glslang/Test/spv.viewportArray2.tesc index 9a33e2331..7fc208a45 100644 --- a/core/deps/glslang/Test/spv.viewportArray2.tesc +++ b/core/deps/glslang/Test/spv.viewportArray2.tesc @@ -1,16 +1,16 @@ -#version 450 -#extension GL_NV_viewport_array2 :require - -layout(vertices = 4) out; - -out gl_PerVertex { - int gl_ViewportMask[2]; -} gl_out[4]; - -layout (viewport_relative) out highp int gl_Layer; - -void main() -{ - gl_out[gl_InvocationID].gl_ViewportMask[0] = 1; - gl_ViewportIndex = 2; -} +#version 450 +#extension GL_NV_viewport_array2 :require + +layout(vertices = 4) out; + +out gl_PerVertex { + int gl_ViewportMask[2]; +} gl_out[4]; + +layout (viewport_relative) out highp int gl_Layer; + +void main() +{ + gl_out[gl_InvocationID].gl_ViewportMask[0] = 1; + gl_ViewportIndex = 2; +} diff --git a/core/deps/glslang/Test/spv.voidFunction.frag b/core/deps/glslang/Test/spv.voidFunction.frag index c3bc45c2f..228ea1ffd 100644 --- a/core/deps/glslang/Test/spv.voidFunction.frag +++ b/core/deps/glslang/Test/spv.voidFunction.frag @@ -1,34 +1,34 @@ -#version 400 - -in vec4 bigColor; -in vec4 BaseColor; -in float d; - -float bar = 2.0; - -void foo() -{ - bar++; - - return; -} - -void foo2() -{ - bar++; -} - -void main() -{ - vec4 outColor = bigColor; - - foo(); - - foo2(); - - outColor.x += bar; - - gl_FragColor = outColor; - - return; -} +#version 400 + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +float bar = 2.0; + +void foo() +{ + bar++; + + return; +} + +void foo2() +{ + bar++; +} + +void main() +{ + vec4 outColor = bigColor; + + foo(); + + foo2(); + + outColor.x += bar; + + gl_FragColor = outColor; + + return; +} diff --git a/core/deps/glslang/Test/spv.volatileAtomic.comp b/core/deps/glslang/Test/spv.volatileAtomic.comp index a86f89627..2b7e6c62c 100644 --- a/core/deps/glslang/Test/spv.volatileAtomic.comp +++ b/core/deps/glslang/Test/spv.volatileAtomic.comp @@ -1,8 +1,8 @@ -#version 450 core - -layout(set=0, binding=3) volatile buffer D { uint d[]; } d; - -void main() -{ - atomicExchange(d.d[0], 0); -} +#version 450 core + +layout(set=0, binding=3) volatile buffer D { uint d[]; } d; + +void main() +{ + atomicExchange(d.d[0], 0); +} diff --git a/core/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp b/core/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp index c17a2592f..6cc9337b6 100644 --- a/core/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp +++ b/core/deps/glslang/Test/spv.vulkan100.subgroupArithmetic.comp @@ -1,393 +1,393 @@ -#version 450 - -#extension GL_KHR_shader_subgroup_arithmetic: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - data[invocation].f4.x = subgroupAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupAdd(data[3].f4); - - data[invocation].i4.x = subgroupAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupAdd(data[3].i4); - - data[invocation].u4.x = subgroupAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupAdd(data[3].u4); - - data[invocation].d4.x = subgroupAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupAdd(data[3].d4); - - data[invocation].f4.x = subgroupMul(data[0].f4.x); - data[invocation].f4.xy = subgroupMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); - data[invocation].f4 = subgroupMul(data[3].f4); - - data[invocation].i4.x = subgroupMul(data[0].i4.x); - data[invocation].i4.xy = subgroupMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); - data[invocation].i4 = subgroupMul(data[3].i4); - - data[invocation].u4.x = subgroupMul(data[0].u4.x); - data[invocation].u4.xy = subgroupMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); - data[invocation].u4 = subgroupMul(data[3].u4); - - data[invocation].d4.x = subgroupMul(data[0].d4.x); - data[invocation].d4.xy = subgroupMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); - data[invocation].d4 = subgroupMul(data[3].d4); - - data[invocation].f4.x = subgroupMin(data[0].f4.x); - data[invocation].f4.xy = subgroupMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); - data[invocation].f4 = subgroupMin(data[3].f4); - - data[invocation].i4.x = subgroupMin(data[0].i4.x); - data[invocation].i4.xy = subgroupMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); - data[invocation].i4 = subgroupMin(data[3].i4); - - data[invocation].u4.x = subgroupMin(data[0].u4.x); - data[invocation].u4.xy = subgroupMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); - data[invocation].u4 = subgroupMin(data[3].u4); - - data[invocation].d4.x = subgroupMin(data[0].d4.x); - data[invocation].d4.xy = subgroupMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); - data[invocation].d4 = subgroupMin(data[3].d4); - - data[invocation].f4.x = subgroupMax(data[0].f4.x); - data[invocation].f4.xy = subgroupMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); - data[invocation].f4 = subgroupMax(data[3].f4); - - data[invocation].i4.x = subgroupMax(data[0].i4.x); - data[invocation].i4.xy = subgroupMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); - data[invocation].i4 = subgroupMax(data[3].i4); - - data[invocation].u4.x = subgroupMax(data[0].u4.x); - data[invocation].u4.xy = subgroupMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); - data[invocation].u4 = subgroupMax(data[3].u4); - - data[invocation].d4.x = subgroupMax(data[0].d4.x); - data[invocation].d4.xy = subgroupMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); - data[invocation].d4 = subgroupMax(data[3].d4); - - data[invocation].i4.x = subgroupAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupAnd(data[3].i4); - - data[invocation].u4.x = subgroupAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupOr(data[0].i4.x); - data[invocation].i4.xy = subgroupOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); - data[invocation].i4 = subgroupOr(data[3].i4); - - data[invocation].u4.x = subgroupOr(data[0].u4.x); - data[invocation].u4.xy = subgroupOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); - data[invocation].u4 = subgroupOr(data[3].u4); - - data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupXor(data[0].i4.x); - data[invocation].i4.xy = subgroupXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); - data[invocation].i4 = subgroupXor(data[3].i4); - - data[invocation].u4.x = subgroupXor(data[0].u4.x); - data[invocation].u4.xy = subgroupXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); - data[invocation].u4 = subgroupXor(data[3].u4); - - data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMul(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMul(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMul(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMul(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMin(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMin(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMin(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMin(data[3].d4); - - data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); - data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); - data[invocation].f4 = subgroupInclusiveMax(data[3].f4); - - data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveMax(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveMax(data[3].u4); - - data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); - data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); - data[invocation].d4 = subgroupInclusiveMax(data[3].d4); - - data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveOr(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveOr(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); - data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); - data[invocation].i4 = subgroupInclusiveXor(data[3].i4); - - data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); - data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); - data[invocation].u4 = subgroupInclusiveXor(data[3].u4); - - data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMul(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMul(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMul(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMul(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMin(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMin(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMin(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMin(data[3].d4); - - data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); - data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); - data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); - data[invocation].f4 = subgroupExclusiveMax(data[3].f4); - - data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveMax(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveMax(data[3].u4); - - data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); - data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); - data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); - data[invocation].d4 = subgroupExclusiveMax(data[3].d4); - - data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveOr(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveOr(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); - - data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); - data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); - data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); - data[invocation].i4 = subgroupExclusiveXor(data[3].i4); - - data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); - data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); - data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); - data[invocation].u4 = subgroupExclusiveXor(data[3].u4); - - data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); - data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); - data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); - data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); -} +#version 450 + +#extension GL_KHR_shader_subgroup_arithmetic: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + data[invocation].f4.x = subgroupAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupAdd(data[3].f4); + + data[invocation].i4.x = subgroupAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupAdd(data[3].i4); + + data[invocation].u4.x = subgroupAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupAdd(data[3].u4); + + data[invocation].d4.x = subgroupAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupAdd(data[3].d4); + + data[invocation].f4.x = subgroupMul(data[0].f4.x); + data[invocation].f4.xy = subgroupMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMul(data[2].f4.xyz); + data[invocation].f4 = subgroupMul(data[3].f4); + + data[invocation].i4.x = subgroupMul(data[0].i4.x); + data[invocation].i4.xy = subgroupMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMul(data[2].i4.xyz); + data[invocation].i4 = subgroupMul(data[3].i4); + + data[invocation].u4.x = subgroupMul(data[0].u4.x); + data[invocation].u4.xy = subgroupMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMul(data[2].u4.xyz); + data[invocation].u4 = subgroupMul(data[3].u4); + + data[invocation].d4.x = subgroupMul(data[0].d4.x); + data[invocation].d4.xy = subgroupMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMul(data[2].d4.xyz); + data[invocation].d4 = subgroupMul(data[3].d4); + + data[invocation].f4.x = subgroupMin(data[0].f4.x); + data[invocation].f4.xy = subgroupMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMin(data[2].f4.xyz); + data[invocation].f4 = subgroupMin(data[3].f4); + + data[invocation].i4.x = subgroupMin(data[0].i4.x); + data[invocation].i4.xy = subgroupMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMin(data[2].i4.xyz); + data[invocation].i4 = subgroupMin(data[3].i4); + + data[invocation].u4.x = subgroupMin(data[0].u4.x); + data[invocation].u4.xy = subgroupMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMin(data[2].u4.xyz); + data[invocation].u4 = subgroupMin(data[3].u4); + + data[invocation].d4.x = subgroupMin(data[0].d4.x); + data[invocation].d4.xy = subgroupMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMin(data[2].d4.xyz); + data[invocation].d4 = subgroupMin(data[3].d4); + + data[invocation].f4.x = subgroupMax(data[0].f4.x); + data[invocation].f4.xy = subgroupMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupMax(data[2].f4.xyz); + data[invocation].f4 = subgroupMax(data[3].f4); + + data[invocation].i4.x = subgroupMax(data[0].i4.x); + data[invocation].i4.xy = subgroupMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupMax(data[2].i4.xyz); + data[invocation].i4 = subgroupMax(data[3].i4); + + data[invocation].u4.x = subgroupMax(data[0].u4.x); + data[invocation].u4.xy = subgroupMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupMax(data[2].u4.xyz); + data[invocation].u4 = subgroupMax(data[3].u4); + + data[invocation].d4.x = subgroupMax(data[0].d4.x); + data[invocation].d4.xy = subgroupMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupMax(data[2].d4.xyz); + data[invocation].d4 = subgroupMax(data[3].d4); + + data[invocation].i4.x = subgroupAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupAnd(data[3].i4); + + data[invocation].u4.x = subgroupAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupOr(data[0].i4.x); + data[invocation].i4.xy = subgroupOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupOr(data[2].i4.xyz); + data[invocation].i4 = subgroupOr(data[3].i4); + + data[invocation].u4.x = subgroupOr(data[0].u4.x); + data[invocation].u4.xy = subgroupOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupOr(data[2].u4.xyz); + data[invocation].u4 = subgroupOr(data[3].u4); + + data[invocation].i4.x = int(subgroupOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupXor(data[0].i4.x); + data[invocation].i4.xy = subgroupXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupXor(data[2].i4.xyz); + data[invocation].i4 = subgroupXor(data[3].i4); + + data[invocation].u4.x = subgroupXor(data[0].u4.x); + data[invocation].u4.xy = subgroupXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupXor(data[2].u4.xyz); + data[invocation].u4 = subgroupXor(data[3].u4); + + data[invocation].i4.x = int(subgroupXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupInclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupInclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupInclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupInclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupInclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupInclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupInclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupInclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupInclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupInclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupInclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupInclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupInclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupInclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupInclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupInclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupInclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupInclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupInclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupInclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupInclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupInclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupInclusiveXor(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].f4.x = subgroupExclusiveAdd(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveAdd(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveAdd(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveAdd(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveAdd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAdd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAdd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAdd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAdd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAdd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAdd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAdd(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveAdd(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveAdd(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveAdd(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveAdd(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMul(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMul(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMul(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMul(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMul(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMul(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMul(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMul(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMul(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMul(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMul(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMul(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMul(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMul(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMul(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMul(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMin(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMin(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMin(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMin(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMin(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMin(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMin(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMin(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMin(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMin(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMin(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMin(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMin(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMin(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMin(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMin(data[3].d4); + + data[invocation].f4.x = subgroupExclusiveMax(data[0].f4.x); + data[invocation].f4.xy = subgroupExclusiveMax(data[1].f4.xy); + data[invocation].f4.xyz = subgroupExclusiveMax(data[2].f4.xyz); + data[invocation].f4 = subgroupExclusiveMax(data[3].f4); + + data[invocation].i4.x = subgroupExclusiveMax(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveMax(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveMax(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveMax(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveMax(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveMax(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveMax(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveMax(data[3].u4); + + data[invocation].d4.x = subgroupExclusiveMax(data[0].d4.x); + data[invocation].d4.xy = subgroupExclusiveMax(data[1].d4.xy); + data[invocation].d4.xyz = subgroupExclusiveMax(data[2].d4.xyz); + data[invocation].d4 = subgroupExclusiveMax(data[3].d4); + + data[invocation].i4.x = subgroupExclusiveAnd(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveAnd(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveAnd(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveAnd(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveAnd(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveAnd(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveAnd(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveAnd(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveAnd(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveAnd(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveAnd(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveAnd(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveOr(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveOr(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveOr(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveOr(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveOr(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveOr(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveOr(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveOr(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveOr(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveOr(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveOr(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveOr(lessThan(data[1].i4, ivec4(0)))); + + data[invocation].i4.x = subgroupExclusiveXor(data[0].i4.x); + data[invocation].i4.xy = subgroupExclusiveXor(data[1].i4.xy); + data[invocation].i4.xyz = subgroupExclusiveXor(data[2].i4.xyz); + data[invocation].i4 = subgroupExclusiveXor(data[3].i4); + + data[invocation].u4.x = subgroupExclusiveXor(data[0].u4.x); + data[invocation].u4.xy = subgroupExclusiveXor(data[1].u4.xy); + data[invocation].u4.xyz = subgroupExclusiveXor(data[2].u4.xyz); + data[invocation].u4 = subgroupExclusiveXor(data[3].u4); + + data[invocation].i4.x = int(subgroupExclusiveXor(data[0].i4.x < 0)); + data[invocation].i4.xy = ivec2(subgroupExclusiveXor(lessThan(data[1].i4.xy, ivec2(0)))); + data[invocation].i4.xyz = ivec3(subgroupExclusiveXor(lessThan(data[1].i4.xyz, ivec3(0)))); + data[invocation].i4 = ivec4(subgroupExclusiveXor(lessThan(data[1].i4, ivec4(0)))); +} diff --git a/core/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp b/core/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp index 88e247b93..604833e05 100644 --- a/core/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp +++ b/core/deps/glslang/Test/spv.vulkan100.subgroupPartitioned.comp @@ -1,420 +1,420 @@ -#version 450 - -#extension GL_NV_shader_subgroup_partitioned: enable - -layout (local_size_x = 8) in; - -layout(binding = 0) buffer Buffers -{ - vec4 f4; - ivec4 i4; - uvec4 u4; - dvec4 d4; -} data[4]; - -void main() -{ - uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; - - uvec4 ballot = subgroupPartitionNV(invocation); - - data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].f4); - - data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].i4); - - data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].u4); - - data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); - data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); - data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); - data[invocation].u4 = subgroupPartitionNV(data[0].d4); - - data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); - data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); - data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); - data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); - - data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); - - data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); - data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); - data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); - data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); - - data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); - data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); - data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); - data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); - - data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); - - data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); - data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); - data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); - data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); - - data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); - data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); - data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); - data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); - - data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); - data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); - data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); - data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); -} +#version 450 + +#extension GL_NV_shader_subgroup_partitioned: enable + +layout (local_size_x = 8) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; + dvec4 d4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubgroupInvocationID + gl_SubgroupSize) % 4; + + uvec4 ballot = subgroupPartitionNV(invocation); + + data[invocation].u4 = subgroupPartitionNV(data[0].f4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].f4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].f4); + + data[invocation].u4 = subgroupPartitionNV(data[0].i4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].i4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].i4); + + data[invocation].u4 = subgroupPartitionNV(data[0].u4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].u4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].u4); + + data[invocation].u4 = subgroupPartitionNV(data[0].d4.x); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xy); + data[invocation].u4 = subgroupPartitionNV(data[0].d4.xyz); + data[invocation].u4 = subgroupPartitionNV(data[0].d4); + + data[invocation].u4 = subgroupPartitionNV(bool(data[0].i4.x)); + data[invocation].u4 = subgroupPartitionNV(bvec2(data[0].i4.xy)); + data[invocation].u4 = subgroupPartitionNV(bvec3(data[0].i4.xyz)); + data[invocation].u4 = subgroupPartitionNV(bvec4(data[0].i4)); + + data[invocation].f4.x = subgroupPartitionedAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedInclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedInclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedInclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedInclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedInclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedInclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedInclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedInclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedInclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedInclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedInclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedInclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedInclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedInclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedInclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedInclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedInclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedInclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedInclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].f4.x = subgroupPartitionedExclusiveAddNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveAddNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveAddNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveAddNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAddNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAddNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAddNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAddNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAddNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAddNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAddNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAddNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveAddNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveAddNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveAddNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveAddNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMulNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMulNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMulNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMulNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMulNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMulNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMulNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMulNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMulNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMulNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMulNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMulNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMulNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMulNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMulNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMulNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMinNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMinNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMinNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMinNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMinNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMinNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMinNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMinNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMinNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMinNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMinNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMinNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMinNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMinNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMinNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMinNV(data[3].d4, ballot); + + data[invocation].f4.x = subgroupPartitionedExclusiveMaxNV(data[0].f4.x, ballot); + data[invocation].f4.xy = subgroupPartitionedExclusiveMaxNV(data[1].f4.xy, ballot); + data[invocation].f4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].f4.xyz, ballot); + data[invocation].f4 = subgroupPartitionedExclusiveMaxNV(data[3].f4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveMaxNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveMaxNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveMaxNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveMaxNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveMaxNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveMaxNV(data[3].u4, ballot); + + data[invocation].d4.x = subgroupPartitionedExclusiveMaxNV(data[0].d4.x, ballot); + data[invocation].d4.xy = subgroupPartitionedExclusiveMaxNV(data[1].d4.xy, ballot); + data[invocation].d4.xyz = subgroupPartitionedExclusiveMaxNV(data[2].d4.xyz, ballot); + data[invocation].d4 = subgroupPartitionedExclusiveMaxNV(data[3].d4, ballot); + + data[invocation].i4.x = subgroupPartitionedExclusiveAndNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveAndNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveAndNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveAndNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveAndNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveAndNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveAndNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveAndNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveAndNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveAndNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveOrNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveOrNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveOrNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveOrNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveOrNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveOrNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveOrNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveOrNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveOrNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveOrNV(lessThan(data[1].i4, ivec4(0)), ballot)); + + data[invocation].i4.x = subgroupPartitionedExclusiveXorNV(data[0].i4.x, ballot); + data[invocation].i4.xy = subgroupPartitionedExclusiveXorNV(data[1].i4.xy, ballot); + data[invocation].i4.xyz = subgroupPartitionedExclusiveXorNV(data[2].i4.xyz, ballot); + data[invocation].i4 = subgroupPartitionedExclusiveXorNV(data[3].i4, ballot); + + data[invocation].u4.x = subgroupPartitionedExclusiveXorNV(data[0].u4.x, ballot); + data[invocation].u4.xy = subgroupPartitionedExclusiveXorNV(data[1].u4.xy, ballot); + data[invocation].u4.xyz = subgroupPartitionedExclusiveXorNV(data[2].u4.xyz, ballot); + data[invocation].u4 = subgroupPartitionedExclusiveXorNV(data[3].u4, ballot); + + data[invocation].i4.x = int(subgroupPartitionedExclusiveXorNV(data[0].i4.x < 0, ballot)); + data[invocation].i4.xy = ivec2(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xy, ivec2(0)), ballot)); + data[invocation].i4.xyz = ivec3(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4.xyz, ivec3(0)), ballot)); + data[invocation].i4 = ivec4(subgroupPartitionedExclusiveXorNV(lessThan(data[1].i4, ivec4(0)), ballot)); +} diff --git a/core/deps/glslang/Test/spv.vulkan110.storageBuffer.vert b/core/deps/glslang/Test/spv.vulkan110.storageBuffer.vert index 0a85b800d..6dd629e81 100644 --- a/core/deps/glslang/Test/spv.vulkan110.storageBuffer.vert +++ b/core/deps/glslang/Test/spv.vulkan110.storageBuffer.vert @@ -1,16 +1,16 @@ -#version 450 - -#pragma use_storage_buffer - -uniform ub { - vec4 a; -} ubi; - -buffer bb { - vec4 b; -} bbi; - -void main() -{ - gl_Position = ubi.a + bbi.b; -} +#version 450 + +#pragma use_storage_buffer + +uniform ub { + vec4 a; +} ubi; + +buffer bb { + vec4 b; +} bbi; + +void main() +{ + gl_Position = ubi.a + bbi.b; +} diff --git a/core/deps/glslang/Test/spv.whileLoop.frag b/core/deps/glslang/Test/spv.whileLoop.frag index 062bff2c5..f7b7141ea 100644 --- a/core/deps/glslang/Test/spv.whileLoop.frag +++ b/core/deps/glslang/Test/spv.whileLoop.frag @@ -1,16 +1,16 @@ -#version 140 - -in vec4 bigColor; -in vec4 BaseColor; -in float d; - -void main() -{ - vec4 color = BaseColor; - - while (color.x < d) { - color += bigColor; - } - - gl_FragColor = color; -} +#version 140 + +in vec4 bigColor; +in vec4 BaseColor; +in float d; + +void main() +{ + vec4 color = BaseColor; + + while (color.x < d) { + color += bigColor; + } + + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/spv.xfb.vert b/core/deps/glslang/Test/spv.xfb.vert index 955e62708..ad762bc21 100644 --- a/core/deps/glslang/Test/spv.xfb.vert +++ b/core/deps/glslang/Test/spv.xfb.vert @@ -1,20 +1,20 @@ -#version 450 - -layout(xfb_buffer = 3) out; -layout(xfb_stride = 48) out; -layout(xfb_offset = 12, location = 0) out float out1; - -layout(xfb_buffer = 2) out; -layout(location=1) out outXfb { - layout(xfb_buffer = 2, xfb_stride = 32, xfb_offset = 8) float out2; -}; - -layout(xfb_buffer = 1, location=3) out outXfb2 { - layout(xfb_stride = 64, xfb_offset = 60) float out3; -}; - -layout(location = 4, xfb_buffer = 0, xfb_offset = 4) out float out4; - -void main() -{ +#version 450 + +layout(xfb_buffer = 3) out; +layout(xfb_stride = 48) out; +layout(xfb_offset = 12, location = 0) out float out1; + +layout(xfb_buffer = 2) out; +layout(location=1) out outXfb { + layout(xfb_buffer = 2, xfb_stride = 32, xfb_offset = 8) float out2; +}; + +layout(xfb_buffer = 1, location=3) out outXfb2 { + layout(xfb_stride = 64, xfb_offset = 60) float out3; +}; + +layout(location = 4, xfb_buffer = 0, xfb_offset = 4) out float out4; + +void main() +{ } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.xfb2.vert b/core/deps/glslang/Test/spv.xfb2.vert index d2abf9b76..895666d9f 100644 --- a/core/deps/glslang/Test/spv.xfb2.vert +++ b/core/deps/glslang/Test/spv.xfb2.vert @@ -1,18 +1,18 @@ -#version 450 - -layout (location = 0) in vec4 position; -layout (binding = 5) uniform ComponentsBlock -{ - vec4 c1; - vec2 c2; -} components; - -layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex -{ - vec4 gl_Position; -}; - -void main() -{ - gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); +#version 450 + +layout (location = 0) in vec4 position; +layout (binding = 5) uniform ComponentsBlock +{ + vec4 c1; + vec2 c2; +} components; + +layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex +{ + vec4 gl_Position; +}; + +void main() +{ + gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); } \ No newline at end of file diff --git a/core/deps/glslang/Test/spv.xfb3.vert b/core/deps/glslang/Test/spv.xfb3.vert index d7b727b2a..2eae7c9eb 100644 --- a/core/deps/glslang/Test/spv.xfb3.vert +++ b/core/deps/glslang/Test/spv.xfb3.vert @@ -1,18 +1,18 @@ -#version 450 - -layout (location = 0) in vec4 position; -layout (binding = 5) uniform ComponentsBlock -{ - vec4 c1; - vec2 c2; -} components; - -layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex -{ - layout(xfb_stride = 80) vec4 gl_Position; -}; - -void main() -{ - gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); +#version 450 + +layout (location = 0) in vec4 position; +layout (binding = 5) uniform ComponentsBlock +{ + vec4 c1; + vec2 c2; +} components; + +layout (xfb_buffer = 3, xfb_offset = 16) out gl_PerVertex +{ + layout(xfb_stride = 80) vec4 gl_Position; +}; + +void main() +{ + gl_Position = position + components.c1 + vec4(components.c2, 0.0, 0.0); } \ No newline at end of file diff --git a/core/deps/glslang/Test/structAssignment.frag b/core/deps/glslang/Test/structAssignment.frag index 1f6466683..959f854ed 100644 --- a/core/deps/glslang/Test/structAssignment.frag +++ b/core/deps/glslang/Test/structAssignment.frag @@ -1,39 +1,39 @@ -#version 130 - -uniform sampler2D sampler; -varying mediump vec2 coord; - -struct lunarStruct1 { - int i; - float f; -}; - -struct lunarStruct2 { - int i; - float f; - lunarStruct1 s1_1; -}; - -struct lunarStruct3 { - lunarStruct2 s2_1; - int i; - float f; - lunarStruct1 s1_1; -}; - - -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2; -uniform lunarStruct3 foo3; - -void main() -{ - lunarStruct2 locals2; - - if (foo3.s2_1.i > 0) - locals2 = foo3.s2_1; - else - locals2 = foo2; - - gl_FragColor = locals2.s1_1.f * texture2D(sampler, coord); -} +#version 130 + +uniform sampler2D sampler; +varying mediump vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1; + int i; + float f; + lunarStruct1 s1_1; +}; + + +uniform lunarStruct1 foo; +uniform lunarStruct2 foo2; +uniform lunarStruct3 foo3; + +void main() +{ + lunarStruct2 locals2; + + if (foo3.s2_1.i > 0) + locals2 = foo3.s2_1; + else + locals2 = foo2; + + gl_FragColor = locals2.s1_1.f * texture2D(sampler, coord); +} diff --git a/core/deps/glslang/Test/structDeref.frag b/core/deps/glslang/Test/structDeref.frag index 97fd383b6..376e408f1 100644 --- a/core/deps/glslang/Test/structDeref.frag +++ b/core/deps/glslang/Test/structDeref.frag @@ -1,71 +1,71 @@ -#version 130 - -uniform sampler2D sampler; -varying vec2 coord; - -struct s0 { - int i; -}; - -struct s00 { - s0 s0_0; -}; - -struct s1 { - int i; - float f; - s0 s0_1; -}; - -struct s2 { - int i; - float f; - s1 s1_1; -}; - -struct s3 { - s2[12] s2_1; - int i; - float f; - s1 s1_1; -}; - - -uniform s0 foo0; -uniform s1 foo1; -uniform s2 foo2; -uniform s3 foo3; - -uniform s00 foo00; - -void main() -{ - s0 locals0; - s2 locals2; - s00 locals00; - - float[6] fArray; - - s1[10] locals1Array; - - if (foo3.s2_1[9].i > 0) { - locals2.f = 1.0; - locals2.s1_1 = s1(0, 1.0, s0(0)); - fArray = float[6]( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - locals1Array[6] = foo1; - locals0 = s0(0); - locals00 = s00(s0(0)); - } else { - locals2.f = coord.x; - locals2.s1_1 = s1(1, coord.y, foo0); - fArray = float[6]( 0.0, 1.0, 2.0, 3.0, 4.0, 5.0); - locals1Array[6] = locals2.s1_1; - locals0 = foo1.s0_1; - locals00 = foo00; - } - - if (locals0.i > 5) - locals0 = locals00.s0_0; - - gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture2D(sampler, coord); -} +#version 130 + +uniform sampler2D sampler; +varying vec2 coord; + +struct s0 { + int i; +}; + +struct s00 { + s0 s0_0; +}; + +struct s1 { + int i; + float f; + s0 s0_1; +}; + +struct s2 { + int i; + float f; + s1 s1_1; +}; + +struct s3 { + s2[12] s2_1; + int i; + float f; + s1 s1_1; +}; + + +uniform s0 foo0; +uniform s1 foo1; +uniform s2 foo2; +uniform s3 foo3; + +uniform s00 foo00; + +void main() +{ + s0 locals0; + s2 locals2; + s00 locals00; + + float[6] fArray; + + s1[10] locals1Array; + + if (foo3.s2_1[9].i > 0) { + locals2.f = 1.0; + locals2.s1_1 = s1(0, 1.0, s0(0)); + fArray = float[6]( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + locals1Array[6] = foo1; + locals0 = s0(0); + locals00 = s00(s0(0)); + } else { + locals2.f = coord.x; + locals2.s1_1 = s1(1, coord.y, foo0); + fArray = float[6]( 0.0, 1.0, 2.0, 3.0, 4.0, 5.0); + locals1Array[6] = locals2.s1_1; + locals0 = foo1.s0_1; + locals00 = foo00; + } + + if (locals0.i > 5) + locals0 = locals00.s0_0; + + gl_FragColor = (float(locals0.i) + locals1Array[6].f + fArray[3] + locals2.s1_1.f) * texture2D(sampler, coord); +} diff --git a/core/deps/glslang/Test/structure.frag b/core/deps/glslang/Test/structure.frag index 867a0273d..97e79cb01 100644 --- a/core/deps/glslang/Test/structure.frag +++ b/core/deps/glslang/Test/structure.frag @@ -1,31 +1,31 @@ -#version 130 -uniform sampler2D sampler; -varying vec2 coord; - -struct lunarStruct1 { - int i; - float f[4]; - vec4 color[5]; -}; - -struct lunarStruct2 { - int i[5]; - float f; - lunarStruct1 s1_1[7]; -}; - -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2[5]; - -void main() -{ - float scale = 0.0; - - if (foo2[3].i[4] > 0) - scale = foo2[3].s1_1[2].color[3].x; - else - scale = foo2[3].s1_1[2].f[3]; - - gl_FragColor = scale * texture2D(sampler, coord); -} - +#version 130 +uniform sampler2D sampler; +varying vec2 coord; + +struct lunarStruct1 { + int i; + float f[4]; + vec4 color[5]; +}; + +struct lunarStruct2 { + int i[5]; + float f; + lunarStruct1 s1_1[7]; +}; + +uniform lunarStruct1 foo; +uniform lunarStruct2 foo2[5]; + +void main() +{ + float scale = 0.0; + + if (foo2[3].i[4] > 0) + scale = foo2[3].s1_1[2].color[3].x; + else + scale = foo2[3].s1_1[2].f[3]; + + gl_FragColor = scale * texture2D(sampler, coord); +} + diff --git a/core/deps/glslang/Test/swizzle.frag b/core/deps/glslang/Test/swizzle.frag index e336b67eb..14f507ecd 100644 --- a/core/deps/glslang/Test/swizzle.frag +++ b/core/deps/glslang/Test/swizzle.frag @@ -1,52 +1,52 @@ -#version 110 - -uniform float blend; -uniform vec4 u; -uniform bool p; - -varying vec2 t; - -void main() -{ - float blendscale = 1.789; - - vec4 w = u; - vec4 w_undef; // test undef - vec4 w_dep = u; // test dependent swizzles - vec4 w_reorder = u; // test reordering - vec4 w2 = u; - vec4 w_flow = u; // test flowControl - - w_reorder.z = blendscale; - - w.wy = t; - - w_reorder.x = blendscale; - - w2.xyzw = u.zwxy; - - w_reorder.y = blendscale; - - w_dep.xy = w2.xz; - w_dep.zw = t; - - w_undef.xy = u.zw; - - if (p) - w_flow.x = t.x; - else - w_flow.x = t.y; - - gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow); - - vec2 c = t; - vec4 rep = vec4(0.0, 0.0, 0.0, 1.0); - - if (c.x < 0.0) - c.x *= -1.0; - - if (c.x <= 1.0) - rep.x = 3.4; - - gl_FragColor += rep; -} +#version 110 + +uniform float blend; +uniform vec4 u; +uniform bool p; + +varying vec2 t; + +void main() +{ + float blendscale = 1.789; + + vec4 w = u; + vec4 w_undef; // test undef + vec4 w_dep = u; // test dependent swizzles + vec4 w_reorder = u; // test reordering + vec4 w2 = u; + vec4 w_flow = u; // test flowControl + + w_reorder.z = blendscale; + + w.wy = t; + + w_reorder.x = blendscale; + + w2.xyzw = u.zwxy; + + w_reorder.y = blendscale; + + w_dep.xy = w2.xz; + w_dep.zw = t; + + w_undef.xy = u.zw; + + if (p) + w_flow.x = t.x; + else + w_flow.x = t.y; + + gl_FragColor = mix(w_reorder, w_undef, w * w2 * w_dep * w_flow); + + vec2 c = t; + vec4 rep = vec4(0.0, 0.0, 0.0, 1.0); + + if (c.x < 0.0) + c.x *= -1.0; + + if (c.x <= 1.0) + rep.x = 3.4; + + gl_FragColor += rep; +} diff --git a/core/deps/glslang/Test/syntaxError.frag b/core/deps/glslang/Test/syntaxError.frag index ac46bf10f..fcbeb69e1 100644 --- a/core/deps/glslang/Test/syntaxError.frag +++ b/core/deps/glslang/Test/syntaxError.frag @@ -1,16 +1,16 @@ -#version 120 - -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; - -void main() -{ - vec5 color = BaseColor; - - do { - color += bigColor; - } while (color.x < d); - - gl_FragColor = color; -} +#version 120 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void main() +{ + vec5 color = BaseColor; + + do { + color += bigColor; + } while (color.x < d); + + gl_FragColor = color; +} diff --git a/core/deps/glslang/Test/test.frag b/core/deps/glslang/Test/test.frag index ac9446e15..1b7d0e95e 100644 --- a/core/deps/glslang/Test/test.frag +++ b/core/deps/glslang/Test/test.frag @@ -1,22 +1,22 @@ -#version 110 - -uniform sampler2D texSampler2D; -uniform sampler3D texSampler3D; - -uniform float blend; -uniform vec2 scale; -uniform vec4 u; - -varying vec2 t; -varying vec3 coords; - -void main() -{ - float blendscale = 1.789; - - vec4 v = texture2D(texSampler2D, (t + scale) / scale ).wzyx; - - vec4 w = texture3D(texSampler3D, coords) + v; - - gl_FragColor = mix(w, u, blend * blendscale); -} +#version 110 + +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; + +uniform float blend; +uniform vec2 scale; +uniform vec4 u; + +varying vec2 t; +varying vec3 coords; + +void main() +{ + float blendscale = 1.789; + + vec4 v = texture2D(texSampler2D, (t + scale) / scale ).wzyx; + + vec4 w = texture3D(texSampler3D, coords) + v; + + gl_FragColor = mix(w, u, blend * blendscale); +} diff --git a/core/deps/glslang/Test/texture.frag b/core/deps/glslang/Test/texture.frag index 67c48a440..8e5391eef 100644 --- a/core/deps/glslang/Test/texture.frag +++ b/core/deps/glslang/Test/texture.frag @@ -1,73 +1,73 @@ -#version 130 - -uniform sampler1D texSampler1D; -uniform sampler2D texSampler2D; -uniform sampler3D texSampler3D; -uniform samplerCube texSamplerCube; -uniform sampler1DShadow shadowSampler1D; -uniform sampler2DShadow shadowSampler2D; - -uniform float blend; -uniform vec2 scale; -uniform vec4 u; - -varying vec2 t; -varying vec2 coords2D; - -void main() -{ - float blendscale = 1.789; - float bias = 2.0; - float lod = 3.0; - float proj = 2.0; - float coords1D = 1.789; - vec3 coords3D = vec3(1.789, 2.718, 3.453); - vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); - vec4 color = vec4(0.0, 0.0, 0.0, 0.0); - - color += texture1D (texSampler1D, coords1D); - color += texture1D (texSampler1D, coords1D, bias); - color += texture1DProj(texSampler1D, coords2D); - color += texture1DProj(texSampler1D, coords4D); - color += texture1DProj(texSampler1D, coords2D, bias); - color += texture1DProj(texSampler1D, coords4D, bias); - - color += texture2D (texSampler2D, coords2D); - color += texture2D (texSampler2D, coords2D, bias); - color += texture2DProj (texSampler2D, coords3D); - color += texture2DProj (texSampler2D, coords4D, bias); - - color += texture3D (texSampler3D, coords3D); - color += texture3D (texSampler3D, coords3D, bias); - color += texture3DProj (texSampler3D, coords4D); - color += texture3DProj (texSampler3D, coords4D, bias); - - color += textureCube (texSamplerCube, coords3D); - color += textureCube (texSamplerCube, coords3D, bias); - - color += shadow1D (shadowSampler1D, coords3D); - color += shadow1D (shadowSampler1D, coords3D, bias); - color += shadow2D (shadowSampler2D, coords3D); - color += shadow2D (shadowSampler2D, coords3D, bias); - color += shadow1DProj (shadowSampler1D, coords4D); - color += shadow1DProj (shadowSampler1D, coords4D, bias); - color += shadow2DProj (shadowSampler2D, coords4D); - color += shadow2DProj (shadowSampler2D, coords4D, bias); - - ivec2 iCoords2D = ivec2(0, 5); - int iLod = 1; - - color += texelFetch(texSampler2D, iCoords2D, iLod); - - vec2 gradX = dFdx(coords2D); - vec2 gradY = dFdy(coords2D); - const ivec2 offset = ivec2(3, -7); - - color += textureGrad(texSampler2D, coords2D, gradX, gradY); - color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY); - color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset); - color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset); - color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY); - - gl_FragColor = mix(color, u, blend * blendscale); +#version 130 + +uniform sampler1D texSampler1D; +uniform sampler2D texSampler2D; +uniform sampler3D texSampler3D; +uniform samplerCube texSamplerCube; +uniform sampler1DShadow shadowSampler1D; +uniform sampler2DShadow shadowSampler2D; + +uniform float blend; +uniform vec2 scale; +uniform vec4 u; + +varying vec2 t; +varying vec2 coords2D; + +void main() +{ + float blendscale = 1.789; + float bias = 2.0; + float lod = 3.0; + float proj = 2.0; + float coords1D = 1.789; + vec3 coords3D = vec3(1.789, 2.718, 3.453); + vec4 coords4D = vec4(1.789, 2.718, 3.453, 2.0); + vec4 color = vec4(0.0, 0.0, 0.0, 0.0); + + color += texture1D (texSampler1D, coords1D); + color += texture1D (texSampler1D, coords1D, bias); + color += texture1DProj(texSampler1D, coords2D); + color += texture1DProj(texSampler1D, coords4D); + color += texture1DProj(texSampler1D, coords2D, bias); + color += texture1DProj(texSampler1D, coords4D, bias); + + color += texture2D (texSampler2D, coords2D); + color += texture2D (texSampler2D, coords2D, bias); + color += texture2DProj (texSampler2D, coords3D); + color += texture2DProj (texSampler2D, coords4D, bias); + + color += texture3D (texSampler3D, coords3D); + color += texture3D (texSampler3D, coords3D, bias); + color += texture3DProj (texSampler3D, coords4D); + color += texture3DProj (texSampler3D, coords4D, bias); + + color += textureCube (texSamplerCube, coords3D); + color += textureCube (texSamplerCube, coords3D, bias); + + color += shadow1D (shadowSampler1D, coords3D); + color += shadow1D (shadowSampler1D, coords3D, bias); + color += shadow2D (shadowSampler2D, coords3D); + color += shadow2D (shadowSampler2D, coords3D, bias); + color += shadow1DProj (shadowSampler1D, coords4D); + color += shadow1DProj (shadowSampler1D, coords4D, bias); + color += shadow2DProj (shadowSampler2D, coords4D); + color += shadow2DProj (shadowSampler2D, coords4D, bias); + + ivec2 iCoords2D = ivec2(0, 5); + int iLod = 1; + + color += texelFetch(texSampler2D, iCoords2D, iLod); + + vec2 gradX = dFdx(coords2D); + vec2 gradY = dFdy(coords2D); + const ivec2 offset = ivec2(3, -7); + + color += textureGrad(texSampler2D, coords2D, gradX, gradY); + color += textureProjGrad(texSampler2D, vec3(coords2D, proj), gradX, gradY); + color += textureGradOffset(texSampler2D, coords2D, gradX, gradY, offset); + color += textureProjGradOffset(texSampler2D, coords3D, gradX, gradY, offset); + color += textureGrad(shadowSampler2D, vec3(coords2D, lod), gradX, gradY); + + gl_FragColor = mix(color, u, blend * blendscale); } \ No newline at end of file diff --git a/core/deps/glslang/Test/tokenPaste.vert b/core/deps/glslang/Test/tokenPaste.vert index 36cab74c9..40de6f921 100644 --- a/core/deps/glslang/Test/tokenPaste.vert +++ b/core/deps/glslang/Test/tokenPaste.vert @@ -52,35 +52,35 @@ float simplePaste(ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF01234567 int a = simplePaste(11,12); // operators -#define MAKE_OP(L, R) L ## R -const int aop = 10; -const int bop = 4; -int cop = aop MAKE_OP(<, <) bop; -bool dop = aop MAKE_OP(!,=) bop; - -#define MAKE_OP3(L, M, R) L ## M ## R - -void foo() -{ - int e = 16; - e MAKE_OP3(>,>,=) 2; - - // recovery from bad op - bool f = e MAKE_OP(>,!) 5; +#define MAKE_OP(L, R) L ## R +const int aop = 10; +const int bop = 4; +int cop = aop MAKE_OP(<, <) bop; +bool dop = aop MAKE_OP(!,=) bop; + +#define MAKE_OP3(L, M, R) L ## M ## R + +void foo() +{ + int e = 16; + e MAKE_OP3(>,>,=) 2; + + // recovery from bad op + bool f = e MAKE_OP(>,!) 5; } // arguments: should make 'uniform int argPaste2;' -#define M_NEST(q) int q -#define M_OUTER(p) M_NEST(p##2) -uniform M_OUTER(argPaste); -// should make 'uniform int argPaste20suff;' -#define M_NEST2(q) int q ## suff -#define M_OUTER2(p) M_NEST2(p ## 20) -uniform M_OUTER2(argPaste); - -#define rec(x)## -rec(rec()) - -#define bax(bay) -#define baz bax(/##) -baz +#define M_NEST(q) int q +#define M_OUTER(p) M_NEST(p##2) +uniform M_OUTER(argPaste); +// should make 'uniform int argPaste20suff;' +#define M_NEST2(q) int q ## suff +#define M_OUTER2(p) M_NEST2(p ## 20) +uniform M_OUTER2(argPaste); + +#define rec(x)## +rec(rec()) + +#define bax(bay) +#define baz bax(/##) +baz diff --git a/core/deps/glslang/Test/types.frag b/core/deps/glslang/Test/types.frag index ee6d9d05e..48701d890 100644 --- a/core/deps/glslang/Test/types.frag +++ b/core/deps/glslang/Test/types.frag @@ -1,81 +1,81 @@ -#version 130 - -uniform bool u_b; -uniform bvec2 u_b2; -uniform bvec3 u_b3; -uniform bvec4 u_b4; - -uniform int u_i; -uniform ivec2 u_i2; -uniform ivec3 u_i3; -uniform ivec4 u_i4; - -uniform float u_f; -uniform vec2 u_f2; -uniform vec3 u_f3; -uniform vec4 u_f4; - -uniform bool i_b; -uniform bvec2 i_b2; -uniform bvec3 i_b3; -uniform bvec4 i_b4; - -flat in int i_i; -flat in ivec2 i_i2; -flat in ivec3 i_i3; -flat in ivec4 i_i4; - -in float i_f; -in vec2 i_f2; -in vec3 i_f3; -in vec4 i_f4; - -void main() -{ - bool b = u_b && i_b; - bvec2 b2 = bvec2(u_b2.x && i_b2.x && u_b2.y && i_b2.y); - bvec3 b3 = bvec3(u_b3.x && i_b3.x && u_b3.y && i_b3.y && u_b3.z && i_b3.z); - bvec4 b4 = bvec4(u_b4.x && i_b4.x && u_b4.y && i_b4.y && u_b4.z && i_b4.z && u_b4.w && i_b4.w); - - int i = u_i + i_i; - ivec2 i2 = u_i2 + i_i2; - ivec3 i3 = u_i3 + i_i3; - ivec4 i4 = u_i4 + i_i4; - - float f = u_f + i_f; - vec2 f2 = u_f2 + i_f2; - vec3 f3 = u_f3 + i_f3; - vec4 f4 = u_f4 + i_f4; - - gl_FragColor = - b || - b2.x || - b2.y || - b3.x || - b3.y || - b3.z || - b4.x || - b4.y || - b4.z || - b4.w ? vec4( - i + - i2.x + - i2.y + - i3.x + - i3.y + - i3.z + - i4.x + - i4.y + - i4.z + - i4.w + - f + - f2.x + - f2.y + - f3.x + - f3.y + - f3.z + - f4.x + - f4.y + - f4.z + - f4.w) : vec4(1.0); -} +#version 130 + +uniform bool u_b; +uniform bvec2 u_b2; +uniform bvec3 u_b3; +uniform bvec4 u_b4; + +uniform int u_i; +uniform ivec2 u_i2; +uniform ivec3 u_i3; +uniform ivec4 u_i4; + +uniform float u_f; +uniform vec2 u_f2; +uniform vec3 u_f3; +uniform vec4 u_f4; + +uniform bool i_b; +uniform bvec2 i_b2; +uniform bvec3 i_b3; +uniform bvec4 i_b4; + +flat in int i_i; +flat in ivec2 i_i2; +flat in ivec3 i_i3; +flat in ivec4 i_i4; + +in float i_f; +in vec2 i_f2; +in vec3 i_f3; +in vec4 i_f4; + +void main() +{ + bool b = u_b && i_b; + bvec2 b2 = bvec2(u_b2.x && i_b2.x && u_b2.y && i_b2.y); + bvec3 b3 = bvec3(u_b3.x && i_b3.x && u_b3.y && i_b3.y && u_b3.z && i_b3.z); + bvec4 b4 = bvec4(u_b4.x && i_b4.x && u_b4.y && i_b4.y && u_b4.z && i_b4.z && u_b4.w && i_b4.w); + + int i = u_i + i_i; + ivec2 i2 = u_i2 + i_i2; + ivec3 i3 = u_i3 + i_i3; + ivec4 i4 = u_i4 + i_i4; + + float f = u_f + i_f; + vec2 f2 = u_f2 + i_f2; + vec3 f3 = u_f3 + i_f3; + vec4 f4 = u_f4 + i_f4; + + gl_FragColor = + b || + b2.x || + b2.y || + b3.x || + b3.y || + b3.z || + b4.x || + b4.y || + b4.z || + b4.w ? vec4( + i + + i2.x + + i2.y + + i3.x + + i3.y + + i3.z + + i4.x + + i4.y + + i4.z + + i4.w + + f + + f2.x + + f2.y + + f3.x + + f3.y + + f3.z + + f4.x + + f4.y + + f4.z + + f4.w) : vec4(1.0); +} diff --git a/core/deps/glslang/Test/uniformArray.frag b/core/deps/glslang/Test/uniformArray.frag index 358b54f66..7db287642 100644 --- a/core/deps/glslang/Test/uniformArray.frag +++ b/core/deps/glslang/Test/uniformArray.frag @@ -1,16 +1,16 @@ -#version 130 -uniform sampler2D texSampler2D; -uniform vec3 inColor; -uniform vec4 color[6]; -uniform float alpha[16]; - -void main() -{ - vec4 texColor = color[1] + color[1]; - - texColor.xyz += inColor; - - texColor.a += alpha[12]; - - gl_FragColor = texColor; -} +#version 130 +uniform sampler2D texSampler2D; +uniform vec3 inColor; +uniform vec4 color[6]; +uniform float alpha[16]; + +void main() +{ + vec4 texColor = color[1] + color[1]; + + texColor.xyz += inColor; + + texColor.a += alpha[12]; + + gl_FragColor = texColor; +} diff --git a/core/deps/glslang/Test/variableArrayIndex.frag b/core/deps/glslang/Test/variableArrayIndex.frag index 18c7e7b7e..63b49c784 100644 --- a/core/deps/glslang/Test/variableArrayIndex.frag +++ b/core/deps/glslang/Test/variableArrayIndex.frag @@ -1,48 +1,48 @@ -#version 130 -uniform sampler2D sampler; -varying vec2 coord; - -struct lunarStruct1 { - int i; - float f; -}; - -struct lunarStruct2 { - int i; - float f; - lunarStruct1 s1_1; -}; - -struct lunarStruct3 { - lunarStruct2 s2_1[3]; - int i; - float f; - lunarStruct1 s1_1; -}; - - -uniform lunarStruct1 foo; -uniform lunarStruct2 foo2[5]; -uniform lunarStruct3 foo3; -uniform int Count; - -void main() -{ - float scale; - int iLocal = Count; - - if (foo3.s2_1[1].i > 0) - scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f; - else - scale = foo3.s2_1[0].s1_1.f; - - //for (int i = 0; i < iLocal; ++i) { - // scale += foo2[i].f; - //} - - gl_FragColor = scale * texture2D(sampler, coord); - - vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); - gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); -} - +#version 130 +uniform sampler2D sampler; +varying vec2 coord; + +struct lunarStruct1 { + int i; + float f; +}; + +struct lunarStruct2 { + int i; + float f; + lunarStruct1 s1_1; +}; + +struct lunarStruct3 { + lunarStruct2 s2_1[3]; + int i; + float f; + lunarStruct1 s1_1; +}; + + +uniform lunarStruct1 foo; +uniform lunarStruct2 foo2[5]; +uniform lunarStruct3 foo3; +uniform int Count; + +void main() +{ + float scale; + int iLocal = Count; + + if (foo3.s2_1[1].i > 0) + scale = foo2[foo3.s2_1[foo.i].i + 2 + ++iLocal].s1_1.f; + else + scale = foo3.s2_1[0].s1_1.f; + + //for (int i = 0; i < iLocal; ++i) { + // scale += foo2[i].f; + //} + + gl_FragColor = scale * texture2D(sampler, coord); + + vec2[3] constructed = vec2[3](coord, vec2(scale), vec2(1.0, 2.0)); + gl_FragColor += vec4(constructed[foo.i], constructed[foo.i]); +} + diff --git a/core/deps/glslang/Test/varyingArray.frag b/core/deps/glslang/Test/varyingArray.frag index 1364cd60d..3bd152fe9 100644 --- a/core/deps/glslang/Test/varyingArray.frag +++ b/core/deps/glslang/Test/varyingArray.frag @@ -1,19 +1,19 @@ -#version 130 -uniform sampler2D texSampler2D; -varying vec4 color; -varying float alpha; - -varying vec4 gl_TexCoord[6]; - -varying vec4 foo[3]; - -void main() -{ - vec4 texColor = texture2D(texSampler2D, vec2(gl_TexCoord[4] + gl_TexCoord[5])); - - texColor += color; - - texColor.a = alpha; - - gl_FragColor = foo[1] + gl_TexCoord[0] + gl_TexCoord[4] + texColor; -} +#version 130 +uniform sampler2D texSampler2D; +varying vec4 color; +varying float alpha; + +varying vec4 gl_TexCoord[6]; + +varying vec4 foo[3]; + +void main() +{ + vec4 texColor = texture2D(texSampler2D, vec2(gl_TexCoord[4] + gl_TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = foo[1] + gl_TexCoord[0] + gl_TexCoord[4] + texColor; +} diff --git a/core/deps/glslang/Test/varyingArrayIndirect.frag b/core/deps/glslang/Test/varyingArrayIndirect.frag index 7463cdce7..d45e601b4 100644 --- a/core/deps/glslang/Test/varyingArrayIndirect.frag +++ b/core/deps/glslang/Test/varyingArrayIndirect.frag @@ -1,21 +1,21 @@ -#version 130 -uniform sampler2D texSampler2D; -varying vec4 color; -varying float alpha; - -varying vec4 gl_TexCoord[6]; - -varying vec4 userIn[2]; - -uniform int a, b; - -void main() -{ - vec4 texColor = texture2D(texSampler2D, vec2(userIn[b] + gl_TexCoord[a] + gl_TexCoord[5])); - - texColor += color; - - texColor.a = alpha; - - gl_FragColor = gl_TexCoord[0] + gl_TexCoord[b] + texColor + userIn[a]; -} +#version 130 +uniform sampler2D texSampler2D; +varying vec4 color; +varying float alpha; + +varying vec4 gl_TexCoord[6]; + +varying vec4 userIn[2]; + +uniform int a, b; + +void main() +{ + vec4 texColor = texture2D(texSampler2D, vec2(userIn[b] + gl_TexCoord[a] + gl_TexCoord[5])); + + texColor += color; + + texColor.a = alpha; + + gl_FragColor = gl_TexCoord[0] + gl_TexCoord[b] + texColor + userIn[a]; +} diff --git a/core/deps/glslang/Test/versionsClean.frag b/core/deps/glslang/Test/versionsClean.frag index 0790addbf..6e19bf887 100644 --- a/core/deps/glslang/Test/versionsClean.frag +++ b/core/deps/glslang/Test/versionsClean.frag @@ -1,45 +1,45 @@ -// -//Copyright (C) 2012 LunarG, 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 LunarG 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. -// -#version 300 es - -in highp vec3 color; -out highp vec4 foo; - -uniform highp sampler2DArrayShadow bar; - -void main() -{ - foo = vec4(color, 142.0f); - discard; -} +// +//Copyright (C) 2012 LunarG, 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 LunarG 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. +// +#version 300 es + +in highp vec3 color; +out highp vec4 foo; + +uniform highp sampler2DArrayShadow bar; + +void main() +{ + foo = vec4(color, 142.0f); + discard; +} diff --git a/core/deps/glslang/Test/versionsClean.vert b/core/deps/glslang/Test/versionsClean.vert index 4d3479ccb..7c197857a 100644 --- a/core/deps/glslang/Test/versionsClean.vert +++ b/core/deps/glslang/Test/versionsClean.vert @@ -1,43 +1,43 @@ -// -//Copyright (C) 2012 LunarG, 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 LunarG 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. -// -#version 420 compatibility - -attribute vec3 color; - -uniform sampler2DRect foo; - -void main() -{ - gl_Position = vec4(color, 142.0f); -} +// +//Copyright (C) 2012 LunarG, 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 LunarG 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. +// +#version 420 compatibility + +attribute vec3 color; + +uniform sampler2DRect foo; + +void main() +{ + gl_Position = vec4(color, 142.0f); +} diff --git a/core/deps/glslang/Test/versionsErrors.frag b/core/deps/glslang/Test/versionsErrors.frag index ad451e527..021c7356b 100644 --- a/core/deps/glslang/Test/versionsErrors.frag +++ b/core/deps/glslang/Test/versionsErrors.frag @@ -1,46 +1,46 @@ -// -//Copyright (C) 2012 LunarG, 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 LunarG 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. -// -#version 110 es - -#extension GL_ARB_texture_rectangle : disable - -attribute vec3 color; - -uniform sampler2DRect foo; - -void main() -{ - gl_FragColor = vec4(color, 142.0f); - discard; -} +// +//Copyright (C) 2012 LunarG, 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 LunarG 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. +// +#version 110 es + +#extension GL_ARB_texture_rectangle : disable + +attribute vec3 color; + +uniform sampler2DRect foo; + +void main() +{ + gl_FragColor = vec4(color, 142.0f); + discard; +} diff --git a/core/deps/glslang/Test/versionsErrors.vert b/core/deps/glslang/Test/versionsErrors.vert index 0b5b011df..8736f2e79 100644 --- a/core/deps/glslang/Test/versionsErrors.vert +++ b/core/deps/glslang/Test/versionsErrors.vert @@ -1,46 +1,46 @@ -// -//Copyright (C) 2012 LunarG, 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 LunarG 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. -// -#version 420 core - -#extension GL_ARB_texture_rectangle : enable - -attribute vec3 color; - -uniform sampler2DRect foo; - -void main() -{ - gl_Position = vec4(color, 142.0f); - discard; -} +// +//Copyright (C) 2012 LunarG, 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 LunarG 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. +// +#version 420 core + +#extension GL_ARB_texture_rectangle : enable + +attribute vec3 color; + +uniform sampler2DRect foo; + +void main() +{ + gl_Position = vec4(color, 142.0f); + discard; +} diff --git a/core/deps/glslang/Test/voidFunction.frag b/core/deps/glslang/Test/voidFunction.frag index 573d5f2ce..4767f7ab1 100644 --- a/core/deps/glslang/Test/voidFunction.frag +++ b/core/deps/glslang/Test/voidFunction.frag @@ -1,34 +1,34 @@ -#version 120 - -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; - -float bar = 2.0; - -void foo() -{ - bar++; - - return; -} - -void foo2() -{ - bar++; -} - -void main() -{ - vec4 outColor = bigColor; - - foo(); - - foo2(); - - outColor.x += bar; - - gl_FragColor = outColor; - - return; -} +#version 120 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +float bar = 2.0; + +void foo() +{ + bar++; + + return; +} + +void foo2() +{ + bar++; +} + +void main() +{ + vec4 outColor = bigColor; + + foo(); + + foo2(); + + outColor.x += bar; + + gl_FragColor = outColor; + + return; +} diff --git a/core/deps/glslang/Test/vulkan.comp b/core/deps/glslang/Test/vulkan.comp index fe5637492..6b6f4cf3b 100644 --- a/core/deps/glslang/Test/vulkan.comp +++ b/core/deps/glslang/Test/vulkan.comp @@ -1,12 +1,12 @@ -#version 450 - -layout(local_size_x_id = 18, local_size_z_id = 19) in; -layout(local_size_x = 32, local_size_y = 32) in; -layout(local_size_z_id = 14) in; // ERROR, can't change this - -void main() -{ - gl_WorkGroupSize; -} - -layout(local_size_y_id = 19) in; // ERROR, already used: TODO not yet reported +#version 450 + +layout(local_size_x_id = 18, local_size_z_id = 19) in; +layout(local_size_x = 32, local_size_y = 32) in; +layout(local_size_z_id = 14) in; // ERROR, can't change this + +void main() +{ + gl_WorkGroupSize; +} + +layout(local_size_y_id = 19) in; // ERROR, already used: TODO not yet reported diff --git a/core/deps/glslang/Test/vulkan.frag b/core/deps/glslang/Test/vulkan.frag index 63d1eb0d2..46c14f314 100644 --- a/core/deps/glslang/Test/vulkan.frag +++ b/core/deps/glslang/Test/vulkan.frag @@ -1,105 +1,105 @@ -#version 450 - -uniform sampler s; // ERROR, no binding -uniform sampler sA[4]; // ERROR, no binding -uniform texture2D t2d; // ERROR, no binding -uniform texture3D t3d[4]; // ERROR, no binding -int i; -uniform samplerShadow sShadow; -uniform texture3D t3d5[5]; -writeonly uniform image2D i2d; - -void badConst() -{ - sampler2D(t2d); // ERROR, need 2 args - sampler2D(s, s); // ERROR, wrong type - sampler2D(i, i); // ERROR, wrong type - sampler2D(t2d, i); // ERROR, wrong type - sampler2D(t2d, t2d); // ERROR, wrong type - sampler2D(t2d, sA); // ERROR, wrong type - - sampler3D[4](t3d5, sA[2]); // ERROR, can't make array - sampler2D(i2d, s); // ERROR, image instead of texture - sampler2D(t3d[1], s); // ERROR, 3D not 2D - sampler2D(t2d, sShadow); - sampler2DShadow(t2d, s); -} - -sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor -sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor - -out vec4 color; // ERROR, no location - -void main() -{ - color = texture(s2D, vec2(0.5)); - color += texture(s3d[i], vec3(0.5)); -} - -layout(push_constant) buffer pcb { // ERROR, not on a buffer - int a; -} pcbInst; - -layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block - -layout(push_constant) uniform; // ERROR, needs an object -layout(std430, push_constant) uniform pcb1 { int a; } pcb1inst; -layout(push_constant) uniform pcb2 { - int a; -}; // Okay now to have no instance name - -layout(input_attachment_index = 2) uniform subpassInput subD; -layout(input_attachment_index = 3) uniform texture2D subDbad1; // ERROR, not a texture -layout(input_attachment_index = 4) writeonly uniform image2D subDbad2; // ERROR, not an image -uniform subpassInput subDbad3; // ERROR, need attachment number -layout(input_attachment_index = 2) uniform subpassInputMS subDMS; - -void foo() -{ - vec4 v = subpassLoad(subD); - v += subpassLoadMS(subD); // ERROR, no such function - v += subpassLoad(subD, 2); // ERROR, no such sig. - v += subpassLoad(subDMS, 2); - v += subpassLoadMS(subDMS, 2); // ERROR, no such function -} - -subroutine int fooS; // ERROR, not in SPV -subroutine int fooSub(); // ERROR, not in SPV - -uniform vec4 dv4; // ERROR, no default uniforms - -void fooTex() -{ - texture(t2d, vec2(1.0)); // ERROR, need a sampler, not a pure texture - imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture -} - -precision highp float; - -layout(location=0) in vec2 vTexCoord; -layout(location=0) out vec4 FragColor; - -vec4 userTexture(mediump sampler2D samp, vec2 coord) -{ - return texture(samp, coord); -} - -bool cond; - -void callUserTexture() -{ - userTexture(sampler2D(t2d,s), vTexCoord); // ERROR, not point of use - userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use - userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use - userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use - - gl_NumSamples; // ERROR, not for Vulkan -} - -void noise() -{ - noise1(dv4); - noise2(4.0); - noise3(vec2(3)); - noise4(dv4); -} +#version 450 + +uniform sampler s; // ERROR, no binding +uniform sampler sA[4]; // ERROR, no binding +uniform texture2D t2d; // ERROR, no binding +uniform texture3D t3d[4]; // ERROR, no binding +int i; +uniform samplerShadow sShadow; +uniform texture3D t3d5[5]; +writeonly uniform image2D i2d; + +void badConst() +{ + sampler2D(t2d); // ERROR, need 2 args + sampler2D(s, s); // ERROR, wrong type + sampler2D(i, i); // ERROR, wrong type + sampler2D(t2d, i); // ERROR, wrong type + sampler2D(t2d, t2d); // ERROR, wrong type + sampler2D(t2d, sA); // ERROR, wrong type + + sampler3D[4](t3d5, sA[2]); // ERROR, can't make array + sampler2D(i2d, s); // ERROR, image instead of texture + sampler2D(t3d[1], s); // ERROR, 3D not 2D + sampler2D(t2d, sShadow); + sampler2DShadow(t2d, s); +} + +sampler2D s2D = sampler2D(t2d, s); // ERROR, no sampler constructor +sampler3D s3d[4] = sampler3D[4](t3d, sA[2]); // ERROR, no sampler constructor + +out vec4 color; // ERROR, no location + +void main() +{ + color = texture(s2D, vec2(0.5)); + color += texture(s3d[i], vec3(0.5)); +} + +layout(push_constant) buffer pcb { // ERROR, not on a buffer + int a; +} pcbInst; + +layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block + +layout(push_constant) uniform; // ERROR, needs an object +layout(std430, push_constant) uniform pcb1 { int a; } pcb1inst; +layout(push_constant) uniform pcb2 { + int a; +}; // Okay now to have no instance name + +layout(input_attachment_index = 2) uniform subpassInput subD; +layout(input_attachment_index = 3) uniform texture2D subDbad1; // ERROR, not a texture +layout(input_attachment_index = 4) writeonly uniform image2D subDbad2; // ERROR, not an image +uniform subpassInput subDbad3; // ERROR, need attachment number +layout(input_attachment_index = 2) uniform subpassInputMS subDMS; + +void foo() +{ + vec4 v = subpassLoad(subD); + v += subpassLoadMS(subD); // ERROR, no such function + v += subpassLoad(subD, 2); // ERROR, no such sig. + v += subpassLoad(subDMS, 2); + v += subpassLoadMS(subDMS, 2); // ERROR, no such function +} + +subroutine int fooS; // ERROR, not in SPV +subroutine int fooSub(); // ERROR, not in SPV + +uniform vec4 dv4; // ERROR, no default uniforms + +void fooTex() +{ + texture(t2d, vec2(1.0)); // ERROR, need a sampler, not a pure texture + imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture +} + +precision highp float; + +layout(location=0) in vec2 vTexCoord; +layout(location=0) out vec4 FragColor; + +vec4 userTexture(mediump sampler2D samp, vec2 coord) +{ + return texture(samp, coord); +} + +bool cond; + +void callUserTexture() +{ + userTexture(sampler2D(t2d,s), vTexCoord); // ERROR, not point of use + userTexture((sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use + userTexture((sampler2D(t2d,s), sampler2D(t2d,s)), vTexCoord); // ERROR, not point of use + userTexture(cond ? sampler2D(t2d,s) : sampler2D(t2d,s), vTexCoord); // ERROR, no ?:, not point of use + + gl_NumSamples; // ERROR, not for Vulkan +} + +void noise() +{ + noise1(dv4); + noise2(4.0); + noise3(vec2(3)); + noise4(dv4); +} diff --git a/core/deps/glslang/Test/vulkan.vert b/core/deps/glslang/Test/vulkan.vert index 598ed50c2..7142691a9 100644 --- a/core/deps/glslang/Test/vulkan.vert +++ b/core/deps/glslang/Test/vulkan.vert @@ -1,77 +1,77 @@ -#version 450 - -layout(input_attachment_index = 2) uniform subpassInput subD1; // ERROR, not this stage -layout(input_attachment_index = 2) uniform isubpassInput subD2; // ERROR, not this stage -layout(input_attachment_index = 2) uniform usubpassInput subD3; // ERROR, not this stage -layout(input_attachment_index = 2) uniform subpassInputMS subD4; // ERROR, not this stage -layout(input_attachment_index = 2) uniform isubpassInputMS subD5; // ERROR, not this stage -layout(input_attachment_index = 2) uniform usubpassInputMS subD6; // ERROR, not this stage - -out vec4 color; - -layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13); // ERROR, not a scalar -layout(constant_id = 17) uniform sampler2D s2D; // ERROR, not the right type or qualifier -layout(constant_id = 4000) const int c1 = 12; // ERROR, too big -layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0); // ERROR, not a scalar -layout(constant_id = 4) in; - -void main() -{ - color = subpassLoad(subD1); // ERROR, no such function in this stage -} - -layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan -layout(shared, binding = 1) uniform ub1n { int a; } ub1i; // ERROR, no shared -layout(packed, binding = 2) uniform ub2n { int a; } ub2i; // ERROR, no packed - -layout(constant_id=222) const int arraySize = 4; - -void foo() -{ - int a1[arraySize]; - int a2[arraySize] = a1; // ERROR, can't use in initializer - - a1 = a2; // ERROR, can't assign, even though the same type - if (a1 == a2) // ERROR, can't compare either - ++color; -} - -layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant - -#ifndef VULKAN -#error VULKAN should be defined -#endif - -#if VULKAN != 100 -#error VULKAN should be 100 -#endif - -float AofA0[2][arraySize]; -float AofA1[arraySize][arraySize]; -float AofA2[arraySize][2 + arraySize]; -float AofA3[arraySize][2]; - -out ban1 { // ERROR, only outer dimension - float f; -} bai1[2][arraySize]; - -out ban2 { - float f; -} bai2[arraySize][2]; - -layout(binding = 3000) uniform sampler2D s3000; -layout(binding = 3001) uniform b3001 { int a; }; -layout(location = 10) in vec4 in1; -layout(location = 10) in vec4 in2; // ERROR, no location aliasing - -layout(constant_id = 400) const int nonLit = 1; -layout(location = nonLit, component = nonLit) in vec4 nonLit1; // ERROR, non literal -layout(binding = nonLit, set = nonLit) uniform nonLitBN { // ERROR, non literal - layout(offset = nonLit) vec4 nonLit1; // ERROR, non literal - layout(align = nonLit) vec4 nonLit3; // ERROR, non literal - layout(xfb_offset = nonLit) vec4 nonLit4; // ERROR, non literal - layout(xfb_buffer = nonLit) vec4 nonLit5; // ERROR, non literal - layout(xfb_stride = nonLit) vec4 nonLit6; // ERROR, non literal -} nonLitBI; -layout(input_attachment_index = nonLit) vec4 nonLit3; // ERROR, non literal -layout(constant_id = nonLit) vec4 nonLit4; // ERROR, non literal +#version 450 + +layout(input_attachment_index = 2) uniform subpassInput subD1; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInput subD2; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInput subD3; // ERROR, not this stage +layout(input_attachment_index = 2) uniform subpassInputMS subD4; // ERROR, not this stage +layout(input_attachment_index = 2) uniform isubpassInputMS subD5; // ERROR, not this stage +layout(input_attachment_index = 2) uniform usubpassInputMS subD6; // ERROR, not this stage + +out vec4 color; + +layout(constant_id = 17) const ivec2 arraySizes = ivec2(12,13); // ERROR, not a scalar +layout(constant_id = 17) uniform sampler2D s2D; // ERROR, not the right type or qualifier +layout(constant_id = 4000) const int c1 = 12; // ERROR, too big +layout(constant_id = 4) const float c2[2] = float[2](1.0, 2.0); // ERROR, not a scalar +layout(constant_id = 4) in; + +void main() +{ + color = subpassLoad(subD1); // ERROR, no such function in this stage +} + +layout(binding = 0) uniform atomic_uint aui; // ERROR, no atomics in Vulkan +layout(shared, binding = 1) uniform ub1n { int a; } ub1i; // ERROR, no shared +layout(packed, binding = 2) uniform ub2n { int a; } ub2i; // ERROR, no packed + +layout(constant_id=222) const int arraySize = 4; + +void foo() +{ + int a1[arraySize]; + int a2[arraySize] = a1; // ERROR, can't use in initializer + + a1 = a2; // ERROR, can't assign, even though the same type + if (a1 == a2) // ERROR, can't compare either + ++color; +} + +layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant + +#ifndef VULKAN +#error VULKAN should be defined +#endif + +#if VULKAN != 100 +#error VULKAN should be 100 +#endif + +float AofA0[2][arraySize]; +float AofA1[arraySize][arraySize]; +float AofA2[arraySize][2 + arraySize]; +float AofA3[arraySize][2]; + +out ban1 { // ERROR, only outer dimension + float f; +} bai1[2][arraySize]; + +out ban2 { + float f; +} bai2[arraySize][2]; + +layout(binding = 3000) uniform sampler2D s3000; +layout(binding = 3001) uniform b3001 { int a; }; +layout(location = 10) in vec4 in1; +layout(location = 10) in vec4 in2; // ERROR, no location aliasing + +layout(constant_id = 400) const int nonLit = 1; +layout(location = nonLit, component = nonLit) in vec4 nonLit1; // ERROR, non literal +layout(binding = nonLit, set = nonLit) uniform nonLitBN { // ERROR, non literal + layout(offset = nonLit) vec4 nonLit1; // ERROR, non literal + layout(align = nonLit) vec4 nonLit3; // ERROR, non literal + layout(xfb_offset = nonLit) vec4 nonLit4; // ERROR, non literal + layout(xfb_buffer = nonLit) vec4 nonLit5; // ERROR, non literal + layout(xfb_stride = nonLit) vec4 nonLit6; // ERROR, non literal +} nonLitBI; +layout(input_attachment_index = nonLit) vec4 nonLit3; // ERROR, non literal +layout(constant_id = nonLit) vec4 nonLit4; // ERROR, non literal diff --git a/core/deps/glslang/Test/web.basic.vert b/core/deps/glslang/Test/web.basic.vert index 8ce0f0cc2..9bc4c30fc 100644 --- a/core/deps/glslang/Test/web.basic.vert +++ b/core/deps/glslang/Test/web.basic.vert @@ -1,15 +1,15 @@ -#version 310 es - -layout(location = 2) in vec4 inv4; -layout(location = 1) out vec4 outv4; - -layout(binding = 3) uniform uBlock { - vec4 a; - ivec4 b; - uvec4 c; -} uInst; - -void main() -{ - outv4 = normalize(inv4) * uInst.a * vec4(uInst.b) * vec4(uInst.c); -} +#version 310 es + +layout(location = 2) in vec4 inv4; +layout(location = 1) out vec4 outv4; + +layout(binding = 3) uniform uBlock { + vec4 a; + ivec4 b; + uvec4 c; +} uInst; + +void main() +{ + outv4 = normalize(inv4) * uInst.a * vec4(uInst.b) * vec4(uInst.c); +} diff --git a/core/deps/glslang/Test/web.builtins.vert b/core/deps/glslang/Test/web.builtins.vert index 11d8e98e8..f27b12b25 100644 --- a/core/deps/glslang/Test/web.builtins.vert +++ b/core/deps/glslang/Test/web.builtins.vert @@ -1,14 +1,14 @@ -#version 310 es - -layout(location = 0) in mediump float ps; - -invariant gl_Position; - -void main() -{ - gl_Position = vec4(ps); - gl_Position *= float(4 - gl_VertexIndex); - - gl_PointSize = ps; - gl_PointSize *= float(5 - gl_InstanceIndex); -} +#version 310 es + +layout(location = 0) in mediump float ps; + +invariant gl_Position; + +void main() +{ + gl_Position = vec4(ps); + gl_Position *= float(4 - gl_VertexIndex); + + gl_PointSize = ps; + gl_PointSize *= float(5 - gl_InstanceIndex); +} diff --git a/core/deps/glslang/Test/whileLoop.frag b/core/deps/glslang/Test/whileLoop.frag index 126fdb12c..a9541f917 100644 --- a/core/deps/glslang/Test/whileLoop.frag +++ b/core/deps/glslang/Test/whileLoop.frag @@ -1,16 +1,16 @@ -#version 110 - -uniform vec4 bigColor; -varying vec4 BaseColor; -uniform float d; - -void main() -{ - vec4 color = BaseColor; - - while (color.x < d) { - color += bigColor; - } - - gl_FragColor = color; -} +#version 110 + +uniform vec4 bigColor; +varying vec4 BaseColor; +uniform float d; + +void main() +{ + vec4 color = BaseColor; + + while (color.x < d) { + color += bigColor; + } + + gl_FragColor = color; +} diff --git a/core/deps/glslang/_config.yml b/core/deps/glslang/_config.yml index c50ff38da..e8b995b95 100644 --- a/core/deps/glslang/_config.yml +++ b/core/deps/glslang/_config.yml @@ -1 +1 @@ -theme: jekyll-theme-merlot \ No newline at end of file +theme: jekyll-theme-merlot diff --git a/core/deps/glslang/glslang/CInterface/glslang_c_interface.cpp b/core/deps/glslang/glslang/CInterface/glslang_c_interface.cpp new file mode 100644 index 000000000..c4c24a9e4 --- /dev/null +++ b/core/deps/glslang/glslang/CInterface/glslang_c_interface.cpp @@ -0,0 +1,461 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +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 HOLDER 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. +**/ + +#include "glslang/Include/glslang_c_interface.h" + +#include "SPIRV/GlslangToSpv.h" +#include "SPIRV/Logger.h" +#include "SPIRV/SpvTools.h" +#include "StandAlone/DirStackFileIncluder.h" +#include "StandAlone/ResourceLimits.h" +#include "glslang/Include/ShHandle.h" + +#include "glslang/Include/ResourceLimits.h" +#include "glslang/MachineIndependent/Versions.h" + +static_assert(int(GLSLANG_STAGE_COUNT) == EShLangCount, ""); +static_assert(int(GLSLANG_STAGE_MASK_COUNT) == EShLanguageMaskCount, ""); +static_assert(int(GLSLANG_SOURCE_COUNT) == glslang::EShSourceCount, ""); +static_assert(int(GLSLANG_CLIENT_COUNT) == glslang::EShClientCount, ""); +static_assert(int(GLSLANG_TARGET_COUNT) == glslang::EShTargetCount, ""); +static_assert(int(GLSLANG_TARGET_CLIENT_VERSION_COUNT) == glslang::EShTargetClientVersionCount, ""); +static_assert(int(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT) == glslang::EShTargetLanguageVersionCount, ""); +static_assert(int(GLSLANG_OPT_LEVEL_COUNT) == EshOptLevelCount, ""); +static_assert(int(GLSLANG_TEX_SAMP_TRANS_COUNT) == EShTexSampTransCount, ""); +static_assert(int(GLSLANG_MSG_COUNT) == EShMsgCount, ""); +static_assert(int(GLSLANG_REFLECTION_COUNT) == EShReflectionCount, ""); +static_assert(int(GLSLANG_PROFILE_COUNT) == EProfileCount, ""); +static_assert(sizeof(glslang_limits_t) == sizeof(TLimits), ""); +static_assert(sizeof(glslang_resource_t) == sizeof(TBuiltInResource), ""); + +typedef struct glslang_shader_s { + glslang::TShader* shader; + std::string preprocessedGLSL; +} glslang_shader_t; + +typedef struct glslang_program_s { + glslang::TProgram* program; + std::vector spirv; + std::string loggerMessages; +} glslang_program_t; + +/* Wrapper/Adapter for C glsl_include_callbacks_t functions + + This class contains a 'glsl_include_callbacks_t' structure + with C include_local/include_system callback pointers. + + This class implement TShader::Includer interface + by redirecting C++ virtual methods to C callbacks. + + The 'IncludeResult' instances produced by this Includer + contain a reference to glsl_include_result_t C structure + to allow its lifetime management by another C callback + (CallbackIncluder::callbacks::free_include_result) +*/ +class CallbackIncluder : public glslang::TShader::Includer { +public: + /* Wrapper of IncludeResult which stores a glsl_include_result object internally */ + class CallbackIncludeResult : public glslang::TShader::Includer::IncludeResult { + public: + CallbackIncludeResult(const std::string& headerName, const char* const headerData, const size_t headerLength, + void* userData, glsl_include_result_t* includeResult) + : glslang::TShader::Includer::IncludeResult(headerName, headerData, headerLength, userData), + includeResult(includeResult) + { + } + + virtual ~CallbackIncludeResult() {} + + protected: + friend class CallbackIncluder; + + glsl_include_result_t* includeResult; + }; + +public: + CallbackIncluder(glsl_include_callbacks_t _callbacks, void* _context) : callbacks(_callbacks), context(_context) {} + + virtual ~CallbackIncluder() {} + + virtual IncludeResult* includeSystem(const char* headerName, const char* includerName, + size_t inclusionDepth) override + { + if (this->callbacks.include_system) { + glsl_include_result_t* result = + this->callbacks.include_system(this->context, headerName, includerName, inclusionDepth); + + return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length, + nullptr, result); + } + + return glslang::TShader::Includer::includeSystem(headerName, includerName, inclusionDepth); + } + + virtual IncludeResult* includeLocal(const char* headerName, const char* includerName, + size_t inclusionDepth) override + { + if (this->callbacks.include_local) { + glsl_include_result_t* result = + this->callbacks.include_local(this->context, headerName, includerName, inclusionDepth); + + return new CallbackIncludeResult(std::string(headerName), result->header_data, result->header_length, + nullptr, result); + } + + return glslang::TShader::Includer::includeLocal(headerName, includerName, inclusionDepth); + } + + /* This function only calls free_include_result callback + when the IncludeResult instance is allocated by a C function */ + virtual void releaseInclude(IncludeResult* result) override + { + if (result == nullptr) + return; + + if (this->callbacks.free_include_result && (result->userData == nullptr)) { + CallbackIncludeResult* innerResult = static_cast(result); + /* use internal free() function */ + this->callbacks.free_include_result(this->context, innerResult->includeResult); + /* ignore internal fields of TShader::Includer::IncludeResult */ + delete result; + return; + } + + delete[] static_cast(result->userData); + delete result; + } + +private: + CallbackIncluder() {} + + /* C callback pointers */ + glsl_include_callbacks_t callbacks; + /* User-defined context */ + void* context; +}; + +int glslang_initialize_process() { return static_cast(glslang::InitializeProcess()); } + +void glslang_finalize_process() { glslang::FinalizeProcess(); } + +static EShLanguage c_shader_stage(glslang_stage_t stage) +{ + switch (stage) { + case GLSLANG_STAGE_VERTEX: + return EShLangVertex; + case GLSLANG_STAGE_TESSCONTROL: + return EShLangTessControl; + case GLSLANG_STAGE_TESSEVALUATION: + return EShLangTessEvaluation; + case GLSLANG_STAGE_GEOMETRY: + return EShLangGeometry; + case GLSLANG_STAGE_FRAGMENT: + return EShLangFragment; + case GLSLANG_STAGE_COMPUTE: + return EShLangCompute; + case GLSLANG_STAGE_RAYGEN_NV: + return EShLangRayGen; + case GLSLANG_STAGE_INTERSECT_NV: + return EShLangIntersect; + case GLSLANG_STAGE_ANYHIT_NV: + return EShLangAnyHit; + case GLSLANG_STAGE_CLOSESTHIT_NV: + return EShLangClosestHit; + case GLSLANG_STAGE_MISS_NV: + return EShLangMiss; + case GLSLANG_STAGE_CALLABLE_NV: + return EShLangCallable; + case GLSLANG_STAGE_TASK_NV: + return EShLangTaskNV; + case GLSLANG_STAGE_MESH_NV: + return EShLangMeshNV; + default: + break; + } + return EShLangCount; +} + +static int c_shader_messages(glslang_messages_t messages) +{ +#define CONVERT_MSG(in, out) \ + if ((messages & in) == in) \ + res |= out; + + int res = 0; + + CONVERT_MSG(GLSLANG_MSG_RELAXED_ERRORS_BIT, EShMsgRelaxedErrors); + CONVERT_MSG(GLSLANG_MSG_SUPPRESS_WARNINGS_BIT, EShMsgSuppressWarnings); + CONVERT_MSG(GLSLANG_MSG_AST_BIT, EShMsgAST); + CONVERT_MSG(GLSLANG_MSG_SPV_RULES_BIT, EShMsgSpvRules); + CONVERT_MSG(GLSLANG_MSG_VULKAN_RULES_BIT, EShMsgVulkanRules); + CONVERT_MSG(GLSLANG_MSG_ONLY_PREPROCESSOR_BIT, EShMsgOnlyPreprocessor); + CONVERT_MSG(GLSLANG_MSG_READ_HLSL_BIT, EShMsgReadHlsl); + CONVERT_MSG(GLSLANG_MSG_CASCADING_ERRORS_BIT, EShMsgCascadingErrors); + CONVERT_MSG(GLSLANG_MSG_KEEP_UNCALLED_BIT, EShMsgKeepUncalled); + CONVERT_MSG(GLSLANG_MSG_HLSL_OFFSETS_BIT, EShMsgHlslOffsets); + CONVERT_MSG(GLSLANG_MSG_DEBUG_INFO_BIT, EShMsgDebugInfo); + CONVERT_MSG(GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT, EShMsgHlslEnable16BitTypes); + CONVERT_MSG(GLSLANG_MSG_HLSL_LEGALIZATION_BIT, EShMsgHlslLegalization); + CONVERT_MSG(GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT, EShMsgHlslDX9Compatible); + CONVERT_MSG(GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT, EShMsgBuiltinSymbolTable); + return res; +#undef CONVERT_MSG +} + +static glslang::EShTargetLanguageVersion +c_shader_target_language_version(glslang_target_language_version_t target_language_version) +{ + switch (target_language_version) { + case GLSLANG_TARGET_SPV_1_0: + return glslang::EShTargetSpv_1_0; + case GLSLANG_TARGET_SPV_1_1: + return glslang::EShTargetSpv_1_1; + case GLSLANG_TARGET_SPV_1_2: + return glslang::EShTargetSpv_1_2; + case GLSLANG_TARGET_SPV_1_3: + return glslang::EShTargetSpv_1_3; + case GLSLANG_TARGET_SPV_1_4: + return glslang::EShTargetSpv_1_4; + case GLSLANG_TARGET_SPV_1_5: + return glslang::EShTargetSpv_1_5; + default: + break; + } + return glslang::EShTargetSpv_1_0; +} + +static glslang::EShClient c_shader_client(glslang_client_t client) +{ + switch (client) { + case GLSLANG_CLIENT_VULKAN: + return glslang::EShClientVulkan; + case GLSLANG_CLIENT_OPENGL: + return glslang::EShClientOpenGL; + default: + break; + } + + return glslang::EShClientNone; +} + +static glslang::EShTargetClientVersion c_shader_client_version(glslang_target_client_version_t client_version) +{ + switch (client_version) { + case GLSLANG_TARGET_VULKAN_1_1: + return glslang::EShTargetVulkan_1_1; + case GLSLANG_TARGET_OPENGL_450: + return glslang::EShTargetOpenGL_450; + default: + break; + } + + return glslang::EShTargetVulkan_1_0; +} + +static glslang::EShTargetLanguage c_shader_target_language(glslang_target_language_t target_language) +{ + if (target_language == GLSLANG_TARGET_NONE) + return glslang::EShTargetNone; + + return glslang::EShTargetSpv; +} + +static glslang::EShSource c_shader_source(glslang_source_t source) +{ + switch (source) { + case GLSLANG_SOURCE_GLSL: + return glslang::EShSourceGlsl; + case GLSLANG_SOURCE_HLSL: + return glslang::EShSourceHlsl; + default: + break; + } + + return glslang::EShSourceNone; +} + +static EProfile c_shader_profile(glslang_profile_t profile) +{ + switch (profile) { + case GLSLANG_BAD_PROFILE: + return EBadProfile; + case GLSLANG_NO_PROFILE: + return ENoProfile; + case GLSLANG_CORE_PROFILE: + return ECoreProfile; + case GLSLANG_COMPATIBILITY_PROFILE: + return ECompatibilityProfile; + case GLSLANG_ES_PROFILE: + return EEsProfile; + case GLSLANG_PROFILE_COUNT: // Should not use this + break; + } + + return EProfile(); +} + +glslang_shader_t* glslang_shader_create(const glslang_input_t* input) +{ + if (!input || !input->code) { + printf("Error creating shader: null input(%p)/input->code\n", input); + + if (input) + printf("input->code = %p\n", input->code); + + return nullptr; + } + + glslang_shader_t* shader = new glslang_shader_t(); + + shader->shader = new glslang::TShader(c_shader_stage(input->stage)); + shader->shader->setStrings(&input->code, 1); + shader->shader->setEnvInput(c_shader_source(input->language), c_shader_stage(input->stage), + c_shader_client(input->client), input->default_version); + shader->shader->setEnvClient(c_shader_client(input->client), c_shader_client_version(input->client_version)); + shader->shader->setEnvTarget(c_shader_target_language(input->target_language), + c_shader_target_language_version(input->target_language_version)); + + return shader; +} + +const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader) +{ + return shader->preprocessedGLSL.c_str(); +} + +int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input) +{ + DirStackFileIncluder Includer; + /* TODO: use custom callbacks if they are available in 'i->callbacks' */ + return shader->shader->preprocess( + reinterpret_cast(input->resource), + input->default_version, + c_shader_profile(input->default_profile), + input->force_default_version_and_profile != 0, + input->forward_compatible != 0, + (EShMessages)c_shader_messages(input->messages), + &shader->preprocessedGLSL, + Includer + ); +} + +int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input) +{ + const char* preprocessedCStr = shader->preprocessedGLSL.c_str(); + shader->shader->setStrings(&preprocessedCStr, 1); + + return shader->shader->parse( + reinterpret_cast(input->resource), + input->default_version, + input->forward_compatible != 0, + (EShMessages)c_shader_messages(input->messages) + ); +} + +const char* glslang_shader_get_info_log(glslang_shader_t* shader) { return shader->shader->getInfoLog(); } + +const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader) { return shader->shader->getInfoDebugLog(); } + +void glslang_shader_delete(glslang_shader_t* shader) +{ + if (!shader) + return; + + delete (shader->shader); + delete (shader); +} + +glslang_program_t* glslang_program_create() +{ + glslang_program_t* p = new glslang_program_t(); + p->program = new glslang::TProgram(); + return p; +} + +void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage) +{ + spv::SpvBuildLogger logger; + glslang::SpvOptions spvOptions; + spvOptions.validate = true; + + const glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage)); + + glslang::GlslangToSpv(*intermediate, program->spirv, &logger, &spvOptions); + + program->loggerMessages = logger.getAllMessages(); +} + +size_t glslang_program_SPIRV_get_size(glslang_program_t* program) { return program->spirv.size(); } + +void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int* out) +{ + memcpy(out, program->spirv.data(), program->spirv.size() * sizeof(unsigned int)); +} + +unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program) +{ + return program->spirv.data(); +} + +const char* glslang_program_SPIRV_get_messages(glslang_program_t* program) +{ + return program->loggerMessages.empty() ? nullptr : program->loggerMessages.c_str(); +} + +void glslang_program_delete(glslang_program_t* program) +{ + if (!program) + return; + + delete (program->program); + delete (program); +} + +void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader) +{ + program->program->addShader(shader->shader); +} + +int glslang_program_link(glslang_program_t* program, int messages) +{ + return (int)program->program->link((EShMessages)messages); +} + +const char* glslang_program_get_info_log(glslang_program_t* program) +{ + return program->program->getInfoLog(); +} + +const char* glslang_program_get_info_debug_log(glslang_program_t* program) +{ + return program->program->getInfoDebugLog(); +} diff --git a/core/deps/glslang/glslang/CMakeLists.txt b/core/deps/glslang/glslang/CMakeLists.txt index 446cabb91..a0259a3de 100644 --- a/core/deps/glslang/glslang/CMakeLists.txt +++ b/core/deps/glslang/glslang/CMakeLists.txt @@ -6,9 +6,10 @@ else(WIN32) message("unknown platform") endif(WIN32) -if(EMSCRIPTEN OR ENABLE_GLSLANG_WEB) +if(EMSCRIPTEN OR ENABLE_GLSLANG_JS) + # May be enabled on non-Emscripten builds for binary-size testing. add_subdirectory(OSDependent/Web) -endif(EMSCRIPTEN OR ENABLE_GLSLANG_WEB) +endif(EMSCRIPTEN OR ENABLE_GLSLANG_JS) set(SOURCES MachineIndependent/glslang.m4 @@ -41,7 +42,8 @@ set(SOURCES MachineIndependent/preprocessor/PpTokens.cpp MachineIndependent/propagateNoContraction.cpp GenericCodeGen/CodeGen.cpp - GenericCodeGen/Link.cpp) + GenericCodeGen/Link.cpp + CInterface/glslang_c_interface.cpp) set(HEADERS Public/ShaderLang.h @@ -49,6 +51,8 @@ set(HEADERS Include/BaseTypes.h Include/Common.h Include/ConstantUnion.h + Include/glslang_c_interface.h + Include/glslang_c_shader_types.h Include/InfoSink.h Include/InitializeGlobals.h Include/intermediate.h @@ -83,8 +87,8 @@ 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 - $ - $) + $ + $) if(WIN32 AND BUILD_SHARED_LIBS) set_target_properties(glslang PROPERTIES PREFIX "") @@ -112,7 +116,7 @@ if(ENABLE_GLSLANG_INSTALL) install(TARGETS glslang EXPORT glslangTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() - install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) + install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) endif(ENABLE_GLSLANG_INSTALL) if(ENABLE_GLSLANG_INSTALL) diff --git a/core/deps/glslang/glslang/Include/BaseTypes.h b/core/deps/glslang/glslang/Include/BaseTypes.h index 6d4b4ff8e..816b17948 100644 --- a/core/deps/glslang/glslang/Include/BaseTypes.h +++ b/core/deps/glslang/glslang/Include/BaseTypes.h @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -61,8 +62,9 @@ enum TBasicType { EbtSampler, EbtStruct, EbtBlock, - EbtAccStructNV, + EbtAccStruct, EbtReference, + EbtRayQuery, // HLSL types that live only temporarily. EbtString, @@ -90,11 +92,11 @@ enum TStorageQualifier { EvqBuffer, // read/write, shared with app EvqShared, // compute shader's read/write 'shared' qualifier - EvqPayloadNV, - EvqPayloadInNV, - EvqHitAttrNV, - EvqCallableDataNV, - EvqCallableDataInNV, + EvqPayload, + EvqPayloadIn, + EvqHitAttr, + EvqCallableData, + EvqCallableDataIn, // parameters EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter @@ -238,20 +240,23 @@ enum TBuiltInVariable { EbvFragmentSizeNV, EbvInvocationsPerPixelNV, // ray tracing - EbvLaunchIdNV, - EbvLaunchSizeNV, - EbvInstanceCustomIndexNV, - EbvWorldRayOriginNV, - EbvWorldRayDirectionNV, - EbvObjectRayOriginNV, - EbvObjectRayDirectionNV, - EbvRayTminNV, - EbvRayTmaxNV, - EbvHitTNV, - EbvHitKindNV, - EbvObjectToWorldNV, - EbvWorldToObjectNV, - EbvIncomingRayFlagsNV, + EbvLaunchId, + EbvLaunchSize, + EbvInstanceCustomIndex, + EbvGeometryIndex, + EbvWorldRayOrigin, + EbvWorldRayDirection, + EbvObjectRayOrigin, + EbvObjectRayDirection, + EbvRayTmin, + EbvRayTmax, + EbvHitT, + EbvHitKind, + EbvObjectToWorld, + EbvObjectToWorld3x4, + EbvWorldToObject, + EbvWorldToObject3x4, + EbvIncomingRayFlags, // barycentrics EbvBaryCoordNV, EbvBaryCoordNoPerspNV, @@ -328,11 +333,11 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q) case EvqPointCoord: return "gl_PointCoord"; break; case EvqFragColor: return "fragColor"; break; case EvqFragDepth: return "gl_FragDepth"; break; - case EvqPayloadNV: return "rayPayloadNV"; break; - case EvqPayloadInNV: return "rayPayloadInNV"; break; - case EvqHitAttrNV: return "hitAttributeNV"; break; - case EvqCallableDataNV: return "callableDataNV"; break; - case EvqCallableDataInNV: return "callableDataInNV"; break; + case EvqPayload: return "rayPayloadNV"; break; + case EvqPayloadIn: return "rayPayloadInNV"; break; + case EvqHitAttr: return "hitAttributeNV"; break; + case EvqCallableData: return "callableDataNV"; break; + case EvqCallableDataIn: return "callableDataInNV"; break; default: return "unknown qualifier"; } } @@ -436,20 +441,21 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvFragFullyCoveredNV: return "FragFullyCoveredNV"; case EbvFragmentSizeNV: return "FragmentSizeNV"; case EbvInvocationsPerPixelNV: return "InvocationsPerPixelNV"; - case EbvLaunchIdNV: return "LaunchIdNV"; - case EbvLaunchSizeNV: return "LaunchSizeNV"; - case EbvInstanceCustomIndexNV: return "InstanceCustomIndexNV"; - case EbvWorldRayOriginNV: return "WorldRayOriginNV"; - case EbvWorldRayDirectionNV: return "WorldRayDirectionNV"; - case EbvObjectRayOriginNV: return "ObjectRayOriginNV"; - case EbvObjectRayDirectionNV: return "ObjectRayDirectionNV"; - case EbvRayTminNV: return "ObjectRayTminNV"; - case EbvRayTmaxNV: return "ObjectRayTmaxNV"; - case EbvHitTNV: return "HitTNV"; - case EbvHitKindNV: return "HitKindNV"; - case EbvIncomingRayFlagsNV: return "IncomingRayFlagsNV"; - case EbvObjectToWorldNV: return "ObjectToWorldNV"; - case EbvWorldToObjectNV: return "WorldToObjectNV"; + case EbvLaunchId: return "LaunchIdNV"; + case EbvLaunchSize: return "LaunchSizeNV"; + case EbvInstanceCustomIndex: return "InstanceCustomIndexNV"; + case EbvGeometryIndex: return "GeometryIndexEXT"; + case EbvWorldRayOrigin: return "WorldRayOriginNV"; + case EbvWorldRayDirection: return "WorldRayDirectionNV"; + case EbvObjectRayOrigin: return "ObjectRayOriginNV"; + case EbvObjectRayDirection: return "ObjectRayDirectionNV"; + case EbvRayTmin: return "ObjectRayTminNV"; + case EbvRayTmax: return "ObjectRayTmaxNV"; + case EbvHitT: return "HitTNV"; + case EbvHitKind: return "HitKindNV"; + case EbvIncomingRayFlags: return "IncomingRayFlagsNV"; + case EbvObjectToWorld: return "ObjectToWorldNV"; + case EbvWorldToObject: return "WorldToObjectNV"; case EbvBaryCoordNV: return "BaryCoordNV"; case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; diff --git a/core/deps/glslang/glslang/Include/ConstantUnion.h b/core/deps/glslang/glslang/Include/ConstantUnion.h index 76b2d9c08..c4ffb8577 100644 --- a/core/deps/glslang/glslang/Include/ConstantUnion.h +++ b/core/deps/glslang/glslang/Include/ConstantUnion.h @@ -921,7 +921,7 @@ public: else unionArray = new TConstUnionVector(size); } - TConstUnionArray(const TConstUnionArray& a) : unionArray(a.unionArray) { } + TConstUnionArray(const TConstUnionArray& a) = default; TConstUnionArray(const TConstUnionArray& a, int start, int size) { unionArray = new TConstUnionVector(size); diff --git a/core/deps/glslang/glslang/Include/Types.h b/core/deps/glslang/glslang/Include/Types.h index 3572099e3..b2c416d10 100644 --- a/core/deps/glslang/glslang/Include/Types.h +++ b/core/deps/glslang/glslang/Include/Types.h @@ -3,6 +3,7 @@ // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2015-2016 Google, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -472,6 +473,18 @@ enum TInterlockOrdering { EioCount, }; +enum TShaderInterface +{ + // Includes both uniform blocks and buffer blocks + EsiUniform = 0, + EsiInput, + EsiOutput, + EsiNone, + + EsiCount +}; + + class TQualifier { public: static const int layoutNotSet = -1; @@ -532,6 +545,7 @@ public: queuefamilycoherent = false; workgroupcoherent = false; subgroupcoherent = false; + shadercallcoherent = false; nonprivate = false; volatil = false; restrict = false; @@ -553,6 +567,7 @@ public: // having a constant_id is not sufficient: expressions have no id, but are still specConstant bool specConstant : 1; bool nonUniform : 1; + bool explicitOffset : 1; #ifdef GLSLANG_WEB bool isWriteOnly() const { return false; } @@ -590,6 +605,7 @@ public: bool queuefamilycoherent : 1; bool workgroupcoherent : 1; bool subgroupcoherent : 1; + bool shadercallcoherent : 1; bool nonprivate : 1; bool isWriteOnly() const { return writeonly; } bool isReadOnly() const { return readonly; } @@ -599,11 +615,11 @@ public: bool isSample() const { return sample; } bool isMemory() const { - return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly || nonprivate; + return shadercallcoherent || subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly || nonprivate; } bool isMemoryQualifierImageAndSSBOOnly() const { - return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly; + return shadercallcoherent || subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly; } bool bufferReferenceNeedsVulkanMemoryModel() const { @@ -773,7 +789,7 @@ public: layoutViewportRelative = false; // -2048 as the default value indicating layoutSecondaryViewportRelative is not set layoutSecondaryViewportRelativeOffset = -2048; - layoutShaderRecordNV = false; + layoutShaderRecord = false; layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd; layoutFormat = ElfNone; #endif @@ -812,7 +828,7 @@ public: hasAnyLocation() || hasStream() || hasFormat() || - isShaderRecordNV() || + isShaderRecord() || isPushConstant() || hasBufferReference(); } @@ -871,7 +887,7 @@ public: bool layoutPassthrough; bool layoutViewportRelative; int layoutSecondaryViewportRelativeOffset; - bool layoutShaderRecordNV; + bool layoutShaderRecord; #endif bool hasUniformLayout() const @@ -942,7 +958,7 @@ public: bool hasAttachment() const { return false; } TLayoutFormat getFormat() const { return ElfNone; } bool isPushConstant() const { return false; } - bool isShaderRecordNV() const { return false; } + bool isShaderRecord() const { return false; } bool hasBufferReference() const { return false; } bool hasBufferReferenceAlign() const { return false; } bool isNonUniform() const { return false; } @@ -993,7 +1009,7 @@ public: } TLayoutFormat getFormat() const { return layoutFormat; } bool isPushConstant() const { return layoutPushConstant; } - bool isShaderRecordNV() const { return layoutShaderRecordNV; } + bool isShaderRecord() const { return layoutShaderRecord; } bool hasBufferReference() const { return layoutBufferReference; } bool hasBufferReferenceAlign() const { @@ -1612,6 +1628,23 @@ public: assert(fieldName); return *fieldName; } + TShaderInterface getShaderInterface() const + { + if (basicType != EbtBlock) + return EsiNone; + + switch (qualifier.storage) { + default: + return EsiNone; + case EvqVaryingIn: + return EsiInput; + case EvqVaryingOut: + return EsiOutput; + case EvqUniform: + case EvqBuffer: + return EsiUniform; + } + } virtual TBasicType getBasicType() const { return basicType; } virtual const TSampler& getSampler() const { return sampler; } @@ -1670,7 +1703,7 @@ public: } virtual bool isOpaque() const { return basicType == EbtSampler #ifndef GLSLANG_WEB - || basicType == EbtAtomicUint || basicType == EbtAccStructNV + || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery #endif ; } virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } @@ -1946,7 +1979,8 @@ public: case EbtAtomicUint: return "atomic_uint"; case EbtStruct: return "structure"; case EbtBlock: return "block"; - case EbtAccStructNV: return "accelerationStructureNV"; + case EbtAccStruct: return "accelerationStructureNV"; + case EbtRayQuery: return "rayQueryEXT"; case EbtReference: return "reference"; #endif default: return "unknown type"; @@ -2056,7 +2090,7 @@ public: appendStr(" layoutSecondaryViewportRelativeOffset="); appendInt(qualifier.layoutSecondaryViewportRelativeOffset); } - if (qualifier.layoutShaderRecordNV) + if (qualifier.layoutShaderRecord) appendStr(" shaderRecordNV"); appendStr(")"); @@ -2099,6 +2133,8 @@ public: appendStr(" workgroupcoherent"); if (qualifier.subgroupcoherent) appendStr(" subgroupcoherent"); + if (qualifier.shadercallcoherent) + appendStr(" shadercallcoherent"); if (qualifier.nonprivate) appendStr(" nonprivate"); if (qualifier.volatil) diff --git a/core/deps/glslang/glslang/Include/glslang_c_interface.h b/core/deps/glslang/glslang/Include/glslang_c_interface.h new file mode 100644 index 000000000..5a450e0e9 --- /dev/null +++ b/core/deps/glslang/glslang/Include/glslang_c_interface.h @@ -0,0 +1,232 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +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 HOLDER 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. +**/ + +#ifndef GLSLANG_C_IFACE_H_INCLUDED +#define GLSLANG_C_IFACE_H_INCLUDED + +#include +#include + +#include "glslang_c_shader_types.h" + +typedef struct glslang_shader_s glslang_shader_t; +typedef struct glslang_program_s glslang_program_t; + +/* TLimits counterpart */ +typedef struct glslang_limits_s { + bool non_inductive_for_loops; + bool while_loops; + bool do_while_loops; + bool general_uniform_indexing; + bool general_attribute_matrix_vector_indexing; + bool general_varying_indexing; + bool general_sampler_indexing; + bool general_variable_indexing; + bool general_constant_matrix_vector_indexing; +} glslang_limits_t; + +/* TBuiltInResource counterpart */ +typedef struct glslang_resource_s { + int max_lights; + int max_clip_planes; + int max_texture_units; + int max_texture_coords; + int max_vertex_attribs; + int max_vertex_uniform_components; + int max_varying_floats; + int max_vertex_texture_image_units; + int max_combined_texture_image_units; + int max_texture_image_units; + int max_fragment_uniform_components; + int max_draw_buffers; + int max_vertex_uniform_vectors; + int max_varying_vectors; + int max_fragment_uniform_vectors; + int max_vertex_output_vectors; + int max_fragment_input_vectors; + int min_program_texel_offset; + int max_program_texel_offset; + int max_clip_distances; + int max_compute_work_group_count_x; + int max_compute_work_group_count_y; + int max_compute_work_group_count_z; + int max_compute_work_group_size_x; + int max_compute_work_group_size_y; + int max_compute_work_group_size_z; + int max_compute_uniform_components; + int max_compute_texture_image_units; + int max_compute_image_uniforms; + int max_compute_atomic_counters; + int max_compute_atomic_counter_buffers; + int max_varying_components; + int max_vertex_output_components; + int max_geometry_input_components; + int max_geometry_output_components; + int max_fragment_input_components; + int max_image_units; + int max_combined_image_units_and_fragment_outputs; + int max_combined_shader_output_resources; + int max_image_samples; + int max_vertex_image_uniforms; + int max_tess_control_image_uniforms; + int max_tess_evaluation_image_uniforms; + int max_geometry_image_uniforms; + int max_fragment_image_uniforms; + int max_combined_image_uniforms; + int max_geometry_texture_image_units; + int max_geometry_output_vertices; + int max_geometry_total_output_components; + int max_geometry_uniform_components; + int max_geometry_varying_components; + int max_tess_control_input_components; + int max_tess_control_output_components; + int max_tess_control_texture_image_units; + int max_tess_control_uniform_components; + int max_tess_control_total_output_components; + int max_tess_evaluation_input_components; + int max_tess_evaluation_output_components; + int max_tess_evaluation_texture_image_units; + int max_tess_evaluation_uniform_components; + int max_tess_patch_components; + int max_patch_vertices; + int max_tess_gen_level; + int max_viewports; + int max_vertex_atomic_counters; + int max_tess_control_atomic_counters; + int max_tess_evaluation_atomic_counters; + int max_geometry_atomic_counters; + int max_fragment_atomic_counters; + int max_combined_atomic_counters; + int max_atomic_counter_bindings; + int max_vertex_atomic_counter_buffers; + int max_tess_control_atomic_counter_buffers; + int max_tess_evaluation_atomic_counter_buffers; + int max_geometry_atomic_counter_buffers; + int max_fragment_atomic_counter_buffers; + int max_combined_atomic_counter_buffers; + int max_atomic_counter_buffer_size; + int max_transform_feedback_buffers; + int max_transform_feedback_interleaved_components; + int max_cull_distances; + int max_combined_clip_and_cull_distances; + int max_samples; + int max_mesh_output_vertices_nv; + int max_mesh_output_primitives_nv; + int max_mesh_work_group_size_x_nv; + int max_mesh_work_group_size_y_nv; + int max_mesh_work_group_size_z_nv; + int max_task_work_group_size_x_nv; + int max_task_work_group_size_y_nv; + int max_task_work_group_size_z_nv; + int max_mesh_view_count_nv; + + glslang_limits_t limits; +} glslang_resource_t; + +typedef struct glslang_input_s { + glslang_source_t language; + glslang_stage_t stage; + glslang_client_t client; + glslang_target_client_version_t client_version; + glslang_target_language_t target_language; + glslang_target_language_version_t target_language_version; + /** Shader source code */ + const char* code; + int default_version; + glslang_profile_t default_profile; + int force_default_version_and_profile; + int forward_compatible; + glslang_messages_t messages; + const glslang_resource_t* resource; +} glslang_input_t; + +/* Inclusion result structure allocated by C include_local/include_system callbacks */ +typedef struct glsl_include_result_s { + /* Header file name or NULL if inclusion failed */ + const char* header_name; + + /* Header contents or NULL */ + const char* header_data; + size_t header_length; + +} glsl_include_result_t; + +/* Callback for local file inclusion */ +typedef glsl_include_result_t* (*glsl_include_local_func)(void* ctx, const char* header_name, const char* includer_name, + size_t include_depth); + +/* Callback for system file inclusion */ +typedef glsl_include_result_t* (*glsl_include_system_func)(void* ctx, const char* header_name, + const char* includer_name, size_t include_depth); + +/* Callback for include result destruction */ +typedef int (*glsl_free_include_result_func)(void* ctx, glsl_include_result_t* result); + +/* Collection of callbacks for GLSL preprocessor */ +typedef struct glsl_include_callbacks_s { + glsl_include_system_func include_system; + glsl_include_local_func include_local; + glsl_free_include_result_func free_include_result; +} glsl_include_callbacks_t; + +#ifdef __cplusplus +extern "C" { +#endif + +int glslang_initialize_process(); +void glslang_finalize_process(); + +glslang_shader_t* glslang_shader_create(const glslang_input_t* input); +void glslang_shader_delete(glslang_shader_t* shader); +int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input); +int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input); +const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader); +const char* glslang_shader_get_info_log(glslang_shader_t* shader); +const char* glslang_shader_get_info_debug_log(glslang_shader_t* shader); + +glslang_program_t* glslang_program_create(); +void glslang_program_delete(glslang_program_t* program); +void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader); +int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t +void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage); +size_t glslang_program_SPIRV_get_size(glslang_program_t* program); +void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*); +unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program); +const char* glslang_program_SPIRV_get_messages(glslang_program_t* program); +const char* glslang_program_get_info_log(glslang_program_t* program); +const char* glslang_program_get_info_debug_log(glslang_program_t* program); + +#ifdef __cplusplus +} +#endif + +#endif /* #ifdef GLSLANG_C_IFACE_INCLUDED */ diff --git a/core/deps/glslang/glslang/Include/glslang_c_shader_types.h b/core/deps/glslang/glslang/Include/glslang_c_shader_types.h new file mode 100644 index 000000000..769f4c4a8 --- /dev/null +++ b/core/deps/glslang/glslang/Include/glslang_c_shader_types.h @@ -0,0 +1,182 @@ +/** + This code is based on the glslang_c_interface implementation by Viktor Latypov +**/ + +/** +BSD 2-Clause License + +Copyright (c) 2019, Viktor Latypov +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. 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. + +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 HOLDER 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. +**/ + +#ifndef C_SHADER_TYPES_H_INCLUDED +#define C_SHADER_TYPES_H_INCLUDED + +#define LAST_ELEMENT_MARKER(x) x + +/* EShLanguage counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX, + GLSLANG_STAGE_TESSCONTROL, + GLSLANG_STAGE_TESSEVALUATION, + GLSLANG_STAGE_GEOMETRY, + GLSLANG_STAGE_FRAGMENT, + GLSLANG_STAGE_COMPUTE, + GLSLANG_STAGE_RAYGEN_NV, + GLSLANG_STAGE_INTERSECT_NV, + GLSLANG_STAGE_ANYHIT_NV, + GLSLANG_STAGE_CLOSESTHIT_NV, + GLSLANG_STAGE_MISS_NV, + GLSLANG_STAGE_CALLABLE_NV, + GLSLANG_STAGE_TASK_NV, + GLSLANG_STAGE_MESH_NV, + LAST_ELEMENT_MARKER(GLSLANG_STAGE_COUNT), +} glslang_stage_t; // would be better as stage, but this is ancient now + +/* EShLanguageMask counterpart */ +typedef enum { + GLSLANG_STAGE_VERTEX_MASK = (1 << GLSLANG_STAGE_VERTEX), + GLSLANG_STAGE_TESSCONTROL_MASK = (1 << GLSLANG_STAGE_TESSCONTROL), + GLSLANG_STAGE_TESSEVALUATION_MASK = (1 << GLSLANG_STAGE_TESSEVALUATION), + GLSLANG_STAGE_GEOMETRY_MASK = (1 << GLSLANG_STAGE_GEOMETRY), + GLSLANG_STAGE_FRAGMENT_MASK = (1 << GLSLANG_STAGE_FRAGMENT), + GLSLANG_STAGE_COMPUTE_MASK = (1 << GLSLANG_STAGE_COMPUTE), + GLSLANG_STAGE_RAYGEN_NV_MASK = (1 << GLSLANG_STAGE_RAYGEN_NV), + GLSLANG_STAGE_INTERSECT_NV_MASK = (1 << GLSLANG_STAGE_INTERSECT_NV), + GLSLANG_STAGE_ANYHIT_NV_MASK = (1 << GLSLANG_STAGE_ANYHIT_NV), + GLSLANG_STAGE_CLOSESTHIT_NV_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT_NV), + GLSLANG_STAGE_MISS_NV_MASK = (1 << GLSLANG_STAGE_MISS_NV), + GLSLANG_STAGE_CALLABLE_NV_MASK = (1 << GLSLANG_STAGE_CALLABLE_NV), + GLSLANG_STAGE_TASK_NV_MASK = (1 << GLSLANG_STAGE_TASK_NV), + GLSLANG_STAGE_MESH_NV_MASK = (1 << GLSLANG_STAGE_MESH_NV), + LAST_ELEMENT_MARKER(GLSLANG_STAGE_MASK_COUNT), +} glslang_stage_mask_t; + +/* EShSource counterpart */ +typedef enum { + GLSLANG_SOURCE_NONE, + GLSLANG_SOURCE_GLSL, + GLSLANG_SOURCE_HLSL, + LAST_ELEMENT_MARKER(GLSLANG_SOURCE_COUNT), +} glslang_source_t; + +/* EShClient counterpart */ +typedef enum { + GLSLANG_CLIENT_NONE, + GLSLANG_CLIENT_VULKAN, + GLSLANG_CLIENT_OPENGL, + LAST_ELEMENT_MARKER(GLSLANG_CLIENT_COUNT), +} glslang_client_t; + +/* EShTargetLanguage counterpart */ +typedef enum { + GLSLANG_TARGET_NONE, + GLSLANG_TARGET_SPV, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_COUNT), +} glslang_target_language_t; + +/* SH_TARGET_ClientVersion counterpart */ +typedef enum { + GLSLANG_TARGET_VULKAN_1_0 = (1 << 22), + GLSLANG_TARGET_VULKAN_1_1 = (1 << 22) | (1 << 12), + GLSLANG_TARGET_OPENGL_450 = 450, + LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT), +} glslang_target_client_version_t; + +/* SH_TARGET_LanguageVersion counterpart */ +typedef enum { + GLSLANG_TARGET_SPV_1_0 = (1 << 16), + GLSLANG_TARGET_SPV_1_1 = (1 << 16) | (1 << 8), + GLSLANG_TARGET_SPV_1_2 = (1 << 16) | (2 << 8), + GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8), + GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8), + GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8), + LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT), +} glslang_target_language_version_t; + +/* EShExecutable counterpart */ +typedef enum { GLSLANG_EX_VERTEX_FRAGMENT, GLSLANG_EX_FRAGMENT } glslang_executable_t; + +/* EShOptimizationLevel counterpart */ +typedef enum { + GLSLANG_OPT_NO_GENERATION, + GLSLANG_OPT_NONE, + GLSLANG_OPT_SIMPLE, + GLSLANG_OPT_FULL, + LAST_ELEMENT_MARKER(GLSLANG_OPT_LEVEL_COUNT), +} glslang_optimization_level_t; + +/* EShTextureSamplerTransformMode counterpart */ +typedef enum { + GLSLANG_TEX_SAMP_TRANS_KEEP, + GLSLANG_TEX_SAMP_TRANS_UPGRADE_TEXTURE_REMOVE_SAMPLER, + LAST_ELEMENT_MARKER(GLSLANG_TEX_SAMP_TRANS_COUNT), +} glslang_texture_sampler_transform_mode_t; + +/* EShMessages counterpart */ +typedef enum { + GLSLANG_MSG_DEFAULT_BIT = 0, + GLSLANG_MSG_RELAXED_ERRORS_BIT = (1 << 0), + GLSLANG_MSG_SUPPRESS_WARNINGS_BIT = (1 << 1), + GLSLANG_MSG_AST_BIT = (1 << 2), + GLSLANG_MSG_SPV_RULES_BIT = (1 << 3), + GLSLANG_MSG_VULKAN_RULES_BIT = (1 << 4), + GLSLANG_MSG_ONLY_PREPROCESSOR_BIT = (1 << 5), + GLSLANG_MSG_READ_HLSL_BIT = (1 << 6), + GLSLANG_MSG_CASCADING_ERRORS_BIT = (1 << 7), + GLSLANG_MSG_KEEP_UNCALLED_BIT = (1 << 8), + GLSLANG_MSG_HLSL_OFFSETS_BIT = (1 << 9), + GLSLANG_MSG_DEBUG_INFO_BIT = (1 << 10), + GLSLANG_MSG_HLSL_ENABLE_16BIT_TYPES_BIT = (1 << 11), + GLSLANG_MSG_HLSL_LEGALIZATION_BIT = (1 << 12), + GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT = (1 << 13), + GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14), + LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT), +} glslang_messages_t; + +/* EShReflectionOptions counterpart */ +typedef enum { + GLSLANG_REFLECTION_DEFAULT_BIT = 0, + GLSLANG_REFLECTION_STRICT_ARRAY_SUFFIX_BIT = (1 << 0), + GLSLANG_REFLECTION_BASIC_ARRAY_SUFFIX_BIT = (1 << 1), + GLSLANG_REFLECTION_INTERMEDIATE_IOO_BIT = (1 << 2), + GLSLANG_REFLECTION_SEPARATE_BUFFERS_BIT = (1 << 3), + GLSLANG_REFLECTION_ALL_BLOCK_VARIABLES_BIT = (1 << 4), + GLSLANG_REFLECTION_UNWRAP_IO_BLOCKS_BIT = (1 << 5), + LAST_ELEMENT_MARKER(GLSLANG_REFLECTION_COUNT), +} glslang_reflection_options_t; + +/* EProfile counterpart (from Versions.h) */ +typedef enum { + GLSLANG_BAD_PROFILE = 0, + GLSLANG_NO_PROFILE = (1 << 0), + GLSLANG_CORE_PROFILE = (1 << 1), + GLSLANG_COMPATIBILITY_PROFILE = (1 << 2), + GLSLANG_ES_PROFILE = (1 << 3), + LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT), +} glslang_profile_t; + +#undef LAST_ELEMENT_MARKER + +#endif diff --git a/core/deps/glslang/glslang/Include/intermediate.h b/core/deps/glslang/glslang/Include/intermediate.h index 29d58ca63..bf12fcf8f 100644 --- a/core/deps/glslang/glslang/Include/intermediate.h +++ b/core/deps/glslang/glslang/Include/intermediate.h @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -621,6 +622,8 @@ enum TOperator { EOpIsHelperInvocation, + EOpDebugPrintf, + // // Branch // @@ -908,12 +911,41 @@ enum TOperator { EOpAverageRounded, EOpMul32x16, - EOpTraceNV, - EOpReportIntersectionNV, - EOpIgnoreIntersectionNV, - EOpTerminateRayNV, - EOpExecuteCallableNV, + EOpTrace, + EOpReportIntersection, + EOpIgnoreIntersection, + EOpTerminateRay, + EOpExecuteCallable, EOpWritePackedPrimitiveIndices4x8NV, + + // + // GL_EXT_ray_query operations + // + + EOpRayQueryInitialize, + EOpRayQueryTerminate, + EOpRayQueryGenerateIntersection, + EOpRayQueryConfirmIntersection, + EOpRayQueryProceed, + EOpRayQueryGetIntersectionType, + EOpRayQueryGetRayTMin, + EOpRayQueryGetRayFlags, + EOpRayQueryGetIntersectionT, + EOpRayQueryGetIntersectionInstanceCustomIndex, + EOpRayQueryGetIntersectionInstanceId, + EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset, + EOpRayQueryGetIntersectionGeometryIndex, + EOpRayQueryGetIntersectionPrimitiveIndex, + EOpRayQueryGetIntersectionBarycentrics, + EOpRayQueryGetIntersectionFrontFace, + EOpRayQueryGetIntersectionCandidateAABBOpaque, + EOpRayQueryGetIntersectionObjectRayDirection, + EOpRayQueryGetIntersectionObjectRayOrigin, + EOpRayQueryGetWorldRayDirection, + EOpRayQueryGetWorldRayOrigin, + EOpRayQueryGetIntersectionObjectToWorld, + EOpRayQueryGetIntersectionWorldToObject, + // // HLSL operations // diff --git a/core/deps/glslang/glslang/Include/revision.h b/core/deps/glslang/glslang/Include/revision.h index a0e4b2066..744c2fb42 100644 --- a/core/deps/glslang/glslang/Include/revision.h +++ b/core/deps/glslang/glslang/Include/revision.h @@ -1,3 +1,3 @@ // This header is generated by the make-revision script. -#define GLSLANG_PATCH_LEVEL 3559 +#define GLSLANG_PATCH_LEVEL 3743 diff --git a/core/deps/glslang/glslang/Include/revision.template b/core/deps/glslang/glslang/Include/revision.template index 6c13630b2..4a16beeb0 100644 --- a/core/deps/glslang/glslang/Include/revision.template +++ b/core/deps/glslang/glslang/Include/revision.template @@ -1,13 +1,13 @@ -// The file revision.h should be updated to the latest version, somehow, on -// check-in, if glslang has changed. -// -// revision.template is the source for revision.h when using SubWCRev as the -// method of updating revision.h. You don't have to do it this way, the -// requirement is only that revision.h gets updated. -// -// revision.h is under source control so that not all consumers of glslang -// source have to figure out how to create revision.h just to get a build -// going. However, if it is not updated, it can be a version behind. - -#define GLSLANG_REVISION "$WCREV$" -#define GLSLANG_DATE "$WCDATE$" +// The file revision.h should be updated to the latest version, somehow, on +// check-in, if glslang has changed. +// +// revision.template is the source for revision.h when using SubWCRev as the +// method of updating revision.h. You don't have to do it this way, the +// requirement is only that revision.h gets updated. +// +// revision.h is under source control so that not all consumers of glslang +// source have to figure out how to create revision.h just to get a build +// going. However, if it is not updated, it can be a version behind. + +#define GLSLANG_REVISION "$WCREV$" +#define GLSLANG_DATE "$WCDATE$" diff --git a/core/deps/glslang/glslang/MachineIndependent/Constant.cpp b/core/deps/glslang/glslang/MachineIndependent/Constant.cpp index 98c2666fb..e21cf427f 100644 --- a/core/deps/glslang/glslang/MachineIndependent/Constant.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/Constant.cpp @@ -2,7 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. -// Copyright (C) 2018 Google, Inc. +// Copyright (C) 2018-2020 Google, Inc. // // All rights reserved. // @@ -1012,6 +1012,7 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) case EOpMin: case EOpMax: case EOpMix: + case EOpMod: case EOpClamp: case EOpLessThan: case EOpGreaterThan: @@ -1074,6 +1075,14 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) case EOpPow: newConstArray[comp].setDConst(pow(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); break; + case EOpMod: + { + double arg0 = childConstUnions[0][arg0comp].getDConst(); + double arg1 = childConstUnions[1][arg1comp].getDConst(); + double result = arg0 - arg1 * floor(arg0 / arg1); + newConstArray[comp].setDConst(result); + break; + } case EOpMin: switch(children[0]->getAsTyped()->getBasicType()) { case EbtFloat16: diff --git a/core/deps/glslang/glslang/MachineIndependent/Initialize.cpp b/core/deps/glslang/glslang/MachineIndependent/Initialize.cpp index 90106d922..04486cd1d 100644 --- a/core/deps/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/Initialize.cpp @@ -1,8 +1,9 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2020 Google, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -125,8 +126,6 @@ enum ArgClass { }; // Mixtures of the above, to help the function tables const ArgClass ClassV1FIOCV = (ArgClass)(ClassV1 | ClassFIO | ClassCV); -const ArgClass ClassV1FOCV = (ArgClass)(ClassV1 | ClassFO | ClassCV); -const ArgClass ClassV1CV = (ArgClass)(ClassV1 | ClassCV); const ArgClass ClassBNS = (ArgClass)(ClassB | ClassNS); const ArgClass ClassRSNS = (ArgClass)(ClassRS | ClassNS); @@ -154,6 +153,11 @@ EProfile EDesktopProfile = static_cast(ENoProfile | ECoreProfile | ECo { EBadProfile } }; const Versioning* Es300Desktop130 = &Es300Desktop130Version[0]; + const Versioning Es310Desktop420Version[] = { { EEsProfile, 0, 310, 0, nullptr }, + { EDesktopProfile, 0, 420, 0, nullptr }, + { EBadProfile } }; + const Versioning* Es310Desktop420 = &Es310Desktop420Version[0]; + const Versioning Es310Desktop430Version[] = { { EEsProfile, 0, 310, 0, nullptr }, { EDesktopProfile, 0, 430, 0, nullptr }, { EBadProfile } }; @@ -257,14 +261,14 @@ const BuiltInFunction BaseFunctions[] = { { EOpGreaterThanEqual, "greaterThanEqual", 2, TypeU, ClassBNS, Es300Desktop130 }, { EOpVectorEqual, "equal", 2, TypeU, ClassBNS, Es300Desktop130 }, { EOpVectorNotEqual, "notEqual", 2, TypeU, ClassBNS, Es300Desktop130 }, - { EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, Es310Desktop430 }, - { EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, Es310Desktop430 }, + { EOpAtomicAdd, "atomicAdd", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicMin, "atomicMin", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicMax, "atomicMax", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicAnd, "atomicAnd", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicOr, "atomicOr", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicXor, "atomicXor", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicExchange, "atomicExchange", 2, TypeIU, ClassV1FIOCV, Es310Desktop420 }, + { EOpAtomicCompSwap, "atomicCompSwap", 3, TypeIU, ClassV1FIOCV, Es310Desktop420 }, #ifndef GLSLANG_WEB { EOpMix, "mix", 3, TypeB, ClassRegular, Es310Desktop450 }, { EOpMix, "mix", 3, TypeIU, ClassLB, Es310Desktop450 }, @@ -690,7 +694,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // // double functions added to desktop 4.00, but not fma, frexp, ldexp, or pack/unpack // - if (profile != EEsProfile && version >= 400) { + if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 commonBuiltins.append( "double sqrt(double);" @@ -1263,7 +1267,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV #endif if ((profile == EEsProfile && version >= 300) || - (profile != EEsProfile && version >= 330)) { + (profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding commonBuiltins.append( "int floatBitsToInt(highp float value);" "ivec2 floatBitsToInt(highp vec2 value);" @@ -1298,15 +1302,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "vec3 fma(vec3, vec3, vec3 );" "vec4 fma(vec4, vec4, vec4 );" "\n"); + } - if (profile != EEsProfile) { + if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 commonBuiltins.append( "double fma(double, double, double);" "dvec2 fma(dvec2, dvec2, dvec2 );" "dvec3 fma(dvec3, dvec3, dvec3 );" "dvec4 fma(dvec4, dvec4, dvec4 );" "\n"); - } } if ((profile == EEsProfile && version >= 310) || @@ -1325,7 +1329,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - if (profile != EEsProfile && version >= 400) { + if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64 commonBuiltins.append( "double frexp(double, out int);" "dvec2 frexp( dvec2, out ivec2);" @@ -4067,10 +4071,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } #ifndef GLSLANG_WEB if ((profile != EEsProfile && version >= 420) || esBarrier) { - commonBuiltins.append( - "void memoryBarrierAtomicCounter();" - "void memoryBarrierImage();" - ); + if (spvVersion.vulkan == 0) { + commonBuiltins.append("void memoryBarrierAtomicCounter();"); + } + commonBuiltins.append("void memoryBarrierImage();"); } if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { stageBuiltins[EShLangMeshNV].append( @@ -4086,6 +4090,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV commonBuiltins.append("void controlBarrier(int, int, int, int);\n" "void memoryBarrier(int, int, int);\n"); + commonBuiltins.append("void debugPrintfEXT();\n"); + if (profile != EEsProfile && version >= 450) { // coopMatStoreNV perhaps ought to have "out" on the buf parameter, but // adding it introduces undesirable tempArgs on the stack. What we want @@ -4320,29 +4326,64 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - // Builtins for GL_NV_ray_tracing + // Builtins for GL_NV_ray_tracing/GL_EXT_ray_tracing/GL_EXT_ray_query if (profile != EEsProfile && version >= 460) { - stageBuiltins[EShLangRayGenNV].append( - "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" - "void executeCallableNV(uint, int);" + commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);" + "void rayQueryTerminateEXT(rayQueryEXT);" + "void rayQueryGenerateIntersectionEXT(rayQueryEXT, float);" + "void rayQueryConfirmIntersectionEXT(rayQueryEXT);" + "bool rayQueryProceedEXT(rayQueryEXT);" + "uint rayQueryGetIntersectionTypeEXT(rayQueryEXT, bool);" + "float rayQueryGetRayTMinEXT(rayQueryEXT);" + "uint rayQueryGetRayFlagsEXT(rayQueryEXT);" + "vec3 rayQueryGetWorldRayOriginEXT(rayQueryEXT);" + "vec3 rayQueryGetWorldRayDirectionEXT(rayQueryEXT);" + "float rayQueryGetIntersectionTEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionInstanceCustomIndexEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionInstanceIdEXT(rayQueryEXT, bool);" + "uint rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionGeometryIndexEXT(rayQueryEXT, bool);" + "int rayQueryGetIntersectionPrimitiveIndexEXT(rayQueryEXT, bool);" + "vec2 rayQueryGetIntersectionBarycentricsEXT(rayQueryEXT, bool);" + "bool rayQueryGetIntersectionFrontFaceEXT(rayQueryEXT, bool);" + "bool rayQueryGetIntersectionCandidateAABBOpaqueEXT(rayQueryEXT);" + "vec3 rayQueryGetIntersectionObjectRayDirectionEXT(rayQueryEXT, bool);" + "vec3 rayQueryGetIntersectionObjectRayOriginEXT(rayQueryEXT, bool);" + "mat4x3 rayQueryGetIntersectionObjectToWorldEXT(rayQueryEXT, bool);" + "mat4x3 rayQueryGetIntersectionWorldToObjectEXT(rayQueryEXT, bool);" "\n"); - stageBuiltins[EShLangIntersectNV].append( + + stageBuiltins[EShLangRayGen].append( + "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" + "\n"); + stageBuiltins[EShLangIntersect].append( "bool reportIntersectionNV(float, uint);" + "bool reportIntersectionEXT(float, uint);" "\n"); - stageBuiltins[EShLangAnyHitNV].append( + stageBuiltins[EShLangAnyHit].append( "void ignoreIntersectionNV();" + "void ignoreIntersectionEXT();" "void terminateRayNV();" + "void terminateRayEXT();" "\n"); - stageBuiltins[EShLangClosestHitNV].append( + stageBuiltins[EShLangClosestHit].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" "\n"); - stageBuiltins[EShLangMissNV].append( + stageBuiltins[EShLangMiss].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" "\n"); - stageBuiltins[EShLangCallableNV].append( + stageBuiltins[EShLangCallable].append( "void executeCallableNV(uint, int);" + "void executeCallableEXT(uint, int);" "\n"); } @@ -5391,100 +5432,160 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangMeshNV] .append(computeSubgroupDecls); stageBuiltins[EShLangTaskNV] .append(subgroupDecls); stageBuiltins[EShLangTaskNV] .append(computeSubgroupDecls); - stageBuiltins[EShLangRayGenNV] .append(subgroupDecls); - stageBuiltins[EShLangIntersectNV] .append(subgroupDecls); - stageBuiltins[EShLangAnyHitNV] .append(subgroupDecls); - stageBuiltins[EShLangClosestHitNV] .append(subgroupDecls); - stageBuiltins[EShLangMissNV] .append(subgroupDecls); - stageBuiltins[EShLangCallableNV] .append(subgroupDecls); + stageBuiltins[EShLangRayGen] .append(subgroupDecls); + stageBuiltins[EShLangIntersect] .append(subgroupDecls); + stageBuiltins[EShLangAnyHit] .append(subgroupDecls); + stageBuiltins[EShLangClosestHit] .append(subgroupDecls); + stageBuiltins[EShLangMiss] .append(subgroupDecls); + stageBuiltins[EShLangCallable] .append(subgroupDecls); } - // GL_NV_ray_tracing + // GL_NV_ray_tracing/GL_EXT_ray_tracing if (profile != EEsProfile && version >= 460) { const char *constRayFlags = "const uint gl_RayFlagsNoneNV = 0U;" + "const uint gl_RayFlagsNoneEXT = 0U;" "const uint gl_RayFlagsOpaqueNV = 1U;" + "const uint gl_RayFlagsOpaqueEXT = 1U;" "const uint gl_RayFlagsNoOpaqueNV = 2U;" + "const uint gl_RayFlagsNoOpaqueEXT = 2U;" "const uint gl_RayFlagsTerminateOnFirstHitNV = 4U;" + "const uint gl_RayFlagsTerminateOnFirstHitEXT = 4U;" "const uint gl_RayFlagsSkipClosestHitShaderNV = 8U;" + "const uint gl_RayFlagsSkipClosestHitShaderEXT = 8U;" "const uint gl_RayFlagsCullBackFacingTrianglesNV = 16U;" + "const uint gl_RayFlagsCullBackFacingTrianglesEXT = 16U;" "const uint gl_RayFlagsCullFrontFacingTrianglesNV = 32U;" + "const uint gl_RayFlagsCullFrontFacingTrianglesEXT = 32U;" "const uint gl_RayFlagsCullOpaqueNV = 64U;" + "const uint gl_RayFlagsCullOpaqueEXT = 64U;" "const uint gl_RayFlagsCullNoOpaqueNV = 128U;" + "const uint gl_RayFlagsCullNoOpaqueEXT = 128U;" + "const uint gl_RayFlagsSkipTrianglesEXT = 256U;" + "const uint gl_RayFlagsSkipAABBEXT = 512U;" + "const uint gl_HitKindFrontFacingTriangleEXT = 254U;" + "const uint gl_HitKindBackFacingTriangleEXT = 255U;" "\n"; + + const char *constRayQueryIntersection = + "const uint gl_RayQueryCandidateIntersectionEXT = 0U;" + "const uint gl_RayQueryCommittedIntersectionEXT = 1U;" + "const uint gl_RayQueryCommittedIntersectionNoneEXT = 0U;" + "const uint gl_RayQueryCommittedIntersectionTriangleEXT = 1U;" + "const uint gl_RayQueryCommittedIntersectionGeneratedEXT = 2U;" + "const uint gl_RayQueryCandidateIntersectionTriangleEXT = 0U;" + "const uint gl_RayQueryCandidateIntersectionAABBEXT = 1U;" + "\n"; + const char *rayGenDecls = "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" "\n"; const char *intersectDecls = "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" "in int gl_PrimitiveID;" "in int gl_InstanceID;" "in int gl_InstanceCustomIndexNV;" + "in int gl_InstanceCustomIndexEXT;" + "in int gl_GeometryIndexEXT;" "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayOriginEXT;" "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_WorldRayDirectionEXT;" "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayOriginEXT;" "in vec3 gl_ObjectRayDirectionNV;" + "in vec3 gl_ObjectRayDirectionEXT;" "in float gl_RayTminNV;" + "in float gl_RayTminEXT;" "in float gl_RayTmaxNV;" + "in float gl_RayTmaxEXT;" "in mat4x3 gl_ObjectToWorldNV;" + "in mat4x3 gl_ObjectToWorldEXT;" + "in mat3x4 gl_ObjectToWorld3x4EXT;" "in mat4x3 gl_WorldToObjectNV;" + "in mat4x3 gl_WorldToObjectEXT;" + "in mat3x4 gl_WorldToObject3x4EXT;" "in uint gl_IncomingRayFlagsNV;" + "in uint gl_IncomingRayFlagsEXT;" "\n"; const char *hitDecls = "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" "in int gl_PrimitiveID;" "in int gl_InstanceID;" "in int gl_InstanceCustomIndexNV;" + "in int gl_InstanceCustomIndexEXT;" + "in int gl_GeometryIndexEXT;" "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayOriginEXT;" "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_WorldRayDirectionEXT;" "in vec3 gl_ObjectRayOriginNV;" + "in vec3 gl_ObjectRayOriginEXT;" "in vec3 gl_ObjectRayDirectionNV;" + "in vec3 gl_ObjectRayDirectionEXT;" "in float gl_RayTminNV;" + "in float gl_RayTminEXT;" "in float gl_RayTmaxNV;" + "in float gl_RayTmaxEXT;" "in float gl_HitTNV;" + "in float gl_HitTEXT;" "in uint gl_HitKindNV;" + "in uint gl_HitKindEXT;" "in mat4x3 gl_ObjectToWorldNV;" + "in mat4x3 gl_ObjectToWorldEXT;" + "in mat3x4 gl_ObjectToWorld3x4EXT;" "in mat4x3 gl_WorldToObjectNV;" + "in mat4x3 gl_WorldToObjectEXT;" + "in mat3x4 gl_WorldToObject3x4EXT;" "in uint gl_IncomingRayFlagsNV;" + "in uint gl_IncomingRayFlagsEXT;" "\n"; const char *missDecls = "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" "in vec3 gl_WorldRayOriginNV;" + "in vec3 gl_WorldRayOriginEXT;" "in vec3 gl_WorldRayDirectionNV;" + "in vec3 gl_WorldRayDirectionEXT;" "in vec3 gl_ObjectRayOriginNV;" "in vec3 gl_ObjectRayDirectionNV;" "in float gl_RayTminNV;" + "in float gl_RayTminEXT;" "in float gl_RayTmaxNV;" + "in float gl_RayTmaxEXT;" "in uint gl_IncomingRayFlagsNV;" + "in uint gl_IncomingRayFlagsEXT;" "\n"; const char *callableDecls = "in uvec3 gl_LaunchIDNV;" + "in uvec3 gl_LaunchIDEXT;" "in uvec3 gl_LaunchSizeNV;" + "in uvec3 gl_LaunchSizeEXT;" "\n"; - stageBuiltins[EShLangRayGenNV].append(rayGenDecls); - stageBuiltins[EShLangRayGenNV].append(constRayFlags); - stageBuiltins[EShLangIntersectNV].append(intersectDecls); - stageBuiltins[EShLangIntersectNV].append(constRayFlags); + commonBuiltins.append(constRayQueryIntersection); + commonBuiltins.append(constRayFlags); - stageBuiltins[EShLangAnyHitNV].append(hitDecls); - stageBuiltins[EShLangAnyHitNV].append(constRayFlags); - - stageBuiltins[EShLangClosestHitNV].append(hitDecls); - stageBuiltins[EShLangClosestHitNV].append(constRayFlags); - - stageBuiltins[EShLangMissNV].append(missDecls); - stageBuiltins[EShLangMissNV].append(constRayFlags); - - stageBuiltins[EShLangCallableNV].append(callableDecls); - stageBuiltins[EShLangCallableNV].append(constRayFlags); + stageBuiltins[EShLangRayGen].append(rayGenDecls); + stageBuiltins[EShLangIntersect].append(intersectDecls); + stageBuiltins[EShLangAnyHit].append(hitDecls); + stageBuiltins[EShLangClosestHit].append(hitDecls); + stageBuiltins[EShLangMiss].append(missDecls); + stageBuiltins[EShLangCallable].append(callableDecls); } if ((profile != EEsProfile && version >= 140)) { @@ -5492,11 +5593,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in highp int gl_DeviceIndex;" // GL_EXT_device_group "\n"; - stageBuiltins[EShLangRayGenNV].append(deviceIndex); - stageBuiltins[EShLangIntersectNV].append(deviceIndex); - stageBuiltins[EShLangAnyHitNV].append(deviceIndex); - stageBuiltins[EShLangClosestHitNV].append(deviceIndex); - stageBuiltins[EShLangMissNV].append(deviceIndex); + stageBuiltins[EShLangRayGen].append(deviceIndex); + stageBuiltins[EShLangIntersect].append(deviceIndex); + stageBuiltins[EShLangAnyHit].append(deviceIndex); + stageBuiltins[EShLangClosestHit].append(deviceIndex); + stageBuiltins[EShLangMiss].append(deviceIndex); } if (version >= 300 /* both ES and non-ES */) { @@ -5512,6 +5613,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV commonBuiltins.append("const int gl_ScopeSubgroup = 3;\n"); commonBuiltins.append("const int gl_ScopeInvocation = 4;\n"); commonBuiltins.append("const int gl_ScopeQueueFamily = 5;\n"); + commonBuiltins.append("const int gl_ScopeShaderCallEXT = 6;\n"); commonBuiltins.append("const int gl_SemanticsRelaxed = 0x0;\n"); commonBuiltins.append("const int gl_SemanticsAcquire = 0x2;\n"); @@ -5708,7 +5810,7 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int return; #endif - if (sampler.isImage() && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 430))) + if (sampler.isImage() && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 420))) return; if (profile == EEsProfile) @@ -6624,9 +6726,34 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf } } + if (version >= 320) { + // tessellation + + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlImageUniforms = %d;", resources.maxTessControlImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationImageUniforms = %d;", resources.maxTessEvaluationImageUniforms); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounters = %d;", resources.maxTessControlAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounters = %d;", resources.maxTessEvaluationAtomicCounters); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessControlAtomicCounterBuffers = %d;", resources.maxTessControlAtomicCounterBuffers); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const int gl_MaxTessEvaluationAtomicCounterBuffers = %d;", resources.maxTessEvaluationAtomicCounterBuffers); + s.append(builtInConstant); + } + } else { // non-ES profile + if (version > 400) { + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexUniformVectors = %d;", resources.maxVertexUniformVectors); + s.append(builtInConstant); + + snprintf(builtInConstant, maxSize, "const int gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors); + s.append(builtInConstant); + } + snprintf(builtInConstant, maxSize, "const int gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs); s.append(builtInConstant); @@ -7428,6 +7555,34 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_FragStencilRefARB", EbvFragStencilRef, symbolTable); } + if (profile != EEsProfile && version >= 460) { + symbolTable.setFunctionExtensions("rayQueryInitializeEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryTerminateEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGenerateIntersectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryConfirmIntersectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryProceedEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionTypeEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionTEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetRayFlagsEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetRayTMinEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceCustomIndexEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceIdEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionGeometryIndexEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionPrimitiveIndexEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionBarycentricsEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionFrontFaceEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionCandidateAABBOpaqueEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectRayDirectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectRayOriginEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionObjectToWorldEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetIntersectionWorldToObjectEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetWorldRayOriginEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setFunctionExtensions("rayQueryGetWorldRayDirectionEXT", 1, &E_GL_EXT_ray_query); + symbolTable.setVariableExtensions("gl_RayFlagsSkipAABBEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); + symbolTable.setVariableExtensions("gl_RayFlagsSkipTrianglesEXT", 1, &E_GL_EXT_ray_flags_primitive_culling); + } + if ((profile != EEsProfile && version >= 130) || (profile == EEsProfile && version >= 310)) { BuiltInVariable("gl_SampleID", EbvSampleId, symbolTable); @@ -7666,6 +7821,29 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("imageAtomicCompSwap", 1, &E_GL_OES_shader_image_atomic); } + if (profile != EEsProfile && version < 330 ) { + symbolTable.setFunctionExtensions("floatBitsToInt", 1, &E_GL_ARB_shader_bit_encoding); + symbolTable.setFunctionExtensions("floatBitsToUint", 1, &E_GL_ARB_shader_bit_encoding); + symbolTable.setFunctionExtensions("intBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding); + symbolTable.setFunctionExtensions("uintBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding); + } + + if (profile != EEsProfile && version < 430 ) { + symbolTable.setFunctionExtensions("imageSize", 1, &E_GL_ARB_shader_image_size); + } + + // GL_ARB_shader_storage_buffer_object + if (profile != EEsProfile && version < 430 ) { + symbolTable.setFunctionExtensions("atomicAdd", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicMin", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicMax", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicAnd", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicOr", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicXor", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicExchange", 1, &E_GL_ARB_shader_storage_buffer_object); + symbolTable.setFunctionExtensions("atomicCompSwap", 1, &E_GL_ARB_shader_storage_buffer_object); + } + symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview); @@ -7878,6 +8056,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } symbolTable.setFunctionExtensions("controlBarrier", 1, &E_GL_KHR_memory_scope_semantics); + symbolTable.setFunctionExtensions("debugPrintfEXT", 1, &E_GL_EXT_debug_printf); // GL_ARB_shader_ballot if (profile != EEsProfile) { @@ -7967,49 +8146,97 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion break; #ifndef GLSLANG_WEB - case EShLangRayGenNV: - case EShLangIntersectNV: - case EShLangAnyHitNV: - case EShLangClosestHitNV: - case EShLangMissNV: - case EShLangCallableNV: + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: if (profile != EEsProfile && version >= 460) { + const char *rtexts[] = { E_GL_NV_ray_tracing, E_GL_EXT_ray_tracing }; symbolTable.setVariableExtensions("gl_LaunchIDNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_LaunchIDEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_LaunchSizeNV", 1, &E_GL_NV_ray_tracing); - symbolTable.setVariableExtensions("gl_PrimitiveID", 1, &E_GL_NV_ray_tracing); - symbolTable.setVariableExtensions("gl_InstanceID", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_LaunchSizeEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_PrimitiveID", 2, rtexts); + symbolTable.setVariableExtensions("gl_InstanceID", 2, rtexts); symbolTable.setVariableExtensions("gl_InstanceCustomIndexNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_InstanceCustomIndexEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_GeometryIndexEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_WorldRayOriginNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayOriginEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_WorldRayDirectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldRayDirectionEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_ObjectRayOriginNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayOriginEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_ObjectRayDirectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectRayDirectionEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_RayTminNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTminEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_RayTmaxNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_RayTmaxEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_HitTNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_HitTEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_HitKindNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_HitKindEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_ObjectToWorldNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectToWorldEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_ObjectToWorld3x4EXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_WorldToObjectNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldToObjectEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); - BuiltInVariable("gl_LaunchIDNV", EbvLaunchIdNV, symbolTable); - BuiltInVariable("gl_LaunchSizeNV", EbvLaunchSizeNV, symbolTable); - BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); - BuiltInVariable("gl_InstanceID", EbvInstanceId, symbolTable); - BuiltInVariable("gl_InstanceCustomIndexNV", EbvInstanceCustomIndexNV,symbolTable); - BuiltInVariable("gl_WorldRayOriginNV", EbvWorldRayOriginNV, symbolTable); - BuiltInVariable("gl_WorldRayDirectionNV", EbvWorldRayDirectionNV, symbolTable); - BuiltInVariable("gl_ObjectRayOriginNV", EbvObjectRayOriginNV, symbolTable); - BuiltInVariable("gl_ObjectRayDirectionNV", EbvObjectRayDirectionNV, symbolTable); - BuiltInVariable("gl_RayTminNV", EbvRayTminNV, symbolTable); - BuiltInVariable("gl_RayTmaxNV", EbvRayTmaxNV, symbolTable); - BuiltInVariable("gl_HitTNV", EbvHitTNV, symbolTable); - BuiltInVariable("gl_HitKindNV", EbvHitKindNV, symbolTable); - BuiltInVariable("gl_ObjectToWorldNV", EbvObjectToWorldNV, symbolTable); - BuiltInVariable("gl_WorldToObjectNV", EbvWorldToObjectNV, symbolTable); - BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlagsNV, symbolTable); - BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + + symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("ignoreIntersectionNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("ignoreIntersectionEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("terminateRayNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("terminateRayEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setFunctionExtensions("executeCallableNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("executeCallableEXT", 1, &E_GL_EXT_ray_tracing); + + + BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); + BuiltInVariable("gl_LaunchIDEXT", EbvLaunchId, symbolTable); + BuiltInVariable("gl_LaunchSizeNV", EbvLaunchSize, symbolTable); + BuiltInVariable("gl_LaunchSizeEXT", EbvLaunchSize, symbolTable); + BuiltInVariable("gl_PrimitiveID", EbvPrimitiveId, symbolTable); + BuiltInVariable("gl_InstanceID", EbvInstanceId, symbolTable); + BuiltInVariable("gl_InstanceCustomIndexNV", EbvInstanceCustomIndex,symbolTable); + BuiltInVariable("gl_InstanceCustomIndexEXT", EbvInstanceCustomIndex,symbolTable); + BuiltInVariable("gl_GeometryIndexEXT", EbvGeometryIndex, symbolTable); + BuiltInVariable("gl_WorldRayOriginNV", EbvWorldRayOrigin, symbolTable); + BuiltInVariable("gl_WorldRayOriginEXT", EbvWorldRayOrigin, symbolTable); + BuiltInVariable("gl_WorldRayDirectionNV", EbvWorldRayDirection, symbolTable); + BuiltInVariable("gl_WorldRayDirectionEXT", EbvWorldRayDirection, symbolTable); + BuiltInVariable("gl_ObjectRayOriginNV", EbvObjectRayOrigin, symbolTable); + BuiltInVariable("gl_ObjectRayOriginEXT", EbvObjectRayOrigin, symbolTable); + BuiltInVariable("gl_ObjectRayDirectionNV", EbvObjectRayDirection, symbolTable); + BuiltInVariable("gl_ObjectRayDirectionEXT", EbvObjectRayDirection, symbolTable); + BuiltInVariable("gl_RayTminNV", EbvRayTmin, symbolTable); + BuiltInVariable("gl_RayTminEXT", EbvRayTmin, symbolTable); + BuiltInVariable("gl_RayTmaxNV", EbvRayTmax, symbolTable); + BuiltInVariable("gl_RayTmaxEXT", EbvRayTmax, symbolTable); + BuiltInVariable("gl_HitTNV", EbvHitT, symbolTable); + BuiltInVariable("gl_HitTEXT", EbvHitT, symbolTable); + BuiltInVariable("gl_HitKindNV", EbvHitKind, symbolTable); + BuiltInVariable("gl_HitKindEXT", EbvHitKind, symbolTable); + BuiltInVariable("gl_ObjectToWorldNV", EbvObjectToWorld, symbolTable); + BuiltInVariable("gl_ObjectToWorldEXT", EbvObjectToWorld, symbolTable); + BuiltInVariable("gl_ObjectToWorld3x4EXT", EbvObjectToWorld3x4, symbolTable); + BuiltInVariable("gl_WorldToObjectNV", EbvWorldToObject, symbolTable); + BuiltInVariable("gl_WorldToObjectEXT", EbvWorldToObject, symbolTable); + BuiltInVariable("gl_WorldToObject3x4EXT", EbvWorldToObject3x4, symbolTable); + BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlags, symbolTable); + BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable); + BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); // GL_ARB_shader_ballot symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); @@ -8426,6 +8653,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("average", EOpAverage); symbolTable.relateToOperator("averageRounded", EOpAverageRounded); symbolTable.relateToOperator("multiply32x16", EOpMul32x16); + symbolTable.relateToOperator("debugPrintfEXT", EOpDebugPrintf); + if (PureOperatorBuiltins) { symbolTable.relateToOperator("imageSize", EOpImageQuerySize); @@ -8715,6 +8944,33 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("dFdyCoarse", EOpDPdyCoarse); symbolTable.relateToOperator("fwidthCoarse", EOpFwidthCoarse); } + + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("rayQueryInitializeEXT", EOpRayQueryInitialize); + symbolTable.relateToOperator("rayQueryTerminateEXT", EOpRayQueryTerminate); + symbolTable.relateToOperator("rayQueryGenerateIntersectionEXT", EOpRayQueryGenerateIntersection); + symbolTable.relateToOperator("rayQueryConfirmIntersectionEXT", EOpRayQueryConfirmIntersection); + symbolTable.relateToOperator("rayQueryProceedEXT", EOpRayQueryProceed); + symbolTable.relateToOperator("rayQueryGetIntersectionTypeEXT", EOpRayQueryGetIntersectionType); + symbolTable.relateToOperator("rayQueryGetRayTMinEXT", EOpRayQueryGetRayTMin); + symbolTable.relateToOperator("rayQueryGetRayFlagsEXT", EOpRayQueryGetRayFlags); + symbolTable.relateToOperator("rayQueryGetIntersectionTEXT", EOpRayQueryGetIntersectionT); + symbolTable.relateToOperator("rayQueryGetIntersectionInstanceCustomIndexEXT", EOpRayQueryGetIntersectionInstanceCustomIndex); + symbolTable.relateToOperator("rayQueryGetIntersectionInstanceIdEXT", EOpRayQueryGetIntersectionInstanceId); + symbolTable.relateToOperator("rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT", EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset); + symbolTable.relateToOperator("rayQueryGetIntersectionGeometryIndexEXT", EOpRayQueryGetIntersectionGeometryIndex); + symbolTable.relateToOperator("rayQueryGetIntersectionPrimitiveIndexEXT", EOpRayQueryGetIntersectionPrimitiveIndex); + symbolTable.relateToOperator("rayQueryGetIntersectionBarycentricsEXT", EOpRayQueryGetIntersectionBarycentrics); + symbolTable.relateToOperator("rayQueryGetIntersectionFrontFaceEXT", EOpRayQueryGetIntersectionFrontFace); + symbolTable.relateToOperator("rayQueryGetIntersectionCandidateAABBOpaqueEXT", EOpRayQueryGetIntersectionCandidateAABBOpaque); + symbolTable.relateToOperator("rayQueryGetIntersectionObjectRayDirectionEXT", EOpRayQueryGetIntersectionObjectRayDirection); + symbolTable.relateToOperator("rayQueryGetIntersectionObjectRayOriginEXT", EOpRayQueryGetIntersectionObjectRayOrigin); + symbolTable.relateToOperator("rayQueryGetWorldRayDirectionEXT", EOpRayQueryGetWorldRayDirection); + symbolTable.relateToOperator("rayQueryGetWorldRayOriginEXT", EOpRayQueryGetWorldRayOrigin); + symbolTable.relateToOperator("rayQueryGetIntersectionObjectToWorldEXT", EOpRayQueryGetIntersectionObjectToWorld); + symbolTable.relateToOperator("rayQueryGetIntersectionWorldToObjectEXT", EOpRayQueryGetIntersectionWorldToObject); + } + symbolTable.relateToOperator("interpolateAtCentroid", EOpInterpolateAtCentroid); symbolTable.relateToOperator("interpolateAtSample", EOpInterpolateAtSample); symbolTable.relateToOperator("interpolateAtOffset", EOpInterpolateAtOffset); @@ -8746,27 +9002,34 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("coopMatMulAddNV", EOpCooperativeMatrixMulAdd); break; - case EShLangRayGenNV: - case EShLangClosestHitNV: - case EShLangMissNV: + case EShLangRayGen: + case EShLangClosestHit: + case EShLangMiss: if (profile != EEsProfile && version >= 460) { - symbolTable.relateToOperator("traceNV", EOpTraceNV); - symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); + symbolTable.relateToOperator("traceNV", EOpTrace); + symbolTable.relateToOperator("traceRayEXT", EOpTrace); + symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallable); + symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallable); } break; - case EShLangIntersectNV: - if (profile != EEsProfile && version >= 460) - symbolTable.relateToOperator("reportIntersectionNV", EOpReportIntersectionNV); - break; - case EShLangAnyHitNV: + case EShLangIntersect: if (profile != EEsProfile && version >= 460) { - symbolTable.relateToOperator("ignoreIntersectionNV", EOpIgnoreIntersectionNV); - symbolTable.relateToOperator("terminateRayNV", EOpTerminateRayNV); + symbolTable.relateToOperator("reportIntersectionNV", EOpReportIntersection); + symbolTable.relateToOperator("reportIntersectionEXT", EOpReportIntersection); + } + break; + case EShLangAnyHit: + if (profile != EEsProfile && version >= 460) { + symbolTable.relateToOperator("ignoreIntersectionNV", EOpIgnoreIntersection); + symbolTable.relateToOperator("ignoreIntersectionEXT", EOpIgnoreIntersection); + symbolTable.relateToOperator("terminateRayNV", EOpTerminateRay); + symbolTable.relateToOperator("terminateRayEXT", EOpTerminateRay); } break; - case EShLangCallableNV: + case EShLangCallable: if (profile != EEsProfile && version >= 460) { - symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); + symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallable); + symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallable); } break; case EShLangMeshNV: diff --git a/core/deps/glslang/glslang/MachineIndependent/Intermediate.cpp b/core/deps/glslang/glslang/MachineIndependent/Intermediate.cpp index d0f86e638..f6a5e7f27 100755 --- a/core/deps/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2015 LunarG, Inc. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2020 Google, Inc. // Copyright (C) 2017 ARM Limited. // // All rights reserved. @@ -538,7 +538,7 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const return false; case EbtAtomicUint: case EbtSampler: - case EbtAccStructNV: + case EbtAccStruct: // opaque types can be passed to functions if (op == EOpFunction) break; @@ -2774,6 +2774,9 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) case EShTexSampTransUpgradeTextureRemoveSampler: performTextureUpgradeAndSamplerRemovalTransformation(root); break; + case EShTexSampTransCount: + assert(0); + break; } #endif @@ -3234,10 +3237,17 @@ bool TIntermediate::promoteUnary(TIntermUnary& node) return false; break; - default: - if (operand->getBasicType() != EbtFloat) + // HLSL uses this path for initial function signature finding for built-ins + // taking a single argument, which generally don't participate in + // operator-based type promotion (type conversion will occur later). + // For now, scalar argument cases are relying on the setType() call below. + if (getSource() == EShSourceHlsl) + break; + // GLSL only allows integer arguments for the cases identified above in the + // case statements. + if (operand->getBasicType() != EbtFloat) return false; } diff --git a/core/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/core/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 282ecca0e..b46400914 100644 --- a/core/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -157,11 +157,11 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, case EvqBuffer: if (node->getQualifier().isReadOnly()) message = "can't modify a readonly buffer"; - if (node->getQualifier().isShaderRecordNV()) + if (node->getQualifier().isShaderRecord()) message = "can't modify a shaderrecordnv qualified buffer"; break; - case EvqHitAttrNV: - if (language != EShLangIntersectNV) + case EvqHitAttr: + if (language != EShLangIntersect) message = "cannot modify hitAttributeNV in this stage"; break; #endif @@ -181,9 +181,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, case EbtAtomicUint: message = "can't modify an atomic_uint"; break; - case EbtAccStructNV: + case EbtAccStruct: message = "can't modify accelerationStructureNV"; break; + case EbtRayQuery: + message = "can't modify rayQueryEXT"; + break; #endif default: break; diff --git a/core/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp b/core/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp index b9ab5c822..d3c9269ca 100644 --- a/core/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -3,6 +3,7 @@ // Copyright (C) 2012-2015 LunarG, Inc. // Copyright (C) 2015-2018 Google, Inc. // Copyright (C) 2017, 2019 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -1353,6 +1354,9 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction case EOpInterpolateAtSample: numArgs = 1; break; + case EOpDebugPrintf: + numArgs = 0; + break; default: break; } @@ -1672,6 +1676,9 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& unsigned int semantics = 0, storageClassSemantics = 0; unsigned int semantics2 = 0, storageClassSemantics2 = 0; + const TIntermTyped* arg0 = (*argp)[0]->getAsTyped(); + const bool isMS = arg0->getBasicType() == EbtSampler && arg0->getType().getSampler().isMultiSample(); + // Grab the semantics and storage class semantics from the operands, based on opcode switch (callNode.getOp()) { case EOpAtomicAdd: @@ -1704,18 +1711,18 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& case EOpImageAtomicXor: case EOpImageAtomicExchange: case EOpImageAtomicStore: - storageClassSemantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); - semantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics = (*argp)[isMS ? 5 : 4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[isMS ? 6 : 5]->getAsConstantUnion()->getConstArray()[0].getIConst(); break; case EOpImageAtomicLoad: - storageClassSemantics = (*argp)[3]->getAsConstantUnion()->getConstArray()[0].getIConst(); - semantics = (*argp)[4]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics = (*argp)[isMS ? 4 : 3]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[isMS ? 5 : 4]->getAsConstantUnion()->getConstArray()[0].getIConst(); break; case EOpImageAtomicCompSwap: - storageClassSemantics = (*argp)[5]->getAsConstantUnion()->getConstArray()[0].getIConst(); - semantics = (*argp)[6]->getAsConstantUnion()->getConstArray()[0].getIConst(); - storageClassSemantics2 = (*argp)[7]->getAsConstantUnion()->getConstArray()[0].getIConst(); - semantics2 = (*argp)[8]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics = (*argp)[isMS ? 6 : 5]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics = (*argp)[isMS ? 7 : 6]->getAsConstantUnion()->getConstArray()[0].getIConst(); + storageClassSemantics2 = (*argp)[isMS ? 8 : 7]->getAsConstantUnion()->getConstArray()[0].getIConst(); + semantics2 = (*argp)[isMS ? 9 : 8]->getAsConstantUnion()->getConstArray()[0].getIConst(); break; case EOpBarrier: @@ -2006,18 +2013,20 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (arg > 0) { #ifndef GLSLANG_WEB - bool f16ShadowCompare = (*argp)[1]->getAsTyped()->getBasicType() == EbtFloat16 && arg0->getType().getSampler().shadow; + bool f16ShadowCompare = (*argp)[1]->getAsTyped()->getBasicType() == EbtFloat16 && + arg0->getType().getSampler().shadow; if (f16ShadowCompare) ++arg; #endif - if (! (*argp)[arg]->getAsConstantUnion()) + if (! (*argp)[arg]->getAsTyped()->getQualifier().isConstant()) error(loc, "argument must be compile-time constant", "texel offset", ""); - else { + else if ((*argp)[arg]->getAsConstantUnion()) { const TType& type = (*argp)[arg]->getAsTyped()->getType(); for (int c = 0; c < type.getVectorSize(); ++c) { int offset = (*argp)[arg]->getAsConstantUnion()->getConstArray()[c].getIConst(); if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset) - error(loc, "value is out of range:", "texel offset", "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]"); + error(loc, "value is out of range:", "texel offset", + "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]"); } } } @@ -2026,15 +2035,32 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } #ifndef GLSLANG_WEB - case EOpTraceNV: + case EOpTrace: if (!(*argp)[10]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "payload number", ""); break; - case EOpExecuteCallableNV: + case EOpExecuteCallable: if (!(*argp)[1]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "callable data number", ""); break; + case EOpRayQueryGetIntersectionType: + case EOpRayQueryGetIntersectionT: + case EOpRayQueryGetIntersectionInstanceCustomIndex: + case EOpRayQueryGetIntersectionInstanceId: + case EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: + case EOpRayQueryGetIntersectionGeometryIndex: + case EOpRayQueryGetIntersectionPrimitiveIndex: + case EOpRayQueryGetIntersectionBarycentrics: + case EOpRayQueryGetIntersectionFrontFace: + case EOpRayQueryGetIntersectionObjectRayDirection: + case EOpRayQueryGetIntersectionObjectRayOrigin: + case EOpRayQueryGetIntersectionObjectToWorld: + case EOpRayQueryGetIntersectionWorldToObject: + if (!(*argp)[1]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "committed", ""); + break; + case EOpTextureQuerySamples: case EOpImageQuerySamples: // GL_ARB_shader_texture_image_samples @@ -3083,7 +3109,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T error(loc, "constructor argument does not have a type", "constructor", ""); return true; } - if (op != EOpConstructStruct && typed->getBasicType() == EbtSampler) { + if (op != EOpConstructStruct && op != EOpConstructNonuniform && typed->getBasicType() == EbtSampler) { error(loc, "cannot convert a sampler", "constructor", ""); return true; } @@ -3128,7 +3154,7 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const if (function[0].type->getBasicType() != EbtSampler || ! function[0].type->getSampler().isTexture() || function[0].type->isArray()) { - error(loc, "sampler-constructor first argument must be a scalar textureXXX type", token, ""); + error(loc, "sampler-constructor first argument must be a scalar *texture* type", token, ""); return true; } // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=() @@ -3136,7 +3162,8 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const texture.setCombined(false); texture.shadow = false; if (texture != function[0].type->getSampler()) { - error(loc, "sampler-constructor first argument must match type and dimensionality of constructor type", token, ""); + error(loc, "sampler-constructor first argument must be a *texture* type" + " matching the dimensionality and sampled type of the constructor", token, ""); return true; } @@ -3146,7 +3173,7 @@ bool TParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const if ( function[1].type->getBasicType() != EbtSampler || ! function[1].type->getSampler().isPureSampler() || function[1].type->isArray()) { - error(loc, "sampler-constructor second argument must be a scalar type 'sampler'", token, ""); + error(loc, "sampler-constructor second argument must be a scalar sampler or samplerShadow", token, ""); return true; } @@ -3222,14 +3249,14 @@ void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, co error(loc, "atomic_uints can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } -void TParseContext::accStructNVCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) +void TParseContext::accStructCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) { if (type.getQualifier().storage == EvqUniform) return; - if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtAccStructNV)) + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtAccStruct)) error(loc, "non-uniform struct contains an accelerationStructureNV:", type.getBasicTypeString().c_str(), identifier.c_str()); - else if (type.getBasicType() == EbtAccStructNV && type.getQualifier().storage != EvqUniform) + else if (type.getBasicType() == EbtAccStruct && type.getQualifier().storage != EvqUniform) error(loc, "accelerationStructureNV can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); @@ -3513,12 +3540,14 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons dst.precision = src.precision; #ifndef GLSLANG_WEB - if (!force && ((src.coherent && (dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)) || - (src.devicecoherent && (dst.coherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)) || - (src.queuefamilycoherent && (dst.coherent || dst.devicecoherent || dst.workgroupcoherent || dst.subgroupcoherent)) || - (src.workgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.subgroupcoherent)) || - (src.subgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent)))) { - error(loc, "only one coherent/devicecoherent/queuefamilycoherent/workgroupcoherent/subgroupcoherent qualifier allowed", GetPrecisionQualifierString(src.precision), ""); + if (!force && ((src.coherent && (dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.devicecoherent && (dst.coherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.queuefamilycoherent && (dst.coherent || dst.devicecoherent || dst.workgroupcoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.workgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.subgroupcoherent || dst.shadercallcoherent)) || + (src.subgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.shadercallcoherent)) || + (src.shadercallcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)))) { + error(loc, "only one coherent/devicecoherent/queuefamilycoherent/workgroupcoherent/subgroupcoherent/shadercallcoherent qualifier allowed", + GetPrecisionQualifierString(src.precision), ""); } #endif // Layout qualifiers @@ -3546,6 +3575,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons MERGE_SINGLETON(queuefamilycoherent); MERGE_SINGLETON(workgroupcoherent); MERGE_SINGLETON(subgroupcoherent); + MERGE_SINGLETON(shadercallcoherent); MERGE_SINGLETON(nonprivate); MERGE_SINGLETON(volatil); MERGE_SINGLETON(restrict); @@ -3983,7 +4013,7 @@ void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermType } // check for additional things allowed by GL_EXT_nonuniform_qualifier - if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStructNV || + if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStruct || base.getBasicType() == EbtRayQuery || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) requireExtensions(loc, 1, &E_GL_EXT_nonuniform_qualifier, "variable index"); else @@ -4487,6 +4517,7 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali type.getQualifier().queuefamilycoherent = qualifier.queuefamilycoherent; type.getQualifier().workgroupcoherent = qualifier.workgroupcoherent; type.getQualifier().subgroupcoherent = qualifier.subgroupcoherent; + type.getQualifier().shadercallcoherent = qualifier.shadercallcoherent; type.getQualifier().nonprivate = qualifier.nonprivate; type.getQualifier().readonly = qualifier.readonly; type.getQualifier().writeonly = qualifier.writeonly; @@ -4868,7 +4899,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi #ifndef GLSLANG_WEB if (id == TQualifier::getLayoutPackingString(ElpStd430)) { requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "std430"); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, "std430"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_shader_storage_buffer_object, "std430"); profileRequires(loc, EEsProfile, 310, nullptr, "std430"); publicType.qualifier.layoutPacking = ElpStd430; return; @@ -5067,13 +5098,19 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } } else { - if (language == EShLangRayGenNV || language == EShLangIntersectNV || - language == EShLangAnyHitNV || language == EShLangClosestHitNV || - language == EShLangMissNV || language == EShLangCallableNV) { - if (id == "shaderrecordnv") { - publicType.qualifier.layoutShaderRecordNV = true; + if (language == EShLangRayGen || language == EShLangIntersect || + language == EShLangAnyHit || language == EShLangClosestHit || + language == EShLangMiss || language == EShLangCallable) { + if (id == "shaderrecordnv" || id == "shaderrecordext") { + if (id == "shaderrecordnv") { + requireExtensions(loc, 1, &E_GL_NV_ray_tracing, "shader record NV"); + } else { + requireExtensions(loc, 1, &E_GL_EXT_ray_tracing, "shader record EXT"); + } + publicType.qualifier.layoutShaderRecord = true; return; } + } } if (language == EShLangCompute) { @@ -5135,6 +5172,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi profileRequires(loc, EEsProfile, 310, nullptr, feature); } publicType.qualifier.layoutOffset = value; + publicType.qualifier.explicitOffset = true; if (nonLiteral) error(loc, "needs a literal integer", "offset", ""); return; @@ -5514,8 +5552,8 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutViewportRelative = true; if (src.layoutSecondaryViewportRelativeOffset != -2048) dst.layoutSecondaryViewportRelativeOffset = src.layoutSecondaryViewportRelativeOffset; - if (src.layoutShaderRecordNV) - dst.layoutShaderRecordNV = true; + if (src.layoutShaderRecord) + dst.layoutShaderRecord = true; if (src.pervertexNV) dst.pervertexNV = true; #endif @@ -5583,7 +5621,7 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb error(loc, "cannot specify on a variable declaration", "align", ""); if (qualifier.isPushConstant()) error(loc, "can only specify on a uniform block", "push_constant", ""); - if (qualifier.isShaderRecordNV()) + if (qualifier.isShaderRecord()) error(loc, "can only specify on a buffer block", "shaderRecordNV", ""); } break; @@ -5657,11 +5695,11 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) error(loc, "cannot apply to uniform or buffer block", "location", ""); break; #ifndef GLSLANG_WEB - case EvqPayloadNV: - case EvqPayloadInNV: - case EvqHitAttrNV: - case EvqCallableDataNV: - case EvqCallableDataInNV: + case EvqPayload: + case EvqPayloadIn: + case EvqHitAttr: + case EvqCallableData: + case EvqCallableDataIn: break; #endif default: @@ -5756,7 +5794,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (spvVersion.spv > 0) { if (qualifier.isUniformOrBuffer()) { if (type.getBasicType() == EbtBlock && !qualifier.isPushConstant() && - !qualifier.isShaderRecordNV() && + !qualifier.isShaderRecord() && !qualifier.hasAttachment() && !qualifier.hasBufferReference()) error(loc, "uniform/buffer blocks require layout(binding=X)", "binding", ""); @@ -5813,7 +5851,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) if (qualifier.hasBufferReference() && type.getBasicType() != EbtBlock) error(loc, "can only be used with a block", "buffer_reference", ""); - if (qualifier.isShaderRecordNV() && type.getBasicType() != EbtBlock) + if (qualifier.isShaderRecord() && type.getBasicType() != EbtBlock) error(loc, "can only be used with a block", "shaderRecordNV", ""); // input attachment @@ -5958,7 +5996,7 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (qualifier.storage != EvqBuffer) error(loc, "can only be used with buffer", "buffer_reference", ""); } - if (qualifier.isShaderRecordNV()) { + if (qualifier.isShaderRecord()) { if (qualifier.storage != EvqBuffer) error(loc, "can only be used with a buffer", "shaderRecordNV", ""); if (qualifier.hasBinding()) @@ -5967,7 +6005,7 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "cannot be used with shaderRecordNV", "set", ""); } - if (qualifier.storage == EvqHitAttrNV && qualifier.hasLayout()) { + if (qualifier.storage == EvqHitAttr && qualifier.hasLayout()) { error(loc, "cannot apply layout qualifiers to hitAttributeNV variable", "hitAttributeNV", ""); } } @@ -6079,6 +6117,15 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct #endif const TFunction* function = nullptr; + + // debugPrintfEXT has var args and is in the symbol table as "debugPrintfEXT()", + // mangled to "debugPrintfEXT(" + if (call.getName() == "debugPrintfEXT") { + TSymbol* symbol = symbolTable.find("debugPrintfEXT(", &builtIn); + if (symbol) + return symbol->getAsFunction(); + } + bool explicitTypesEnabled = extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8) || extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16) || @@ -6091,7 +6138,7 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct if (isEsProfile() || version < 120) function = findFunctionExact(loc, call, builtIn); else if (version < 400) - function = findFunction120(loc, call, builtIn); + function = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn); else if (explicitTypesEnabled) function = findFunctionExplicitTypes(loc, call, builtIn); else @@ -6384,13 +6431,15 @@ const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType) { #ifndef GLSLANG_WEB - if (publicType.basicType == EbtAtomicUint && publicType.qualifier.hasBinding() && - publicType.qualifier.hasOffset()) { + if (publicType.basicType == EbtAtomicUint && publicType.qualifier.hasBinding()) { if (publicType.qualifier.layoutBinding >= (unsigned int)resources.maxAtomicCounterBindings) { error(loc, "atomic_uint binding is too large", "binding", ""); return; } - atomicUintOffsets[publicType.qualifier.layoutBinding] = publicType.qualifier.layoutOffset; + + if(publicType.qualifier.hasOffset()) { + atomicUintOffsets[publicType.qualifier.layoutBinding] = publicType.qualifier.layoutOffset; + } return; } @@ -6459,7 +6508,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden transparentOpaqueCheck(loc, type, identifier); #ifndef GLSLANG_WEB atomicUintCheck(loc, type, identifier); - accStructNVCheck(loc, type, identifier); + accStructCheck(loc, type, identifier); checkAndResizeMeshViewDim(loc, type, /*isBlockMember*/ false); #endif if (type.getQualifier().storage == EvqConst && type.containsReference()) { @@ -7393,7 +7442,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // Special case for "push_constant uniform", which has a default of std430, // contrary to normal uniform defaults, and can't have a default tracked for it. if ((currentBlockQualifier.isPushConstant() && !currentBlockQualifier.hasPacking()) || - (currentBlockQualifier.isShaderRecordNV() && !currentBlockQualifier.hasPacking())) + (currentBlockQualifier.isShaderRecord() && !currentBlockQualifier.hasPacking())) currentBlockQualifier.layoutPacking = ElpStd430; // Special case for "taskNV in/out", which has a default of std430, @@ -7610,6 +7659,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // with a particular stage. void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& qualifier) { + const char *extsrt[2] = { E_GL_NV_ray_tracing, E_GL_EXT_ray_tracing }; switch (qualifier.storage) { case EvqUniform: profileRequires(loc, EEsProfile, 300, nullptr, "uniform block"); @@ -7619,7 +7669,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q break; case EvqBuffer: requireProfile(loc, EEsProfile | ECoreProfile | ECompatibilityProfile, "buffer block"); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, nullptr, "buffer block"); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_shader_storage_buffer_object, "buffer block"); profileRequires(loc, EEsProfile, 310, nullptr, "buffer block"); break; case EvqVaryingIn: @@ -7648,28 +7698,28 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q } break; #ifndef GLSLANG_WEB - case EvqPayloadNV: - profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV block"); - requireStage(loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangAnyHitNVMask | EShLangClosestHitNVMask | EShLangMissNVMask), + case EvqPayload: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "rayPayloadNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangAnyHitMask | EShLangClosestHitMask | EShLangMissMask), "rayPayloadNV block"); break; - case EvqPayloadInNV: - profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV block"); - requireStage(loc, (EShLanguageMask)(EShLangAnyHitNVMask | EShLangClosestHitNVMask | EShLangMissNVMask), + case EvqPayloadIn: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "rayPayloadInNV block"); + requireStage(loc, (EShLanguageMask)(EShLangAnyHitMask | EShLangClosestHitMask | EShLangMissMask), "rayPayloadInNV block"); break; - case EvqHitAttrNV: - profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV block"); - requireStage(loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangAnyHitNVMask | EShLangClosestHitNVMask), "hitAttributeNV block"); + case EvqHitAttr: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "hitAttributeNV block"); + requireStage(loc, (EShLanguageMask)(EShLangIntersectMask | EShLangAnyHitMask | EShLangClosestHitMask), "hitAttributeNV block"); break; - case EvqCallableDataNV: - profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "callableDataNV block"); - requireStage(loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), + case EvqCallableData: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "callableDataNV block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV block"); break; - case EvqCallableDataInNV: - profileRequires(loc, ~EEsProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV block"); - requireStage(loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV block"); + case EvqCallableDataIn: + profileRequires(loc, ~EEsProfile, 460, 2, extsrt, "callableDataInNV block"); + requireStage(loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV block"); break; #endif default: @@ -7708,8 +7758,8 @@ void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& error(loc, "cannot use invariant qualifier on an interface block", "invariant", ""); if (qualifier.isPushConstant()) intermediate.addPushConstantCount(); - if (qualifier.isShaderRecordNV()) - intermediate.addShaderRecordNVCount(); + if (qualifier.isShaderRecord()) + intermediate.addShaderRecordCount(); if (qualifier.isTaskMemory()) intermediate.addTaskNVCount(); } @@ -8231,7 +8281,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "cannot declare a default, can only be used on a block", "buffer_reference", ""); if (qualifier.hasSpecConstantId()) error(loc, "cannot declare a default, can only be used on a scalar", "constant_id", ""); - if (qualifier.isShaderRecordNV()) + if (qualifier.isShaderRecord()) error(loc, "cannot declare a default, can only be used on a block", "shaderRecordNV", ""); } diff --git a/core/deps/glslang/glslang/MachineIndependent/ParseHelper.h b/core/deps/glslang/glslang/MachineIndependent/ParseHelper.h index 39363f1a2..20df64053 100644 --- a/core/deps/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/core/deps/glslang/glslang/MachineIndependent/ParseHelper.h @@ -358,7 +358,7 @@ public: void boolCheck(const TSourceLoc&, const TPublicType&); void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); - void accStructNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); + void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); void memberQualifierCheck(glslang::TPublicType&); void globalQualifierFixCheck(const TSourceLoc&, TQualifier&); diff --git a/core/deps/glslang/glslang/MachineIndependent/Scan.cpp b/core/deps/glslang/glslang/MachineIndependent/Scan.cpp index 710af4ab8..a2f154669 100644 --- a/core/deps/glslang/glslang/MachineIndependent/Scan.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/Scan.cpp @@ -2,6 +2,8 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Copyright (C) 2020 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -187,17 +189,15 @@ bool TInputScanner::scanVersion(int& version, EProfile& profile, bool& notFirstT if (lookingInMiddle) { notFirstToken = true; // make forward progress by finishing off the current line plus extra new lines - if (peek() == '\n' || peek() == '\r') { - while (peek() == '\n' || peek() == '\r') - get(); - } else + if (peek() != '\n' && peek() != '\r') { do { c = get(); } while (c != EndOfInput && c != '\n' && c != '\r'); - while (peek() == '\n' || peek() == '\r') - get(); - if (peek() == EndOfInput) - return true; + } + while (peek() == '\n' || peek() == '\r') + get(); + if (peek() == EndOfInput) + return true; } lookingInMiddle = true; @@ -416,6 +416,7 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["queuefamilycoherent"] = QUEUEFAMILYCOHERENT; (*KeywordMap)["workgroupcoherent"] = WORKGROUPCOHERENT; (*KeywordMap)["subgroupcoherent"] = SUBGROUPCOHERENT; + (*KeywordMap)["shadercallcoherent"] = SHADERCALLCOHERENT; (*KeywordMap)["nonprivate"] = NONPRIVATE; (*KeywordMap)["restrict"] = RESTRICT; (*KeywordMap)["readonly"] = READONLY; @@ -704,11 +705,18 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["precise"] = PRECISE; (*KeywordMap)["rayPayloadNV"] = PAYLOADNV; + (*KeywordMap)["rayPayloadEXT"] = PAYLOADEXT; (*KeywordMap)["rayPayloadInNV"] = PAYLOADINNV; + (*KeywordMap)["rayPayloadInEXT"] = PAYLOADINEXT; (*KeywordMap)["hitAttributeNV"] = HITATTRNV; + (*KeywordMap)["hitAttributeEXT"] = HITATTREXT; (*KeywordMap)["callableDataNV"] = CALLDATANV; + (*KeywordMap)["callableDataEXT"] = CALLDATAEXT; (*KeywordMap)["callableDataInNV"] = CALLDATAINNV; + (*KeywordMap)["callableDataInEXT"] = CALLDATAINEXT; (*KeywordMap)["accelerationStructureNV"] = ACCSTRUCTNV; + (*KeywordMap)["accelerationStructureEXT"] = ACCSTRUCTEXT; + (*KeywordMap)["rayQueryEXT"] = RAYQUERYEXT; (*KeywordMap)["perprimitiveNV"] = PERPRIMITIVENV; (*KeywordMap)["perviewNV"] = PERVIEWNV; (*KeywordMap)["taskNV"] = PERTASKNV; @@ -843,6 +851,7 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) parseContext.error(loc, "not supported", "::", ""); break; + case PpAtomConstString: parserToken->sType.lex.string = NewPoolTString(tokenText); return STRING_LITERAL; case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; @@ -908,7 +917,8 @@ int TScanContext::tokenizeIdentifier() case BUFFER: afterBuffer = true; if ((parseContext.isEsProfile() && parseContext.version < 310) || - (!parseContext.isEsProfile() && parseContext.version < 430)) + (!parseContext.isEsProfile() && (parseContext.version < 430 && + !parseContext.extensionTurnedOn(E_GL_ARB_shader_storage_buffer_object)))) return identifierOrType(); return keyword; @@ -1014,6 +1024,23 @@ int TScanContext::tokenizeIdentifier() parseContext.extensionTurnedOn(E_GL_NV_ray_tracing)) return keyword; return identifierOrType(); + case PAYLOADEXT: + case PAYLOADINEXT: + case HITATTREXT: + case CALLDATAEXT: + case CALLDATAINEXT: + case ACCSTRUCTEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_ray_tracing) || + parseContext.extensionTurnedOn(E_GL_EXT_ray_query)) + return keyword; + return identifierOrType(); + case RAYQUERYEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_EXT_ray_query))) + return keyword; + return identifierOrType(); case ATOMIC_UINT: if ((parseContext.isEsProfile() && parseContext.version >= 310) || parseContext.extensionTurnedOn(E_GL_ARB_shader_atomic_counters)) @@ -1025,6 +1052,7 @@ int TScanContext::tokenizeIdentifier() case QUEUEFAMILYCOHERENT: case WORKGROUPCOHERENT: case SUBGROUPCOHERENT: + case SHADERCALLCOHERENT: case NONPRIVATE: case RESTRICT: case READONLY: @@ -1166,7 +1194,10 @@ int TScanContext::tokenizeIdentifier() case DVEC3: case DVEC4: afterType = true; - if (parseContext.isEsProfile() || parseContext.version < 400) + if (parseContext.isEsProfile() || parseContext.version < 150 || + (!parseContext.symbolTable.atBuiltInLevel() && + parseContext.version < 400 && + !parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64))) reservedWord(); return keyword; @@ -1741,7 +1772,9 @@ int TScanContext::dMat() return keyword; } - if (!parseContext.isEsProfile() && parseContext.version >= 400) + if (!parseContext.isEsProfile() && (parseContext.version >= 400 || + parseContext.symbolTable.atBuiltInLevel() || + (parseContext.version >= 150 && parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64)))) return keyword; if (parseContext.isForwardCompatible()) diff --git a/core/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp b/core/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp index 44ce1c19d..a1392dbde 100644 --- a/core/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -1,7 +1,7 @@ // // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013-2016 LunarG, Inc. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2020 Google, Inc. // // All rights reserved. // @@ -361,17 +361,17 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS // check for ray tracing stages if (profile != EEsProfile && version >= 450) { - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGenNV, source, + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGen, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersectNV, source, + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangIntersect, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHitNV, source, + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangAnyHit, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHitNV, source, + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangClosestHit, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMissNV, source, + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMiss, source, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCallableNV, source, + InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCallable, source, infoSink, commonTable, symbolTables); } @@ -623,12 +623,12 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo version = profile == EEsProfile ? 310 : 420; } break; - case EShLangRayGenNV: - case EShLangIntersectNV: - case EShLangAnyHitNV: - case EShLangClosestHitNV: - case EShLangMissNV: - case EShLangCallableNV: + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: if (profile == EEsProfile || version < 460) { correct = false; infoSink.info.message(EPrefixError, "#version: ray tracing shaders require non-es profile with version 460 or above"); @@ -716,6 +716,9 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages case EShClientOpenGL: spvVersion.openGl = environment->input.dialectVersion; break; + case EShClientCount: + assert(0); + break; } switch (environment->input.languageFamily) { case EShSourceNone: @@ -728,6 +731,9 @@ void TranslateEnvironment(const TEnvironment* environment, EShMessages& messages source = EShSourceHlsl; messages = static_cast(messages | EShMsgReadHlsl); break; + case EShSourceCount: + assert(0); + break; } } @@ -1771,6 +1777,8 @@ void TShader::setSourceEntryPoint(const char* name) sourceEntryPointName = name; } +// Log initial settings and transforms. +// See comment for class TProcesses. void TShader::addProcesses(const std::vector& p) { intermediate->addProcesses(p); diff --git a/core/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp b/core/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp index 44682379f..06b5a813d 100644 --- a/core/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -3,6 +3,7 @@ // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. // Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -74,7 +75,8 @@ void TType::buildMangledName(TString& mangledName) const case EbtInt64: mangledName += "i64"; break; case EbtUint64: mangledName += "u64"; break; case EbtAtomicUint: mangledName += "au"; break; - case EbtAccStructNV: mangledName += "asnv"; break; + case EbtAccStruct: mangledName += "as"; break; + case EbtRayQuery: mangledName += "rq"; break; #endif case EbtSampler: switch (sampler.type) { @@ -120,7 +122,7 @@ void TType::buildMangledName(TString& mangledName) const mangledName += "-tx-struct"; char text[16]; // plenty enough space for the small integers. - snprintf(text, sizeof(text), "%d-", sampler.getStructReturnIndex()); + snprintf(text, sizeof(text), "%u-", sampler.getStructReturnIndex()); mangledName += text; } else { switch (sampler.getVectorSize()) { diff --git a/core/deps/glslang/glslang/MachineIndependent/Versions.cpp b/core/deps/glslang/glslang/MachineIndependent/Versions.cpp index 23f74232b..5a8f813ce 100644 --- a/core/deps/glslang/glslang/MachineIndependent/Versions.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/Versions.cpp @@ -2,7 +2,8 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2020 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -184,6 +185,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable; extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable; extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable; + extensionBehavior[E_GL_ARB_gpu_shader_fp64] = EBhDisable; extensionBehavior[E_GL_ARB_shader_ballot] = EBhDisable; extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable; extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable; @@ -195,6 +197,9 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_shader_clock] = EBhDisable; extensionBehavior[E_GL_ARB_uniform_buffer_object] = EBhDisable; extensionBehavior[E_GL_ARB_sample_shading] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_bit_encoding] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_image_size] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_storage_buffer_object] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; @@ -220,6 +225,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_buffer_reference2] = EBhDisable; extensionBehavior[E_GL_EXT_buffer_reference_uvec2] = EBhDisable; extensionBehavior[E_GL_EXT_demote_to_helper_invocation] = EBhDisable; + extensionBehavior[E_GL_EXT_debug_printf] = EBhDisable; extensionBehavior[E_GL_EXT_shader_16bit_storage] = EBhDisable; extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable; @@ -290,9 +296,12 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_OES_texture_cube_map_array] = EBhDisable; // EXT extensions - extensionBehavior[E_GL_EXT_device_group] = EBhDisable; - extensionBehavior[E_GL_EXT_multiview] = EBhDisable; - extensionBehavior[E_GL_EXT_shader_realtime_clock] = EBhDisable; + extensionBehavior[E_GL_EXT_device_group] = EBhDisable; + extensionBehavior[E_GL_EXT_multiview] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_realtime_clock] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_tracing] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_query] = EBhDisable; + extensionBehavior[E_GL_EXT_ray_flags_primitive_culling] = EBhDisable; // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; @@ -338,7 +347,6 @@ void TParseVersions::getPreamble(std::string& preamble) // AEP "#define GL_ANDROID_extension_pack_es31a 1\n" - "#define GL_KHR_blend_equation_advanced 1\n" "#define GL_OES_sample_variables 1\n" "#define GL_OES_shader_image_atomic 1\n" "#define GL_OES_shader_multisample_interpolation 1\n" @@ -394,15 +402,19 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_ARB_shader_texture_image_samples 1\n" "#define GL_ARB_viewport_array 1\n" "#define GL_ARB_gpu_shader_int64 1\n" + "#define GL_ARB_gpu_shader_fp64 1\n" "#define GL_ARB_shader_ballot 1\n" "#define GL_ARB_sparse_texture2 1\n" "#define GL_ARB_sparse_texture_clamp 1\n" "#define GL_ARB_shader_stencil_export 1\n" "#define GL_ARB_sample_shading 1\n" + "#define GL_ARB_shader_image_size 1\n" // "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members "#define GL_ARB_post_depth_coverage 1\n" "#define GL_ARB_fragment_shader_interlock 1\n" "#define GL_ARB_uniform_buffer_object 1\n" + "#define GL_ARB_shader_bit_encoding 1\n" + "#define GL_ARB_shader_storage_buffer_object 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_post_depth_coverage 1\n" @@ -417,6 +429,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_buffer_reference2 1\n" "#define GL_EXT_buffer_reference_uvec2 1\n" "#define GL_EXT_demote_to_helper_invocation 1\n" + "#define GL_EXT_debug_printf 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" @@ -430,6 +443,9 @@ void TParseVersions::getPreamble(std::string& preamble) "#define E_GL_EXT_shader_atomic_int64 1\n" "#define E_GL_EXT_shader_realtime_clock 1\n" + "#define E_GL_EXT_ray_tracing 1\n" + "#define E_GL_EXT_ray_query 1\n" + "#define E_GL_EXT_ray_flags_primitive_culling 1\n" "#define GL_AMD_shader_ballot 1\n" "#define GL_AMD_shader_trinary_minmax 1\n" @@ -505,6 +521,7 @@ void TParseVersions::getPreamble(std::string& preamble) preamble += "#define GL_GOOGLE_cpp_style_line_directive 1\n" "#define GL_GOOGLE_include_directive 1\n" + "#define GL_KHR_blend_equation_advanced 1\n" ; #endif @@ -542,12 +559,12 @@ const char* StageName(EShLanguage stage) case EShLangTessControl: return "tessellation control"; case EShLangTessEvaluation: return "tessellation evaluation"; case EShLangGeometry: return "geometry"; - case EShLangRayGenNV: return "ray-generation"; - case EShLangIntersectNV: return "intersection"; - case EShLangAnyHitNV: return "any-hit"; - case EShLangClosestHitNV: return "closest-hit"; - case EShLangMissNV: return "miss"; - case EShLangCallableNV: return "callable"; + case EShLangRayGen: return "ray-generation"; + case EShLangIntersect: return "intersection"; + case EShLangAnyHit: return "any-hit"; + case EShLangClosestHit: return "closest-hit"; + case EShLangMiss: return "miss"; + case EShLangCallable: return "callable"; case EShLangMeshNV: return "mesh"; case EShLangTaskNV: return "task"; #endif @@ -925,8 +942,8 @@ void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) // Call for any operation needing GLSL double data-type support. void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) { - requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, nullptr, op); + //requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader_fp64, op); } // Call for any operation needing GLSL float16 data-type support. diff --git a/core/deps/glslang/glslang/MachineIndependent/Versions.h b/core/deps/glslang/glslang/MachineIndependent/Versions.h index d319a2d54..4e93592eb 100644 --- a/core/deps/glslang/glslang/MachineIndependent/Versions.h +++ b/core/deps/glslang/glslang/MachineIndependent/Versions.h @@ -3,6 +3,7 @@ // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. // Copyright (C) 2015-2018 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -38,6 +39,8 @@ #ifndef _VERSIONS_INCLUDED_ #define _VERSIONS_INCLUDED_ +#define LAST_ELEMENT_MARKER(x) x + // // Help manage multiple profiles, versions, extensions etc. // @@ -54,7 +57,8 @@ typedef enum { ENoProfile = (1 << 0), // only for desktop, before profiles showed up ECoreProfile = (1 << 1), ECompatibilityProfile = (1 << 2), - EEsProfile = (1 << 3) + EEsProfile = (1 << 3), + LAST_ELEMENT_MARKER(EProfileCount), } EProfile; namespace glslang { @@ -136,6 +140,7 @@ const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_con const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64"; +const char* const E_GL_ARB_gpu_shader_fp64 = "GL_ARB_gpu_shader_fp64"; const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot"; const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; @@ -147,6 +152,9 @@ const char* const E_GL_ARB_fragment_shader_interlock = "GL_ARB_fragment_shade const char* const E_GL_ARB_shader_clock = "GL_ARB_shader_clock"; const char* const E_GL_ARB_uniform_buffer_object = "GL_ARB_uniform_buffer_object"; const char* const E_GL_ARB_sample_shading = "GL_ARB_sample_shading"; +const char* const E_GL_ARB_shader_bit_encoding = "GL_ARB_shader_bit_encoding"; +const char* const E_GL_ARB_shader_image_size = "GL_ARB_shader_image_size"; +const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage_buffer_object"; const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; @@ -181,6 +189,10 @@ const char* const E_GL_EXT_buffer_reference2 = "GL_EXT_buffer_ref const char* const E_GL_EXT_buffer_reference_uvec2 = "GL_EXT_buffer_reference_uvec2"; const char* const E_GL_EXT_demote_to_helper_invocation = "GL_EXT_demote_to_helper_invocation"; const char* const E_GL_EXT_shader_realtime_clock = "GL_EXT_shader_realtime_clock"; +const char* const E_GL_EXT_debug_printf = "GL_EXT_debug_printf"; +const char* const E_GL_EXT_ray_tracing = "GL_EXT_ray_tracing"; +const char* const E_GL_EXT_ray_query = "GL_EXT_ray_query"; +const char* const E_GL_EXT_ray_flags_primitive_culling = "GL_EXT_ray_flags_primitive_culling"; // Arrays of extensions for the above viewportEXTs duplications diff --git a/core/deps/glslang/glslang/MachineIndependent/glslang.m4 b/core/deps/glslang/glslang/MachineIndependent/glslang.m4 index 20f2ba40d..1432bf6e8 100644 --- a/core/deps/glslang/glslang/MachineIndependent/glslang.m4 +++ b/core/deps/glslang/glslang/MachineIndependent/glslang.m4 @@ -2,7 +2,8 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2019 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -204,6 +205,8 @@ GLSLANG_WEB_EXCLUDE_ON %token F64MAT4X2 F64MAT4X3 F64MAT4X4 %token ATOMIC_UINT %token ACCSTRUCTNV +%token ACCSTRUCTEXT +%token RAYQUERYEXT %token FCOOPMATNV ICOOPMATNV UCOOPMATNV // combined image/sampler @@ -263,6 +266,7 @@ GLSLANG_WEB_EXCLUDE_OFF %token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN %token MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN %token SUB_ASSIGN +%token STRING_LITERAL %token LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT %token COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT @@ -285,9 +289,10 @@ GLSLANG_WEB_EXCLUDE_ON %token INT64CONSTANT UINT64CONSTANT %token SUBROUTINE DEMOTE %token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV +%token PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT %token PATCH SAMPLE NONUNIFORM %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT -%token SUBGROUPCOHERENT NONPRIVATE +%token SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT %token NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV %token PRECISE GLSLANG_WEB_EXCLUDE_OFF @@ -377,6 +382,9 @@ primary_expression $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); } GLSLANG_WEB_EXCLUDE_ON + | STRING_LITERAL { + $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true); + } | INT32CONSTANT { parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); @@ -402,7 +410,9 @@ GLSLANG_WEB_EXCLUDE_ON $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true); } | DOUBLECONSTANT { - parseContext.doubleCheck($1.loc, "double literal"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double literal"); $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true); } | FLOAT16CONSTANT { @@ -1413,42 +1423,81 @@ GLSLANG_WEB_EXCLUDE_ON } | HITATTRNV { parseContext.globalCheck($1.loc, "hitAttributeNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangClosestHitNVMask - | EShLangAnyHitNVMask), "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); $$.init($1.loc); - $$.qualifier.storage = EvqHitAttrNV; + $$.qualifier.storage = EvqHitAttr; + } + | HITATTREXT { + parseContext.globalCheck($1.loc, "hitAttributeEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitAttr; } | PAYLOADNV { parseContext.globalCheck($1.loc, "rayPayloadNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | - EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); $$.init($1.loc); - $$.qualifier.storage = EvqPayloadNV; + $$.qualifier.storage = EvqPayload; + } + | PAYLOADEXT { + parseContext.globalCheck($1.loc, "rayPayloadEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayload; } | PAYLOADINNV { parseContext.globalCheck($1.loc, "rayPayloadInNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitNVMask | - EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); $$.init($1.loc); - $$.qualifier.storage = EvqPayloadInNV; + $$.qualifier.storage = EvqPayloadIn; + } + | PAYLOADINEXT { + parseContext.globalCheck($1.loc, "rayPayloadInEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayloadIn; } | CALLDATANV { parseContext.globalCheck($1.loc, "callableDataNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | - EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), "callableDataNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); $$.init($1.loc); - $$.qualifier.storage = EvqCallableDataNV; + $$.qualifier.storage = EvqCallableData; + } + | CALLDATAEXT { + parseContext.globalCheck($1.loc, "callableDataEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableData; } | CALLDATAINNV { parseContext.globalCheck($1.loc, "callableDataInNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); $$.init($1.loc); - $$.qualifier.storage = EvqCallableDataInNV; + $$.qualifier.storage = EvqCallableDataIn; + } + | CALLDATAINEXT { + parseContext.globalCheck($1.loc, "callableDataInEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableDataIn; } | COHERENT { $$.init($1.loc); @@ -1479,6 +1528,11 @@ GLSLANG_WEB_EXCLUDE_ON parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); $$.qualifier.nonprivate = true; } + | SHADERCALLCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); + $$.qualifier.shadercallcoherent = true; + } | VOLATILE { $$.init($1.loc); $$.qualifier.volatil = true; @@ -1751,7 +1805,9 @@ type_specifier_nonarray } GLSLANG_WEB_EXCLUDE_ON | DOUBLE { - parseContext.doubleCheck($1.loc, "double"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; } @@ -1811,19 +1867,25 @@ GLSLANG_WEB_EXCLUDE_ON $$.basicType = EbtUint64; } | DVEC2 { - parseContext.doubleCheck($1.loc, "double vector"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setVector(2); } | DVEC3 { - parseContext.doubleCheck($1.loc, "double vector"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setVector(3); } | DVEC4 { - parseContext.doubleCheck($1.loc, "double vector"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setVector(4); @@ -2027,73 +2089,97 @@ GLSLANG_WEB_EXCLUDE_ON $$.setVector(4); } | DMAT2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 2); } | DMAT3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 3); } | DMAT4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 4); } | DMAT2X2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 2); } | DMAT2X3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 3); } | DMAT2X4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 4); } | DMAT3X2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 2); } | DMAT3X3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 3); } | DMAT3X4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 4); } | DMAT4X2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 2); } | DMAT4X3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 3); } | DMAT4X4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 4); @@ -2316,7 +2402,15 @@ GLSLANG_WEB_EXCLUDE_ON } | ACCSTRUCTNV { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtAccStructNV; + $$.basicType = EbtAccStruct; + } + | ACCSTRUCTEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAccStruct; + } + | RAYQUERYEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtRayQuery; } | ATOMIC_UINT { parseContext.vulkanRemoved($1.loc, "atomic counter types"); diff --git a/core/deps/glslang/glslang/MachineIndependent/glslang.y b/core/deps/glslang/glslang/MachineIndependent/glslang.y index e263f3d7a..e33d7d1ca 100644 --- a/core/deps/glslang/glslang/MachineIndependent/glslang.y +++ b/core/deps/glslang/glslang/MachineIndependent/glslang.y @@ -2,7 +2,8 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2013 LunarG, Inc. // Copyright (C) 2017 ARM Limited. -// Copyright (C) 2015-2018 Google, Inc. +// Copyright (C) 2015-2019 Google, Inc. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -204,6 +205,8 @@ extern int yylex(YYSTYPE*, TParseContext&); %token F64MAT4X2 F64MAT4X3 F64MAT4X4 %token ATOMIC_UINT %token ACCSTRUCTNV +%token ACCSTRUCTEXT +%token RAYQUERYEXT %token FCOOPMATNV ICOOPMATNV UCOOPMATNV // combined image/sampler @@ -263,6 +266,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN %token MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN %token SUB_ASSIGN +%token STRING_LITERAL %token LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT %token COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT @@ -285,9 +289,10 @@ extern int yylex(YYSTYPE*, TParseContext&); %token INT64CONSTANT UINT64CONSTANT %token SUBROUTINE DEMOTE %token PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV +%token PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT %token PATCH SAMPLE NONUNIFORM %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT -%token SUBGROUPCOHERENT NONPRIVATE +%token SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT %token NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV %token PRECISE @@ -377,6 +382,9 @@ primary_expression $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true); } + | STRING_LITERAL { + $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true); + } | INT32CONSTANT { parseContext.explicitInt32Check($1.loc, "32-bit signed literal"); $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true); @@ -402,7 +410,9 @@ primary_expression $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true); } | DOUBLECONSTANT { - parseContext.doubleCheck($1.loc, "double literal"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double literal"); $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true); } | FLOAT16CONSTANT { @@ -1413,42 +1423,81 @@ storage_qualifier } | HITATTRNV { parseContext.globalCheck($1.loc, "hitAttributeNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangClosestHitNVMask - | EShLangAnyHitNVMask), "hitAttributeNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); $$.init($1.loc); - $$.qualifier.storage = EvqHitAttrNV; + $$.qualifier.storage = EvqHitAttr; + } + | HITATTREXT { + parseContext.globalCheck($1.loc, "hitAttributeEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV"); + $$.init($1.loc); + $$.qualifier.storage = EvqHitAttr; } | PAYLOADNV { parseContext.globalCheck($1.loc, "rayPayloadNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | - EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); $$.init($1.loc); - $$.qualifier.storage = EvqPayloadNV; + $$.qualifier.storage = EvqPayload; + } + | PAYLOADEXT { + parseContext.globalCheck($1.loc, "rayPayloadEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayload; } | PAYLOADINNV { parseContext.globalCheck($1.loc, "rayPayloadInNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitNVMask | - EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); $$.init($1.loc); - $$.qualifier.storage = EvqPayloadInNV; + $$.qualifier.storage = EvqPayloadIn; + } + | PAYLOADINEXT { + parseContext.globalCheck($1.loc, "rayPayloadInEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqPayloadIn; } | CALLDATANV { parseContext.globalCheck($1.loc, "callableDataNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenNVMask | - EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), "callableDataNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); $$.init($1.loc); - $$.qualifier.storage = EvqCallableDataNV; + $$.qualifier.storage = EvqCallableData; + } + | CALLDATAEXT { + parseContext.globalCheck($1.loc, "callableDataEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableData; } | CALLDATAINNV { parseContext.globalCheck($1.loc, "callableDataInNV"); - parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); $$.init($1.loc); - $$.qualifier.storage = EvqCallableDataInNV; + $$.qualifier.storage = EvqCallableDataIn; + } + | CALLDATAINEXT { + parseContext.globalCheck($1.loc, "callableDataInEXT"); + parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); + parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT"); + $$.init($1.loc); + $$.qualifier.storage = EvqCallableDataIn; } | COHERENT { $$.init($1.loc); @@ -1479,6 +1528,11 @@ storage_qualifier parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); $$.qualifier.nonprivate = true; } + | SHADERCALLCOHERENT { + $$.init($1.loc); + parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); + $$.qualifier.shadercallcoherent = true; + } | VOLATILE { $$.init($1.loc); $$.qualifier.volatil = true; @@ -1751,7 +1805,9 @@ type_specifier_nonarray } | DOUBLE { - parseContext.doubleCheck($1.loc, "double"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; } @@ -1811,19 +1867,25 @@ type_specifier_nonarray $$.basicType = EbtUint64; } | DVEC2 { - parseContext.doubleCheck($1.loc, "double vector"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setVector(2); } | DVEC3 { - parseContext.doubleCheck($1.loc, "double vector"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setVector(3); } | DVEC4 { - parseContext.doubleCheck($1.loc, "double vector"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setVector(4); @@ -2027,73 +2089,97 @@ type_specifier_nonarray $$.setVector(4); } | DMAT2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 2); } | DMAT3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 3); } | DMAT4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 4); } | DMAT2X2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 2); } | DMAT2X3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 3); } | DMAT2X4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(2, 4); } | DMAT3X2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 2); } | DMAT3X3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 3); } | DMAT3X4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(3, 4); } | DMAT4X2 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 2); } | DMAT4X3 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 3); } | DMAT4X4 { - parseContext.doubleCheck($1.loc, "double matrix"); + parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck($1.loc, "double matrix"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtDouble; $$.setMatrix(4, 4); @@ -2316,7 +2402,15 @@ type_specifier_nonarray } | ACCSTRUCTNV { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); - $$.basicType = EbtAccStructNV; + $$.basicType = EbtAccStruct; + } + | ACCSTRUCTEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtAccStruct; + } + | RAYQUERYEXT { + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtRayQuery; } | ATOMIC_UINT { parseContext.vulkanRemoved($1.loc, "atomic counter types"); @@ -3791,3 +3885,4 @@ single_attribute %% + diff --git a/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp b/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp index d2967973d..69f7f8e0b 100644 --- a/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -62,7 +62,7 @@ /* Copy the first part of user declarations. */ -#line 68 "MachineIndependent/glslang.y" /* yacc.c:339 */ +#line 69 "glslang.y" /* yacc.c:339 */ /* Based on: @@ -88,7 +88,7 @@ Jutta Degener, 1995 using namespace glslang; -#line 92 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ +#line 92 "glslang_tab.cpp" /* yacc.c:339 */ # ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus @@ -108,8 +108,8 @@ using namespace glslang; /* In a future release of Bison, this section will be replaced by #include "glslang_tab.cpp.h". */ -#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED -# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -281,256 +281,265 @@ extern int yydebug; 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, - TEXTURE2DMSARRAY = 526, - ITEXTURE2DMSARRAY = 527, - UTEXTURE2DMSARRAY = 528, - F16TEXTURE1D = 529, - F16TEXTURE2D = 530, - F16TEXTURE3D = 531, - F16TEXTURE2DRECT = 532, - F16TEXTURECUBE = 533, - F16TEXTURE1DARRAY = 534, - F16TEXTURE2DARRAY = 535, - F16TEXTURECUBEARRAY = 536, - F16TEXTUREBUFFER = 537, - F16TEXTURE2DMS = 538, - F16TEXTURE2DMSARRAY = 539, - SUBPASSINPUT = 540, - SUBPASSINPUTMS = 541, - ISUBPASSINPUT = 542, - ISUBPASSINPUTMS = 543, - USUBPASSINPUT = 544, - USUBPASSINPUTMS = 545, - F16SUBPASSINPUT = 546, - F16SUBPASSINPUTMS = 547, - LEFT_OP = 548, - RIGHT_OP = 549, - INC_OP = 550, - DEC_OP = 551, - LE_OP = 552, - GE_OP = 553, - EQ_OP = 554, - NE_OP = 555, - AND_OP = 556, - OR_OP = 557, - XOR_OP = 558, - MUL_ASSIGN = 559, - DIV_ASSIGN = 560, - ADD_ASSIGN = 561, - MOD_ASSIGN = 562, - LEFT_ASSIGN = 563, - RIGHT_ASSIGN = 564, - AND_ASSIGN = 565, - XOR_ASSIGN = 566, - OR_ASSIGN = 567, - SUB_ASSIGN = 568, - LEFT_PAREN = 569, - RIGHT_PAREN = 570, - LEFT_BRACKET = 571, - RIGHT_BRACKET = 572, - LEFT_BRACE = 573, - RIGHT_BRACE = 574, - DOT = 575, - COMMA = 576, - COLON = 577, - EQUAL = 578, - SEMICOLON = 579, - BANG = 580, - DASH = 581, - TILDE = 582, - PLUS = 583, - STAR = 584, - SLASH = 585, - PERCENT = 586, - LEFT_ANGLE = 587, - RIGHT_ANGLE = 588, - VERTICAL_BAR = 589, - CARET = 590, - AMPERSAND = 591, - QUESTION = 592, - INVARIANT = 593, - HIGH_PRECISION = 594, - MEDIUM_PRECISION = 595, - LOW_PRECISION = 596, - PRECISION = 597, - PACKED = 598, - RESOURCE = 599, - SUPERP = 600, - FLOATCONSTANT = 601, - INTCONSTANT = 602, - UINTCONSTANT = 603, - BOOLCONSTANT = 604, - IDENTIFIER = 605, - TYPE_NAME = 606, - CENTROID = 607, - IN = 608, - OUT = 609, - INOUT = 610, - STRUCT = 611, - VOID = 612, - WHILE = 613, - BREAK = 614, - CONTINUE = 615, - DO = 616, - ELSE = 617, - FOR = 618, - IF = 619, - DISCARD = 620, - RETURN = 621, - SWITCH = 622, - CASE = 623, - DEFAULT = 624, - UNIFORM = 625, - SHARED = 626, - 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, - RESTRICT = 651, - READONLY = 652, - WRITEONLY = 653, - DEVICECOHERENT = 654, - QUEUEFAMILYCOHERENT = 655, - WORKGROUPCOHERENT = 656, - SUBGROUPCOHERENT = 657, - NONPRIVATE = 658, - NOPERSPECTIVE = 659, - EXPLICITINTERPAMD = 660, - PERVERTEXNV = 661, - PERPRIMITIVENV = 662, - PERVIEWNV = 663, - PERTASKNV = 664, - PRECISE = 665 + ACCSTRUCTEXT = 416, + RAYQUERYEXT = 417, + FCOOPMATNV = 418, + ICOOPMATNV = 419, + UCOOPMATNV = 420, + SAMPLERCUBEARRAY = 421, + SAMPLERCUBEARRAYSHADOW = 422, + ISAMPLERCUBEARRAY = 423, + USAMPLERCUBEARRAY = 424, + SAMPLER1D = 425, + SAMPLER1DARRAY = 426, + SAMPLER1DARRAYSHADOW = 427, + ISAMPLER1D = 428, + SAMPLER1DSHADOW = 429, + SAMPLER2DRECT = 430, + SAMPLER2DRECTSHADOW = 431, + ISAMPLER2DRECT = 432, + USAMPLER2DRECT = 433, + SAMPLERBUFFER = 434, + ISAMPLERBUFFER = 435, + USAMPLERBUFFER = 436, + SAMPLER2DMS = 437, + ISAMPLER2DMS = 438, + USAMPLER2DMS = 439, + SAMPLER2DMSARRAY = 440, + ISAMPLER2DMSARRAY = 441, + USAMPLER2DMSARRAY = 442, + SAMPLEREXTERNALOES = 443, + SAMPLEREXTERNAL2DY2YEXT = 444, + ISAMPLER1DARRAY = 445, + USAMPLER1D = 446, + USAMPLER1DARRAY = 447, + F16SAMPLER1D = 448, + F16SAMPLER2D = 449, + F16SAMPLER3D = 450, + F16SAMPLER2DRECT = 451, + F16SAMPLERCUBE = 452, + F16SAMPLER1DARRAY = 453, + F16SAMPLER2DARRAY = 454, + F16SAMPLERCUBEARRAY = 455, + F16SAMPLERBUFFER = 456, + F16SAMPLER2DMS = 457, + F16SAMPLER2DMSARRAY = 458, + F16SAMPLER1DSHADOW = 459, + F16SAMPLER2DSHADOW = 460, + F16SAMPLER1DARRAYSHADOW = 461, + F16SAMPLER2DARRAYSHADOW = 462, + F16SAMPLER2DRECTSHADOW = 463, + F16SAMPLERCUBESHADOW = 464, + F16SAMPLERCUBEARRAYSHADOW = 465, + IMAGE1D = 466, + IIMAGE1D = 467, + UIMAGE1D = 468, + IMAGE2D = 469, + IIMAGE2D = 470, + UIMAGE2D = 471, + IMAGE3D = 472, + IIMAGE3D = 473, + UIMAGE3D = 474, + IMAGE2DRECT = 475, + IIMAGE2DRECT = 476, + UIMAGE2DRECT = 477, + IMAGECUBE = 478, + IIMAGECUBE = 479, + UIMAGECUBE = 480, + IMAGEBUFFER = 481, + IIMAGEBUFFER = 482, + UIMAGEBUFFER = 483, + IMAGE1DARRAY = 484, + IIMAGE1DARRAY = 485, + UIMAGE1DARRAY = 486, + IMAGE2DARRAY = 487, + IIMAGE2DARRAY = 488, + UIMAGE2DARRAY = 489, + IMAGECUBEARRAY = 490, + IIMAGECUBEARRAY = 491, + UIMAGECUBEARRAY = 492, + IMAGE2DMS = 493, + IIMAGE2DMS = 494, + UIMAGE2DMS = 495, + IMAGE2DMSARRAY = 496, + IIMAGE2DMSARRAY = 497, + UIMAGE2DMSARRAY = 498, + F16IMAGE1D = 499, + F16IMAGE2D = 500, + F16IMAGE3D = 501, + F16IMAGE2DRECT = 502, + F16IMAGECUBE = 503, + F16IMAGE1DARRAY = 504, + F16IMAGE2DARRAY = 505, + F16IMAGECUBEARRAY = 506, + F16IMAGEBUFFER = 507, + F16IMAGE2DMS = 508, + F16IMAGE2DMSARRAY = 509, + TEXTURECUBEARRAY = 510, + ITEXTURECUBEARRAY = 511, + UTEXTURECUBEARRAY = 512, + TEXTURE1D = 513, + ITEXTURE1D = 514, + UTEXTURE1D = 515, + TEXTURE1DARRAY = 516, + ITEXTURE1DARRAY = 517, + UTEXTURE1DARRAY = 518, + TEXTURE2DRECT = 519, + ITEXTURE2DRECT = 520, + UTEXTURE2DRECT = 521, + TEXTUREBUFFER = 522, + ITEXTUREBUFFER = 523, + UTEXTUREBUFFER = 524, + TEXTURE2DMS = 525, + ITEXTURE2DMS = 526, + UTEXTURE2DMS = 527, + TEXTURE2DMSARRAY = 528, + ITEXTURE2DMSARRAY = 529, + UTEXTURE2DMSARRAY = 530, + F16TEXTURE1D = 531, + F16TEXTURE2D = 532, + F16TEXTURE3D = 533, + F16TEXTURE2DRECT = 534, + F16TEXTURECUBE = 535, + F16TEXTURE1DARRAY = 536, + F16TEXTURE2DARRAY = 537, + F16TEXTURECUBEARRAY = 538, + F16TEXTUREBUFFER = 539, + F16TEXTURE2DMS = 540, + F16TEXTURE2DMSARRAY = 541, + SUBPASSINPUT = 542, + SUBPASSINPUTMS = 543, + ISUBPASSINPUT = 544, + ISUBPASSINPUTMS = 545, + USUBPASSINPUT = 546, + USUBPASSINPUTMS = 547, + F16SUBPASSINPUT = 548, + F16SUBPASSINPUTMS = 549, + LEFT_OP = 550, + RIGHT_OP = 551, + INC_OP = 552, + DEC_OP = 553, + LE_OP = 554, + GE_OP = 555, + EQ_OP = 556, + NE_OP = 557, + AND_OP = 558, + OR_OP = 559, + XOR_OP = 560, + MUL_ASSIGN = 561, + DIV_ASSIGN = 562, + ADD_ASSIGN = 563, + MOD_ASSIGN = 564, + LEFT_ASSIGN = 565, + RIGHT_ASSIGN = 566, + AND_ASSIGN = 567, + XOR_ASSIGN = 568, + OR_ASSIGN = 569, + SUB_ASSIGN = 570, + STRING_LITERAL = 571, + LEFT_PAREN = 572, + RIGHT_PAREN = 573, + LEFT_BRACKET = 574, + RIGHT_BRACKET = 575, + LEFT_BRACE = 576, + RIGHT_BRACE = 577, + DOT = 578, + COMMA = 579, + COLON = 580, + EQUAL = 581, + SEMICOLON = 582, + BANG = 583, + DASH = 584, + TILDE = 585, + PLUS = 586, + STAR = 587, + SLASH = 588, + PERCENT = 589, + LEFT_ANGLE = 590, + RIGHT_ANGLE = 591, + VERTICAL_BAR = 592, + CARET = 593, + AMPERSAND = 594, + QUESTION = 595, + INVARIANT = 596, + HIGH_PRECISION = 597, + MEDIUM_PRECISION = 598, + LOW_PRECISION = 599, + PRECISION = 600, + PACKED = 601, + RESOURCE = 602, + SUPERP = 603, + FLOATCONSTANT = 604, + INTCONSTANT = 605, + UINTCONSTANT = 606, + BOOLCONSTANT = 607, + IDENTIFIER = 608, + TYPE_NAME = 609, + CENTROID = 610, + IN = 611, + OUT = 612, + INOUT = 613, + STRUCT = 614, + VOID = 615, + WHILE = 616, + BREAK = 617, + CONTINUE = 618, + DO = 619, + ELSE = 620, + FOR = 621, + IF = 622, + DISCARD = 623, + RETURN = 624, + SWITCH = 625, + CASE = 626, + DEFAULT = 627, + UNIFORM = 628, + SHARED = 629, + BUFFER = 630, + FLAT = 631, + SMOOTH = 632, + LAYOUT = 633, + DOUBLECONSTANT = 634, + INT16CONSTANT = 635, + UINT16CONSTANT = 636, + FLOAT16CONSTANT = 637, + INT32CONSTANT = 638, + UINT32CONSTANT = 639, + INT64CONSTANT = 640, + UINT64CONSTANT = 641, + SUBROUTINE = 642, + DEMOTE = 643, + PAYLOADNV = 644, + PAYLOADINNV = 645, + HITATTRNV = 646, + CALLDATANV = 647, + CALLDATAINNV = 648, + PAYLOADEXT = 649, + PAYLOADINEXT = 650, + HITATTREXT = 651, + CALLDATAEXT = 652, + CALLDATAINEXT = 653, + PATCH = 654, + SAMPLE = 655, + NONUNIFORM = 656, + COHERENT = 657, + VOLATILE = 658, + RESTRICT = 659, + READONLY = 660, + WRITEONLY = 661, + DEVICECOHERENT = 662, + QUEUEFAMILYCOHERENT = 663, + WORKGROUPCOHERENT = 664, + SUBGROUPCOHERENT = 665, + NONPRIVATE = 666, + SHADERCALLCOHERENT = 667, + NOPERSPECTIVE = 668, + EXPLICITINTERPAMD = 669, + PERVERTEXNV = 670, + PERPRIMITIVENV = 671, + PERVIEWNV = 672, + PERTASKNV = 673, + PRECISE = 674 }; #endif @@ -539,7 +548,7 @@ extern int yydebug; union YYSTYPE { -#line 96 "MachineIndependent/glslang.y" /* yacc.c:355 */ +#line 97 "glslang.y" /* yacc.c:355 */ struct { glslang::TSourceLoc loc; @@ -575,7 +584,7 @@ union YYSTYPE glslang::TArraySizes* typeParameters; } interm; -#line 579 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +#line 588 "glslang_tab.cpp" /* yacc.c:355 */ }; typedef union YYSTYPE YYSTYPE; @@ -587,10 +596,10 @@ typedef union YYSTYPE YYSTYPE; int yyparse (glslang::TParseContext* pParseContext); -#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ +#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */ /* Copy the second part of user declarations. */ -#line 132 "MachineIndependent/glslang.y" /* yacc.c:358 */ +#line 133 "glslang.y" /* yacc.c:358 */ /* windows only pragma */ @@ -606,7 +615,7 @@ int yyparse (glslang::TParseContext* pParseContext); extern int yylex(YYSTYPE*, TParseContext&); -#line 610 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ +#line 619 "glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -846,23 +855,23 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 386 +#define YYFINAL 394 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 9369 +#define YYLAST 9550 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 411 +#define YYNTOKENS 420 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 111 /* YYNRULES -- Number of rules. */ -#define YYNRULES 582 +#define YYNRULES 591 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 727 +#define YYNSTATES 736 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 665 +#define YYMAXUTOK 674 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -937,72 +946,74 @@ static const yytype_uint16 yytranslate[] = 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 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 + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 352, 352, 358, 361, 366, 369, 372, 376, 380, - 384, 388, 392, 396, 400, 404, 408, 416, 419, 422, - 425, 428, 433, 441, 448, 455, 461, 465, 472, 475, - 481, 488, 498, 506, 511, 539, 548, 554, 558, 562, - 582, 583, 584, 585, 591, 592, 597, 602, 611, 612, - 617, 625, 626, 632, 641, 642, 647, 652, 657, 665, - 666, 675, 687, 688, 697, 698, 707, 708, 717, 718, - 726, 727, 735, 736, 744, 745, 745, 763, 764, 780, - 784, 788, 792, 797, 801, 805, 809, 813, 817, 821, - 828, 831, 842, 849, 854, 859, 866, 870, 874, 878, - 883, 888, 897, 897, 908, 912, 919, 926, 929, 936, - 944, 964, 987, 1002, 1027, 1038, 1048, 1058, 1068, 1077, - 1080, 1084, 1088, 1093, 1101, 1108, 1113, 1118, 1123, 1132, - 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, 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, - 1612, 1616, 1620, 1625, 1629, 1634, 1639, 1644, 1649, 1654, - 1659, 1664, 1669, 1674, 1680, 1686, 1692, 1697, 1702, 1707, - 1712, 1717, 1722, 1727, 1732, 1737, 1742, 1747, 1753, 1758, - 1763, 1768, 1773, 1778, 1783, 1788, 1793, 1798, 1803, 1808, - 1813, 1819, 1825, 1831, 1837, 1843, 1849, 1855, 1861, 1867, - 1873, 1879, 1885, 1891, 1897, 1903, 1909, 1915, 1921, 1927, - 1933, 1939, 1945, 1951, 1957, 1963, 1969, 1975, 1981, 1987, - 1993, 1999, 2005, 2011, 2017, 2023, 2029, 2035, 2041, 2047, - 2053, 2059, 2065, 2071, 2077, 2083, 2089, 2095, 2101, 2107, - 2113, 2119, 2125, 2131, 2137, 2143, 2149, 2155, 2161, 2167, - 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, 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 + 0, 357, 357, 363, 366, 371, 374, 377, 381, 385, + 388, 392, 396, 400, 404, 408, 412, 418, 426, 429, + 432, 435, 438, 443, 451, 458, 465, 471, 475, 482, + 485, 491, 498, 508, 516, 521, 549, 558, 564, 568, + 572, 592, 593, 594, 595, 601, 602, 607, 612, 621, + 622, 627, 635, 636, 642, 651, 652, 657, 662, 667, + 675, 676, 685, 697, 698, 707, 708, 717, 718, 727, + 728, 736, 737, 745, 746, 754, 755, 755, 773, 774, + 790, 794, 798, 802, 807, 811, 815, 819, 823, 827, + 831, 838, 841, 852, 859, 864, 869, 876, 880, 884, + 888, 893, 898, 907, 907, 918, 922, 929, 936, 939, + 946, 954, 974, 997, 1012, 1037, 1048, 1058, 1068, 1078, + 1087, 1090, 1094, 1098, 1103, 1111, 1118, 1123, 1128, 1133, + 1142, 1152, 1179, 1188, 1195, 1203, 1210, 1217, 1225, 1235, + 1242, 1253, 1259, 1262, 1269, 1273, 1277, 1286, 1296, 1299, + 1310, 1313, 1316, 1320, 1324, 1329, 1333, 1340, 1344, 1349, + 1355, 1361, 1368, 1373, 1381, 1387, 1399, 1413, 1419, 1424, + 1432, 1440, 1448, 1456, 1464, 1472, 1480, 1488, 1495, 1502, + 1506, 1511, 1516, 1521, 1526, 1531, 1536, 1540, 1544, 1548, + 1552, 1558, 1569, 1576, 1579, 1588, 1593, 1603, 1608, 1616, + 1620, 1630, 1633, 1639, 1645, 1652, 1662, 1666, 1670, 1674, + 1679, 1683, 1688, 1693, 1698, 1703, 1708, 1713, 1718, 1723, + 1728, 1734, 1740, 1746, 1751, 1756, 1761, 1766, 1771, 1776, + 1781, 1786, 1791, 1796, 1801, 1807, 1814, 1819, 1824, 1829, + 1834, 1839, 1844, 1849, 1854, 1859, 1864, 1869, 1877, 1885, + 1893, 1899, 1905, 1911, 1917, 1923, 1929, 1935, 1941, 1947, + 1953, 1959, 1965, 1971, 1977, 1983, 1989, 1995, 2001, 2007, + 2013, 2019, 2025, 2031, 2037, 2043, 2049, 2055, 2061, 2067, + 2073, 2079, 2085, 2091, 2099, 2107, 2115, 2123, 2131, 2139, + 2147, 2155, 2163, 2171, 2179, 2187, 2193, 2199, 2205, 2211, + 2217, 2223, 2229, 2235, 2241, 2247, 2253, 2259, 2265, 2271, + 2277, 2283, 2289, 2295, 2301, 2307, 2313, 2319, 2325, 2331, + 2337, 2343, 2349, 2355, 2361, 2367, 2373, 2379, 2385, 2391, + 2397, 2403, 2407, 2411, 2415, 2420, 2426, 2431, 2436, 2441, + 2446, 2451, 2456, 2462, 2467, 2472, 2477, 2482, 2487, 2493, + 2499, 2505, 2511, 2517, 2523, 2529, 2535, 2541, 2547, 2553, + 2559, 2565, 2571, 2576, 2581, 2586, 2591, 2596, 2601, 2607, + 2612, 2617, 2622, 2627, 2632, 2637, 2642, 2648, 2653, 2658, + 2663, 2668, 2673, 2678, 2683, 2688, 2693, 2698, 2703, 2708, + 2713, 2718, 2724, 2729, 2734, 2740, 2746, 2751, 2756, 2761, + 2767, 2772, 2777, 2782, 2788, 2793, 2798, 2803, 2809, 2814, + 2819, 2824, 2830, 2836, 2842, 2848, 2853, 2859, 2865, 2871, + 2876, 2881, 2886, 2891, 2896, 2902, 2907, 2912, 2917, 2923, + 2928, 2933, 2938, 2944, 2949, 2954, 2959, 2965, 2970, 2975, + 2980, 2986, 2991, 2996, 3001, 3007, 3012, 3017, 3022, 3028, + 3033, 3038, 3043, 3049, 3054, 3059, 3064, 3070, 3075, 3080, + 3085, 3091, 3096, 3101, 3106, 3112, 3117, 3122, 3127, 3133, + 3138, 3143, 3148, 3154, 3159, 3164, 3169, 3175, 3180, 3185, + 3190, 3196, 3201, 3206, 3212, 3218, 3224, 3230, 3237, 3244, + 3250, 3256, 3262, 3268, 3274, 3280, 3287, 3292, 3308, 3313, + 3318, 3326, 3326, 3337, 3337, 3347, 3350, 3363, 3385, 3412, + 3416, 3422, 3427, 3438, 3442, 3448, 3459, 3462, 3469, 3473, + 3474, 3480, 3481, 3482, 3483, 3484, 3485, 3486, 3488, 3494, + 3503, 3504, 3508, 3504, 3520, 3521, 3525, 3525, 3532, 3532, + 3546, 3549, 3557, 3565, 3576, 3577, 3581, 3585, 3592, 3599, + 3603, 3611, 3615, 3628, 3632, 3639, 3639, 3659, 3662, 3668, + 3680, 3692, 3696, 3703, 3703, 3718, 3718, 3734, 3734, 3755, + 3758, 3764, 3767, 3773, 3777, 3784, 3789, 3794, 3801, 3804, + 3813, 3817, 3826, 3829, 3833, 3842, 3842, 3865, 3871, 3874, + 3879, 3882 }; #endif @@ -1039,16 +1050,17 @@ static const char *const yytname[] = "F32MAT3X2", "F32MAT3X3", "F32MAT3X4", "F32MAT4X2", "F32MAT4X3", "F32MAT4X4", "F64MAT2X2", "F64MAT2X3", "F64MAT2X4", "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", "F64MAT4X4", - "ATOMIC_UINT", "ACCSTRUCTNV", "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV", - "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", + "ATOMIC_UINT", "ACCSTRUCTNV", "ACCSTRUCTEXT", "RAYQUERYEXT", + "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV", "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", @@ -1078,28 +1090,30 @@ static const char *const yytname[] = "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", + "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "STRING_LITERAL", + "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", "PAYLOADEXT", + "PAYLOADINEXT", "HITATTREXT", "CALLDATAEXT", "CALLDATAINEXT", "PATCH", + "SAMPLE", "NONUNIFORM", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", "WRITEONLY", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT", - "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", "NOPERSPECTIVE", - "EXPLICITINTERPAMD", "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV", - "PERTASKNV", "PRECISE", "$accept", "variable_identifier", - "primary_expression", "postfix_expression", "integer_expression", - "function_call", "function_call_or_method", "function_call_generic", + "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", + "SHADERCALLCOHERENT", "NOPERSPECTIVE", "EXPLICITINTERPAMD", + "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV", "PERTASKNV", "PRECISE", + "$accept", "variable_identifier", "primary_expression", + "postfix_expression", "integer_expression", "function_call", + "function_call_or_method", "function_call_generic", "function_call_header_no_parameters", "function_call_header_with_parameters", "function_call_header", "function_identifier", "unary_expression", "unary_operator", @@ -1185,16 +1199,16 @@ static const yytype_uint16 yytoknum[] = 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, - 665 + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674 }; # endif -#define YYPACT_NINF -453 +#define YYPACT_NINF -457 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-453))) + (!!((Yystate) == (-457))) -#define YYTABLE_NINF -528 +#define YYTABLE_NINF -537 #define yytable_value_is_error(Yytable_value) \ 0 @@ -1203,79 +1217,80 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 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, -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 + 4075, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, 132, -457, + -457, -457, -457, -457, -1, -457, -457, -457, -457, -457, + -457, -301, -298, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, 11, -249, 17, 30, 6160, + 20, -457, 28, -457, -457, -457, -457, 4492, -457, -457, + -457, -457, 50, -457, -457, 739, -457, -457, 16, -457, + 81, -29, 69, -457, -313, -457, 111, -457, 6160, -457, + -457, -457, 6160, 103, 106, -457, -314, -457, 72, -457, + -457, 8566, 142, -457, -457, -457, 136, 6160, -457, 144, + -457, 53, -457, -457, 76, 6974, -457, -312, 1156, -457, + -457, -457, -457, 142, -309, -457, 7372, -308, -457, 119, + -457, 65, 8566, 8566, -457, 8566, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, -457, 36, -457, -457, -457, 171, + 85, 8964, 173, -457, 8566, -457, -457, -323, 174, -457, + 6160, 139, 4909, -457, 6160, 8566, -457, -29, -457, 141, + -457, -457, 145, 99, 35, 26, 71, 156, 159, 161, + 196, 195, 23, 181, 7770, -457, 183, 182, -457, -457, + 186, 179, 180, -457, 191, 192, 187, 8168, 193, 8566, + 188, 189, 127, -457, -457, 96, -457, -249, 200, 201, + -457, -457, -457, -457, -457, 1573, -457, -457, -457, -457, + -457, -457, -457, -457, -457, -24, 174, 7372, 13, 7372, + -457, -457, 7372, 6160, -457, 166, -457, -457, -457, 86, + -457, -457, 8566, 168, -457, -457, 8566, 205, -457, -457, + -457, 8566, -457, 139, 142, 124, -457, -457, -457, 5326, + -457, -457, -457, -457, 8566, 8566, 8566, 8566, 8566, 8566, + 8566, 8566, 8566, 8566, 8566, 8566, 8566, 8566, 8566, 8566, + 8566, 8566, 8566, -457, -457, -457, 206, 172, -457, 1990, + -457, -457, -457, 1990, -457, 8566, -457, -457, 130, 8566, + 125, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, -457, -457, 8566, 8566, -457, -457, -457, -457, + -457, -457, -457, 7372, -457, 94, -457, 5743, -457, -457, + 207, 204, -457, -457, -457, 131, 174, 139, -457, -457, + -457, -457, -457, 145, 145, 99, 99, 35, 35, 35, + 35, 26, 26, 71, 156, 159, 161, 196, 195, 8566, + -457, 212, 60, -457, 1990, 3658, 169, 3241, 87, -457, + 89, -457, -457, -457, -457, -457, 6576, -457, -457, -457, + -457, 143, 8566, 211, 172, 210, 204, 184, 6160, 217, + 219, -457, -457, 3658, 218, -457, -457, -457, 8566, 220, + -457, -457, -457, 214, 2407, 8566, -457, 216, 223, 185, + 224, 2824, -457, 225, -457, -457, 7372, -457, -457, -457, + 97, 8566, 2407, 218, -457, -457, 1990, -457, 222, 204, + -457, -457, 1990, 229, -457, -457 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1283,113 +1298,114 @@ static const yytype_int16 yypact[] = means the default is an error. */ 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, 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, - 269, 252, 253, 254, 264, 265, 266, 240, 241, 242, - 276, 277, 278, 243, 244, 245, 288, 289, 290, 246, - 247, 248, 300, 301, 302, 249, 250, 251, 312, 313, - 314, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 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, 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, 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, - 147, 149, 155, 129, 195, 151, 487, 0, 571, 573, - 0, 494, 0, 0, 0, 96, 0, 93, 0, 106, - 0, 115, 109, 117, 0, 118, 0, 94, 125, 99, - 0, 148, 130, 0, 188, 194, 1, 572, 0, 0, - 492, 143, 145, 0, 141, 186, 0, 0, 97, 0, - 0, 577, 110, 114, 116, 112, 120, 111, 0, 126, - 102, 0, 100, 0, 0, 0, 0, 42, 41, 43, - 40, 5, 6, 7, 8, 2, 15, 13, 14, 16, - 9, 10, 11, 12, 3, 17, 36, 19, 24, 25, - 0, 0, 29, 0, 197, 0, 35, 33, 0, 189, - 95, 0, 0, 0, 496, 0, 0, 140, 0, 184, - 0, 190, 44, 48, 51, 54, 59, 62, 64, 66, - 68, 70, 72, 74, 0, 0, 98, 0, 522, 531, - 535, 0, 0, 0, 556, 0, 0, 0, 0, 0, - 0, 0, 0, 44, 77, 90, 0, 509, 0, 155, - 129, 512, 533, 511, 519, 510, 0, 513, 514, 537, - 515, 544, 516, 517, 552, 518, 0, 113, 0, 121, - 0, 504, 128, 0, 0, 104, 0, 101, 37, 38, - 0, 21, 22, 0, 0, 27, 26, 0, 199, 30, - 32, 39, 0, 196, 0, 502, 0, 500, 495, 497, - 0, 92, 144, 142, 187, 0, 0, 0, 0, 0, + 0, 157, 210, 208, 209, 207, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 211, 212, 213, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 336, 337, 338, 339, 340, 341, 342, 362, 363, 364, + 365, 366, 367, 368, 377, 390, 391, 378, 379, 381, + 380, 382, 383, 384, 385, 386, 387, 388, 389, 165, + 166, 236, 237, 235, 238, 245, 246, 243, 244, 241, + 242, 239, 240, 268, 269, 270, 280, 281, 282, 265, + 266, 267, 277, 278, 279, 262, 263, 264, 274, 275, + 276, 259, 260, 261, 271, 272, 273, 247, 248, 249, + 283, 284, 285, 250, 251, 252, 295, 296, 297, 253, + 254, 255, 307, 308, 309, 256, 257, 258, 319, 320, + 321, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 310, + 311, 312, 313, 314, 315, 316, 317, 318, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 334, 331, 332, + 333, 493, 494, 495, 346, 347, 370, 373, 335, 344, + 345, 361, 343, 392, 393, 396, 397, 398, 400, 401, + 402, 404, 405, 406, 408, 409, 483, 484, 369, 371, + 372, 348, 349, 350, 394, 351, 355, 356, 359, 399, + 403, 407, 352, 353, 357, 358, 395, 354, 360, 439, + 441, 442, 443, 445, 446, 447, 449, 450, 451, 453, + 454, 455, 457, 458, 459, 461, 462, 463, 465, 466, + 467, 469, 470, 471, 473, 474, 475, 477, 478, 479, + 481, 482, 440, 444, 448, 452, 456, 464, 468, 472, + 460, 476, 480, 374, 375, 376, 410, 419, 421, 415, + 420, 422, 423, 425, 426, 427, 429, 430, 431, 433, + 434, 435, 437, 438, 411, 412, 413, 424, 414, 416, + 417, 418, 428, 432, 436, 485, 486, 489, 490, 491, + 492, 487, 488, 584, 132, 498, 499, 500, 0, 497, + 161, 159, 160, 158, 0, 206, 162, 163, 164, 134, + 133, 0, 190, 171, 173, 169, 175, 177, 172, 174, + 170, 176, 178, 167, 168, 192, 179, 186, 187, 188, + 189, 180, 181, 182, 183, 184, 185, 135, 136, 137, + 138, 139, 140, 147, 583, 0, 585, 0, 109, 108, + 0, 120, 125, 154, 153, 151, 155, 0, 148, 150, + 156, 130, 202, 152, 496, 0, 580, 582, 0, 503, + 0, 0, 0, 97, 0, 94, 0, 107, 0, 116, + 110, 118, 0, 119, 0, 95, 126, 100, 0, 149, + 131, 0, 195, 201, 1, 581, 0, 0, 501, 144, + 146, 0, 142, 193, 0, 0, 98, 0, 0, 586, + 111, 115, 117, 113, 121, 112, 0, 127, 103, 0, + 101, 0, 0, 0, 9, 0, 43, 42, 44, 41, + 5, 6, 7, 8, 2, 16, 14, 15, 17, 10, + 11, 12, 13, 3, 18, 37, 20, 25, 26, 0, + 0, 30, 0, 204, 0, 36, 34, 0, 196, 96, + 0, 0, 0, 505, 0, 0, 141, 0, 191, 0, + 197, 45, 49, 52, 55, 60, 63, 65, 67, 69, + 71, 73, 75, 0, 0, 99, 0, 531, 540, 544, + 0, 0, 0, 565, 0, 0, 0, 0, 0, 0, + 0, 0, 45, 78, 91, 0, 518, 0, 156, 130, + 521, 542, 520, 528, 519, 0, 522, 523, 546, 524, + 553, 525, 526, 561, 527, 0, 114, 0, 122, 0, + 513, 129, 0, 0, 105, 0, 102, 38, 39, 0, + 22, 23, 0, 0, 28, 27, 0, 206, 31, 33, + 40, 0, 203, 0, 511, 0, 509, 504, 506, 0, + 93, 145, 143, 194, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 75, 191, 192, 0, 0, 521, - 0, 554, 567, 566, 0, 558, 0, 570, 568, 0, - 0, 0, 551, 520, 80, 81, 83, 82, 85, 86, - 87, 88, 89, 84, 79, 0, 0, 536, 532, 534, - 538, 545, 553, 123, 0, 507, 0, 127, 0, 105, - 4, 0, 23, 20, 31, 198, 0, 503, 0, 498, - 493, 45, 46, 47, 50, 49, 52, 53, 57, 58, - 55, 56, 60, 61, 63, 65, 67, 69, 71, 73, - 0, 193, 581, 0, 579, 523, 0, 0, 0, 0, - 569, 0, 550, 78, 91, 122, 505, 0, 103, 18, - 499, 501, 0, 0, 0, 0, 0, 542, 0, 0, - 0, 0, 561, 560, 563, 529, 546, 506, 508, 0, - 0, 578, 580, 524, 0, 0, 0, 562, 0, 0, - 541, 0, 0, 539, 0, 76, 582, 0, 526, 555, - 525, 0, 564, 0, 529, 528, 530, 548, 543, 0, - 565, 559, 540, 549, 0, 557, 547 + 0, 0, 0, 76, 198, 199, 0, 0, 530, 0, + 563, 576, 575, 0, 567, 0, 579, 577, 0, 0, + 0, 560, 529, 81, 82, 84, 83, 86, 87, 88, + 89, 90, 85, 80, 0, 0, 545, 541, 543, 547, + 554, 562, 124, 0, 516, 0, 128, 0, 106, 4, + 0, 24, 21, 32, 205, 0, 512, 0, 507, 502, + 46, 47, 48, 51, 50, 53, 54, 58, 59, 56, + 57, 61, 62, 64, 66, 68, 70, 72, 74, 0, + 200, 590, 0, 588, 532, 0, 0, 0, 0, 578, + 0, 559, 79, 92, 123, 514, 0, 104, 19, 508, + 510, 0, 0, 0, 0, 0, 551, 0, 0, 0, + 0, 570, 569, 572, 538, 555, 515, 517, 0, 0, + 587, 589, 533, 0, 0, 0, 571, 0, 0, 550, + 0, 0, 548, 0, 77, 591, 0, 535, 564, 534, + 0, 573, 0, 538, 537, 539, 557, 552, 0, 574, + 568, 549, 558, 0, 566, 556 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -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 + -457, -457, -457, -457, -457, -457, -457, -457, -457, -457, + -457, -457, 8868, -457, -87, -84, -127, -93, -33, -31, + -27, -25, -28, -26, -457, -86, -457, -103, -457, -111, + -125, 2, -457, -457, -457, 4, -457, -457, -457, 176, + 194, 178, -457, -457, -337, -457, -457, -457, -457, 95, + -457, -37, -46, -457, 9, -457, 0, -63, -457, -457, + -457, -457, 263, -457, -457, -457, -456, -140, 10, -73, + -211, -457, -102, -198, -321, -457, -144, -457, -457, -155, + -154, -457, -457, 198, -274, -97, -457, 46, -457, -118, + -457, 51, -457, -457, -457, -457, 52, -457, -457, -457, + -457, -457, -457, -457, -457, 213, -457, -457, -457, -457, + -105 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 434, 435, 436, 621, 437, 438, 439, 440, 441, - 442, 443, 493, 445, 463, 464, 465, 466, 467, 468, - 469, 470, 471, 472, 473, 494, 650, 495, 605, 496, - 552, 497, 337, 524, 413, 498, 339, 340, 341, 371, - 372, 373, 342, 343, 344, 345, 346, 347, 393, 394, - 348, 349, 350, 351, 446, 396, 447, 399, 384, 385, - 448, 354, 355, 356, 455, 389, 453, 454, 546, 547, - 522, 616, 501, 502, 503, 504, 505, 580, 676, 709, - 700, 701, 702, 710, 506, 507, 508, 509, 703, 680, - 510, 511, 704, 724, 512, 513, 514, 656, 584, 658, - 684, 698, 699, 515, 357, 358, 359, 368, 516, 653, - 654 + -1, 443, 444, 445, 630, 446, 447, 448, 449, 450, + 451, 452, 502, 454, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 503, 659, 504, 614, 505, + 561, 506, 345, 533, 421, 507, 347, 348, 349, 379, + 380, 381, 350, 351, 352, 353, 354, 355, 401, 402, + 356, 357, 358, 359, 455, 404, 456, 407, 392, 393, + 457, 362, 363, 364, 464, 397, 462, 463, 555, 556, + 531, 625, 510, 511, 512, 513, 514, 589, 685, 718, + 709, 710, 711, 719, 515, 516, 517, 518, 712, 689, + 519, 520, 713, 733, 521, 522, 523, 665, 593, 667, + 693, 707, 708, 524, 365, 366, 367, 376, 525, 662, + 663 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1397,161 +1413,122 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 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, 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, - 0, 0, 0, 0, 0, 0, 0, 352, 0, 0, - 0, 0, 0, 0, 0, 381, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 679, 0, 0, - 0, 0, 0, 0, 0, 500, 500, 0, 500, 0, - 0, 0, 0, 0, 499, 499, 0, 499, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 382, - 0, 0, 0, 0, 500, 0, 0, 0, 352, 0, - 0, 0, 0, 499, 0, 500, 0, 0, 0, 0, - 0, 0, 500, 0, 499, 0, 0, 0, 0, 0, - 0, 499, 0, 500, 0, 0, 0, 500, 0, 0, - 0, 0, 499, 500, 0, 0, 499, 0, 0, 0, - 386, 0, 499, 1, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 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, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 0, 0, 0, 0, 0, 0, 0, + 361, 551, 344, 415, 346, 405, 405, 484, 559, 360, + 405, 484, 416, 552, 406, 485, 371, 527, 532, 372, + 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, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 627, 375, 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, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 389, 382, 530, 539, 664, 622, 618, 624, 483, + 369, 626, 558, 417, 399, 571, 572, 582, 687, 458, + 569, 570, 484, 540, 541, 377, 389, 490, 373, 623, + 493, 382, 494, 495, 384, 400, 498, 385, 548, 383, + 526, 528, 370, -35, 378, 542, 687, 390, 360, 543, + 460, 573, 574, 583, 374, 361, 360, 344, 396, 346, + 299, 466, 575, 576, 360, 304, 305, 467, 383, 560, + 683, 386, 383, 717, 684, 391, 598, 360, 600, 535, + 725, 360, 536, 418, 468, 666, 419, 461, 586, 420, + 469, 717, 398, 545, 629, 694, 360, 695, 509, 546, + 615, 615, 674, 615, 389, 728, 675, 508, 676, 558, + 615, 615, 403, 616, 530, 460, 530, 460, 567, 530, + 568, 631, 408, 603, 604, 605, 606, 607, 608, 609, + 610, 611, 612, 633, 647, 648, 649, 650, 637, 615, + 671, 638, 732, 613, 615, 637, 413, 669, 679, 414, + 553, 405, 461, 459, 461, 697, 618, 615, 698, 360, + 465, 360, 534, 360, 295, 296, 297, 564, 565, 566, + 643, 644, 651, 652, 668, 645, 646, 558, 670, 544, + 549, 636, 554, 484, 563, 577, 460, 578, 579, 580, + 581, 584, 587, 590, 588, 727, 591, 592, 594, 595, + 599, 672, 673, 601, 596, 509, 602, -36, -34, 628, + 530, 632, 460, -29, 508, 661, 660, 678, 615, 682, + 690, 700, 702, 461, 618, 704, 705, 703, 715, -536, + 716, 722, 360, 721, 653, 487, 726, 654, 681, 734, + 723, 735, 655, 657, 686, 656, 658, 699, 411, 461, + 412, 368, 562, 635, 680, 691, 724, 730, 360, 731, + 692, 619, 410, 530, 409, 706, 620, 621, 395, 701, + 0, 0, 686, 0, 0, 0, 0, 0, 0, 509, + 460, 0, 0, 509, 720, 714, 560, 0, 508, 0, + 0, 0, 508, 0, 0, 0, 0, 0, 0, 0, + 729, 0, 0, 530, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 461, 688, 0, + 0, 0, 0, 0, 0, 0, 360, 0, 0, 0, + 0, 0, 389, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 688, 0, 0, 0, + 0, 0, 0, 0, 509, 509, 0, 509, 0, 0, + 0, 0, 0, 508, 508, 0, 508, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 390, 0, + 0, 0, 0, 509, 0, 0, 0, 360, 0, 0, + 0, 0, 508, 0, 509, 0, 0, 0, 0, 0, + 0, 509, 0, 508, 0, 0, 0, 0, 0, 0, + 508, 0, 509, 0, 0, 0, 509, 0, 0, 0, + 0, 508, 509, 0, 0, 508, 0, 0, 0, 394, + 0, 508, 1, 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, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 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, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 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, 0, - 0, 0, 0, 0, 291, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 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, 293, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 304, 305, 306, 307, 308, 309, 0, 0, 0, 0, - 0, 0, 0, 0, 310, 0, 311, 312, 313, 314, + 294, 295, 296, 297, 298, 0, 0, 0, 0, 0, + 0, 0, 0, 299, 300, 301, 302, 303, 304, 305, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 306, 307, 308, 309, 310, 311, 0, 0, + 0, 0, 0, 0, 0, 0, 312, 0, 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, 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, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 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, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 0, 0, 414, 415, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 416, 0, 477, 0, 478, 479, 0, 0, - 0, 0, 480, 417, 418, 419, 420, 0, 0, 0, - 0, 0, 0, 0, 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, 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, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 1, 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, @@ -1580,19 +1557,145 @@ static const yytype_int16 yytable[] = 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 0, - 0, 414, 415, 0, 0, 0, 0, 0, 0, 0, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 416, 0, 477, 0, 478, 608, 0, 0, 0, 0, - 480, 417, 418, 419, 420, 0, 0, 0, 0, 0, - 0, 0, 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, 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, + 0, 0, 424, 425, 0, 486, 0, 487, 488, 0, + 0, 0, 0, 489, 426, 427, 428, 429, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 294, 295, 296, + 297, 298, 0, 0, 0, 430, 431, 432, 433, 434, + 299, 300, 301, 302, 303, 304, 305, 490, 491, 492, + 493, 0, 494, 495, 496, 497, 498, 499, 500, 306, + 307, 308, 309, 310, 311, 435, 436, 437, 438, 439, + 440, 441, 442, 312, 501, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 1, 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, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 0, 0, + 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 424, + 425, 0, 486, 0, 487, 617, 0, 0, 0, 0, + 489, 426, 427, 428, 429, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 294, 295, 296, 297, 298, 0, + 0, 0, 430, 431, 432, 433, 434, 299, 300, 301, + 302, 303, 304, 305, 490, 491, 492, 493, 0, 494, + 495, 496, 497, 498, 499, 500, 306, 307, 308, 309, + 310, 311, 435, 436, 437, 438, 439, 440, 441, 442, + 312, 501, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 1, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 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, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 0, 0, 422, 423, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 424, 425, 0, 486, + 0, 487, 0, 0, 0, 0, 0, 489, 426, 427, + 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 294, 295, 296, 297, 298, 0, 0, 0, 430, + 431, 432, 433, 434, 299, 300, 301, 302, 303, 304, + 305, 490, 491, 492, 493, 0, 494, 495, 496, 497, + 498, 499, 500, 306, 307, 308, 309, 310, 311, 435, + 436, 437, 438, 439, 440, 441, 442, 312, 501, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 1, 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, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 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, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 0, 0, 422, 423, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 424, 425, 0, 486, 0, 408, 0, + 0, 0, 0, 0, 489, 426, 427, 428, 429, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 294, 295, + 296, 297, 298, 0, 0, 0, 430, 431, 432, 433, + 434, 299, 300, 301, 302, 303, 304, 305, 490, 491, + 492, 493, 0, 494, 495, 496, 497, 498, 499, 500, + 306, 307, 308, 309, 310, 311, 435, 436, 437, 438, + 439, 440, 441, 442, 312, 501, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 1, 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, @@ -1621,19 +1724,145 @@ static const yytype_int16 yytable[] = 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 0, 0, 414, - 415, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 416, 0, - 477, 0, 478, 0, 0, 0, 0, 0, 480, 417, - 418, 419, 420, 0, 0, 0, 0, 0, 0, 0, - 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, 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, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, + 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 424, 425, 0, 486, 0, 0, 0, 0, 0, 0, + 0, 489, 426, 427, 428, 429, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 294, 295, 296, 297, 298, + 0, 0, 0, 430, 431, 432, 433, 434, 299, 300, + 301, 302, 303, 304, 305, 490, 491, 492, 493, 0, + 494, 495, 496, 497, 498, 499, 500, 306, 307, 308, + 309, 310, 311, 435, 436, 437, 438, 439, 440, 441, + 442, 312, 501, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 1, 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, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 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, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 0, 0, 422, 423, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 424, 425, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 489, 426, + 427, 428, 429, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 294, 295, 296, 297, 298, 0, 0, 0, + 430, 431, 432, 433, 434, 299, 300, 301, 302, 303, + 304, 305, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 306, 307, 308, 309, 310, 311, + 435, 436, 437, 438, 439, 440, 441, 442, 312, 0, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 1, 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, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 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, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 0, 0, 422, 423, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 424, 425, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 426, 427, 428, 429, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 294, + 295, 296, 297, 0, 0, 0, 0, 430, 431, 432, + 433, 434, 299, 300, 301, 302, 303, 304, 305, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 306, 307, 308, 309, 310, 311, 435, 436, 437, + 438, 439, 440, 441, 442, 312, 0, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 1, 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, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 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, 0, 0, 0, 0, 0, + 0, 0, 293, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 294, 295, 296, 297, + 298, 0, 0, 0, 0, 0, 0, 0, 0, 299, + 300, 301, 302, 303, 304, 305, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 306, 307, + 308, 309, 310, 311, 0, 0, 0, 0, 0, 0, + 0, 0, 312, 0, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 1, 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, @@ -1662,100 +1891,61 @@ static const yytype_int16 yytable[] = 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 0, 0, 414, 415, 0, + 286, 287, 288, 289, 290, 291, 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 416, 0, 477, 0, - 400, 0, 0, 0, 0, 0, 480, 417, 418, 419, - 420, 0, 0, 0, 0, 0, 0, 0, 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, 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, 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, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 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, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 0, 0, 414, 415, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 416, 0, 477, 0, 0, 0, - 0, 0, 0, 0, 480, 417, 418, 419, 420, 0, - 0, 0, 0, 0, 0, 0, 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, 309, 426, 427, 428, 429, - 430, 431, 432, 433, 310, 492, 311, 312, 313, 314, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 387, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 294, 295, 296, 297, 0, 0, 0, + 0, 0, 0, 0, 0, 388, 299, 300, 301, 302, + 303, 304, 305, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 306, 307, 308, 309, 310, + 311, 0, 0, 0, 0, 0, 0, 0, 0, 312, + 0, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 1, 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, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 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, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 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, 0, + 0, 557, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 294, 295, 296, 297, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 299, 300, 301, 302, 303, 304, 305, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 306, 307, 308, 309, 310, 311, 0, 0, + 0, 0, 0, 0, 0, 0, 312, 0, 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, 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, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 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, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 0, 0, 414, 415, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 416, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 480, 417, 418, 419, 420, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 292, 293, 294, 295, - 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, 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, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 1, 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, @@ -1784,25 +1974,149 @@ static const yytype_int16 yytable[] = 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 0, - 0, 414, 415, 0, 0, 0, 0, 0, 0, 0, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 416, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 417, 418, 419, 420, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 292, 293, 294, 295, 0, 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, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 639, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 294, 295, 296, + 297, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 299, 300, 301, 302, 303, 304, 305, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 306, + 307, 308, 309, 310, 311, 0, 0, 0, 0, 0, + 0, 0, 0, 312, 0, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 1, 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, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 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, 0, 0, 677, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 294, 295, 296, 297, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 299, 300, 301, + 302, 303, 304, 305, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 306, 307, 308, 309, + 310, 311, 0, 0, 0, 0, 0, 0, 0, 0, + 312, 0, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 1, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 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, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 294, 295, 296, 297, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 299, 300, 301, 302, 303, 304, + 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 306, 307, 308, 309, 310, 311, 0, + 0, 0, 0, 0, 0, 0, 0, 312, 0, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 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, 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, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 0, 0, 422, 423, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 424, 425, 0, 0, 0, 529, 696, 0, + 0, 0, 0, 0, 426, 427, 428, 429, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 430, 431, 432, 433, 434, + 299, 0, 0, 0, 0, 304, 305, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 325, 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, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 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, @@ -1825,25 +2139,24 @@ static const yytype_int16 yytable[] = 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 0, 0, 0, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 0, + 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 424, 425, 0, 0, 470, 0, 0, 0, 0, 0, + 0, 0, 426, 427, 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 291, 0, + 0, 0, 0, 430, 431, 432, 433, 434, 299, 0, + 0, 0, 0, 304, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, + 0, 0, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 325, 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, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 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, @@ -1866,25 +2179,24 @@ static const yytype_int16 yytable[] = 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 0, 0, 0, 0, 0, + 286, 287, 288, 289, 290, 291, 292, 0, 0, 422, + 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 424, 425, + 0, 0, 0, 529, 0, 0, 0, 0, 0, 0, + 426, 427, 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 430, 431, 432, 433, 434, 299, 0, 0, 0, + 0, 304, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 379, 0, 0, 0, + 0, 435, 436, 437, 438, 439, 440, 441, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, + 0, 0, 0, 325, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 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, 97, @@ -1907,25 +2219,24 @@ static const yytype_int16 yytable[] = 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 0, 0, 0, 0, 0, 0, 0, + 288, 289, 290, 291, 292, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 548, + 0, 0, 0, 0, 0, 0, 424, 425, 0, 0, + 585, 0, 0, 0, 0, 0, 0, 0, 426, 427, + 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 430, + 431, 432, 433, 434, 299, 0, 0, 0, 0, 304, + 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 435, + 436, 437, 438, 439, 440, 441, 442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 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, 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, + 0, 325, 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, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 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, 97, 98, 99, @@ -1948,24 +2259,23 @@ static const yytype_int16 yytable[] = 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 290, 291, 292, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 630, 0, 0, + 0, 0, 0, 0, 424, 425, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 597, 426, 427, 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 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, 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, + 0, 0, 0, 0, 0, 0, 0, 430, 431, 432, + 433, 434, 299, 0, 0, 0, 0, 304, 305, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 435, 436, 437, + 438, 439, 440, 441, 442, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 325, 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, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 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, @@ -1988,25 +2298,24 @@ static const yytype_int16 yytable[] = 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 0, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 0, 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 424, 425, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 426, 427, 428, 429, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 668, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 430, 431, 432, 433, 434, + 299, 0, 0, 0, 0, 304, 305, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 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, 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, + 0, 0, 0, 0, 0, 435, 436, 437, 438, 439, + 440, 441, 442, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 325, 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, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 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, @@ -2029,301 +2338,27 @@ static const yytype_int16 yytable[] = 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 0, 0, 0, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 453, + 0, 422, 423, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 471, 0, 0, 0, 0, 0, 0, + 424, 425, 0, 0, 0, 0, 0, 0, 0, 0, + 537, 538, 426, 427, 428, 429, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 430, 431, 432, 433, 434, 299, 0, + 0, 0, 550, 304, 547, 0, 0, 0, 0, 0, + 0, 0, 0, 471, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 435, 436, 437, 438, 439, 440, 441, + 442, 0, 471, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 325, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, - 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 634, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 416, 0, 0, 0, 520, - 687, 0, 0, 0, 0, 0, 417, 418, 419, 420, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 416, 0, 0, 461, 0, - 0, 0, 0, 0, 0, 0, 417, 418, 419, 420, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 416, 0, 0, 0, 520, - 0, 0, 0, 0, 0, 0, 417, 418, 419, 420, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 416, 0, 0, 576, 0, - 0, 0, 0, 0, 0, 0, 417, 418, 419, 420, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 416, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 588, 417, 418, 419, 420, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 416, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 417, 418, 419, 420, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, 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, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 0, 0, 414, 415, 0, 444, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 462, 0, 416, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 417, 418, 419, 420, - 528, 529, 0, 0, 0, 0, 0, 0, 0, 0, - 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, 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, - 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, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 625, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 631, 632, 633, 462, 462, 462, 462, 462, 462, - 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 0, 0, 640, 641, 642, 471, 471, 471, 471, 471, + 471, 471, 471, 471, 471, 471, 471, 471, 471, 471, + 471, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2333,166 +2368,127 @@ static const yytype_int16 yytable[] = 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, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 462 + 471 }; static const yytype_int16 yycheck[] = { - 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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 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, 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, - -1, -1, -1, -1, -1, -1, -1, 618, -1, -1, - -1, -1, -1, -1, -1, 679, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 684, -1, -1, - -1, -1, -1, -1, -1, 655, 656, -1, 658, -1, - -1, -1, -1, -1, 655, 656, -1, 658, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 679, - -1, -1, -1, -1, 684, -1, -1, -1, 679, -1, - -1, -1, -1, 684, -1, 695, -1, -1, -1, -1, - -1, -1, 702, -1, 695, -1, -1, -1, -1, -1, - -1, 702, -1, 713, -1, -1, -1, 717, -1, -1, - -1, -1, 713, 723, -1, -1, 717, -1, -1, -1, - 0, -1, 723, 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, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 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, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, -1, -1, -1, -1, -1, -1, -1, + 0, 324, 0, 317, 0, 319, 319, 319, 464, 0, + 319, 319, 326, 336, 327, 327, 317, 326, 326, 317, + 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, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 533, 327, 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, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 357, 349, 416, 425, 589, 527, 515, 529, 405, + 321, 532, 462, 386, 353, 299, 300, 304, 665, 392, + 295, 296, 319, 297, 298, 318, 382, 361, 327, 326, + 364, 378, 366, 367, 324, 374, 370, 327, 451, 349, + 413, 414, 353, 317, 324, 319, 693, 357, 349, 323, + 397, 335, 336, 340, 353, 365, 357, 365, 368, 365, + 354, 318, 301, 302, 365, 359, 360, 324, 378, 465, + 320, 353, 382, 704, 324, 335, 497, 378, 499, 324, + 711, 382, 327, 321, 318, 593, 324, 397, 484, 327, + 324, 722, 321, 318, 318, 318, 397, 318, 408, 324, + 324, 324, 623, 324, 460, 318, 322, 408, 324, 559, + 324, 324, 353, 327, 527, 462, 529, 464, 329, 532, + 331, 542, 321, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 546, 571, 572, 573, 574, 324, 324, + 325, 327, 726, 326, 324, 324, 353, 327, 327, 353, + 460, 319, 462, 327, 464, 676, 664, 324, 325, 460, + 326, 462, 353, 464, 342, 343, 344, 332, 333, 334, + 567, 568, 575, 576, 595, 569, 570, 627, 599, 318, + 317, 554, 353, 319, 353, 339, 533, 338, 337, 303, + 305, 320, 319, 317, 322, 716, 327, 327, 317, 317, + 317, 614, 615, 325, 327, 515, 327, 317, 317, 353, + 623, 353, 559, 318, 515, 353, 320, 320, 324, 317, + 361, 320, 322, 533, 732, 318, 317, 353, 318, 321, + 326, 318, 533, 327, 577, 321, 321, 578, 659, 327, + 365, 322, 579, 581, 665, 580, 582, 682, 382, 559, + 382, 298, 467, 553, 637, 667, 710, 722, 559, 723, + 667, 525, 378, 676, 376, 693, 525, 525, 365, 684, + -1, -1, 693, -1, -1, -1, -1, -1, -1, 589, + 627, -1, -1, 593, 705, 698, 682, -1, 589, -1, + -1, -1, 593, -1, -1, -1, -1, -1, -1, -1, + 721, -1, -1, 716, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 627, 665, -1, + -1, -1, -1, -1, -1, -1, 627, -1, -1, -1, + -1, -1, 688, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 693, -1, -1, -1, + -1, -1, -1, -1, 664, 665, -1, 667, -1, -1, + -1, -1, -1, 664, 665, -1, 667, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 688, -1, + -1, -1, -1, 693, -1, -1, -1, 688, -1, -1, + -1, -1, 693, -1, 704, -1, -1, -1, -1, -1, + -1, 711, -1, 704, -1, -1, -1, -1, -1, -1, + 711, -1, 722, -1, -1, -1, 726, -1, -1, -1, + -1, 722, 732, -1, -1, 726, -1, -1, -1, 0, + -1, 732, 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, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 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, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, -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, -1, - -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -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, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, 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, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, -1, -1, 295, 296, -1, -1, -1, -1, -1, + 341, 342, 343, 344, 345, -1, -1, -1, -1, -1, + -1, -1, -1, 354, 355, 356, 357, 358, 359, 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 314, -1, 316, -1, 318, 319, -1, -1, - -1, -1, 324, 325, 326, 327, 328, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 338, 339, 340, 341, - 342, -1, -1, -1, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - -1, 363, 364, 365, 366, 367, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, - 382, 383, 384, 385, 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, + -1, -1, 373, 374, 375, 376, 377, 378, -1, -1, + -1, -1, -1, -1, -1, -1, 387, -1, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 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, @@ -2521,101 +2517,62 @@ static const yytype_int16 yycheck[] = 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, - -1, 295, 296, -1, -1, -1, -1, -1, -1, -1, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, -1, -1, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 314, -1, 316, -1, 318, 319, -1, -1, -1, -1, - 324, 325, 326, 327, 328, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 338, 339, 340, 341, 342, -1, - -1, -1, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, -1, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + -1, -1, 316, 317, -1, 319, -1, 321, 322, -1, + -1, -1, -1, 327, 328, 329, 330, 331, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 341, 342, 343, + 344, 345, -1, -1, -1, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, -1, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 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, - 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, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, -1, -1, 295, - 296, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 314, -1, - 316, -1, 318, -1, -1, -1, -1, -1, 324, 325, - 326, 327, 328, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 338, 339, 340, 341, 342, -1, -1, -1, - 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, - 356, 357, 358, 359, 360, 361, -1, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 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, 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, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 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, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, -1, -1, 295, 296, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 314, -1, 316, -1, - 318, -1, -1, -1, -1, -1, 324, 325, 326, 327, - 328, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 338, 339, 340, 341, 342, -1, -1, -1, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, - 358, 359, 360, 361, -1, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 385, 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, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 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, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 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, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, -1, -1, + 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 316, + 317, -1, 319, -1, 321, 322, -1, -1, -1, -1, + 327, 328, 329, 330, 331, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 341, 342, 343, 344, 345, -1, + -1, -1, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, -1, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 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, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 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, @@ -2644,100 +2601,61 @@ static const yytype_int16 yycheck[] = 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, -1, -1, 295, 296, -1, -1, -1, + 290, 291, 292, 293, 294, -1, -1, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 314, -1, 316, -1, -1, -1, - -1, -1, -1, -1, 324, 325, 326, 327, 328, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 338, 339, - 340, 341, 342, -1, -1, -1, 346, 347, 348, 349, + -1, -1, -1, -1, -1, -1, 316, 317, -1, 319, + -1, 321, -1, -1, -1, -1, -1, 327, 328, 329, + 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 341, 342, 343, 344, 345, -1, -1, -1, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, -1, 363, 364, 365, 366, 367, 368, 369, + 360, 361, 362, 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 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, 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, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, -1, -1, 295, 296, -1, -1, -1, -1, -1, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 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, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, -1, -1, 297, 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 314, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 324, 325, 326, 327, 328, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 338, 339, 340, 341, - 342, -1, -1, -1, 346, 347, 348, 349, 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, 375, 376, 377, 378, 379, 380, 381, - 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, - 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, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, - -1, 295, 296, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 314, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 325, 326, 327, 328, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 338, 339, 340, 341, -1, -1, - -1, -1, 346, 347, 348, 349, 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, 375, 376, 377, 378, 379, 380, 381, 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, + -1, -1, -1, 316, 317, -1, 319, -1, 321, -1, + -1, -1, -1, -1, 327, 328, 329, 330, 331, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 341, 342, + 343, 344, 345, -1, -1, -1, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, -1, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 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, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 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, @@ -2766,19 +2684,145 @@ static const yytype_int16 yycheck[] = 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, -1, -1, -1, + 286, 287, 288, 289, 290, 291, 292, 293, 294, -1, + -1, 297, 298, -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, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, 375, - -1, -1, -1, -1, -1, -1, -1, -1, 384, -1, + 316, 317, -1, 319, -1, -1, -1, -1, -1, -1, + -1, 327, 328, 329, 330, 331, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 341, 342, 343, 344, 345, + -1, -1, -1, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, -1, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 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, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 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, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 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, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, -1, -1, 297, 298, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 316, 317, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 327, 328, + 329, 330, 331, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 341, 342, 343, 344, 345, -1, -1, -1, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, -1, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 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, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, -1, -1, 297, 298, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 316, 317, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 328, 329, 330, 331, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 341, + 342, 343, 344, -1, -1, -1, -1, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, -1, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 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, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + -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, -1, -1, -1, -1, -1, + -1, -1, 327, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 341, 342, 343, 344, + 345, -1, -1, -1, -1, -1, -1, -1, -1, 354, + 355, 356, 357, 358, 359, 360, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, + 375, 376, 377, 378, -1, -1, -1, -1, -1, -1, + -1, -1, 387, -1, 389, 390, 391, 392, 393, 394, + 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 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, @@ -2807,100 +2851,61 @@ static const yytype_int16 yycheck[] = 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, -1, -1, -1, -1, -1, + 288, 289, 290, 291, 292, 293, 294, -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, -1, -1, -1, -1, 324, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 327, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 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, 375, -1, -1, - -1, -1, -1, -1, -1, -1, 384, -1, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + -1, -1, -1, 341, 342, 343, 344, -1, -1, -1, + -1, -1, -1, -1, -1, 353, 354, 355, 356, 357, + 358, 359, 360, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 373, 374, 375, 376, 377, + 378, -1, -1, -1, -1, -1, -1, -1, -1, 387, + -1, 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, 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, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 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, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, -1, -1, -1, -1, -1, -1, -1, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 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, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 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, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, -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, 319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -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, 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, 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, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 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, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 341, 342, 343, 344, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 354, 355, 356, 357, 358, 359, 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 319, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -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, 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, + -1, -1, 373, 374, 375, 376, 377, 378, -1, -1, + -1, -1, -1, -1, -1, -1, 387, -1, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 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, @@ -2929,25 +2934,149 @@ static const yytype_int16 yycheck[] = 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, -1, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, -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, -1, -1, 322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 319, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -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, 375, -1, -1, -1, -1, -1, -1, -1, -1, - 384, -1, 386, 387, 388, 389, 390, 391, 392, 393, + -1, -1, -1, -1, -1, -1, -1, 341, 342, 343, + 344, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 354, 355, 356, 357, 358, 359, 360, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, + 374, 375, 376, 377, 378, -1, -1, -1, -1, -1, + -1, -1, -1, 387, -1, 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, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 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, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 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, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, -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, -1, -1, 322, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 341, 342, 343, 344, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 354, 355, 356, + 357, 358, 359, 360, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, 375, 376, + 377, 378, -1, -1, -1, -1, -1, -1, -1, -1, + 387, -1, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 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, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 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, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, -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, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 341, 342, 343, 344, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 354, 355, 356, 357, 358, 359, + 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 373, 374, 375, 376, 377, 378, -1, + -1, -1, -1, -1, -1, -1, -1, 387, -1, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 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, 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, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, -1, -1, 297, 298, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 316, 317, -1, -1, -1, 321, 322, -1, + -1, -1, -1, -1, 328, 329, 330, 331, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 349, 350, 351, 352, 353, + 354, -1, -1, -1, -1, 359, 360, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 379, 380, 381, 382, 383, + 384, 385, 386, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 401, 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, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 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, @@ -2970,301 +3099,226 @@ static const yytype_int16 yycheck[] = 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, -1, -1, -1, + 286, 287, 288, 289, 290, 291, 292, 293, 294, -1, + -1, 297, 298, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 316, 317, -1, -1, 320, -1, -1, -1, -1, -1, + -1, -1, 328, 329, 330, 331, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 349, 350, 351, 352, 353, 354, -1, + -1, -1, -1, 359, 360, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 379, 380, 381, 382, 383, 384, 385, + 386, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 401, 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, 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, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, -1, -1, 297, + 298, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 316, 317, + -1, -1, -1, 321, -1, -1, -1, -1, -1, -1, + 328, 329, 330, 331, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 349, 350, 351, 352, 353, 354, -1, -1, -1, + -1, 359, 360, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 379, 380, 381, 382, 383, 384, 385, 386, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 401, 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, 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, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, -1, -1, 297, 298, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 316, 317, -1, -1, + 320, -1, -1, -1, -1, -1, -1, -1, 328, 329, + 330, 331, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 349, + 350, 351, 352, 353, 354, -1, -1, -1, -1, 359, + 360, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 379, + 380, 381, 382, 383, 384, 385, 386, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 401, 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, 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, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, -1, -1, 297, 298, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 316, 317, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 327, 328, 329, 330, 331, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 349, 350, 351, + 352, 353, 354, -1, -1, -1, -1, 359, 360, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 379, 380, 381, + 382, 383, 384, 385, 386, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 401, + 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, 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, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, -1, -1, 297, 298, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 316, 317, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 328, 329, 330, 331, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 349, 350, 351, 352, 353, + 354, -1, -1, -1, -1, 359, 360, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 379, 380, 381, 382, 383, + 384, 385, 386, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 401, 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, 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, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 391, + -1, 297, 298, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, + 316, 317, -1, -1, -1, -1, -1, -1, -1, -1, + 422, 423, 328, 329, 330, 331, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 349, 350, 351, 352, 353, 354, -1, + -1, -1, 454, 359, 360, -1, -1, -1, -1, -1, + -1, -1, -1, 465, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 379, 380, 381, 382, 383, 384, 385, + 386, -1, 484, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 401, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, 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, - 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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 551, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, -1, -1, 318, - 319, -1, -1, -1, -1, -1, 325, 326, 327, 328, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, -1, 317, -1, - -1, -1, -1, -1, -1, -1, 325, 326, 327, 328, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, -1, -1, 318, - -1, -1, -1, -1, -1, -1, 325, 326, 327, 328, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, -1, 317, -1, - -1, -1, -1, -1, -1, -1, 325, 326, 327, 328, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 324, 325, 326, 327, 328, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 314, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 325, 326, 327, 328, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, 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, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, -1, -1, 295, 296, -1, 383, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 397, -1, 314, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 325, 326, 327, 328, - 414, 415, -1, -1, -1, -1, -1, -1, -1, -1, - -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, -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, - -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, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 542, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 555, 556, 557, 558, 559, 560, 561, 562, 563, - 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + -1, -1, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, -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, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, @@ -3274,7 +3328,7 @@ static const yytype_int16 yycheck[] = -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, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 673 + 682 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -3310,139 +3364,142 @@ static const yytype_uint16 yystos[] = 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 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, 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, - 463, 464, 465, 467, 472, 473, 474, 515, 516, 517, - 473, 318, 350, 314, 314, 324, 350, 324, 518, 315, - 321, 450, 451, 452, 462, 467, 321, 324, 350, 324, - 350, 463, 467, 332, 469, 470, 0, 516, 467, 476, - 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, 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, 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, - 440, 295, 296, 316, 320, 315, 315, 321, 357, 438, - 314, 423, 321, 333, 467, 350, 479, 480, 319, 478, - 477, 436, 441, 460, 350, 329, 330, 331, 326, 328, - 293, 294, 297, 298, 332, 333, 299, 300, 336, 335, - 334, 301, 303, 302, 337, 317, 317, 436, 316, 319, - 488, 314, 324, 324, 509, 314, 314, 324, 324, 440, - 314, 440, 322, 324, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 323, 439, 321, 324, 319, 484, - 498, 502, 507, 481, 323, 481, 482, 481, 477, 350, - 315, 415, 440, 350, 438, 423, 479, 468, 321, 324, - 319, 423, 423, 423, 425, 425, 426, 426, 427, 427, - 427, 427, 428, 428, 429, 430, 431, 432, 433, 434, - 437, 317, 350, 520, 521, 495, 508, 484, 510, 440, - 324, 440, 322, 438, 438, 481, 319, 321, 319, 317, - 324, 480, 440, 314, 317, 321, 489, 440, 455, 462, - 500, 358, 483, 496, 511, 315, 315, 319, 481, 322, - 441, 317, 521, 319, 350, 315, 314, 500, 512, 513, - 491, 492, 493, 499, 503, 438, 315, 323, 485, 490, - 494, 440, 324, 315, 362, 487, 485, 318, 481, 315, - 440, 490, 491, 495, 504, 324, 319 + 292, 293, 294, 327, 341, 342, 343, 344, 345, 354, + 355, 356, 357, 358, 359, 360, 373, 374, 375, 376, + 377, 378, 387, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 451, 452, 455, 456, 457, 458, + 462, 463, 464, 465, 466, 467, 470, 471, 472, 473, + 474, 476, 481, 482, 483, 524, 525, 526, 482, 321, + 353, 317, 317, 327, 353, 327, 527, 318, 324, 459, + 460, 461, 471, 476, 324, 327, 353, 327, 353, 472, + 476, 335, 478, 479, 0, 525, 476, 485, 321, 353, + 374, 468, 469, 353, 475, 319, 327, 477, 321, 503, + 460, 459, 461, 353, 353, 317, 326, 477, 321, 324, + 327, 454, 297, 298, 316, 317, 328, 329, 330, 331, + 349, 350, 351, 352, 353, 379, 380, 381, 382, 383, + 384, 385, 386, 421, 422, 423, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 474, 476, 480, 477, 327, + 471, 476, 486, 487, 484, 326, 318, 324, 318, 324, + 320, 432, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 319, 327, 319, 321, 322, 327, + 361, 362, 363, 364, 366, 367, 368, 369, 370, 371, + 372, 388, 432, 445, 447, 449, 451, 455, 474, 476, + 492, 493, 494, 495, 496, 504, 505, 506, 507, 510, + 511, 514, 515, 516, 523, 528, 477, 326, 477, 321, + 447, 490, 326, 453, 353, 324, 327, 432, 432, 449, + 297, 298, 319, 323, 318, 318, 324, 360, 447, 317, + 432, 324, 336, 476, 353, 488, 489, 322, 487, 486, + 445, 450, 469, 353, 332, 333, 334, 329, 331, 295, + 296, 299, 300, 335, 336, 301, 302, 339, 338, 337, + 303, 305, 304, 340, 320, 320, 445, 319, 322, 497, + 317, 327, 327, 518, 317, 317, 327, 327, 449, 317, + 449, 325, 327, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 326, 448, 324, 327, 322, 493, 507, + 511, 516, 490, 326, 490, 491, 490, 486, 353, 318, + 424, 449, 353, 447, 432, 488, 477, 324, 327, 322, + 432, 432, 432, 434, 434, 435, 435, 436, 436, 436, + 436, 437, 437, 438, 439, 440, 441, 442, 443, 446, + 320, 353, 529, 530, 504, 517, 493, 519, 449, 327, + 449, 325, 447, 447, 490, 322, 324, 322, 320, 327, + 489, 449, 317, 320, 324, 498, 449, 464, 471, 509, + 361, 492, 505, 520, 318, 318, 322, 490, 325, 450, + 320, 530, 322, 353, 318, 317, 509, 521, 522, 500, + 501, 502, 508, 512, 447, 318, 326, 494, 499, 503, + 449, 327, 318, 365, 496, 494, 321, 490, 318, 449, + 499, 500, 504, 513, 327, 322 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 411, 412, 413, 413, 413, 413, 413, 413, 413, - 413, 413, 413, 413, 413, 413, 413, 414, 414, 414, - 414, 414, 414, 415, 416, 417, 418, 418, 419, 419, - 420, 420, 421, 422, 422, 422, 423, 423, 423, 423, - 424, 424, 424, 424, 425, 425, 425, 425, 426, 426, - 426, 427, 427, 427, 428, 428, 428, 428, 428, 429, - 429, 429, 430, 430, 431, 431, 432, 432, 433, 433, - 434, 434, 435, 435, 436, 437, 436, 438, 438, 439, - 439, 439, 439, 439, 439, 439, 439, 439, 439, 439, - 440, 440, 441, 442, 442, 442, 442, 442, 442, 442, - 442, 442, 444, 443, 445, 445, 446, 447, 447, 448, - 448, 449, 450, 450, 451, 451, 451, 451, 452, 453, - 453, 453, 453, 453, 454, 454, 454, 454, 454, 455, - 455, 456, 457, 457, 457, 457, 457, 457, 457, 457, - 458, 459, 459, 460, 460, 460, 461, 462, 462, 463, - 463, 463, 463, 463, 463, 463, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 464, 464, 464, 464, 464, - 464, 464, 464, 464, 464, 465, 466, 466, 467, 467, - 468, 468, 468, 468, 469, 469, 470, 471, 471, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 472, - 472, 472, 472, 472, 472, 472, 472, 472, 472, 473, - 473, 473, 475, 474, 476, 474, 477, 477, 478, 478, - 479, 479, 480, 480, 481, 481, 481, 482, 482, 483, - 484, 484, 485, 485, 485, 485, 485, 485, 485, 485, - 486, 487, 488, 489, 487, 490, 490, 492, 491, 493, - 491, 494, 494, 495, 495, 496, 496, 497, 497, 498, - 499, 499, 500, 500, 501, 501, 503, 502, 504, 504, - 505, 505, 506, 506, 508, 507, 509, 507, 510, 507, - 511, 511, 512, 512, 513, 513, 514, 514, 514, 514, - 514, 515, 515, 516, 516, 516, 518, 517, 519, 520, - 520, 521, 521 + 0, 420, 421, 422, 422, 422, 422, 422, 422, 422, + 422, 422, 422, 422, 422, 422, 422, 422, 423, 423, + 423, 423, 423, 423, 424, 425, 426, 427, 427, 428, + 428, 429, 429, 430, 431, 431, 431, 432, 432, 432, + 432, 433, 433, 433, 433, 434, 434, 434, 434, 435, + 435, 435, 436, 436, 436, 437, 437, 437, 437, 437, + 438, 438, 438, 439, 439, 440, 440, 441, 441, 442, + 442, 443, 443, 444, 444, 445, 446, 445, 447, 447, + 448, 448, 448, 448, 448, 448, 448, 448, 448, 448, + 448, 449, 449, 450, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 453, 452, 454, 454, 455, 456, 456, + 457, 457, 458, 459, 459, 460, 460, 460, 460, 461, + 462, 462, 462, 462, 462, 463, 463, 463, 463, 463, + 464, 464, 465, 466, 466, 466, 466, 466, 466, 466, + 466, 467, 468, 468, 469, 469, 469, 470, 471, 471, + 472, 472, 472, 472, 472, 472, 472, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 473, 473, 473, 473, 473, 473, 473, 473, + 473, 473, 474, 475, 475, 476, 476, 477, 477, 477, + 477, 478, 478, 479, 480, 480, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 481, 481, + 481, 481, 481, 481, 481, 481, 481, 481, 482, 482, + 482, 484, 483, 485, 483, 486, 486, 487, 487, 488, + 488, 489, 489, 490, 490, 490, 491, 491, 492, 493, + 493, 494, 494, 494, 494, 494, 494, 494, 494, 495, + 496, 497, 498, 496, 499, 499, 501, 500, 502, 500, + 503, 503, 504, 504, 505, 505, 506, 506, 507, 508, + 508, 509, 509, 510, 510, 512, 511, 513, 513, 514, + 514, 515, 515, 517, 516, 518, 516, 519, 516, 520, + 520, 521, 521, 522, 522, 523, 523, 523, 523, 523, + 524, 524, 525, 525, 525, 527, 526, 528, 529, 529, + 530, 530 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, - 3, 2, 2, 1, 1, 1, 2, 2, 2, 1, - 2, 3, 2, 1, 1, 1, 1, 2, 2, 2, - 1, 1, 1, 1, 1, 3, 3, 3, 1, 3, - 3, 1, 3, 3, 1, 3, 3, 3, 3, 1, - 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 0, 6, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, + 1, 3, 2, 2, 1, 1, 1, 2, 2, 2, + 1, 2, 3, 2, 1, 1, 1, 1, 2, 2, + 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, + 3, 3, 1, 3, 3, 1, 3, 3, 3, 3, + 1, 3, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 1, 3, 1, 3, 1, 0, 6, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 2, 2, 4, 2, 3, 4, 2, - 3, 4, 0, 6, 2, 3, 2, 1, 1, 2, - 3, 3, 2, 3, 2, 1, 2, 1, 1, 1, - 3, 4, 6, 5, 1, 2, 3, 5, 4, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 1, 3, 1, 3, 1, 1, 1, 2, 1, + 1, 1, 3, 1, 2, 2, 4, 2, 3, 4, + 2, 3, 4, 0, 6, 2, 3, 2, 1, 1, + 2, 3, 3, 2, 3, 2, 1, 2, 1, 1, + 1, 3, 4, 6, 5, 1, 2, 3, 5, 4, + 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 1, 3, 1, 3, 1, 1, 1, 2, 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, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 4, 1, 1, 3, 2, 3, - 2, 3, 3, 4, 1, 0, 3, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 1, 1, 3, 2, 3, 2, 3, 3, + 4, 1, 0, 3, 1, 3, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -3472,16 +3529,16 @@ static const yytype_uint8 yyr2[] = 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, 1, 1, 1, 1, 1, - 1, 1, 0, 6, 0, 5, 1, 2, 3, 4, - 1, 3, 1, 2, 1, 3, 4, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 0, 0, 5, 1, 1, 0, 2, 0, - 2, 2, 3, 1, 2, 1, 2, 1, 2, 5, - 3, 1, 1, 4, 1, 2, 0, 8, 0, 1, - 3, 2, 1, 2, 0, 6, 0, 8, 0, 7, - 1, 1, 1, 0, 2, 3, 2, 2, 2, 3, - 2, 1, 2, 1, 1, 1, 0, 3, 5, 1, - 3, 1, 4 + 1, 0, 6, 0, 5, 1, 2, 3, 4, 1, + 3, 1, 2, 1, 3, 4, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 0, 0, 5, 1, 1, 0, 2, 0, 2, + 2, 3, 1, 2, 1, 2, 1, 2, 5, 3, + 1, 1, 4, 1, 2, 0, 8, 0, 1, 3, + 2, 1, 2, 0, 6, 0, 8, 0, 7, 1, + 1, 1, 0, 2, 3, 2, 2, 2, 3, 2, + 1, 2, 1, 1, 1, 0, 3, 5, 1, 3, + 1, 4 }; @@ -4164,250 +4221,260 @@ yyreduce: switch (yyn) { case 2: -#line 352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 357 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 4172 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4229 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 3: -#line 358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 363 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4237 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 4: -#line 361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 366 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 4190 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4247 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 5: -#line 366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 371 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 4198 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4255 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 6: -#line 369 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 374 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4263 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 7: -#line 372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 377 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4215 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4272 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 8: -#line 376 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 381 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 4223 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4280 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 9: -#line 380 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 385 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); + } +#line 4288 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 10: +#line 388 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4297 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 10: -#line 384 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 11: +#line 392 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4241 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4306 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 11: -#line 388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 12: +#line 396 "glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 4250 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4315 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 12: -#line 392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 13: +#line 400 "glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 4259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4324 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 13: -#line 396 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 14: +#line 404 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 4268 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4333 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 14: -#line 400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 15: +#line 408 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 4277 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 15: -#line 404 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); - } -#line 4286 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4342 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 16: -#line 408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 412 "glslang.y" /* yacc.c:1646 */ + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); + } +#line 4353 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 17: +#line 418 "glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 4295 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 17: -#line 416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } -#line 4303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4362 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 18: -#line 419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); - } -#line 4311 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 19: -#line 422 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 426 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4319 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4370 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 19: +#line 429 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); + } +#line 4378 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 20: -#line 425 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 432 "glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4327 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4386 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 21: -#line 428 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 435 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); + } +#line 4394 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 22: +#line 438 "glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 4337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4404 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 22: -#line 433 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 23: +#line 443 "glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 4347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4414 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 23: -#line 441 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 24: +#line 451 "glslang.y" /* yacc.c:1646 */ { parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4423 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 24: -#line 448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 25: +#line 458 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 4365 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 25: -#line 455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm) = (yyvsp[0].interm); - } -#line 4373 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4432 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 26: -#line 461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm) = (yyvsp[-1].interm); - (yyval.interm).loc = (yyvsp[0].lex).loc; - } -#line 4382 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 27: -#line 465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm) = (yyvsp[-1].interm); - (yyval.interm).loc = (yyvsp[0].lex).loc; - } -#line 4391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 28: -#line 472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm) = (yyvsp[-1].interm); - } -#line 4399 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 29: -#line 475 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 465 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); } -#line 4407 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4440 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 27: +#line 471 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 4449 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 28: +#line 475 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; + } +#line 4458 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 29: +#line 482 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 4466 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 30: -#line 481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 485 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 4474 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 31: +#line 491 "glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -4415,11 +4482,11 @@ yyreduce: (yyval.interm).function = (yyvsp[-1].interm).function; (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } -#line 4419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4486 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 31: -#line 488 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 32: +#line 498 "glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType }; param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); @@ -4427,29 +4494,29 @@ yyreduce: (yyval.interm).function = (yyvsp[-2].interm).function; (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } -#line 4431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 32: -#line 498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm) = (yyvsp[-1].interm); - } -#line 4439 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4498 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 33: -#line 506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 508 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 4506 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 34: +#line 516 "glslang.y" /* yacc.c:1646 */ { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 4449 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4516 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 34: -#line 511 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 35: +#line 521 "glslang.y" /* yacc.c:1646 */ { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -4477,50 +4544,50 @@ yyreduce: (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); } } -#line 4481 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4548 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 35: -#line 539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 36: +#line 549 "glslang.y" /* yacc.c:1646 */ { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 4491 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4558 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 36: -#line 548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 37: +#line 558 "glslang.y" /* yacc.c:1646 */ { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 4502 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4569 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 37: -#line 554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 38: +#line 564 "glslang.y" /* yacc.c:1646 */ { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 4511 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4578 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 38: -#line 558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 39: +#line 568 "glslang.y" /* yacc.c:1646 */ { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 4520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4587 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 39: -#line 562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 40: +#line 572 "glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -4537,179 +4604,179 @@ yyreduce: (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 4541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 40: -#line 582 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 4547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4608 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 41: -#line 583 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 4553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 592 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 4614 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 42: -#line 584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 4559 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 593 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 4620 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 43: -#line 585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; - parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 4566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 594 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 4626 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 44: -#line 591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4572 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 595 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } +#line 4633 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 45: -#line 592 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 601 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4639 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 46: +#line 602 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4649 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 46: -#line 597 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 47: +#line 607 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4592 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4659 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 47: -#line 602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 48: +#line 612 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 48: -#line 611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4670 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 49: -#line 612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 621 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4676 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 50: +#line 622 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4686 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 50: -#line 617 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 51: +#line 627 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4629 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 51: -#line 625 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4635 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4696 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 52: -#line 626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 635 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4702 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 53: +#line 636 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4713 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 53: -#line 632 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 54: +#line 642 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4657 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 54: -#line 641 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4663 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4724 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 55: -#line 642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 651 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4730 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 56: +#line 652 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4673 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4740 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 56: -#line 647 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 57: +#line 657 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4683 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4750 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 57: -#line 652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 58: +#line 662 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4693 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4760 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 58: -#line 657 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 59: +#line 667 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 59: -#line 665 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4709 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4770 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 60: -#line 666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 675 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4776 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 61: +#line 676 "glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -4719,11 +4786,11 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4723 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4790 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 61: -#line 675 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 62: +#line 685 "glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -4733,124 +4800,124 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4737 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 62: -#line 687 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4743 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4804 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 63: -#line 688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 697 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4810 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 64: +#line 698 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4754 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 64: -#line 697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4760 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4821 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 65: -#line 698 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 707 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4827 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 66: +#line 708 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 66: -#line 707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4777 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4838 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 67: -#line 708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 717 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4844 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 68: +#line 718 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 4788 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 68: -#line 717 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4794 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4855 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 69: -#line 718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 727 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4861 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 70: +#line 728 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4804 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 70: -#line 726 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4810 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4871 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 71: -#line 727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 736 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4877 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 72: +#line 737 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4820 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 72: -#line 735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4887 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 73: -#line 736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 745 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4893 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 74: +#line 746 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 4836 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 74: -#line 744 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4903 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 75: -#line 745 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - ++parseContext.controlFlowNestingLevel; - } -#line 4850 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 754 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4909 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 76: -#line 748 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 755 "glslang.y" /* yacc.c:1646 */ + { + ++parseContext.controlFlowNestingLevel; + } +#line 4917 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 77: +#line 758 "glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -4863,17 +4930,17 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 4867 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 77: -#line 763 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 4873 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4934 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 78: -#line 764 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 773 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 4940 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 79: +#line 774 "glslang.y" /* yacc.c:1646 */ { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -4887,119 +4954,119 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 4891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4958 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 79: -#line 780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 80: +#line 790 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 4900 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4967 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 80: -#line 784 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 81: +#line 794 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 4909 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4976 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 81: -#line 788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 82: +#line 798 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 4918 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4985 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 82: -#line 792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 83: +#line 802 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 4928 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 4995 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 83: -#line 797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 84: +#line 807 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 4937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5004 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 84: -#line 801 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 85: +#line 811 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 4946 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5013 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 85: -#line 805 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 86: +#line 815 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 4955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5022 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 86: -#line 809 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 87: +#line 819 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 4964 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5031 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 87: -#line 813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 88: +#line 823 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 4973 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5040 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 88: -#line 817 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 89: +#line 827 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 4982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5049 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 89: -#line 821 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 90: +#line 831 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 4991 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 90: -#line 828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); - } -#line 4999 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5058 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 91: -#line 831 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 838 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 5066 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 92: +#line 841 "glslang.y" /* yacc.c:1646 */ { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -5008,40 +5075,40 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 5012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5079 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 92: -#line 842 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 93: +#line 852 "glslang.y" /* yacc.c:1646 */ { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5021 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5088 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 93: -#line 849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 94: +#line 859 "glslang.y" /* yacc.c:1646 */ { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 5031 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5098 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 94: -#line 854 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 95: +#line 864 "glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 5041 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5108 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 95: -#line 859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 96: +#line 869 "glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope @@ -5049,75 +5116,75 @@ yyreduce: parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 5053 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5120 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 96: -#line 866 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 97: +#line 876 "glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } -#line 5062 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5129 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 97: -#line 870 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 98: +#line 880 "glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 5071 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5138 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 98: -#line 874 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 99: +#line 884 "glslang.y" /* yacc.c:1646 */ { parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } -#line 5080 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5147 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 99: -#line 878 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 100: +#line 888 "glslang.y" /* yacc.c:1646 */ { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 5090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5157 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 100: -#line 883 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 101: +#line 893 "glslang.y" /* yacc.c:1646 */ { parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } -#line 5100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5167 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 101: -#line 888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 102: +#line 898 "glslang.y" /* yacc.c:1646 */ { parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 5111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 102: -#line 897 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 5117 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5178 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 103: -#line 897 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 907 "glslang.y" /* yacc.c:1646 */ + { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } +#line 5184 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 104: +#line 907 "glslang.y" /* yacc.c:1646 */ { --parseContext.structNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; @@ -5127,54 +5194,54 @@ yyreduce: (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 5131 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5198 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 104: -#line 908 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 105: +#line 918 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 5140 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5207 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 105: -#line 912 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 106: +#line 922 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 5149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5216 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 106: -#line 919 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 107: +#line 929 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5158 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 107: -#line 926 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.function) = (yyvsp[0].interm.function); - } -#line 5166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5225 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 108: -#line 929 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 936 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 5174 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5233 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 109: -#line 936 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 939 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.function) = (yyvsp[0].interm.function); + } +#line 5241 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 110: +#line 946 "glslang.y" /* yacc.c:1646 */ { // Add the parameter (yyval.interm.function) = (yyvsp[-1].interm.function); @@ -5183,11 +5250,11 @@ yyreduce: else delete (yyvsp[0].interm).param.type; } -#line 5187 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5254 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 110: -#line 944 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 111: +#line 954 "glslang.y" /* yacc.c:1646 */ { // // Only first parameter of one-parameter functions can be void @@ -5205,11 +5272,11 @@ yyreduce: (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } -#line 5209 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5276 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 111: -#line 964 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 112: +#line 974 "glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -5229,11 +5296,11 @@ yyreduce: function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 5233 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5300 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 112: -#line 987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 113: +#line 997 "glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -5249,11 +5316,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 5253 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5320 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 113: -#line 1002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 114: +#line 1012 "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"); @@ -5273,11 +5340,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 5277 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5344 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 114: -#line 1027 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 115: +#line 1037 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -5289,11 +5356,11 @@ yyreduce: parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 5293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5360 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 115: -#line 1038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 116: +#line 1048 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); @@ -5301,11 +5368,11 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 5305 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5372 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 116: -#line 1048 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 117: +#line 1058 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) @@ -5316,11 +5383,11 @@ yyreduce: parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 5320 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5387 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 117: -#line 1058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 118: +#line 1068 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[0].interm); @@ -5328,68 +5395,68 @@ yyreduce: parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } -#line 5332 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5399 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 118: -#line 1068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 119: +#line 1078 "glslang.y" /* yacc.c:1646 */ { TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 5343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 119: -#line 1077 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm) = (yyvsp[0].interm); - } -#line 5351 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5410 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 120: -#line 1080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1087 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[0].interm); + } +#line 5418 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 121: +#line 1090 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-2].interm); parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } -#line 5360 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5427 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 121: -#line 1084 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 122: +#line 1094 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-3].interm); parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } -#line 5369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5436 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 122: -#line 1088 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 123: +#line 1098 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-5].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 5379 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5446 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 123: -#line 1093 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 124: +#line 1103 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-4].interm).type; TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } -#line 5389 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5456 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 124: -#line 1101 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 125: +#line 1111 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; @@ -5397,51 +5464,51 @@ yyreduce: parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 5401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5468 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 125: -#line 1108 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 126: +#line 1118 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-1].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } -#line 5411 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5478 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 126: -#line 1113 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 127: +#line 1123 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-2].interm.type); (yyval.interm).intermNode = 0; parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } -#line 5421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5488 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 127: -#line 1118 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 128: +#line 1128 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-4].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 5431 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5498 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 128: -#line 1123 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 129: +#line 1133 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).type = (yyvsp[-3].interm.type); TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); } -#line 5441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5508 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 129: -#line 1132 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 130: +#line 1142 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -5452,11 +5519,11 @@ yyreduce: } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } -#line 5456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5523 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 130: -#line 1142 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 131: +#line 1152 "glslang.y" /* yacc.c:1646 */ { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -5481,22 +5548,22 @@ yyreduce: (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 5485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5552 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 131: -#line 1169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 132: +#line 1179 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 5496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5563 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 132: -#line 1178 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 133: +#line 1188 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -5504,11 +5571,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 5508 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5575 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 133: -#line 1185 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 134: +#line 1195 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -5516,11 +5583,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 5520 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5587 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 134: -#line 1193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 135: +#line 1203 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); @@ -5528,11 +5595,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 5532 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5599 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 135: -#line 1200 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 136: +#line 1210 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); @@ -5540,11 +5607,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 5544 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5611 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 136: -#line 1207 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 137: +#line 1217 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); @@ -5553,11 +5620,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 5557 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5624 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 137: -#line 1215 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 138: +#line 1225 "glslang.y" /* yacc.c:1646 */ { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); @@ -5568,11 +5635,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 5572 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5639 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 138: -#line 1225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 139: +#line 1235 "glslang.y" /* yacc.c:1646 */ { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); @@ -5580,11 +5647,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 5584 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5651 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 139: -#line 1232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 140: +#line 1242 "glslang.y" /* yacc.c:1646 */ { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); @@ -5592,84 +5659,84 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 5596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 140: -#line 1243 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type) = (yyvsp[-1].interm.type); - } -#line 5604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5663 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 141: -#line 1249 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1253 "glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 5612 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5671 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 142: -#line 1252 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1259 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5679 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 143: +#line 1262 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 5622 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5689 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 143: -#line 1259 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 144: +#line 1269 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 5631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5698 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 144: -#line 1263 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 145: +#line 1273 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 5640 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5707 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 145: -#line 1267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 146: +#line 1277 "glslang.y" /* yacc.c:1646 */ { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 5650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5717 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 146: -#line 1276 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 147: +#line 1286 "glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 5661 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 147: -#line 1286 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type) = (yyvsp[0].interm.type); - } -#line 5669 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5728 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 148: -#line 1289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1296 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5736 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 149: +#line 1299 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -5678,112 +5745,112 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 5682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 149: -#line 1300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type) = (yyvsp[0].interm.type); - } -#line 5690 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5749 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 150: -#line 1303 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1310 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5698 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5757 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 151: -#line 1306 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1313 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5765 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 152: +#line 1316 "glslang.y" /* yacc.c:1646 */ { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5707 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 152: -#line 1310 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[0].interm.type); - } -#line 5716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5774 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 153: -#line 1314 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1320 "glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5783 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 154: -#line 1319 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1324 "glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5734 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5792 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 155: -#line 1323 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1329 "glslang.y" /* yacc.c:1646 */ { + // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 5742 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5801 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 156: -#line 1330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1333 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + } +#line 5809 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 157: +#line 1340 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 5751 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5818 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 157: -#line 1334 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 158: +#line 1344 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 5761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5828 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 158: -#line 1339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 159: +#line 1349 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 5772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5839 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 159: -#line 1345 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 160: +#line 1355 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 5783 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5850 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 160: -#line 1351 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 161: +#line 1361 "glslang.y" /* yacc.c:1646 */ { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -5791,21 +5858,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 5795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5862 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 161: -#line 1358 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 162: +#line 1368 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 5805 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5872 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 162: -#line 1363 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 163: +#line 1373 "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"); @@ -5814,21 +5881,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 5818 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5885 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 163: -#line 1371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 164: +#line 1381 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 5828 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5895 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 164: -#line 1377 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 165: +#line 1387 "glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -5841,11 +5908,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 5845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5912 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 165: -#line 1389 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 166: +#line 1399 "glslang.y" /* yacc.c:1646 */ { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -5860,250 +5927,324 @@ yyreduce: else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 5864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5931 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 166: -#line 1403 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 167: +#line 1413 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 5875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5942 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 167: -#line 1409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 168: +#line 1419 "glslang.y" /* yacc.c:1646 */ { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 5885 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 168: -#line 1414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectNVMask | EShLangClosestHitNVMask - | EShLangAnyHitNVMask), "hitAttributeNV"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); - (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqHitAttrNV; - } -#line 5898 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5952 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 169: -#line 1422 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1424 "glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenNVMask | EShLangClosestHitNVMask | - EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadNV"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV"); (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqPayloadNV; + (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 5911 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5965 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 170: -#line 1430 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1432 "glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitNVMask | - EShLangAnyHitNVMask | EShLangMissNVMask), "rayPayloadInNV"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask + | EShLangAnyHitMask), "hitAttributeEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV"); (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqPayloadInNV; + (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 5924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5978 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 171: -#line 1438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1440 "glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenNVMask | - EShLangClosestHitNVMask | EShLangMissNVMask | EShLangCallableNVMask), "callableDataNV"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV"); (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqCallableDataNV; + (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 5937 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 5991 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 172: -#line 1446 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1448 "glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); - parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableNVMask), "callableDataInNV"); - parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT"); (yyval.interm.type).init((yyvsp[0].lex).loc); - (yyval.interm.type).qualifier.storage = EvqCallableDataInNV; + (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 5949 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6004 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 173: -#line 1453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1456 "glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayloadIn; + } +#line 6017 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 174: +#line 1464 "glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | + EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqPayloadIn; + } +#line 6030 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 175: +#line 1472 "glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableData; + } +#line 6043 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 176: +#line 1480 "glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | + EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableData; + } +#line 6056 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 177: +#line 1488 "glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableDataIn; + } +#line 6068 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 178: +#line 1495 "glslang.y" /* yacc.c:1646 */ + { + parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqCallableDataIn; + } +#line 6080 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 179: +#line 1502 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 5958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6089 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 174: -#line 1457 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 180: +#line 1506 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 5968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6099 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 175: -#line 1462 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 181: +#line 1511 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 5978 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6109 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 176: -#line 1467 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 182: +#line 1516 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 5988 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6119 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 177: -#line 1472 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 183: +#line 1521 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 5998 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6129 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 178: -#line 1477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 184: +#line 1526 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 6008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6139 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 179: -#line 1482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 185: +#line 1531 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); + (yyval.interm.type).qualifier.shadercallcoherent = true; + } +#line 6149 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 186: +#line 1536 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 6017 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6158 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 180: -#line 1486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 187: +#line 1540 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 6026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6167 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 181: -#line 1490 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 188: +#line 1544 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 6035 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6176 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 182: -#line 1494 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 189: +#line 1548 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 6044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6185 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 183: -#line 1498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 190: +#line 1552 "glslang.y" /* yacc.c:1646 */ { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 6055 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6196 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 184: -#line 1504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 191: +#line 1558 "glslang.y" /* yacc.c:1646 */ { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 6066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6207 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 185: -#line 1515 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 192: +#line 1569 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 6075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6216 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 186: -#line 1522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 193: +#line 1576 "glslang.y" /* yacc.c:1646 */ { // TODO } -#line 6083 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6224 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 187: -#line 1525 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 194: +#line 1579 "glslang.y" /* yacc.c:1646 */ { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 6093 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6234 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 188: -#line 1534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 195: +#line 1588 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); (yyval.interm.type).typeParameters = (yyvsp[0].interm.typeParameters); } -#line 6103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6244 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 189: -#line 1539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 196: +#line 1593 "glslang.y" /* yacc.c:1646 */ { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-2].interm.type); @@ -6111,21 +6252,21 @@ yyreduce: (yyval.interm.type).typeParameters = (yyvsp[-1].interm.typeParameters); (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } -#line 6115 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6256 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 190: -#line 1549 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 197: +#line 1603 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 6125 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6266 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 191: -#line 1554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 198: +#line 1608 "glslang.y" /* yacc.c:1646 */ { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -6134,20 +6275,20 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 6138 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6279 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 192: -#line 1562 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 199: +#line 1616 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 6147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6288 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 193: -#line 1566 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 200: +#line 1620 "glslang.y" /* yacc.c:1646 */ { (yyval.interm) = (yyvsp[-3].interm); @@ -6155,35 +6296,35 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 6159 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6300 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 194: -#line 1576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 201: +#line 1630 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 6167 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6308 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 195: -#line 1579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 202: +#line 1633 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeParameters) = 0; } -#line 6175 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6316 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 196: -#line 1585 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 203: +#line 1639 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 6183 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6324 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 197: -#line 1591 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 204: +#line 1645 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeParameters) = new TArraySizes; @@ -6191,11 +6332,11 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 6195 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6336 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 198: -#line 1598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 205: +#line 1652 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); @@ -6203,2927 +6344,2977 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter"); (yyval.interm.typeParameters)->addInnerSize(size); } -#line 6207 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6348 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 199: -#line 1608 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 206: +#line 1662 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 6216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6357 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 200: -#line 1612 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 207: +#line 1666 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 6225 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6366 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 201: -#line 1616 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 208: +#line 1670 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 6234 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6375 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 202: -#line 1620 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 209: +#line 1674 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 6244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 203: -#line 1625 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - } -#line 6253 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 204: -#line 1629 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 6263 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 205: -#line 1634 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); - } -#line 6273 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 206: -#line 1639 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); - } -#line 6283 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 207: -#line 1644 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(2); - } -#line 6293 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 208: -#line 1649 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(3); - } -#line 6303 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 209: -#line 1654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(4); - } -#line 6313 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6385 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 210: -#line 1659 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1679 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtBool; } -#line 6323 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6394 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 211: -#line 1664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1683 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 6404 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 212: +#line 1688 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 6414 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 213: +#line 1693 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); + } +#line 6424 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 214: +#line 1698 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); + } +#line 6434 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 215: +#line 1703 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); + } +#line 6444 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 216: +#line 1708 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); + } +#line 6454 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 217: +#line 1713 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); + } +#line 6464 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 218: +#line 1718 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(3); } -#line 6333 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6474 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 212: -#line 1669 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 219: +#line 1723 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 6343 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6484 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 213: -#line 1674 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 220: +#line 1728 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 6354 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6495 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 214: -#line 1680 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 221: +#line 1734 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 6365 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6506 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 215: -#line 1686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 222: +#line 1740 "glslang.y" /* yacc.c:1646 */ { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 6376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6517 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 216: -#line 1692 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 223: +#line 1746 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6527 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 217: -#line 1697 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 224: +#line 1751 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6396 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6537 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 218: -#line 1702 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 225: +#line 1756 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6547 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 219: -#line 1707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 226: +#line 1761 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 6416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6557 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 220: -#line 1712 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 227: +#line 1766 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 6426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6567 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 221: -#line 1717 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 228: +#line 1771 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 6436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6577 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 222: -#line 1722 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 229: +#line 1776 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 6446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6587 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 223: -#line 1727 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 230: +#line 1781 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 6456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6597 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 224: -#line 1732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 231: +#line 1786 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 6466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6607 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 225: -#line 1737 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 232: +#line 1791 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 6476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6617 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 226: -#line 1742 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 233: +#line 1796 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 6486 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6627 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 227: -#line 1747 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 234: +#line 1801 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 6496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6637 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 228: -#line 1753 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 235: +#line 1807 "glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 6506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6649 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 229: -#line 1758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 236: +#line 1814 "glslang.y" /* yacc.c:1646 */ { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 6516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6659 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 230: -#line 1763 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 237: +#line 1819 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 6526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6669 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 231: -#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 238: +#line 1824 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 6536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6679 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 232: -#line 1773 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 239: +#line 1829 "glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 6546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6689 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 233: -#line 1778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 240: +#line 1834 "glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 6556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6699 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 234: -#line 1783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 241: +#line 1839 "glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 6566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6709 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 235: -#line 1788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 242: +#line 1844 "glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 6576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6719 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 236: -#line 1793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 243: +#line 1849 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 6586 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6729 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 237: -#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 244: +#line 1854 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 6596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6739 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 238: -#line 1803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 245: +#line 1859 "glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 6606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6749 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 239: -#line 1808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 246: +#line 1864 "glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 6616 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 240: -#line 1813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); - } -#line 6627 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 241: -#line 1819 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); - } -#line 6638 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 242: -#line 1825 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); - } -#line 6649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 243: -#line 1831 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(2); - } -#line 6660 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 244: -#line 1837 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(3); - } -#line 6671 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 245: -#line 1843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(4); - } -#line 6682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 246: -#line 1849 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 6693 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6759 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 247: -#line 1855 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1869 "glslang.y" /* yacc.c:1646 */ { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 6704 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6772 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 248: -#line 1861 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1877 "glslang.y" /* yacc.c:1646 */ + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); + } +#line 6785 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 249: +#line 1885 "glslang.y" /* yacc.c:1646 */ + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); + } +#line 6798 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 250: +#line 1893 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(2); + } +#line 6809 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 251: +#line 1899 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); + } +#line 6820 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 252: +#line 1905 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(4); + } +#line 6831 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 253: +#line 1911 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 6842 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 254: +#line 1917 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 6853 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 255: +#line 1923 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 6715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 249: -#line 1867 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); - } -#line 6726 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 250: -#line 1873 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); - } -#line 6737 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 251: -#line 1879 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); - } -#line 6748 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 252: -#line 1885 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(2); - } -#line 6759 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 253: -#line 1891 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(3); - } -#line 6770 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 254: -#line 1897 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(4); - } -#line 6781 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 255: -#line 1903 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(2); - } -#line 6792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6864 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 256: -#line 1909 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1929 "glslang.y" /* yacc.c:1646 */ { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 6803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6875 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 257: -#line 1915 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1935 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); + } +#line 6886 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 258: +#line 1941 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); + } +#line 6897 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 259: +#line 1947 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(2); + } +#line 6908 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 260: +#line 1953 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(3); + } +#line 6919 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 261: +#line 1959 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(4); + } +#line 6930 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 262: +#line 1965 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); + } +#line 6941 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 263: +#line 1971 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); + } +#line 6952 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 264: +#line 1977 "glslang.y" /* yacc.c:1646 */ { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; (yyval.interm.type).setVector(4); } -#line 6814 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 258: -#line 1921 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); - } -#line 6825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 259: -#line 1927 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(3); - } -#line 6836 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 260: -#line 1933 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(4); - } -#line 6847 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 261: -#line 1939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(2); - } -#line 6858 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 262: -#line 1945 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(3); - } -#line 6869 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 263: -#line 1951 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(4); - } -#line 6880 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 264: -#line 1957 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(2); - } -#line 6891 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6963 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 265: -#line 1963 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1983 "glslang.y" /* yacc.c:1646 */ { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(3); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } -#line 6902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 6974 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 266: -#line 1969 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 1989 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } +#line 6985 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 267: +#line 1995 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); + } +#line 6996 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 268: +#line 2001 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); + } +#line 7007 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 269: +#line 2007 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); + } +#line 7018 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 270: +#line 2013 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(4); + } +#line 7029 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 271: +#line 2019 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(2); + } +#line 7040 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 272: +#line 2025 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(3); + } +#line 7051 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 273: +#line 2031 "glslang.y" /* yacc.c:1646 */ { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(4); } -#line 6913 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 267: -#line 1975 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(2); - } -#line 6924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 268: -#line 1981 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(3); - } -#line 6935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 269: -#line 1987 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(4); - } -#line 6946 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 270: -#line 1993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(2); - } -#line 6957 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 271: -#line 1999 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(3); - } -#line 6968 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 272: -#line 2005 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(4); - } -#line 6979 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 273: -#line 2011 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint64; - (yyval.interm.type).setVector(2); - } -#line 6990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7062 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 274: -#line 2017 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2037 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(2); + } +#line 7073 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 275: +#line 2043 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); + } +#line 7084 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 276: +#line 2049 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(4); + } +#line 7095 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 277: +#line 2055 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); + } +#line 7106 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 278: +#line 2061 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } +#line 7117 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 279: +#line 2067 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); + } +#line 7128 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 280: +#line 2073 "glslang.y" /* yacc.c:1646 */ + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(2); + } +#line 7139 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 281: +#line 2079 "glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 7001 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7150 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 275: -#line 2023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 282: +#line 2085 "glslang.y" /* yacc.c:1646 */ { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 7012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 276: -#line 2029 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); - } -#line 7023 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 277: -#line 2035 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); - } -#line 7034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 278: -#line 2041 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); - } -#line 7045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 279: -#line 2047 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); - } -#line 7056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 280: -#line 2053 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 3); - } -#line 7067 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 281: -#line 2059 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 4); - } -#line 7078 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 282: -#line 2065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 2); - } -#line 7089 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7161 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 283: -#line 2071 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2091 "glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 7100 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7174 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 284: -#line 2077 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2099 "glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).setMatrix(3, 3); } -#line 7111 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7187 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 285: -#line 2083 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2107 "glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).setMatrix(4, 4); } -#line 7122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7200 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 286: -#line 2089 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2115 "glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 7133 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7213 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 287: -#line 2095 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2123 "glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(2, 3); } -#line 7144 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7226 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 288: -#line 2101 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2131 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); } -#line 7155 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7239 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 289: -#line 2107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2139 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); } -#line 7166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7252 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 290: -#line 2113 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2147 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } -#line 7177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7265 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 291: -#line 2119 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2155 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); } -#line 7188 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7278 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 292: -#line 2125 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2163 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); } -#line 7199 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7291 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 293: -#line 2131 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2171 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); } -#line 7210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7304 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 294: -#line 2137 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2179 "glslang.y" /* yacc.c:1646 */ { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } -#line 7221 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7317 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 295: -#line 2143 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2187 "glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 7232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7328 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 296: -#line 2149 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2193 "glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).setMatrix(3, 3); } -#line 7243 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7339 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 297: -#line 2155 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2199 "glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).setMatrix(4, 4); } -#line 7254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7350 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 298: -#line 2161 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2205 "glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 2); } -#line 7265 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7361 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 299: -#line 2167 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2211 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 3); + } +#line 7372 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 300: +#line 2217 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(2, 4); + } +#line 7383 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 301: +#line 2223 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 2); + } +#line 7394 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 302: +#line 2229 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); + } +#line 7405 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 303: +#line 2235 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 4); + } +#line 7416 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 304: +#line 2241 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 2); + } +#line 7427 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 305: +#line 2247 "glslang.y" /* yacc.c:1646 */ + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 3); + } +#line 7438 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 306: +#line 2253 "glslang.y" /* yacc.c:1646 */ { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 7276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 300: -#line 2173 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); - } -#line 7287 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 301: -#line 2179 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); - } -#line 7298 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 302: -#line 2185 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); - } -#line 7309 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 303: -#line 2191 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); - } -#line 7320 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 304: -#line 2197 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 3); - } -#line 7331 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 305: -#line 2203 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 4); - } -#line 7342 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 306: -#line 2209 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 2); - } -#line 7353 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7449 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 307: -#line 2215 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 2259 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } +#line 7460 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 308: +#line 2265 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7471 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 308: -#line 2221 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 309: +#line 2271 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); + } +#line 7482 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 310: +#line 2277 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); + } +#line 7493 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 311: +#line 2283 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); + } +#line 7504 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 312: +#line 2289 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); + } +#line 7515 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 313: +#line 2295 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); + } +#line 7526 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 314: +#line 2301 "glslang.y" /* yacc.c:1646 */ + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } +#line 7537 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 315: +#line 2307 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7375 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7548 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 309: -#line 2227 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 316: +#line 2313 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7559 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 310: -#line 2233 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 317: +#line 2319 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7397 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7570 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 311: -#line 2239 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 318: +#line 2325 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7581 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 312: -#line 2245 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 319: +#line 2331 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7419 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7592 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 313: -#line 2251 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 320: +#line 2337 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7430 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7603 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 314: -#line 2257 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 321: +#line 2343 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7614 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 315: -#line 2263 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 322: +#line 2349 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 7452 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7625 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 316: -#line 2269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 323: +#line 2355 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 7463 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7636 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 317: -#line 2275 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 324: +#line 2361 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 7474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7647 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 318: -#line 2281 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 325: +#line 2367 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 7485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7658 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 319: -#line 2287 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 326: +#line 2373 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 7496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7669 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 320: -#line 2293 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 327: +#line 2379 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 7507 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7680 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 321: -#line 2299 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 328: +#line 2385 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 7518 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7691 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 322: -#line 2305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 329: +#line 2391 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 7529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7702 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 323: -#line 2311 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 330: +#line 2397 "glslang.y" /* yacc.c:1646 */ { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 7540 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7713 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 324: -#line 2317 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 331: +#line 2403 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtAccStructNV; + (yyval.interm.type).basicType = EbtAccStruct; } -#line 7549 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7722 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 325: -#line 2321 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 332: +#line 2407 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAccStruct; + } +#line 7731 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 333: +#line 2411 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtRayQuery; + } +#line 7740 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 334: +#line 2415 "glslang.y" /* yacc.c:1646 */ { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 7559 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7750 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 326: -#line 2326 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 335: +#line 2420 "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); } -#line 7569 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7760 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 327: -#line 2332 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 336: +#line 2426 "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); } -#line 7579 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7770 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 328: -#line 2337 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 337: +#line 2431 "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, Esd3D); } -#line 7589 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7780 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 329: -#line 2342 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 338: +#line 2436 "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, EsdCube); } -#line 7599 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7790 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 330: -#line 2347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 339: +#line 2441 "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, true); } -#line 7609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7800 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 331: -#line 2352 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 340: +#line 2446 "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, EsdCube, false, true); } -#line 7619 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7810 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 332: -#line 2357 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 341: +#line 2451 "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); } -#line 7629 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7820 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 333: -#line 2362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 342: +#line 2456 "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); } -#line 7639 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7830 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 334: -#line 2368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 343: +#line 2462 "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); } -#line 7649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7840 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 335: -#line 2373 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 344: +#line 2467 "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); } -#line 7659 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7850 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 336: -#line 2378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 345: +#line 2472 "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, true); } -#line 7669 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7860 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 337: -#line 2383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 346: +#line 2477 "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, EsdCube, true); } -#line 7679 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7870 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 338: -#line 2388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 347: +#line 2482 "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, EsdCube, true, true); } -#line 7689 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7880 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 339: -#line 2393 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 348: +#line 2487 "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, Esd1D); } -#line 7700 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7891 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 340: -#line 2399 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 349: +#line 2493 "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); } -#line 7711 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7902 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 341: -#line 2405 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 350: +#line 2499 "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, Esd3D); } -#line 7722 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7913 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 342: -#line 2411 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 351: +#line 2505 "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, EsdCube); } -#line 7733 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7924 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 343: -#line 2417 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 352: +#line 2511 "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, Esd1D, false, true); } -#line 7744 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7935 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 344: -#line 2423 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 353: +#line 2517 "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, true); } -#line 7755 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7946 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 345: -#line 2429 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 354: +#line 2523 "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, EsdCube, false, true); } -#line 7766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7957 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 346: -#line 2435 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 355: +#line 2529 "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, Esd1D, true); } -#line 7777 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7968 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 347: -#line 2441 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 356: +#line 2535 "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); } -#line 7788 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7979 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 348: -#line 2447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 357: +#line 2541 "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, Esd1D, true, true); } -#line 7799 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 7990 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 349: -#line 2453 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 358: +#line 2547 "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, true); } -#line 7810 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8001 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 350: -#line 2459 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 359: +#line 2553 "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, EsdCube, true); } -#line 7821 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8012 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 351: -#line 2465 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 360: +#line 2559 "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, EsdCube, true, true); } -#line 7832 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8023 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 352: -#line 2471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 361: +#line 2565 "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); } -#line 7842 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8033 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 353: -#line 2477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 362: +#line 2571 "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); } -#line 7852 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8043 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 354: -#line 2482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 363: +#line 2576 "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, Esd3D); } -#line 7862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8053 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 355: -#line 2487 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 364: +#line 2581 "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); } -#line 7872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8063 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 356: -#line 2492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 365: +#line 2586 "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); } -#line 7882 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8073 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 357: -#line 2497 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 366: +#line 2591 "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); } -#line 7892 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8083 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 358: -#line 2502 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 367: +#line 2596 "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); } -#line 7902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8093 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 359: -#line 2507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 368: +#line 2601 "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); } -#line 7912 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8103 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 360: -#line 2513 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 369: +#line 2607 "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); } -#line 7922 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8113 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 361: -#line 2518 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 370: +#line 2612 "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); } -#line 7932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8123 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 362: -#line 2523 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 371: +#line 2617 "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); } -#line 7942 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8133 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 363: -#line 2528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 372: +#line 2622 "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, true); } -#line 7952 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8143 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 364: -#line 2533 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 373: +#line 2627 "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); } -#line 7962 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8153 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 365: -#line 2538 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 374: +#line 2632 "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, true); } -#line 7972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8163 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 366: -#line 2543 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 375: +#line 2637 "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); } -#line 7982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8173 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 367: -#line 2548 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 376: +#line 2642 "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); } -#line 7992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8183 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 368: -#line 2554 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 377: +#line 2648 "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); } -#line 8002 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8193 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 369: -#line 2559 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 378: +#line 2653 "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); } -#line 8012 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8203 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 370: -#line 2564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 379: +#line 2658 "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, Esd3D); } -#line 8022 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8213 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 371: -#line 2569 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 380: +#line 2663 "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); } -#line 8032 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8223 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 372: -#line 2574 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 381: +#line 2668 "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); } -#line 8042 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8233 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 373: -#line 2579 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 382: +#line 2673 "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); } -#line 8052 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8243 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 374: -#line 2584 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 383: +#line 2678 "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, Esd3D); } -#line 8062 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8253 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 375: -#line 2589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 384: +#line 2683 "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); } -#line 8072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8263 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 376: -#line 2594 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 385: +#line 2688 "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, true); } -#line 8082 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8273 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 377: -#line 2599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 386: +#line 2693 "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); } -#line 8092 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8283 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 378: -#line 2604 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 387: +#line 2698 "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, Esd3D); } -#line 8102 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8293 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 379: -#line 2609 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 388: +#line 2703 "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); } -#line 8112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8303 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 380: -#line 2614 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 389: +#line 2708 "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); } -#line 8122 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8313 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 381: -#line 2619 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 390: +#line 2713 "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); } -#line 8132 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8323 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 382: -#line 2624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 391: +#line 2718 "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(true); } -#line 8142 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8333 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 383: -#line 2630 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 392: +#line 2724 "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); } -#line 8152 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8343 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 384: -#line 2635 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 393: +#line 2729 "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); } -#line 8162 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8353 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 385: -#line 2640 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 394: +#line 2734 "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); } -#line 8173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8364 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 386: -#line 2646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 395: +#line 2740 "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); } -#line 8184 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8375 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 387: -#line 2652 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 396: +#line 2746 "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); } -#line 8194 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8385 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 388: -#line 2657 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 397: +#line 2751 "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); } -#line 8204 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8395 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 389: -#line 2662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 398: +#line 2756 "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); } -#line 8214 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8405 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 390: -#line 2667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 399: +#line 2761 "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); } -#line 8225 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8416 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 391: -#line 2673 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 400: +#line 2767 "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); } -#line 8235 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8426 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 392: -#line 2678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 401: +#line 2772 "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); } -#line 8245 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8436 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 393: -#line 2683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 402: +#line 2777 "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); } -#line 8255 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8446 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 394: -#line 2688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 403: +#line 2782 "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); } -#line 8266 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8457 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 395: -#line 2694 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 404: +#line 2788 "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); } -#line 8276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8467 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 396: -#line 2699 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 405: +#line 2793 "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); } -#line 8286 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8477 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 397: -#line 2704 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 406: +#line 2798 "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); } -#line 8296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8487 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 398: -#line 2709 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 407: +#line 2803 "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); } -#line 8307 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8498 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 399: -#line 2715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 408: +#line 2809 "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); } -#line 8317 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8508 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 400: -#line 2720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 409: +#line 2814 "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); } -#line 8327 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8518 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 401: -#line 2725 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 410: +#line 2819 "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, Esd1D); } -#line 8337 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8528 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 402: -#line 2730 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 411: +#line 2824 "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); } -#line 8348 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8539 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 403: -#line 2736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 412: +#line 2830 "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); } -#line 8359 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8550 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 404: -#line 2742 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 413: +#line 2836 "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); } -#line 8370 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8561 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 405: -#line 2748 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 414: +#line 2842 "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); } -#line 8381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8572 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 406: -#line 2754 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 415: +#line 2848 "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, Esd1D, true); } -#line 8391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8582 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 407: -#line 2759 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 416: +#line 2853 "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); } -#line 8402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8593 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 408: -#line 2765 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 417: +#line 2859 "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); } -#line 8413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8604 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 409: -#line 2771 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 418: +#line 2865 "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); } -#line 8424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8615 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 410: -#line 2777 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 419: +#line 2871 "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); } -#line 8434 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8625 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 411: -#line 2782 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 420: +#line 2876 "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, true); } -#line 8444 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8635 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 412: -#line 2787 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 421: +#line 2881 "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); } -#line 8454 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8645 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 413: -#line 2792 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 422: +#line 2886 "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); } -#line 8464 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8655 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 414: -#line 2797 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 423: +#line 2891 "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, EsdRect); } -#line 8474 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8665 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 415: -#line 2802 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 424: +#line 2896 "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, EsdRect); } -#line 8485 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8676 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 416: -#line 2808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 425: +#line 2902 "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, EsdRect); } -#line 8495 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8686 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 417: -#line 2813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 426: +#line 2907 "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, EsdRect); } -#line 8505 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8696 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 418: -#line 2818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 427: +#line 2912 "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, EsdBuffer); } -#line 8515 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8706 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 419: -#line 2823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 428: +#line 2917 "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, EsdBuffer); } -#line 8526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8717 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 420: -#line 2829 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 429: +#line 2923 "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, EsdBuffer); } -#line 8536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8727 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 421: -#line 2834 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 430: +#line 2928 "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, EsdBuffer); } -#line 8546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8737 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 422: -#line 2839 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 431: +#line 2933 "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, false, false, true); } -#line 8556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8747 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 423: -#line 2844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 432: +#line 2938 "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, false, false, true); } -#line 8567 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8758 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 424: -#line 2850 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 433: +#line 2944 "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, false, false, true); } -#line 8577 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8768 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 425: -#line 2855 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 434: +#line 2949 "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, false, false, true); } -#line 8587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8778 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 426: -#line 2860 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 435: +#line 2954 "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, false, true); } -#line 8597 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8788 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 427: -#line 2865 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 436: +#line 2959 "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, false, true); } -#line 8608 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8799 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 428: -#line 2871 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 437: +#line 2965 "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, true, false, true); } -#line 8618 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8809 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 429: -#line 2876 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 438: +#line 2970 "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, false, true); } -#line 8628 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8819 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 430: -#line 2881 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 439: +#line 2975 "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.setImage(EbtFloat, Esd1D); } -#line 8638 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8829 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 431: -#line 2886 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 440: +#line 2980 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 8649 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8840 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 432: -#line 2892 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 441: +#line 2986 "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.setImage(EbtInt, Esd1D); } -#line 8659 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8850 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 433: -#line 2897 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 442: +#line 2991 "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.setImage(EbtUint, Esd1D); } -#line 8669 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8860 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 434: -#line 2902 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 443: +#line 2996 "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.setImage(EbtFloat, Esd2D); } -#line 8679 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8870 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 435: -#line 2907 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 444: +#line 3001 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 8690 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8881 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 436: -#line 2913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 445: +#line 3007 "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.setImage(EbtInt, Esd2D); } -#line 8700 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8891 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 437: -#line 2918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 446: +#line 3012 "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.setImage(EbtUint, Esd2D); } -#line 8710 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8901 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 438: -#line 2923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 447: +#line 3017 "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.setImage(EbtFloat, Esd3D); } -#line 8720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8911 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 439: -#line 2928 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 448: +#line 3022 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 8731 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8922 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 440: -#line 2934 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 449: +#line 3028 "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.setImage(EbtInt, Esd3D); } -#line 8741 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8932 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 441: -#line 2939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 450: +#line 3033 "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.setImage(EbtUint, Esd3D); } -#line 8751 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8942 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 442: -#line 2944 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 451: +#line 3038 "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.setImage(EbtFloat, EsdRect); } -#line 8761 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8952 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 443: -#line 2949 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 452: +#line 3043 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 8772 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8963 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 444: -#line 2955 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 453: +#line 3049 "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.setImage(EbtInt, EsdRect); } -#line 8782 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8973 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 445: -#line 2960 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 454: +#line 3054 "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.setImage(EbtUint, EsdRect); } -#line 8792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8983 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 446: -#line 2965 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 455: +#line 3059 "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.setImage(EbtFloat, EsdCube); } -#line 8802 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 8993 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 447: -#line 2970 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 456: +#line 3064 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 8813 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9004 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 448: -#line 2976 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 457: +#line 3070 "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.setImage(EbtInt, EsdCube); } -#line 8823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9014 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 449: -#line 2981 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 458: +#line 3075 "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.setImage(EbtUint, EsdCube); } -#line 8833 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9024 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 450: -#line 2986 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 459: +#line 3080 "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.setImage(EbtFloat, EsdBuffer); } -#line 8843 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9034 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 451: -#line 2991 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 460: +#line 3085 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 8854 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9045 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 452: -#line 2997 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 461: +#line 3091 "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.setImage(EbtInt, EsdBuffer); } -#line 8864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9055 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 453: -#line 3002 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 462: +#line 3096 "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.setImage(EbtUint, EsdBuffer); } -#line 8874 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9065 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 454: -#line 3007 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 463: +#line 3101 "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.setImage(EbtFloat, Esd1D, true); } -#line 8884 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9075 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 455: -#line 3012 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 464: +#line 3106 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 8895 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9086 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 456: -#line 3018 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 465: +#line 3112 "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.setImage(EbtInt, Esd1D, true); } -#line 8905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9096 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 457: -#line 3023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 466: +#line 3117 "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.setImage(EbtUint, Esd1D, true); } -#line 8915 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9106 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 458: -#line 3028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 467: +#line 3122 "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.setImage(EbtFloat, Esd2D, true); } -#line 8925 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9116 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 459: -#line 3033 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 468: +#line 3127 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 8936 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9127 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 460: -#line 3039 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 469: +#line 3133 "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.setImage(EbtInt, Esd2D, true); } -#line 8946 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9137 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 461: -#line 3044 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 470: +#line 3138 "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.setImage(EbtUint, Esd2D, true); } -#line 8956 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9147 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 462: -#line 3049 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 471: +#line 3143 "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.setImage(EbtFloat, EsdCube, true); } -#line 8966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9157 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 463: -#line 3054 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 472: +#line 3148 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 8977 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9168 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 464: -#line 3060 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 473: +#line 3154 "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.setImage(EbtInt, EsdCube, true); } -#line 8987 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9178 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 465: -#line 3065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 474: +#line 3159 "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.setImage(EbtUint, EsdCube, true); } -#line 8997 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9188 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 466: -#line 3070 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 475: +#line 3164 "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.setImage(EbtFloat, Esd2D, false, false, true); } -#line 9007 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9198 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 467: -#line 3075 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 476: +#line 3169 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 9018 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9209 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 468: -#line 3081 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 477: +#line 3175 "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.setImage(EbtInt, Esd2D, false, false, true); } -#line 9028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9219 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 469: -#line 3086 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 478: +#line 3180 "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.setImage(EbtUint, Esd2D, false, false, true); } -#line 9038 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9229 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 470: -#line 3091 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 479: +#line 3185 "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.setImage(EbtFloat, Esd2D, true, false, true); } -#line 9048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9239 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 471: -#line 3096 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 480: +#line 3190 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 9059 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9250 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 472: -#line 3102 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 481: +#line 3196 "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.setImage(EbtInt, Esd2D, true, false, true); } -#line 9069 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9260 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 473: -#line 3107 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 482: +#line 3201 "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.setImage(EbtUint, Esd2D, true, false, true); } -#line 9079 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9270 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 474: -#line 3112 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 483: +#line 3206 "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; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 9090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9281 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 475: -#line 3118 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 484: +#line 3212 "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; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 9101 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9292 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 476: -#line 3124 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 485: +#line 3218 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 9112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9303 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 477: -#line 3130 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 486: +#line 3224 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 9123 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9314 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 478: -#line 3136 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 487: +#line 3230 "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"); @@ -9131,11 +9322,11 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 9135 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9326 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 479: -#line 3143 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 488: +#line 3237 "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"); @@ -9143,98 +9334,98 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 9147 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9338 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 480: -#line 3150 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 489: +#line 3244 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 9158 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9349 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 481: -#line 3156 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 490: +#line 3250 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 9169 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9360 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 482: -#line 3162 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 491: +#line 3256 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 9180 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9371 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 483: -#line 3168 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 492: +#line 3262 "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()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 9191 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9382 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 484: -#line 3174 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 493: +#line 3268 "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()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).coopmat = true; } -#line 9202 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9393 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 485: -#line 3180 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 494: +#line 3274 "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()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).coopmat = true; } -#line 9213 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9404 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 486: -#line 3186 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 495: +#line 3280 "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()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).coopmat = true; } -#line 9224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9415 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 487: -#line 3193 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 496: +#line 3287 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 9234 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9425 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 488: -#line 3198 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 497: +#line 3292 "glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the @@ -9248,47 +9439,47 @@ yyreduce: } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 9252 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9443 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 489: -#line 3214 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 498: +#line 3308 "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()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 9262 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9453 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 490: -#line 3219 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 499: +#line 3313 "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()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 9272 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9463 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 491: -#line 3224 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 500: +#line 3318 "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()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 9282 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9473 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 492: -#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 501: +#line 3326 "glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 9288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9479 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 493: -#line 3232 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 502: +#line 3326 "glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -9300,17 +9491,17 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 9304 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9495 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 494: -#line 3243 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 503: +#line 3337 "glslang.y" /* yacc.c:1646 */ { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 9310 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9501 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 495: -#line 3243 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 504: +#line 3337 "glslang.y" /* yacc.c:1646 */ { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -9318,19 +9509,19 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 9322 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9513 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 496: -#line 3253 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 505: +#line 3347 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 9330 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9521 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 497: -#line 3256 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 506: +#line 3350 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { @@ -9341,11 +9532,11 @@ yyreduce: (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 9345 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9536 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 498: -#line 3269 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 507: +#line 3363 "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"); @@ -9368,11 +9559,11 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 9372 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9563 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 499: -#line 3291 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 508: +#line 3385 "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"); @@ -9397,38 +9588,38 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 9401 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9592 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 500: -#line 3318 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 509: +#line 3412 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 9410 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9601 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 501: -#line 3322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 510: +#line 3416 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 9418 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9609 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 502: -#line 3328 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 511: +#line 3422 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 9428 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9619 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 503: -#line 3333 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 512: +#line 3427 "glslang.y" /* yacc.c:1646 */ { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -9437,235 +9628,235 @@ yyreduce: (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 9441 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9632 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 504: -#line 3344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 513: +#line 3438 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 9449 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9640 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 505: -#line 3348 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 514: +#line 3442 "glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 9460 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9651 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 506: -#line 3354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 515: +#line 3448 "glslang.y" /* yacc.c:1646 */ { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 9471 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 507: -#line 3365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); - } -#line 9479 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 508: -#line 3368 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); - } -#line 9487 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ - break; - - case 509: -#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 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 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 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 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 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 3389 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9662 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 516: -#line 3390 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9535 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 3459 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); + } +#line 9670 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 517: -#line 3391 "MachineIndependent/glslang.y" /* yacc.c:1646 */ - { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 3462 "glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + } +#line 9678 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 518: -#line 3392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3469 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9684 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 519: -#line 3394 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3473 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9553 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9690 "glslang_tab.cpp" /* yacc.c:1646 */ break; case 520: -#line 3400 "MachineIndependent/glslang.y" /* yacc.c:1646 */ +#line 3474 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9696 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 521: +#line 3480 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9702 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 522: +#line 3481 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9708 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 523: +#line 3482 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9714 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 524: +#line 3483 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9720 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 525: +#line 3484 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9726 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 526: +#line 3485 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9732 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 527: +#line 3486 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9738 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 528: +#line 3488 "glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 9744 "glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 529: +#line 3494 "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"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 9563 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9754 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 521: -#line 3409 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 530: +#line 3503 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9569 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9760 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 522: -#line 3410 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 531: +#line 3504 "glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 9578 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9769 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 523: -#line 3414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 532: +#line 3508 "glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 9587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9778 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 524: -#line 3418 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 533: +#line 3512 "glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 9597 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9788 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 525: -#line 3426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 534: +#line 3520 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9603 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9794 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 526: -#line 3427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 535: +#line 3521 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9609 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9800 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 527: -#line 3431 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 536: +#line 3525 "glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } -#line 9617 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9808 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 528: -#line 3434 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 537: +#line 3528 "glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9817 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 529: -#line 3438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 538: +#line 3532 "glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9827 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 530: -#line 3443 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 539: +#line 3537 "glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9647 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9838 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 531: -#line 3452 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 540: +#line 3546 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9655 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9846 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 532: -#line 3455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 541: +#line 3549 "glslang.y" /* yacc.c:1646 */ { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 9665 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9856 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 533: -#line 3463 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 542: +#line 3557 "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 || @@ -9674,11 +9865,11 @@ yyreduce: (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 9678 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9869 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 534: -#line 3471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 543: +#line 3565 "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)) { @@ -9687,76 +9878,76 @@ yyreduce: } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 9691 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9882 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 535: -#line 3482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 544: +#line 3576 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9697 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9888 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 536: -#line 3483 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 545: +#line 3577 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 9703 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9894 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 537: -#line 3487 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 546: +#line 3581 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9711 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9902 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 538: -#line 3491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 547: +#line 3585 "glslang.y" /* yacc.c:1646 */ { parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9720 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9911 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 539: -#line 3498 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 548: +#line 3592 "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); } -#line 9729 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9920 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 540: -#line 3505 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 549: +#line 3599 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 9738 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9929 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 541: -#line 3509 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 550: +#line 3603 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 9747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9938 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 542: -#line 3517 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 551: +#line 3611 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 9756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9947 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 543: -#line 3521 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 552: +#line 3615 "glslang.y" /* yacc.c:1646 */ { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); @@ -9767,28 +9958,28 @@ yyreduce: else (yyval.interm.intermTypedNode) = 0; } -#line 9771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9962 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 544: -#line 3534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 553: +#line 3628 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9779 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9970 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 545: -#line 3538 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 554: +#line 3632 "glslang.y" /* yacc.c:1646 */ { parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9788 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9979 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 546: -#line 3545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 555: +#line 3639 "glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -9797,11 +9988,11 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 9801 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 9992 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 547: -#line 3553 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 556: +#line 3647 "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(); @@ -9811,27 +10002,27 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9815 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10006 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 548: -#line 3565 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 557: +#line 3659 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } -#line 9823 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10014 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 549: -#line 3568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 558: +#line 3662 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9831 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10022 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 550: -#line 3574 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 559: +#line 3668 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -9844,11 +10035,11 @@ yyreduce: (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 9848 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10039 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 551: -#line 3586 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 560: +#line 3680 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -9858,28 +10049,28 @@ yyreduce: else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 9862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10053 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 552: -#line 3598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 561: +#line 3692 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9870 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10061 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 553: -#line 3602 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 562: +#line 3696 "glslang.y" /* yacc.c:1646 */ { parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9879 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10070 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 554: -#line 3609 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 563: +#line 3703 "glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -9888,11 +10079,11 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9892 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10083 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 555: -#line 3617 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 564: +#line 3711 "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); @@ -9900,21 +10091,21 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9904 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10095 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 556: -#line 3624 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 565: +#line 3718 "glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10105 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 557: -#line 3629 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 566: +#line 3723 "glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -9926,22 +10117,22 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9930 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10121 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 558: -#line 3640 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 567: +#line 3734 "glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 9941 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10132 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 559: -#line 3646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 568: +#line 3740 "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); @@ -9954,81 +10145,81 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 9958 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10149 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 560: -#line 3661 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 569: +#line 3755 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10157 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 561: -#line 3664 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 570: +#line 3758 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 9974 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10165 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 562: -#line 3670 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 571: +#line 3764 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 9982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10173 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 563: -#line 3673 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 572: +#line 3767 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermTypedNode) = 0; } -#line 9990 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10181 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 564: -#line 3679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 573: +#line 3773 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 9999 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10190 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 565: -#line 3683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 574: +#line 3777 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 10008 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10199 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 566: -#line 3690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 575: +#line 3784 "glslang.y" /* yacc.c:1646 */ { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 10018 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10209 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 567: -#line 3695 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 576: +#line 3789 "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", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 10028 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10219 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 568: -#line 3700 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 577: +#line 3794 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -10036,83 +10227,83 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 10040 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10231 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 569: -#line 3707 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 578: +#line 3801 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 10048 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10239 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 570: -#line 3710 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 579: +#line 3804 "glslang.y" /* yacc.c:1646 */ { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 10057 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10248 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 571: -#line 3719 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 580: +#line 3813 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 10066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10257 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 572: -#line 3723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 581: +#line 3817 "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)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 10077 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10268 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 573: -#line 3732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 582: +#line 3826 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 10085 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10276 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 574: -#line 3735 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 583: +#line 3829 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 10093 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10284 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 575: -#line 3739 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 584: +#line 3833 "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"); (yyval.interm.intermNode) = nullptr; } -#line 10103 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10294 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 576: -#line 3748 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 585: +#line 3842 "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); } -#line 10112 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10303 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 577: -#line 3752 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 586: +#line 3846 "glslang.y" /* yacc.c:1646 */ { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -10128,52 +10319,52 @@ yyreduce: (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); (yyval.interm.intermNode)->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable); } -#line 10132 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10323 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 578: -#line 3771 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 587: +#line 3865 "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"); } -#line 10141 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10332 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 579: -#line 3777 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 588: +#line 3871 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 10149 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10340 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 580: -#line 3780 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 589: +#line 3874 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 10157 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10348 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 581: -#line 3785 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 590: +#line 3879 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 10165 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10356 "glslang_tab.cpp" /* yacc.c:1646 */ break; - case 582: -#line 3788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + case 591: +#line 3882 "glslang.y" /* yacc.c:1646 */ { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 10173 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10364 "glslang_tab.cpp" /* yacc.c:1646 */ break; -#line 10177 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ +#line 10368 "glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -10401,5 +10592,6 @@ yyreturn: #endif return yyresult; } -#line 3793 "MachineIndependent/glslang.y" /* yacc.c:1906 */ +#line 3887 "glslang.y" /* yacc.c:1906 */ + diff --git a/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index f4f411473..31c8f9024 100644 --- a/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/core/deps/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -30,8 +30,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED -# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +#ifndef YY_YY_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_GLSLANG_TAB_CPP_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -203,256 +203,265 @@ extern int yydebug; 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, - TEXTURE2DMSARRAY = 526, - ITEXTURE2DMSARRAY = 527, - UTEXTURE2DMSARRAY = 528, - F16TEXTURE1D = 529, - F16TEXTURE2D = 530, - F16TEXTURE3D = 531, - F16TEXTURE2DRECT = 532, - F16TEXTURECUBE = 533, - F16TEXTURE1DARRAY = 534, - F16TEXTURE2DARRAY = 535, - F16TEXTURECUBEARRAY = 536, - F16TEXTUREBUFFER = 537, - F16TEXTURE2DMS = 538, - F16TEXTURE2DMSARRAY = 539, - SUBPASSINPUT = 540, - SUBPASSINPUTMS = 541, - ISUBPASSINPUT = 542, - ISUBPASSINPUTMS = 543, - USUBPASSINPUT = 544, - USUBPASSINPUTMS = 545, - F16SUBPASSINPUT = 546, - F16SUBPASSINPUTMS = 547, - LEFT_OP = 548, - RIGHT_OP = 549, - INC_OP = 550, - DEC_OP = 551, - LE_OP = 552, - GE_OP = 553, - EQ_OP = 554, - NE_OP = 555, - AND_OP = 556, - OR_OP = 557, - XOR_OP = 558, - MUL_ASSIGN = 559, - DIV_ASSIGN = 560, - ADD_ASSIGN = 561, - MOD_ASSIGN = 562, - LEFT_ASSIGN = 563, - RIGHT_ASSIGN = 564, - AND_ASSIGN = 565, - XOR_ASSIGN = 566, - OR_ASSIGN = 567, - SUB_ASSIGN = 568, - LEFT_PAREN = 569, - RIGHT_PAREN = 570, - LEFT_BRACKET = 571, - RIGHT_BRACKET = 572, - LEFT_BRACE = 573, - RIGHT_BRACE = 574, - DOT = 575, - COMMA = 576, - COLON = 577, - EQUAL = 578, - SEMICOLON = 579, - BANG = 580, - DASH = 581, - TILDE = 582, - PLUS = 583, - STAR = 584, - SLASH = 585, - PERCENT = 586, - LEFT_ANGLE = 587, - RIGHT_ANGLE = 588, - VERTICAL_BAR = 589, - CARET = 590, - AMPERSAND = 591, - QUESTION = 592, - INVARIANT = 593, - HIGH_PRECISION = 594, - MEDIUM_PRECISION = 595, - LOW_PRECISION = 596, - PRECISION = 597, - PACKED = 598, - RESOURCE = 599, - SUPERP = 600, - FLOATCONSTANT = 601, - INTCONSTANT = 602, - UINTCONSTANT = 603, - BOOLCONSTANT = 604, - IDENTIFIER = 605, - TYPE_NAME = 606, - CENTROID = 607, - IN = 608, - OUT = 609, - INOUT = 610, - STRUCT = 611, - VOID = 612, - WHILE = 613, - BREAK = 614, - CONTINUE = 615, - DO = 616, - ELSE = 617, - FOR = 618, - IF = 619, - DISCARD = 620, - RETURN = 621, - SWITCH = 622, - CASE = 623, - DEFAULT = 624, - UNIFORM = 625, - SHARED = 626, - 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, - RESTRICT = 651, - READONLY = 652, - WRITEONLY = 653, - DEVICECOHERENT = 654, - QUEUEFAMILYCOHERENT = 655, - WORKGROUPCOHERENT = 656, - SUBGROUPCOHERENT = 657, - NONPRIVATE = 658, - NOPERSPECTIVE = 659, - EXPLICITINTERPAMD = 660, - PERVERTEXNV = 661, - PERPRIMITIVENV = 662, - PERVIEWNV = 663, - PERTASKNV = 664, - PRECISE = 665 + ACCSTRUCTEXT = 416, + RAYQUERYEXT = 417, + FCOOPMATNV = 418, + ICOOPMATNV = 419, + UCOOPMATNV = 420, + SAMPLERCUBEARRAY = 421, + SAMPLERCUBEARRAYSHADOW = 422, + ISAMPLERCUBEARRAY = 423, + USAMPLERCUBEARRAY = 424, + SAMPLER1D = 425, + SAMPLER1DARRAY = 426, + SAMPLER1DARRAYSHADOW = 427, + ISAMPLER1D = 428, + SAMPLER1DSHADOW = 429, + SAMPLER2DRECT = 430, + SAMPLER2DRECTSHADOW = 431, + ISAMPLER2DRECT = 432, + USAMPLER2DRECT = 433, + SAMPLERBUFFER = 434, + ISAMPLERBUFFER = 435, + USAMPLERBUFFER = 436, + SAMPLER2DMS = 437, + ISAMPLER2DMS = 438, + USAMPLER2DMS = 439, + SAMPLER2DMSARRAY = 440, + ISAMPLER2DMSARRAY = 441, + USAMPLER2DMSARRAY = 442, + SAMPLEREXTERNALOES = 443, + SAMPLEREXTERNAL2DY2YEXT = 444, + ISAMPLER1DARRAY = 445, + USAMPLER1D = 446, + USAMPLER1DARRAY = 447, + F16SAMPLER1D = 448, + F16SAMPLER2D = 449, + F16SAMPLER3D = 450, + F16SAMPLER2DRECT = 451, + F16SAMPLERCUBE = 452, + F16SAMPLER1DARRAY = 453, + F16SAMPLER2DARRAY = 454, + F16SAMPLERCUBEARRAY = 455, + F16SAMPLERBUFFER = 456, + F16SAMPLER2DMS = 457, + F16SAMPLER2DMSARRAY = 458, + F16SAMPLER1DSHADOW = 459, + F16SAMPLER2DSHADOW = 460, + F16SAMPLER1DARRAYSHADOW = 461, + F16SAMPLER2DARRAYSHADOW = 462, + F16SAMPLER2DRECTSHADOW = 463, + F16SAMPLERCUBESHADOW = 464, + F16SAMPLERCUBEARRAYSHADOW = 465, + IMAGE1D = 466, + IIMAGE1D = 467, + UIMAGE1D = 468, + IMAGE2D = 469, + IIMAGE2D = 470, + UIMAGE2D = 471, + IMAGE3D = 472, + IIMAGE3D = 473, + UIMAGE3D = 474, + IMAGE2DRECT = 475, + IIMAGE2DRECT = 476, + UIMAGE2DRECT = 477, + IMAGECUBE = 478, + IIMAGECUBE = 479, + UIMAGECUBE = 480, + IMAGEBUFFER = 481, + IIMAGEBUFFER = 482, + UIMAGEBUFFER = 483, + IMAGE1DARRAY = 484, + IIMAGE1DARRAY = 485, + UIMAGE1DARRAY = 486, + IMAGE2DARRAY = 487, + IIMAGE2DARRAY = 488, + UIMAGE2DARRAY = 489, + IMAGECUBEARRAY = 490, + IIMAGECUBEARRAY = 491, + UIMAGECUBEARRAY = 492, + IMAGE2DMS = 493, + IIMAGE2DMS = 494, + UIMAGE2DMS = 495, + IMAGE2DMSARRAY = 496, + IIMAGE2DMSARRAY = 497, + UIMAGE2DMSARRAY = 498, + F16IMAGE1D = 499, + F16IMAGE2D = 500, + F16IMAGE3D = 501, + F16IMAGE2DRECT = 502, + F16IMAGECUBE = 503, + F16IMAGE1DARRAY = 504, + F16IMAGE2DARRAY = 505, + F16IMAGECUBEARRAY = 506, + F16IMAGEBUFFER = 507, + F16IMAGE2DMS = 508, + F16IMAGE2DMSARRAY = 509, + TEXTURECUBEARRAY = 510, + ITEXTURECUBEARRAY = 511, + UTEXTURECUBEARRAY = 512, + TEXTURE1D = 513, + ITEXTURE1D = 514, + UTEXTURE1D = 515, + TEXTURE1DARRAY = 516, + ITEXTURE1DARRAY = 517, + UTEXTURE1DARRAY = 518, + TEXTURE2DRECT = 519, + ITEXTURE2DRECT = 520, + UTEXTURE2DRECT = 521, + TEXTUREBUFFER = 522, + ITEXTUREBUFFER = 523, + UTEXTUREBUFFER = 524, + TEXTURE2DMS = 525, + ITEXTURE2DMS = 526, + UTEXTURE2DMS = 527, + TEXTURE2DMSARRAY = 528, + ITEXTURE2DMSARRAY = 529, + UTEXTURE2DMSARRAY = 530, + F16TEXTURE1D = 531, + F16TEXTURE2D = 532, + F16TEXTURE3D = 533, + F16TEXTURE2DRECT = 534, + F16TEXTURECUBE = 535, + F16TEXTURE1DARRAY = 536, + F16TEXTURE2DARRAY = 537, + F16TEXTURECUBEARRAY = 538, + F16TEXTUREBUFFER = 539, + F16TEXTURE2DMS = 540, + F16TEXTURE2DMSARRAY = 541, + SUBPASSINPUT = 542, + SUBPASSINPUTMS = 543, + ISUBPASSINPUT = 544, + ISUBPASSINPUTMS = 545, + USUBPASSINPUT = 546, + USUBPASSINPUTMS = 547, + F16SUBPASSINPUT = 548, + F16SUBPASSINPUTMS = 549, + LEFT_OP = 550, + RIGHT_OP = 551, + INC_OP = 552, + DEC_OP = 553, + LE_OP = 554, + GE_OP = 555, + EQ_OP = 556, + NE_OP = 557, + AND_OP = 558, + OR_OP = 559, + XOR_OP = 560, + MUL_ASSIGN = 561, + DIV_ASSIGN = 562, + ADD_ASSIGN = 563, + MOD_ASSIGN = 564, + LEFT_ASSIGN = 565, + RIGHT_ASSIGN = 566, + AND_ASSIGN = 567, + XOR_ASSIGN = 568, + OR_ASSIGN = 569, + SUB_ASSIGN = 570, + STRING_LITERAL = 571, + LEFT_PAREN = 572, + RIGHT_PAREN = 573, + LEFT_BRACKET = 574, + RIGHT_BRACKET = 575, + LEFT_BRACE = 576, + RIGHT_BRACE = 577, + DOT = 578, + COMMA = 579, + COLON = 580, + EQUAL = 581, + SEMICOLON = 582, + BANG = 583, + DASH = 584, + TILDE = 585, + PLUS = 586, + STAR = 587, + SLASH = 588, + PERCENT = 589, + LEFT_ANGLE = 590, + RIGHT_ANGLE = 591, + VERTICAL_BAR = 592, + CARET = 593, + AMPERSAND = 594, + QUESTION = 595, + INVARIANT = 596, + HIGH_PRECISION = 597, + MEDIUM_PRECISION = 598, + LOW_PRECISION = 599, + PRECISION = 600, + PACKED = 601, + RESOURCE = 602, + SUPERP = 603, + FLOATCONSTANT = 604, + INTCONSTANT = 605, + UINTCONSTANT = 606, + BOOLCONSTANT = 607, + IDENTIFIER = 608, + TYPE_NAME = 609, + CENTROID = 610, + IN = 611, + OUT = 612, + INOUT = 613, + STRUCT = 614, + VOID = 615, + WHILE = 616, + BREAK = 617, + CONTINUE = 618, + DO = 619, + ELSE = 620, + FOR = 621, + IF = 622, + DISCARD = 623, + RETURN = 624, + SWITCH = 625, + CASE = 626, + DEFAULT = 627, + UNIFORM = 628, + SHARED = 629, + BUFFER = 630, + FLAT = 631, + SMOOTH = 632, + LAYOUT = 633, + DOUBLECONSTANT = 634, + INT16CONSTANT = 635, + UINT16CONSTANT = 636, + FLOAT16CONSTANT = 637, + INT32CONSTANT = 638, + UINT32CONSTANT = 639, + INT64CONSTANT = 640, + UINT64CONSTANT = 641, + SUBROUTINE = 642, + DEMOTE = 643, + PAYLOADNV = 644, + PAYLOADINNV = 645, + HITATTRNV = 646, + CALLDATANV = 647, + CALLDATAINNV = 648, + PAYLOADEXT = 649, + PAYLOADINEXT = 650, + HITATTREXT = 651, + CALLDATAEXT = 652, + CALLDATAINEXT = 653, + PATCH = 654, + SAMPLE = 655, + NONUNIFORM = 656, + COHERENT = 657, + VOLATILE = 658, + RESTRICT = 659, + READONLY = 660, + WRITEONLY = 661, + DEVICECOHERENT = 662, + QUEUEFAMILYCOHERENT = 663, + WORKGROUPCOHERENT = 664, + SUBGROUPCOHERENT = 665, + NONPRIVATE = 666, + SHADERCALLCOHERENT = 667, + NOPERSPECTIVE = 668, + EXPLICITINTERPAMD = 669, + PERVERTEXNV = 670, + PERPRIMITIVENV = 671, + PERVIEWNV = 672, + PERTASKNV = 673, + PRECISE = 674 }; #endif @@ -461,7 +470,7 @@ extern int yydebug; union YYSTYPE { -#line 96 "MachineIndependent/glslang.y" /* yacc.c:1909 */ +#line 97 "glslang.y" /* yacc.c:1909 */ struct { glslang::TSourceLoc loc; @@ -497,7 +506,7 @@ union YYSTYPE glslang::TArraySizes* typeParameters; } interm; -#line 501 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +#line 510 "glslang_tab.cpp.h" /* yacc.c:1909 */ }; typedef union YYSTYPE YYSTYPE; @@ -509,4 +518,4 @@ typedef union YYSTYPE YYSTYPE; int yyparse (glslang::TParseContext* pParseContext); -#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ +#endif /* !YY_YY_GLSLANG_TAB_CPP_H_INCLUDED */ diff --git a/core/deps/glslang/glslang/MachineIndependent/intermOut.cpp b/core/deps/glslang/glslang/MachineIndependent/intermOut.cpp index 3a93aedaf..593ed6f91 100644 --- a/core/deps/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/intermOut.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2017 ARM Limited. +// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -1078,18 +1079,43 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSubpassLoad: out.debug << "subpassLoad"; break; case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; - case EOpTraceNV: out.debug << "traceNV"; break; - case EOpReportIntersectionNV: out.debug << "reportIntersectionNV"; break; - case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break; - case EOpTerminateRayNV: out.debug << "terminateRayNV"; break; - case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break; + case EOpTrace: out.debug << "traceNV"; break; + case EOpReportIntersection: out.debug << "reportIntersectionNV"; break; + case EOpIgnoreIntersection: out.debug << "ignoreIntersectionNV"; break; + case EOpTerminateRay: out.debug << "terminateRayNV"; break; + case EOpExecuteCallable: out.debug << "executeCallableNV"; break; case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break; + case EOpRayQueryInitialize: out.debug << "rayQueryInitializeEXT"; break; + case EOpRayQueryTerminate: out.debug << "rayQueryTerminateEXT"; break; + case EOpRayQueryGenerateIntersection: out.debug << "rayQueryGenerateIntersectionEXT"; break; + case EOpRayQueryConfirmIntersection: out.debug << "rayQueryConfirmIntersectionEXT"; break; + case EOpRayQueryProceed: out.debug << "rayQueryProceedEXT"; break; + case EOpRayQueryGetIntersectionType: out.debug << "rayQueryGetIntersectionTypeEXT"; break; + case EOpRayQueryGetRayTMin: out.debug << "rayQueryGetRayTMinEXT"; break; + case EOpRayQueryGetRayFlags: out.debug << "rayQueryGetRayFlagsEXT"; break; + case EOpRayQueryGetIntersectionT: out.debug << "rayQueryGetIntersectionTEXT"; break; + case EOpRayQueryGetIntersectionInstanceCustomIndex: out.debug << "rayQueryGetIntersectionInstanceCustomIndexEXT"; break; + case EOpRayQueryGetIntersectionInstanceId: out.debug << "rayQueryGetIntersectionInstanceIdEXT"; break; + case EOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffset: out.debug << "rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT"; break; + case EOpRayQueryGetIntersectionGeometryIndex: out.debug << "rayQueryGetIntersectionGeometryIndexEXT"; break; + case EOpRayQueryGetIntersectionPrimitiveIndex: out.debug << "rayQueryGetIntersectionPrimitiveIndexEXT"; break; + case EOpRayQueryGetIntersectionBarycentrics: out.debug << "rayQueryGetIntersectionBarycentricsEXT"; break; + case EOpRayQueryGetIntersectionFrontFace: out.debug << "rayQueryGetIntersectionFrontFaceEXT"; break; + case EOpRayQueryGetIntersectionCandidateAABBOpaque: out.debug << "rayQueryGetIntersectionCandidateAABBOpaqueEXT"; break; + case EOpRayQueryGetIntersectionObjectRayDirection: out.debug << "rayQueryGetIntersectionObjectRayDirectionEXT"; break; + case EOpRayQueryGetIntersectionObjectRayOrigin: out.debug << "rayQueryGetIntersectionObjectRayOriginEXT"; break; + case EOpRayQueryGetWorldRayDirection: out.debug << "rayQueryGetWorldRayDirectionEXT"; break; + case EOpRayQueryGetWorldRayOrigin: out.debug << "rayQueryGetWorldRayOriginEXT"; break; + case EOpRayQueryGetIntersectionObjectToWorld: out.debug << "rayQueryGetIntersectionObjectToWorldEXT"; break; + case EOpRayQueryGetIntersectionWorldToObject: out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break; + case EOpCooperativeMatrixLoad: out.debug << "Load cooperative matrix"; break; case EOpCooperativeMatrixStore: out.debug << "Store cooperative matrix"; break; case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break; case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break; + case EOpDebugPrintf: out.debug << "Debug printf"; break; default: out.debug.message(EPrefixError, "Bad aggregation op"); } @@ -1536,4 +1562,4 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree) } // end namespace glslang -#endif // not GLSLANG_WEB \ No newline at end of file +#endif // not GLSLANG_WEB diff --git a/core/deps/glslang/glslang/MachineIndependent/iomapper.cpp b/core/deps/glslang/glslang/MachineIndependent/iomapper.cpp index 3262c0a20..9dc1da2c9 100644 --- a/core/deps/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/iomapper.cpp @@ -161,7 +161,7 @@ struct TNotifyUniformAdaptor } private: - TNotifyUniformAdaptor& operator=(TNotifyUniformAdaptor&); + TNotifyUniformAdaptor& operator=(TNotifyUniformAdaptor&) = delete; }; struct TNotifyInOutAdaptor @@ -180,7 +180,7 @@ struct TNotifyInOutAdaptor } private: - TNotifyInOutAdaptor& operator=(TNotifyInOutAdaptor&); + TNotifyInOutAdaptor& operator=(TNotifyInOutAdaptor&) = delete; }; struct TResolverUniformAdaptor { @@ -236,7 +236,7 @@ struct TResolverUniformAdaptor { bool& error; private: - TResolverUniformAdaptor& operator=(TResolverUniformAdaptor&); + TResolverUniformAdaptor& operator=(TResolverUniformAdaptor&) = delete; }; struct TResolverInOutAdaptor { @@ -283,7 +283,7 @@ struct TResolverInOutAdaptor { bool& error; private: - TResolverInOutAdaptor& operator=(TResolverInOutAdaptor&); + TResolverInOutAdaptor& operator=(TResolverInOutAdaptor&) = delete; }; // The class is used for reserving explicit uniform locations and ubo/ssbo/opaque bindings @@ -384,7 +384,7 @@ struct TSymbolValidater bool& hadError; private: - TSymbolValidater& operator=(TSymbolValidater&); + TSymbolValidater& operator=(TSymbolValidater&) = delete; }; struct TSlotCollector { @@ -398,7 +398,7 @@ struct TSlotCollector { TInfoSink& infoSink; private: - TSlotCollector& operator=(TSlotCollector&); + TSlotCollector& operator=(TSlotCollector&) = delete; }; TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate) @@ -579,7 +579,10 @@ TDefaultGlslIoResolver::TDefaultGlslIoResolver(const TIntermediate& intermediate int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) { const TType& type = ent.symbol->getType(); - const TString& name = ent.symbol->getName(); + const TString& name = IsAnonymous(ent.symbol->getName()) ? + ent.symbol->getType().getTypeName() + : + ent.symbol->getName(); if (currentStage != stage) { preStage = currentStage; currentStage = stage; @@ -663,7 +666,10 @@ int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInf int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) { const TType& type = ent.symbol->getType(); - const TString& name = ent.symbol->getName(); + const TString& name = IsAnonymous(ent.symbol->getName()) ? + ent.symbol->getType().getTypeName() + : + ent.symbol->getName(); // kick out of not doing this if (! doAutoLocationMapping()) { return ent.newLocation = -1; @@ -734,7 +740,10 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn int TDefaultGlslIoResolver::resolveBinding(EShLanguage /*stage*/, TVarEntryInfo& ent) { const TType& type = ent.symbol->getType(); - const TString& name = ent.symbol->getName(); + const TString& name = IsAnonymous(ent.symbol->getName()) ? + ent.symbol->getType().getTypeName() + : + ent.symbol->getName(); // On OpenGL arrays of opaque types take a seperate binding for each element int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; TResourceType resource = getResourceType(type); @@ -809,7 +818,10 @@ void TDefaultGlslIoResolver::endCollect(EShLanguage /*stage*/) { void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& infoSink) { const TType& type = ent.symbol->getType(); - const TString& name = ent.symbol->getName(); + const TString& name = IsAnonymous(ent.symbol->getName()) ? + ent.symbol->getType().getTypeName() + : + ent.symbol->getName(); TStorageQualifier storage = type.getQualifier().storage; EShLanguage stage(EShLangCount); switch (storage) { @@ -831,6 +843,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& if (iter->second != location) { TString errorMsg = "Invalid location: " + name; infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + hasError = true; } } } @@ -856,6 +869,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& if (iter->second != location) { TString errorMsg = "Invalid location: " + name; infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + hasError = true; } } } @@ -867,7 +881,10 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& infoSink) { const TType& type = ent.symbol->getType(); - const TString& name = ent.symbol->getName(); + const TString& name = IsAnonymous(ent.symbol->getName()) ? + ent.symbol->getType().getTypeName() + : + ent.symbol->getName(); int resource = getResourceType(type); if (type.getQualifier().hasBinding()) { TVarSlotMap& varSlotMap = resourceSlotMap[resource]; @@ -884,6 +901,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& if (iter->second != binding) { TString errorMsg = "Invalid binding: " + name; infoSink.info.message(EPrefixInternalError, errorMsg.c_str()); + hasError = true; } } } @@ -1158,7 +1176,7 @@ bool TGlslIoMapper::addStage(EShLanguage stage, TIntermediate& intermediate, TIn resolver = &defaultResolver; } resolver->addStage(stage); - inVarMaps[stage] = new TVarLiveMap, outVarMaps[stage] = new TVarLiveMap(), uniformVarMap[stage] = new TVarLiveMap(); + inVarMaps[stage] = new TVarLiveMap(); outVarMaps[stage] = new TVarLiveMap(); uniformVarMap[stage] = new TVarLiveMap(); TVarGatherTraverser iter_binding_all(intermediate, true, *inVarMaps[stage], *outVarMaps[stage], *uniformVarMap[stage]); TVarGatherTraverser iter_binding_live(intermediate, false, *inVarMaps[stage], *outVarMaps[stage], diff --git a/core/deps/glslang/glslang/MachineIndependent/iomapper.h b/core/deps/glslang/glslang/MachineIndependent/iomapper.h index 684e88d57..13a8932b9 100644 --- a/core/deps/glslang/glslang/MachineIndependent/iomapper.h +++ b/core/deps/glslang/glslang/MachineIndependent/iomapper.h @@ -129,6 +129,7 @@ public: uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage); TSlotSetMap slots; + bool hasError = false; protected: TDefaultIoResolverBase(TDefaultIoResolverBase&); @@ -260,10 +261,10 @@ public: class TGlslIoMapper : public TIoMapper { public: TGlslIoMapper() { - memset(inVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1)); - memset(outVarMaps, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1)); - memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * (EShLangCount + 1)); - memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1)); + memset(inVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(outVarMaps, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(uniformVarMap, 0, sizeof(TVarLiveMap*) * EShLangCount); + memset(intermediates, 0, sizeof(TIntermediate*) * EShLangCount); } virtual ~TGlslIoMapper() { for (size_t stage = 0; stage < EShLangCount; stage++) { diff --git a/core/deps/glslang/glslang/MachineIndependent/linkValidate.cpp b/core/deps/glslang/glslang/MachineIndependent/linkValidate.cpp old mode 100644 new mode 100755 index fe51ec93f..dcb1cc8cb --- a/core/deps/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -138,7 +138,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_MAX(spvVersion.openGl); numErrors += unit.getNumErrors(); - numPushConstants += unit.numPushConstants; + // Only one push_constant is allowed, mergeLinkerObjects() will ensure the push_constant + // is the same for all units. + if (numPushConstants > 1 || unit.numPushConstants > 1) + error(infoSink, "Only one push_constant block is allowed per stage"); + numPushConstants = std::min(numPushConstants + unit.numPushConstants, 1); if (unit.invocations != TQualifier::layoutNotSet) { if (invocations == TQualifier::layoutNotSet) @@ -286,7 +290,7 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) } // Getting this far means we have two existing trees to merge... - numShaderRecordNVBlocks += unit.numShaderRecordNVBlocks; + numShaderRecordBlocks += unit.numShaderRecordBlocks; numTaskNVBlocks += unit.numTaskNVBlocks; // Get the top-level globals of each unit @@ -299,10 +303,10 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) // Map by global name to unique ID to rationalize the same object having // differing IDs in different trees. - TMap idMap; + TIdMaps idMaps; int maxId; - seedIdMap(idMap, maxId); - remapIds(idMap, maxId + 1, unit); + seedIdMap(idMaps, maxId); + remapIds(idMaps, maxId + 1, unit); mergeBodies(infoSink, globals, unitGlobals); mergeLinkerObjects(infoSink, linkerObjects, unitLinkerObjects); @@ -311,27 +315,40 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit) #endif +static const TString& getNameForIdMap(TIntermSymbol* symbol) +{ + TShaderInterface si = symbol->getType().getShaderInterface(); + if (si == EsiNone) + return symbol->getName(); + else + return symbol->getType().getTypeName(); +} + + + // Traverser that seeds an ID map with all built-ins, and tracks the // maximum ID used. // (It would be nice to put this in a function, but that causes warnings // on having no bodies for the copy-constructor/operator=.) class TBuiltInIdTraverser : public TIntermTraverser { public: - TBuiltInIdTraverser(TMap& idMap) : idMap(idMap), maxId(0) { } + TBuiltInIdTraverser(TIdMaps& idMaps) : idMaps(idMaps), maxId(0) { } // If it's a built in, add it to the map. // Track the max ID. virtual void visitSymbol(TIntermSymbol* symbol) { const TQualifier& qualifier = symbol->getType().getQualifier(); - if (qualifier.builtIn != EbvNone) - idMap[symbol->getName()] = symbol->getId(); + if (qualifier.builtIn != EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } maxId = std::max(maxId, symbol->getId()); } int getMaxId() const { return maxId; } protected: TBuiltInIdTraverser(TBuiltInIdTraverser&); TBuiltInIdTraverser& operator=(TBuiltInIdTraverser&); - TMap& idMap; + TIdMaps& idMaps; int maxId; }; @@ -340,31 +357,33 @@ protected: // on having no bodies for the copy-constructor/operator=.) class TUserIdTraverser : public TIntermTraverser { public: - TUserIdTraverser(TMap& idMap) : idMap(idMap) { } + TUserIdTraverser(TIdMaps& idMaps) : idMaps(idMaps) { } // If its a non-built-in global, add it to the map. virtual void visitSymbol(TIntermSymbol* symbol) { const TQualifier& qualifier = symbol->getType().getQualifier(); - if (qualifier.builtIn == EbvNone) - idMap[symbol->getName()] = symbol->getId(); + if (qualifier.builtIn == EbvNone) { + TShaderInterface si = symbol->getType().getShaderInterface(); + idMaps[si][getNameForIdMap(symbol)] = symbol->getId(); + } } protected: TUserIdTraverser(TUserIdTraverser&); TUserIdTraverser& operator=(TUserIdTraverser&); - TMap& idMap; // over biggest id + TIdMaps& idMaps; // over biggest id }; // Initialize the the ID map with what we know of 'this' AST. -void TIntermediate::seedIdMap(TMap& idMap, int& maxId) +void TIntermediate::seedIdMap(TIdMaps& idMaps, int& maxId) { // all built-ins everywhere need to align on IDs and contribute to the max ID - TBuiltInIdTraverser builtInIdTraverser(idMap); + TBuiltInIdTraverser builtInIdTraverser(idMaps); treeRoot->traverse(&builtInIdTraverser); maxId = builtInIdTraverser.getMaxId(); // user variables in the linker object list need to align on ids - TUserIdTraverser userIdTraverser(idMap); + TUserIdTraverser userIdTraverser(idMaps); findLinkerObjects()->traverse(&userIdTraverser); } @@ -373,7 +392,7 @@ void TIntermediate::seedIdMap(TMap& idMap, int& maxId) // on having no bodies for the copy-constructor/operator=.) class TRemapIdTraverser : public TIntermTraverser { public: - TRemapIdTraverser(const TMap& idMap, int idShift) : idMap(idMap), idShift(idShift) { } + TRemapIdTraverser(const TIdMaps& idMaps, int idShift) : idMaps(idMaps), idShift(idShift) { } // Do the mapping: // - if the same symbol, adopt the 'this' ID // - otherwise, ensure a unique ID by shifting to a new space @@ -382,8 +401,9 @@ public: const TQualifier& qualifier = symbol->getType().getQualifier(); bool remapped = false; if (qualifier.isLinkable() || qualifier.builtIn != EbvNone) { - auto it = idMap.find(symbol->getName()); - if (it != idMap.end()) { + TShaderInterface si = symbol->getType().getShaderInterface(); + auto it = idMaps[si].find(getNameForIdMap(symbol)); + if (it != idMaps[si].end()) { symbol->changeId(it->second); remapped = true; } @@ -394,14 +414,14 @@ public: protected: TRemapIdTraverser(TRemapIdTraverser&); TRemapIdTraverser& operator=(TRemapIdTraverser&); - const TMap& idMap; + const TIdMaps& idMaps; int idShift; }; -void TIntermediate::remapIds(const TMap& idMap, int idShift, TIntermediate& unit) +void TIntermediate::remapIds(const TIdMaps& idMaps, int idShift, TIntermediate& unit) { // Remap all IDs to either share or be unique, as dictated by the idMap and idShift. - TRemapIdTraverser idTraverser(idMap, idShift); + TRemapIdTraverser idTraverser(idMaps, idShift); unit.getTreeRoot()->traverse(&idTraverser); } @@ -443,7 +463,19 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin TIntermSymbol* symbol = linkerObjects[linkObj]->getAsSymbolNode(); TIntermSymbol* unitSymbol = unitLinkerObjects[unitLinkObj]->getAsSymbolNode(); assert(symbol && unitSymbol); - if (symbol->getName() == unitSymbol->getName()) { + + bool isSameSymbol = false; + // If they are both blocks in the same shader interface, + // match by the block-name, not the identifier name. + if (symbol->getType().getBasicType() == EbtBlock && unitSymbol->getType().getBasicType() == EbtBlock) { + if (symbol->getType().getShaderInterface() == unitSymbol->getType().getShaderInterface()) { + isSameSymbol = symbol->getType().getTypeName() == unitSymbol->getType().getTypeName(); + } + } + else if (symbol->getName() == unitSymbol->getName()) + isSameSymbol = true; + + if (isSameSymbol) { // filter out copy merge = false; @@ -462,6 +494,9 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin // Check for consistent types/qualification/initializers etc. mergeErrorCheck(infoSink, *symbol, *unitSymbol, false); } + // If different symbols, verify they arn't push_constant since there can only be one per stage + else if (symbol->getQualifier().isPushConstant() && unitSymbol->getQualifier().isPushConstant()) + error(infoSink, "Only one push_constant block is allowed per stage"); } if (merge) linkerObjects.push_back(unitLinkerObjects[unitLinkObj]); @@ -520,6 +555,22 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy writeTypeComparison = true; } + // Uniform and buffer blocks must either both have an instance name, or + // must both be anonymous. The names don't need to match though. + if (symbol.getQualifier().isUniformOrBuffer() && + (IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()))) { + error(infoSink, "Matched Uniform or Storage blocks must all be anonymous," + " or all be named:"); + writeTypeComparison = true; + } + + if (symbol.getQualifier().storage == unitSymbol.getQualifier().storage && + (IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) || + (!IsAnonymous(symbol.getName()) && symbol.getName() != unitSymbol.getName()))) { + warn(infoSink, "Matched shader interfaces are using different instance names."); + writeTypeComparison = true; + } + // Precision... if (symbol.getQualifier().precision != unitSymbol.getQualifier().precision) { error(infoSink, "Precision qualifiers must match:"); @@ -555,6 +606,7 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy symbol.getQualifier().queuefamilycoherent != unitSymbol.getQualifier().queuefamilycoherent || symbol.getQualifier().workgroupcoherent != unitSymbol.getQualifier().workgroupcoherent || symbol.getQualifier().subgroupcoherent != unitSymbol.getQualifier().subgroupcoherent || + symbol.getQualifier().shadercallcoherent!= unitSymbol.getQualifier().shadercallcoherent || symbol.getQualifier().nonprivate != unitSymbol.getQualifier().nonprivate || symbol.getQualifier().volatil != unitSymbol.getQualifier().volatil || symbol.getQualifier().restrict != unitSymbol.getQualifier().restrict || @@ -589,9 +641,13 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy } } - if (writeTypeComparison) - infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus \"" << - unitSymbol.getType().getCompleteString() << "\"\n"; + if (writeTypeComparison) { + infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus "; + if (symbol.getName() != unitSymbol.getName()) + infoSink.info << unitSymbol.getName() << ": "; + + infoSink.info << "\"" << unitSymbol.getType().getCompleteString() << "\"\n"; + } #endif } @@ -721,13 +777,13 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) break; case EShLangCompute: break; - case EShLangRayGenNV: - case EShLangIntersectNV: - case EShLangAnyHitNV: - case EShLangClosestHitNV: - case EShLangMissNV: - case EShLangCallableNV: - if (numShaderRecordNVBlocks > 1) + case EShLangRayGen: + case EShLangIntersect: + case EShLangAnyHit: + case EShLangClosestHit: + case EShLangMiss: + case EShLangCallable: + if (numShaderRecordBlocks > 1) error(infoSink, "Only one shaderRecordNV buffer block is allowed per stage"); break; case EShLangMeshNV: diff --git a/core/deps/glslang/glslang/MachineIndependent/localintermediate.h b/core/deps/glslang/glslang/MachineIndependent/localintermediate.h index cb172e5e9..66f5a88ad 100644 --- a/core/deps/glslang/glslang/MachineIndependent/localintermediate.h +++ b/core/deps/glslang/glslang/MachineIndependent/localintermediate.h @@ -162,7 +162,10 @@ struct TXfbBuffer { #endif // Track a set of strings describing how the module was processed. -// Using the form: +// This includes command line options, transforms, etc., ideally inclusive enough +// to reproduce the steps used to transform the input source to the output. +// E.g., see SPIR-V OpModuleProcessed. +// Each "process" or "transform" uses is expressed in the form: // process arg0 arg1 arg2 ... // process arg0 arg1 arg2 ... // where everything is textual, and there can be zero or more arguments @@ -222,6 +225,15 @@ enum ComputeDerivativeMode { LayoutDerivativeGroupLinear, // derivative_group_linearNV }; +class TIdMaps { +public: + TMap& operator[](int i) { return maps[i]; } + const TMap& operator[](int i) const { return maps[i]; } +private: + TMap maps[EsiCount]; +}; + + // // Set of helper functions to help parse and build the tree. // @@ -244,12 +256,12 @@ public: inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), vertexSpacing(EvsNone), vertexOrder(EvoNone), interlockOrdering(EioNone), pointMode(false), earlyFragmentTests(false), - postDepthCoverage(false), depthLayout(EldNone), + postDepthCoverage(false), depthLayout(EldNone), hlslFunctionality1(false), blendEquations(0), xfbMode(false), multiStream(false), layoutOverrideCoverage(false), geoPassthroughEXT(false), - numShaderRecordNVBlocks(0), + numShaderRecordBlocks(0), computeDerivativeMode(LayoutDerivativeNone), primitives(TQualifier::layoutNotSet), numTaskNVBlocks(0), @@ -332,6 +344,9 @@ public: case EShTargetVulkan_1_1: processes.addProcess("target-env vulkan1.1"); break; + case EShTargetVulkan_1_2: + processes.addProcess("target-env vulkan1.2"); + break; default: processes.addProcess("target-env vulkanUnknown"); break; @@ -500,7 +515,7 @@ public: bool getAutoMapBindings() const { return false; } bool getAutoMapLocations() const { return false; } int getNumPushConstants() const { return 0; } - void addShaderRecordNVCount() { } + void addShaderRecordCount() { } void addTaskNVCount() { } void setUseVulkanMemoryModel() { } bool usingVulkanMemoryModel() const { return false; } @@ -580,7 +595,7 @@ public: processes.addProcess("flatten-uniform-arrays"); } bool getFlattenUniformArrays() const { return flattenUniformArrays; } -#endif +#endif void setNoStorageFormat(bool b) { useUnknownFormat = b; @@ -617,7 +632,7 @@ public: void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { textureSamplerTransformMode = mode; } int getNumPushConstants() const { return numPushConstants; } - void addShaderRecordNVCount() { ++numShaderRecordNVBlocks; } + void addShaderRecordCount() { ++numShaderRecordBlocks; } void addTaskNVCount() { ++numTaskNVBlocks; } bool setInvocations(int i) @@ -856,8 +871,8 @@ protected: void mergeCallGraphs(TInfoSink&, TIntermediate&); void mergeModes(TInfoSink&, TIntermediate&); void mergeTrees(TInfoSink&, TIntermediate&); - void seedIdMap(TMap& idMap, int& maxId); - void remapIds(const TMap& idMap, int idShift, TIntermediate&); + void seedIdMap(TIdMaps& idMaps, int& maxId); + void remapIds(const TIdMaps& idMaps, int idShift, TIntermediate&); void mergeBodies(TInfoSink&, TIntermSequence& globals, const TIntermSequence& unitGlobals); void mergeLinkerObjects(TInfoSink&, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects); void mergeImplicitArraySizes(TType&, const TType&); @@ -942,7 +957,7 @@ protected: bool multiStream; bool layoutOverrideCoverage; bool geoPassthroughEXT; - int numShaderRecordNVBlocks; + int numShaderRecordBlocks; ComputeDerivativeMode computeDerivativeMode; int primitives; int numTaskNVBlocks; diff --git a/core/deps/glslang/glslang/MachineIndependent/parseConst.cpp b/core/deps/glslang/glslang/MachineIndependent/parseConst.cpp index 1a8e6d998..7c04743ba 100644 --- a/core/deps/glslang/glslang/MachineIndependent/parseConst.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/parseConst.cpp @@ -165,17 +165,27 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node) } } } else { - // matrix from vector + // matrix from vector or scalar int count = 0; const int startIndex = index; int nodeComps = node->getType().computeNumComponents(); for (int i = startIndex; i < endIndex; i++) { if (i >= instanceSize) return; - if (i == startIndex || (i - startIndex) % (matrixRows + 1) == 0 ) + if (nodeComps == 1) { + // If there is a single scalar parameter to a matrix + // constructor, it is used to initialize all the + // components on the matrix's diagonal, with the + // remaining components initialized to 0.0. + if (i == startIndex || (i - startIndex) % (matrixRows + 1) == 0 ) + leftUnionArray[i] = rightUnionArray[count]; + else + leftUnionArray[i].setDConst(0.0); + } else { + // construct the matrix in column-major order, from + // the components provided, in order leftUnionArray[i] = rightUnionArray[count]; - else - leftUnionArray[i].setDConst(0.0); + } index++; diff --git a/core/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/core/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp old mode 100755 new mode 100644 index d7ff485c0..ec3935614 --- a/core/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -621,14 +621,25 @@ int TPpContext::CPPinclude(TPpToken* ppToken) { const TSourceLoc directiveLoc = ppToken->loc; bool startWithLocalSearch = true; // to additionally include the extra "" paths - int token = scanToken(ppToken); + int token; - // handle -style #include - if (token == '<') { + // Find the first non-whitespace char after #include + int ch = getChar(); + while (ch == ' ' || ch == '\t') { + ch = getChar(); + } + if (ch == '<') { + // style startWithLocalSearch = false; token = scanHeaderName(ppToken, '>'); + } else if (ch == '"') { + // "header-name" style + token = scanHeaderName(ppToken, '"'); + } else { + // unexpected, get the full token to generate the error + ungetChar(); + token = scanToken(ppToken); } - // otherwise ppToken already has the header name and it was "header-name" style if (token != PpAtomConstString) { parseContext.ppError(directiveLoc, "must be followed by a header name", "#include", ""); @@ -711,7 +722,9 @@ int TPpContext::CPPline(TPpToken* ppToken) const char* sourceName = nullptr; // Optional source file name. bool lineErr = false; bool fileErr = false; + disableEscapeSequences = true; token = eval(token, MIN_PRECEDENCE, false, lineRes, lineErr, ppToken); + disableEscapeSequences = false; if (! lineErr) { lineToken = lineRes; if (token == '\n') @@ -754,7 +767,9 @@ int TPpContext::CPPline(TPpToken* ppToken) // Handle #error int TPpContext::CPPerror(TPpToken* ppToken) { + disableEscapeSequences = true; int token = scanToken(ppToken); + disableEscapeSequences = false; std::string message; TSourceLoc loc = ppToken->loc; diff --git a/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp b/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp old mode 100755 new mode 100644 index cc003a8d1..1363ce2be --- a/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -87,7 +87,8 @@ namespace glslang { TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : preamble(0), strings(0), previous_token('\n'), parseContext(pc), includer(inclr), inComment(false), rootFileName(rootFileName), - currentSourceFile(rootFileName) + currentSourceFile(rootFileName), + disableEscapeSequences(false) { ifdepth = 0; for (elsetracker = 0; elsetracker < maxIfNesting; elsetracker++) diff --git a/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 8470e172a..714b5eadb 100644 --- a/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -105,13 +105,13 @@ public: } // Used for comparing macro definitions, so checks what is relevant for that. - bool operator==(const TPpToken& right) + bool operator==(const TPpToken& right) const { return space == right.space && ival == right.ival && dval == right.dval && i64val == right.i64val && strncmp(name, right.name, MaxTokenLength) == 0; } - bool operator!=(const TPpToken& right) { return ! operator==(right); } + bool operator!=(const TPpToken& right) const { return ! operator==(right); } TSourceLoc loc; // True if a space (for white space or a removed comment) should also be @@ -695,6 +695,7 @@ protected: std::string currentSourceFile; std::istringstream strtodStream; + bool disableEscapeSequences; }; } // end namespace glslang diff --git a/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp old mode 100755 new mode 100644 index c293af3c1..e0f44f8b4 --- a/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -1026,12 +1026,80 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) case '\'': return pp->characterLiteral(ppToken); case '"': - // TODO: If this gets enhanced to handle escape sequences, or - // anything that is different than what #include needs, then - // #include needs to use scanHeaderName() for this. + // #include uses scanHeaderName() to ignore these escape sequences. ch = getch(); while (ch != '"' && ch != '\n' && ch != EndOfInput) { if (len < MaxTokenLength) { + if (ch == '\\' && !pp->disableEscapeSequences) { + int nextCh = getch(); + switch (nextCh) { + case '\'': ch = 0x27; break; + case '"': ch = 0x22; break; + case '?': ch = 0x3f; break; + case '\\': ch = 0x5c; break; + case 'a': ch = 0x07; break; + case 'b': ch = 0x08; break; + case 'f': ch = 0x0c; break; + case 'n': ch = 0x0a; break; + case 'r': ch = 0x0d; break; + case 't': ch = 0x09; break; + case 'v': ch = 0x0b; break; + case 'x': + // Hex value, arbitrary number of characters. Terminated by the first + // non-hex digit + { + int numDigits = 0; + ch = 0; + while (true) { + nextCh = getch(); + if (nextCh >= '0' && nextCh <= '9') + nextCh -= '0'; + else if (nextCh >= 'A' && nextCh <= 'F') + nextCh -= 'A' - 10; + else if (nextCh >= 'a' && nextCh <= 'f') + nextCh -= 'a' - 10; + else { + ungetch(); + break; + } + numDigits++; + ch = ch * 0x10 + nextCh; + } + if (numDigits == 0) { + pp->parseContext.ppError(ppToken->loc, "Expected hex value in escape sequence", "string", ""); + } + break; + } + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + // Octal value, up to three octal digits + { + int numDigits = 1; + ch = nextCh - '0'; + while (numDigits < 3) { + nextCh = getch(); + if (nextCh >= '0' && nextCh <= '7') + nextCh -= '0'; + else { + ungetch(); + break; + } + numDigits++; + ch = ch * 8 + nextCh; + } + break; + } + default: + pp->parseContext.ppError(ppToken->loc, "Invalid escape sequence", "string", ""); + break; + } + } ppToken->name[len] = (char)ch; len++; ch = getch(); @@ -1120,10 +1188,12 @@ int TPpContext::tokenize(TPpToken& ppToken) continue; break; case PpAtomConstString: + // HLSL allows string literals. + // GLSL allows string literals with GL_EXT_debug_printf. if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) { - // HLSL allows string literals. - parseContext.ppError(ppToken.loc, "string literals not supported", "\"\"", ""); - continue; + parseContext.requireExtensions(ppToken.loc, 1, &E_GL_EXT_debug_printf, "string literal"); + if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf)) + continue; } break; case '\'': diff --git a/core/deps/glslang/glslang/MachineIndependent/propagateNoContraction.cpp b/core/deps/glslang/glslang/MachineIndependent/propagateNoContraction.cpp index 83a3230f5..9def592ba 100644 --- a/core/deps/glslang/glslang/MachineIndependent/propagateNoContraction.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/propagateNoContraction.cpp @@ -867,4 +867,4 @@ void PropagateNoContraction(const glslang::TIntermediate& intermediate) } }; -#endif // GLSLANG_WEB \ No newline at end of file +#endif // GLSLANG_WEB diff --git a/core/deps/glslang/glslang/MachineIndependent/reflection.cpp b/core/deps/glslang/glslang/MachineIndependent/reflection.cpp index b09367113..287693323 100644 --- a/core/deps/glslang/glslang/MachineIndependent/reflection.cpp +++ b/core/deps/glslang/glslang/MachineIndependent/reflection.cpp @@ -1188,7 +1188,7 @@ void TReflection::dump() for (int dim=0; dim<3; ++dim) if (getLocalSize(dim) > 1) - printf("Local size %s: %d\n", axis[dim], getLocalSize(dim)); + printf("Local size %s: %u\n", axis[dim], getLocalSize(dim)); printf("\n"); } diff --git a/core/deps/glslang/glslang/MachineIndependent/reflection.h b/core/deps/glslang/glslang/MachineIndependent/reflection.h index efdc8934f..0c33de459 100644 --- a/core/deps/glslang/glslang/MachineIndependent/reflection.h +++ b/core/deps/glslang/glslang/MachineIndependent/reflection.h @@ -220,4 +220,4 @@ protected: #endif // _REFLECTION_INCLUDED -#endif // GLSLANG_WEB \ No newline at end of file +#endif // GLSLANG_WEB diff --git a/core/deps/glslang/glslang/OSDependent/Web/CMakeLists.txt b/core/deps/glslang/glslang/OSDependent/Web/CMakeLists.txt index e8238c350..697b0b75f 100644 --- a/core/deps/glslang/glslang/OSDependent/Web/CMakeLists.txt +++ b/core/deps/glslang/glslang/OSDependent/Web/CMakeLists.txt @@ -1,24 +1,38 @@ -add_executable(glslang.js "glslang.js.cpp") -glslang_set_link_args(glslang.js) -target_link_libraries(glslang.js glslang SPIRV) -if(EMSCRIPTEN) - set_target_properties(glslang.js PROPERTIES - OUTPUT_NAME "glslang" - SUFFIX ".js") - em_link_pre_js(glslang.js "${CMAKE_CURRENT_SOURCE_DIR}/glslang.pre.js") +if(ENABLE_GLSLANG_JS) + add_executable(glslang.js "glslang.js.cpp") + glslang_set_link_args(glslang.js) + target_link_libraries(glslang.js glslang SPIRV) - target_link_options(glslang.js PRIVATE - "SHELL:--bind -s MODULARIZE=1") - if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE) - target_link_options(glslang.js PRIVATE - "SHELL:-s ENVIRONMENT=node -s BINARYEN_ASYNC_COMPILATION=0") - else() - target_link_options(glslang.js PRIVATE - "SHELL:-s ENVIRONMENT=web,worker") - endif() + # Link library names that start with "-" are treated as link flags. + # "-Os" should be OK in MSVC; don't use /Os because CMake won't + # treat it as a link flag. + target_link_libraries(glslang.js "-Os") - if(NOT ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE) - add_custom_command(TARGET glslang.js POST_BUILD - COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/glslang.after.js >> ${CMAKE_CURRENT_BINARY_DIR}/glslang.js) - endif() -endif(EMSCRIPTEN) + if(EMSCRIPTEN) + set_target_properties(glslang.js PROPERTIES + OUTPUT_NAME "glslang" + SUFFIX ".js") + em_link_pre_js(glslang.js "${CMAKE_CURRENT_SOURCE_DIR}/glslang.pre.js") + + target_link_libraries(glslang.js "--llvm-lto 1") + target_link_libraries(glslang.js "--closure 1") + target_link_libraries(glslang.js "-s MODULARIZE=1") + target_link_libraries(glslang.js "-s ALLOW_MEMORY_GROWTH=1") + target_link_libraries(glslang.js "-s FILESYSTEM=0") + + if(ENABLE_EMSCRIPTEN_SINGLE_FILE) + target_link_libraries(glslang.js "-s SINGLE_FILE=1") + endif(ENABLE_EMSCRIPTEN_SINGLE_FILE) + + if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE) + target_link_libraries(glslang.js "-s ENVIRONMENT=node -s BINARYEN_ASYNC_COMPILATION=0") + else() + target_link_libraries(glslang.js "-s ENVIRONMENT=web,worker") + endif() + + if(NOT ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE) + add_custom_command(TARGET glslang.js POST_BUILD + COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/glslang.after.js >> ${CMAKE_CURRENT_BINARY_DIR}/glslang.js) + endif() + endif(EMSCRIPTEN) +endif(ENABLE_GLSLANG_JS) diff --git a/core/deps/glslang/glslang/OSDependent/Web/glslang.js.cpp b/core/deps/glslang/glslang/OSDependent/Web/glslang.js.cpp index 6cb93fe27..854d293a3 100644 --- a/core/deps/glslang/glslang/OSDependent/Web/glslang.js.cpp +++ b/core/deps/glslang/glslang/OSDependent/Web/glslang.js.cpp @@ -176,7 +176,12 @@ extern "C" { * If null, the compilation failed. */ EMSCRIPTEN_KEEPALIVE -void* convert_glsl_to_spirv(const char* glsl, int stage_int, bool gen_debug, uint32_t** spirv, size_t* spirv_len) +void* convert_glsl_to_spirv(const char* glsl, + int stage_int, + bool gen_debug, + glslang::EShTargetLanguageVersion spirv_version, + uint32_t** spirv, + size_t* spirv_len) { if (glsl == nullptr) { fprintf(stderr, "Input pointer null\n"); @@ -194,6 +199,18 @@ void* convert_glsl_to_spirv(const char* glsl, int stage_int, bool gen_debug, uin return nullptr; } EShLanguage stage = static_cast(stage_int); + switch (spirv_version) { + case glslang::EShTargetSpv_1_0: + case glslang::EShTargetSpv_1_1: + case glslang::EShTargetSpv_1_2: + case glslang::EShTargetSpv_1_3: + case glslang::EShTargetSpv_1_4: + case glslang::EShTargetSpv_1_5: + break; + default: + fprintf(stderr, "Invalid SPIR-V version number\n"); + return nullptr; + } if (!initialized) { glslang::InitializeProcess(); @@ -203,8 +220,8 @@ void* convert_glsl_to_spirv(const char* glsl, int stage_int, bool gen_debug, uin glslang::TShader shader(stage); shader.setStrings(&glsl, 1); shader.setEnvInput(glslang::EShSourceGlsl, stage, glslang::EShClientVulkan, 100); - shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_1); - shader.setEnvTarget(glslang::EShTargetSpv, glslang::EShTargetSpv_1_3); + shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_0); + shader.setEnvTarget(glslang::EShTargetSpv, spirv_version); if (!shader.parse(&DefaultTBuiltInResource, 100, true, EShMsgDefault)) { fprintf(stderr, "Parse failed\n"); fprintf(stderr, "%s\n", shader.getInfoLog()); @@ -260,7 +277,7 @@ void main() { })"; uint32_t* output; size_t output_len; - void* id = convert_glsl_to_spirv(input, 4, false, &output, &output_len); + void* id = convert_glsl_to_spirv(input, 4, false, glslang::EShTargetSpv_1_0, &output, &output_len); assert(output != nullptr); assert(output_len != 0); destroy_output_buffer(id); diff --git a/core/deps/glslang/glslang/OSDependent/Web/glslang.pre.js b/core/deps/glslang/glslang/OSDependent/Web/glslang.pre.js index 7d3fd0234..46a569506 100644 --- a/core/deps/glslang/glslang/OSDependent/Web/glslang.pre.js +++ b/core/deps/glslang/glslang/OSDependent/Web/glslang.pre.js @@ -1,23 +1,34 @@ -Module['compileGLSLZeroCopy'] = function(glsl, shader_stage, gen_debug) { +Module['compileGLSLZeroCopy'] = function(glsl, shader_stage, gen_debug, spirv_version) { gen_debug = !!gen_debug; - var shader_stage_int; - if (shader_stage === 'vertex') { - shader_stage_int = 0; - } else if (shader_stage === 'fragment') { - shader_stage_int = 4; - } else if (shader_stage === 'compute') { - shader_stage_int = 5; - } else { - throw new Error("shader_stage must be 'vertex', 'fragment', or 'compute'"); + var shader_stage_int; // EShLanguage + switch (shader_stage) { + case 'vertex': shader_stage_int = 0; break; + case 'fragment': shader_stage_int = 4; break; + case 'compute': shader_stage_int = 5; break; + default: + throw new Error("shader_stage must be 'vertex', 'fragment', or 'compute'."); + } + + spirv_version = spirv_version || '1.0'; + var spirv_version_int; // EShTargetLanguageVersion + switch (spirv_version) { + case '1.0': spirv_version_int = (1 << 16) | (0 << 8); break; + case '1.1': spirv_version_int = (1 << 16) | (1 << 8); break; + case '1.2': spirv_version_int = (1 << 16) | (2 << 8); break; + case '1.3': spirv_version_int = (1 << 16) | (3 << 8); break; + case '1.4': spirv_version_int = (1 << 16) | (4 << 8); break; + case '1.5': spirv_version_int = (1 << 16) | (5 << 8); break; + default: + throw new Error("spirv_version must be '1.0' ~ '1.5'."); } var p_output = Module['_malloc'](4); var p_output_len = Module['_malloc'](4); var id = ccall('convert_glsl_to_spirv', 'number', - ['string', 'number', 'boolean', 'number', 'number'], - [glsl, shader_stage_int, gen_debug, p_output, p_output_len]); + ['string', 'number', 'boolean', 'number', 'number', 'number'], + [glsl, shader_stage_int, gen_debug, spirv_version_int, p_output, p_output_len]); var output = getValue(p_output, 'i32'); var output_len = getValue(p_output_len, 'i32'); Module['_free'](p_output); @@ -37,8 +48,8 @@ Module['compileGLSLZeroCopy'] = function(glsl, shader_stage, gen_debug) { return ret; }; -Module['compileGLSL'] = function(glsl, shader_stage, gen_debug) { - var compiled = Module['compileGLSLZeroCopy'](glsl, shader_stage, gen_debug); +Module['compileGLSL'] = function(glsl, shader_stage, gen_debug, spirv_version) { + var compiled = Module['compileGLSLZeroCopy'](glsl, shader_stage, gen_debug, spirv_version); var ret = compiled['data'].slice() compiled['free'](); return ret; diff --git a/core/deps/glslang/glslang/Public/ShaderLang.h b/core/deps/glslang/glslang/Public/ShaderLang.h index 4cc6c2f48..acb2a0785 100755 --- a/core/deps/glslang/glslang/Public/ShaderLang.h +++ b/core/deps/glslang/glslang/Public/ShaderLang.h @@ -92,15 +92,21 @@ typedef enum { EShLangGeometry, EShLangFragment, EShLangCompute, - EShLangRayGenNV, - EShLangIntersectNV, - EShLangAnyHitNV, - EShLangClosestHitNV, - EShLangMissNV, - EShLangCallableNV, + EShLangRayGen, + EShLangRayGenNV = EShLangRayGen, + EShLangIntersect, + EShLangIntersectNV = EShLangIntersect, + EShLangAnyHit, + EShLangAnyHitNV = EShLangAnyHit, + EShLangClosestHit, + EShLangClosestHitNV = EShLangClosestHit, + EShLangMiss, + EShLangMissNV = EShLangMiss, + EShLangCallable, + EShLangCallableNV = EShLangCallable, EShLangTaskNV, EShLangMeshNV, - EShLangCount, + LAST_ELEMENT_MARKER(EShLangCount), } EShLanguage; // would be better as stage, but this is ancient now typedef enum { @@ -110,14 +116,21 @@ typedef enum { EShLangGeometryMask = (1 << EShLangGeometry), EShLangFragmentMask = (1 << EShLangFragment), EShLangComputeMask = (1 << EShLangCompute), - EShLangRayGenNVMask = (1 << EShLangRayGenNV), - EShLangIntersectNVMask = (1 << EShLangIntersectNV), - EShLangAnyHitNVMask = (1 << EShLangAnyHitNV), - EShLangClosestHitNVMask = (1 << EShLangClosestHitNV), - EShLangMissNVMask = (1 << EShLangMissNV), - EShLangCallableNVMask = (1 << EShLangCallableNV), + EShLangRayGenMask = (1 << EShLangRayGen), + EShLangRayGenNVMask = EShLangRayGenMask, + EShLangIntersectMask = (1 << EShLangIntersect), + EShLangIntersectNVMask = EShLangIntersectMask, + EShLangAnyHitMask = (1 << EShLangAnyHit), + EShLangAnyHitNVMask = EShLangAnyHitMask, + EShLangClosestHitMask = (1 << EShLangClosestHit), + EShLangClosestHitNVMask = EShLangClosestHitMask, + EShLangMissMask = (1 << EShLangMiss), + EShLangMissNVMask = EShLangMissMask, + EShLangCallableMask = (1 << EShLangCallable), + EShLangCallableNVMask = EShLangCallableMask, EShLangTaskNVMask = (1 << EShLangTaskNV), EShLangMeshNVMask = (1 << EShLangMeshNV), + LAST_ELEMENT_MARKER(EShLanguageMaskCount), } EShLanguageMask; namespace glslang { @@ -128,24 +141,29 @@ typedef enum { EShSourceNone, EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL) EShSourceHlsl, // HLSL + LAST_ELEMENT_MARKER(EShSourceCount), } EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead typedef enum { EShClientNone, // use when there is no client, e.g. for validation EShClientVulkan, EShClientOpenGL, + LAST_ELEMENT_MARKER(EShClientCount), } EShClient; typedef enum { EShTargetNone, EShTargetSpv, // SPIR-V (preferred spelling) EshTargetSpv = EShTargetSpv, // legacy spelling + LAST_ELEMENT_MARKER(EShTargetCount), } EShTargetLanguage; typedef enum { EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0 EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1 + EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2 EShTargetOpenGL_450 = 450, // OpenGL + LAST_ELEMENT_MARKER(EShTargetClientVersionCount), } EShTargetClientVersion; typedef EShTargetClientVersion EshTargetClientVersion; @@ -157,6 +175,7 @@ typedef enum { EShTargetSpv_1_3 = (1 << 16) | (3 << 8), // SPIR-V 1.3 EShTargetSpv_1_4 = (1 << 16) | (4 << 8), // SPIR-V 1.4 EShTargetSpv_1_5 = (1 << 16) | (5 << 8), // SPIR-V 1.5 + LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount), } EShTargetLanguageVersion; struct TInputLanguage { @@ -206,6 +225,7 @@ typedef enum { EShOptNone, EShOptSimple, // Optimizations that can be done quickly EShOptFull, // Optimizations that will take more time + LAST_ELEMENT_MARKER(EshOptLevelCount), } EShOptimizationLevel; // @@ -214,6 +234,7 @@ typedef enum { typedef enum { EShTexSampTransKeep, // keep textures and samplers as is (default) EShTexSampTransUpgradeTextureRemoveSampler, // change texture w/o embeded sampler into sampled texture and throw away all samplers + LAST_ELEMENT_MARKER(EShTexSampTransCount), } EShTextureSamplerTransformMode; // @@ -236,6 +257,7 @@ enum EShMessages { EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (right now only for samplers) EShMsgBuiltinSymbolTable = (1 << 14), // print the builtin symbol table + LAST_ELEMENT_MARKER(EShMsgCount), }; // @@ -249,6 +271,7 @@ typedef enum { EShReflectionSeparateBuffers = (1 << 3), // buffer variables and buffer blocks are reflected separately EShReflectionAllBlockVariables = (1 << 4), // reflect all variables in blocks, even if they are inactive EShReflectionUnwrapIOBlocks = (1 << 5), // unwrap input/output blocks the same as with uniform blocks + LAST_ELEMENT_MARKER(EShReflectionCount), } EShReflectionOptions; // @@ -394,6 +417,8 @@ enum TResourceType { // - optionally call setEnv*(), see below for more detail // - optionally use setPreamble() to set a special shader string that will be // processed before all others but won't affect the validity of #version +// - optionally call addProcesses() for each setting/transform, +// see comment for class TProcesses // - call parse(): source language and target environment must be selected // either by correct setting of EShMessages sent to parse(), or by // explicitly calling setEnv*() @@ -628,11 +653,11 @@ protected: // stringNames is the optional names for all the strings. If stringNames // is null, then none of the strings has name. If a certain element in // stringNames is null, then the corresponding string does not have name. - const char* const* strings; + const char* const* strings; // explicit code to compile, see previous comment const int* lengths; const char* const* stringNames; - const char* preamble; - int numStrings; + int numStrings; // size of the above arrays + const char* preamble; // string of implicit code to compile before the explicitly provided code // a function in the source string can be renamed FROM this TO the name given in setEntryPoint. std::string sourceEntryPointName; diff --git a/core/deps/glslang/gtests/Hlsl.FromFile.cpp b/core/deps/glslang/gtests/Hlsl.FromFile.cpp index 59c687d87..f48353644 100755 --- a/core/deps/glslang/gtests/Hlsl.FromFile.cpp +++ b/core/deps/glslang/gtests/Hlsl.FromFile.cpp @@ -350,6 +350,7 @@ INSTANTIATE_TEST_CASE_P( {"hlsl.semicolons.frag", "main"}, {"hlsl.shapeConv.frag", "main"}, {"hlsl.shapeConvRet.frag", "main"}, + {"hlsl.singleArgIntPromo.vert", "main"}, {"hlsl.self_cast.frag", "main"}, {"hlsl.snorm.uav.comp", "main"}, {"hlsl.specConstant.frag", "main"}, diff --git a/core/deps/glslang/gtests/Link.FromFile.Vk.cpp b/core/deps/glslang/gtests/Link.FromFile.Vk.cpp old mode 100644 new mode 100755 index fe96bd9a8..a43edcf22 --- a/core/deps/glslang/gtests/Link.FromFile.Vk.cpp +++ b/core/deps/glslang/gtests/Link.FromFile.Vk.cpp @@ -50,6 +50,7 @@ TEST_P(LinkTestVulkan, FromFile) const size_t fileCount = fileNames.size(); const EShMessages controls = DeriveOptions(Source::GLSL, Semantics::Vulkan, Target::AST); GlslangResult result; + result.validationResult = false; // Compile each input shader file. bool success = true; @@ -108,6 +109,16 @@ INSTANTIATE_TEST_CASE_P( ::testing::ValuesIn(std::vector>({ {"link1.vk.frag", "link2.vk.frag"}, {"spv.unit1.frag", "spv.unit2.frag", "spv.unit3.frag"}, + {"link.vk.matchingPC.0.0.frag", "link.vk.matchingPC.0.1.frag", + "link.vk.matchingPC.0.2.frag"}, + {"link.vk.differentPC.0.0.frag", "link.vk.differentPC.0.1.frag", + "link.vk.differentPC.0.2.frag"}, + {"link.vk.differentPC.1.0.frag", "link.vk.differentPC.1.1.frag", + "link.vk.differentPC.1.2.frag"}, + {"link.vk.pcNamingValid.0.0.vert", "link.vk.pcNamingValid.0.1.vert"}, + {"link.vk.pcNamingInvalid.0.0.vert", "link.vk.pcNamingInvalid.0.1.vert"}, + {"link.vk.multiBlocksValid.0.0.vert", "link.vk.multiBlocksValid.0.1.vert"}, + {"link.vk.multiBlocksValid.1.0.geom", "link.vk.multiBlocksValid.1.1.geom"}, })) ); // clang-format on diff --git a/core/deps/glslang/gtests/Link.FromFile.cpp b/core/deps/glslang/gtests/Link.FromFile.cpp old mode 100644 new mode 100755 index abc33a910..dc9bb765c --- a/core/deps/glslang/gtests/Link.FromFile.cpp +++ b/core/deps/glslang/gtests/Link.FromFile.cpp @@ -100,7 +100,11 @@ INSTANTIATE_TEST_CASE_P( {"150.tesc", "150.tese", "400.tesc", "400.tese", "410.tesc", "420.tesc", "420.tese"}, {"max_vertices_0.geom"}, {"es-link1.frag", "es-link2.frag"}, - {"missingBodies.vert"} + {"missingBodies.vert"}, + {"link.multiAnonBlocksInvalid.0.0.vert", "link.multiAnonBlocksInvalid.0.1.vert"}, + {"link.multiAnonBlocksValid.0.0.vert", "link.multiAnonBlocksValid.0.1.vert"}, + {"link.multiBlocksInvalid.0.0.vert", "link.multiBlocksInvalid.0.1.vert"}, + {"link.multiBlocksValid.1.0.vert", "link.multiBlocksValid.1.1.vert"}, })) ); // clang-format on diff --git a/core/deps/glslang/gtests/Spv.FromFile.cpp b/core/deps/glslang/gtests/Spv.FromFile.cpp index 0e46e790f..1d061fb36 100644 --- a/core/deps/glslang/gtests/Spv.FromFile.cpp +++ b/core/deps/glslang/gtests/Spv.FromFile.cpp @@ -105,6 +105,7 @@ TEST_P(CompileVulkanToDebugSpirvTest, FromFile) "/baseResults/", false, true); } + TEST_P(CompileVulkan1_1ToSpirvTest, FromFile) { loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), @@ -229,6 +230,14 @@ INSTANTIATE_TEST_CASE_P( "spv.while-continue-break.vert", "spv.while-simple.vert", // vulkan-specific tests + "rayQuery.rgen", + "rayQuery-no-cse.rgen", + "rayQuery-initialize.rgen", + "rayQuery-allOps.rgen", + "rayQuery-allOps.Error.rgen", + "rayQuery-committed.Error.rgen", + "rayQuery-allOps.comp", + "rayQuery-allOps.frag", "spv.set.vert", "spv.double.comp", "spv.100ops.frag", @@ -271,6 +280,7 @@ INSTANTIATE_TEST_CASE_P( "spv.always-discard2.frag", "spv.arbPostDepthCoverage.frag", "spv.arbPostDepthCoverage_Error.frag", + "spv.atomicCounter.comp", "spv.bitCast.frag", "spv.bool.vert", "spv.boolInBlock.frag", @@ -309,6 +319,8 @@ INSTANTIATE_TEST_CASE_P( "spv.dataOut.frag", "spv.dataOutIndirect.frag", "spv.dataOutIndirect.vert", + "spv.debugPrintf.frag", + "spv.debugPrintf_Error.frag", "spv.demoteDisabled.frag", "spv.deepRvalue.frag", "spv.depthOut.frag", @@ -317,6 +329,20 @@ INSTANTIATE_TEST_CASE_P( "spv.earlyReturnDiscard.frag", "spv.extPostDepthCoverage.frag", "spv.extPostDepthCoverage_Error.frag", + "spv.ext.AnyHitShader.rahit", + "spv.ext.AnyHitShader_Errors.rahit", + "spv.ext.ClosestHitShader.rchit", + "spv.ext.ClosestHitShader_Errors.rchit", + "spv.ext.IntersectShader.rint", + "spv.ext.IntersectShader_Errors.rint", + "spv.ext.MissShader.rmiss", + "spv.ext.MissShader_Errors.rmiss", + "spv.ext.RayCallable.rcall", + "spv.ext.RayCallable_Errors.rcall", + "spv.ext.RayConstants.rgen", + "spv.ext.RayGenShader.rgen", + "spv.ext.RayGenShader11.rgen", + "spv.ext.RayGenShaderArray.rgen", "spv.float16convertonlyarith.comp", "spv.float16convertonlystorage.comp", "spv.flowControl.frag", @@ -355,6 +381,9 @@ INSTANTIATE_TEST_CASE_P( "spv.nonSquare.vert", "spv.nonuniform.frag", "spv.nonuniform2.frag", + "spv.nonuniform3.frag", + "spv.nonuniform4.frag", + "spv.nonuniform5.frag", "spv.noWorkgroup.comp", "spv.offsets.frag", "spv.Operations.frag", @@ -569,6 +598,7 @@ INSTANTIATE_TEST_CASE_P( "spv.glFragColor.frag", "spv.rankShift.comp", "spv.specConst.vert", + "spv.specTexture.frag", "spv.OVR_multiview.vert", "spv.xfbOffsetOnBlockMembersAssignment.vert", "spv.xfbOffsetOnStructMembersAssignment.vert", diff --git a/core/deps/glslang/gtests/TestFixture.cpp b/core/deps/glslang/gtests/TestFixture.cpp index baf4d16dd..ced6fcce6 100644 --- a/core/deps/glslang/gtests/TestFixture.cpp +++ b/core/deps/glslang/gtests/TestFixture.cpp @@ -61,17 +61,17 @@ EShLanguage GetShaderStage(const std::string& stage) } else if (stage == "comp") { return EShLangCompute; } else if (stage == "rgen") { - return EShLangRayGenNV; + return EShLangRayGen; } else if (stage == "rint") { - return EShLangIntersectNV; + return EShLangIntersect; } else if (stage == "rahit") { - return EShLangAnyHitNV; + return EShLangAnyHit; } else if (stage == "rchit") { - return EShLangClosestHitNV; + return EShLangClosestHit; } else if (stage == "rmiss") { - return EShLangMissNV; + return EShLangMiss; } else if (stage == "rcall") { - return EShLangCallableNV; + return EShLangCallable; } else if (stage == "task") { return EShLangTaskNV; } else if (stage == "mesh") { diff --git a/core/deps/glslang/hlsl/hlslGrammar.cpp b/core/deps/glslang/hlsl/hlslGrammar.cpp index 8ab1a900b..47ced29c0 100644 --- a/core/deps/glslang/hlsl/hlslGrammar.cpp +++ b/core/deps/glslang/hlsl/hlslGrammar.cpp @@ -2516,6 +2516,8 @@ bool HlslGrammar::acceptMemberFunctionDefinition(TIntermNode*& nodeList, const T // bool HlslGrammar::acceptFunctionParameters(TFunction& function) { + parseContext.beginParameterParsing(function); + // LEFT_PAREN if (! acceptTokenClass(EHTokLeftParen)) return false; diff --git a/core/deps/glslang/hlsl/hlslParseHelper.cpp b/core/deps/glslang/hlsl/hlslParseHelper.cpp index be665ac00..2dc173fca 100755 --- a/core/deps/glslang/hlsl/hlslParseHelper.cpp +++ b/core/deps/glslang/hlsl/hlslParseHelper.cpp @@ -69,7 +69,8 @@ HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& int clipDistanceOutput(nullptr), cullDistanceOutput(nullptr), clipDistanceInput(nullptr), - cullDistanceInput(nullptr) + cullDistanceInput(nullptr), + parsingEntrypointParameters(false) { globalUniformDefaults.clear(); globalUniformDefaults.layoutMatrix = ElmRowMajor; @@ -756,9 +757,6 @@ TIntermTyped* HlslParseContext::handleBracketOperator(const TSourceLoc& loc, TIn // indexStructBufferContent returns nullptr if it isn't a structuredbuffer (SSBO). TIntermTyped* sbArray = indexStructBufferContent(loc, base); if (sbArray != nullptr) { - if (sbArray == nullptr) - return nullptr; - // Now we'll apply the [] index to that array const TOperator idxOp = (index->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; @@ -2049,7 +2047,7 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct }; // if we aren't in the entry point, fix the IO as such and exit - if (userFunction.getName().compare(intermediate.getEntryPointName().c_str()) != 0) { + if (! isEntrypointName(userFunction.getName())) { remapNonEntryPointIO(userFunction); return nullptr; } @@ -7571,7 +7569,7 @@ const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, TFunction if (args->getAsAggregate()) { // Handle aggregates: put all args into the new function call - for (int arg=0; arggetAsAggregate()->getSequence().size()); ++arg) { + for (int arg = 0; arg < int(args->getAsAggregate()->getSequence().size()); ++arg) { // TODO: But for constness, we could avoid the new & shallowCopy, and use the pointer directly. TParameter param = { 0, new TType, nullptr }; param.type->shallowCopy(args->getAsAggregate()->getSequence()[arg]->getAsTyped()->getType()); @@ -8884,6 +8882,10 @@ void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier // bool HlslParseContext::handleInputGeometry(const TSourceLoc& loc, const TLayoutGeometry& geometry) { + // these can be declared on non-entry-points, in which case they lose their meaning + if (! parsingEntrypointParameters) + return true; + switch (geometry) { case ElgPoints: // fall through case ElgLines: // ... @@ -8914,6 +8916,10 @@ bool HlslParseContext::handleOutputGeometry(const TSourceLoc& loc, const TLayout if (language != EShLangGeometry) return true; + // these can be declared on non-entry-points, in which case they lose their meaning + if (! parsingEntrypointParameters) + return true; + switch (geometry) { case ElgPoints: case ElgLineStrip: diff --git a/core/deps/glslang/hlsl/hlslParseHelper.h b/core/deps/glslang/hlsl/hlslParseHelper.h index 822de896f..6f4166103 100644 --- a/core/deps/glslang/hlsl/hlslParseHelper.h +++ b/core/deps/glslang/hlsl/hlslParseHelper.h @@ -183,6 +183,11 @@ public: void getFullNamespaceName(TString*&) const; void addScopeMangler(TString&); + void beginParameterParsing(TFunction& function) + { + parsingEntrypointParameters = isEntrypointName(function.getName()); + } + void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); } void popSwitchSequence() { switchSequenceStack.pop_back(); } @@ -241,6 +246,7 @@ protected: TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer, TIntermTyped* scalarInit); bool isScalarConstructor(const TIntermNode*); TOperator mapAtomicOp(const TSourceLoc& loc, TOperator op, bool isImage); + bool isEntrypointName(const TString& name) { return name.compare(intermediate.getEntryPointName().c_str()) == 0; } // Return true if this node requires L-value conversion (e.g, to an imageStore). bool shouldConvertLValue(const TIntermNode*) const; @@ -494,6 +500,7 @@ protected: }; TMap textureShadowVariant; + bool parsingEntrypointParameters; }; // This is the prefix we use for built-in methods to avoid namespace collisions with diff --git a/core/deps/glslang/known_good.json b/core/deps/glslang/known_good.json index ada57d785..9cc8c444a 100644 --- a/core/deps/glslang/known_good.json +++ b/core/deps/glslang/known_good.json @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "5c019b5923c1f6bf00a3ac28114ec4a7b1faa0e2" + "commit" : "fd8e130510a6b002b28eee5885a9505040a9bdc9" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "204cd131c42b90d129073719f2766293ce35c081" + "commit" : "f8bf11a0253a32375c32cad92c841237b96696c0" } ] }