Commit cb127d3d by Nicolas Capens Committed by Shannon Woods

Create the HLSL shadow texture function.

TRAC #23394 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
parent 354ed2d1
...@@ -33,6 +33,9 @@ int UniformComponentCount(GLenum type) ...@@ -33,6 +33,9 @@ int UniformComponentCount(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_UNSIGNED_INT: case GL_UNSIGNED_INT:
return 1; return 1;
case GL_BOOL_VEC2: case GL_BOOL_VEC2:
...@@ -107,6 +110,9 @@ GLenum UniformComponentType(GLenum type) ...@@ -107,6 +110,9 @@ GLenum UniformComponentType(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_INT_VEC2: case GL_INT_VEC2:
case GL_INT_VEC3: case GL_INT_VEC3:
case GL_INT_VEC4: case GL_INT_VEC4:
...@@ -209,6 +215,9 @@ int VariableRowCount(GLenum type) ...@@ -209,6 +215,9 @@ int VariableRowCount(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
return 1; return 1;
case GL_FLOAT_MAT2: case GL_FLOAT_MAT2:
case GL_FLOAT_MAT3x2: case GL_FLOAT_MAT3x2:
...@@ -251,6 +260,9 @@ int VariableColumnCount(GLenum type) ...@@ -251,6 +260,9 @@ int VariableColumnCount(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
return 1; return 1;
case GL_BOOL_VEC2: case GL_BOOL_VEC2:
case GL_FLOAT_VEC2: case GL_FLOAT_VEC2:
...@@ -299,6 +311,9 @@ bool IsSampler(GLenum type) ...@@ -299,6 +311,9 @@ bool IsSampler(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
return true; return true;
} }
......
...@@ -254,6 +254,36 @@ inline bool IsSamplerArray(TBasicType type) ...@@ -254,6 +254,36 @@ inline bool IsSamplerArray(TBasicType type)
return false; return false;
} }
inline bool IsShadowSampler(TBasicType type)
{
switch (type)
{
case EbtSampler2DShadow:
case EbtSamplerCubeShadow:
case EbtSampler2DArrayShadow:
return true;
case EbtISampler2D:
case EbtISampler3D:
case EbtISamplerCube:
case EbtISampler2DArray:
case EbtUSampler2D:
case EbtUSampler3D:
case EbtUSamplerCube:
case EbtUSampler2DArray:
case EbtSampler2D:
case EbtSampler3D:
case EbtSamplerCube:
case EbtSamplerExternalOES:
case EbtSampler2DRect:
case EbtSampler2DArray:
return false;
default:
assert(!IsSampler(type));
}
return false;
}
// //
// Qualifiers and built-ins. These are mainly used to see what can be read // Qualifiers and built-ins. These are mainly used to see what can be read
// or written, and by the machine dependent translator to know which registers // or written, and by the machine dependent translator to know which registers
......
...@@ -39,6 +39,7 @@ class OutputHLSL : public TIntermTraverser ...@@ -39,6 +39,7 @@ class OutputHLSL : public TIntermTraverser
TString typeString(const TType &type); TString typeString(const TType &type);
TString textureString(const TType &type); TString textureString(const TType &type);
TString samplerString(const TType &type);
TString interpolationString(TQualifier qualifier); TString interpolationString(TQualifier qualifier);
TString structureString(const TStructure &structure, bool useHLSLRowMajorPacking, bool useStd140Packing); TString structureString(const TStructure &structure, bool useHLSLRowMajorPacking, bool useStd140Packing);
TString structureTypeName(const TStructure &structure, bool useHLSLRowMajorPacking, bool useStd140Packing); TString structureTypeName(const TStructure &structure, bool useHLSLRowMajorPacking, bool useStd140Packing);
......
...@@ -2267,12 +2267,14 @@ TextureType ProgramBinary::getTextureType(GLenum samplerType, InfoLog &infoLog) ...@@ -2267,12 +2267,14 @@ TextureType ProgramBinary::getTextureType(GLenum samplerType, InfoLog &infoLog)
case GL_SAMPLER_2D: case GL_SAMPLER_2D:
case GL_INT_SAMPLER_2D: case GL_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_2D: case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_SAMPLER_2D_SHADOW:
return TEXTURE_2D; return TEXTURE_2D;
case GL_SAMPLER_3D: case GL_SAMPLER_3D:
case GL_INT_SAMPLER_3D: case GL_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
return TEXTURE_3D; return TEXTURE_3D;
case GL_SAMPLER_CUBE: case GL_SAMPLER_CUBE:
case GL_SAMPLER_CUBE_SHADOW:
return TEXTURE_CUBE; return TEXTURE_CUBE;
case GL_INT_SAMPLER_CUBE: case GL_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
...@@ -2282,6 +2284,7 @@ TextureType ProgramBinary::getTextureType(GLenum samplerType, InfoLog &infoLog) ...@@ -2282,6 +2284,7 @@ TextureType ProgramBinary::getTextureType(GLenum samplerType, InfoLog &infoLog)
case GL_SAMPLER_2D_ARRAY: case GL_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_ARRAY: case GL_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_ARRAY_SHADOW:
return TEXTURE_2D_ARRAY; return TEXTURE_2D_ARRAY;
default: UNREACHABLE(); default: UNREACHABLE();
} }
......
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