mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
mesa: add KHR_no_error support for CompressedTex*SubImage1D()
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
cb5627cbac
commit
d5e382e316
4 changed files with 53 additions and 11 deletions
|
|
@ -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" />
|
||||
|
|
|
|||
|
|
@ -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"/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -4574,23 +4580,48 @@ 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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue