summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2016-07-14 14:25:19 -0600
committerBrian Paul <brianp@vmware.com>2016-07-15 14:24:34 -0600
commit0ac9f25032a2e1bca52552972da4b55276fc1ae6 (patch)
tree9148c7e375915da492c85176e50ae763e9b093da /src/mesa/main/teximage.c
parente477d92c94d6415d2844f68766adf5339aebe7bf (diff)
downloadexternal_mesa3d-0ac9f25032a2e1bca52552972da4b55276fc1ae6.zip
external_mesa3d-0ac9f25032a2e1bca52552972da4b55276fc1ae6.tar.gz
external_mesa3d-0ac9f25032a2e1bca52552972da4b55276fc1ae6.tar.bz2
mesa: add numLevels, numSamples to Driver.TestProxyTexImage()
So that the function can work properly with glTexStorage(), where we know how many mipmap levels there are. And so we can compute storage for MSAA textures. Also, remove the obsolete texture border parameter. A subsequent patch will update _mesa_test_proxy_teximage() to use these new parameters. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 080bcbf..c75f605 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) {