ctx->dirty_shader[stage] |= FD_DIRTY_SHADER_TEX;
}
+ /* Images */
+ const unsigned num_images = util_last_bit(ctx->shaderimg[stage].enabled_mask);
+ for (unsigned i = 0; i < num_images; i++) {
+ if (ctx->dirty_shader[stage] & FD_DIRTY_SHADER_IMAGE)
+ break;
+ if (ctx->shaderimg[stage].si[i].resource == prsc)
+ ctx->dirty_shader[stage] |= FD_DIRTY_SHADER_IMAGE;
+ }
+
/* SSBOs */
const unsigned num_ssbos = util_last_bit(ctx->shaderbuf[stage].enabled_mask);
for (unsigned i = 0; i < num_ssbos; i++) {
}
}
+/**
+ * @rsc: the resource to shadow
+ * @level: the level to discard (if box != NULL, otherwise ignored)
+ * @box: the box to discard (or NULL if none)
+ * @modifier: the modifier for the new buffer state
+ */
static bool
fd_try_shadow_resource(struct fd_context *ctx, struct fd_resource *rsc,
unsigned level, const struct pipe_box *box, uint64_t modifier)
if (prsc->target == PIPE_BUFFER)
fallback = true;
- bool whole_level = util_texrange_covers_whole_level(prsc, level,
+ bool discard_whole_level = box && util_texrange_covers_whole_level(prsc, level,
box->x, box->y, box->z, box->width, box->height, box->depth);
/* TODO need to be more clever about current level */
- if ((prsc->target >= PIPE_TEXTURE_2D) && !whole_level)
+ if ((prsc->target >= PIPE_TEXTURE_2D) && box && !discard_whole_level)
return false;
struct pipe_resource *pshadow =
/* TODO valid_buffer_range?? */
swap(rsc->bo, shadow->bo);
swap(rsc->write_batch, shadow->write_batch);
+ swap(rsc->offset, shadow->offset);
+ swap(rsc->ubwc_offset, shadow->ubwc_offset);
+ swap(rsc->ubwc_pitch, shadow->ubwc_pitch);
+ swap(rsc->ubwc_size, shadow->ubwc_size);
rsc->seqno = p_atomic_inc_return(&ctx->screen->rsc_seqno);
/* at this point, the newly created shadow buffer is not referenced
/* blit the other levels in their entirety: */
for (unsigned l = 0; l <= prsc->last_level; l++) {
- if (l == level)
+ if (box && l == level)
continue;
/* just blit whole level: */
/* deal w/ current level specially, since we might need to split
* it up into a couple blits:
*/
- if (!whole_level) {
+ if (box && !discard_whole_level) {
set_box(level, level);
switch (prsc->target) {