Commit 75fb4752 by Nicolas Capens Committed by Shannon Woods

Implement textureSize.

TRAC #23485 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
parent c98406ab
...@@ -22,6 +22,7 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI ...@@ -22,6 +22,7 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI
TType *float3 = new TType(EbtFloat, EbpUndefined, EvqGlobal, 3); TType *float3 = new TType(EbtFloat, EbpUndefined, EvqGlobal, 3);
TType *float4 = new TType(EbtFloat, EbpUndefined, EvqGlobal, 4); TType *float4 = new TType(EbtFloat, EbpUndefined, EvqGlobal, 4);
TType *int1 = new TType(EbtInt, EbpUndefined, EvqGlobal, 1);
TType *int2 = new TType(EbtInt, EbpUndefined, EvqGlobal, 2); TType *int2 = new TType(EbtInt, EbpUndefined, EvqGlobal, 2);
TType *int3 = new TType(EbtInt, EbpUndefined, EvqGlobal, 3); TType *int3 = new TType(EbtInt, EbpUndefined, EvqGlobal, 3);
TType *int4 = new TType(EbtInt, EbpUndefined, EvqGlobal, 4); TType *int4 = new TType(EbtInt, EbpUndefined, EvqGlobal, 4);
...@@ -459,6 +460,19 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI ...@@ -459,6 +460,19 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler3D, "sampler", float4, "coord", float1, "bias"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler3D, "sampler", float4, "coord", float1, "bias");
} }
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", sampler2D, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", isampler2D, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", usampler2D, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", sampler3D, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", isampler3D, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", usampler3D, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", samplerCube, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", isamplerCube, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", usamplerCube, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", sampler2DArray, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", isampler2DArray, "sampler", int1, "lod");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", usampler2DArray, "sampler", int1, "lod");
if(type == SH_FRAGMENT_SHADER) if(type == SH_FRAGMENT_SHADER)
{ {
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "dFdx", float1, "p"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "dFdx", float1, "p");
......
...@@ -96,18 +96,19 @@ class OutputHLSL : public TIntermTraverser ...@@ -96,18 +96,19 @@ class OutputHLSL : public TIntermTraverser
struct TextureFunction struct TextureFunction
{ {
enum Mipmap enum Method
{ {
IMPLICIT, IMPLICIT, // Mipmap LOD determined implicitly (standard lookup)
BIAS, BIAS,
LOD, LOD,
LOD0 LOD0,
SIZE // textureSize()
}; };
TBasicType sampler; TBasicType sampler;
int coords; int coords;
bool proj; bool proj;
Mipmap mipmap; Method method;
TString name() const; TString name() const;
......
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