diff options
author | Timothy Arceri <[email protected]> | 2017-05-10 17:20:10 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-17 10:12:03 +1000 |
commit | d5e382e316b651f1b048407b014c6e9cfc05b8cc (patch) | |
tree | 6d4f94c0b09e773f11dfb0ba3498d48e249004b7 /src/mesa/main | |
parent | cb5627cbac2c68b0faccdedaeb462fbd507ddc7e (diff) |
mesa: add KHR_no_error support for CompressedTex*SubImage1D()
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/teximage.c | 49 | ||||
-rw-r--r-- | src/mesa/main/teximage.h | 11 |
2 files changed, 51 insertions, 9 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index c95e9e276cf..722d8809d39 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -4533,7 +4533,7 @@ static ALWAYS_INLINE void compressed_tex_sub_image(unsigned dim, GLenum target, GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data, - bool dsa, const char *caller) + bool dsa, bool no_error, const char *caller) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; @@ -4541,25 +4541,31 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint texture, GET_CURRENT_CONTEXT(ctx); if (dsa) { - texObj = _mesa_lookup_texture_err(ctx, texture, caller); - if (!texObj) - return; + if (no_error) { + texObj = _mesa_lookup_texture(ctx, texture); + } else { + texObj = _mesa_lookup_texture_err(ctx, texture, caller); + if (!texObj) + return; + } target = texObj->Target; } - if (compressed_subtexture_target_check(ctx, target, dim, format, dsa, + if (!no_error && + compressed_subtexture_target_check(ctx, target, dim, format, dsa, caller)) { return; } if (!dsa) { texObj = _mesa_get_current_tex_object(ctx, target); - if (!texObj) + if (!no_error && !texObj) return; } - if (compressed_subtexture_error_check(ctx, dim, texObj, target, level, + if (!no_error && + compressed_subtexture_error_check(ctx, dim, texObj, target, level, xoffset, 0, 0, width, 1, 1, format, imageSize, data, caller)) { return; @@ -4575,22 +4581,47 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint texture, void GLAPIENTRY +_mesa_CompressedTexSubImage1D_no_error(GLenum target, GLint level, + GLint xoffset, GLsizei width, + GLenum format, GLsizei imageSize, + const GLvoid *data) +{ + compressed_tex_sub_image(1, target, 0, level, xoffset, width, format, + imageSize, data, false, true, + "glCompressedTexSubImage1D"); +} + + +void GLAPIENTRY _mesa_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) { compressed_tex_sub_image(1, target, 0, level, xoffset, width, format, - imageSize, data, false, + imageSize, data, false, false, "glCompressedTexSubImage1D"); } + +void GLAPIENTRY +_mesa_CompressedTextureSubImage1D_no_error(GLuint texture, GLint level, + GLint xoffset, GLsizei width, + GLenum format, GLsizei imageSize, + const GLvoid *data) +{ + compressed_tex_sub_image(1, 0, texture, level, xoffset, width, + format, imageSize, data, true, true, + "glCompressedTextureSubImage1D"); +} + + void GLAPIENTRY _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) { compressed_tex_sub_image(1, 0, texture, level, xoffset, width, - format, imageSize, data, true, + format, imageSize, data, true, false, "glCompressedTextureSubImage1D"); } diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 5becd293444..08e01c6641d 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -386,12 +386,23 @@ _mesa_CompressedTexImage3D(GLenum target, GLint level, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); + +extern void GLAPIENTRY +_mesa_CompressedTexSubImage1D_no_error(GLenum target, GLint level, + GLint xoffset, GLsizei width, + GLenum format, GLsizei imageSize, + const GLvoid *data); extern void GLAPIENTRY _mesa_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); extern void GLAPIENTRY +_mesa_CompressedTextureSubImage1D_no_error(GLuint texture, GLint level, + GLint xoffset, GLsizei width, + GLenum format, GLsizei imageSize, + const GLvoid *data); +extern void GLAPIENTRY _mesa_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); |