Commit 73f5bf61 by Nicolas Capens Committed by Shannon Woods

Add 3D texture intrinsics to the symbol table.

TRAC #23365 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
parent e27c1c3b
...@@ -42,12 +42,15 @@ enum TBasicType ...@@ -42,12 +42,15 @@ enum TBasicType
EbtBool, EbtBool,
EbtGuardSamplerBegin, // non type: see implementation of IsSampler() EbtGuardSamplerBegin, // non type: see implementation of IsSampler()
EbtSampler2D, EbtSampler2D,
EbtSampler3D,
EbtSamplerCube, EbtSamplerCube,
EbtSamplerExternalOES, // Only valid if OES_EGL_image_external exists. EbtSamplerExternalOES, // Only valid if OES_EGL_image_external exists.
EbtSampler2DRect, // Only valid if GL_ARB_texture_rectangle exists. EbtSampler2DRect, // Only valid if GL_ARB_texture_rectangle exists.
EbtISampler2D, EbtISampler2D,
EbtISampler3D,
EbtISamplerCube, EbtISamplerCube,
EbtUSampler2D, EbtUSampler2D,
EbtUSampler3D,
EbtUSamplerCube, EbtUSamplerCube,
EbtGuardSamplerEnd, // non type: see implementation of IsSampler() EbtGuardSamplerEnd, // non type: see implementation of IsSampler()
EbtStruct, EbtStruct,
......
...@@ -385,30 +385,40 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI ...@@ -385,30 +385,40 @@ void InsertBuiltInFunctions(ShShaderType type, ShShaderSpec spec, const ShBuiltI
symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "textureCubeLod", samplerCube, "sampler", float3, "coord", float1, "lod"); symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "textureCubeLod", samplerCube, "sampler", float3, "coord", float1, "lod");
} }
TType *sampler3D = new TType(EbtSampler3D, EbpUndefined, EvqGlobal, 1);
// //
// Texture Functions for GLSL ES 3.0 // Texture Functions for GLSL ES 3.0
// //
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texture", sampler2D, "sampler", float2, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texture", sampler2D, "sampler", float2, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texture", sampler3D, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texture", samplerCube, "sampler", float3, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "texture", samplerCube, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", sampler2D, "sampler", float3, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", sampler2D, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", sampler2D, "sampler", float4, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", sampler2D, "sampler", float4, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", sampler3D, "sampler", float4, "coord");
TType *isampler2D = new TType(EbtISampler2D, EbpUndefined, EvqGlobal, 1); TType *isampler2D = new TType(EbtISampler2D, EbpUndefined, EvqGlobal, 1);
TType *isampler3D = new TType(EbtISampler3D, EbpUndefined, EvqGlobal, 1);
TType *isamplerCube = new TType(EbtISamplerCube, EbpUndefined, EvqGlobal, 1); TType *isamplerCube = new TType(EbtISamplerCube, EbpUndefined, EvqGlobal, 1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "texture", isampler2D, "sampler", float2, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "texture", isampler2D, "sampler", float2, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "texture", isampler3D, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "texture", isamplerCube, "sampler", float3, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "texture", isamplerCube, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "textureProj", isampler2D, "sampler", float3, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "textureProj", isampler2D, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "textureProj", isampler2D, "sampler", float4, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "textureProj", isampler2D, "sampler", float4, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int4, "textureProj", isampler3D, "sampler", float4, "coord");
TType *usampler2D = new TType(EbtUSampler2D, EbpUndefined, EvqGlobal, 1); TType *usampler2D = new TType(EbtUSampler2D, EbpUndefined, EvqGlobal, 1);
TType *usampler3D = new TType(EbtUSampler3D, EbpUndefined, EvqGlobal, 1);
TType *usamplerCube = new TType(EbtUSamplerCube, EbpUndefined, EvqGlobal, 1); TType *usamplerCube = new TType(EbtUSamplerCube, EbpUndefined, EvqGlobal, 1);
TType *uint4 = new TType(EbtUInt, EbpUndefined, EvqGlobal, 4); TType *uint4 = new TType(EbtUInt, EbpUndefined, EvqGlobal, 4);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "texture", usampler2D, "sampler", float2, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "texture", usampler2D, "sampler", float2, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "texture", usampler3D, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "texture", usamplerCube, "sampler", float3, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "texture", usamplerCube, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler2D, "sampler", float3, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler2D, "sampler", float3, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler2D, "sampler", float4, "coord"); symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler2D, "sampler", float4, "coord");
symbolTable.insertBuiltIn(ESSL3_BUILTINS, uint4, "textureProj", usampler3D, "sampler", float4, "coord");
if(type == SH_FRAGMENT_SHADER) if(type == SH_FRAGMENT_SHADER)
{ {
......
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