Lines Matching refs:prsc
58 rebind_resource(struct fd_context *ctx, struct pipe_resource *prsc) in rebind_resource() argument
62 if (ctx->vtx.vertexbuf.vb[i].buffer.resource == prsc) in rebind_resource()
75 if (ctx->constbuf[stage].cb[i].buffer == prsc) in rebind_resource()
83 if (ctx->tex[stage].textures[i] && (ctx->tex[stage].textures[i]->texture == prsc)) in rebind_resource()
92 if (ctx->shaderbuf[stage].sb[i].buffer == prsc) in rebind_resource()
140 struct pipe_resource *prsc = &rsc->base; in fd_try_shadow_resource() local
143 if (prsc->next) in fd_try_shadow_resource()
150 prsc->format, prsc->target, prsc->nr_samples, in fd_try_shadow_resource()
155 if (prsc->target == PIPE_BUFFER) in fd_try_shadow_resource()
158 bool whole_level = util_texrange_covers_whole_level(prsc, level, in fd_try_shadow_resource()
162 if ((prsc->target >= PIPE_TEXTURE_2D) && !whole_level) in fd_try_shadow_resource()
166 pctx->screen->resource_create(pctx->screen, prsc); in fd_try_shadow_resource()
214 blit.dst.resource = prsc; in fd_try_shadow_resource()
215 blit.dst.format = prsc->format; in fd_try_shadow_resource()
218 blit.mask = util_format_get_mask(prsc->format); in fd_try_shadow_resource()
227 for (unsigned l = 0; l <= prsc->last_level; l++) { in fd_try_shadow_resource()
233 set_box(box.width, u_minify(prsc->width0, l)); in fd_try_shadow_resource()
234 set_box(box.height, u_minify(prsc->height0, l)); in fd_try_shadow_resource()
235 set_box(box.depth, u_minify(prsc->depth0, l)); in fd_try_shadow_resource()
246 switch (prsc->target) { in fd_try_shadow_resource()
260 if ((box->x + box->width) < u_minify(prsc->width0, level)) { in fd_try_shadow_resource()
262 set_box(box.width, u_minify(prsc->width0, level) - (box->x + box->width)); in fd_try_shadow_resource()
406 fd_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc) in fd_flush_resource() argument
408 flush_resource(fd_context(pctx), fd_resource(prsc), PIPE_TRANSFER_READ); in fd_flush_resource()
439 struct pipe_resource *prsc, in fd_resource_transfer_map() argument
445 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_transfer_map()
449 enum pipe_format format = prsc->format; in fd_resource_transfer_map()
455 DBG("prsc=%p, level=%u, usage=%x, box=%dx%d+%d,%d", prsc, level, usage, in fd_resource_transfer_map()
466 pipe_resource_reference(&ptrans->resource, prsc); in fd_resource_transfer_map()
522 rebind_resource(ctx, prsc); in fd_resource_transfer_map()
524 prsc->target == PIPE_BUFFER && in fd_resource_transfer_map()
563 rebind_resource(ctx, prsc); in fd_resource_transfer_map()
641 struct pipe_resource *prsc) in fd_resource_destroy() argument
643 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_destroy()
654 struct pipe_resource *prsc, in fd_resource_get_handle() argument
658 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_get_handle()
667 struct pipe_resource *prsc = &rsc->base; in setup_slices() local
668 struct fd_screen *screen = fd_screen(prsc->screen); in setup_slices()
672 uint32_t width = prsc->width0; in setup_slices()
673 uint32_t height = prsc->height0; in setup_slices()
674 uint32_t depth = prsc->depth0; in setup_slices()
678 uint32_t layers_in_level = rsc->layer_first ? 1 : prsc->array_size; in setup_slices()
680 for (level = 0; level <= prsc->last_level; level++) { in setup_slices()
697 if (prsc->target == PIPE_TEXTURE_3D && ( in setup_slices()
764 fd_resource_resize(struct pipe_resource *prsc, uint32_t sz) in fd_resource_resize() argument
766 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_resize()
768 debug_assert(prsc->width0 == 0); in fd_resource_resize()
769 debug_assert(prsc->target == PIPE_BUFFER); in fd_resource_resize()
770 debug_assert(prsc->bind == PIPE_BIND_QUERY_BUFFER); in fd_resource_resize()
772 prsc->width0 = sz; in fd_resource_resize()
773 realloc_bo(rsc, fd_screen(prsc->screen)->setup_slices(rsc)); in fd_resource_resize()
804 struct pipe_resource *prsc = &rsc->base; in fd_resource_create() local
809 "nr_samples=%u, usage=%u, bind=%x, flags=%x", prsc, in fd_resource_create()
818 *prsc = *tmpl; in fd_resource_create()
832 pipe_reference_init(&prsc->reference, 1); in fd_resource_create()
834 prsc->screen = pscreen; in fd_resource_create()
866 debug_assert(prsc->bind == PIPE_BIND_QUERY_BUFFER); in fd_resource_create()
867 return prsc; in fd_resource_create()
872 size = rsc->layer_size * prsc->array_size; in fd_resource_create()
879 return prsc; in fd_resource_create()
881 fd_resource_destroy(pscreen, prsc); in fd_resource_create()
897 struct pipe_resource *prsc = &rsc->base; in fd_resource_from_handle() local
910 *prsc = *tmpl; in fd_resource_from_handle()
912 pipe_reference_init(&prsc->reference, 1); in fd_resource_from_handle()
914 prsc->screen = pscreen; in fd_resource_from_handle()
926 slice->size0 = handle->stride * prsc->height0; in fd_resource_from_handle()
928 if ((slice->pitch < align(prsc->width0, pitchalign)) || in fd_resource_from_handle()
934 return prsc; in fd_resource_from_handle()
937 fd_resource_destroy(pscreen, prsc); in fd_resource_from_handle()
1118 fd_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc) in fd_invalidate_resource() argument
1120 struct fd_resource *rsc = fd_resource(prsc); in fd_invalidate_resource()
1132 if (pfb->zsbuf && pfb->zsbuf->texture == prsc) in fd_invalidate_resource()
1136 if (pfb->cbufs[i] && pfb->cbufs[i]->texture == prsc) { in fd_invalidate_resource()
1146 fd_resource_get_internal_format(struct pipe_resource *prsc) in fd_resource_get_internal_format() argument
1148 return fd_resource(prsc)->internal_format; in fd_resource_get_internal_format()
1152 fd_resource_set_stencil(struct pipe_resource *prsc, in fd_resource_set_stencil() argument
1155 fd_resource(prsc)->stencil = fd_resource(stencil); in fd_resource_set_stencil()
1159 fd_resource_get_stencil(struct pipe_resource *prsc) in fd_resource_get_stencil() argument
1161 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_get_stencil()