diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_cb_readpixels.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 2 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index b524738ae29..bfed988701a 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -83,6 +83,10 @@ st_readpixels(struct gl_context *ctx, GLint x, GLint y, st_validate_state(st); st_flush_bitmap_cache(st); + if (!st->prefer_blit_based_texture_transfer) { + goto fallback; + } + /* This must be done after state validation. */ src = strb->texture; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 7307c6052c5..94fbbf7bed8 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -608,6 +608,10 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims, unsigned bind; GLubyte *map; + if (!st->prefer_blit_based_texture_transfer) { + goto fallback; + } + if (!dst) { goto fallback; } @@ -860,6 +864,10 @@ st_GetTexImage(struct gl_context * ctx, ubyte *map = NULL; boolean done = FALSE; + if (!st->prefer_blit_based_texture_transfer) { + goto fallback; + } + if (!stImage->pt) { goto fallback; } diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index e2d074d14a4..cc87f2bb38d 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -182,6 +182,8 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, st->has_stencil_export = screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT); st->has_shader_model3 = screen->get_param(screen, PIPE_CAP_SM3); + st->prefer_blit_based_texture_transfer = screen->get_param(screen, + PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER); st->needs_texcoord_semantic = screen->get_param(screen, PIPE_CAP_TGSI_TEXCOORD); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index c6c68adcfb2..8786a036ff4 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -84,6 +84,7 @@ struct st_context boolean has_stencil_export; /**< can do shader stencil export? */ boolean has_time_elapsed; boolean has_shader_model3; + boolean prefer_blit_based_texture_transfer; boolean needs_texcoord_semantic; |