[Mesa-dev] [PATCH 7/7] mesa: add KHR_no_error support for glCompressedTex*SubImage3D()
Timothy Arceri
tarceri at itsqueeze.com
Fri May 12 04:13:01 UTC 2017
---
src/mapi/glapi/gen/ARB_direct_state_access.xml | 2 +-
src/mapi/glapi/gen/gl_API.xml | 3 ++-
src/mesa/main/teximage.c | 28 +++++++++++++++++++++++++-
src/mesa/main/teximage.h | 14 +++++++++++++
4 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/src/mapi/glapi/gen/ARB_direct_state_access.xml b/src/mapi/glapi/gen/ARB_direct_state_access.xml
index 21f44b5..43e4e05 100644
--- a/src/mapi/glapi/gen/ARB_direct_state_access.xml
+++ b/src/mapi/glapi/gen/ARB_direct_state_access.xml
@@ -425,21 +425,21 @@
<param name="level" type="GLint" />
<param name="xoffset" type="GLint" />
<param name="yoffset" type="GLint" />
<param name="width" type="GLsizei" />
<param name="height" type="GLsizei" />
<param name="format" type="GLenum" />
<param name="imageSize" type="GLsizei" />
<param name="data" type="const GLvoid *" />
</function>
- <function name="CompressedTextureSubImage3D">
+ <function name="CompressedTextureSubImage3D" no_error="true">
<param name="texture" type="GLuint" />
<param name="level" type="GLint" />
<param name="xoffset" type="GLint" />
<param name="yoffset" type="GLint" />
<param name="zoffset" type="GLint" />
<param name="width" type="GLsizei" />
<param name="height" type="GLsizei" />
<param name="depth" type="GLsizei" />
<param name="format" type="GLenum" />
<param name="imageSize" type="GLsizei" />
diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml
index 755cb31..1a3b306 100644
--- a/src/mapi/glapi/gen/gl_API.xml
+++ b/src/mapi/glapi/gen/gl_API.xml
@@ -4536,21 +4536,22 @@
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="internalformat" type="GLenum"/>
<param name="width" type="GLsizei"/>
<param name="border" type="GLint"/>
<param name="imageSize" type="GLsizei" counter="true"/>
<param name="data" type="const GLvoid *" count="imageSize"/>
<glx rop="214" handcode="client"/>
</function>
- <function name="CompressedTexSubImage3D" es2="3.0" marshal="sync">
+ <function name="CompressedTexSubImage3D" es2="3.0" marshal="sync"
+ no_error="true">
<param name="target" type="GLenum"/>
<param name="level" type="GLint"/>
<param name="xoffset" type="GLint"/>
<param name="yoffset" type="GLint"/>
<param name="zoffset" type="GLint"/>
<param name="width" type="GLsizei"/>
<param name="height" type="GLsizei"/>
<param name="depth" type="GLsizei"/>
<param name="format" type="GLenum"/>
<param name="imageSize" type="GLsizei" counter="true"/>
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 2f9ff30..fed1dad 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -4576,21 +4576,21 @@ compressed_tex_sub_image(unsigned dim, GLenum target, GLuint texture,
/* Must handle special case GL_TEXTURE_CUBE_MAP. */
if (dim == 3 && dsa && texObj->Target == GL_TEXTURE_CUBE_MAP) {
const char *pixels = data;
GLint image_stride;
/* Make sure the texture object is a proper cube.
* (See texturesubimage in teximage.c for details on why this check is
* performed.)
*/
- if (!_mesa_cube_level_complete(texObj, level)) {
+ if (!no_error && !_mesa_cube_level_complete(texObj, level)) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCompressedTextureSubImage3D(cube map incomplete)");
return;
}
/* Copy in each face. */
for (int i = 0; i < 6; ++i) {
texImage = texObj->Image[i][level];
assert(texImage);
@@ -4707,31 +4707,57 @@ _mesa_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const GLvoid *data)
{
compressed_tex_sub_image(2, 0, texture, level, xoffset, yoffset, 0, width,
height, 1, format, imageSize, data, true, false,
"glCompressedTextureSubImage2D");
}
void GLAPIENTRY
+_mesa_CompressedTexSubImage3D_no_error(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data)
+{
+ compressed_tex_sub_image(3, target, 0, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, imageSize, data,
+ false, true, "glCompressedTexSubImage3D");
+}
+
+void GLAPIENTRY
_mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth, GLenum format,
GLsizei imageSize, const GLvoid *data)
{
compressed_tex_sub_image(3, target, 0, level, xoffset, yoffset, zoffset,
width, height, depth, format, imageSize, data,
false, false, "glCompressedTexSubImage3D");
}
void GLAPIENTRY
+_mesa_CompressedTextureSubImage3D_no_error(GLuint texture, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data)
+{
+ compressed_tex_sub_image(3, 0, texture, level, xoffset, yoffset, zoffset,
+ width, height, depth, format, imageSize, data,
+ true, true, "glCompressedTextureSubImage3D");
+}
+
+void GLAPIENTRY
_mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth,
GLenum format, GLsizei imageSize,
const GLvoid *data)
{
compressed_tex_sub_image(3, 0, texture, level, xoffset, yoffset, zoffset,
width, height, depth, format, imageSize, data,
true, false, "glCompressedTextureSubImage3D");
}
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 6eda721..bc4e235 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -426,26 +426,40 @@ _mesa_CompressedTextureSubImage2D_no_error(GLuint texture, GLint level,
GLenum format, GLsizei imageSize,
const GLvoid *data);
extern void GLAPIENTRY
_mesa_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset,
GLint yoffset,
GLsizei width, GLsizei height,
GLenum format, GLsizei imageSize,
const GLvoid *data);
extern void GLAPIENTRY
+_mesa_CompressedTexSubImage3D_no_error(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data);
+extern void GLAPIENTRY
_mesa_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset, GLsizei width,
GLsizei height, GLsizei depth, GLenum format,
GLsizei imageSize, const GLvoid *data);
extern void GLAPIENTRY
+_mesa_CompressedTextureSubImage3D_no_error(GLuint texture, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width,
+ GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize,
+ const GLvoid *data);
+extern void GLAPIENTRY
_mesa_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset,
GLint yoffset, GLint zoffset,
GLsizei width, GLsizei height,
GLsizei depth,
GLenum format, GLsizei imageSize,
const GLvoid *data);
extern void GLAPIENTRY
_mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer);
--
2.9.3
More information about the mesa-dev
mailing list