Commit 344e7142 by Nicolas Capens Committed by Shannon Woods

Support isampler throughout the compiler.

TRAC #23359 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
parent d273c273
...@@ -36,8 +36,8 @@ extern "C" { ...@@ -36,8 +36,8 @@ extern "C" {
#endif #endif
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented everytime the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 115 #define ANGLE_SH_VERSION 116
// //
// The names of the following enums have been derived by replacing GL prefix // The names of the following enums have been derived by replacing GL prefix
...@@ -115,7 +115,9 @@ typedef enum { ...@@ -115,7 +115,9 @@ typedef enum {
SH_SAMPLER_2D = 0x8B5E, SH_SAMPLER_2D = 0x8B5E,
SH_SAMPLER_CUBE = 0x8B60, SH_SAMPLER_CUBE = 0x8B60,
SH_SAMPLER_2D_RECT_ARB = 0x8B63, SH_SAMPLER_2D_RECT_ARB = 0x8B63,
SH_SAMPLER_EXTERNAL_OES = 0x8D66 SH_SAMPLER_EXTERNAL_OES = 0x8D66,
SH_INT_SAMPLER_2D = 0x8DCA,
SH_INT_SAMPLER_CUBE = 0x8DCC,
} ShDataType; } ShDataType;
typedef enum { typedef enum {
......
...@@ -67,6 +67,8 @@ inline const char* getBasicString(TBasicType t) ...@@ -67,6 +67,8 @@ inline const char* getBasicString(TBasicType t)
case EbtSamplerCube: return "samplerCube"; break; case EbtSamplerCube: return "samplerCube"; break;
case EbtSamplerExternalOES: return "samplerExternalOES"; break; case EbtSamplerExternalOES: return "samplerExternalOES"; break;
case EbtSampler2DRect: return "sampler2DRect"; break; case EbtSampler2DRect: return "sampler2DRect"; break;
case EbtISampler2D: return "isampler2D"; break;
case EbtISamplerCube: return "isamplerCube"; break;
case EbtStruct: return "structure"; break; case EbtStruct: return "structure"; break;
case EbtInterfaceBlock: return "interface block"; break; case EbtInterfaceBlock: return "interface block"; break;
default: return "unknown type"; default: return "unknown type";
......
...@@ -432,12 +432,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt ...@@ -432,12 +432,10 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
// //
// Does the base type allow operation? // Does the base type allow operation?
// //
switch (node->getBasicType()) { if (node->getBasicType() == EbtVoid ||
case EbtVoid: IsSampler(node->getBasicType()))
case EbtSampler2D: {
case EbtSamplerCube: return 0;
return 0;
default: break;
} }
// //
......
...@@ -328,16 +328,11 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod ...@@ -328,16 +328,11 @@ bool TParseContext::lValueErrorCheck(int line, const char* op, TIntermTyped* nod
// //
// Type that can't be written to? // Type that can't be written to?
// //
switch (node->getBasicType()) { if (node->getBasicType() == EbtVoid) {
case EbtSampler2D:
case EbtSamplerCube:
message = "can't modify a sampler";
break;
case EbtVoid:
message = "can't modify void"; message = "can't modify void";
break; }
default: if (IsSampler(node->getBasicType())) {
break; message = "can't modify a sampler";
} }
} }
......
...@@ -50,6 +50,8 @@ void TType::buildMangledName(TString& mangledName) ...@@ -50,6 +50,8 @@ void TType::buildMangledName(TString& mangledName)
case EbtBool: mangledName += 'b'; break; case EbtBool: mangledName += 'b'; break;
case EbtSampler2D: mangledName += "s2"; break; case EbtSampler2D: mangledName += "s2"; break;
case EbtSamplerCube: mangledName += "sC"; break; case EbtSamplerCube: mangledName += "sC"; break;
case EbtISampler2D: mangledName += "is2"; break;
case EbtISamplerCube: mangledName += "isC"; break;
case EbtStruct: case EbtStruct:
mangledName += "struct-"; mangledName += "struct-";
if (typeName) if (typeName)
......
...@@ -99,6 +99,8 @@ static ShDataType getVariableDataType(const TType& type) ...@@ -99,6 +99,8 @@ static ShDataType getVariableDataType(const TType& type)
case EbtSamplerCube: return SH_SAMPLER_CUBE; case EbtSamplerCube: return SH_SAMPLER_CUBE;
case EbtSamplerExternalOES: return SH_SAMPLER_EXTERNAL_OES; case EbtSamplerExternalOES: return SH_SAMPLER_EXTERNAL_OES;
case EbtSampler2DRect: return SH_SAMPLER_2D_RECT_ARB; case EbtSampler2DRect: return SH_SAMPLER_2D_RECT_ARB;
case EbtISampler2D: return SH_INT_SAMPLER_2D;
case EbtISamplerCube: return SH_INT_SAMPLER_CUBE;
default: UNREACHABLE(); default: UNREACHABLE();
} }
return SH_NONE; return SH_NONE;
......
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