mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-23 16:10:33 +01:00
tu: C++-proofing: ease access to global bo struct
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21931>
This commit is contained in:
parent
40b7e5c48a
commit
aec1e9ecf7
8 changed files with 18 additions and 17 deletions
|
|
@ -92,8 +92,7 @@ fence_before(uint32_t a, uint32_t b)
|
|||
static uint32_t
|
||||
get_autotune_fence(struct tu_autotune *at)
|
||||
{
|
||||
const struct tu6_global *global = at->device->global_bo->map;
|
||||
return global->autotune_fence;
|
||||
return at->device->global_bo_map->autotune_fence;
|
||||
}
|
||||
|
||||
static struct tu_submission_data *
|
||||
|
|
|
|||
|
|
@ -720,19 +720,20 @@ compile_shader(struct tu_device *dev, struct nir_shader *nir,
|
|||
|
||||
ir3_finalize_nir(dev->compiler, nir);
|
||||
|
||||
const struct ir3_shader_options options = {
|
||||
.reserved_user_consts = align(consts, 4),
|
||||
.api_wavesize = IR3_SINGLE_OR_DOUBLE,
|
||||
.real_wavesize = IR3_SINGLE_OR_DOUBLE,
|
||||
};
|
||||
struct ir3_shader *sh =
|
||||
ir3_shader_from_nir(dev->compiler, nir, &(struct ir3_shader_options) {
|
||||
.reserved_user_consts = align(consts, 4),
|
||||
.api_wavesize = IR3_SINGLE_OR_DOUBLE,
|
||||
.real_wavesize = IR3_SINGLE_OR_DOUBLE,
|
||||
}, NULL);
|
||||
ir3_shader_from_nir(dev->compiler, nir, &options, NULL);
|
||||
|
||||
struct ir3_shader_key key = {};
|
||||
bool created;
|
||||
struct ir3_shader_variant *so =
|
||||
ir3_shader_get_variant(sh, &key, false, false, &created);
|
||||
|
||||
struct tu6_global *global = dev->global_bo->map;
|
||||
struct tu6_global *global = dev->global_bo_map;
|
||||
|
||||
assert(*offset + so->info.sizedwords <= ARRAY_SIZE(global->shaders));
|
||||
dev->global_shaders[idx] = sh;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ tu6_lazy_emit_vsc(struct tu_cmd_buffer *cmd, struct tu_cs *cs)
|
|||
*/
|
||||
mtx_lock(&dev->mutex);
|
||||
|
||||
struct tu6_global *global = dev->global_bo->map;
|
||||
struct tu6_global *global = dev->global_bo_map;
|
||||
|
||||
uint32_t vsc_draw_overflow = global->vsc_draw_overflow;
|
||||
uint32_t vsc_prim_overflow = global->vsc_prim_overflow;
|
||||
|
|
|
|||
|
|
@ -43,8 +43,7 @@ static void *
|
|||
sync_gpu_with_cpu(void *_job)
|
||||
{
|
||||
struct breadcrumbs_context *ctx = (struct breadcrumbs_context *) _job;
|
||||
struct tu6_global *global =
|
||||
(struct tu6_global *) ctx->device->global_bo->map;
|
||||
struct tu6_global *global = ctx->device->global_bo_map;
|
||||
uint32_t last_breadcrumb = 0;
|
||||
uint32_t breakpoint_hits = 0;
|
||||
|
||||
|
|
@ -135,7 +134,7 @@ tu_breadcrumbs_init(struct tu_device *device)
|
|||
|
||||
device->breadcrumbs_ctx = ctx;
|
||||
|
||||
struct tu6_global *global = device->global_bo->map;
|
||||
struct tu6_global *global = device->global_bo_map;
|
||||
global->breadcrumb_cpu_sync_seqno = 0;
|
||||
global->breadcrumb_gpu_sync_seqno = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -2246,7 +2246,9 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice,
|
|||
}
|
||||
|
||||
global = (struct tu6_global *)device->global_bo->map;
|
||||
device->global_bo_map = global;
|
||||
tu_init_clear_blit_shaders(device);
|
||||
|
||||
global->predicate = 0;
|
||||
global->vtx_stats_query_not_running = 1;
|
||||
global->dbg_one = (uint32_t)-1;
|
||||
|
|
@ -3102,9 +3104,8 @@ tu_init_sampler(struct tu_device *device,
|
|||
}
|
||||
|
||||
tu6_pack_border_color(
|
||||
device->global_bo->map +
|
||||
offsetof_arr(struct tu6_global, bcolor, border_color),
|
||||
&color, pCreateInfo->borderColor == VK_BORDER_COLOR_INT_CUSTOM_EXT);
|
||||
&device->global_bo_map->bcolor[border_color], &color,
|
||||
pCreateInfo->borderColor == VK_BORDER_COLOR_INT_CUSTOM_EXT);
|
||||
border_color += TU_BORDER_COLOR_BUILTIN;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,6 +247,7 @@ struct tu_device
|
|||
} fiber_pvtmem_bo, wave_pvtmem_bo;
|
||||
|
||||
struct tu_bo *global_bo;
|
||||
struct tu6_global *global_bo_map;
|
||||
|
||||
uint32_t implicit_sync_bo_count;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct dynamic_rendering_entry {
|
|||
static VkResult
|
||||
get_cmd_buffer(struct tu_device *dev, struct tu_cmd_buffer **cmd_buffer_out)
|
||||
{
|
||||
struct tu6_global *global = dev->global_bo->map;
|
||||
struct tu6_global *global = dev->global_bo_map;
|
||||
|
||||
/* Note: because QueueSubmit is serialized, we don't need any locks here.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ tu_dbg_log_gmem_load_store_skips(struct tu_device *device)
|
|||
return;
|
||||
}
|
||||
|
||||
struct tu6_global *global = device->global_bo->map;
|
||||
struct tu6_global *global = device->global_bo_map;
|
||||
|
||||
uint32_t current_taken_loads = global->dbg_gmem_taken_loads;
|
||||
uint32_t current_taken_stores = global->dbg_gmem_taken_stores;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue