Lines Matching refs:templ

167                      const struct pipe_resource *templ,
174 if (!modifier_is_supported(devinfo, templ->format, templ->bind,
445 const struct pipe_resource *templ,
448 if (templ->flags & IRIS_RESOURCE_FLAG_DEVICE_MEM)
453 switch (templ->usage) {
467 if (templ->bind & PIPE_BIND_SCANOUT)
470 if (templ->flags & (PIPE_RESOURCE_FLAG_MAP_COHERENT |
479 if ((templ->bind & PIPE_BIND_SHARED) ||
480 util_format_get_num_planes(templ->format) > 1)
506 const struct pipe_resource *templ)
512 res->base.b = *templ;
518 if (templ->target == PIPE_BUFFER)
659 const struct pipe_resource *templ,
671 } else if (templ->usage == PIPE_USAGE_STAGING ||
672 templ->bind & (PIPE_BIND_LINEAR | PIPE_BIND_CURSOR)) {
675 (templ->bind & (PIPE_BIND_SCANOUT | PIPE_BIND_SHARED))) {
677 } else if (templ->bind & PIPE_BIND_SCANOUT) {
688 if (templ->usage == PIPE_USAGE_STAGING)
691 if (templ->bind & PIPE_BIND_RENDER_TARGET)
694 if (templ->bind & PIPE_BIND_SAMPLER_VIEW)
697 if (templ->bind & PIPE_BIND_SHADER_IMAGE)
700 if (templ->bind & PIPE_BIND_SCANOUT)
703 if (templ->target == PIPE_TEXTURE_CUBE ||
704 templ->target == PIPE_TEXTURE_CUBE_ARRAY) {
708 if (templ->usage != PIPE_USAGE_STAGING &&
709 util_format_is_depth_or_stencil(templ->format)) {
712 assert(!util_format_is_depth_and_stencil(templ->format));
714 usage |= templ->format == PIPE_FORMAT_S8_UINT ?
719 iris_format_for_usage(&screen->devinfo, templ->format, usage).fmt;
722 .dim = target_to_isl_surf_dim(templ->target),
724 .width = templ->width0,
725 .height = templ->height0,
726 .depth = templ->depth0,
727 .levels = templ->last_level + 1,
728 .array_len = templ->array_size,
729 .samples = MAX2(templ->nr_samples, 1),
739 res->internal_format = templ->format;
1097 const struct pipe_resource *templ)
1100 struct iris_resource *res = iris_alloc_resource(pscreen, templ);
1102 assert(templ->target == PIPE_BUFFER);
1103 assert(templ->height0 <= 1);
1104 assert(templ->depth0 <= 1);
1105 assert(templ->format == PIPE_FORMAT_NONE ||
1106 util_format_get_blocksize(templ->format) == 1);
1108 res->internal_format = templ->format;
1112 const char *name = templ->target == PIPE_BUFFER ? "buffer" : "miptree";
1113 if (templ->flags & IRIS_RESOURCE_FLAG_SHADER_MEMZONE) {
1116 } else if (templ->flags & IRIS_RESOURCE_FLAG_SURFACE_MEMZONE) {
1119 } else if (templ->flags & IRIS_RESOURCE_FLAG_DYNAMIC_MEMZONE) {
1122 } else if (templ->flags & IRIS_RESOURCE_FLAG_BINDLESS_MEMZONE) {
1127 unsigned flags = iris_resource_alloc_flags(screen, templ, res->aux.usage);
1129 res->bo = iris_bo_alloc(screen->bufmgr, name, templ->width0,
1130 iris_buffer_alignment(templ->width0),
1138 if (templ->bind & PIPE_BIND_SHARED) {
1148 const struct pipe_resource *templ,
1154 struct iris_resource *res = iris_alloc_resource(pscreen, templ);
1160 select_best_modifier(devinfo, templ, modifiers, modifiers_count);
1168 iris_resource_configure_main(screen, res, templ, modifier, 0);
1177 unsigned flags = iris_resource_alloc_flags(screen, templ, res->aux.usage);
1180 assert(!(templ->flags & (IRIS_RESOURCE_FLAG_SHADER_MEMZONE |
1226 if (templ->bind & PIPE_BIND_SHARED) {
1241 const struct pipe_resource *templ)
1243 if (templ->target == PIPE_BUFFER)
1244 return iris_resource_create_for_buffer(pscreen, templ);
1246 return iris_resource_create_with_modifiers(pscreen, templ, NULL, 0);
1265 const struct pipe_resource *templ,
1270 struct iris_resource *res = iris_alloc_resource(pscreen, templ);
1274 if (templ->target != PIPE_BUFFER &&
1275 templ->target != PIPE_TEXTURE_1D &&
1276 templ->target != PIPE_TEXTURE_2D)
1279 if (templ->array_size > 1)
1282 size_t res_size = templ->width0;
1283 if (templ->target != PIPE_BUFFER) {
1285 templ->width0 * util_format_get_blocksize(templ->format);
1286 res_size = templ->height0 * row_pitch_B;
1288 if (!iris_resource_configure_main(screen, res, templ,
1310 res->internal_format = templ->format;
1320 util_range_add(&res->base.b, &res->valid_buffer_range, 0, templ->width0);
1357 const struct pipe_resource *templ,
1361 assert(templ->target != PIPE_BUFFER);
1365 struct iris_resource *res = iris_alloc_resource(pscreen, templ);
1398 iris_resource_configure_main(screen, res, templ, modifier,
1438 const struct pipe_resource *templ,
1444 struct iris_resource *res = iris_alloc_resource(pscreen, templ);
1449 if (templ->flags & PIPE_RESOURCE_FLAG_TEXTURING_MORE_LIKELY) {
1451 iris_resource_configure_main(screen, res, templ, DRM_FORMAT_MOD_INVALID, 0);
1458 res->internal_format = templ->format;
1471 const struct pipe_resource *templ,
1475 enum pipe_format format = templ->format;
1479 return iris_resource_from_memobj(pscreen, templ, pmemobj, offset);
1481 struct pipe_resource t = *templ;
1560 struct pipe_resource templ = old_res->base.b;
1561 templ.bind |= new_bind_flag;
1564 (void *) pscreen->resource_create(pscreen, &templ);
1579 for (unsigned l = 0; l <= templ.last_level; l++) {
1581 .width = u_minify(templ.width0, l),
1582 .height = u_minify(templ.height0, l),
1583 .depth = util_num_layers(&templ, l),
1598 old_res->base.b.bind = templ.bind;
1611 for (unsigned l = 0; l <= templ.last_level; l++) {
1612 unsigned layers = util_num_layers(&templ, l);
2000 struct pipe_resource templ = (struct pipe_resource) {
2012 templ.target = PIPE_BUFFER;
2013 else if (templ.array_size > 1)
2014 templ.target = PIPE_TEXTURE_2D_ARRAY;
2016 templ.target = PIPE_TEXTURE_2D;
2018 map->staging = iris_resource_create(pscreen, &templ);
2021 if (templ.target != PIPE_BUFFER) {