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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22725>
This commit is contained in:
Mike Blumenkrantz
2023-04-03 14:06:52 -04:00
committed by Marge Bot
parent db4017cf36
commit 1c3bd0f218
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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,
+1
View File
@@ -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));
+1
View File
@@ -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;