From 889572cfa0381b9f2fe9daa814106ee95f045928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Fri, 22 Dec 2017 19:53:27 -0800 Subject: [PATCH] Updated glslang. --- 3rdparty/glslang/SPIRV/GlslangToSpv.cpp | 64 +- 3rdparty/glslang/SPIRV/spvIR.h | 5 +- .../Test/310implicitSizeArrayError.vert | 2 +- 3rdparty/glslang/Test/450.vert | 8 + .../hlsl.aliasOpaque.frag.out | 5 +- .../hlsl.flattenOpaque.frag.out | 2 +- .../hlsl.flattenOpaqueInit.vert.out | 2 +- .../hlsl.flattenOpaqueInitMix.vert.out | 2 +- .../hlsl.flattenSubset.frag.out | 4 +- .../hlsl.flattenSubset2.frag.out | 6 +- .../hlsl.partialFlattenLocal.vert.out | 65 +- .../hlsl.partialFlattenMixed.vert.out | 8 +- .../310implicitSizeArrayError.vert.out | 8 +- .../glslang/Test/baseResults/330.frag.out | 4 +- .../glslang/Test/baseResults/450.vert.out | 8 +- .../glsl.entryPointRename.vert.bad.out | 2 +- .../glsl.entryPointRename.vert.out | 2 +- .../Test/baseResults/glspv.version.frag.out | 2 +- .../Test/baseResults/hlsl.PointSize.geom.out | 2 +- .../Test/baseResults/hlsl.PointSize.vert.out | 2 +- .../baseResults/hlsl.aliasOpaque.frag.out | 2 +- .../Test/baseResults/hlsl.amend.frag.out | 2 +- .../baseResults/hlsl.array.flatten.frag.out | 2 +- .../Test/baseResults/hlsl.array.frag.out | 2 +- .../hlsl.array.implicit-size.frag.out | 2 +- .../baseResults/hlsl.array.multidim.frag.out | 2 +- .../Test/baseResults/hlsl.assoc.frag.out | 2 +- .../hlsl.attribute.expression.comp.out | 2 +- .../Test/baseResults/hlsl.attribute.frag.out | 2 +- .../baseResults/hlsl.attributeC11.frag.out | 2 +- .../hlsl.attributeGlobalBuffer.frag.out | 2 +- .../Test/baseResults/hlsl.basic.comp.out | 2 +- .../Test/baseResults/hlsl.basic.geom.out | 2 +- .../Test/baseResults/hlsl.boolConv.vert.out | 384 ++-- .../Test/baseResults/hlsl.buffer.frag.out | 2 +- .../hlsl.calculatelod.dx10.frag.out | 2 +- .../Test/baseResults/hlsl.cast.frag.out | 2 +- .../hlsl.cbuffer-identifier.vert.out | 2 +- .../Test/baseResults/hlsl.charLit.vert.out | 2 +- .../Test/baseResults/hlsl.clip.frag.out | 2 +- .../baseResults/hlsl.clipdistance-1.frag.out | 2 +- .../baseResults/hlsl.clipdistance-1.geom.out | 2 +- .../baseResults/hlsl.clipdistance-1.vert.out | 2 +- .../baseResults/hlsl.clipdistance-2.frag.out | 2 +- .../baseResults/hlsl.clipdistance-2.geom.out | 2 +- .../baseResults/hlsl.clipdistance-2.vert.out | 2 +- .../baseResults/hlsl.clipdistance-3.frag.out | 2 +- .../baseResults/hlsl.clipdistance-3.geom.out | 2 +- .../baseResults/hlsl.clipdistance-3.vert.out | 2 +- .../baseResults/hlsl.clipdistance-4.frag.out | 2 +- .../baseResults/hlsl.clipdistance-4.geom.out | 2 +- .../baseResults/hlsl.clipdistance-4.vert.out | 2 +- .../baseResults/hlsl.clipdistance-5.frag.out | 2 +- .../baseResults/hlsl.clipdistance-5.vert.out | 2 +- .../baseResults/hlsl.clipdistance-6.frag.out | 2 +- .../baseResults/hlsl.clipdistance-6.vert.out | 2 +- .../baseResults/hlsl.clipdistance-7.frag.out | 2 +- .../baseResults/hlsl.clipdistance-7.vert.out | 2 +- .../baseResults/hlsl.clipdistance-8.frag.out | 2 +- .../baseResults/hlsl.clipdistance-8.vert.out | 2 +- .../baseResults/hlsl.clipdistance-9.frag.out | 2 +- .../baseResults/hlsl.clipdistance-9.vert.out | 2 +- .../Test/baseResults/hlsl.color.hull.tesc.out | 67 +- .../baseResults/hlsl.comparison.vec.frag.out | 2 +- .../baseResults/hlsl.conditional.frag.out | 2 +- .../baseResults/hlsl.constantbuffer.frag.out | 2 +- .../baseResults/hlsl.constructArray.vert.out | 2 +- .../baseResults/hlsl.constructexpr.frag.out | 2 +- .../baseResults/hlsl.constructimat.frag.out | 2 +- .../Test/baseResults/hlsl.dashI.vert.out | 2 +- .../hlsl.deadFunctionMissingBody.vert.out | 2 +- .../baseResults/hlsl.depthGreater.frag.out | 2 +- .../Test/baseResults/hlsl.depthLess.frag.out | 2 +- .../Test/baseResults/hlsl.discard.frag.out | 2 +- .../Test/baseResults/hlsl.doLoop.frag.out | 2 +- .../Test/baseResults/hlsl.domain.1.tese.out | 2 +- .../Test/baseResults/hlsl.domain.2.tese.out | 2 +- .../Test/baseResults/hlsl.domain.3.tese.out | 2 +- .../hlsl.emptystruct.init.vert.out | 2 +- .../hlsl.emptystructreturn.frag.out | 2 +- .../hlsl.emptystructreturn.vert.out | 2 +- .../Test/baseResults/hlsl.entry-in.frag.out | 2 +- .../Test/baseResults/hlsl.entry-out.frag.out | 2 +- .../baseResults/hlsl.entry.rename.frag.out | 2 +- .../hlsl.explicitDescriptorSet-2.frag.out | 2 +- .../hlsl.explicitDescriptorSet.frag.out | 2 +- .../baseResults/hlsl.flatten.return.frag.out | 2 +- .../baseResults/hlsl.flattenOpaque.frag.out | 2 +- .../hlsl.flattenOpaqueInit.vert.out | 2 +- .../hlsl.flattenOpaqueInitMix.vert.out | 2 +- .../baseResults/hlsl.flattenSubset.frag.out | 2 +- .../baseResults/hlsl.flattenSubset2.frag.out | 2 +- .../Test/baseResults/hlsl.float1.frag.out | 2 +- .../Test/baseResults/hlsl.float4.frag.out | 2 +- .../Test/baseResults/hlsl.forLoop.frag.out | 2 +- .../Test/baseResults/hlsl.fraggeom.frag.out | 2 +- .../hlsl.gather.array.dx10.frag.out | 2 +- .../hlsl.gather.basic.dx10.frag.out | 2 +- .../hlsl.gather.basic.dx10.vert.out | 2 +- .../hlsl.gather.offset.dx10.frag.out | 2 +- .../hlsl.gather.offsetarray.dx10.frag.out | 2 +- .../hlsl.gatherRGBA.array.dx10.frag.out | 2 +- .../hlsl.gatherRGBA.basic.dx10.frag.out | 2 +- .../hlsl.gatherRGBA.offset.dx10.frag.out | 2 +- .../hlsl.gatherRGBA.offsetarray.dx10.frag.out | 2 +- .../hlsl.gathercmpRGBA.offset.dx10.frag.out | 2 +- .../hlsl.getdimensions.dx10.frag.out | 2 +- .../hlsl.getdimensions.dx10.vert.out | 2 +- .../hlsl.getdimensions.rw.dx10.frag.out | 2 +- .../hlsl.getsampleposition.dx10.frag.out | 2 +- .../hlsl.global-const-init.frag.out | 2 +- .../Test/baseResults/hlsl.gs-hs-mix.tesc.out | 50 +- .../Test/baseResults/hlsl.hlslOffset.vert.out | 2 +- .../Test/baseResults/hlsl.hull.1.tesc.out | 105 +- .../Test/baseResults/hlsl.hull.2.tesc.out | 121 +- .../Test/baseResults/hlsl.hull.3.tesc.out | 121 +- .../Test/baseResults/hlsl.hull.4.tesc.out | 67 +- .../baseResults/hlsl.hull.ctrlpt-1.tesc.out | 80 +- .../baseResults/hlsl.hull.ctrlpt-2.tesc.out | 82 +- .../Test/baseResults/hlsl.hull.void.tesc.out | 4 +- .../hlsl.identifier.sample.frag.out | 2 +- .../glslang/Test/baseResults/hlsl.if.frag.out | 2 +- .../baseResults/hlsl.implicitBool.frag.out | 2 +- .../Test/baseResults/hlsl.include.vert.out | 2 +- .../Test/baseResults/hlsl.inf.vert.out | 2 +- .../Test/baseResults/hlsl.init.frag.out | 2 +- .../Test/baseResults/hlsl.init2.frag.out | 2 +- .../Test/baseResults/hlsl.inoutquals.frag.out | 2 +- .../baseResults/hlsl.intrinsic.frexp.frag.out | 2 +- .../baseResults/hlsl.intrinsic.frexp.vert.out | 2 +- .../hlsl.intrinsics.barriers.comp.out | 28 +- .../Test/baseResults/hlsl.intrinsics.comp.out | 2 +- .../hlsl.intrinsics.d3dcolortoubyte4.frag.out | 2 +- .../hlsl.intrinsics.double.frag.out | 2 +- .../hlsl.intrinsics.evalfns.frag.out | 2 +- .../hlsl.intrinsics.f1632.frag.out | 2 +- .../hlsl.intrinsics.f3216.frag.out | 2 +- .../Test/baseResults/hlsl.intrinsics.frag.out | 2 +- .../baseResults/hlsl.intrinsics.lit.frag.out | 2 +- .../hlsl.intrinsics.negative.comp.out | 2 +- .../hlsl.intrinsics.negative.vert.out | 2 +- .../hlsl.intrinsics.promote.down.frag.out | 2 +- .../hlsl.intrinsics.promote.frag.out | 2 +- .../hlsl.intrinsics.promote.outputs.frag.out | 2 +- .../Test/baseResults/hlsl.intrinsics.vert.out | 2 +- .../Test/baseResults/hlsl.isfinite.frag.out | 2 +- .../Test/baseResults/hlsl.layout.frag.out | 2 +- .../baseResults/hlsl.layoutOverride.vert.out | 2 +- .../baseResults/hlsl.load.2dms.dx10.frag.out | 2 +- .../baseResults/hlsl.load.array.dx10.frag.out | 2 +- .../baseResults/hlsl.load.basic.dx10.frag.out | 2 +- .../baseResults/hlsl.load.basic.dx10.vert.out | 2 +- .../hlsl.load.buffer.dx10.frag.out | 2 +- .../hlsl.load.buffer.float.dx10.frag.out | 2 +- .../hlsl.load.offset.dx10.frag.out | 2 +- .../hlsl.load.offsetarray.dx10.frag.out | 2 +- .../hlsl.load.rwbuffer.dx10.frag.out | 2 +- .../hlsl.load.rwtexture.array.dx10.frag.out | 2 +- .../hlsl.load.rwtexture.dx10.frag.out | 2 +- .../baseResults/hlsl.logical.binary.frag.out | 2 +- .../hlsl.logical.binary.vec.frag.out | 2 +- .../baseResults/hlsl.logical.unary.frag.out | 2 +- .../baseResults/hlsl.logicalConvert.frag.out | 2 +- .../Test/baseResults/hlsl.loopattr.frag.out | 2 +- .../Test/baseResults/hlsl.matNx1.frag.out | 2 +- .../baseResults/hlsl.matType.bool.frag.out | 2 +- .../Test/baseResults/hlsl.matType.frag.out | 2 +- .../baseResults/hlsl.matType.int.frag.out | 2 +- .../Test/baseResults/hlsl.matpack-1.frag.out | 2 +- .../baseResults/hlsl.matpack-pragma.frag.out | 2 +- .../baseResults/hlsl.matrixSwizzle.vert.out | 2 +- .../baseResults/hlsl.matrixindex.frag.out | 2 +- .../Test/baseResults/hlsl.max.frag.out | 2 +- .../baseResults/hlsl.memberFunCall.frag.out | 2 +- .../Test/baseResults/hlsl.mintypes.frag.out | 2 +- .../baseResults/hlsl.mip.operator.frag.out | 2 +- .../baseResults/hlsl.mul-truncate.frag.out | 2 +- .../hlsl.multiDescriptorSet.frag.out | 2 +- .../Test/baseResults/hlsl.multiEntry.vert.out | 2 +- .../baseResults/hlsl.multiReturn.frag.out | 2 +- .../Test/baseResults/hlsl.namespace.frag.out | 2 +- .../baseResults/hlsl.nonint-index.frag.out | 2 +- .../hlsl.nonstaticMemberFunction.frag.out | 2 +- .../baseResults/hlsl.numericsuffixes.frag.out | 2 +- .../Test/baseResults/hlsl.numthreads.comp.out | 2 +- .../baseResults/hlsl.opaque-type-bug.frag.out | 2 +- .../Test/baseResults/hlsl.overload.frag.out | 2 +- .../baseResults/hlsl.params.default.frag.out | 2 +- .../hlsl.partialFlattenLocal.vert.out | 2 +- .../hlsl.partialFlattenMixed.vert.out | 2 +- .../baseResults/hlsl.partialInit.frag.out | 2 +- .../Test/baseResults/hlsl.pp.line.frag.out | 2 +- .../glslang/Test/baseResults/hlsl.pp.vert.out | 2 +- .../Test/baseResults/hlsl.precedence.frag.out | 2 +- .../baseResults/hlsl.precedence2.frag.out | 2 +- .../Test/baseResults/hlsl.precise.frag.out | 2 +- .../baseResults/hlsl.preprocessor.frag.out | 2 +- .../baseResults/hlsl.promote.atomic.frag.out | 2 +- .../baseResults/hlsl.promote.binary.frag.out | 2 +- .../baseResults/hlsl.promote.vec1.frag.out | 2 +- .../Test/baseResults/hlsl.promotions.frag.out | 2 +- .../Test/baseResults/hlsl.rw.atomics.frag.out | 2 +- .../Test/baseResults/hlsl.rw.bracket.frag.out | 2 +- .../baseResults/hlsl.rw.register.frag.out | 2 +- .../hlsl.rw.scalar.bracket.frag.out | 2 +- .../Test/baseResults/hlsl.rw.swizzle.frag.out | 2 +- .../baseResults/hlsl.rw.vec2.bracket.frag.out | 2 +- .../hlsl.sample.array.dx10.frag.out | 2 +- .../hlsl.sample.basic.dx10.frag.out | 2 +- .../hlsl.sample.offset.dx10.frag.out | 2 +- .../hlsl.sample.offsetarray.dx10.frag.out | 2 +- .../hlsl.sample.sub-vec4.dx10.frag.out | 2 +- .../hlsl.samplebias.array.dx10.frag.out | 2 +- .../hlsl.samplebias.basic.dx10.frag.out | 2 +- .../hlsl.samplebias.offset.dx10.frag.out | 2 +- .../hlsl.samplebias.offsetarray.dx10.frag.out | 2 +- .../hlsl.samplecmp.array.dx10.frag.out | 2 +- .../hlsl.samplecmp.basic.dx10.frag.out | 2 +- .../hlsl.samplecmp.dualmode.frag.out | 2 +- .../hlsl.samplecmp.offset.dx10.frag.out | 2 +- .../hlsl.samplecmp.offsetarray.dx10.frag.out | 2 +- ...lsl.samplecmplevelzero.array.dx10.frag.out | 2 +- ...lsl.samplecmplevelzero.basic.dx10.frag.out | 2 +- ...sl.samplecmplevelzero.offset.dx10.frag.out | 2 +- ...mplecmplevelzero.offsetarray.dx10.frag.out | 2 +- .../hlsl.samplegrad.array.dx10.frag.out | 2 +- .../hlsl.samplegrad.basic.dx10.frag.out | 2 +- .../hlsl.samplegrad.basic.dx10.vert.out | 2 +- .../hlsl.samplegrad.offset.dx10.frag.out | 2 +- .../hlsl.samplegrad.offsetarray.dx10.frag.out | 2 +- .../hlsl.samplelevel.array.dx10.frag.out | 2 +- .../hlsl.samplelevel.basic.dx10.frag.out | 2 +- .../hlsl.samplelevel.basic.dx10.vert.out | 2 +- .../hlsl.samplelevel.offset.dx10.frag.out | 2 +- ...hlsl.samplelevel.offsetarray.dx10.frag.out | 2 +- .../baseResults/hlsl.scalar-length.frag.out | 2 +- .../baseResults/hlsl.scalar2matrix.frag.out | 2 +- .../Test/baseResults/hlsl.scalarCast.vert.out | 2 +- .../Test/baseResults/hlsl.scope.frag.out | 2 +- .../Test/baseResults/hlsl.semantic-1.vert.out | 2 +- .../Test/baseResults/hlsl.semantic.geom.out | 2 +- .../Test/baseResults/hlsl.semantic.vert.out | 2 +- .../Test/baseResults/hlsl.semicolons.frag.out | 2 +- .../Test/baseResults/hlsl.shapeConv.frag.out | 2 +- .../baseResults/hlsl.shapeConvRet.frag.out | 2 +- .../Test/baseResults/hlsl.sin.frag.out | 2 +- .../Test/baseResults/hlsl.snorm.uav.comp.out | 2 +- .../hlsl.staticMemberFunction.frag.out | 2 +- ...sl.store.rwbyteaddressbuffer.type.comp.out | 2 +- .../Test/baseResults/hlsl.string.frag.out | 2 +- .../baseResults/hlsl.stringtoken.frag.out | 2 +- .../Test/baseResults/hlsl.struct.frag.out | 2 +- .../baseResults/hlsl.struct.split-1.vert.out | 2 +- .../hlsl.struct.split.array.geom.out | 2 +- .../hlsl.struct.split.assign.frag.out | 2 +- .../hlsl.struct.split.call.vert.out | 2 +- .../hlsl.struct.split.nested.geom.out | 2 +- .../hlsl.struct.split.trivial.geom.out | 2 +- .../hlsl.struct.split.trivial.vert.out | 2 +- .../baseResults/hlsl.structIoFourWay.frag.out | 2 +- .../hlsl.structStructName.frag.out | 2 +- .../hlsl.structarray.flatten.frag.out | 2 +- .../hlsl.structarray.flatten.geom.out | 2 +- .../hlsl.structbuffer.append.fn.frag.out | 2 +- .../hlsl.structbuffer.append.frag.out | 2 +- .../hlsl.structbuffer.atomics.frag.out | 2 +- .../hlsl.structbuffer.byte.frag.out | 38 +- .../hlsl.structbuffer.coherent.frag.out | 2 +- .../hlsl.structbuffer.floatidx.comp.out | 2 +- .../baseResults/hlsl.structbuffer.fn.frag.out | 2 +- .../hlsl.structbuffer.fn2.comp.out | 10 +- .../baseResults/hlsl.structbuffer.frag.out | 2 +- .../hlsl.structbuffer.incdec.frag.out | 2 +- .../baseResults/hlsl.structbuffer.rw.frag.out | 2 +- .../hlsl.structbuffer.rwbyte.frag.out | 1661 ++++++++--------- .../Test/baseResults/hlsl.structin.vert.out | 2 +- .../Test/baseResults/hlsl.subpass.frag.out | 2 +- .../Test/baseResults/hlsl.switch.frag.out | 2 +- .../Test/baseResults/hlsl.swizzle.frag.out | 2 +- .../baseResults/hlsl.synthesizeInput.frag.out | 2 +- .../Test/baseResults/hlsl.target.frag.out | 2 +- .../baseResults/hlsl.targetStruct1.frag.out | 2 +- .../baseResults/hlsl.targetStruct2.frag.out | 2 +- .../baseResults/hlsl.templatetypes.frag.out | 2 +- .../baseResults/hlsl.texture.struct.frag.out | 2 +- .../baseResults/hlsl.texture.subvec4.frag.out | 2 +- .../baseResults/hlsl.texturebuffer.frag.out | 2 +- .../Test/baseResults/hlsl.this.frag.out | 2 +- .../Test/baseResults/hlsl.tx.bracket.frag.out | 2 +- .../baseResults/hlsl.tx.overload.frag.out | 2 +- .../Test/baseResults/hlsl.type.half.frag.out | 2 +- .../baseResults/hlsl.type.identifier.frag.out | 2 +- .../baseResults/hlsl.typeGraphCopy.vert.out | 2 +- .../Test/baseResults/hlsl.typedef.frag.out | 2 +- .../Test/baseResults/hlsl.void.frag.out | 2 +- .../Test/baseResults/hlsl.whileLoop.frag.out | 2 +- .../Test/baseResults/hlsl.y-negate-1.vert.out | 33 +- .../Test/baseResults/hlsl.y-negate-2.vert.out | 43 +- .../Test/baseResults/hlsl.y-negate-3.vert.out | 52 +- .../baseResults/remap.basic.dcefunc.frag.out | 2 +- .../remap.basic.everything.frag.out | 2 +- .../baseResults/remap.basic.none.frag.out | 2 +- .../baseResults/remap.basic.strip.frag.out | 2 +- ...emap.hlsl.sample.basic.everything.frag.out | 2 +- .../remap.hlsl.sample.basic.none.frag.out | 2 +- .../remap.hlsl.sample.basic.strip.frag.out | 2 +- ...map.hlsl.templatetypes.everything.frag.out | 2 +- .../remap.hlsl.templatetypes.none.frag.out | 2 +- .../baseResults/remap.if.everything.frag.out | 2 +- .../Test/baseResults/remap.if.none.frag.out | 2 +- .../remap.similar_1a.everything.frag.out | 2 +- .../remap.similar_1a.none.frag.out | 2 +- .../remap.similar_1b.everything.frag.out | 2 +- .../remap.similar_1b.none.frag.out | 2 +- .../Test/baseResults/remap.specconst.comp.out | 2 +- .../remap.switch.everything.frag.out | 2 +- .../baseResults/remap.switch.none.frag.out | 2 +- .../remap.uniformarray.everything.frag.out | 2 +- .../remap.uniformarray.none.frag.out | 2 +- .../Test/baseResults/spv.100ops.frag.out | 2 +- .../glslang/Test/baseResults/spv.130.frag.out | 2 +- .../glslang/Test/baseResults/spv.140.frag.out | 2 +- .../glslang/Test/baseResults/spv.150.geom.out | 2 +- .../glslang/Test/baseResults/spv.150.vert.out | 2 +- .../Test/baseResults/spv.300BuiltIns.vert.out | 2 +- .../Test/baseResults/spv.300layout.frag.out | 2 +- .../Test/baseResults/spv.300layout.vert.out | 2 +- .../Test/baseResults/spv.300layoutp.vert.out | 2 +- .../Test/baseResults/spv.310.bitcast.frag.out | 2 +- .../glslang/Test/baseResults/spv.310.comp.out | 166 +- .../glslang/Test/baseResults/spv.330.geom.out | 2 +- .../glslang/Test/baseResults/spv.400.frag.out | 2 +- .../glslang/Test/baseResults/spv.400.tesc.out | 141 +- .../glslang/Test/baseResults/spv.400.tese.out | 2 +- .../glslang/Test/baseResults/spv.420.geom.out | 2 +- .../glslang/Test/baseResults/spv.430.frag.out | 2 +- .../glslang/Test/baseResults/spv.430.vert.out | 2 +- .../glslang/Test/baseResults/spv.450.geom.out | 2 +- .../baseResults/spv.450.noRedecl.tesc.out | 2 +- .../glslang/Test/baseResults/spv.450.tesc.out | 2 +- .../glslang/Test/baseResults/spv.460.comp.out | 2 +- .../glslang/Test/baseResults/spv.460.frag.out | 2 +- .../glslang/Test/baseResults/spv.460.vert.out | 2 +- .../Test/baseResults/spv.AofA.frag.out | 2 +- .../spv.GeometryShaderPassthrough.geom.out | 2 +- .../baseResults/spv.OVR_multiview.vert.out | 2 +- .../Test/baseResults/spv.Operations.frag.out | 2 +- .../Test/baseResults/spv.accessChain.frag.out | 2 +- .../Test/baseResults/spv.aggOps.frag.out | 2 +- .../baseResults/spv.always-discard.frag.out | 2 +- .../baseResults/spv.always-discard2.frag.out | 2 +- .../spv.arbPostDepthCoverage.frag.out | 2 +- .../Test/baseResults/spv.atomic.comp.out | 4 +- .../Test/baseResults/spv.atomicInt64.comp.out | 2 +- .../Test/baseResults/spv.barrier.vert.out | 46 + .../Test/baseResults/spv.bitCast.frag.out | 2 +- .../Test/baseResults/spv.bool.vert.out | 2 +- .../Test/baseResults/spv.boolInBlock.frag.out | 2 +- .../baseResults/spv.branch-return.vert.out | 2 +- .../spv.buffer.autoassign.frag.out | 2 +- .../Test/baseResults/spv.builtInXFB.vert.out | 2 +- .../spv.conditionalDiscard.frag.out | 2 +- .../Test/baseResults/spv.conversion.frag.out | 2 +- .../Test/baseResults/spv.dataOut.frag.out | 2 +- .../baseResults/spv.dataOutIndirect.frag.out | 2 +- .../baseResults/spv.dataOutIndirect.vert.out | 2 +- .../Test/baseResults/spv.debugInfo.frag.out | 2 +- .../Test/baseResults/spv.deepRvalue.frag.out | 2 +- .../Test/baseResults/spv.depthOut.frag.out | 2 +- .../Test/baseResults/spv.deviceGroup.frag.out | 2 +- .../Test/baseResults/spv.discard-dce.frag.out | 2 +- .../Test/baseResults/spv.do-simple.vert.out | 2 +- .../spv.do-while-continue-break.vert.out | 2 +- .../Test/baseResults/spv.doWhileLoop.frag.out | 2 +- .../Test/baseResults/spv.double.comp.out | 2 +- .../Test/baseResults/spv.drawParams.vert.out | 2 +- .../spv.earlyReturnDiscard.frag.out | 2 +- .../spv.extPostDepthCoverage.frag.out | 2 +- .../Test/baseResults/spv.float16.frag.out | 2 +- .../Test/baseResults/spv.flowControl.frag.out | 2 +- .../spv.for-complex-condition.vert.out | 2 +- .../spv.for-continue-break.vert.out | 2 +- .../Test/baseResults/spv.for-nobody.vert.out | 2 +- .../Test/baseResults/spv.for-notest.vert.out | 2 +- .../Test/baseResults/spv.for-simple.vert.out | 2 +- .../Test/baseResults/spv.forLoop.frag.out | 2 +- .../Test/baseResults/spv.forwardFun.frag.out | 2 +- .../baseResults/spv.fullyCovered.frag.out | 2 +- .../baseResults/spv.functionCall.frag.out | 2 +- .../spv.functionNestedOpaque.vert.out | 2 +- .../spv.functionSemantics.frag.out | 2 +- .../Test/baseResults/spv.glFragColor.frag.out | 2 +- .../spv.glsl.register.autoassign.frag.out | 2 +- .../spv.glsl.register.noautoassign.frag.out | 2 +- .../baseResults/spv.hlslDebugInfo.frag.out | 2 +- .../Test/baseResults/spv.hlslOffsets.vert.out | 2 +- .../Test/baseResults/spv.image.frag.out | 2 +- .../spv.imageLoadStoreLod.frag.out | 2 +- .../Test/baseResults/spv.int16.frag.out | 2 +- .../Test/baseResults/spv.int64.frag.out | 2 +- .../Test/baseResults/spv.intOps.vert.out | 2 +- .../Test/baseResults/spv.interpOps.frag.out | 2 +- .../baseResults/spv.layoutNested.vert.out | 2 +- .../Test/baseResults/spv.length.frag.out | 2 +- .../baseResults/spv.localAggregates.frag.out | 2 +- .../Test/baseResults/spv.loops.frag.out | 2 +- .../baseResults/spv.loopsArtificial.frag.out | 2 +- .../Test/baseResults/spv.matFun.vert.out | 2 +- .../Test/baseResults/spv.matrix.frag.out | 2 +- .../Test/baseResults/spv.matrix2.frag.out | 2 +- .../baseResults/spv.memoryQualifier.frag.out | 2 +- .../spv.merge-unreachable.frag.out | 2 +- .../Test/baseResults/spv.multiStruct.comp.out | 2 +- .../spv.multiStructFuncall.frag.out | 2 +- .../Test/baseResults/spv.multiView.frag.out | 2 +- .../spv.multiviewPerViewAttributes.tesc.out | 2 +- .../spv.multiviewPerViewAttributes.vert.out | 2 +- .../Test/baseResults/spv.newTexture.frag.out | 2 +- .../baseResults/spv.noBuiltInLoc.vert.out | 2 +- .../spv.noDeadDecorations.vert.out | 2 +- .../Test/baseResults/spv.noWorkgroup.comp.out | 2 +- .../Test/baseResults/spv.nonSquare.vert.out | 2 +- .../Test/baseResults/spv.offsets.frag.out | 2 +- .../Test/baseResults/spv.paramMemory.frag.out | 2 +- .../Test/baseResults/spv.precise.tesc.out | 2 +- .../Test/baseResults/spv.precise.tese.out | 2 +- .../Test/baseResults/spv.precision.frag.out | 2 +- .../spv.precisionNonESSamp.frag.out | 2 +- .../Test/baseResults/spv.prepost.frag.out | 2 +- .../baseResults/spv.pushConstant.vert.out | 2 +- .../baseResults/spv.pushConstantAnon.vert.out | 2 +- .../Test/baseResults/spv.qualifiers.vert.out | 2 +- .../Test/baseResults/spv.queryL.frag.out | 2 +- .../spv.register.autoassign-2.frag.out | 2 +- .../spv.register.autoassign.frag.out | 2 +- .../spv.register.noautoassign.frag.out | 2 +- .../baseResults/spv.register.subpass.frag.out | 2 +- .../baseResults/spv.rw.autoassign.frag.out | 2 +- .../Test/baseResults/spv.sample.frag.out | 2 +- .../Test/baseResults/spv.sampleId.frag.out | 2 +- .../spv.sampleMaskOverrideCoverage.frag.out | 2 +- .../baseResults/spv.samplePosition.frag.out | 2 +- .../Test/baseResults/spv.separate.frag.out | 2 +- .../glslang/Test/baseResults/spv.set.vert.out | 2 +- .../baseResults/spv.shaderBallot.comp.out | 2 +- .../baseResults/spv.shaderBallotAMD.comp.out | 2 +- .../baseResults/spv.shaderDrawParams.vert.out | 2 +- .../spv.shaderFragMaskAMD.frag.out | 2 +- .../baseResults/spv.shaderGroupVote.comp.out | 2 +- .../spv.shaderStencilExport.frag.out | 2 +- .../Test/baseResults/spv.shiftOps.frag.out | 2 +- .../baseResults/spv.shortCircuit.frag.out | 2 +- .../spv.simpleFunctionCall.frag.out | 2 +- .../Test/baseResults/spv.simpleMat.vert.out | 2 +- .../baseResults/spv.sparseTexture.frag.out | 2 +- .../spv.sparseTextureClamp.frag.out | 2 +- .../Test/baseResults/spv.specConst.vert.out | 2 +- .../baseResults/spv.specConstant.comp.out | 2 +- .../baseResults/spv.specConstant.vert.out | 2 +- .../spv.specConstantComposite.vert.out | 2 +- .../spv.specConstantOperations.vert.out | 2 +- .../baseResults/spv.ssbo.autoassign.frag.out | 2 +- .../Test/baseResults/spv.ssboAlias.frag.out | 2 +- .../spv.stereoViewRendering.tesc.out | 2 +- .../spv.stereoViewRendering.vert.out | 2 +- .../baseResults/spv.storageBuffer.vert.out | 2 +- .../baseResults/spv.structAssignment.frag.out | 2 +- .../Test/baseResults/spv.structDeref.frag.out | 2 +- .../Test/baseResults/spv.structure.frag.out | 2 +- .../Test/baseResults/spv.subpass.frag.out | 2 +- .../Test/baseResults/spv.switch.frag.out | 2 +- .../Test/baseResults/spv.swizzle.frag.out | 2 +- .../baseResults/spv.swizzleInversion.frag.out | 2 +- .../Test/baseResults/spv.test.frag.out | 2 +- .../Test/baseResults/spv.test.vert.out | 2 +- .../Test/baseResults/spv.texture.frag.out | 2 +- .../spv.texture.sampler.transform.frag.out | 2 +- .../Test/baseResults/spv.texture.vert.out | 2 +- .../baseResults/spv.textureBuffer.vert.out | 2 +- .../spv.textureGatherBiasLod.frag.out | 2 +- .../Test/baseResults/spv.types.frag.out | 2 +- .../Test/baseResults/spv.uint.frag.out | 2 +- .../baseResults/spv.uniformArray.frag.out | 2 +- .../spv.variableArrayIndex.frag.out | 2 +- .../baseResults/spv.varyingArray.frag.out | 2 +- .../spv.varyingArrayIndirect.frag.out | 2 +- .../baseResults/spv.viewportArray2.tesc.out | 2 +- .../baseResults/spv.viewportArray2.vert.out | 2 +- .../baseResults/spv.voidFunction.frag.out | 2 +- .../spv.while-continue-break.vert.out | 2 +- .../baseResults/spv.while-simple.vert.out | 2 +- .../Test/baseResults/spv.whileLoop.frag.out | 2 +- .../glslang/Test/baseResults/spv.xfb.vert.out | 2 +- .../Test/baseResults/vulkan.ast.vert.out | 2 +- 3rdparty/glslang/Test/runtests | 36 +- 3rdparty/glslang/Test/spv.310.comp | 2 + 3rdparty/glslang/Test/spv.barrier.vert | 15 + .../glslang/glslang/Include/intermediate.h | 3 +- .../MachineIndependent/Intermediate.cpp | 5 + .../MachineIndependent/ParseHelper.cpp | 19 +- .../glslang/MachineIndependent/intermOut.cpp | 3 +- 3rdparty/glslang/gtests/Spv.FromFile.cpp | 1 + 3rdparty/glslang/hlsl/hlslParseHelper.cpp | 18 +- 3rdparty/glslang/hlsl/hlslParseables.cpp | 4 +- 504 files changed, 2322 insertions(+), 2196 deletions(-) create mode 100755 3rdparty/glslang/Test/baseResults/spv.barrier.vert.out create mode 100644 3rdparty/glslang/Test/spv.barrier.vert diff --git a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp index 745021f26..969049655 100755 --- a/3rdparty/glslang/SPIRV/GlslangToSpv.cpp +++ b/3rdparty/glslang/SPIRV/GlslangToSpv.cpp @@ -1762,8 +1762,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpMemoryBarrierImage: case glslang::EOpMemoryBarrierShared: case glslang::EOpGroupMemoryBarrier: + case glslang::EOpDeviceMemoryBarrier: case glslang::EOpAllMemoryBarrierWithGroupSync: - case glslang::EOpGroupMemoryBarrierWithGroupSync: + case glslang::EOpDeviceMemoryBarrierWithGroupSync: case glslang::EOpWorkgroupMemoryBarrier: case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: noReturnValue = true; @@ -5429,40 +5430,65 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op, spv: builder.createNoResultOp(spv::OpEndPrimitive); return 0; case glslang::EOpBarrier: - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, spv::MemorySemanticsMaskNone); + if (glslangIntermediate->getStage() == EShLangTessControl) { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeInvocation, spv::MemorySemanticsMaskNone); + // TODO: prefer the following, when available: + // builder.createControlBarrier(spv::ScopePatch, spv::ScopePatch, + // spv::MemorySemanticsPatchMask | + // spv::MemorySemanticsAcquireReleaseMask); + } else { + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + } return 0; case glslang::EOpMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierAtomicCounter: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAtomicCounterMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierBuffer: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierImage: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpMemoryBarrierShared: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpGroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpAllMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsAllMemory); + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, + spv::MemorySemanticsAllMemory | + spv::MemorySemanticsAcquireReleaseMask); return 0; - case glslang::EOpGroupMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); + case glslang::EOpDeviceMemoryBarrier: + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); + return 0; + case glslang::EOpDeviceMemoryBarrierWithGroupSync: + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeDevice, spv::MemorySemanticsUniformMemoryMask | + spv::MemorySemanticsImageMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpWorkgroupMemoryBarrier: - builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createMemoryBarrier(spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; case glslang::EOpWorkgroupMemoryBarrierWithGroupSync: - // Control barrier with non-"None" semantic is also a memory barrier. - builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, spv::MemorySemanticsWorkgroupMemoryMask); + builder.createControlBarrier(spv::ScopeWorkgroup, spv::ScopeWorkgroup, + spv::MemorySemanticsWorkgroupMemoryMask | + spv::MemorySemanticsAcquireReleaseMask); return 0; #ifdef AMD_EXTENSIONS case glslang::EOpTime: @@ -5959,7 +5985,9 @@ void GetSpirvVersion(std::string& version) // or a different instruction sequence to do something gets used). int GetSpirvGeneratorVersion() { - return 2; + // return 1; // start + // return 2; // EOpAtomicCounterDecrement gets a post decrement, to map between GLSL -> SPIR-V + return 3; // change/correct barrier-instruction operands, to match memory model group decisions } // Write SPIR-V out to a binary file @@ -6058,6 +6086,8 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector $TARGETDIR/reflection.vert.out diff -b $BASEDIR/reflection.vert.out $TARGETDIR/reflection.vert.out || HASERROR=1 -$EXE -D -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out +$EXE -D -Od -e flizv -l -q -C -V -Od hlsl.reflection.vert > $TARGETDIR/hlsl.reflection.vert.out diff -b $BASEDIR/hlsl.reflection.vert.out $TARGETDIR/hlsl.reflection.vert.out || HASERROR=1 -$EXE -D -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out +$EXE -D -Od -e main -l -q -C -V -Od hlsl.reflection.binding.frag > $TARGETDIR/hlsl.reflection.binding.frag.out diff -b $BASEDIR/hlsl.reflection.binding.frag.out $TARGETDIR/hlsl.reflection.binding.frag.out || HASERROR=1 -$EXE -D -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out +$EXE -D -Od -e main -l -q --hlsl-iomap --auto-map-bindings --stb 10 --sbb 20 --ssb 30 --suavb 40 --scb 50 -D -V -e main -Od hlsl.automap.frag > $TARGETDIR/hlsl.automap.frag.out diff -b $BASEDIR/hlsl.automap.frag.out $TARGETDIR/hlsl.automap.frag.out || HASERROR=1 # @@ -56,14 +56,14 @@ fi # entry point renaming tests # echo Running entry-point renaming tests -$EXE -i -H -V -D -e main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out +$EXE -i -H -V -D -Od -e main_in_spv --ku --source-entrypoint main -Od hlsl.entry.rename.frag > $TARGETDIR/hlsl.entry.rename.frag.out diff -b $BASEDIR/hlsl.entry.rename.frag.out $TARGETDIR/hlsl.entry.rename.frag.out || HASERROR=1 # # Testing ill-defined uncalled function # echo Running ill-defined uncalled function -$EXE -D -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out +$EXE -D -Od -e main -H -Od hlsl.deadFunctionMissingBody.vert > $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out diff -b $BASEDIR/hlsl.deadFunctionMissingBody.vert.out $TARGETDIR/hlsl.deadFunctionMissingBody.vert.out || HASERROR=1 if [ $HASERROR -eq 0 ] @@ -88,27 +88,27 @@ $EXE -i --hlsl-offsets -H spv.hlslOffsets.vert > $TARGETDIR/spv.hlslOffsets.vert diff -b $BASEDIR/spv.hlslOffsets.vert.out $TARGETDIR/spv.hlslOffsets.vert.out || HASERROR=1 echo Running hlsl offsets -$EXE -i --hlsl-offsets -D -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out +$EXE -i --hlsl-offsets -D -Od -e main -H -Od hlsl.hlslOffset.vert > $TARGETDIR/hlsl.hlslOffset.vert.out diff -b $BASEDIR/hlsl.hlslOffset.vert.out $TARGETDIR/hlsl.hlslOffset.vert.out || HASERROR=1 # # Testing --resource-set-binding # echo Configuring HLSL descriptor set and binding number manually -$EXE -V -D -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out +$EXE -V -D -Od -e main -H -Od hlsl.multiDescriptorSet.frag --rsb frag t0 0 0 t1 1 0 s0 0 1 s1 1 1 b0 2 0 b1 2 1 b2 2 2 > $TARGETDIR/hlsl.multiDescriptorSet.frag.out diff -b $BASEDIR/hlsl.multiDescriptorSet.frag.out $TARGETDIR/hlsl.multiDescriptorSet.frag.out || HASERROR=1 -$EXE -V -D -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out +$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb 4 > $TARGETDIR/hlsl.explicitDescriptorSet.frag.out diff -b $BASEDIR/hlsl.explicitDescriptorSet.frag.out $TARGETDIR/hlsl.explicitDescriptorSet.frag.out || HASERROR=1 -$EXE -V -D -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out +$EXE -V -D -Od -e main -H -Od hlsl.explicitDescriptorSet.frag --hlsl-iomap --amb --ssb 10 --stb 20 --rsb frag 3 > $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out diff -b $BASEDIR/hlsl.explicitDescriptorSet-2.frag.out $TARGETDIR/hlsl.explicitDescriptorSet-2.frag.out || HASERROR=1 # # Testing per-descriptor-set IO map shift # echo 'Testing per-descriptor-set IO map shift' -$EXE -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 +$EXE -e main --hlsl-iomap --ssb 10 1 15 2 --stb 20 --stb 25 2 --suavb 30 --suavb 40 2 --sub 50 6 -i -q -D -Od -V hlsl.shift.per-set.frag > $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 diff -b $BASEDIR/hlsl.shift.per-set.frag.out $TARGETDIR/hlsl.shift.per-set.frag.out || HASERROR=1 # @@ -129,7 +129,7 @@ echo Testing SPV Debug Information $EXE -g --relaxed-errors --suppress-warnings --aml --hlsl-offsets --nsf \ -G -H spv.debugInfo.frag --rsb frag 3 > $TARGETDIR/spv.debugInfo.frag.out diff -b $BASEDIR/spv.debugInfo.frag.out $TARGETDIR/spv.debugInfo.frag.out || HASERROR=1 -$EXE -g -D -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \ +$EXE -g -D -Od -e newMain -g --amb --aml --fua --hlsl-iomap --nsf --sib 1 --ssb 2 --sbb 3 --stb 4 --suavb 5 --sub 6 \ --sep origMain -H -Od spv.hlslDebugInfo.vert --rsb vert t0 0 0 > $TARGETDIR/spv.hlslDebugInfo.frag.out diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.out || HASERROR=1 @@ -137,13 +137,13 @@ diff -b $BASEDIR/spv.hlslDebugInfo.frag.out $TARGETDIR/spv.hlslDebugInfo.frag.ou # Testing Includer # echo Testing Includer -$EXE -D -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out +$EXE -D -Od -e main -H -Od ../Test/hlsl.include.vert > $TARGETDIR/hlsl.include.vert.out diff -b $BASEDIR/hlsl.include.vert.out $TARGETDIR/hlsl.include.vert.out || HASERROR=1 -$EXE -D -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out +$EXE -D -Od -e main -H -Od hlsl.includeNegative.vert > $TARGETDIR/hlsl.includeNegative.vert.out diff -b $BASEDIR/hlsl.includeNegative.vert.out $TARGETDIR/hlsl.includeNegative.vert.out || HASERROR=1 $EXE -l -i include.vert > $TARGETDIR/include.vert.out diff -b $BASEDIR/include.vert.out $TARGETDIR/include.vert.out || HASERROR=1 -$EXE -D -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out +$EXE -D -Od -e main -H -Od -Iinc1/path1 -Iinc1/path2 hlsl.dashI.vert > $TARGETDIR/hlsl.dashI.vert.out diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR=1 # @@ -152,7 +152,7 @@ diff -b $BASEDIR/hlsl.dashI.vert.out $TARGETDIR/hlsl.dashI.vert.out || HASERROR= 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 diff -b $BASEDIR/glsl.-D-U.frag.out $TARGETDIR/glsl.-D-U.frag.out || HASERROR=1 -$EXE -D -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 -DFOO=200 -UUNDEFED -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 # @@ -190,11 +190,11 @@ diff -b $BASEDIR/remap.invalid-spirv-2.out $TARGETDIR/remap.invalid-spirv-2.out # Testing position Y inversion # echo "Testing position Y inversion" -$EXE -H -e main -V -D -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out +$EXE -H -e main -V -D -Od -H -i --iy hlsl.y-negate-1.vert > $TARGETDIR/hlsl.y-negate-1.vert.out diff -b $BASEDIR/hlsl.y-negate-1.vert.out $TARGETDIR/hlsl.y-negate-1.vert.out || HASERROR=1 -$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out +$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-2.vert > $TARGETDIR/hlsl.y-negate-2.vert.out diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || HASERROR=1 -$EXE -H -e main -V -D -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out +$EXE -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 # diff --git a/3rdparty/glslang/Test/spv.310.comp b/3rdparty/glslang/Test/spv.310.comp index 6cbb0430f..53117dd97 100644 --- a/3rdparty/glslang/Test/spv.310.comp +++ b/3rdparty/glslang/Test/spv.310.comp @@ -37,4 +37,6 @@ void main() outnames.va[gl_LocalInvocationID.x] = vec4(s); outnames.s = outbname.uns.length(); gl_DeviceIndex; + memoryBarrierShared(); + groupMemoryBarrier(); } diff --git a/3rdparty/glslang/Test/spv.barrier.vert b/3rdparty/glslang/Test/spv.barrier.vert new file mode 100644 index 000000000..c7828ce7b --- /dev/null +++ b/3rdparty/glslang/Test/spv.barrier.vert @@ -0,0 +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; +} \ No newline at end of file diff --git a/3rdparty/glslang/glslang/Include/intermediate.h b/3rdparty/glslang/glslang/Include/intermediate.h index 4a28e3567..587601957 100644 --- a/3rdparty/glslang/glslang/Include/intermediate.h +++ b/3rdparty/glslang/glslang/Include/intermediate.h @@ -722,7 +722,8 @@ enum TOperator { EOpInterlockedOr, // ... EOpInterlockedXor, // ... EOpAllMemoryBarrierWithGroupSync, // memory barriers without non-hlsl AST equivalents - EOpGroupMemoryBarrierWithGroupSync, // ... + EOpDeviceMemoryBarrier, // ... + EOpDeviceMemoryBarrierWithGroupSync, // ... EOpWorkgroupMemoryBarrier, // ... EOpWorkgroupMemoryBarrierWithGroupSync, // ... EOpEvaluateAttributeSnapped, // InterpolateAtOffset with int position on 16x16 grid diff --git a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index 2fa0d8a85..21899abe9 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -2474,6 +2474,11 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) return false; node.setLeft(left); node.setRight(right); + + // Update the original base assumption on result type.. + node.setType(left->getType()); + node.getWritableType().getQualifier().clear(); + break; default: diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index 78a5d8ee6..9254aa62b 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -1378,6 +1378,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan arg0 = unaryArg; } + TString featureString; + const char* feature = nullptr; switch (callNode.getOp()) { case EOpTextureGather: case EOpTextureGatherOffset: @@ -1386,8 +1388,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan // Figure out which variants are allowed by what extensions, // and what arguments must be constant for which situations. - TString featureString = fnCandidate.getName() + "(...)"; - const char* feature = featureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "(...)"; + feature = featureString.c_str(); profileRequires(loc, EEsProfile, 310, nullptr, feature); int compArg = -1; // track which argument, if any, is the constant component argument switch (callNode.getOp()) { @@ -1443,8 +1446,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan bias = fnCandidate.getParamCount() > 4; if (bias) { - TString biasFeatureString = fnCandidate.getName() + "with bias argument"; - const char* feature = biasFeatureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); profileRequires(loc, ~EEsProfile, 450, nullptr, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -1466,8 +1470,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan bias = fnCandidate.getParamCount() > 5; if (bias) { - TString featureString = fnCandidate.getName() + "with bias argument"; - const char* feature = featureString.c_str(); + featureString = fnCandidate.getName(); + featureString += "with bias argument"; + feature = featureString.c_str(); profileRequires(loc, ~EEsProfile, 450, nullptr, feature); requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature); } @@ -4567,6 +4572,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) break; case EvqUniform: case EvqBuffer: + if (type.getBasicType() == EbtBlock) + error(loc, "cannot apply to uniform or buffer block", "location", ""); break; default: error(loc, "can only apply to uniform, buffer, in, or out storage qualifiers", "location", ""); diff --git a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp index 7e15392da..dd2cdc89f 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp @@ -791,7 +791,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpGenMul: out.debug << "mul"; break; case EOpAllMemoryBarrierWithGroupSync: out.debug << "AllMemoryBarrierWithGroupSync"; break; - case EOpGroupMemoryBarrierWithGroupSync: out.debug << "GroupMemoryBarrierWithGroupSync"; break; + case EOpDeviceMemoryBarrier: out.debug << "DeviceMemoryBarrier"; break; + case EOpDeviceMemoryBarrierWithGroupSync: out.debug << "DeviceMemoryBarrierWithGroupSync"; break; case EOpWorkgroupMemoryBarrier: out.debug << "WorkgroupMemoryBarrier"; break; case EOpWorkgroupMemoryBarrierWithGroupSync: out.debug << "WorkgroupMemoryBarrierWithGroupSync"; break; diff --git a/3rdparty/glslang/gtests/Spv.FromFile.cpp b/3rdparty/glslang/gtests/Spv.FromFile.cpp index da80b1168..85762f4c0 100644 --- a/3rdparty/glslang/gtests/Spv.FromFile.cpp +++ b/3rdparty/glslang/gtests/Spv.FromFile.cpp @@ -189,6 +189,7 @@ INSTANTIATE_TEST_CASE_P( // Test looping constructs. // No tests yet for making sure break and continue from a nested loop // goes to the innermost target. + "spv.barrier.vert", "spv.do-simple.vert", "spv.do-while-continue-break.vert", "spv.for-complex-condition.vert", diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/3rdparty/glslang/hlsl/hlslParseHelper.cpp index a3e5e8a73..7e401fd6f 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.cpp +++ b/3rdparty/glslang/hlsl/hlslParseHelper.cpp @@ -3302,7 +3302,13 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte const TOperator idxOp = (offsetIdx->getQualifier().storage == EvqConst) ? EOpIndexDirect : EOpIndexIndirect; - vec = intermediate.growAggregate(vec, intermediate.addIndex(idxOp, argArray, offsetIdx, loc)); + TIntermTyped* indexVal = intermediate.addIndex(idxOp, argArray, offsetIdx, loc); + + TType derefType(argArray->getType(), 0); + derefType.getQualifier().makeTemporary(); + indexVal->setType(derefType); + + vec = intermediate.growAggregate(vec, indexVal); } vec->setType(TType(argArray->getBasicType(), EvqTemporary, size)); @@ -3366,8 +3372,14 @@ void HlslParseContext::decomposeStructBufferMethods(const TSourceLoc& loc, TInte const TType derefType(argArray->getType(), 0); lValue->setType(derefType); - TIntermTyped* rValue = (size == 1) ? argValue : - intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + TIntermTyped* rValue; + if (size == 1) { + rValue = argValue; + } else { + rValue = intermediate.addIndex(EOpIndexDirect, argValue, idxConst, loc); + const TType indexType(argValue->getType(), 0); + rValue->setType(indexType); + } TIntermTyped* assign = intermediate.addAssign(EOpAssign, lValue, rValue, loc); diff --git a/3rdparty/glslang/hlsl/hlslParseables.cpp b/3rdparty/glslang/hlsl/hlslParseables.cpp index bae9e6e8c..7a46e805d 100755 --- a/3rdparty/glslang/hlsl/hlslParseables.cpp +++ b/3rdparty/glslang/hlsl/hlslParseables.cpp @@ -1087,8 +1087,8 @@ void TBuiltInParseablesHlsl::identifyBuiltIns(int /*version*/, EProfile /*profil symbolTable.relateToOperator("ddy_fine", EOpDPdyFine); symbolTable.relateToOperator("degrees", EOpDegrees); symbolTable.relateToOperator("determinant", EOpDeterminant); - symbolTable.relateToOperator("DeviceMemoryBarrier", EOpGroupMemoryBarrier); - symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpGroupMemoryBarrierWithGroupSync); // ... + symbolTable.relateToOperator("DeviceMemoryBarrier", EOpDeviceMemoryBarrier); + symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync", EOpDeviceMemoryBarrierWithGroupSync); symbolTable.relateToOperator("distance", EOpDistance); symbolTable.relateToOperator("dot", EOpDot); symbolTable.relateToOperator("dst", EOpDst);