Skip to content
Snippets Groups Projects
Commit 2fde45a1 authored by John Kessenich's avatar John Kessenich
Browse files

Requesting input on Bug 1346: checking in, turned off, enum-based operators...

Requesting input on Bug 1346: checking in, turned off, enum-based operators for texturing and image operations.  Please reply there with any input, thanks.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31289 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 92993c5e
No related branches found
No related tags found
No related merge requests found
...@@ -328,6 +328,52 @@ enum TOperator { ...@@ -328,6 +328,52 @@ enum TOperator {
// //
EOpArrayLength, // "Array" distinguishes from length(v) built-in function, but it applies to vectors and matrices as well. EOpArrayLength, // "Array" distinguishes from length(v) built-in function, but it applies to vectors and matrices as well.
//
// Image operations
//
// N.B. The following is not being used yet, pending input, as switching
// to it from the current text-based approach will break existing consumers.
EImageQuerySize,
EImageQuerySamples,
EImageLoad,
EImageStore,
EImageAtomicAdd,
EImageAtomicMin,
EImageAtomicMax,
EImageAtomicAnd,
EImageAtomicOr,
EImageAtomicXor,
EImageAtomicExchange,
EImageAtomicCompSwap,
//
// Texture operations
//
ETextureQuerySize,
ETextureQueryLod,
ETextureQueryLevels,
ETextureQuerySamples,
ETexture,
ETextureProj,
ETextureLod,
ETextureOffset,
ETextureFetch,
ETextureFetchOffset,
ETextureProjOffset,
ETextureLodOffset,
ETextureProjLod,
ETextureProjLodOffset,
ETextureGrad,
ETextureGradOffset,
ETextureProjGrad,
ETextureProjGradOffset,
ETextureGather,
ETextureGatherOffset,
ETextureGatherOffsets,
}; };
class TIntermTraverser; class TIntermTraverser;
......
...@@ -57,6 +57,7 @@ namespace glslang { ...@@ -57,6 +57,7 @@ namespace glslang {
bool ARBCompatibility = true; bool ARBCompatibility = true;
const bool ForwardCompatibility = false; const bool ForwardCompatibility = false;
const bool PureOperatorBuiltins = false; // could break backward compatibility; pending feedback
inline bool IncludeLegacy(int version, EProfile profile) inline bool IncludeLegacy(int version, EProfile profile)
{ {
...@@ -2965,6 +2966,69 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb ...@@ -2965,6 +2966,69 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb
symbolTable.relateToOperator("memoryBarrierBuffer", EOpMemoryBarrierBuffer); symbolTable.relateToOperator("memoryBarrierBuffer", EOpMemoryBarrierBuffer);
symbolTable.relateToOperator("memoryBarrierImage", EOpMemoryBarrierImage); symbolTable.relateToOperator("memoryBarrierImage", EOpMemoryBarrierImage);
if (PureOperatorBuiltins) {
symbolTable.relateToOperator("imageQuerySize", EImageQuerySize);
symbolTable.relateToOperator("imageQuerySamples", EImageQuerySamples);
symbolTable.relateToOperator("imageLoad", EImageLoad);
symbolTable.relateToOperator("imageStore", EImageStore);
symbolTable.relateToOperator("imageAtomicAdd", EImageAtomicAdd);
symbolTable.relateToOperator("imageAtomicMin", EImageAtomicMin);
symbolTable.relateToOperator("imageAtomicMax", EImageAtomicMax);
symbolTable.relateToOperator("imageAtomicAnd", EImageAtomicAnd);
symbolTable.relateToOperator("imageAtomicOr", EImageAtomicOr);
symbolTable.relateToOperator("imageAtomicXor", EImageAtomicXor);
symbolTable.relateToOperator("imageAtomicExchange", EImageAtomicExchange);
symbolTable.relateToOperator("imageAtomicCompSwap", EImageAtomicCompSwap);
symbolTable.relateToOperator("textureSize", ETextureQuerySize);
symbolTable.relateToOperator("textureQueryLod", ETextureQueryLod);
symbolTable.relateToOperator("textureQueryLevels", ETextureQueryLevels);
symbolTable.relateToOperator("textureSamples", ETextureQuerySamples);
symbolTable.relateToOperator("texture", ETexture);
symbolTable.relateToOperator("textureProj", ETextureProj);
symbolTable.relateToOperator("textureLod", ETextureLod);
symbolTable.relateToOperator("textureOffset", ETextureOffset);
symbolTable.relateToOperator("textureFetch", ETextureFetch);
symbolTable.relateToOperator("textureFetchOffset", ETextureFetchOffset);
symbolTable.relateToOperator("textureProjOffset", ETextureProjOffset);
symbolTable.relateToOperator("textureLodOffset", ETextureLodOffset);
symbolTable.relateToOperator("textureProjLod", ETextureProjLod);
symbolTable.relateToOperator("textureProjLodOffset", ETextureProjLodOffset);
symbolTable.relateToOperator("textureGrad", ETextureGrad);
symbolTable.relateToOperator("textureGradOffset", ETextureGradOffset);
symbolTable.relateToOperator("textureProjGrad", ETextureProjGrad);
symbolTable.relateToOperator("textureProjGradOffset", ETextureProjGradOffset);
symbolTable.relateToOperator("textureGather", ETextureGather);
symbolTable.relateToOperator("textureGatherOffset", ETextureGatherOffset);
symbolTable.relateToOperator("textureGatherOffsets", ETextureGatherOffsets);
if (IncludeLegacy(version, profile)) {
// TBD: add ftransform(), any others?
symbolTable.relateToOperator("texture1D", ETexture);
symbolTable.relateToOperator("texture1DProj", ETextureProj);
symbolTable.relateToOperator("texture1DLod", ETextureLod);
symbolTable.relateToOperator("texture1DProjLod", ETextureProjLod);
symbolTable.relateToOperator("texture2D", ETexture);
symbolTable.relateToOperator("texture2DProj", ETextureProj);
symbolTable.relateToOperator("texture2DLod", ETextureLod);
symbolTable.relateToOperator("texture2DProjLod", ETextureProjLod);
symbolTable.relateToOperator("texture3D", ETexture);
symbolTable.relateToOperator("texture3DProj", ETextureProj);
symbolTable.relateToOperator("texture3DLod", ETextureLod);
symbolTable.relateToOperator("texture3DProjLod", ETextureProjLod);
symbolTable.relateToOperator("textureCube", ETexture);
symbolTable.relateToOperator("textureCubeLod", ETextureLod);
symbolTable.relateToOperator("shadow1D", ETexture);
symbolTable.relateToOperator("shadow2D", ETexture);
symbolTable.relateToOperator("shadow1DProj", ETextureProj);
symbolTable.relateToOperator("shadow2DProj", ETextureProj);
symbolTable.relateToOperator("shadow1DLod", ETextureLod);
symbolTable.relateToOperator("shadow2DLod", ETextureLod);
symbolTable.relateToOperator("shadow1DProjLod", ETextureProjLod);
symbolTable.relateToOperator("shadow2DProjLod", ETextureProjLod);
}
}
switch(language) { switch(language) {
case EShLangVertex: case EShLangVertex:
break; break;
......
...@@ -395,6 +395,41 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node ...@@ -395,6 +395,41 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpMemoryBarrierShared: out.debug << "MemoryBarrierShared"; break; case EOpMemoryBarrierShared: out.debug << "MemoryBarrierShared"; break;
case EOpGroupMemoryBarrier: out.debug << "GroupMemoryBarrier"; break; case EOpGroupMemoryBarrier: out.debug << "GroupMemoryBarrier"; break;
case EImageQuerySize: out.debug << "imageQuerySize"; break;
case EImageQuerySamples: out.debug << "imageQuerySamples"; break;
case EImageLoad: out.debug << "imageLoad"; break;
case EImageStore: out.debug << "imageStore"; break;
case EImageAtomicAdd: out.debug << "imageAtomicAdd"; break;
case EImageAtomicMin: out.debug << "imageAtomicMin"; break;
case EImageAtomicMax: out.debug << "imageAtomicMax"; break;
case EImageAtomicAnd: out.debug << "imageAtomicAnd"; break;
case EImageAtomicOr: out.debug << "imageAtomicOr"; break;
case EImageAtomicXor: out.debug << "imageAtomicXor"; break;
case EImageAtomicExchange: out.debug << "imageAtomicExchange"; break;
case EImageAtomicCompSwap: out.debug << "imageAtomicCompSwap"; break;
case ETextureQuerySize: out.debug << "textureSize"; break;
case ETextureQueryLod: out.debug << "textureQueryLod"; break;
case ETextureQueryLevels: out.debug << "textureQueryLevels"; break;
case ETextureQuerySamples: out.debug << "textureSamples"; break;
case ETexture: out.debug << "texture"; break;
case ETextureProj: out.debug << "textureProj"; break;
case ETextureLod: out.debug << "textureLod"; break;
case ETextureOffset: out.debug << "textureOffset"; break;
case ETextureFetch: out.debug << "textureFetch"; break;
case ETextureFetchOffset: out.debug << "textureFetchOffset"; break;
case ETextureProjOffset: out.debug << "textureProjOffset"; break;
case ETextureLodOffset: out.debug << "textureLodOffset"; break;
case ETextureProjLod: out.debug << "textureProjLod"; break;
case ETextureProjLodOffset: out.debug << "textureProjLodOffset"; break;
case ETextureGrad: out.debug << "textureGrad"; break;
case ETextureGradOffset: out.debug << "textureGradOffset"; break;
case ETextureProjGrad: out.debug << "textureProjGrad"; break;
case ETextureProjGradOffset: out.debug << "textureProjGradOffset"; break;
case ETextureGather: out.debug << "textureGather"; break;
case ETextureGatherOffset: out.debug << "textureGatherOffset"; break;
case ETextureGatherOffsets: out.debug << "textureGatherOffsets"; break;
default: out.debug.message(EPrefixError, "Bad aggregation op"); default: out.debug.message(EPrefixError, "Bad aggregation op");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment