diff options
author | Brian Paul <[email protected]> | 2016-07-14 14:25:19 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2016-07-15 14:24:34 -0600 |
commit | 0ac9f25032a2e1bca52552972da4b55276fc1ae6 (patch) | |
tree | 9148c7e375915da492c85176e50ae763e9b093da /src/mesa/state_tracker | |
parent | e477d92c94d6415d2844f68766adf5339aebe7bf (diff) |
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 <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 1474d973861..a76775f6ded 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -2686,9 +2686,9 @@ st_AllocTextureStorage(struct gl_context *ctx, static GLboolean st_TestProxyTexImage(struct gl_context *ctx, GLenum target, - GLint level, mesa_format format, - GLint width, GLint height, - GLint depth, GLint border) + GLuint numLevels, GLint level, + mesa_format format, GLuint numSamples, + GLint width, GLint height, GLint depth) { struct st_context *st = st_context(ctx); struct pipe_context *pipe = st->pipe; @@ -2710,14 +2710,19 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target, pt.target = gl_target_to_pipe(target); pt.format = st_mesa_format_to_pipe_format(st, format); + pt.nr_samples = numSamples; st_gl_texture_dims_to_pipe_dims(target, width, height, depth, &pt.width0, &pt.height0, &pt.depth0, &pt.array_size); - if (level == 0 && (texObj->Sampler.MinFilter == GL_LINEAR || - texObj->Sampler.MinFilter == GL_NEAREST)) { + if (numLevels > 0) { + /* For immutable textures we know the final number of mip levels */ + pt.last_level = numLevels - 1; + } + else if (level == 0 && (texObj->Sampler.MinFilter == GL_LINEAR || + texObj->Sampler.MinFilter == GL_NEAREST)) { /* assume just one mipmap level */ pt.last_level = 0; } @@ -2730,8 +2735,8 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target, } else { /* Use core Mesa fallback */ - return _mesa_test_proxy_teximage(ctx, target, level, format, - width, height, depth, border); + return _mesa_test_proxy_teximage(ctx, target, numLevels, level, format, + numSamples, width, height, depth); } } |