diff options
29 files changed, 24 insertions, 95 deletions
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 3a94b75ee33..4619526094c 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -526,8 +526,6 @@ debug_print_bind_flags(const char *msg, unsigned usage) DEBUG_NAMED_VALUE(PIPE_BIND_INDEX_BUFFER), DEBUG_NAMED_VALUE(PIPE_BIND_CONSTANT_BUFFER), DEBUG_NAMED_VALUE(PIPE_BIND_DISPLAY_TARGET), - DEBUG_NAMED_VALUE(PIPE_BIND_TRANSFER_WRITE), - DEBUG_NAMED_VALUE(PIPE_BIND_TRANSFER_READ), DEBUG_NAMED_VALUE(PIPE_BIND_STREAM_OUTPUT), DEBUG_NAMED_VALUE(PIPE_BIND_CURSOR), DEBUG_NAMED_VALUE(PIPE_BIND_CUSTOM), diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst index 5a11e729841..5dff650fe8d 100644 --- a/src/gallium/docs/source/screen.rst +++ b/src/gallium/docs/source/screen.rst @@ -529,8 +529,6 @@ resources might be created and handled quite differently. * ``PIPE_BIND_VERTEX_BUFFER``: A vertex buffer. * ``PIPE_BIND_INDEX_BUFFER``: An vertex index/element buffer. * ``PIPE_BIND_CONSTANT_BUFFER``: A buffer of shader constants. -* ``PIPE_BIND_TRANSFER_WRITE``: A transfer object which will be written to. -* ``PIPE_BIND_TRANSFER_READ``: A transfer object which will be read from. * ``PIPE_BIND_STREAM_OUTPUT``: A stream output buffer. * ``PIPE_BIND_CUSTOM``: * ``PIPE_BIND_SCANOUT``: A front color buffer or scanout buffer. diff --git a/src/gallium/drivers/freedreno/a2xx/fd2_screen.c b/src/gallium/drivers/freedreno/a2xx/fd2_screen.c index 007b9e66870..12ab5b41089 100644 --- a/src/gallium/drivers/freedreno/a2xx/fd2_screen.c +++ b/src/gallium/drivers/freedreno/a2xx/fd2_screen.c @@ -87,11 +87,6 @@ fd2_screen_is_format_supported(struct pipe_screen *pscreen, retval |= PIPE_BIND_INDEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - if (retval != usage) { DBG("not supported: format=%s, target=%d, sample_count=%d, " "usage=%x, retval=%x", util_format_name(format), diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c index 52a284e0471..998ec7a0bdb 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_screen.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_screen.c @@ -87,11 +87,6 @@ fd3_screen_is_format_supported(struct pipe_screen *pscreen, retval |= PIPE_BIND_INDEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - if (retval != usage) { DBG("not supported: format=%s, target=%d, sample_count=%d, " "usage=%x, retval=%x", util_format_name(format), diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c index aa60658d7c6..6006bb96b3a 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_screen.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_screen.c @@ -86,11 +86,6 @@ fd4_screen_is_format_supported(struct pipe_screen *pscreen, retval |= PIPE_BIND_INDEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - if (retval != usage) { DBG("not supported: format=%s, target=%d, sample_count=%d, " "usage=%x, retval=%x", util_format_name(format), diff --git a/src/gallium/drivers/ilo/ilo_resource.c b/src/gallium/drivers/ilo/ilo_resource.c index 7961288179d..5ca7e1b0a5a 100644 --- a/src/gallium/drivers/ilo/ilo_resource.c +++ b/src/gallium/drivers/ilo/ilo_resource.c @@ -204,7 +204,7 @@ resource_get_image_info(const struct pipe_resource *templ, * images when the image size is greater than one-fourth of the mappable * aperture. */ - if (templ->bind & (PIPE_BIND_TRANSFER_WRITE | PIPE_BIND_TRANSFER_READ)) + if (templ->usage == PIPE_USAGE_STAGING) info->prefer_linear_threshold = dev->aperture_mappable / 4; info->bind_surface_sampler = (templ->bind & PIPE_BIND_SAMPLER_VIEW); diff --git a/src/gallium/drivers/ilo/ilo_transfer.c b/src/gallium/drivers/ilo/ilo_transfer.c index 87607ebe80d..c0dab31440c 100644 --- a/src/gallium/drivers/ilo/ilo_transfer.c +++ b/src/gallium/drivers/ilo/ilo_transfer.c @@ -180,7 +180,6 @@ xfer_alloc_staging_res(struct ilo_transfer *xfer) templ.array_size = box->depth; templ.nr_samples = 1; templ.usage = PIPE_USAGE_STAGING; - templ.bind = PIPE_BIND_TRANSFER_WRITE; if (xfer->base.usage & PIPE_TRANSFER_FLUSH_EXPLICIT) { templ.flags = PIPE_RESOURCE_FLAG_MAP_PERSISTENT | @@ -1111,7 +1110,7 @@ buf_pwrite(struct ilo_context *ilo, struct pipe_resource *res, templ = *res; templ.width0 = size; templ.usage = PIPE_USAGE_STAGING; - templ.bind = PIPE_BIND_TRANSFER_WRITE; + templ.bind = 0; staging = ilo->base.screen->resource_create(ilo->base.screen, &templ); if (staging) { const struct ilo_vma *staging_vma = ilo_resource_get_vma(staging); diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c index ed74c3aa249..2ced8f11ef6 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c @@ -374,10 +374,8 @@ nv30_screen_is_format_supported(struct pipe_screen *pscreen, return false; } - /* transfers & shared are always supported */ - bindings &= ~(PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE | - PIPE_BIND_SHARED); + /* shared is always supported */ + bindings &= ~PIPE_BIND_SHARED; return (nv30_format_info(pscreen, format)->bindings & bindings) == bindings; } diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index 57c0c2bca8b..1ec791d5163 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -75,10 +75,8 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, sample_count > 1) return false; - /* transfers & shared are always supported */ - bindings &= ~(PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE | - PIPE_BIND_LINEAR | + /* shared is always supported */ + bindings &= ~(PIPE_BIND_LINEAR | PIPE_BIND_SHARED); return (( nv50_format_table[format].usage | diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index 0627f3df9e7..0103031da66 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -84,10 +84,8 @@ nvc0_screen_is_format_supported(struct pipe_screen *pscreen, nouveau_screen(pscreen)->class_3d != NVEA_3D_CLASS) return false; - /* transfers & shared are always supported */ - bindings &= ~(PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE | - PIPE_BIND_LINEAR | + /* shared is always supported */ + bindings &= ~(PIPE_BIND_LINEAR | PIPE_BIND_SHARED); if (bindings & PIPE_BIND_SHADER_IMAGE && sample_count > 1 && diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 509feaebb1d..f6949ce191b 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -664,12 +664,6 @@ static boolean r300_is_format_supported(struct pipe_screen* screen, } } - /* Transfers are always supported. */ - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - return retval == usage; } diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index ed385ee9dce..d137514326b 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -294,11 +294,6 @@ boolean evergreen_is_format_supported(struct pipe_screen *screen, retval |= PIPE_BIND_VERTEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - if ((usage & PIPE_BIND_LINEAR) && !util_format_is_compressed(format) && !(usage & PIPE_BIND_DEPTH_STENCIL)) diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c index c55c5322bfe..2b58d982a91 100644 --- a/src/gallium/drivers/r600/r600_state.c +++ b/src/gallium/drivers/r600/r600_state.c @@ -235,11 +235,6 @@ boolean r600_is_format_supported(struct pipe_screen *screen, retval |= PIPE_BIND_VERTEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - if ((usage & PIPE_BIND_LINEAR) && !util_format_is_compressed(format) && !(usage & PIPE_BIND_DEPTH_STENCIL)) diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c index a600793e3e6..2e8b6f44d56 100644 --- a/src/gallium/drivers/radeon/r600_buffer_common.c +++ b/src/gallium/drivers/radeon/r600_buffer_common.c @@ -386,7 +386,7 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx, struct r600_resource *staging; staging = (struct r600_resource*) pipe_buffer_create( - ctx->screen, PIPE_BIND_TRANSFER_READ, PIPE_USAGE_STAGING, + ctx->screen, 0, PIPE_USAGE_STAGING, box->width + (box->x % R600_MAP_BUFFER_ALIGNMENT)); if (staging) { /* Copy the VRAM buffer to the staging buffer. */ diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 280a9f88be5..0d3de9ab31a 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -1856,11 +1856,6 @@ static boolean si_is_format_supported(struct pipe_screen *screen, retval |= PIPE_BIND_VERTEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - if ((usage & PIPE_BIND_LINEAR) && !util_format_is_compressed(format) && !(usage & PIPE_BIND_DEPTH_STENCIL)) diff --git a/src/gallium/drivers/vc4/vc4_screen.c b/src/gallium/drivers/vc4/vc4_screen.c index 652d9b46742..3dc85d5e573 100644 --- a/src/gallium/drivers/vc4/vc4_screen.c +++ b/src/gallium/drivers/vc4/vc4_screen.c @@ -494,11 +494,6 @@ vc4_screen_is_format_supported(struct pipe_screen *pscreen, retval |= PIPE_BIND_INDEX_BUFFER; } - if (usage & PIPE_BIND_TRANSFER_READ) - retval |= PIPE_BIND_TRANSFER_READ; - if (usage & PIPE_BIND_TRANSFER_WRITE) - retval |= PIPE_BIND_TRANSFER_WRITE; - #if 0 if (retval != usage) { fprintf(stderr, diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 5361ed62714..88aa050ef7e 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -410,8 +410,7 @@ enum pipe_flush_flags #define PIPE_BIND_INDEX_BUFFER (1 << 5) /* draw_elements */ #define PIPE_BIND_CONSTANT_BUFFER (1 << 6) /* set_constant_buffer */ #define PIPE_BIND_DISPLAY_TARGET (1 << 7) /* flush_front_buffer */ -#define PIPE_BIND_TRANSFER_WRITE (1 << 8) /* transfer_map */ -#define PIPE_BIND_TRANSFER_READ (1 << 9) /* transfer_map */ +/* gap */ #define PIPE_BIND_STREAM_OUTPUT (1 << 10) /* set_stream_output_buffers */ #define PIPE_BIND_CURSOR (1 << 11) /* mouse cursor */ #define PIPE_BIND_CUSTOM (1 << 12) /* state-tracker/winsys usages */ diff --git a/src/gallium/state_trackers/clover/core/format.cpp b/src/gallium/state_trackers/clover/core/format.cpp index aee1cc9c79d..57012924098 100644 --- a/src/gallium/state_trackers/clover/core/format.cpp +++ b/src/gallium/state_trackers/clover/core/format.cpp @@ -147,9 +147,7 @@ namespace clover { std::set<cl_image_format> s; pipe_texture_target target = translate_target(type); unsigned bindings = (PIPE_BIND_SAMPLER_VIEW | - PIPE_BIND_COMPUTE_RESOURCE | - PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE); + PIPE_BIND_COMPUTE_RESOURCE); for (auto f : formats) { if (all_of([=](const device &dev) { diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp index 83781d39c01..06fd3f608fa 100644 --- a/src/gallium/state_trackers/clover/core/resource.cpp +++ b/src/gallium/state_trackers/clover/core/resource.cpp @@ -136,9 +136,7 @@ root_resource::root_resource(clover::device &dev, memory_obj &obj, info.target = translate_target(obj.type()); info.bind = (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_COMPUTE_RESOURCE | - PIPE_BIND_GLOBAL | - PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE); + PIPE_BIND_GLOBAL); if (obj.flags() & CL_MEM_USE_HOST_PTR && user_ptr_support) { // Page alignment is normally required for this, just try, hope for the diff --git a/src/gallium/state_trackers/nine/adapter9.c b/src/gallium/state_trackers/nine/adapter9.c index 41140d46f33..acf205dc58c 100644 --- a/src/gallium/state_trackers/nine/adapter9.c +++ b/src/gallium/state_trackers/nine/adapter9.c @@ -388,8 +388,7 @@ NineAdapter9_CheckDeviceMultiSampleType( struct NineAdapter9 *This, if (depth_stencil_format(SurfaceFormat)) bind = d3d9_get_pipe_depth_format_bindings(SurfaceFormat); else /* render-target */ - bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE | PIPE_BIND_RENDER_TARGET; + bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET; pf = d3d9_to_pipe_format_checked(screen, SurfaceFormat, PIPE_TEXTURE_2D, MultiSampleType, bind, FALSE, FALSE); diff --git a/src/gallium/state_trackers/nine/buffer9.c b/src/gallium/state_trackers/nine/buffer9.c index 387fc29878c..236a3ee66bd 100644 --- a/src/gallium/state_trackers/nine/buffer9.c +++ b/src/gallium/state_trackers/nine/buffer9.c @@ -67,7 +67,7 @@ NineBuffer9_ctor( struct NineBuffer9 *This, /* Note: WRITEONLY is just tip for resource placement, the resource * can still be read (but slower). */ - info->bind = PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_TRANSFER_WRITE | PIPE_BIND_TRANSFER_READ; + info->bind = PIPE_BIND_VERTEX_BUFFER; /* It is hard to find clear information on where to place the buffer in * memory depending on the flag. diff --git a/src/gallium/state_trackers/nine/cubetexture9.c b/src/gallium/state_trackers/nine/cubetexture9.c index 11000942d3a..dd1a43023dc 100644 --- a/src/gallium/state_trackers/nine/cubetexture9.c +++ b/src/gallium/state_trackers/nine/cubetexture9.c @@ -101,9 +101,6 @@ NineCubeTexture9_ctor( struct NineCubeTexture9 *This, if (Usage & D3DUSAGE_DYNAMIC) { info->usage = PIPE_USAGE_DYNAMIC; - info->bind |= - PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE; } if (Usage & D3DUSAGE_SOFTWAREPROCESSING) DBG("Application asked for Software Vertex Processing, " diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c index 3f6577c076b..230ad0290d7 100644 --- a/src/gallium/state_trackers/nine/device9.c +++ b/src/gallium/state_trackers/nine/device9.c @@ -254,7 +254,7 @@ NineDevice9_ctor( struct NineDevice9 *This, tmpl.last_level = 0; tmpl.nr_samples = 0; tmpl.usage = PIPE_USAGE_DEFAULT; - tmpl.bind = PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_TRANSFER_WRITE; + tmpl.bind = PIPE_BIND_VERTEX_BUFFER; tmpl.flags = 0; This->dummy_vbo = pScreen->resource_create(pScreen, &tmpl); diff --git a/src/gallium/state_trackers/nine/nine_pipe.h b/src/gallium/state_trackers/nine/nine_pipe.h index fe8e91013d8..93e32252478 100644 --- a/src/gallium/state_trackers/nine/nine_pipe.h +++ b/src/gallium/state_trackers/nine/nine_pipe.h @@ -239,8 +239,7 @@ d3d9_get_pipe_depth_format_bindings(D3DFORMAT format) case D3DFMT_D32F_LOCKABLE: case D3DFMT_D16_LOCKABLE: case D3DFMT_D32_LOCKABLE: - return PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE; + return PIPE_BIND_DEPTH_STENCIL; case D3DFMT_DF16: case D3DFMT_DF24: case D3DFMT_INTZ: diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c index bc1c4b108cb..79fba283fb9 100644 --- a/src/gallium/state_trackers/nine/swapchain9.c +++ b/src/gallium/state_trackers/nine/swapchain9.c @@ -301,8 +301,7 @@ NineSwapChain9_Resize( struct NineSwapChain9 *This, } for (i = 0; i < newBufferCount; ++i) { - tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE | PIPE_BIND_RENDER_TARGET; + tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET; tmplt.nr_samples = pParams->MultiSampleType; if (!has_present_buffers) tmplt.bind |= PIPE_BIND_SHARED | PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET; @@ -547,8 +546,7 @@ create_present_buffer( struct NineSwapChain9 *This, tmplt.usage = PIPE_USAGE_DEFAULT; tmplt.flags = 0; tmplt.format = PIPE_FORMAT_B8G8R8X8_UNORM; - tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE | PIPE_BIND_RENDER_TARGET | + tmplt.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET | PIPE_BIND_SHARED | PIPE_BIND_SCANOUT | PIPE_BIND_DISPLAY_TARGET; tmplt.nr_samples = 0; if (This->actx->linear_framebuffer) diff --git a/src/gallium/state_trackers/nine/texture9.c b/src/gallium/state_trackers/nine/texture9.c index 9bc8610b291..875620e065c 100644 --- a/src/gallium/state_trackers/nine/texture9.c +++ b/src/gallium/state_trackers/nine/texture9.c @@ -142,9 +142,6 @@ NineTexture9_ctor( struct NineTexture9 *This, if (Usage & D3DUSAGE_DYNAMIC) { info->usage = PIPE_USAGE_DYNAMIC; - info->bind |= - PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE; } if (Usage & D3DUSAGE_SOFTWAREPROCESSING) diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumetexture9.c index e70f3c12337..e5db6fc426d 100644 --- a/src/gallium/state_trackers/nine/volumetexture9.c +++ b/src/gallium/state_trackers/nine/volumetexture9.c @@ -94,9 +94,6 @@ NineVolumeTexture9_ctor( struct NineVolumeTexture9 *This, if (Usage & D3DUSAGE_DYNAMIC) { info->usage = PIPE_USAGE_DYNAMIC; - info->bind |= - PIPE_BIND_TRANSFER_READ | - PIPE_BIND_TRANSFER_WRITE; } if (Usage & D3DUSAGE_SOFTWAREPROCESSING) DBG("Application asked for Software Vertex Processing, " diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 3cfdf78f190..b79f1062a19 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -274,7 +274,6 @@ blit_to_staging(struct st_context *st, struct st_renderbuffer *strb, memset(&dst_templ, 0, sizeof(dst_templ)); dst_templ.target = PIPE_TEXTURE_2D; dst_templ.format = dst_format; - dst_templ.bind = PIPE_BIND_TRANSFER_READ; if (util_format_is_depth_or_stencil(dst_format)) dst_templ.bind |= PIPE_BIND_DEPTH_STENCIL; else @@ -404,7 +403,7 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y, struct pipe_resource *src; struct pipe_resource *dst = NULL; enum pipe_format dst_format, src_format; - unsigned bind = PIPE_BIND_TRANSFER_READ; + unsigned bind; struct pipe_transfer *tex_xfer; ubyte *map = NULL; int dst_x, dst_y; @@ -452,9 +451,9 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y, } if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL) - bind |= PIPE_BIND_DEPTH_STENCIL; + bind = PIPE_BIND_DEPTH_STENCIL; else - bind |= PIPE_BIND_RENDER_TARGET; + bind = PIPE_BIND_RENDER_TARGET; /* Choose the destination format by finding the best match * for the format+type combo. */ diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 62c2900aeb1..fa360b9fed4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1821,7 +1821,7 @@ st_GetTexSubImage(struct gl_context * ctx, GLenum gl_target = texImage->TexObject->Target; enum pipe_texture_target pipe_target; struct pipe_blit_info blit; - unsigned bind = PIPE_BIND_TRANSFER_READ; + unsigned bind; struct pipe_transfer *tex_xfer; ubyte *map = NULL; boolean done = FALSE; @@ -1885,9 +1885,9 @@ st_GetTexSubImage(struct gl_context * ctx, } if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL) - bind |= PIPE_BIND_DEPTH_STENCIL; + bind = PIPE_BIND_DEPTH_STENCIL; else - bind |= PIPE_BIND_RENDER_TARGET; + bind = PIPE_BIND_RENDER_TARGET; /* GetTexImage only returns a single face for cubemaps. */ if (gl_target == GL_TEXTURE_CUBE_MAP) { |