aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index c922a3164..94fbbf7be 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -68,7 +68,7 @@
#define DBG if (0) printf
-static enum pipe_texture_target
+enum pipe_texture_target
gl_target_to_pipe(GLenum target)
{
switch (target) {
@@ -542,8 +542,8 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage,
* Return a writemask for the gallium blit. The parameters can be base
* formats or "format" from glDrawPixels/glTexImage/glGetTexImage.
*/
-static unsigned
-get_blit_mask(GLenum srcFormat, GLenum dstFormat)
+unsigned
+st_get_blit_mask(GLenum srcFormat, GLenum dstFormat)
{
switch (dstFormat) {
case GL_DEPTH_STENCIL:
@@ -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;
}
@@ -769,7 +773,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
blit.src.box.width = blit.dst.box.width = width;
blit.src.box.height = blit.dst.box.height = height;
blit.src.box.depth = blit.dst.box.depth = depth;
- blit.mask = get_blit_mask(format, texImage->_BaseFormat);
+ blit.mask = st_get_blit_mask(format, texImage->_BaseFormat);
blit.filter = PIPE_TEX_FILTER_NEAREST;
blit.scissor_enable = FALSE;
@@ -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;
}
@@ -996,7 +1004,7 @@ st_GetTexImage(struct gl_context * ctx,
blit.src.box.width = blit.dst.box.width = width;
blit.src.box.height = blit.dst.box.height = height;
blit.src.box.depth = blit.dst.box.depth = depth;
- blit.mask = get_blit_mask(texImage->_BaseFormat, format);
+ blit.mask = st_get_blit_mask(texImage->_BaseFormat, format);
blit.filter = PIPE_TEX_FILTER_NEAREST;
blit.scissor_enable = FALSE;
@@ -1370,7 +1378,7 @@ st_CopyTexSubImage(struct gl_context *ctx, GLuint dims,
blit.dst.box.width = width;
blit.dst.box.height = height;
blit.dst.box.depth = 1;
- blit.mask = get_blit_mask(rb->_BaseFormat, texImage->_BaseFormat);
+ blit.mask = st_get_blit_mask(rb->_BaseFormat, texImage->_BaseFormat);
blit.filter = PIPE_TEX_FILTER_NEAREST;
/* 1D array textures need special treatment.