Commit 7ca4db3c by Alexis Hetu Committed by Alexis Hétu

Added handling of a few more types of variable

Added a few missing types: - Unsigned ints and vectors - Signed and unsigned int samplers - 2D Array samplers Change-Id: I052f7da3b2cb24c5cd2bdd1cf1e3b3a2b0ee0a50 Reviewed-on: https://swiftshader-review.googlesource.com/3042Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 5f3d23ca
......@@ -2368,8 +2368,9 @@ namespace glsl
GLenum OutputASM::glVariableType(const TType &type)
{
if(type.getBasicType() == EbtFloat)
switch(type.getBasicType())
{
case EbtFloat:
if(type.isScalar())
{
return GL_FLOAT;
......@@ -2416,9 +2417,8 @@ namespace glsl
}
}
else UNREACHABLE();
}
else if(type.getBasicType() == EbtInt)
{
break;
case EbtInt:
if(type.isScalar())
{
return GL_INT;
......@@ -2434,9 +2434,25 @@ namespace glsl
}
}
else UNREACHABLE();
}
else if(type.getBasicType() == EbtBool)
{
break;
case EbtUInt:
if(type.isScalar())
{
return GL_UNSIGNED_INT;
}
else if(type.isVector())
{
switch(type.getNominalSize())
{
case 2: return GL_UNSIGNED_INT_VEC2;
case 3: return GL_UNSIGNED_INT_VEC3;
case 4: return GL_UNSIGNED_INT_VEC4;
default: UNREACHABLE();
}
}
else UNREACHABLE();
break;
case EbtBool:
if(type.isScalar())
{
return GL_BOOL;
......@@ -2452,24 +2468,29 @@ namespace glsl
}
}
else UNREACHABLE();
}
else if(type.getBasicType() == EbtSampler2D)
{
break;
case EbtSampler2D:
case EbtISampler2D:
case EbtUSampler2D:
return GL_SAMPLER_2D;
}
else if(type.getBasicType() == EbtSamplerCube)
{
case EbtSamplerCube:
case EbtISamplerCube:
case EbtUSamplerCube:
return GL_SAMPLER_CUBE;
}
else if(type.getBasicType() == EbtSamplerExternalOES)
{
case EbtSamplerExternalOES:
return GL_SAMPLER_EXTERNAL_OES;
}
else if(type.getBasicType() == EbtSampler3D)
{
case EbtSampler3D:
case EbtISampler3D:
case EbtUSampler3D:
return GL_SAMPLER_3D_OES;
case EbtSampler2DArray:
case EbtISampler2DArray:
case EbtUSampler2DArray:
return GL_SAMPLER_2D_ARRAY;
default:
UNREACHABLE();
break;
}
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