diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/dd.h | 5 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 22 | ||||
-rw-r--r-- | src/mesa/main/teximage.h | 7 | ||||
-rw-r--r-- | src/mesa/main/texstorage.c | 4 | ||||
-rw-r--r-- | src/mesa/main/textureview.c | 5 |
5 files changed, 24 insertions, 19 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 4891e2a3728..114cbd2b151 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -308,9 +308,10 @@ struct dd_function_table { * \return GL_TRUE if the image is OK, GL_FALSE if too large */ GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target, - GLint level, mesa_format format, + GLuint numLevels, GLint level, + mesa_format format, GLuint numSamples, GLint width, GLint height, - GLint depth, GLint border); + GLint depth); /*@}*/ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 080bcbf5509..c75f60570c2 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1253,18 +1253,20 @@ error_check_subtexture_dimensions(struct gl_context *ctx, GLuint dims, * and texturing will effectively be disabled. * * \param target any texture target/type + * \param numLevels number of mipmap levels in the texture or 0 if not known * \param level as passed to glTexImage * \param format the MESA_FORMAT_x for the tex image + * \param numSamples number of samples per texel * \param width as passed to glTexImage * \param height as passed to glTexImage * \param depth as passed to glTexImage - * \param border as passed to glTexImage * \return GL_TRUE if the image is acceptable, GL_FALSE if not acceptable. */ GLboolean -_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, - mesa_format format, - GLint width, GLint height, GLint depth, GLint border) +_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, + GLuint numLevels, GLint level, + mesa_format format, GLuint numSamples, + GLint width, GLint height, GLint depth) { /* We just check if the image size is less than MaxTextureMbytes. * Some drivers may do more specific checks. @@ -2949,8 +2951,8 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims, /* check that the texture won't take too much memory, etc */ sizeOK = ctx->Driver.TestProxyTexImage(ctx, proxy_target(target), - level, texFormat, - width, height, depth, border); + 0, level, texFormat, 1, + width, height, depth); if (_mesa_is_proxy_texture(target)) { /* Proxy texture: just clear or set state depending on error checking */ @@ -3646,8 +3648,8 @@ copyteximage(struct gl_context *ctx, GLuint dims, assert(texFormat != MESA_FORMAT_NONE); if (!ctx->Driver.TestProxyTexImage(ctx, proxy_target(target), - level, texFormat, - width, height, 1, border)) { + 0, level, texFormat, 1, + width, height, 1)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage%uD(image too large)", dims); return; @@ -5386,8 +5388,8 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims, dimensionsOK = _mesa_legal_texture_dimensions(ctx, target, 0, width, height, depth, 0); - sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, 0, texFormat, - width, height, depth, 0); + sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, 0, 0, texFormat, + samples, width, height, depth); if (_mesa_is_proxy_texture(target)) { if (samplesOK && dimensionsOK && sizeOK) { diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 8b687062a67..c52a7806c0d 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -176,9 +176,10 @@ _mesa_max_texture_levels(struct gl_context *ctx, GLenum target); extern GLboolean -_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level, - mesa_format format, - GLint width, GLint height, GLint depth, GLint border); +_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, + GLuint numLevels, GLint level, + mesa_format format, GLuint numSamples, + GLint width, GLint height, GLint depth); extern GLboolean _mesa_target_can_be_compressed(const struct gl_context *ctx, GLenum target, diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index 72ed8696fde..ab8324f176e 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -396,8 +396,8 @@ _mesa_texture_storage(struct gl_context *ctx, GLuint dims, dimensionsOK = _mesa_legal_texture_dimensions(ctx, target, 0, width, height, depth, 0); - sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, 0, texFormat, - width, height, depth, 0); + sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, levels, 0, texFormat, + 1, width, height, depth); if (_mesa_is_proxy_texture(target)) { if (dimensionsOK && sizeOK) { diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c index 9b584cdba68..ed66c179589 100644 --- a/src/mesa/main/textureview.c +++ b/src/mesa/main/textureview.c @@ -714,8 +714,9 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture, return; } - sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, 0, texFormat, - width, height, depth, 0); + sizeOK = ctx->Driver.TestProxyTexImage(ctx, target, 1, 0, texFormat, + origTexImage->NumSamples, + width, height, depth); if (!sizeOK) { _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureView(invalid texture size)"); |