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 | |
parent | cb5627cbac2c68b0faccdedaeb462fbd507ddc7e (diff) |
mesa: add KHR_no_error support for CompressedTex*SubImage1D()
Reviewed-by: Nicolai Hähnle <[email protected]>
-rw-r--r-- | src/mapi/glapi/gen/ARB_direct_state_access.xml | 2 | ||||
-rw-r--r-- | src/mapi/glapi/gen/gl_API.xml | 2 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 49 | ||||
-rw-r--r-- | src/mesa/main/teximage.h | 11 |
4 files changed, 53 insertions, 11 deletions
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml index 2f2ba20b7d4..4597d3b6d38 100644 --- a/src/mapi/glapi/gen/ARB_direct_state_access.xml +++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml @@ -410,7 +410,7 @@ <param name="pixels" type="const GLvoid *" /> </function> - <function name="CompressedTextureSubImage1D"> + <function name="CompressedTextureSubImage1D" no_error="true"> <param name="texture" type="GLuint" /> <param name="level" type="GLint" /> <param name="xoffset" type="GLint" /> diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 50d60f53da6..026f74c2a04 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -4571,7 +4571,7 @@ <glx rop="218" handcode="client"/> </function> - <function name="CompressedTexSubImage1D" marshal="sync"> + <function name="CompressedTexSubImage1D" marshal="sync" no_error="true"> <param name="target" type="GLenum"/> <param name="level" type="GLint"/> <param name="xoffset" type="GLint"/> 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); |