MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / declareTypeDefaults

Method declareTypeDefaults

glslang/MachineIndependent/ParseHelper.cpp:8760–8778  ·  view source on GitHub ↗

When a declaration includes a type, but not a variable name, it can be used to establish defaults.

Source from the content-addressed store, hash-verified

8758// When a declaration includes a type, but not a variable name, it can be used
8759// to establish defaults.
8760void TParseContext::declareTypeDefaults(const TSourceLoc& loc, const TPublicType& publicType)
8761{
8762 if (publicType.basicType == EbtAtomicUint && publicType.qualifier.hasBinding()) {
8763 if (publicType.qualifier.layoutBinding >= (unsigned int)resources.maxAtomicCounterBindings) {
8764 error(loc, "atomic_uint binding is too large", "binding", "");
8765 return;
8766 }
8767 if (publicType.qualifier.hasOffset())
8768 atomicUintOffsets[publicType.qualifier.layoutBinding] = publicType.qualifier.layoutOffset;
8769 return;
8770 }
8771
8772 if (publicType.arraySizes) {
8773 error(loc, "expect an array name", "", "");
8774 }
8775
8776 if (publicType.qualifier.hasLayout() && !publicType.qualifier.hasBufferReference())
8777 warn(loc, "useless application of layout qualifier", "layout", "");
8778}
8779
8780void TParseContext::typeParametersCheck(const TSourceLoc& loc, const TPublicType& publicType)
8781{

Callers 1

yyparseFunction · 0.80

Calls 5

errorFunction · 0.85
hasBindingMethod · 0.80
hasOffsetMethod · 0.80
hasLayoutMethod · 0.80
hasBufferReferenceMethod · 0.80

Tested by

no test coverage detected