mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
zink: split total_mem off to total_video_mem, use total_mem for tc
tc needs the total host memory available, not the total video memory Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10006>
This commit is contained in:
parent
c624489968
commit
e4426d7828
3 changed files with 6 additions and 3 deletions
|
|
@ -1984,10 +1984,10 @@ zink_maybe_flush_or_stall(struct zink_context *ctx)
|
|||
{
|
||||
struct zink_screen *screen = zink_screen(ctx->base.screen);
|
||||
/* flush anytime our total batch memory usage is potentially >= 1/10 of total system memory */
|
||||
if (ctx->batch.state->resource_size >= screen->total_mem / 10)
|
||||
if (ctx->batch.state->resource_size >= screen->total_video_mem / 10)
|
||||
flush_batch(ctx, true);
|
||||
|
||||
if (ctx->resource_size >= screen->total_mem / 10 || _mesa_hash_table_num_entries(&ctx->batch_states) > 10) {
|
||||
if (ctx->resource_size >= screen->total_video_mem / 10 || _mesa_hash_table_num_entries(&ctx->batch_states) > 10) {
|
||||
sync_flush(ctx, zink_batch_state(ctx->last_fence));
|
||||
zink_vkfence_wait(screen, ctx->last_fence, PIPE_TIMEOUT_INFINITE);
|
||||
zink_batch_reset_all(ctx);
|
||||
|
|
|
|||
|
|
@ -1494,7 +1494,9 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
|
|||
screen->driconf.dual_color_blend_by_location = driQueryOptionb(config->options, "dual_color_blend_by_location");
|
||||
#endif
|
||||
|
||||
screen->total_mem = get_video_mem(screen);
|
||||
screen->total_video_mem = get_video_mem(screen);
|
||||
if (!os_get_total_physical_memory(&screen->total_mem))
|
||||
goto fail;
|
||||
|
||||
simple_mtx_init(&screen->surface_mtx, mtx_plain);
|
||||
simple_mtx_init(&screen->bufferview_mtx, mtx_plain);
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ struct zink_screen {
|
|||
|
||||
unsigned shader_id;
|
||||
|
||||
uint64_t total_video_mem;
|
||||
uint64_t total_mem;
|
||||
|
||||
VkInstance instance;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue