diff options
author | Ilia Mirkin <[email protected]> | 2019-09-02 18:50:01 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2019-09-04 00:35:45 -0400 |
commit | 32d458fdff83454b9b3a9f77b9c34640e382b4f3 (patch) | |
tree | 7c9b4a42b9a31bd820152421cd1e7b874bbd6994 /src/mesa | |
parent | 8e92ce9ba566dd34e6f99b0042d16cba4b12f787 (diff) |
teximage: ensure that Tex*SubImage* checks format
We were previously not doing at least some of the checks. This uses the
same logic that is used in glTexImage*.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/teximage.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index f90765f40fa..e55e435779f 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2205,6 +2205,15 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions, return GL_TRUE; } + if (!texture_formats_agree(texImage->InternalFormat, format)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s(incompatible internalFormat = %s, format = %s)", + callerName, + _mesa_enum_to_string(texImage->InternalFormat), + _mesa_enum_to_string(format)); + return GL_TRUE; + } + GLenum internalFormat = _mesa_is_gles(ctx) ? oes_float_internal_format(ctx, texImage->InternalFormat, type) : texImage->InternalFormat; |