mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 03:48:06 +02:00
radv/winsys: add a new flag that requests zerovram allocations
This introduces RADON_FLAG_ZERO_VRAM. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3888>
This commit is contained in:
parent
7a73446c51
commit
37650bf938
2 changed files with 6 additions and 2 deletions
|
|
@ -61,6 +61,7 @@ enum radeon_bo_flag { /* bitfield */
|
|||
RADEON_FLAG_READ_ONLY = (1 << 7),
|
||||
RADEON_FLAG_32BIT = (1 << 8),
|
||||
RADEON_FLAG_PREFER_LOCAL_BO = (1 << 9),
|
||||
RADEON_FLAG_ZERO_VRAM = (1 << 10),
|
||||
};
|
||||
|
||||
enum radeon_bo_usage { /* bitfield */
|
||||
|
|
|
|||
|
|
@ -382,8 +382,11 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
|
|||
}
|
||||
|
||||
/* this won't do anything on pre 4.9 kernels */
|
||||
if (ws->zero_all_vram_allocs && (initial_domain & RADEON_DOMAIN_VRAM))
|
||||
request.flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
|
||||
if (initial_domain & RADEON_DOMAIN_VRAM) {
|
||||
if (ws->zero_all_vram_allocs || (flags & RADEON_FLAG_ZERO_VRAM))
|
||||
request.flags |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
|
||||
}
|
||||
|
||||
r = amdgpu_bo_alloc(ws->dev, &request, &buf_handle);
|
||||
if (r) {
|
||||
fprintf(stderr, "amdgpu: Failed to allocate a buffer:\n");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue