Lines Matching refs:templ
96 const struct pipe_resource *templ,
103 if (!modifier_is_supported(devinfo, templ->format, templ->bind,
173 const struct pipe_resource *templ,
178 util_format_description(templ->format);
180 isl_surf_usage_flags_t usage = pipe_bind_to_isl_usage(templ->bind);
184 if (devinfo->ver < 6 && !util_format_is_depth_or_stencil(templ->format))
192 if (templ->bind & PIPE_BIND_RENDER_TARGET && devinfo->ver < 6) {
198 if (templ->usage == PIPE_USAGE_STAGING ||
199 templ->bind & (PIPE_BIND_LINEAR | PIPE_BIND_CURSOR) )
201 else if (templ->bind & PIPE_BIND_SCANOUT)
206 if (templ->target == PIPE_TEXTURE_CUBE ||
207 templ->target == PIPE_TEXTURE_CUBE_ARRAY)
210 if (templ->usage != PIPE_USAGE_STAGING) {
211 if (templ->format == PIPE_FORMAT_S8_UINT)
216 if (templ->format == PIPE_FORMAT_Z24X8_UNORM ||
217 templ->format == PIPE_FORMAT_Z24_UNORM_S8_UINT ||
218 templ->format == PIPE_FORMAT_Z32_FLOAT_S8X24_UINT)
224 if (templ->format == PIPE_FORMAT_S8_UINT)
229 crocus_format_for_usage(&screen->devinfo, templ->format, usage).fmt;
231 if (row_pitch_B == 0 && templ->usage == PIPE_USAGE_STAGING &&
232 templ->target == PIPE_TEXTURE_2D &&
235 row_pitch_B = util_format_get_stride(templ->format, templ->width0);
240 .dim = crocus_target_to_isl_surf_dim(templ->target),
242 .width = templ->width0,
243 .height = templ->height0,
244 .depth = templ->depth0,
245 .levels = templ->last_level + 1,
246 .array_len = templ->array_size,
247 .samples = MAX2(templ->nr_samples, 1),
262 if (templ->usage == PIPE_USAGE_STAGING)
266 res->internal_format = templ->format;
358 const struct pipe_resource *templ)
364 res->base.b = *templ;
370 if (templ->target == PIPE_BUFFER)
649 const struct pipe_resource *templ)
652 struct crocus_resource *res = crocus_alloc_resource(pscreen, templ);
654 assert(templ->target == PIPE_BUFFER);
655 assert(templ->height0 <= 1);
656 assert(templ->depth0 <= 1);
657 assert(templ->format == PIPE_FORMAT_NONE ||
658 util_format_get_blocksize(templ->format) == 1);
660 res->internal_format = templ->format;
663 const char *name = templ->target == PIPE_BUFFER ? "buffer" : "miptree";
665 res->bo = crocus_bo_alloc(screen->bufmgr, name, templ->width0);
676 const struct pipe_resource *templ,
682 struct crocus_resource *res = crocus_alloc_resource(pscreen, templ);
688 select_best_modifier(devinfo, templ, modifiers, modifiers_count);
695 if (templ->usage == PIPE_USAGE_STAGING &&
696 templ->bind == PIPE_BIND_DEPTH_STENCIL &&
701 crocus_resource_configure_main(screen, res, templ, modifier, 0);
708 if (templ->usage == PIPE_USAGE_STAGING)
712 if (templ->bind & PIPE_BIND_SCANOUT)
743 if (templ->format == PIPE_FORMAT_S8_UINT && !(templ->usage == PIPE_USAGE_STAGING) &&
744 devinfo->ver == 7 && (templ->bind & PIPE_BIND_SAMPLER_VIEW)) {
773 const struct pipe_resource *templ)
775 if (templ->target == PIPE_BUFFER)
776 return crocus_resource_create_for_buffer(pscreen, templ);
778 return crocus_resource_create_with_modifiers(pscreen, templ, NULL, 0);
797 const struct pipe_resource *templ,
802 struct crocus_resource *res = crocus_alloc_resource(pscreen, templ);
806 assert(templ->target == PIPE_BUFFER);
808 res->internal_format = templ->format;
810 user_memory, templ->width0);
816 util_range_add(&res->base.b, &res->valid_buffer_range, 0, templ->width0);
823 const struct pipe_resource *templ,
827 assert(templ->target != PIPE_BUFFER);
831 struct crocus_resource *res = crocus_alloc_resource(pscreen, templ);
860 crocus_resource_configure_main(screen, res, templ, modifier,
905 const struct pipe_resource *templ,
911 struct crocus_resource *res = crocus_alloc_resource(pscreen, templ);
917 if (util_format_has_depth(util_format_description(templ->format)))
920 if (templ->flags & PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY) {
922 crocus_resource_configure_main(screen, res, templ, DRM_FORMAT_MOD_INVALID, 0);
1243 struct pipe_resource templ = (struct pipe_resource) {
1255 templ.target = PIPE_BUFFER;
1256 else if (templ.array_size > 1)
1257 templ.target = PIPE_TEXTURE_2D_ARRAY;
1259 templ.target = PIPE_TEXTURE_2D;
1261 map->staging = crocus_resource_create(pscreen, &templ);
1264 if (templ.target != PIPE_BUFFER) {