From: Mike Blumenkrantz Date: Mon, 3 Apr 2023 18:06:52 +0000 (-0400) Subject: zink: add zink_program::uses_shobj for managing shader object binds X-Git-Tag: upstream/23.3.3~9439 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c3bd0f218876427cb247f34f2c7f4653c5af620;p=platform%2Fupstream%2Fmesa.git zink: add zink_program::uses_shobj for managing shader object binds this is going to be more flexible than just checking for separable+EXT Part-of: --- diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp index f3b659d..59692fd 100644 --- a/src/gallium/drivers/zink/zink_draw.cpp +++ b/src/gallium/drivers/zink/zink_draw.cpp @@ -278,7 +278,7 @@ update_gfx_pipeline(struct zink_context *ctx, struct zink_batch_state *bs, enum else zink_gfx_program_update(ctx); bool pipeline_changed = false; - if (ctx->curr_program->is_separable && screen->info.have_EXT_shader_object) { + if (ctx->curr_program->base.uses_shobj) { if (BATCH_CHANGED || shaders_changed || !ctx->shobj_draw) { VkShaderStageFlagBits stages[] = { VK_SHADER_STAGE_VERTEX_BIT, diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 8220a40..fa2b949 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -1157,6 +1157,7 @@ create_gfx_program_separable(struct zink_context *ctx, struct zink_shader **stag prog->ctx = ctx; prog->is_separable = true; prog->gfx_hash = ctx->gfx_hash; + prog->base.uses_shobj = screen->info.have_EXT_shader_object; prog->stages_remaining = prog->stages_present = ctx->shader_stages; memcpy(prog->shaders, stages, sizeof(prog->shaders)); diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 54cbb47..d57968b 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -955,6 +955,7 @@ struct zink_program { struct zink_batch_usage *batch_uses; bool is_compute; bool can_precompile; + bool uses_shobj; //whether shader objects are used; programs CANNOT mix shader objects and shader modules struct zink_program_descriptor_data dd;