Commit 354ed2d1 by Nicolas Capens Committed by Shannon Woods

Compact sampler type translation.

TRAC #23394 Signed-off-by: Jamie Madill Signed-off-by: Shannon Woods Author: Nicolas Capens
parent 8f80e024
......@@ -3803,55 +3803,27 @@ GLenum OutputHLSL::glVariableType(const TType &type)
}
else UNREACHABLE();
}
else if (type.getBasicType() == EbtSampler2D)
{
return GL_SAMPLER_2D;
}
else if (type.getBasicType() == EbtSampler3D)
{
return GL_SAMPLER_3D;
}
else if (type.getBasicType() == EbtSamplerCube)
{
return GL_SAMPLER_CUBE;
}
else if (type.getBasicType() == EbtSampler2DArray)
{
return GL_SAMPLER_2D_ARRAY;
}
else if (type.getBasicType() == EbtISampler2D)
{
return GL_INT_SAMPLER_2D;
}
else if (type.getBasicType() == EbtISampler3D)
{
return GL_INT_SAMPLER_3D;
}
else if (type.getBasicType() == EbtISamplerCube)
{
return GL_INT_SAMPLER_CUBE;
}
else if (type.getBasicType() == EbtISampler2DArray)
{
return GL_INT_SAMPLER_2D_ARRAY;
}
else if (type.getBasicType() == EbtUSampler2D)
{
return GL_UNSIGNED_INT_SAMPLER_2D;
}
else if (type.getBasicType() == EbtUSampler3D)
{
return GL_UNSIGNED_INT_SAMPLER_3D;
}
else if (type.getBasicType() == EbtUSamplerCube)
{
return GL_UNSIGNED_INT_SAMPLER_CUBE;
}
else if (type.getBasicType() == EbtUSampler2DArray)
{
return GL_UNSIGNED_INT_SAMPLER_2D_ARRAY;
switch(type.getBasicType())
{
case EbtSampler2D: return GL_SAMPLER_2D;
case EbtSampler3D: return GL_SAMPLER_3D;
case EbtSamplerCube: return GL_SAMPLER_CUBE;
case EbtSampler2DArray: return GL_SAMPLER_2D_ARRAY;
case EbtISampler2D: return GL_INT_SAMPLER_2D;
case EbtISampler3D: return GL_INT_SAMPLER_3D;
case EbtISamplerCube: return GL_INT_SAMPLER_CUBE;
case EbtISampler2DArray: return GL_INT_SAMPLER_2D_ARRAY;
case EbtUSampler2D: return GL_UNSIGNED_INT_SAMPLER_2D;
case EbtUSampler3D: return GL_UNSIGNED_INT_SAMPLER_3D;
case EbtUSamplerCube: return GL_UNSIGNED_INT_SAMPLER_CUBE;
case EbtUSampler2DArray: return GL_UNSIGNED_INT_SAMPLER_2D_ARRAY;
case EbtSampler2DShadow: return GL_SAMPLER_2D_SHADOW;
case EbtSamplerCubeShadow: return GL_SAMPLER_CUBE_SHADOW;
case EbtSampler2DArrayShadow: return GL_SAMPLER_2D_ARRAY_SHADOW;
default: UNREACHABLE();
}
else UNREACHABLE();
return GL_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