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 ...@@ -2368,8 +2368,9 @@ namespace glsl
GLenum OutputASM::glVariableType(const TType &type) GLenum OutputASM::glVariableType(const TType &type)
{ {
if(type.getBasicType() == EbtFloat) switch(type.getBasicType())
{ {
case EbtFloat:
if(type.isScalar()) if(type.isScalar())
{ {
return GL_FLOAT; return GL_FLOAT;
...@@ -2416,9 +2417,8 @@ namespace glsl ...@@ -2416,9 +2417,8 @@ namespace glsl
} }
} }
else UNREACHABLE(); else UNREACHABLE();
} break;
else if(type.getBasicType() == EbtInt) case EbtInt:
{
if(type.isScalar()) if(type.isScalar())
{ {
return GL_INT; return GL_INT;
...@@ -2434,9 +2434,25 @@ namespace glsl ...@@ -2434,9 +2434,25 @@ namespace glsl
} }
} }
else UNREACHABLE(); else UNREACHABLE();
} break;
else if(type.getBasicType() == EbtBool) 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()) if(type.isScalar())
{ {
return GL_BOOL; return GL_BOOL;
...@@ -2452,24 +2468,29 @@ namespace glsl ...@@ -2452,24 +2468,29 @@ namespace glsl
} }
} }
else UNREACHABLE(); else UNREACHABLE();
} break;
else if(type.getBasicType() == EbtSampler2D) case EbtSampler2D:
{ case EbtISampler2D:
case EbtUSampler2D:
return GL_SAMPLER_2D; return GL_SAMPLER_2D;
} case EbtSamplerCube:
else if(type.getBasicType() == EbtSamplerCube) case EbtISamplerCube:
{ case EbtUSamplerCube:
return GL_SAMPLER_CUBE; return GL_SAMPLER_CUBE;
} case EbtSamplerExternalOES:
else if(type.getBasicType() == EbtSamplerExternalOES)
{
return GL_SAMPLER_EXTERNAL_OES; return GL_SAMPLER_EXTERNAL_OES;
} case EbtSampler3D:
else if(type.getBasicType() == EbtSampler3D) case EbtISampler3D:
{ case EbtUSampler3D:
return GL_SAMPLER_3D_OES; return GL_SAMPLER_3D_OES;
case EbtSampler2DArray:
case EbtISampler2DArray:
case EbtUSampler2DArray:
return GL_SAMPLER_2D_ARRAY;
default:
UNREACHABLE();
break;
} }
else UNREACHABLE();
return GL_NONE; 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