am 3618e8c9: Merge "opengles emulator: add GL_OES_depth_texture extension"

* commit '3618e8c98b238f6abc1eeddda97c75a9140c52ae':
  opengles emulator: add GL_OES_depth_texture extension
This commit is contained in:
David Turner
2011-08-09 08:44:29 -07:00
committed by Android Git Automerger
4 changed files with 23 additions and 1 deletions

View File

@@ -90,7 +90,7 @@ bool GLESv2Context::needConvert(GLESConversionArrays& cArrs,GLint first,GLsizei
void GLESv2Context::initExtensionString() {
*s_glExtensions = "GL_OES_EGL_image GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint "
"GL_OES_standard_derivatives GL_OES_texture_float GL_OES_texture_float_linear "
"GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture ";
"GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture ";
if (s_glSupport.GL_ARB_HALF_FLOAT_PIXEL || s_glSupport.GL_NV_HALF_FLOAT)
*s_glExtensions+="GL_OES_texture_half_float GL_OES_texture_half_float_linear ";
if (s_glSupport.GL_EXT_PACKED_DEPTH_STENCIL)

View File

@@ -1415,6 +1415,12 @@ GL_APICALL void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint inte
GLESv2Validate::pixelFrmt(ctx,format)&&
GLESv2Validate::pixelType(ctx,type)),GL_INVALID_ENUM);
SET_ERROR_IF((format == GL_DEPTH_COMPONENT || internalformat == GL_DEPTH_COMPONENT) &&
(type != GL_UNSIGNED_SHORT && type != GL_UNSIGNED_INT), GL_INVALID_OPERATION);
SET_ERROR_IF((type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT) &&
(format != GL_DEPTH_COMPONENT || internalformat != GL_DEPTH_COMPONENT), GL_INVALID_OPERATION);
SET_ERROR_IF(!(GLESv2Validate::pixelOp(format,type) && internalformat == ((GLint)format)),GL_INVALID_OPERATION);
SET_ERROR_IF(border != 0,GL_INVALID_VALUE);

View File

@@ -140,3 +140,17 @@ bool GLESv2Validate::precisionType(GLenum type){
bool GLESv2Validate::arrayIndex(GLEScontext * ctx,GLuint index) {
return index < (GLuint)ctx->getCaps()->maxVertexAttribs;
}
bool GLESv2Validate::pixelType(GLEScontext * ctx,GLenum type) {
if(type == GL_UNSIGNED_SHORT || type == GL_UNSIGNED_INT)
return true;
return GLESvalidate::pixelType(ctx, type);
}
bool GLESv2Validate::pixelFrmt(GLEScontext* ctx,GLenum format) {
if(format == GL_DEPTH_COMPONENT)
return true;
return GLESvalidate::pixelFrmt(ctx, format);
}

View File

@@ -33,6 +33,8 @@ static bool readPixelFrmt(GLenum format);
static bool shaderType(GLenum type);
static bool precisionType(GLenum type);
static bool arrayIndex(GLEScontext * ctx,GLuint index);
static bool pixelType(GLEScontext * ctx,GLenum type);
static bool pixelFrmt(GLEScontext* ctx,GLenum format);
};
#endif