* fragment = csc * texel
*/
for (i = 0; i < 3; ++i)
- ureg_TEX(shader, ureg_writemask(texel, TGSI_WRITEMASK_X << i), TGSI_TEXTURE_3D, tc, sampler[i]);
+ ureg_TEX(shader, ureg_writemask(texel, TGSI_WRITEMASK_X << i), TGSI_TEXTURE_2D_ARRAY, tc, sampler[i]);
ureg_MOV(shader, ureg_writemask(texel, TGSI_WRITEMASK_W), ureg_imm1f(shader, 1.0f));
i_tc[i], ureg_imm1f(shader, 0.5f));
ureg_ROUND(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_YZ), ureg_src(t_tc[i]));
ureg_MOV(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_W),
- ureg_imm1f(shader, i ? -0.25f : 0.25f));
+ ureg_imm1f(shader, i ? 1.0f : 0.0f));
ureg_ADD(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_YZ),
ureg_src(t_tc[i]), ureg_imm1f(shader, 0.5f));
ureg_MUL(shader, ureg_writemask(t_tc[i], TGSI_WRITEMASK_Y),
TGSI_SWIZZLE_X, j ? TGSI_SWIZZLE_Z : TGSI_SWIZZLE_Y, TGSI_SWIZZLE_W, TGSI_SWIZZLE_W);
ureg_TEX(shader, ureg_writemask(t_texel[i], TGSI_WRITEMASK_X << j),
- TGSI_TEXTURE_3D, src, sampler[j]);
+ TGSI_TEXTURE_2D_ARRAY, src, sampler[j]);
}
/* calculate linear interpolation factor
default_rect(struct vl_compositor_layer *layer)
{
struct pipe_resource *res = layer->sampler_views[0]->texture;
- struct u_rect rect = { 0, res->width0, 0, res->height0 * res->depth0 };
+ struct u_rect rect = { 0, res->width0, 0, res->height0 * res->array_size };
return rect;
}
break;
case VL_COMPOSITOR_BOB_TOP:
- s->layers[layer].zw.x = 0.25f;
+ s->layers[layer].zw.x = 0.0f;
s->layers[layer].src.tl.y += half_a_line;
s->layers[layer].src.br.y += half_a_line;
s->layers[layer].fs = c->fs_video_buffer;
break;
case VL_COMPOSITOR_BOB_BOTTOM:
- s->layers[layer].zw.x = 0.75f;
+ s->layers[layer].zw.x = 1.0f;
s->layers[layer].src.tl.y -= half_a_line;
s->layers[layer].src.br.y -= half_a_line;
s->layers[layer].fs = c->fs_video_buffer;
vl_vide_buffer_template(struct pipe_resource *templ,
const struct pipe_video_buffer *tmpl,
enum pipe_format resource_format,
- unsigned depth, unsigned usage, unsigned plane)
+ unsigned array_size, unsigned usage,
+ unsigned plane)
{
memset(templ, 0, sizeof(*templ));
- templ->target = depth > 1 ? PIPE_TEXTURE_3D : PIPE_TEXTURE_2D;
+ templ->target = array_size > 1 ? PIPE_TEXTURE_2D_ARRAY : PIPE_TEXTURE_2D;
templ->format = resource_format;
templ->width0 = tmpl->width;
templ->height0 = tmpl->height;
- templ->depth0 = depth;
- templ->array_size = 1;
+ templ->depth0 = 1;
+ templ->array_size = array_size;
templ->bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
templ->usage = usage;
struct vl_video_buffer *buf = (struct vl_video_buffer *)buffer;
struct pipe_surface surf_templ;
struct pipe_context *pipe;
- unsigned i, j, depth, surf;
+ unsigned i, j, array_size, surf;
assert(buf);
pipe = buf->base.context;
- depth = buffer->interlaced ? 2 : 1;
+ array_size = buffer->interlaced ? 2 : 1;
for (i = 0, surf = 0; i < VL_NUM_COMPONENTS; ++i) {
- for (j = 0; j < depth; ++j, ++surf) {
+ for (j = 0; j < array_size; ++j, ++surf) {
assert(surf < (VL_NUM_COMPONENTS * 2));
if (!buf->resources[i]) {
vl_video_buffer_create_ex(struct pipe_context *pipe,
const struct pipe_video_buffer *tmpl,
const enum pipe_format resource_formats[VL_NUM_COMPONENTS],
- unsigned depth, unsigned usage)
+ unsigned array_size, unsigned usage)
{
struct pipe_resource res_tmpl;
struct pipe_resource *resources[VL_NUM_COMPONENTS];
memset(resources, 0, sizeof resources);
- vl_vide_buffer_template(&res_tmpl, tmpl, resource_formats[0], depth, usage, 0);
+ vl_vide_buffer_template(&res_tmpl, tmpl, resource_formats[0], array_size, usage, 0);
resources[0] = pipe->screen->resource_create(pipe->screen, &res_tmpl);
if (!resources[0])
goto error;
return vl_video_buffer_create_ex2(pipe, tmpl, resources);
}
- vl_vide_buffer_template(&res_tmpl, tmpl, resource_formats[1], depth, usage, 1);
+ vl_vide_buffer_template(&res_tmpl, tmpl, resource_formats[1], array_size, usage, 1);
resources[1] = pipe->screen->resource_create(pipe->screen, &res_tmpl);
if (!resources[1])
goto error;
if (resource_formats[2] == PIPE_FORMAT_NONE)
return vl_video_buffer_create_ex2(pipe, tmpl, resources);
- vl_vide_buffer_template(&res_tmpl, tmpl, resource_formats[2], depth, usage, 2);
+ vl_vide_buffer_template(&res_tmpl, tmpl, resource_formats[2], array_size, usage, 2);
resources[2] = pipe->screen->resource_create(pipe->screen, &res_tmpl);
if (!resources[2])
goto error;
vl_vide_buffer_template(struct pipe_resource *templ,
const struct pipe_video_buffer *templat,
enum pipe_format resource_format,
- unsigned depth, unsigned usage, unsigned plane);
+ unsigned array_size, unsigned usage,
+ unsigned plane);
/**
* creates a video buffer, can be used as a standard implementation for pipe->create_video_buffer
const struct pipe_video_buffer *templat);
/**
- * extended create function, gets depth, usage and formats for each plane seperately
+ * extended create function, gets array_size, usage and formats for each plane seperately
*/
struct pipe_video_buffer *
vl_video_buffer_create_ex(struct pipe_context *pipe,
const struct pipe_video_buffer *templat,
const enum pipe_format resource_formats[VL_NUM_COMPONENTS],
- unsigned depth, unsigned usage);
+ unsigned array_size, unsigned usage);
/**
* even more extended create function, provide the pipe_resource for each plane
const enum pipe_format *resource_formats;
struct pipe_video_buffer template;
struct pipe_resource templ;
- unsigned i, depth;
+ unsigned i, array_size;
assert(pipe);
if (!resource_formats)
return NULL;
- depth = tmpl->interlaced ? 2 : 1;
+ array_size = tmpl->interlaced ? 2 : 1;
template = *tmpl;
template.width = align(tmpl->width, VL_MACROBLOCK_WIDTH);
- template.height = align(tmpl->height / depth, VL_MACROBLOCK_HEIGHT);
+ template.height = align(tmpl->height / array_size, VL_MACROBLOCK_HEIGHT);
- vl_vide_buffer_template(&templ, &template, resource_formats[0], depth, PIPE_USAGE_STATIC, 0);
+ vl_vide_buffer_template(&templ, &template, resource_formats[0], array_size, PIPE_USAGE_STATIC, 0);
if (ctx->chip_class < EVERGREEN)
templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[0] = (struct r600_texture *)
goto error;
if (resource_formats[1] != PIPE_FORMAT_NONE) {
- vl_vide_buffer_template(&templ, &template, resource_formats[1], depth, PIPE_USAGE_STATIC, 1);
+ vl_vide_buffer_template(&templ, &template, resource_formats[1], array_size, PIPE_USAGE_STATIC, 1);
if (ctx->chip_class < EVERGREEN)
templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[1] = (struct r600_texture *)
}
if (resource_formats[2] != PIPE_FORMAT_NONE) {
- vl_vide_buffer_template(&templ, &template, resource_formats[2], depth, PIPE_USAGE_STATIC, 2);
+ vl_vide_buffer_template(&templ, &template, resource_formats[2], array_size, PIPE_USAGE_STATIC, 2);
if (ctx->chip_class < EVERGREEN)
templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[2] = (struct r600_texture *)
resources[i]->resource.buf);
}
- template.height *= depth;
+ template.height *= array_size;
return vl_video_buffer_create_ex2(pipe, &template, (struct pipe_resource **)resources);
error:
const enum pipe_format *resource_formats;
struct pipe_video_buffer template;
struct pipe_resource templ;
- unsigned i, depth;
+ unsigned i, array_size;
assert(pipe);
if (!resource_formats)
return NULL;
- depth = tmpl->interlaced ? 2 : 1;
+ array_size = tmpl->interlaced ? 2 : 1;
template = *tmpl;
template.width = align(tmpl->width, VL_MACROBLOCK_WIDTH);
- template.height = align(tmpl->height / depth, VL_MACROBLOCK_HEIGHT);
+ template.height = align(tmpl->height / array_size, VL_MACROBLOCK_HEIGHT);
- vl_vide_buffer_template(&templ, &template, resource_formats[0], depth, PIPE_USAGE_STATIC, 0);
+ vl_vide_buffer_template(&templ, &template, resource_formats[0], array_size, PIPE_USAGE_STATIC, 0);
/* TODO: Setting the transfer flag is only a workaround till we get tiling working */
templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[0] = (struct r600_resource_texture *)
goto error;
if (resource_formats[1] != PIPE_FORMAT_NONE) {
- vl_vide_buffer_template(&templ, &template, resource_formats[1], depth, PIPE_USAGE_STATIC, 1);
+ vl_vide_buffer_template(&templ, &template, resource_formats[1], array_size, PIPE_USAGE_STATIC, 1);
templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[1] = (struct r600_resource_texture *)
pipe->screen->resource_create(pipe->screen, &templ);
}
if (resource_formats[2] != PIPE_FORMAT_NONE) {
- vl_vide_buffer_template(&templ, &template, resource_formats[2], depth, PIPE_USAGE_STATIC, 2);
+ vl_vide_buffer_template(&templ, &template, resource_formats[2], array_size, PIPE_USAGE_STATIC, 2);
templ.flags = R600_RESOURCE_FLAG_TRANSFER;
resources[2] = (struct r600_resource_texture *)
pipe->screen->resource_create(pipe->screen, &templ);
resources[i]->resource.buf);
}
- template.height *= depth;
+ template.height *= array_size;
return vl_video_buffer_create_ex2(pipe, &template, (struct pipe_resource **)resources);
error:
vlVdpVideoSurfaceSize(vlsurface, i, &width, &height);
- for (j = 0; j < sv->texture->depth0; ++j) {
+ for (j = 0; j < sv->texture->array_size; ++j) {
struct pipe_box box = {
0, 0, j,
width, height, 1
}
util_copy_rect(destination_data[i] + destination_pitches[i] * j, sv->texture->format,
- destination_pitches[i] * sv->texture->depth0, 0, 0,
+ destination_pitches[i] * sv->texture->array_size, 0, 0,
box.width, box.height, map, transfer->stride, 0, 0);
pipe_transfer_unmap(pipe, transfer);
vlVdpVideoSurfaceSize(p_surf, i, &width, &height);
- for (j = 0; j < sv->texture->depth0; ++j) {
+ for (j = 0; j < sv->texture->array_size; ++j) {
struct pipe_box dst_box = {
0, 0, j,
width, height, 1
pipe->transfer_inline_write(pipe, sv->texture, 0,
PIPE_TRANSFER_WRITE, &dst_box,
source_data[i] + source_pitches[i] * j,
- source_pitches[i] * sv->texture->depth0,
+ source_pitches[i] * sv->texture->array_size,
0);
}
}