mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 09:20:13 +01:00
gallium: remove PIPE_BIND_TRANSFER_READ/WRITE
not used in any useful way Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
parent
0fbaf74977
commit
5981ab5445
29 changed files with 24 additions and 95 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 |
|
||||
|
|
|
|||
|
|
@ -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 &&
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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, "
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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, "
|
||||
|
|
|
|||
|
|
@ -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. */
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue