Commit 67b2a00f by John Kessenich

Merge branch 'master' into khronosmaster

parents 2b5b41bb 019f08fc
......@@ -88,7 +88,9 @@ public:
void dumpSpv(std::vector<unsigned int>& out);
protected:
spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier);
spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable);
spv::ImageFormat TranslateImageFormat(const glslang::TType& type);
spv::Id createSpvVariable(const glslang::TIntermSymbol*);
spv::Id getSampledType(const glslang::TSampler&);
spv::Id convertGlslangToSpvType(const glslang::TType& type);
......@@ -301,7 +303,7 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T
// Translate glslang type to SPIR-V interpolation decorations.
// Returns spv::Decoration(spv::BadValue) when no decoration
// should be applied.
spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier)
spv::Decoration TGlslangToSpvTraverser::TranslateInterpolationDecoration(const glslang::TQualifier& qualifier)
{
if (qualifier.smooth) {
// Smooth decoration doesn't exist in SPIR-V 1.0
......@@ -315,9 +317,10 @@ spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qual
return spv::DecorationFlat;
else if (qualifier.centroid)
return spv::DecorationCentroid;
else if (qualifier.sample)
else if (qualifier.sample) {
builder.addCapability(spv::CapabilitySampleRateShading);
return spv::DecorationSample;
else
} else
return (spv::Decoration)spv::BadValue;
}
......@@ -358,6 +361,18 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
// TODO: builder.addCapability(spv::CapabilityMultiViewport);
return spv::BuiltInViewportIndex;
case glslang::EbvSampleId:
builder.addCapability(spv::CapabilitySampleRateShading);
return spv::BuiltInSampleId;
case glslang::EbvSamplePosition:
builder.addCapability(spv::CapabilitySampleRateShading);
return spv::BuiltInSamplePosition;
case glslang::EbvSampleMask:
builder.addCapability(spv::CapabilitySampleRateShading);
return spv::BuiltInSampleMask;
case glslang::EbvPosition: return spv::BuiltInPosition;
case glslang::EbvVertexId: return spv::BuiltInVertexId;
case glslang::EbvInstanceId: return spv::BuiltInInstanceId;
......@@ -377,9 +392,6 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvFragCoord: return spv::BuiltInFragCoord;
case glslang::EbvPointCoord: return spv::BuiltInPointCoord;
case glslang::EbvFace: return spv::BuiltInFrontFacing;
case glslang::EbvSampleId: return spv::BuiltInSampleId;
case glslang::EbvSamplePosition: return spv::BuiltInSamplePosition;
case glslang::EbvSampleMask: return spv::BuiltInSampleMask;
case glslang::EbvFragDepth: return spv::BuiltInFragDepth;
case glslang::EbvHelperInvocation: return spv::BuiltInHelperInvocation;
case glslang::EbvNumWorkGroups: return spv::BuiltInNumWorkgroups;
......@@ -393,10 +405,48 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
}
// Translate glslang image layout format to SPIR-V image format.
spv::ImageFormat TranslateImageFormat(const glslang::TType& type)
spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TType& type)
{
assert(type.getBasicType() == glslang::EbtSampler);
// Check for capabilities
switch (type.getQualifier().layoutFormat) {
case glslang::ElfRg32f:
case glslang::ElfRg16f:
case glslang::ElfR11fG11fB10f:
case glslang::ElfR16f:
case glslang::ElfRgba16:
case glslang::ElfRgb10A2:
case glslang::ElfRg16:
case glslang::ElfRg8:
case glslang::ElfR16:
case glslang::ElfR8:
case glslang::ElfRgba16Snorm:
case glslang::ElfRg16Snorm:
case glslang::ElfRg8Snorm:
case glslang::ElfR16Snorm:
case glslang::ElfR8Snorm:
case glslang::ElfRg32i:
case glslang::ElfRg16i:
case glslang::ElfRg8i:
case glslang::ElfR16i:
case glslang::ElfR8i:
case glslang::ElfRgb10a2ui:
case glslang::ElfRg32ui:
case glslang::ElfRg16ui:
case glslang::ElfRg8ui:
case glslang::ElfR16ui:
case glslang::ElfR8ui:
builder.addCapability(spv::CapabilityStorageImageExtendedFormats);
break;
default:
break;
}
// do the translation
switch (type.getQualifier().layoutFormat) {
case glslang::ElfNone: return spv::ImageFormatUnknown;
case glslang::ElfRgba32f: return spv::ImageFormatRgba32f;
......@@ -2126,6 +2176,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
operands.push_back(*opIt);
}
return builder.createOp(spv::OpImageRead, convertGlslangToSpvType(node->getType()), operands);
if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown)
builder.addCapability(spv::CapabilityStorageImageReadWithoutFormat);
} else if (node->getOp() == glslang::EOpImageStore) {
if (sampler.ms) {
operands.push_back(*(opIt + 1));
......@@ -2134,6 +2186,8 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
} else
operands.push_back(*opIt);
builder.createNoResultOp(spv::OpImageWrite, operands);
if (builder.getImageTypeFormat(builder.getImageType(operands.front())) == spv::ImageFormatUnknown)
builder.addCapability(spv::CapabilityStorageImageWriteWithoutFormat);
return spv::NoResult;
} else if (node->isSparseImage()) {
spv::MissingFunctionality("sparse image functions");
......@@ -2182,6 +2236,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
params.coords = arguments[1];
int extraArgs = 0;
bool noImplicitLod = false;
// sort out where Dref is coming from
if (cubeCompare) {
......@@ -2203,7 +2258,11 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
if (cracked.lod) {
params.lod = arguments[2];
++extraArgs;
} else if (sampler.ms) {
} else if (glslangIntermediate->getStage() != EShLangFragment) {
// we need to invent the default lod for an explicit lod instruction for a non-fragment stage
noImplicitLod = true;
}
if (sampler.ms) {
params.sample = arguments[2]; // For MS, "sample" should be specified
++extraArgs;
}
......@@ -2241,7 +2300,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
}
}
return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), sparse, cracked.fetch, cracked.proj, cracked.gather, params);
return builder.createTextureCall(precision, convertGlslangToSpvType(node->getType()), sparse, cracked.fetch, cracked.proj, cracked.gather, noImplicitLod, params);
}
spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAggregate* node)
......@@ -2883,10 +2942,6 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv:
return createAtomicOperation(op, precision, typeId, operands, typeProxy);
}
case glslang::EOpImageLoad:
unaryOp = spv::OpImageRead;
break;
case glslang::EOpBitFieldReverse:
unaryOp = spv::OpBitReverse;
break;
......
......@@ -165,6 +165,18 @@ Id Builder::makeIntegerType(int width, bool hasSign)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
// deal with capabilities
switch (width) {
case 16:
addCapability(CapabilityInt16);
break;
case 64:
addCapability(CapabilityInt64);
break;
default:
break;
}
return type->getResultId();
}
......@@ -185,6 +197,18 @@ Id Builder::makeFloatType(int width)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
// deal with capabilities
switch (width) {
case 16:
addCapability(CapabilityFloat16);
break;
case 64:
addCapability(CapabilityFloat64);
break;
default:
break;
}
return type->getResultId();
}
......@@ -382,6 +406,48 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
// deal with capabilities
switch (dim) {
case DimBuffer:
if (sampled)
addCapability(CapabilitySampledBuffer);
else
addCapability(CapabilityImageBuffer);
break;
case Dim1D:
if (sampled)
addCapability(CapabilitySampled1D);
else
addCapability(CapabilityImage1D);
break;
case DimCube:
if (arrayed) {
if (sampled)
addCapability(CapabilitySampledCubeArray);
else
addCapability(CapabilityImageCubeArray);
}
break;
case DimRect:
if (sampled)
addCapability(CapabilitySampledRect);
else
addCapability(CapabilityImageRect);
break;
case DimSubpassData:
addCapability(CapabilityInputAttachment);
break;
default:
break;
}
if (ms) {
if (arrayed)
addCapability(CapabilityImageMSArray);
if (! sampled)
addCapability(CapabilityStorageImageMultisample);
}
return type->getResultId();
}
......@@ -1220,7 +1286,7 @@ Id Builder::createBuiltinCall(Id resultType, Id builtins, int entryPoint, std::v
// Accept all parameters needed to create a texture instruction.
// Create the correct instruction based on the inputs, and make the call.
Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, const TextureParameters& parameters)
Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, bool noImplicitLod, const TextureParameters& parameters)
{
static const int maxTextureArgs = 10;
Id texArgs[maxTextureArgs] = {};
......@@ -1229,7 +1295,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
// Set up the fixed arguments
//
int numArgs = 0;
bool xplicit = false;
bool explicitLod = false;
texArgs[numArgs++] = parameters.sampler;
texArgs[numArgs++] = parameters.coords;
if (parameters.Dref)
......@@ -1250,13 +1316,18 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
if (parameters.lod) {
mask = (ImageOperandsMask)(mask | ImageOperandsLodMask);
texArgs[numArgs++] = parameters.lod;
xplicit = true;
}
if (parameters.gradX) {
explicitLod = true;
} else if (parameters.gradX) {
mask = (ImageOperandsMask)(mask | ImageOperandsGradMask);
texArgs[numArgs++] = parameters.gradX;
texArgs[numArgs++] = parameters.gradY;
xplicit = true;
explicitLod = true;
} else if (noImplicitLod && ! fetch && ! gather) {
// have to explicitly use lod of 0 if not allowed to have them be implicit, and
// we would otherwise be about to issue an implicit instruction
mask = (ImageOperandsMask)(mask | ImageOperandsLodMask);
texArgs[numArgs++] = makeFloatConstant(0.0);
explicitLod = true;
}
if (parameters.offset) {
if (isConstant(parameters.offset))
......@@ -1274,6 +1345,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
texArgs[numArgs++] = parameters.sample;
}
if (parameters.lodClamp) {
// capability if this bit is used
addCapability(CapabilityMinLod);
mask = (ImageOperandsMask)(mask | ImageOperandsMinLodMask);
texArgs[numArgs++] = parameters.lodClamp;
}
......@@ -1285,8 +1359,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
//
// Set up the instruction
//
Op opCode;
opCode = OpImageSampleImplicitLod;
Op opCode = OpNop; // All paths below need to set this
if (fetch) {
if (sparse)
opCode = OpImageSparseFetch;
......@@ -1303,7 +1376,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
opCode = OpImageSparseGather;
else
opCode = OpImageGather;
} else if (xplicit) {
} else if (explicitLod) {
if (parameters.Dref) {
if (proj)
if (sparse)
......@@ -1393,6 +1466,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
Id resultId = textureInst->getResultId();
if (sparse) {
// set capability
addCapability(CapabilitySparseResidency);
// Decode the return type that was a special structure
createStore(createCompositeExtract(resultId, typeId1, 1), parameters.texelOut);
resultId = createCompositeExtract(resultId, typeId0, 0);
......@@ -1410,6 +1486,9 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
// Comments in header
Id Builder::createTextureQueryCall(Op opCode, const TextureParameters& parameters)
{
// All these need a capability
addCapability(CapabilityImageQuery);
// Figure out the result type
Id resultType = 0;
switch (opCode) {
......
......@@ -124,6 +124,7 @@ 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); }
bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); }
bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); }
......@@ -322,7 +323,7 @@ public:
};
// Select the correct texture operation based on all inputs, and emit the correct instruction
Id createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, const TextureParameters&);
Id createTextureCall(Decoration precision, Id resultType, bool sparse, bool fetch, bool proj, bool gather, bool noImplicit, const TextureParameters&);
// Emit the OpTextureQuery* instruction that was passed in.
// Figure out the right return value and type, and return it.
......
......@@ -11,6 +11,10 @@ Linked fragment stage:
Capability Shader
Capability ClipDistance
Capability SampledRect
Capability Sampled1D
Capability SampledCubeArray
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 17 68 79 99 173 184 185 186
......
......@@ -9,6 +9,9 @@ Linked fragment stage:
Capability Shader
Capability ClipDistance
Capability SampledRect
Capability SampledBuffer
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 16 28 33 43
......
......@@ -5,13 +5,13 @@ Linked vertex stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 50
// Id's are bound by 67
Capability Shader
Capability ClipDistance
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 13 17 39 48 49
EntryPoint Vertex 4 "main" 13 17 39 65 66
Source GLSL 150
Name 4 "main"
Name 11 "gl_PerVertex"
......@@ -30,16 +30,17 @@ Linked vertex stage:
MemberName 37(s2) 1 "d"
Name 39 "s2out"
Name 41 "i"
Name 46 "ui"
Name 48 "gl_VertexID"
Name 49 "gl_InstanceID"
Name 48 "s2D"
Name 63 "ui"
Name 65 "gl_VertexID"
Name 66 "gl_InstanceID"
MemberDecorate 11(gl_PerVertex) 0 Invariant
MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position
MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize
MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance
Decorate 11(gl_PerVertex) Block
Decorate 48(gl_VertexID) BuiltIn VertexId
Decorate 49(gl_InstanceID) BuiltIn InstanceId
Decorate 65(gl_VertexID) BuiltIn VertexId
Decorate 66(gl_InstanceID) BuiltIn InstanceId
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
......@@ -70,11 +71,22 @@ Linked vertex stage:
38: TypePointer Output 37(s2)
39(s2out): 38(ptr) Variable Output
40: TypePointer Function 14(int)
45: TypePointer UniformConstant 14(int)
46(ui): 45(ptr) Variable UniformConstant
47: TypePointer Input 14(int)
48(gl_VertexID): 47(ptr) Variable Input
49(gl_InstanceID): 47(ptr) Variable Input
45: TypeImage 6(float) 2D sampled format:Unknown
46: TypeSampledImage 45
47: TypePointer UniformConstant 46
48(s2D): 47(ptr) Variable UniformConstant
50: TypeVector 6(float) 2
51: 6(float) Constant 1056964608
52: 50(fvec2) ConstantComposite 51 51
53: 6(float) Constant 0
56: TypeVector 6(float) 3
57: 56(fvec3) ConstantComposite 51 51 51
60: 6(float) Constant 1078774989
62: TypePointer UniformConstant 14(int)
63(ui): 62(ptr) Variable UniformConstant
64: TypePointer Input 14(int)
65(gl_VertexID): 64(ptr) Variable Input
66(gl_InstanceID): 64(ptr) Variable Input
4(main): 2 Function None 3
5: Label
41(i): 40(ptr) Variable Function
......@@ -92,5 +104,11 @@ Linked vertex stage:
43: 6(float) Load 23(ps)
44: 25(ptr) AccessChain 39(s2out) 21 42 27 27 33
Store 44 43
49: 46 Load 48(s2D)
54: 7(fvec4) ImageSampleExplicitLod 49 52 Lod 53
55: 46 Load 48(s2D)
58: 7(fvec4) ImageSampleProjExplicitLod 55 57 Lod 53
59: 46 Load 48(s2D)
61: 7(fvec4) ImageSampleExplicitLod 59 52 Lod 60
Return
FunctionEnd
......@@ -10,7 +10,9 @@ Linked fragment stage:
// Id's are bound by 1104
Capability Shader
Capability Float64
Capability ClipDistance
Capability SampledRect
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 13 1025 1031 1036 1048 1074 1095 1097
......
......@@ -10,6 +10,7 @@ Linked compute stage:
// Id's are bound by 62
Capability Shader
Capability Float64
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint GLCompute 4 "main" 26 33
......
......@@ -7,12 +7,20 @@ Linked fragment stage:
// Module Version 10000
// Generated by (magic number): 80001
// Id's are bound by 372
// Id's are bound by 378
Capability Shader
Capability SampledRect
Capability Sampled1D
Capability SampledCubeArray
Capability SampledBuffer
Capability ImageMSArray
Capability StorageImageExtendedFormats
Capability ImageQuery
Capability StorageImageWriteWithoutFormat
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 356
EntryPoint Fragment 4 "main" 362
ExecutionMode 4 OriginLowerLeft
Source GLSL 450
Name 4 "main"
......@@ -36,8 +44,9 @@ Linked fragment stage:
Name 232 "ii1D"
Name 245 "ui2D"
Name 248 "value"
Name 356 "fragData"
Name 371 "ic4D"
Name 357 "wo2D"
Name 362 "fragData"
Name 377 "ic4D"
Decorate 15(i1D) Binding 0
Decorate 27(i2D) Binding 1
Decorate 38(i3D) Binding 2
......@@ -51,6 +60,7 @@ Linked fragment stage:
Decorate 108(i2DMSArray) Binding 10
Decorate 232(ii1D) Binding 11
Decorate 245(ui2D) Binding 12
Decorate 357(wo2D) Binding 1
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
......@@ -84,7 +94,7 @@ Linked fragment stage:
70: TypeImage 12(float) 1D array nonsampled format:Rgba32f
71: TypePointer UniformConstant 70
72(i1DArray): 71(ptr) Variable UniformConstant
80: TypeImage 12(float) 2D array nonsampled format:Rgba32f
80: TypeImage 12(float) 2D array nonsampled format:Rg16
81: TypePointer UniformConstant 80
82(i2DArray): 81(ptr) Variable UniformConstant
87: TypeImage 12(float) Buffer nonsampled format:Rgba32f
......@@ -132,18 +142,21 @@ Linked fragment stage:
340: 6(int) Constant 18
341: 6(int) Constant 17
349: 18(int) Constant 19
355: TypePointer Output 125(fvec4)
356(fragData): 355(ptr) Variable Output
362: TypeBool
369: TypeVector 6(int) 4
370: TypePointer UniformConstant 369(ivec4)
371(ic4D): 370(ptr) Variable UniformConstant
355: TypeImage 12(float) 2D nonsampled format:Unknown
356: TypePointer UniformConstant 355
357(wo2D): 356(ptr) Variable UniformConstant
361: TypePointer Output 125(fvec4)
362(fragData): 361(ptr) Variable Output
368: TypeBool
375: TypeVector 6(int) 4
376: TypePointer UniformConstant 375(ivec4)
377(ic4D): 376(ptr) Variable UniformConstant
4(main): 2 Function None 3
5: Label
9(iv): 8(ptr) Variable Function
127(v): 126(ptr) Variable Function
229(ui): 228(ptr) Variable Function
357: 126(ptr) Variable Function
363: 126(ptr) Variable Function
Store 9(iv) 11
16: 13 Load 15(i1D)
17: 6(int) ImageQuerySize 16
......@@ -465,22 +478,26 @@ Linked fragment stage:
353: 18(int) Load 229(ui)
354: 18(int) IAdd 353 352
Store 229(ui) 354
358: 18(int) Load 229(ui)
359: 20(ptr) AccessChain 9(iv) 237
360: 6(int) Load 359
361: 18(int) Bitcast 360
363: 362(bool) INotEqual 358 361
SelectionMerge 365 None
BranchConditional 363 364 367
364: Label
366: 125(fvec4) Load 127(v)
Store 357 366
Branch 365
367: Label
Store 357 129
Branch 365
365: Label
368: 125(fvec4) Load 357
Store 356(fragData) 368
358: 355 Load 357(wo2D)
359: 29(ivec2) Load 142(ic2D)
360: 125(fvec4) Load 127(v)
ImageWrite 358 359 360
364: 18(int) Load 229(ui)
365: 20(ptr) AccessChain 9(iv) 237
366: 6(int) Load 365
367: 18(int) Bitcast 366
369: 368(bool) INotEqual 364 367
SelectionMerge 371 None
BranchConditional 369 370 373
370: Label
372: 125(fvec4) Load 127(v)
Store 363 372
Branch 371
373: Label
Store 363 129
Branch 371
371: Label
374: 125(fvec4) Load 363
Store 362(fragData) 374
Return
FunctionEnd
......@@ -10,6 +10,9 @@ Linked fragment stage:
// Id's are bound by 278
Capability Shader
Capability SampledRect
Capability SampledCubeArray
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 17 26 29 55 81 84 91 247 277
......
......@@ -10,6 +10,11 @@ Linked fragment stage:
// Id's are bound by 237
Capability Shader
Capability SampledRect
Capability Sampled1D
Capability SampledCubeArray
Capability SampledBuffer
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main"
......
......@@ -10,6 +10,9 @@ Linked fragment stage:
// Id's are bound by 399
Capability Shader
Capability SampledRect
Capability SparseResidency
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 384
......
......@@ -10,6 +10,10 @@ Linked fragment stage:
// Id's are bound by 360
Capability Shader
Capability SampledRect
Capability SparseResidency
Capability MinLod
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 345
......
......@@ -8,6 +8,7 @@ Linked fragment stage:
// Id's are bound by 291
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 47 276 290
......
......@@ -8,6 +8,7 @@ Linked vertex stage:
// Id's are bound by 146
Capability Shader
Capability Sampled1D
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 39 140 144 145
......
......@@ -4,6 +4,7 @@ in vec4 iv4;
uniform float ps;
uniform int ui;
uniform sampler2D s2D;
invariant gl_Position;
......@@ -27,13 +28,11 @@ void main()
gl_ClipDistance[2] = iv4.x;
int i;
s2out.d[i].b[2].w = ps;
// test recovery from nonsupported built-ins
//float n1 = noise1(2.4);
//n1 = noise1(vec4(n1));
//vec2 n2 = noise2(vec3(n1));
//vec3 n3 = noise3(n2);
//vec4 n4 = noise4(n3);
// 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];
......@@ -7,7 +7,7 @@ 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(rgba32f, binding = 7) uniform image2DArray i2DArray;
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;
......@@ -15,6 +15,8 @@ layout(rgba32f, binding = 10) uniform image2DMSArray i2DMSArray;
layout(r32i, binding = 11) uniform iimage1D ii1D;
layout(r32ui, binding = 12) uniform uimage2D ui2D;
writeonly layout(binding = 1) uniform image2D wo2D;
uniform int ic1D;
uniform ivec2 ic2D;
uniform ivec3 ic3D;
......@@ -84,6 +86,8 @@ void main()
iv.x += imageAtomicCompSwap(ii1D, ic1D, 18, 17);
ui += imageAtomicCompSwap(ui2D, ic2D, 19u, value);
imageStore(wo2D, ic2D, v);
fragData = ui != iv.y ? v : vec4(0.0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment