diff options
author | Brian Paul <[email protected]> | 2017-07-20 10:51:45 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-07-22 13:18:56 -0600 |
commit | b4debc0d6959b793d315f70fd9a354717d51522a (patch) | |
tree | 99112967e074157be5a12b3381d3dd689fd42bb7 /src | |
parent | aeade86db5761313f8b8c3c8555d3813d92e92ff (diff) |
st/mesa: use proper resource target type in st_AllocTextureStorage()
When we validate the texture sample count, pass the correct
pipe_texture_target for the texture, rather than PIPE_TEXTURE_2D.
Also add more comments about MSAA.
No piglit regressions with VMware driver.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index c6a5e634553..f66e1bd0cbe 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -2651,6 +2651,8 @@ st_finalize_texture(struct gl_context *ctx, /** * Called via ctx->Driver.AllocTextureStorage() to allocate texture memory * for a whole mipmap stack. + * Note: for multisample textures if the requested sample count is not + * supported, we search for the next higher supported sample count. */ static GLboolean st_AllocTextureStorage(struct gl_context *ctx, @@ -2679,10 +2681,11 @@ st_AllocTextureStorage(struct gl_context *ctx, /* Raise the sample count if the requested one is unsupported. */ if (num_samples > 1) { + enum pipe_texture_target ptarget = gl_target_to_pipe(texObj->Target); boolean found = FALSE; for (; num_samples <= ctx->Const.MaxSamples; num_samples++) { - if (screen->is_format_supported(screen, fmt, PIPE_TEXTURE_2D, + if (screen->is_format_supported(screen, fmt, ptarget, num_samples, PIPE_BIND_SAMPLER_VIEW)) { /* Update the sample count in gl_texture_image as well. */ |