Commit 355a5dc1 by Alexis Hetu Committed by Alexis Hétu

Adding support for more format/internalformat combinations

OpenGLES 3.0 allows for more combinations of format/internalformat for floating point types. These types were already supported, just not using the combinations added here. Bug chromium:763384 Change-Id: I146548c2920799c7ea0d5d537d556ba562708147 Reviewed-on: https://swiftshader-review.googlesource.com/12928Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 36fad3cc
......@@ -663,10 +663,19 @@ namespace egl
return sw::FORMAT_G32R32F;
case GL_RGB:
case GL_RGB32F:
case GL_R11F_G11F_B10F:
case GL_RGB9_E5:
return sw::FORMAT_X32B32G32R32F;
case GL_RGBA:
case GL_RGBA32F:
return sw::FORMAT_A32B32G32R32F;
case GL_R16F:
return sw::FORMAT_R16F;
case GL_RG16F:
return sw::FORMAT_G16R16F;
case GL_RGB16F:
case GL_RGBA16F:
return sw::FORMAT_A16B16G16R16F;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT32F:
return sw::FORMAT_D32F;
......@@ -697,6 +706,9 @@ namespace egl
case GL_RGBA:
case GL_RGBA16F:
return sw::FORMAT_A16B16G16R16F;
case GL_R11F_G11F_B10F:
case GL_RGB9_E5:
return sw::FORMAT_X32B32G32R32F;
default:
UNREACHABLE(format);
}
......@@ -1062,6 +1074,8 @@ namespace egl
case GL_RGB32F: return sizeof(float) * 3;
case GL_RGBA: return sizeof(float) * 4;
case GL_RGBA32F: return sizeof(float) * 4;
case GL_R11F_G11F_B10F: return sizeof(int);
case GL_RGB9_E5: return sizeof(int);
default: UNREACHABLE(format);
}
break;
......@@ -1083,6 +1097,8 @@ namespace egl
case GL_RGB16F: return sizeof(unsigned short) * 3;
case GL_RGBA: return sizeof(unsigned short) * 4;
case GL_RGBA16F: return sizeof(unsigned short) * 4;
case GL_R11F_G11F_B10F: return sizeof(int);
case GL_RGB9_E5: return sizeof(int);
default: UNREACHABLE(format);
}
break;
......@@ -1494,6 +1510,12 @@ namespace egl
case GL_RGBA32F:
LoadImageData<Bytes_16>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
break;
case GL_R11F_G11F_B10F:
LoadImageData<R11G11B10F>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
break;
case GL_RGB9_E5:
LoadImageData<RGB9E5>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
break;
case GL_DEPTH_COMPONENT:
case GL_DEPTH_COMPONENT32F:
LoadImageData<Bytes_4>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
......@@ -1533,6 +1555,12 @@ namespace egl
case GL_RGBA16F:
LoadImageData<Bytes_8>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
break;
case GL_R11F_G11F_B10F:
LoadImageData<R11G11B10F>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
break;
case GL_RGB9_E5:
LoadImageData<RGB9E5>(xoffset, yoffset, zoffset, width, height, depth, inputPitch, inputHeight, getPitch(), getHeight(), input, buffer);
break;
default: UNREACHABLE(format);
}
break;
......
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