case GL_DOUBLE:
return sizeof(GLdouble);
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
return sizeof(GLhalfARB);
case GL_FIXED:
return sizeof(GLfixed);
case GL_INT:
return sizeof(GLint);
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
return sizeof(GLhalfARB);
case GL_FLOAT:
return sizeof(GLfloat);
case GL_FLOAT:
return comps * sizeof(GLfloat);
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
return comps * sizeof(GLhalfARB);
case GL_UNSIGNED_BYTE_3_3_2:
case GL_UNSIGNED_BYTE_2_3_3_REV:
}
return GL_NO_ERROR;
+ case GL_HALF_FLOAT_OES:
+ switch (format) {
+ case GL_RGBA:
+ case GL_RGB:
+ case GL_LUMINANCE_ALPHA:
+ case GL_LUMINANCE:
+ case GL_ALPHA:
+ return GL_NO_ERROR;
+ default:
+ return GL_INVALID_OPERATION;
+ }
+
default:
; /* fall-through */
}
* \return error code, or GL_NO_ERROR.
*/
GLenum
-_mesa_es3_error_check_format_and_type(GLenum format, GLenum type,
+_mesa_es3_error_check_format_and_type(const struct gl_context *ctx,
+ GLenum format, GLenum type,
GLenum internalFormat)
{
switch (format) {
case GL_RGBA16F:
case GL_RGBA32F:
break;
+ case GL_RGBA:
+ if (ctx->Extensions.OES_texture_float && internalFormat == format)
+ break;
default:
return GL_INVALID_OPERATION;
}
break;
+ case GL_HALF_FLOAT_OES:
+ if (ctx->Extensions.OES_texture_half_float && internalFormat == format)
+ break;
default:
return GL_INVALID_OPERATION;
}
case GL_R11F_G11F_B10F:
case GL_RGB9_E5:
break;
+ case GL_RGB:
+ if (ctx->Extensions.OES_texture_float && internalFormat == format)
+ break;
default:
return GL_INVALID_OPERATION;
}
break;
+ case GL_HALF_FLOAT_OES:
+ if (!ctx->Extensions.OES_texture_half_float || internalFormat != format)
+ return GL_INVALID_OPERATION;
+ break;
+
case GL_UNSIGNED_INT_2_10_10_10_REV:
switch (internalFormat) {
case GL_RGB: /* GL_EXT_texture_type_2_10_10_10_REV */
case GL_ALPHA:
case GL_LUMINANCE:
case GL_LUMINANCE_ALPHA:
- if (type != GL_UNSIGNED_BYTE || format != internalFormat)
- return GL_INVALID_OPERATION;
- break;
+ switch (type) {
+ case GL_FLOAT:
+ if (ctx->Extensions.OES_texture_float && internalFormat == format)
+ break;
+ case GL_HALF_FLOAT_OES:
+ if (ctx->Extensions.OES_texture_half_float && internalFormat == format)
+ break;
+ default:
+ if (type != GL_UNSIGNED_BYTE || format != internalFormat)
+ return GL_INVALID_OPERATION;
+ }
}
return GL_NO_ERROR;
is_signed = true;
break;
case GL_HALF_FLOAT:
+ case GL_HALF_FLOAT_OES:
type_size = 2;
is_signed = true;
is_float = true;
srcType == GL_INT ||
srcType == GL_UNSIGNED_INT_24_8_EXT ||
srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_HALF_FLOAT_OES ||
srcType == GL_FLOAT ||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
}
break;
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
{
GLuint i;
const GLhalfARB *s = (const GLhalfARB *) src;
srcType == GL_INT ||
srcType == GL_UNSIGNED_INT_24_8_EXT ||
srcType == GL_HALF_FLOAT_ARB ||
+ srcType == GL_HALF_FLOAT_OES ||
srcType == GL_FLOAT ||
srcType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
}
break;
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
{
GLhalfARB *dst = (GLhalfARB *) dest;
GLuint i;
needClamp = GL_TRUE;
break;
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
{
GLuint i;
const GLhalfARB *src = (const GLhalfARB *) source;
}
break;
case GL_HALF_FLOAT_ARB:
+ case GL_HALF_FLOAT_OES:
{
GLhalfARB *dst = (GLhalfARB *) dest;
GLuint i;