if (!res->sampler_bind_count[stage == MESA_SHADER_COMPUTE])
check_for_layout_update(ctx, res, stage == MESA_SHADER_COMPUTE);
}
+ if (stage == MESA_SHADER_FRAGMENT) {
+ assert(slot < 32);
+ ctx->di.shadow.mask &= ~BITFIELD_BIT(slot);
+ }
}
static void
unsigned i;
const uint32_t mask = BITFIELD_RANGE(start_slot, num_views);
+ uint32_t shadow_mask = ctx->di.shadow.mask;
ctx->di.cubes[shader_type] &= ~mask;
bool update = false;
shadow_update |= memcmp(&ctx->di.shadow.swizzle[start_slot + i],
&b->swizzle, sizeof(struct zink_fs_shadow_swizzle));
memcpy(&ctx->di.shadow.swizzle[start_slot + i], &b->swizzle, sizeof(struct zink_fs_shadow_swizzle));
- } else if (ctx->di.shadow.mask) {
+ } else if (shader_type == MESA_SHADER_FRAGMENT) {
assert(start_slot + i < 32); //bitfield size
ctx->di.shadow.mask &= ~BITFIELD_BIT(start_slot + i);
}
} else if (a) {
unbind_samplerview(ctx, shader_type, start_slot + i);
update = true;
- if (ctx->di.shadow.mask) {
- assert(start_slot + i < 32); //bitfield size
- ctx->di.shadow.mask &= ~BITFIELD_BIT(start_slot + i);
- }
}
if (take_ownership) {
pipe_sampler_view_reference(&ctx->sampler_views[shader_type][start_slot + i], NULL);
&ctx->sampler_views[shader_type][start_slot + i],
NULL);
update_descriptor_state_sampler(ctx, shader_type, start_slot + i, NULL);
- if (ctx->di.shadow.mask) {
- assert(start_slot + i < 32); //bitfield size
- ctx->di.shadow.mask &= ~BITFIELD_BIT(start_slot + i);
- }
}
ctx->di.num_sampler_views[shader_type] = start_slot + num_views;
if (update) {
zink_context_invalidate_descriptor_state(ctx, shader_type, ZINK_DESCRIPTOR_TYPE_SAMPLER_VIEW, start_slot, num_views);
if (!screen->info.have_EXT_non_seamless_cube_map)
update_nonseamless_shader_key(ctx, shader_type);
+ shadow_update |= shadow_mask != ctx->di.shadow.mask;
zink_set_fs_shadow_needs_shader_swizzle_key(ctx, shadow_update);
}
}