Lines Matching refs:prsc
72 struct pipe_resource *prsc = &rsc->base; in rebind_resource_in_ctx() local
81 if (vb->vb[i].buffer.resource == prsc) in rebind_resource_in_ctx()
102 if (cb->cb[i].buffer == prsc) { in rebind_resource_in_ctx()
115 if (tex->textures[i] && (tex->textures[i]->texture == prsc)) { in rebind_resource_in_ctx()
129 if (si->si[i].resource == prsc) { in rebind_resource_in_ctx()
143 if (sb->sb[i].buffer == prsc) { in rebind_resource_in_ctx()
181 struct pipe_resource *prsc = &rsc->base; in realloc_bo() local
185 COND(prsc->bind & PIPE_BIND_SCANOUT, DRM_FREEDRENO_GEM_SCANOUT); in realloc_bo()
196 prsc->width0, prsc->height0, prsc->depth0, rsc->layout.cpp, prsc->bind); in realloc_bo()
243 struct pipe_resource *prsc = &rsc->base; in fd_try_shadow_resource() local
246 if (prsc->next) in fd_try_shadow_resource()
268 prsc->format, prsc->target, prsc->nr_samples, in fd_try_shadow_resource()
269 prsc->nr_storage_samples, in fd_try_shadow_resource()
274 if (prsc->target == PIPE_BUFFER) in fd_try_shadow_resource()
277 bool discard_whole_level = box && util_texrange_covers_whole_level(prsc, level, in fd_try_shadow_resource()
281 if ((prsc->target >= PIPE_TEXTURE_2D) && box && !discard_whole_level) in fd_try_shadow_resource()
286 prsc, &modifier, 1); in fd_try_shadow_resource()
337 blit.dst.resource = prsc; in fd_try_shadow_resource()
338 blit.dst.format = prsc->format; in fd_try_shadow_resource()
341 blit.mask = util_format_get_mask(prsc->format); in fd_try_shadow_resource()
350 for (unsigned l = 0; l <= prsc->last_level; l++) { in fd_try_shadow_resource()
356 set_box(box.width, u_minify(prsc->width0, l)); in fd_try_shadow_resource()
357 set_box(box.height, u_minify(prsc->height0, l)); in fd_try_shadow_resource()
358 set_box(box.depth, u_minify(prsc->depth0, l)); in fd_try_shadow_resource()
360 for (int i = 0; i < prsc->array_size; i++) { in fd_try_shadow_resource()
372 switch (prsc->target) { in fd_try_shadow_resource()
386 if ((box->x + box->width) < u_minify(prsc->width0, level)) { in fd_try_shadow_resource()
388 set_box(box.width, u_minify(prsc->width0, level) - (box->x + box->width)); in fd_try_shadow_resource()
559 fd_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc) in fd_flush_resource() argument
561 flush_resource(fd_context(pctx), fd_resource(prsc), PIPE_MAP_READ); in fd_flush_resource()
592 struct pipe_resource *prsc, in fd_resource_transfer_map() argument
598 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_transfer_map()
601 enum pipe_format format = prsc->format; in fd_resource_transfer_map()
607 DBG("prsc=%p, level=%u, usage=%x, box=%dx%d+%d,%d", prsc, level, usage, in fd_resource_transfer_map()
623 pipe_resource_reference(&ptrans->resource, prsc); in fd_resource_transfer_map()
685 prsc->target == PIPE_BUFFER && in fd_resource_transfer_map()
801 struct pipe_resource *prsc) in fd_resource_destroy() argument
803 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_destroy()
833 struct pipe_resource *prsc, in fd_resource_get_handle() argument
837 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_get_handle()
843 prsc, prsc->target, util_format_name(prsc->format), in fd_resource_get_handle()
844 prsc->width0, prsc->height0, prsc->depth0, in fd_resource_get_handle()
845 prsc->array_size, prsc->last_level, prsc->nr_samples, in fd_resource_get_handle()
846 prsc->usage, prsc->bind, prsc->flags, in fd_resource_get_handle()
855 fd_resource_resize(struct pipe_resource *prsc, uint32_t sz) in fd_resource_resize() argument
857 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_resize()
859 debug_assert(prsc->width0 == 0); in fd_resource_resize()
860 debug_assert(prsc->target == PIPE_BUFFER); in fd_resource_resize()
861 debug_assert(prsc->bind == PIPE_BIND_QUERY_BUFFER); in fd_resource_resize()
863 prsc->width0 = sz; in fd_resource_resize()
864 realloc_bo(rsc, fd_screen(prsc->screen)->setup_slices(rsc)); in fd_resource_resize()
868 fd_resource_layout_init(struct pipe_resource *prsc) in fd_resource_layout_init() argument
870 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_layout_init()
873 layout->format = prsc->format; in fd_resource_layout_init()
875 layout->width0 = prsc->width0; in fd_resource_layout_init()
876 layout->height0 = prsc->height0; in fd_resource_layout_init()
877 layout->depth0 = prsc->depth0; in fd_resource_layout_init()
879 layout->cpp = util_format_get_blocksize(prsc->format); in fd_resource_layout_init()
880 layout->cpp *= fd_resource_nr_samples(prsc); in fd_resource_layout_init()
898 struct pipe_resource *prsc; in fd_resource_allocate_and_resolve() local
903 prsc = &rsc->base; in fd_resource_allocate_and_resolve()
906 "nr_samples=%u, usage=%u, bind=%x, flags=%x", prsc, in fd_resource_allocate_and_resolve()
915 *prsc = *tmpl; in fd_resource_allocate_and_resolve()
916 fd_resource_layout_init(prsc); in fd_resource_allocate_and_resolve()
948 pipe_reference_init(&prsc->reference, 1); in fd_resource_allocate_and_resolve()
950 prsc->screen = pscreen; in fd_resource_allocate_and_resolve()
955 rsc->layout.tile_mode = screen->tile_mode(prsc); in fd_resource_allocate_and_resolve()
966 if (prsc->target == PIPE_BUFFER) { in fd_resource_allocate_and_resolve()
967 assert(prsc->format == PIPE_FORMAT_R8_UNORM); in fd_resource_allocate_and_resolve()
968 size = prsc->width0; in fd_resource_allocate_and_resolve()
979 debug_assert(prsc->bind == PIPE_BIND_QUERY_BUFFER); in fd_resource_allocate_and_resolve()
981 return prsc; in fd_resource_allocate_and_resolve()
987 size = rsc->layout.layer_size * prsc->array_size; in fd_resource_allocate_and_resolve()
997 return prsc; in fd_resource_allocate_and_resolve()
1010 struct pipe_resource *prsc; in fd_resource_create_with_modifiers() local
1045 prsc = fd_resource_allocate_and_resolve(pscreen, tmpl, modifiers, count, &size); in fd_resource_create_with_modifiers()
1046 if (!prsc) in fd_resource_create_with_modifiers()
1048 rsc = fd_resource(prsc); in fd_resource_create_with_modifiers()
1054 return prsc; in fd_resource_create_with_modifiers()
1056 fd_resource_destroy(pscreen, prsc); in fd_resource_create_with_modifiers()
1085 struct pipe_resource *prsc = &rsc->base; in fd_resource_from_handle() local
1089 prsc, tmpl->target, util_format_name(tmpl->format), in fd_resource_from_handle()
1095 *prsc = *tmpl; in fd_resource_from_handle()
1096 fd_resource_layout_init(prsc); in fd_resource_from_handle()
1098 pipe_reference_init(&prsc->reference, 1); in fd_resource_from_handle()
1100 prsc->screen = pscreen; in fd_resource_from_handle()
1115 slice->size0 = handle->stride * prsc->height0; in fd_resource_from_handle()
1132 if (rsc->layout.pitch0 < (prsc->width0 * rsc->layout.cpp) || in fd_resource_from_handle()
1143 renderonly_create_gpu_import_for_resource(prsc, screen->ro, NULL); in fd_resource_from_handle()
1149 return prsc; in fd_resource_from_handle()
1152 fd_resource_destroy(pscreen, prsc); in fd_resource_from_handle()
1176 fd_invalidate_resource(struct pipe_context *pctx, struct pipe_resource *prsc) in fd_invalidate_resource() argument
1179 struct fd_resource *rsc = fd_resource(prsc); in fd_invalidate_resource()
1193 if (pfb->zsbuf && pfb->zsbuf->texture == prsc) { in fd_invalidate_resource()
1199 if (pfb->cbufs[i] && pfb->cbufs[i]->texture == prsc) { in fd_invalidate_resource()
1210 fd_resource_get_internal_format(struct pipe_resource *prsc) in fd_resource_get_internal_format() argument
1212 return fd_resource(prsc)->internal_format; in fd_resource_get_internal_format()
1216 fd_resource_set_stencil(struct pipe_resource *prsc, in fd_resource_set_stencil() argument
1219 fd_resource(prsc)->stencil = fd_resource(stencil); in fd_resource_set_stencil()
1223 fd_resource_get_stencil(struct pipe_resource *prsc) in fd_resource_get_stencil() argument
1225 struct fd_resource *rsc = fd_resource(prsc); in fd_resource_get_stencil()
1271 struct pipe_resource *prsc; in fd_resource_from_memobj() local
1287 prsc = fd_resource_allocate_and_resolve(pscreen, tmpl, &modifiers, 1, &size); in fd_resource_from_memobj()
1288 if (!prsc) in fd_resource_from_memobj()
1290 rsc = fd_resource(prsc); in fd_resource_from_memobj()
1296 fd_resource_destroy(pscreen, prsc); in fd_resource_from_memobj()
1303 return prsc; in fd_resource_from_memobj()