mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 17:48:10 +02:00
winsys/sw/android: set bo usage correctly
Since this is the software path, set GRALLOC_USAGE_SW_WRITE_OFTEN when PIPE_BIND_RENDER_TARGET, and set GRALLOC_USAGE_SW_READ_OFTEN when PIPE_BIND_SAMPLER_VIEW.
This commit is contained in:
parent
327de226ae
commit
f496d8b86d
1 changed files with 3 additions and 10 deletions
|
|
@ -158,17 +158,10 @@ android_displaytarget_from_handle(struct sw_winsys *ws,
|
|||
adt->width = templ->width0;
|
||||
adt->height = templ->height0;
|
||||
|
||||
if (templ->usage & PIPE_BIND_RENDER_TARGET)
|
||||
adt->usage |= GRALLOC_USAGE_HW_RENDER;
|
||||
if (templ->usage & PIPE_BIND_SAMPLER_VIEW)
|
||||
adt->usage |= GRALLOC_USAGE_HW_TEXTURE;
|
||||
if (templ->usage & PIPE_BIND_SCANOUT)
|
||||
adt->usage |= GRALLOC_USAGE_HW_FB;
|
||||
|
||||
if (templ->usage & PIPE_BIND_TRANSFER_READ)
|
||||
adt->usage |= GRALLOC_USAGE_SW_READ_OFTEN;
|
||||
if (templ->usage & PIPE_BIND_TRANSFER_WRITE)
|
||||
if (templ->bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_TRANSFER_WRITE))
|
||||
adt->usage |= GRALLOC_USAGE_SW_WRITE_OFTEN;
|
||||
if (templ->bind & (PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_TRANSFER_READ))
|
||||
adt->usage |= GRALLOC_USAGE_SW_READ_OFTEN;
|
||||
|
||||
if (stride)
|
||||
*stride = adt->stride;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue