Lines Matching defs:res
37 struct zink_resource *res,
45 ivci.image = res->obj->image;
49 ivci.viewType = res->need_2D ? VK_IMAGE_VIEW_TYPE_2D : VK_IMAGE_VIEW_TYPE_1D;
53 ivci.viewType = res->need_2D ? VK_IMAGE_VIEW_TYPE_2D_ARRAY : VK_IMAGE_VIEW_TYPE_1D_ARRAY;
97 ivci.subresourceRange.aspectMask = res->aspect;
104 ivci.viewType = zink_surface_clamp_viewtype(ivci.viewType, templ->u.tex.first_layer, templ->u.tex.last_layer, res->base.b.array_size);
110 init_surface_info(struct zink_surface *surface, struct zink_resource *res, VkImageViewCreateInfo *ivci)
113 surface->info.flags = res->obj->vkflags;
114 surface->info.usage = usage_info ? usage_info->usage : res->obj->vkusage;
119 if (res->obj->dt) {
120 struct kopper_displaytarget *cdt = res->obj->dt;
135 struct zink_resource *res = zink_resource(pres);
145 VkFormatFeatureFlags feats = res->optimal_tiling ?
149 usage_info.usage = res->obj->vkusage & ~attachment;
150 if (res->obj->modifier_aspect) {
151 feats = res->obj->vkfeats;
154 if (res->obj->modifier == screen->modifier_props[templ->format].pDrmFormatModifierProperties[i].drmFormatModifier)
158 if ((res->obj->vkusage & attachment) &&
178 init_surface_info(surface, res, ivci);
218 struct zink_resource *res = zink_resource(pres);
221 simple_mtx_lock(&res->surface_mtx);
222 struct hash_entry *entry = _mesa_hash_table_search_pre_hashed(&res->surface_cache, hash, ivci);
227 entry = _mesa_hash_table_insert_pre_hashed(&res->surface_cache, hash, &surface->ivci, surface);
229 simple_mtx_unlock(&res->surface_mtx);
238 simple_mtx_unlock(&res->surface_mtx);
260 struct zink_resource *res = zink_resource(pres);
263 VkImageViewCreateInfo ivci = create_ivci(zink_screen(pctx->screen), res, templ,
267 if (res->obj->dt) {
306 struct zink_resource *res = zink_resource(psurface->texture);
308 simple_mtx_lock(&res->surface_mtx);
311 simple_mtx_unlock(&res->surface_mtx);
314 struct hash_entry *he = _mesa_hash_table_search_pre_hashed(&res->surface_cache, surface->hash, &surface->ivci);
317 _mesa_hash_table_remove(&res->surface_cache, he);
318 simple_mtx_unlock(&res->surface_mtx);
349 struct zink_resource *res = zink_resource((*psurface)->texture);
353 assert(!res->obj->dt);
355 ivci.image = res->obj->image;
358 simple_mtx_lock(&res->surface_mtx);
359 struct hash_entry *new_entry = _mesa_hash_table_search_pre_hashed(&res->surface_cache, hash, &ivci);
366 simple_mtx_unlock(&res->surface_mtx);
371 struct hash_entry *entry = _mesa_hash_table_search_pre_hashed(&res->surface_cache, surface->hash, &surface->ivci);
373 _mesa_hash_table_remove(&res->surface_cache, entry);
378 simple_mtx_unlock(&res->surface_mtx);
383 entry = _mesa_hash_table_insert_pre_hashed(&res->surface_cache, surface->hash, &surface->ivci, surface);
389 surface->info.flags = res->obj->vkflags;
390 surface->info.usage = res->obj->vkusage;
393 simple_mtx_unlock(&res->surface_mtx);
436 struct zink_resource *res = zink_resource(surface->base.texture);
437 struct kopper_displaytarget *cdt = res->obj->dt;
440 if (res->obj->dt != surface->dt) {
449 surface->base.width = res->base.b.width0;
450 surface->base.height = res->base.b.height0;
451 init_surface_info(surface, res, &surface->ivci);
453 if (!surface->swapchain[res->obj->dt_idx]) {
454 assert(res->obj->image && cdt->swapchain->images[res->obj->dt_idx].image == res->obj->image);
455 surface->ivci.image = res->obj->image;
457 VKSCR(CreateImageView)(screen->dev, &surface->ivci, NULL, &surface->swapchain[res->obj->dt_idx]);
459 surface->image_view = surface->swapchain[res->obj->dt_idx];