mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 00:40:10 +01:00
gallium: delete pipe_surface::width and pipe_surface::height
these fields are misleading and should always be replaced by either: * the framebuffer width/height * explicit function params to specify width/height Co-authored-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33946>
This commit is contained in:
parent
e06cfa3e08
commit
9d359c6d10
76 changed files with 324 additions and 343 deletions
|
|
@ -111,8 +111,6 @@ static struct pipe_surface *noop_create_surface(struct pipe_context *ctx,
|
||||||
pipe_resource_reference(&surface->texture, texture);
|
pipe_resource_reference(&surface->texture, texture);
|
||||||
surface->context = ctx;
|
surface->context = ctx;
|
||||||
surface->format = surf_tmpl->format;
|
surface->format = surf_tmpl->format;
|
||||||
surface->width = texture->width0;
|
|
||||||
surface->height = texture->height0;
|
|
||||||
surface->texture = texture;
|
surface->texture = texture;
|
||||||
surface->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
surface->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
surface->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
surface->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -697,8 +697,6 @@ void trace_dump_surface_template(const struct pipe_surface *state,
|
||||||
|
|
||||||
trace_dump_member(format, state, format);
|
trace_dump_member(format, state, format);
|
||||||
trace_dump_member(ptr, state, texture);
|
trace_dump_member(ptr, state, texture);
|
||||||
trace_dump_member(uint, state, width);
|
|
||||||
trace_dump_member(uint, state, height);
|
|
||||||
|
|
||||||
trace_dump_member_begin("target");
|
trace_dump_member_begin("target");
|
||||||
trace_dump_enum(tr_util_pipe_texture_target_name(target));
|
trace_dump_enum(tr_util_pipe_texture_target_name(target));
|
||||||
|
|
|
||||||
|
|
@ -1821,8 +1821,7 @@ static void do_blits(struct blitter_context_priv *ctx,
|
||||||
struct pipe_framebuffer_state fb_state = {0};
|
struct pipe_framebuffer_state fb_state = {0};
|
||||||
|
|
||||||
/* Initialize framebuffer state. */
|
/* Initialize framebuffer state. */
|
||||||
fb_state.width = dst->width;
|
pipe_surface_size(dst, &fb_state.width, &fb_state.height);
|
||||||
fb_state.height = dst->height;
|
|
||||||
fb_state.nr_cbufs = is_zsbuf ? 0 : 1;
|
fb_state.nr_cbufs = is_zsbuf ? 0 : 1;
|
||||||
|
|
||||||
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
||||||
|
|
@ -2378,8 +2377,7 @@ void util_blitter_clear_render_target(struct blitter_context *blitter,
|
||||||
bind_fs_clear_color(ctx, false);
|
bind_fs_clear_color(ctx, false);
|
||||||
|
|
||||||
/* set a framebuffer state */
|
/* set a framebuffer state */
|
||||||
fb_state.width = dstsurf->width;
|
pipe_surface_size(dstsurf, &fb_state.width, &fb_state.height);
|
||||||
fb_state.height = dstsurf->height;
|
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dstsurf;
|
fb_state.cbufs[0] = dstsurf;
|
||||||
fb_state.zsbuf = NULL;
|
fb_state.zsbuf = NULL;
|
||||||
|
|
@ -2390,7 +2388,7 @@ void util_blitter_clear_render_target(struct blitter_context *blitter,
|
||||||
pipe->set_min_samples(pipe, 1);
|
pipe->set_min_samples(pipe, 1);
|
||||||
msaa = util_framebuffer_get_num_samples(&fb_state) > 1;
|
msaa = util_framebuffer_get_num_samples(&fb_state) > 1;
|
||||||
|
|
||||||
blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
|
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
||||||
blitter_set_common_draw_rect_state(ctx, false, msaa);
|
blitter_set_common_draw_rect_state(ctx, false, msaa);
|
||||||
|
|
||||||
struct pipe_constant_buffer cb = {
|
struct pipe_constant_buffer cb = {
|
||||||
|
|
@ -2469,8 +2467,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
|
||||||
bind_fs_empty(ctx);
|
bind_fs_empty(ctx);
|
||||||
|
|
||||||
/* set a framebuffer state */
|
/* set a framebuffer state */
|
||||||
fb_state.width = dstsurf->width;
|
pipe_surface_size(dstsurf, &fb_state.width, &fb_state.height);
|
||||||
fb_state.height = dstsurf->height;
|
|
||||||
fb_state.nr_cbufs = 0;
|
fb_state.nr_cbufs = 0;
|
||||||
fb_state.cbufs[0] = NULL;
|
fb_state.cbufs[0] = NULL;
|
||||||
fb_state.zsbuf = dstsurf;
|
fb_state.zsbuf = dstsurf;
|
||||||
|
|
@ -2480,7 +2477,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
|
||||||
if (pipe->set_min_samples)
|
if (pipe->set_min_samples)
|
||||||
pipe->set_min_samples(pipe, 1);
|
pipe->set_min_samples(pipe, 1);
|
||||||
|
|
||||||
blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
|
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
||||||
|
|
||||||
num_layers = dstsurf->u.tex.last_layer - dstsurf->u.tex.first_layer + 1;
|
num_layers = dstsurf->u.tex.last_layer - dstsurf->u.tex.first_layer + 1;
|
||||||
if (num_layers > 1 && ctx->has_layered) {
|
if (num_layers > 1 && ctx->has_layered) {
|
||||||
|
|
@ -2535,8 +2532,7 @@ void util_blitter_custom_depth_stencil(struct blitter_context *blitter,
|
||||||
bind_fs_empty(ctx);
|
bind_fs_empty(ctx);
|
||||||
|
|
||||||
/* set a framebuffer state */
|
/* set a framebuffer state */
|
||||||
fb_state.width = zsurf->width;
|
pipe_surface_size(zsurf, &fb_state.width, &fb_state.height);
|
||||||
fb_state.height = zsurf->height;
|
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
if (cbsurf) {
|
if (cbsurf) {
|
||||||
fb_state.cbufs[0] = cbsurf;
|
fb_state.cbufs[0] = cbsurf;
|
||||||
|
|
@ -2554,9 +2550,9 @@ void util_blitter_custom_depth_stencil(struct blitter_context *blitter,
|
||||||
|
|
||||||
blitter_set_common_draw_rect_state(ctx, false,
|
blitter_set_common_draw_rect_state(ctx, false,
|
||||||
util_framebuffer_get_num_samples(&fb_state) > 1);
|
util_framebuffer_get_num_samples(&fb_state) > 1);
|
||||||
blitter_set_dst_dimensions(ctx, zsurf->width, zsurf->height);
|
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
||||||
blitter->draw_rectangle(blitter, ctx->velem_state, get_vs_passthrough_pos,
|
blitter->draw_rectangle(blitter, ctx->velem_state, get_vs_passthrough_pos,
|
||||||
0, 0, zsurf->width, zsurf->height, depth,
|
0, 0, fb_state.width, fb_state.height, depth,
|
||||||
1, UTIL_BLITTER_ATTRIB_NONE, NULL);
|
1, UTIL_BLITTER_ATTRIB_NONE, NULL);
|
||||||
|
|
||||||
util_blitter_restore_vertex_states(blitter);
|
util_blitter_restore_vertex_states(blitter);
|
||||||
|
|
@ -2728,8 +2724,7 @@ void util_blitter_custom_color(struct blitter_context *blitter,
|
||||||
bind_fs_clear_color(ctx, false);
|
bind_fs_clear_color(ctx, false);
|
||||||
|
|
||||||
/* set a framebuffer state */
|
/* set a framebuffer state */
|
||||||
fb_state.width = dstsurf->width;
|
pipe_surface_size(dstsurf, &fb_state.width, &fb_state.height);
|
||||||
fb_state.height = dstsurf->height;
|
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dstsurf;
|
fb_state.cbufs[0] = dstsurf;
|
||||||
fb_state.zsbuf = NULL;
|
fb_state.zsbuf = NULL;
|
||||||
|
|
@ -2741,9 +2736,9 @@ void util_blitter_custom_color(struct blitter_context *blitter,
|
||||||
|
|
||||||
blitter_set_common_draw_rect_state(ctx, false,
|
blitter_set_common_draw_rect_state(ctx, false,
|
||||||
util_framebuffer_get_num_samples(&fb_state) > 1);
|
util_framebuffer_get_num_samples(&fb_state) > 1);
|
||||||
blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
|
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
||||||
blitter->draw_rectangle(blitter, ctx->velem_state, get_vs_passthrough_pos,
|
blitter->draw_rectangle(blitter, ctx->velem_state, get_vs_passthrough_pos,
|
||||||
0, 0, dstsurf->width, dstsurf->height,
|
0, 0, fb_state.width, fb_state.height,
|
||||||
0, 1, UTIL_BLITTER_ATTRIB_NONE, NULL);
|
0, 1, UTIL_BLITTER_ATTRIB_NONE, NULL);
|
||||||
|
|
||||||
util_blitter_restore_vertex_states(blitter);
|
util_blitter_restore_vertex_states(blitter);
|
||||||
|
|
@ -2768,6 +2763,7 @@ static void *get_custom_vs(struct blitter_context *blitter)
|
||||||
*/
|
*/
|
||||||
void util_blitter_custom_shader(struct blitter_context *blitter,
|
void util_blitter_custom_shader(struct blitter_context *blitter,
|
||||||
struct pipe_surface *dstsurf,
|
struct pipe_surface *dstsurf,
|
||||||
|
uint16_t width, uint16_t height,
|
||||||
void *custom_vs, void *custom_fs)
|
void *custom_vs, void *custom_fs)
|
||||||
{
|
{
|
||||||
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter;
|
||||||
|
|
@ -2793,8 +2789,8 @@ void util_blitter_custom_shader(struct blitter_context *blitter,
|
||||||
pipe->bind_fs_state(pipe, custom_fs);
|
pipe->bind_fs_state(pipe, custom_fs);
|
||||||
|
|
||||||
/* set a framebuffer state */
|
/* set a framebuffer state */
|
||||||
fb_state.width = dstsurf->width;
|
fb_state.width = width;
|
||||||
fb_state.height = dstsurf->height;
|
fb_state.height = height;
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dstsurf;
|
fb_state.cbufs[0] = dstsurf;
|
||||||
fb_state.resolve = NULL;
|
fb_state.resolve = NULL;
|
||||||
|
|
@ -2805,9 +2801,9 @@ void util_blitter_custom_shader(struct blitter_context *blitter,
|
||||||
|
|
||||||
blitter_set_common_draw_rect_state(ctx, false,
|
blitter_set_common_draw_rect_state(ctx, false,
|
||||||
util_framebuffer_get_num_samples(&fb_state) > 1);
|
util_framebuffer_get_num_samples(&fb_state) > 1);
|
||||||
blitter_set_dst_dimensions(ctx, dstsurf->width, dstsurf->height);
|
blitter_set_dst_dimensions(ctx, fb_state.width, fb_state.height);
|
||||||
blitter->draw_rectangle(blitter, ctx->velem_state, get_custom_vs,
|
blitter->draw_rectangle(blitter, ctx->velem_state, get_custom_vs,
|
||||||
0, 0, dstsurf->width, dstsurf->height,
|
0, 0, fb_state.width, fb_state.height,
|
||||||
0, 1, UTIL_BLITTER_ATTRIB_NONE, NULL);
|
0, 1, UTIL_BLITTER_ATTRIB_NONE, NULL);
|
||||||
|
|
||||||
util_blitter_restore_vertex_states(blitter);
|
util_blitter_restore_vertex_states(blitter);
|
||||||
|
|
@ -2902,7 +2898,8 @@ util_blitter_stencil_fallback(struct blitter_context *blitter,
|
||||||
|
|
||||||
blitter_set_common_draw_rect_state(ctx, scissor != NULL,
|
blitter_set_common_draw_rect_state(ctx, scissor != NULL,
|
||||||
util_framebuffer_get_num_samples(&fb_state) > 1);
|
util_framebuffer_get_num_samples(&fb_state) > 1);
|
||||||
blitter_set_dst_dimensions(ctx, dst_view->width, dst_view->height);
|
blitter_set_dst_dimensions(ctx, pipe_surface_width(dst_view),
|
||||||
|
pipe_surface_height(dst_view));
|
||||||
|
|
||||||
if (scissor) {
|
if (scissor) {
|
||||||
pipe->set_scissor_states(pipe, 0, 1, scissor);
|
pipe->set_scissor_states(pipe, 0, 1, scissor);
|
||||||
|
|
|
||||||
|
|
@ -389,6 +389,7 @@ void util_blitter_custom_resolve_color(struct blitter_context *blitter,
|
||||||
/* Used by vc4 for 8/16-bit linear-to-tiled blits */
|
/* Used by vc4 for 8/16-bit linear-to-tiled blits */
|
||||||
void util_blitter_custom_shader(struct blitter_context *blitter,
|
void util_blitter_custom_shader(struct blitter_context *blitter,
|
||||||
struct pipe_surface *dstsurf,
|
struct pipe_surface *dstsurf,
|
||||||
|
uint16_t width, uint16_t height,
|
||||||
void *custom_vs, void *custom_fs);
|
void *custom_vs, void *custom_fs);
|
||||||
|
|
||||||
/* Used by D3D12 for non-MSAA -> MSAA stencil blits */
|
/* Used by D3D12 for non-MSAA -> MSAA stencil blits */
|
||||||
|
|
|
||||||
|
|
@ -112,19 +112,19 @@ debug_dump_surface(struct pipe_context *pipe,
|
||||||
* to be done here:
|
* to be done here:
|
||||||
*/
|
*/
|
||||||
texture = surface->texture;
|
texture = surface->texture;
|
||||||
|
|
||||||
data = pipe_texture_map(pipe, texture, surface->u.tex.level,
|
data = pipe_texture_map(pipe, texture, surface->u.tex.level,
|
||||||
surface->u.tex.first_layer,
|
surface->u.tex.first_layer,
|
||||||
PIPE_MAP_READ,
|
PIPE_MAP_READ,
|
||||||
0, 0, surface->width, surface->height, &transfer);
|
0, 0, pipe_surface_width(surface),
|
||||||
|
pipe_surface_height(surface), &transfer);
|
||||||
if (!data)
|
if (!data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
debug_dump_image(prefix,
|
debug_dump_image(prefix,
|
||||||
texture->format,
|
texture->format,
|
||||||
util_format_get_blocksize(texture->format),
|
util_format_get_blocksize(texture->format),
|
||||||
util_format_get_nblocksx(texture->format, surface->width),
|
util_format_get_nblocksx(texture->format, pipe_surface_width(surface)),
|
||||||
util_format_get_nblocksy(texture->format, surface->height),
|
util_format_get_nblocksy(texture->format, pipe_surface_height(surface)),
|
||||||
transfer->stride,
|
transfer->stride,
|
||||||
data);
|
data);
|
||||||
|
|
||||||
|
|
@ -194,7 +194,8 @@ debug_dump_surface_bmp(struct pipe_context *pipe,
|
||||||
|
|
||||||
ptr = pipe_texture_map(pipe, texture, surface->u.tex.level,
|
ptr = pipe_texture_map(pipe, texture, surface->u.tex.level,
|
||||||
surface->u.tex.first_layer, PIPE_MAP_READ,
|
surface->u.tex.first_layer, PIPE_MAP_READ,
|
||||||
0, 0, surface->width, surface->height, &transfer);
|
0, 0, pipe_surface_width(surface),
|
||||||
|
pipe_surface_height(surface), &transfer);
|
||||||
|
|
||||||
debug_dump_transfer_bmp(pipe, filename, transfer, ptr);
|
debug_dump_transfer_bmp(pipe, filename, transfer, ptr);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -712,8 +712,6 @@ util_dump_surface(FILE *stream, const struct pipe_surface *state)
|
||||||
util_dump_struct_begin(stream, "pipe_surface");
|
util_dump_struct_begin(stream, "pipe_surface");
|
||||||
|
|
||||||
util_dump_member(stream, format, state, format);
|
util_dump_member(stream, format, state, format);
|
||||||
util_dump_member(stream, uint, state, width);
|
|
||||||
util_dump_member(stream, uint, state, height);
|
|
||||||
|
|
||||||
util_dump_member(stream, ptr, state, texture);
|
util_dump_member(stream, ptr, state, texture);
|
||||||
util_dump_member(stream, uint, state, u.tex.level);
|
util_dump_member(stream, uint, state, u.tex.level);
|
||||||
|
|
|
||||||
|
|
@ -168,13 +168,18 @@ util_framebuffer_min_size(const struct pipe_framebuffer_state *fb,
|
||||||
if (!fb->cbufs[i])
|
if (!fb->cbufs[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
w = MIN2(w, fb->cbufs[i]->width);
|
uint16_t width, height;
|
||||||
h = MIN2(h, fb->cbufs[i]->height);
|
pipe_surface_size(fb->cbufs[i], &width, &height);
|
||||||
|
|
||||||
|
w = MIN2(w, width);
|
||||||
|
h = MIN2(h, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fb->zsbuf) {
|
if (fb->zsbuf) {
|
||||||
w = MIN2(w, fb->zsbuf->width);
|
uint16_t width, height;
|
||||||
h = MIN2(h, fb->zsbuf->height);
|
pipe_surface_size(fb->zsbuf, &width, &height);
|
||||||
|
w = MIN2(w, width);
|
||||||
|
h = MIN2(h, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (w == ~0u) {
|
if (w == ~0u) {
|
||||||
|
|
|
||||||
|
|
@ -345,8 +345,6 @@ pipe_surface_reset(struct pipe_context *ctx, struct pipe_surface* ps,
|
||||||
{
|
{
|
||||||
pipe_resource_reference(&ps->texture, pt);
|
pipe_resource_reference(&ps->texture, pt);
|
||||||
ps->format = pt->format;
|
ps->format = pt->format;
|
||||||
ps->width = (uint16_t)u_minify(pt->width0, level);
|
|
||||||
ps->height = (uint16_t)u_minify(pt->height0, level);
|
|
||||||
ps->u.tex.level = level;
|
ps->u.tex.level = level;
|
||||||
ps->u.tex.first_layer = ps->u.tex.last_layer = layer;
|
ps->u.tex.first_layer = ps->u.tex.last_layer = layer;
|
||||||
ps->context = ctx;
|
ps->context = ctx;
|
||||||
|
|
@ -361,6 +359,67 @@ pipe_surface_init(struct pipe_context *ctx, struct pipe_surface* ps,
|
||||||
pipe_surface_reset(ctx, ps, pt, level, layer);
|
pipe_surface_reset(ctx, ps, pt, level, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline unsigned
|
||||||
|
pipe_surface_width(const struct pipe_surface *ps)
|
||||||
|
{
|
||||||
|
if (ps->texture->target == PIPE_BUFFER) {
|
||||||
|
/* TODO: delete clover */
|
||||||
|
return ps->u.buf.last_element - ps->u.buf.first_element + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned width = (uint16_t)u_minify(ps->texture->width0, ps->u.tex.level);
|
||||||
|
|
||||||
|
/* adjust texture view size to get full blocksize on compressed formats */
|
||||||
|
if (!util_format_is_depth_or_stencil(ps->texture->format) && ps->format != ps->texture->format) {
|
||||||
|
const struct util_format_description *res_desc = util_format_description(ps->texture->format);
|
||||||
|
const struct util_format_description *surf_desc = util_format_description(ps->format);
|
||||||
|
|
||||||
|
if (res_desc->block.width != surf_desc->block.width ||
|
||||||
|
res_desc->block.height != surf_desc->block.height) {
|
||||||
|
unsigned nblks_x = util_format_get_nblocksx(ps->texture->format, width);
|
||||||
|
width = nblks_x * surf_desc->block.width;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return width;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline unsigned
|
||||||
|
pipe_surface_height(const struct pipe_surface *ps)
|
||||||
|
{
|
||||||
|
if (ps->texture->target == PIPE_BUFFER) {
|
||||||
|
/* TODO: delete clover */
|
||||||
|
return ps->texture->height0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned height = u_minify(ps->texture->height0, ps->u.tex.level);
|
||||||
|
|
||||||
|
/* adjust texture view size to get full blocksize on compressed formats */
|
||||||
|
if (!util_format_is_depth_or_stencil(ps->texture->format) && ps->format != ps->texture->format) {
|
||||||
|
const struct util_format_description *res_desc = util_format_description(ps->texture->format);
|
||||||
|
const struct util_format_description *surf_desc = util_format_description(ps->format);
|
||||||
|
|
||||||
|
if (res_desc->block.width != surf_desc->block.width ||
|
||||||
|
res_desc->block.height != surf_desc->block.height) {
|
||||||
|
|
||||||
|
unsigned nblks_y = util_format_get_nblocksy(ps->texture->format, height);
|
||||||
|
height = nblks_y * surf_desc->block.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return height;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
pipe_surface_size(const struct pipe_surface *ps, uint16_t *width, uint16_t *height)
|
||||||
|
{
|
||||||
|
if (width)
|
||||||
|
*width = (uint16_t)pipe_surface_width(ps);
|
||||||
|
|
||||||
|
if (height)
|
||||||
|
*height = (uint16_t)pipe_surface_height(ps);
|
||||||
|
}
|
||||||
|
|
||||||
/* Return true if the surfaces are equal. */
|
/* Return true if the surfaces are equal. */
|
||||||
static inline bool
|
static inline bool
|
||||||
pipe_surface_equal(struct pipe_surface *s1, struct pipe_surface *s2)
|
pipe_surface_equal(struct pipe_surface *s1, struct pipe_surface *s2)
|
||||||
|
|
|
||||||
|
|
@ -50,13 +50,9 @@ Header('util/format/u_format.h')
|
||||||
|
|
||||||
Tracepoint('surface',
|
Tracepoint('surface',
|
||||||
args=[ArgStruct(type='const struct pipe_surface *', var='psurf')],
|
args=[ArgStruct(type='const struct pipe_surface *', var='psurf')],
|
||||||
tp_struct=[Arg(type='uint16_t', name='width', var='psurf->width', c_format='%u'),
|
tp_struct=[Arg(type='uint8_t', name='nr_samples', var='psurf->nr_samples', c_format='%u'),
|
||||||
Arg(type='uint16_t', name='height', var='psurf->height', c_format='%u'),
|
|
||||||
Arg(type='uint8_t', name='nr_samples', var='psurf->nr_samples', c_format='%u'),
|
|
||||||
Arg(type='const char *', name='format', var='util_format_short_name(psurf->format)', c_format='%s')],
|
Arg(type='const char *', name='format', var='util_format_short_name(psurf->format)', c_format='%s')],
|
||||||
tp_print=['%ux%u@%u, fmt=%s',
|
tp_print=['%u samples, fmt=%s',
|
||||||
'__entry->width',
|
|
||||||
'__entry->height',
|
|
||||||
'__entry->nr_samples',
|
'__entry->nr_samples',
|
||||||
'__entry->format'],
|
'__entry->format'],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -403,8 +403,8 @@ vl_bicubic_filter_render(struct vl_bicubic_filter *filter,
|
||||||
} else {
|
} else {
|
||||||
scissor.minx = 0;
|
scissor.minx = 0;
|
||||||
scissor.miny = 0;
|
scissor.miny = 0;
|
||||||
scissor.maxx = dst->width;
|
scissor.maxx = pipe_surface_width(dst);
|
||||||
scissor.maxy = dst->height;
|
scissor.maxy = pipe_surface_height(dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_color.f[0] = clear_color.f[1] = 0.0f;
|
clear_color.f[0] = clear_color.f[1] = 0.0f;
|
||||||
|
|
@ -417,8 +417,8 @@ vl_bicubic_filter_render(struct vl_bicubic_filter *filter,
|
||||||
viewport.translate[0] = dst_area->x0;
|
viewport.translate[0] = dst_area->x0;
|
||||||
viewport.translate[1] = dst_area->y0;
|
viewport.translate[1] = dst_area->y0;
|
||||||
} else {
|
} else {
|
||||||
viewport.scale[0] = dst->width;
|
viewport.scale[0] = pipe_surface_width(dst);
|
||||||
viewport.scale[1] = dst->height;
|
viewport.scale[1] = pipe_surface_height(dst);
|
||||||
}
|
}
|
||||||
viewport.scale[2] = 1;
|
viewport.scale[2] = 1;
|
||||||
viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
|
viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
|
||||||
|
|
@ -440,14 +440,15 @@ vl_bicubic_filter_render(struct vl_bicubic_filter *filter,
|
||||||
u_upload_unmap(filter->pipe->const_uploader);
|
u_upload_unmap(filter->pipe->const_uploader);
|
||||||
|
|
||||||
memset(&fb_state, 0, sizeof(fb_state));
|
memset(&fb_state, 0, sizeof(fb_state));
|
||||||
fb_state.width = dst->width;
|
fb_state.width = pipe_surface_width(dst);
|
||||||
fb_state.height = dst->height;
|
fb_state.height = pipe_surface_height(dst);
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dst;
|
fb_state.cbufs[0] = dst;
|
||||||
|
|
||||||
filter->pipe->set_scissor_states(filter->pipe, 0, 1, &scissor);
|
filter->pipe->set_scissor_states(filter->pipe, 0, 1, &scissor);
|
||||||
filter->pipe->clear_render_target(filter->pipe, dst, &clear_color,
|
filter->pipe->clear_render_target(filter->pipe, dst, &clear_color,
|
||||||
0, 0, dst->width, dst->height, false);
|
0, 0, pipe_surface_width(dst),
|
||||||
|
pipe_surface_height(dst), false);
|
||||||
filter->pipe->set_constant_buffer(filter->pipe, PIPE_SHADER_FRAGMENT,
|
filter->pipe->set_constant_buffer(filter->pipe, PIPE_SHADER_FRAGMENT,
|
||||||
0, false, &cb);
|
0, false, &cb);
|
||||||
filter->pipe->bind_rasterizer_state(filter->pipe, filter->rs_state);
|
filter->pipe->bind_rasterizer_state(filter->pipe, filter->rs_state);
|
||||||
|
|
|
||||||
|
|
@ -895,22 +895,21 @@ vl_compositor_cs_render(struct vl_compositor_state *s,
|
||||||
assert(c && s);
|
assert(c && s);
|
||||||
assert(dst_surface);
|
assert(dst_surface);
|
||||||
|
|
||||||
c->fb_state.width = dst_surface->width;
|
pipe_surface_size(dst_surface, &c->fb_state.width, &c->fb_state.height);
|
||||||
c->fb_state.height = dst_surface->height;
|
|
||||||
c->fb_state.cbufs[0] = dst_surface;
|
c->fb_state.cbufs[0] = dst_surface;
|
||||||
|
|
||||||
if (!s->scissor_valid) {
|
if (!s->scissor_valid) {
|
||||||
s->scissor.minx = 0;
|
s->scissor.minx = 0;
|
||||||
s->scissor.miny = 0;
|
s->scissor.miny = 0;
|
||||||
s->scissor.maxx = dst_surface->width;
|
s->scissor.maxx = c->fb_state.width;
|
||||||
s->scissor.maxy = dst_surface->height;
|
s->scissor.maxy = c->fb_state.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clear_dirty && dirty_area &&
|
if (clear_dirty && dirty_area &&
|
||||||
(dirty_area->x0 < dirty_area->x1 || dirty_area->y0 < dirty_area->y1)) {
|
(dirty_area->x0 < dirty_area->x1 || dirty_area->y0 < dirty_area->y1)) {
|
||||||
|
|
||||||
c->pipe->clear_render_target(c->pipe, dst_surface, &s->clear_color,
|
c->pipe->clear_render_target(c->pipe, dst_surface, &s->clear_color,
|
||||||
0, 0, dst_surface->width, dst_surface->height, false);
|
0, 0, c->fb_state.width, c->fb_state.height, false);
|
||||||
dirty_area->x0 = dirty_area->y0 = VL_COMPOSITOR_MAX_DIRTY;
|
dirty_area->x0 = dirty_area->y0 = VL_COMPOSITOR_MAX_DIRTY;
|
||||||
dirty_area->x1 = dirty_area->y1 = VL_COMPOSITOR_MIN_DIRTY;
|
dirty_area->x1 = dirty_area->y1 = VL_COMPOSITOR_MIN_DIRTY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -713,15 +713,14 @@ vl_compositor_gfx_render(struct vl_compositor_state *s,
|
||||||
assert(c);
|
assert(c);
|
||||||
assert(dst_surface);
|
assert(dst_surface);
|
||||||
|
|
||||||
c->fb_state.width = dst_surface->width;
|
pipe_surface_size(dst_surface, &c->fb_state.width, &c->fb_state.height);
|
||||||
c->fb_state.height = dst_surface->height;
|
|
||||||
c->fb_state.cbufs[0] = dst_surface;
|
c->fb_state.cbufs[0] = dst_surface;
|
||||||
|
|
||||||
if (!s->scissor_valid) {
|
if (!s->scissor_valid) {
|
||||||
s->scissor.minx = 0;
|
s->scissor.minx = 0;
|
||||||
s->scissor.miny = 0;
|
s->scissor.miny = 0;
|
||||||
s->scissor.maxx = dst_surface->width;
|
s->scissor.maxx = c->fb_state.width;
|
||||||
s->scissor.maxy = dst_surface->height;
|
s->scissor.maxy = c->fb_state.height;
|
||||||
}
|
}
|
||||||
c->pipe->set_scissor_states(c->pipe, 0, 1, &s->scissor);
|
c->pipe->set_scissor_states(c->pipe, 0, 1, &s->scissor);
|
||||||
|
|
||||||
|
|
@ -732,7 +731,7 @@ vl_compositor_gfx_render(struct vl_compositor_state *s,
|
||||||
(dirty_area->x0 < dirty_area->x1 || dirty_area->y0 < dirty_area->y1)) {
|
(dirty_area->x0 < dirty_area->x1 || dirty_area->y0 < dirty_area->y1)) {
|
||||||
|
|
||||||
c->pipe->clear_render_target(c->pipe, dst_surface, &s->clear_color,
|
c->pipe->clear_render_target(c->pipe, dst_surface, &s->clear_color,
|
||||||
0, 0, dst_surface->width, dst_surface->height, false);
|
0, 0, c->fb_state.width, c->fb_state.height, false);
|
||||||
dirty_area->x0 = dirty_area->y0 = VL_COMPOSITOR_MAX_DIRTY;
|
dirty_area->x0 = dirty_area->y0 = VL_COMPOSITOR_MAX_DIRTY;
|
||||||
dirty_area->x1 = dirty_area->y1 = VL_COMPOSITOR_MIN_DIRTY;
|
dirty_area->x1 = dirty_area->y1 = VL_COMPOSITOR_MIN_DIRTY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -283,8 +283,8 @@ vl_matrix_filter_render(struct vl_matrix_filter *filter,
|
||||||
assert(filter && src && dst);
|
assert(filter && src && dst);
|
||||||
|
|
||||||
memset(&viewport, 0, sizeof(viewport));
|
memset(&viewport, 0, sizeof(viewport));
|
||||||
viewport.scale[0] = dst->width;
|
viewport.scale[0] = pipe_surface_width(dst);
|
||||||
viewport.scale[1] = dst->height;
|
viewport.scale[1] = pipe_surface_height(dst);
|
||||||
viewport.scale[2] = 1;
|
viewport.scale[2] = 1;
|
||||||
viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
|
viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
|
||||||
viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
|
viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
|
||||||
|
|
@ -292,8 +292,8 @@ vl_matrix_filter_render(struct vl_matrix_filter *filter,
|
||||||
viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
|
viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
|
||||||
|
|
||||||
memset(&fb_state, 0, sizeof(fb_state));
|
memset(&fb_state, 0, sizeof(fb_state));
|
||||||
fb_state.width = dst->width;
|
fb_state.width = pipe_surface_width(dst);
|
||||||
fb_state.height = dst->height;
|
fb_state.height = pipe_surface_height(dst);
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dst;
|
fb_state.cbufs[0] = dst;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -586,11 +586,11 @@ vl_mc_set_surface(struct vl_mc_buffer *buffer, struct pipe_surface *surface)
|
||||||
|
|
||||||
buffer->surface_cleared = false;
|
buffer->surface_cleared = false;
|
||||||
|
|
||||||
buffer->viewport.scale[0] = surface->width;
|
buffer->viewport.scale[0] = pipe_surface_width(surface);
|
||||||
buffer->viewport.scale[1] = surface->height;
|
buffer->viewport.scale[1] = pipe_surface_height(surface);
|
||||||
|
|
||||||
buffer->fb_state.width = surface->width;
|
buffer->fb_state.width = pipe_surface_width(surface);
|
||||||
buffer->fb_state.height = surface->height;
|
buffer->fb_state.height = pipe_surface_height(surface);
|
||||||
buffer->fb_state.cbufs[0] = surface;
|
buffer->fb_state.cbufs[0] = surface;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -401,8 +401,8 @@ vl_median_filter_render(struct vl_median_filter *filter,
|
||||||
assert(filter && src && dst);
|
assert(filter && src && dst);
|
||||||
|
|
||||||
memset(&viewport, 0, sizeof(viewport));
|
memset(&viewport, 0, sizeof(viewport));
|
||||||
viewport.scale[0] = dst->width;
|
viewport.scale[0] = pipe_surface_width(dst);
|
||||||
viewport.scale[1] = dst->height;
|
viewport.scale[1] = pipe_surface_height(dst);
|
||||||
viewport.scale[2] = 1;
|
viewport.scale[2] = 1;
|
||||||
viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
|
viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
|
||||||
viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
|
viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
|
||||||
|
|
@ -410,8 +410,8 @@ vl_median_filter_render(struct vl_median_filter *filter,
|
||||||
viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
|
viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
|
||||||
|
|
||||||
memset(&fb_state, 0, sizeof(fb_state));
|
memset(&fb_state, 0, sizeof(fb_state));
|
||||||
fb_state.width = dst->width;
|
fb_state.width = pipe_surface_width(dst);
|
||||||
fb_state.height = dst->height;
|
fb_state.height = pipe_surface_height(dst);
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dst;
|
fb_state.cbufs[0] = dst;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -424,8 +424,8 @@ vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
|
||||||
|
|
||||||
pipe_sampler_view_reference(&buffer->src, src);
|
pipe_sampler_view_reference(&buffer->src, src);
|
||||||
|
|
||||||
buffer->viewport.scale[0] = dst->width;
|
buffer->viewport.scale[0] = pipe_surface_width(dst);
|
||||||
buffer->viewport.scale[1] = dst->height;
|
buffer->viewport.scale[1] = pipe_surface_height(dst);
|
||||||
buffer->viewport.scale[2] = 1;
|
buffer->viewport.scale[2] = 1;
|
||||||
buffer->viewport.translate[0] = 0;
|
buffer->viewport.translate[0] = 0;
|
||||||
buffer->viewport.translate[1] = 0;
|
buffer->viewport.translate[1] = 0;
|
||||||
|
|
@ -435,8 +435,8 @@ vl_zscan_init_buffer(struct vl_zscan *zscan, struct vl_zscan_buffer *buffer,
|
||||||
buffer->viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
|
buffer->viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
|
||||||
buffer->viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
|
buffer->viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
|
||||||
|
|
||||||
buffer->fb_state.width = dst->width;
|
buffer->fb_state.width = pipe_surface_width(dst);
|
||||||
buffer->fb_state.height = dst->height;
|
buffer->fb_state.height = pipe_surface_height(dst);
|
||||||
buffer->fb_state.nr_cbufs = 1;
|
buffer->fb_state.nr_cbufs = 1;
|
||||||
pipe_surface_reference(&buffer->fb_state.cbufs[0], dst);
|
pipe_surface_reference(&buffer->fb_state.cbufs[0], dst);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -878,8 +878,6 @@ agx_create_surface(struct pipe_context *ctx, struct pipe_resource *texture,
|
||||||
surface->context = ctx;
|
surface->context = ctx;
|
||||||
surface->format = surf_tmpl->format;
|
surface->format = surf_tmpl->format;
|
||||||
surface->nr_samples = surf_tmpl->nr_samples;
|
surface->nr_samples = surf_tmpl->nr_samples;
|
||||||
surface->width = u_minify(texture->width0, level);
|
|
||||||
surface->height = u_minify(texture->height0, level);
|
|
||||||
surface->texture = texture;
|
surface->texture = texture;
|
||||||
surface->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
surface->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
surface->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
surface->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -2859,8 +2859,6 @@ crocus_create_surface(struct pipe_context *ctx,
|
||||||
pipe_resource_reference(&psurf->texture, tex);
|
pipe_resource_reference(&psurf->texture, tex);
|
||||||
psurf->context = ctx;
|
psurf->context = ctx;
|
||||||
psurf->format = tmpl->format;
|
psurf->format = tmpl->format;
|
||||||
psurf->width = tex->width0;
|
|
||||||
psurf->height = tex->height0;
|
|
||||||
psurf->u.tex.first_layer = tmpl->u.tex.first_layer;
|
psurf->u.tex.first_layer = tmpl->u.tex.first_layer;
|
||||||
psurf->u.tex.last_layer = tmpl->u.tex.last_layer;
|
psurf->u.tex.last_layer = tmpl->u.tex.last_layer;
|
||||||
psurf->u.tex.level = tmpl->u.tex.level;
|
psurf->u.tex.level = tmpl->u.tex.level;
|
||||||
|
|
@ -3000,9 +2998,6 @@ crocus_create_surface(struct pipe_context *ctx,
|
||||||
tile_x_sa /= fmtl->bw;
|
tile_x_sa /= fmtl->bw;
|
||||||
tile_y_sa /= fmtl->bh;
|
tile_y_sa /= fmtl->bh;
|
||||||
|
|
||||||
psurf->width = surf->surf.logical_level0_px.width;
|
|
||||||
psurf->height = surf->surf.logical_level0_px.height;
|
|
||||||
|
|
||||||
return psurf;
|
return psurf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4948,8 +4943,8 @@ emit_null_fb_surface(struct crocus_batch *batch,
|
||||||
layer = 0;
|
layer = 0;
|
||||||
|
|
||||||
if (cso->nr_cbufs == 0 && cso->zsbuf) {
|
if (cso->nr_cbufs == 0 && cso->zsbuf) {
|
||||||
width = cso->zsbuf->width;
|
width = ((struct crocus_surface*)cso->zsbuf)->surf.logical_level0_px.width;
|
||||||
height = cso->zsbuf->height;
|
height = ((struct crocus_surface*)cso->zsbuf)->surf.logical_level0_px.height;
|
||||||
level = cso->zsbuf->u.tex.level;
|
level = cso->zsbuf->u.tex.level;
|
||||||
layer = cso->zsbuf->u.tex.first_layer;
|
layer = cso->zsbuf->u.tex.first_layer;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -509,6 +509,8 @@ resolve_stencil_to_temp(struct d3d12_context *ctx,
|
||||||
pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src_view);
|
pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &src_view);
|
||||||
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_state);
|
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 1, &sampler_state);
|
||||||
util_blitter_custom_shader(ctx->blitter, dst_surf,
|
util_blitter_custom_shader(ctx->blitter, dst_surf,
|
||||||
|
(uint16_t)pipe_surface_width(dst_surf),
|
||||||
|
(uint16_t)pipe_surface_height(dst_surf),
|
||||||
get_stencil_resolve_vs(ctx),
|
get_stencil_resolve_vs(ctx),
|
||||||
get_stencil_resolve_fs(ctx, info->src.box.height == info->dst.box.height));
|
get_stencil_resolve_fs(ctx, info->src.box.height == info->dst.box.height));
|
||||||
util_blitter_restore_textures(ctx->blitter);
|
util_blitter_restore_textures(ctx->blitter);
|
||||||
|
|
|
||||||
|
|
@ -2059,8 +2059,10 @@ d3d12_clear(struct pipe_context *pctx,
|
||||||
for (int i = 0; i < ctx->fb.nr_cbufs; ++i) {
|
for (int i = 0; i < ctx->fb.nr_cbufs; ++i) {
|
||||||
if (buffers & (PIPE_CLEAR_COLOR0 << i)) {
|
if (buffers & (PIPE_CLEAR_COLOR0 << i)) {
|
||||||
struct pipe_surface *psurf = ctx->fb.cbufs[i];
|
struct pipe_surface *psurf = ctx->fb.cbufs[i];
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(psurf, &width, &height);
|
||||||
d3d12_clear_render_target(pctx, psurf, color,
|
d3d12_clear_render_target(pctx, psurf, color,
|
||||||
0, 0, psurf->width, psurf->height,
|
0, 0, width, height,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2068,10 +2070,12 @@ d3d12_clear(struct pipe_context *pctx,
|
||||||
|
|
||||||
if (buffers & PIPE_CLEAR_DEPTHSTENCIL && ctx->fb.zsbuf) {
|
if (buffers & PIPE_CLEAR_DEPTHSTENCIL && ctx->fb.zsbuf) {
|
||||||
struct pipe_surface *psurf = ctx->fb.zsbuf;
|
struct pipe_surface *psurf = ctx->fb.zsbuf;
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(psurf, &width, &height);
|
||||||
d3d12_clear_depth_stencil(pctx, psurf,
|
d3d12_clear_depth_stencil(pctx, psurf,
|
||||||
buffers & PIPE_CLEAR_DEPTHSTENCIL,
|
buffers & PIPE_CLEAR_DEPTHSTENCIL,
|
||||||
depth, stencil,
|
depth, stencil,
|
||||||
0, 0, psurf->width, psurf->height,
|
0, 0, width, height,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -248,8 +248,6 @@ d3d12_create_surface(struct pipe_context *pctx,
|
||||||
pipe_reference_init(&surface->base.reference, 1);
|
pipe_reference_init(&surface->base.reference, 1);
|
||||||
surface->base.context = pctx;
|
surface->base.context = pctx;
|
||||||
surface->base.format = tpl->format;
|
surface->base.format = tpl->format;
|
||||||
surface->base.width = static_cast<uint16_t>(u_minify(pres->width0, tpl->u.tex.level));
|
|
||||||
surface->base.height = static_cast<uint16_t>(u_minify(pres->height0, tpl->u.tex.level));
|
|
||||||
surface->base.u.tex.level = tpl->u.tex.level;
|
surface->base.u.tex.level = tpl->u.tex.level;
|
||||||
surface->base.u.tex.first_layer = tpl->u.tex.first_layer;
|
surface->base.u.tex.first_layer = tpl->u.tex.first_layer;
|
||||||
surface->base.u.tex.last_layer = tpl->u.tex.last_layer;
|
surface->base.u.tex.last_layer = tpl->u.tex.last_layer;
|
||||||
|
|
@ -294,8 +292,8 @@ blit_surface(struct pipe_context *pctx, struct d3d12_surface *surface, bool pre)
|
||||||
info.src.box.x = info.dst.box.x = 0;
|
info.src.box.x = info.dst.box.x = 0;
|
||||||
info.src.box.y = info.dst.box.y = 0;
|
info.src.box.y = info.dst.box.y = 0;
|
||||||
info.src.box.z = info.dst.box.z = 0;
|
info.src.box.z = info.dst.box.z = 0;
|
||||||
info.src.box.width = info.dst.box.width = surface->base.width;
|
info.src.box.width = info.dst.box.width = pipe_surface_width(&surface->base);
|
||||||
info.src.box.height = info.dst.box.height = surface->base.height;
|
info.src.box.height = info.dst.box.height = pipe_surface_height(&surface->base);
|
||||||
info.src.box.depth = info.dst.box.depth = 0;
|
info.src.box.depth = info.dst.box.depth = 0;
|
||||||
info.mask = PIPE_MASK_RGBA;
|
info.mask = PIPE_MASK_RGBA;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,8 +122,6 @@ etna_create_surface(struct pipe_context *pctx, struct pipe_resource *prsc,
|
||||||
}
|
}
|
||||||
|
|
||||||
surf->base.format = templat->format;
|
surf->base.format = templat->format;
|
||||||
surf->base.width = rsc->levels[level].width;
|
|
||||||
surf->base.height = rsc->levels[level].height;
|
|
||||||
surf->base.writable = templat->writable; /* what is this for anyway */
|
surf->base.writable = templat->writable; /* what is this for anyway */
|
||||||
surf->base.u = templat->u;
|
surf->base.u = templat->u;
|
||||||
surf->level = lev;
|
surf->level = lev;
|
||||||
|
|
|
||||||
|
|
@ -219,7 +219,6 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t base,
|
||||||
uint32_t offset =
|
uint32_t offset =
|
||||||
fd_resource_offset(rsc, psurf->u.tex.level, psurf->u.tex.first_layer);
|
fd_resource_offset(rsc, psurf->u.tex.level, psurf->u.tex.first_layer);
|
||||||
enum pipe_format format = fd_gmem_restore_format(psurf->format);
|
enum pipe_format format = fd_gmem_restore_format(psurf->format);
|
||||||
|
|
||||||
OUT_PKT3(ring, CP_SET_CONSTANT, 2);
|
OUT_PKT3(ring, CP_SET_CONSTANT, 2);
|
||||||
OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_INFO));
|
OUT_RING(ring, CP_REG(REG_A2XX_RB_COLOR_INFO));
|
||||||
OUT_RING(ring, A2XX_RB_COLOR_INFO_BASE(base) |
|
OUT_RING(ring, A2XX_RB_COLOR_INFO_BASE(base) |
|
||||||
|
|
@ -237,8 +236,8 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t base,
|
||||||
A2XX_SQ_TEX_1_FORMAT(fd2_pipe2surface(format).format) |
|
A2XX_SQ_TEX_1_FORMAT(fd2_pipe2surface(format).format) |
|
||||||
A2XX_SQ_TEX_1_CLAMP_POLICY(SQ_TEX_CLAMP_POLICY_OGL),
|
A2XX_SQ_TEX_1_CLAMP_POLICY(SQ_TEX_CLAMP_POLICY_OGL),
|
||||||
0);
|
0);
|
||||||
OUT_RING(ring, A2XX_SQ_TEX_2_WIDTH(psurf->width - 1) |
|
OUT_RING(ring, A2XX_SQ_TEX_2_WIDTH(pipe_surface_width(psurf) - 1) |
|
||||||
A2XX_SQ_TEX_2_HEIGHT(psurf->height - 1));
|
A2XX_SQ_TEX_2_HEIGHT(pipe_surface_height(psurf) - 1));
|
||||||
OUT_RING(ring, A2XX_SQ_TEX_3_MIP_FILTER(SQ_TEX_FILTER_BASEMAP) |
|
OUT_RING(ring, A2XX_SQ_TEX_3_MIP_FILTER(SQ_TEX_FILTER_BASEMAP) |
|
||||||
A2XX_SQ_TEX_3_SWIZ_X(0) | A2XX_SQ_TEX_3_SWIZ_Y(1) |
|
A2XX_SQ_TEX_3_SWIZ_X(0) | A2XX_SQ_TEX_3_SWIZ_Y(1) |
|
||||||
A2XX_SQ_TEX_3_SWIZ_Z(2) | A2XX_SQ_TEX_3_SWIZ_W(3) |
|
A2XX_SQ_TEX_3_SWIZ_Z(2) | A2XX_SQ_TEX_3_SWIZ_W(3) |
|
||||||
|
|
|
||||||
|
|
@ -301,6 +301,8 @@ fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring,
|
||||||
|
|
||||||
struct fd_resource *rsc = fd_resource(psurf[i]->texture);
|
struct fd_resource *rsc = fd_resource(psurf[i]->texture);
|
||||||
enum pipe_format format = fd_gmem_restore_format(psurf[i]->format);
|
enum pipe_format format = fd_gmem_restore_format(psurf[i]->format);
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(psurf[i], &width, &height);
|
||||||
/* The restore blit_zs shader expects stencil in sampler 0, and depth
|
/* The restore blit_zs shader expects stencil in sampler 0, and depth
|
||||||
* in sampler 1
|
* in sampler 1
|
||||||
*/
|
*/
|
||||||
|
|
@ -319,8 +321,8 @@ fd3_emit_gmem_restore_tex(struct fd_ringbuffer *ring,
|
||||||
A3XX_TEX_CONST_0_TYPE(A3XX_TEX_2D) |
|
A3XX_TEX_CONST_0_TYPE(A3XX_TEX_2D) |
|
||||||
fd3_tex_swiz(format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y,
|
fd3_tex_swiz(format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y,
|
||||||
PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W));
|
PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W));
|
||||||
OUT_RING(ring, A3XX_TEX_CONST_1_WIDTH(psurf[i]->width) |
|
OUT_RING(ring, A3XX_TEX_CONST_1_WIDTH(width) |
|
||||||
A3XX_TEX_CONST_1_HEIGHT(psurf[i]->height));
|
A3XX_TEX_CONST_1_HEIGHT(height));
|
||||||
OUT_RING(ring, A3XX_TEX_CONST_2_PITCH(fd_resource_pitch(rsc, lvl)) |
|
OUT_RING(ring, A3XX_TEX_CONST_2_PITCH(fd_resource_pitch(rsc, lvl)) |
|
||||||
A3XX_TEX_CONST_2_INDX(BASETABLE_SZ * i));
|
A3XX_TEX_CONST_2_INDX(BASETABLE_SZ * i));
|
||||||
OUT_RING(ring, 0x00000000);
|
OUT_RING(ring, 0x00000000);
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,8 @@ fd4_emit_gmem_restore_tex(struct fd_ringbuffer *ring, unsigned nr_bufs,
|
||||||
if (bufs[i]) {
|
if (bufs[i]) {
|
||||||
struct fd_resource *rsc = fd_resource(bufs[i]->texture);
|
struct fd_resource *rsc = fd_resource(bufs[i]->texture);
|
||||||
enum pipe_format format = fd_gmem_restore_format(bufs[i]->format);
|
enum pipe_format format = fd_gmem_restore_format(bufs[i]->format);
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(bufs[i], &width, &height);
|
||||||
/* The restore blit_zs shader expects stencil in sampler 0,
|
/* The restore blit_zs shader expects stencil in sampler 0,
|
||||||
* and depth in sampler 1
|
* and depth in sampler 1
|
||||||
*/
|
*/
|
||||||
|
|
@ -416,8 +417,8 @@ fd4_emit_gmem_restore_tex(struct fd_ringbuffer *ring, unsigned nr_bufs,
|
||||||
A4XX_TEX_CONST_0_TYPE(A4XX_TEX_2D) |
|
A4XX_TEX_CONST_0_TYPE(A4XX_TEX_2D) |
|
||||||
fd4_tex_swiz(format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y,
|
fd4_tex_swiz(format, PIPE_SWIZZLE_X, PIPE_SWIZZLE_Y,
|
||||||
PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W));
|
PIPE_SWIZZLE_Z, PIPE_SWIZZLE_W));
|
||||||
OUT_RING(ring, A4XX_TEX_CONST_1_WIDTH(bufs[i]->width) |
|
OUT_RING(ring, A4XX_TEX_CONST_1_WIDTH(width) |
|
||||||
A4XX_TEX_CONST_1_HEIGHT(bufs[i]->height));
|
A4XX_TEX_CONST_1_HEIGHT(height));
|
||||||
OUT_RING(ring, A4XX_TEX_CONST_2_PITCH(fd_resource_pitch(rsc, lvl)));
|
OUT_RING(ring, A4XX_TEX_CONST_2_PITCH(fd_resource_pitch(rsc, lvl)));
|
||||||
OUT_RING(ring, 0x00000000);
|
OUT_RING(ring, 0x00000000);
|
||||||
OUT_RELOC(ring, rsc->bo, offset, 0, 0);
|
OUT_RELOC(ring, rsc->bo, offset, 0, 0);
|
||||||
|
|
|
||||||
|
|
@ -1117,17 +1117,19 @@ fd6_resolve_tile(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
||||||
uint64_t gmem_base = batch->ctx->screen->gmem_base + base;
|
uint64_t gmem_base = batch->ctx->screen->gmem_base + base;
|
||||||
uint32_t gmem_pitch = gmem->bin_w * batch->framebuffer.samples *
|
uint32_t gmem_pitch = gmem->bin_w * batch->framebuffer.samples *
|
||||||
util_format_get_blocksize(psurf->format);
|
util_format_get_blocksize(psurf->format);
|
||||||
|
unsigned width = pipe_surface_width(psurf);
|
||||||
|
unsigned height = pipe_surface_height(psurf);
|
||||||
|
|
||||||
OUT_PKT4(ring, REG_A6XX_GRAS_2D_DST_TL, 2);
|
OUT_PKT4(ring, REG_A6XX_GRAS_2D_DST_TL, 2);
|
||||||
OUT_RING(ring, A6XX_GRAS_2D_DST_TL_X(0) | A6XX_GRAS_2D_DST_TL_Y(0));
|
OUT_RING(ring, A6XX_GRAS_2D_DST_TL_X(0) | A6XX_GRAS_2D_DST_TL_Y(0));
|
||||||
OUT_RING(ring, A6XX_GRAS_2D_DST_BR_X(psurf->width - 1) |
|
OUT_RING(ring, A6XX_GRAS_2D_DST_BR_X(width - 1) |
|
||||||
A6XX_GRAS_2D_DST_BR_Y(psurf->height - 1));
|
A6XX_GRAS_2D_DST_BR_Y(height - 1));
|
||||||
|
|
||||||
OUT_REG(ring,
|
OUT_REG(ring,
|
||||||
A6XX_GRAS_2D_SRC_TL_X(0),
|
A6XX_GRAS_2D_SRC_TL_X(0),
|
||||||
A6XX_GRAS_2D_SRC_BR_X(psurf->width - 1),
|
A6XX_GRAS_2D_SRC_BR_X(width - 1),
|
||||||
A6XX_GRAS_2D_SRC_TL_Y(0),
|
A6XX_GRAS_2D_SRC_TL_Y(0),
|
||||||
A6XX_GRAS_2D_SRC_BR_Y(psurf->height - 1),
|
A6XX_GRAS_2D_SRC_BR_Y(height - 1),
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Enable scissor bit, which will take into account the window scissor
|
/* Enable scissor bit, which will take into account the window scissor
|
||||||
|
|
@ -1158,8 +1160,8 @@ fd6_resolve_tile(struct fd_batch *batch, struct fd_ringbuffer *ring,
|
||||||
),
|
),
|
||||||
SP_PS_2D_SRC_SIZE(
|
SP_PS_2D_SRC_SIZE(
|
||||||
CHIP,
|
CHIP,
|
||||||
.width = psurf->width,
|
.width = width,
|
||||||
.height = psurf->height,
|
.height = height,
|
||||||
),
|
),
|
||||||
SP_PS_2D_SRC(
|
SP_PS_2D_SRC(
|
||||||
CHIP,
|
CHIP,
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,6 @@ fd_create_surface(struct pipe_context *pctx, struct pipe_resource *ptex,
|
||||||
|
|
||||||
psurf->context = pctx;
|
psurf->context = pctx;
|
||||||
psurf->format = surf_tmpl->format;
|
psurf->format = surf_tmpl->format;
|
||||||
psurf->width = u_minify(ptex->width0, level);
|
|
||||||
psurf->height = u_minify(ptex->height0, level);
|
|
||||||
psurf->nr_samples = surf_tmpl->nr_samples;
|
psurf->nr_samples = surf_tmpl->nr_samples;
|
||||||
|
|
||||||
if (ptex->target == PIPE_BUFFER) {
|
if (ptex->target == PIPE_BUFFER) {
|
||||||
|
|
|
||||||
|
|
@ -231,16 +231,20 @@ i915_clear_blitter(struct pipe_context *pipe, unsigned buffers,
|
||||||
struct pipe_surface *ps = framebuffer->cbufs[i];
|
struct pipe_surface *ps = framebuffer->cbufs[i];
|
||||||
|
|
||||||
if (ps) {
|
if (ps) {
|
||||||
pipe->clear_render_target(pipe, ps, color, 0, 0, ps->width,
|
uint16_t width, height;
|
||||||
ps->height, true);
|
pipe_surface_size(ps, &width, &height);
|
||||||
|
pipe->clear_render_target(pipe, ps, color, 0, 0, width,
|
||||||
|
height, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
|
if (buffers & PIPE_CLEAR_DEPTHSTENCIL) {
|
||||||
struct pipe_surface *ps = framebuffer->zsbuf;
|
struct pipe_surface *ps = framebuffer->zsbuf;
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(ps, &width, &height);
|
||||||
pipe->clear_depth_stencil(pipe, ps, buffers & PIPE_CLEAR_DEPTHSTENCIL,
|
pipe->clear_depth_stencil(pipe, ps, buffers & PIPE_CLEAR_DEPTHSTENCIL,
|
||||||
depth, stencil, 0, 0, ps->width, ps->height,
|
depth, stencil, 0, 0, width, height,
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,8 @@ i915_clear_render_target_render(struct pipe_context *pipe,
|
||||||
|
|
||||||
util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);
|
util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);
|
||||||
|
|
||||||
fb_state.width = dst->width;
|
fb_state.width = width;
|
||||||
fb_state.height = dst->height;
|
fb_state.height = height;
|
||||||
fb_state.nr_cbufs = 1;
|
fb_state.nr_cbufs = 1;
|
||||||
fb_state.cbufs[0] = dst;
|
fb_state.cbufs[0] = dst;
|
||||||
fb_state.zsbuf = NULL;
|
fb_state.zsbuf = NULL;
|
||||||
|
|
@ -170,8 +170,8 @@ i915_clear_depth_stencil_render(struct pipe_context *pipe,
|
||||||
|
|
||||||
util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);
|
util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);
|
||||||
|
|
||||||
fb_state.width = dst->width;
|
fb_state.width = width;
|
||||||
fb_state.height = dst->height;
|
fb_state.height = height;
|
||||||
fb_state.nr_cbufs = 0;
|
fb_state.nr_cbufs = 0;
|
||||||
fb_state.zsbuf = dst;
|
fb_state.zsbuf = dst;
|
||||||
pipe->set_framebuffer_state(pipe, &fb_state);
|
pipe->set_framebuffer_state(pipe, &fb_state);
|
||||||
|
|
@ -404,8 +404,6 @@ i915_create_surface_custom(struct pipe_context *ctx, struct pipe_resource *pt,
|
||||||
pipe_reference_init(&ps->reference, 1);
|
pipe_reference_init(&ps->reference, 1);
|
||||||
pipe_resource_reference(&ps->texture, pt);
|
pipe_resource_reference(&ps->texture, pt);
|
||||||
ps->format = surf_tmpl->format;
|
ps->format = surf_tmpl->format;
|
||||||
ps->width = u_minify(width0, surf_tmpl->u.tex.level);
|
|
||||||
ps->height = u_minify(height0, surf_tmpl->u.tex.level);
|
|
||||||
ps->u.tex.level = surf_tmpl->u.tex.level;
|
ps->u.tex.level = surf_tmpl->u.tex.level;
|
||||||
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -3273,8 +3273,6 @@ iris_create_surface(struct pipe_context *ctx,
|
||||||
pipe_resource_reference(&psurf->texture, tex);
|
pipe_resource_reference(&psurf->texture, tex);
|
||||||
psurf->context = ctx;
|
psurf->context = ctx;
|
||||||
psurf->format = tmpl->format;
|
psurf->format = tmpl->format;
|
||||||
psurf->width = isl_surf.logical_level0_px.width;
|
|
||||||
psurf->height = isl_surf.logical_level0_px.height;
|
|
||||||
psurf->texture = tex;
|
psurf->texture = tex;
|
||||||
psurf->u.tex.first_layer = tmpl->u.tex.first_layer;
|
psurf->u.tex.first_layer = tmpl->u.tex.first_layer;
|
||||||
psurf->u.tex.last_layer = tmpl->u.tex.last_layer;
|
psurf->u.tex.last_layer = tmpl->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -75,13 +75,14 @@ lima_pack_blit_cmd(struct lima_job *job,
|
||||||
|
|
||||||
reload_render_state.multi_sample |= (sample_mask << 12);
|
reload_render_state.multi_sample |= (sample_mask << 12);
|
||||||
|
|
||||||
|
uint16_t width, height;
|
||||||
if (job->key.cbuf) {
|
if (job->key.cbuf) {
|
||||||
fb_width = job->key.cbuf->width;
|
pipe_surface_size(job->key.cbuf, &width, &height);
|
||||||
fb_height = job->key.cbuf->height;
|
|
||||||
} else {
|
} else {
|
||||||
fb_width = job->key.zsbuf->width;
|
pipe_surface_size(job->key.zsbuf, &width, &height);
|
||||||
fb_height = job->key.zsbuf->height;
|
|
||||||
}
|
}
|
||||||
|
fb_width = width;
|
||||||
|
fb_height = height;
|
||||||
|
|
||||||
if (util_format_is_depth_or_stencil(psurf->format)) {
|
if (util_format_is_depth_or_stencil(psurf->format)) {
|
||||||
reload_render_state.alpha_blend &= 0x0fffffff;
|
reload_render_state.alpha_blend &= 0x0fffffff;
|
||||||
|
|
@ -295,10 +296,9 @@ lima_do_blit(struct pipe_context *pctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool tile_aligned = false;
|
bool tile_aligned = false;
|
||||||
|
|
||||||
if (info->dst.box.x == 0 && info->dst.box.y == 0 &&
|
if (info->dst.box.x == 0 && info->dst.box.y == 0 &&
|
||||||
info->dst.box.width == lima_dst_surf->base.width &&
|
info->dst.box.width == pipe_surface_width(&lima_dst_surf->base) &&
|
||||||
info->dst.box.height == lima_dst_surf->base.height)
|
info->dst.box.height == pipe_surface_height(&lima_dst_surf->base))
|
||||||
tile_aligned = true;
|
tile_aligned = true;
|
||||||
|
|
||||||
if (info->dst.box.x % 16 == 0 && info->dst.box.y % 16 == 0 &&
|
if (info->dst.box.x % 16 == 0 && info->dst.box.y % 16 == 0 &&
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,10 @@ lima_get_fb_info(struct lima_job *job)
|
||||||
fb->width = ctx->framebuffer.base.width;
|
fb->width = ctx->framebuffer.base.width;
|
||||||
fb->height = ctx->framebuffer.base.height;
|
fb->height = ctx->framebuffer.base.height;
|
||||||
} else {
|
} else {
|
||||||
fb->width = surf->base.width;
|
uint16_t width, height;
|
||||||
fb->height = surf->base.height;
|
pipe_surface_size(&surf->base, &width, &height);
|
||||||
|
fb->width = width;
|
||||||
|
fb->height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
int width = align(fb->width, 16) >> 4;
|
int width = align(fb->width, 16) >> 4;
|
||||||
|
|
|
||||||
|
|
@ -580,15 +580,13 @@ lima_surface_create(struct pipe_context *pctx,
|
||||||
|
|
||||||
psurf->context = pctx;
|
psurf->context = pctx;
|
||||||
psurf->format = surf_tmpl->format;
|
psurf->format = surf_tmpl->format;
|
||||||
psurf->width = u_minify(pres->width0, level);
|
|
||||||
psurf->height = u_minify(pres->height0, level);
|
|
||||||
psurf->nr_samples = surf_tmpl->nr_samples;
|
psurf->nr_samples = surf_tmpl->nr_samples;
|
||||||
psurf->u.tex.level = level;
|
psurf->u.tex.level = level;
|
||||||
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
||||||
surf->tiled_w = align(psurf->width, 16) >> 4;
|
surf->tiled_w = align(u_minify(pres->width0, level), 16) >> 4;
|
||||||
surf->tiled_h = align(psurf->height, 16) >> 4;
|
surf->tiled_h = align(u_minify(pres->height0, level), 16) >> 4;
|
||||||
|
|
||||||
surf->reload = 0;
|
surf->reload = 0;
|
||||||
if (util_format_has_stencil(util_format_description(psurf->format)))
|
if (util_format_has_stencil(util_format_description(psurf->format)))
|
||||||
|
|
|
||||||
|
|
@ -226,18 +226,10 @@ llvmpipe_create_surface(struct pipe_context *pipe,
|
||||||
if (llvmpipe_resource_is_texture(pt)) {
|
if (llvmpipe_resource_is_texture(pt)) {
|
||||||
assert(surf_tmpl->u.tex.level <= pt->last_level);
|
assert(surf_tmpl->u.tex.level <= pt->last_level);
|
||||||
assert(surf_tmpl->u.tex.first_layer <= surf_tmpl->u.tex.last_layer);
|
assert(surf_tmpl->u.tex.first_layer <= surf_tmpl->u.tex.last_layer);
|
||||||
ps->width = u_minify(pt->width0, surf_tmpl->u.tex.level);
|
|
||||||
ps->height = u_minify(pt->height0, surf_tmpl->u.tex.level);
|
|
||||||
ps->u.tex.level = surf_tmpl->u.tex.level;
|
ps->u.tex.level = surf_tmpl->u.tex.level;
|
||||||
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
} else {
|
} else {
|
||||||
/* setting width as number of elements should get us correct
|
|
||||||
* renderbuffer width
|
|
||||||
*/
|
|
||||||
ps->width = surf_tmpl->u.buf.last_element
|
|
||||||
- surf_tmpl->u.buf.first_element + 1;
|
|
||||||
ps->height = pt->height0;
|
|
||||||
ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
|
ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
|
||||||
ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
|
ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
|
||||||
assert(ps->u.buf.first_element <= ps->u.buf.last_element);
|
assert(ps->u.buf.first_element <= ps->u.buf.last_element);
|
||||||
|
|
|
||||||
|
|
@ -573,9 +573,6 @@ nv30_miptree_surface_new(struct pipe_context *pipe,
|
||||||
else
|
else
|
||||||
ns->pitch = lvl->pitch;
|
ns->pitch = lvl->pitch;
|
||||||
|
|
||||||
/* comment says there are going to be removed, but they're used by the st */
|
|
||||||
ps->width = ns->width;
|
|
||||||
ps->height = ns->height;
|
|
||||||
return ps;
|
return ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -486,10 +486,6 @@ nv50_surface_from_miptree(struct nv50_miptree *mt,
|
||||||
ns->depth = ps->u.tex.last_layer - ps->u.tex.first_layer + 1;
|
ns->depth = ps->u.tex.last_layer - ps->u.tex.first_layer + 1;
|
||||||
ns->offset = mt->level[templ->u.tex.level].offset;
|
ns->offset = mt->level[templ->u.tex.level].offset;
|
||||||
|
|
||||||
/* comment says there are going to be removed, but they're used by the st */
|
|
||||||
ps->width = ns->width;
|
|
||||||
ps->height = ns->height;
|
|
||||||
|
|
||||||
ns->width <<= mt->ms_x;
|
ns->width <<= mt->ms_x;
|
||||||
ns->height <<= mt->ms_y;
|
ns->height <<= mt->ms_y;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,6 @@ nv50_surface_from_buffer(struct pipe_context *pipe,
|
||||||
sf->height = 1;
|
sf->height = 1;
|
||||||
sf->depth = 1;
|
sf->depth = 1;
|
||||||
|
|
||||||
sf->base.width = sf->width;
|
|
||||||
sf->base.height = sf->height;
|
|
||||||
|
|
||||||
sf->base.context = pipe;
|
sf->base.context = pipe;
|
||||||
return &sf->base;
|
return &sf->base;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1111,8 +1111,7 @@ nv50_blit_set_dst(struct nv50_blitctx *ctx,
|
||||||
nv50->framebuffer.cbufs[0] = nv50_miptree_surface_new(pipe, res, &templ);
|
nv50->framebuffer.cbufs[0] = nv50_miptree_surface_new(pipe, res, &templ);
|
||||||
nv50->framebuffer.nr_cbufs = 1;
|
nv50->framebuffer.nr_cbufs = 1;
|
||||||
nv50->framebuffer.zsbuf = NULL;
|
nv50->framebuffer.zsbuf = NULL;
|
||||||
nv50->framebuffer.width = nv50->framebuffer.cbufs[0]->width;
|
pipe_surface_size(nv50->framebuffer.cbufs[0], &nv50->framebuffer.width, &nv50->framebuffer.height);
|
||||||
nv50->framebuffer.height = nv50->framebuffer.cbufs[0]->height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -980,8 +980,7 @@ nvc0_blit_set_dst(struct nvc0_blitctx *ctx,
|
||||||
nvc0->framebuffer.cbufs[0] = nvc0_miptree_surface_new(pipe, res, &templ);
|
nvc0->framebuffer.cbufs[0] = nvc0_miptree_surface_new(pipe, res, &templ);
|
||||||
nvc0->framebuffer.nr_cbufs = 1;
|
nvc0->framebuffer.nr_cbufs = 1;
|
||||||
nvc0->framebuffer.zsbuf = NULL;
|
nvc0->framebuffer.zsbuf = NULL;
|
||||||
nvc0->framebuffer.width = nvc0->framebuffer.cbufs[0]->width;
|
pipe_surface_size(nvc0->framebuffer.cbufs[0], &nvc0->framebuffer.width, &nvc0->framebuffer.height);
|
||||||
nvc0->framebuffer.height = nvc0->framebuffer.cbufs[0]->height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
|
|
@ -259,22 +259,14 @@ panfrost_create_surface(struct pipe_context *pipe, struct pipe_resource *pt,
|
||||||
|
|
||||||
if (pt->target != PIPE_BUFFER) {
|
if (pt->target != PIPE_BUFFER) {
|
||||||
assert(surf_tmpl->u.tex.level <= pt->last_level);
|
assert(surf_tmpl->u.tex.level <= pt->last_level);
|
||||||
ps->width = u_minify(pt->width0, surf_tmpl->u.tex.level);
|
|
||||||
ps->height = u_minify(pt->height0, surf_tmpl->u.tex.level);
|
|
||||||
ps->nr_samples = surf_tmpl->nr_samples;
|
ps->nr_samples = surf_tmpl->nr_samples;
|
||||||
ps->u.tex.level = surf_tmpl->u.tex.level;
|
ps->u.tex.level = surf_tmpl->u.tex.level;
|
||||||
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
} else {
|
} else {
|
||||||
/* setting width as number of elements should get us correct
|
|
||||||
* renderbuffer width */
|
|
||||||
ps->width =
|
|
||||||
surf_tmpl->u.buf.last_element - surf_tmpl->u.buf.first_element + 1;
|
|
||||||
ps->height = pt->height0;
|
|
||||||
ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
|
ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
|
||||||
ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
|
ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
|
||||||
assert(ps->u.buf.first_element <= ps->u.buf.last_element);
|
assert(ps->u.buf.first_element <= ps->u.buf.last_element);
|
||||||
assert(ps->u.buf.last_element < ps->width);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -491,8 +491,7 @@ void r300_decompress_zmask_locked_unsafe(struct r300_context *r300)
|
||||||
struct pipe_framebuffer_state fb;
|
struct pipe_framebuffer_state fb;
|
||||||
|
|
||||||
memset(&fb, 0, sizeof(fb));
|
memset(&fb, 0, sizeof(fb));
|
||||||
fb.width = r300->locked_zbuffer->width;
|
pipe_surface_size(r300->locked_zbuffer, &fb.width, &fb.height);
|
||||||
fb.height = r300->locked_zbuffer->height;
|
|
||||||
fb.zsbuf = r300->locked_zbuffer;
|
fb.zsbuf = r300->locked_zbuffer;
|
||||||
|
|
||||||
r300->context.set_framebuffer_state(&r300->context, &fb);
|
r300->context.set_framebuffer_state(&r300->context, &fb);
|
||||||
|
|
|
||||||
|
|
@ -829,7 +829,8 @@ static void r300_print_fb_surf_info(struct pipe_surface *surf, unsigned index,
|
||||||
"r300: TEX: Macro: %s, Micro: %s, "
|
"r300: TEX: Macro: %s, Micro: %s, "
|
||||||
"Dim: %ix%ix%i, LastLevel: %i, Format: %s\n",
|
"Dim: %ix%ix%i, LastLevel: %i, Format: %s\n",
|
||||||
|
|
||||||
binding, index, surf->width, surf->height,
|
binding, index, pipe_surface_width(surf),
|
||||||
|
pipe_surface_height(surf),
|
||||||
surf->u.tex.first_layer, surf->u.tex.last_layer, surf->u.tex.level,
|
surf->u.tex.first_layer, surf->u.tex.last_layer, surf->u.tex.level,
|
||||||
util_format_short_name(surf->format),
|
util_format_short_name(surf->format),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1180,8 +1180,6 @@ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,
|
||||||
pipe_resource_reference(&surface->base.texture, texture);
|
pipe_resource_reference(&surface->base.texture, texture);
|
||||||
surface->base.context = ctx;
|
surface->base.context = ctx;
|
||||||
surface->base.format = surf_tmpl->format;
|
surface->base.format = surf_tmpl->format;
|
||||||
surface->base.width = u_minify(width0_override, level);
|
|
||||||
surface->base.height = u_minify(height0_override, level);
|
|
||||||
surface->base.u.tex.level = level;
|
surface->base.u.tex.level = level;
|
||||||
surface->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
surface->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
surface->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
@ -1199,7 +1197,7 @@ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,
|
||||||
|
|
||||||
/* Parameters for the CBZB clear. */
|
/* Parameters for the CBZB clear. */
|
||||||
surface->cbzb_allowed = tex->tex.cbzb_allowed[level];
|
surface->cbzb_allowed = tex->tex.cbzb_allowed[level];
|
||||||
surface->cbzb_width = align(surface->base.width, 64);
|
surface->cbzb_width = align(pipe_surface_width(surf_tmpl), 64);
|
||||||
|
|
||||||
/* Height must be aligned to the size of a tile. */
|
/* Height must be aligned to the size of a tile. */
|
||||||
tile_height = r300_get_pixel_alignment(surface->base.format,
|
tile_height = r300_get_pixel_alignment(surface->base.format,
|
||||||
|
|
@ -1209,7 +1207,7 @@ struct pipe_surface* r300_create_surface_custom(struct pipe_context * ctx,
|
||||||
DIM_HEIGHT, 0,
|
DIM_HEIGHT, 0,
|
||||||
tex->b.bind & PIPE_BIND_SCANOUT);
|
tex->b.bind & PIPE_BIND_SCANOUT);
|
||||||
|
|
||||||
surface->cbzb_height = align((surface->base.height + 1) / 2,
|
surface->cbzb_height = align((pipe_surface_height(surf_tmpl) + 1) / 2,
|
||||||
tile_height);
|
tile_height);
|
||||||
|
|
||||||
/* Offset must be aligned to 2K and must point at the beginning
|
/* Offset must be aligned to 2K and must point at the beginning
|
||||||
|
|
|
||||||
|
|
@ -662,7 +662,7 @@ void r600_resource_copy_region(struct pipe_context *ctx,
|
||||||
struct r600_context *rctx = (struct r600_context *)ctx;
|
struct r600_context *rctx = (struct r600_context *)ctx;
|
||||||
struct pipe_surface *dst_view, dst_templ;
|
struct pipe_surface *dst_view, dst_templ;
|
||||||
struct pipe_sampler_view src_templ, *src_view;
|
struct pipe_sampler_view src_templ, *src_view;
|
||||||
unsigned dst_width, dst_height, src_width0, src_height0, src_widthFL, src_heightFL;
|
unsigned src_width0, src_height0, src_widthFL, src_heightFL;
|
||||||
unsigned src_force_level = 0;
|
unsigned src_force_level = 0;
|
||||||
struct pipe_box sbox, dstbox;
|
struct pipe_box sbox, dstbox;
|
||||||
|
|
||||||
|
|
@ -686,8 +686,6 @@ void r600_resource_copy_region(struct pipe_context *ctx,
|
||||||
return; /* error */
|
return; /* error */
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_width = u_minify(dst->width0, dst_level);
|
|
||||||
dst_height = u_minify(dst->height0, dst_level);
|
|
||||||
src_width0 = src->width0;
|
src_width0 = src->width0;
|
||||||
src_height0 = src->height0;
|
src_height0 = src->height0;
|
||||||
src_widthFL = u_minify(src->width0, src_level);
|
src_widthFL = u_minify(src->width0, src_level);
|
||||||
|
|
@ -706,8 +704,6 @@ void r600_resource_copy_region(struct pipe_context *ctx,
|
||||||
src_templ.format = PIPE_FORMAT_R32G32B32A32_UINT; /* 128-bit block */
|
src_templ.format = PIPE_FORMAT_R32G32B32A32_UINT; /* 128-bit block */
|
||||||
dst_templ.format = src_templ.format;
|
dst_templ.format = src_templ.format;
|
||||||
|
|
||||||
dst_width = util_format_get_nblocksx(dst->format, dst_width);
|
|
||||||
dst_height = util_format_get_nblocksy(dst->format, dst_height);
|
|
||||||
src_width0 = util_format_get_nblocksx(src->format, src_width0);
|
src_width0 = util_format_get_nblocksx(src->format, src_width0);
|
||||||
src_height0 = util_format_get_nblocksy(src->format, src_height0);
|
src_height0 = util_format_get_nblocksy(src->format, src_height0);
|
||||||
src_widthFL = util_format_get_nblocksx(src->format, src_widthFL);
|
src_widthFL = util_format_get_nblocksx(src->format, src_widthFL);
|
||||||
|
|
@ -731,7 +727,6 @@ void r600_resource_copy_region(struct pipe_context *ctx,
|
||||||
src_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
|
src_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
|
||||||
dst_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
|
dst_templ.format = PIPE_FORMAT_R8G8B8A8_UINT;
|
||||||
|
|
||||||
dst_width = util_format_get_nblocksx(dst->format, dst_width);
|
|
||||||
src_width0 = util_format_get_nblocksx(src->format, src_width0);
|
src_width0 = util_format_get_nblocksx(src->format, src_width0);
|
||||||
src_widthFL = util_format_get_nblocksx(src->format, src_widthFL);
|
src_widthFL = util_format_get_nblocksx(src->format, src_widthFL);
|
||||||
|
|
||||||
|
|
@ -775,8 +770,7 @@ void r600_resource_copy_region(struct pipe_context *ctx,
|
||||||
|
|
||||||
dst_view = r600_create_surface_custom(ctx, dst, &dst_templ,
|
dst_view = r600_create_surface_custom(ctx, dst, &dst_templ,
|
||||||
/* we don't care about these two for r600g */
|
/* we don't care about these two for r600g */
|
||||||
dst->width0, dst->height0,
|
dst->width0, dst->height0);
|
||||||
dst_width, dst_height);
|
|
||||||
|
|
||||||
if (rctx->b.gfx_level >= EVERGREEN) {
|
if (rctx->b.gfx_level >= EVERGREEN) {
|
||||||
src_view = evergreen_create_sampler_view_custom(ctx, src, &src_templ,
|
src_view = evergreen_create_sampler_view_custom(ctx, src, &src_templ,
|
||||||
|
|
|
||||||
|
|
@ -740,8 +740,7 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
|
||||||
struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
|
struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
|
||||||
struct pipe_resource *texture,
|
struct pipe_resource *texture,
|
||||||
const struct pipe_surface *templ,
|
const struct pipe_surface *templ,
|
||||||
unsigned width0, unsigned height0,
|
unsigned width0, unsigned height0);
|
||||||
unsigned width, unsigned height);
|
|
||||||
unsigned r600_translate_colorswap(enum pipe_format format, bool do_endian_swap);
|
unsigned r600_translate_colorswap(enum pipe_format format, bool do_endian_swap);
|
||||||
void evergreen_do_fast_color_clear(struct r600_common_context *rctx,
|
void evergreen_do_fast_color_clear(struct r600_common_context *rctx,
|
||||||
struct pipe_framebuffer_state *fb,
|
struct pipe_framebuffer_state *fb,
|
||||||
|
|
|
||||||
|
|
@ -1497,8 +1497,7 @@ void r600_texture_transfer_unmap(struct pipe_context *ctx,
|
||||||
struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
|
struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
|
||||||
struct pipe_resource *texture,
|
struct pipe_resource *texture,
|
||||||
const struct pipe_surface *templ,
|
const struct pipe_surface *templ,
|
||||||
unsigned width0, unsigned height0,
|
unsigned width0, unsigned height0)
|
||||||
unsigned width, unsigned height)
|
|
||||||
{
|
{
|
||||||
struct r600_surface *surface = CALLOC_STRUCT(r600_surface);
|
struct r600_surface *surface = CALLOC_STRUCT(r600_surface);
|
||||||
|
|
||||||
|
|
@ -1512,8 +1511,6 @@ struct pipe_surface *r600_create_surface_custom(struct pipe_context *pipe,
|
||||||
pipe_resource_reference(&surface->base.texture, texture);
|
pipe_resource_reference(&surface->base.texture, texture);
|
||||||
surface->base.context = pipe;
|
surface->base.context = pipe;
|
||||||
surface->base.format = templ->format;
|
surface->base.format = templ->format;
|
||||||
surface->base.width = width;
|
|
||||||
surface->base.height = height;
|
|
||||||
surface->base.u = templ->u;
|
surface->base.u = templ->u;
|
||||||
|
|
||||||
surface->width0 = width0;
|
surface->width0 = width0;
|
||||||
|
|
@ -1526,9 +1523,6 @@ static struct pipe_surface *r600_create_surface(struct pipe_context *pipe,
|
||||||
struct pipe_resource *tex,
|
struct pipe_resource *tex,
|
||||||
const struct pipe_surface *templ)
|
const struct pipe_surface *templ)
|
||||||
{
|
{
|
||||||
unsigned level = templ->u.tex.level;
|
|
||||||
unsigned width = u_minify(tex->width0, level);
|
|
||||||
unsigned height = u_minify(tex->height0, level);
|
|
||||||
unsigned width0 = tex->width0;
|
unsigned width0 = tex->width0;
|
||||||
unsigned height0 = tex->height0;
|
unsigned height0 = tex->height0;
|
||||||
|
|
||||||
|
|
@ -1544,20 +1538,13 @@ static struct pipe_surface *r600_create_surface(struct pipe_context *pipe,
|
||||||
* height is changed. */
|
* height is changed. */
|
||||||
if (tex_desc->block.width != templ_desc->block.width ||
|
if (tex_desc->block.width != templ_desc->block.width ||
|
||||||
tex_desc->block.height != templ_desc->block.height) {
|
tex_desc->block.height != templ_desc->block.height) {
|
||||||
unsigned nblks_x = util_format_get_nblocksx(tex->format, width);
|
|
||||||
unsigned nblks_y = util_format_get_nblocksy(tex->format, height);
|
|
||||||
|
|
||||||
width = nblks_x * templ_desc->block.width;
|
|
||||||
height = nblks_y * templ_desc->block.height;
|
|
||||||
|
|
||||||
width0 = util_format_get_nblocksx(tex->format, width0);
|
width0 = util_format_get_nblocksx(tex->format, width0);
|
||||||
height0 = util_format_get_nblocksy(tex->format, height0);
|
height0 = util_format_get_nblocksy(tex->format, height0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return r600_create_surface_custom(pipe, tex, templ,
|
return r600_create_surface_custom(pipe, tex, templ,
|
||||||
width0, height0,
|
width0, height0);
|
||||||
width, height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void r600_surface_destroy(struct pipe_context *pipe,
|
static void r600_surface_destroy(struct pipe_context *pipe,
|
||||||
|
|
|
||||||
|
|
@ -1076,12 +1076,14 @@ static void si_fb_clear_via_compute(struct si_context *sctx, unsigned *buffers,
|
||||||
if (vi_dcc_enabled(tex, surf->u.tex.level))
|
if (vi_dcc_enabled(tex, surf->u.tex.level))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(surf, &width, &height);
|
||||||
/* Clears of thick and linear layouts are fastest with compute. */
|
/* Clears of thick and linear layouts are fastest with compute. */
|
||||||
if (tex->surface.thick_tiling ||
|
if (tex->surface.thick_tiling ||
|
||||||
(tex->surface.is_linear && (surf->height > 1 || depth > 1 || surf->width >= 8192))) {
|
(tex->surface.is_linear && (height > 1 || depth > 1 || width >= 8192))) {
|
||||||
struct pipe_box box;
|
struct pipe_box box;
|
||||||
|
|
||||||
u_box_3d(0, 0, surf->u.tex.first_layer, surf->width, surf->height, depth, &box);
|
u_box_3d(0, 0, surf->u.tex.first_layer, width, height, depth, &box);
|
||||||
|
|
||||||
if (si_compute_clear_image(sctx, &tex->buffer.b.b, surf->format, surf->u.tex.level, &box,
|
if (si_compute_clear_image(sctx, &tex->buffer.b.b, surf->format, surf->u.tex.level, &box,
|
||||||
color, sctx->render_cond_enabled, true))
|
color, sctx->render_cond_enabled, true))
|
||||||
|
|
@ -1257,10 +1259,12 @@ static bool si_try_normal_clear(struct si_context *sctx, struct pipe_surface *ds
|
||||||
const union pipe_color_union *color,
|
const union pipe_color_union *color,
|
||||||
float depth, unsigned stencil)
|
float depth, unsigned stencil)
|
||||||
{
|
{
|
||||||
|
uint16_t surf_width, surf_height;
|
||||||
|
pipe_surface_size(dst, &surf_width, &surf_height);
|
||||||
/* This is worth it only if it's a whole image clear. */
|
/* This is worth it only if it's a whole image clear. */
|
||||||
if (dstx == 0 && dsty == 0 &&
|
if (dstx == 0 && dsty == 0 &&
|
||||||
width == dst->width &&
|
width == surf_width &&
|
||||||
height == dst->height &&
|
height == surf_height &&
|
||||||
dst->u.tex.first_layer == 0 &&
|
dst->u.tex.first_layer == 0 &&
|
||||||
dst->u.tex.last_layer == util_max_layer(dst->texture, dst->u.tex.level) &&
|
dst->u.tex.last_layer == util_max_layer(dst->texture, dst->u.tex.level) &&
|
||||||
/* pipe->clear honors render_condition, so only use it if it's unset or if it's set and enabled. */
|
/* pipe->clear honors render_condition, so only use it if it's unset or if it's set and enabled. */
|
||||||
|
|
@ -1278,8 +1282,8 @@ static bool si_try_normal_clear(struct si_context *sctx, struct pipe_surface *ds
|
||||||
fb.zsbuf = dst;
|
fb.zsbuf = dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
fb.width = dst->width;
|
fb.width = surf_width;
|
||||||
fb.height = dst->height;
|
fb.height = surf_height;
|
||||||
|
|
||||||
ctx->set_framebuffer_state(ctx, &fb);
|
ctx->set_framebuffer_state(ctx, &fb);
|
||||||
ctx->clear(ctx, buffers, NULL, color, depth, stencil);
|
ctx->clear(ctx, buffers, NULL, color, depth, stencil);
|
||||||
|
|
|
||||||
|
|
@ -2300,8 +2300,6 @@ static struct pipe_surface *si_create_surface(struct pipe_context *pipe, struct
|
||||||
pipe_resource_reference(&surface->base.texture, tex);
|
pipe_resource_reference(&surface->base.texture, tex);
|
||||||
surface->base.context = pipe;
|
surface->base.context = pipe;
|
||||||
surface->base.format = templ->format;
|
surface->base.format = templ->format;
|
||||||
surface->base.width = width;
|
|
||||||
surface->base.height = height;
|
|
||||||
surface->base.u = templ->u;
|
surface->base.u = templ->u;
|
||||||
|
|
||||||
surface->width0 = width0;
|
surface->width0 = width0;
|
||||||
|
|
|
||||||
|
|
@ -546,21 +546,24 @@ si_vpe_set_plane_info(struct vpe_video_processor *vpeproc,
|
||||||
return VPE_STATUS_NOT_SUPPORTED;
|
return VPE_STATUS_NOT_SUPPORTED;
|
||||||
|
|
||||||
/* 1st plane ret setting */
|
/* 1st plane ret setting */
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(surfaces[0], &width, &height);
|
||||||
plane_size->surface_size.x = 0;
|
plane_size->surface_size.x = 0;
|
||||||
plane_size->surface_size.y = 0;
|
plane_size->surface_size.y = 0;
|
||||||
plane_size->surface_size.width = surfaces[0]->width;
|
plane_size->surface_size.width = width;
|
||||||
plane_size->surface_size.height = surfaces[0]->height;
|
plane_size->surface_size.height = height;
|
||||||
plane_size->surface_pitch = si_tex_0->surface.u.gfx9.surf_pitch;
|
plane_size->surface_pitch = si_tex_0->surface.u.gfx9.surf_pitch;
|
||||||
plane_size->surface_aligned_height = surfaces[0]->height;
|
plane_size->surface_aligned_height = height;
|
||||||
|
|
||||||
/* YUV 2nd plane ret setting */
|
/* YUV 2nd plane ret setting */
|
||||||
if (util_format_get_num_planes(format) == 2) {
|
if (util_format_get_num_planes(format) == 2) {
|
||||||
|
pipe_surface_size(surfaces[1], &width, &height);
|
||||||
plane_size->chroma_size.x = 0;
|
plane_size->chroma_size.x = 0;
|
||||||
plane_size->chroma_size.y = 0;
|
plane_size->chroma_size.y = 0;
|
||||||
plane_size->chroma_size.width = surfaces[1]->width;
|
plane_size->chroma_size.width = width;
|
||||||
plane_size->chroma_size.height = surfaces[1]->height;
|
plane_size->chroma_size.height = height;
|
||||||
plane_size->chroma_pitch = si_tex_1->surface.u.gfx9.surf_pitch;
|
plane_size->chroma_pitch = si_tex_1->surface.u.gfx9.surf_pitch;
|
||||||
plane_size->chrome_aligned_height = surfaces[1]->height;
|
plane_size->chrome_aligned_height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Color space setting */
|
/* Color space setting */
|
||||||
|
|
@ -687,8 +690,8 @@ si_vpe_set_stream_out_param(struct vpe_video_processor *vpeproc,
|
||||||
if (process_properties->background_color) {
|
if (process_properties->background_color) {
|
||||||
build_param->target_rect.x = 0;
|
build_param->target_rect.x = 0;
|
||||||
build_param->target_rect.y = 0;
|
build_param->target_rect.y = 0;
|
||||||
build_param->target_rect.width = vpeproc->dst_surfaces[0]->width;
|
build_param->target_rect.width = pipe_surface_width(vpeproc->dst_surfaces[0]);
|
||||||
build_param->target_rect.height = vpeproc->dst_surfaces[0]->height;
|
build_param->target_rect.height = pipe_surface_height(vpeproc->dst_surfaces[0]);
|
||||||
} else {
|
} else {
|
||||||
build_param->target_rect.x = process_properties->dst_region.x0;
|
build_param->target_rect.x = process_properties->dst_region.x0;
|
||||||
build_param->target_rect.y = process_properties->dst_region.y0;
|
build_param->target_rect.y = process_properties->dst_region.y0;
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,8 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers,
|
||||||
zs_buffers != PIPE_CLEAR_DEPTHSTENCIL) {
|
zs_buffers != PIPE_CLEAR_DEPTHSTENCIL) {
|
||||||
/* Clearing only depth or stencil in a combined depth-stencil buffer. */
|
/* Clearing only depth or stencil in a combined depth-stencil buffer. */
|
||||||
util_clear_depth_stencil(pipe, zsbuf, zs_buffers, depth, stencil,
|
util_clear_depth_stencil(pipe, zsbuf, zs_buffers, depth, stencil,
|
||||||
0, 0, zsbuf->width, zsbuf->height);
|
0, 0, pipe_surface_width(zsbuf),
|
||||||
|
pipe_surface_height(zsbuf));
|
||||||
}
|
}
|
||||||
else if (zs_buffers) {
|
else if (zs_buffers) {
|
||||||
static const union pipe_color_union zero;
|
static const union pipe_color_union zero;
|
||||||
|
|
|
||||||
|
|
@ -302,8 +302,6 @@ softpipe_create_surface(struct pipe_context *pipe,
|
||||||
ps->format = surf_tmpl->format;
|
ps->format = surf_tmpl->format;
|
||||||
if (pt->target != PIPE_BUFFER) {
|
if (pt->target != PIPE_BUFFER) {
|
||||||
assert(surf_tmpl->u.tex.level <= pt->last_level);
|
assert(surf_tmpl->u.tex.level <= pt->last_level);
|
||||||
ps->width = u_minify(pt->width0, surf_tmpl->u.tex.level);
|
|
||||||
ps->height = u_minify(pt->height0, surf_tmpl->u.tex.level);
|
|
||||||
ps->u.tex.level = surf_tmpl->u.tex.level;
|
ps->u.tex.level = surf_tmpl->u.tex.level;
|
||||||
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
ps->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
ps->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
@ -312,13 +310,9 @@ softpipe_create_surface(struct pipe_context *pipe,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* setting width as number of elements should get us correct renderbuffer width */
|
|
||||||
ps->width = surf_tmpl->u.buf.last_element - surf_tmpl->u.buf.first_element + 1;
|
|
||||||
ps->height = pt->height0;
|
|
||||||
ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
|
ps->u.buf.first_element = surf_tmpl->u.buf.first_element;
|
||||||
ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
|
ps->u.buf.last_element = surf_tmpl->u.buf.last_element;
|
||||||
assert(ps->u.buf.first_element <= ps->u.buf.last_element);
|
assert(ps->u.buf.first_element <= ps->u.buf.last_element);
|
||||||
assert(ps->u.buf.last_element < ps->width);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ps;
|
return ps;
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,9 @@ sp_tile_cache_set_surface(struct softpipe_tile_cache *tc,
|
||||||
ps->u.tex.level, ps->u.tex.first_layer + i,
|
ps->u.tex.level, ps->u.tex.first_layer + i,
|
||||||
PIPE_MAP_READ_WRITE |
|
PIPE_MAP_READ_WRITE |
|
||||||
PIPE_MAP_UNSYNCHRONIZED,
|
PIPE_MAP_UNSYNCHRONIZED,
|
||||||
0, 0, ps->width, ps->height,
|
0, 0,
|
||||||
|
pipe_surface_width(ps),
|
||||||
|
pipe_surface_height(ps),
|
||||||
&tc->transfer[i]);
|
&tc->transfer[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,9 +143,8 @@ try_clear(struct svga_context *svga,
|
||||||
|
|
||||||
if (buffers & PIPE_CLEAR_STENCIL)
|
if (buffers & PIPE_CLEAR_STENCIL)
|
||||||
flags |= SVGA3D_CLEAR_STENCIL;
|
flags |= SVGA3D_CLEAR_STENCIL;
|
||||||
|
rect.w = MAX2(rect.w, pipe_surface_width(fb->zsbuf));
|
||||||
rect.w = MAX2(rect.w, fb->zsbuf->width);
|
rect.h = MAX2(rect.h, pipe_surface_height(fb->zsbuf));
|
||||||
rect.h = MAX2(rect.h, fb->zsbuf->height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!svga_have_vgpu10(svga) &&
|
if (!svga_have_vgpu10(svga) &&
|
||||||
|
|
@ -321,8 +320,9 @@ svga_clear_texture(struct pipe_context *pipe,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (box->x == 0 && box->y == 0 && box->width == surface->width &&
|
|
||||||
box->height == surface->height) {
|
if (box->x == 0 && box->y == 0 && box->width == pipe_surface_width(surface) &&
|
||||||
|
box->height == pipe_surface_height(surface)) {
|
||||||
/* clearing whole surface, use direct VGPU10 command */
|
/* clearing whole surface, use direct VGPU10 command */
|
||||||
assert(svga_surface(dsv)->view_id != SVGA3D_INVALID_ID);
|
assert(svga_surface(dsv)->view_id != SVGA3D_INVALID_ID);
|
||||||
|
|
||||||
|
|
@ -363,8 +363,8 @@ svga_clear_texture(struct pipe_context *pipe,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (box->x == 0 && box->y == 0 && box->width == surface->width &&
|
if (box->x == 0 && box->y == 0 && box->width == pipe_surface_width(surface) &&
|
||||||
box->height == surface->height) {
|
box->height == pipe_surface_height(surface)) {
|
||||||
struct pipe_framebuffer_state *curr = &svga->curr.framebuffer;
|
struct pipe_framebuffer_state *curr = &svga->curr.framebuffer;
|
||||||
bool int_target = is_integer_target(curr, PIPE_CLEAR_COLOR);
|
bool int_target = is_integer_target(curr, PIPE_CLEAR_COLOR);
|
||||||
|
|
||||||
|
|
@ -509,16 +509,16 @@ svga_clear_render_target(struct pipe_context *pipe,
|
||||||
struct pipe_surface *dst,
|
struct pipe_surface *dst,
|
||||||
const union pipe_color_union *color,
|
const union pipe_color_union *color,
|
||||||
unsigned dstx, unsigned dsty,
|
unsigned dstx, unsigned dsty,
|
||||||
unsigned width, unsigned height,
|
unsigned dst_width, unsigned dst_height,
|
||||||
bool render_condition_enabled)
|
bool render_condition_enabled)
|
||||||
{
|
{
|
||||||
struct svga_context *svga = svga_context( pipe );
|
struct svga_context *svga = svga_context( pipe );
|
||||||
|
|
||||||
svga_toggle_render_condition(svga, render_condition_enabled, false);
|
svga_toggle_render_condition(svga, render_condition_enabled, false);
|
||||||
if (!svga_have_vgpu10(svga) || dstx != 0 || dsty != 0 ||
|
if (!svga_have_vgpu10(svga) || dstx != 0 || dsty != 0 ||
|
||||||
width != dst->width || height != dst->height) {
|
dst_width != pipe_surface_width(dst) || dst_height != pipe_surface_height(dst)) {
|
||||||
svga_blitter_clear_render_target(svga, dst, color, dstx, dsty, width,
|
svga_blitter_clear_render_target(svga, dst, color, dstx, dsty, dst_width,
|
||||||
height);
|
dst_height);
|
||||||
} else {
|
} else {
|
||||||
enum pipe_error ret;
|
enum pipe_error ret;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -108,23 +108,23 @@ svga_set_framebuffer_state(struct pipe_context *pipe,
|
||||||
* different size, depending on the host API and driver,
|
* different size, depending on the host API and driver,
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
int width = 0, height = 0;
|
uint16_t width = 0, height = 0;
|
||||||
if (fb->zsbuf) {
|
if (fb->zsbuf) {
|
||||||
width = fb->zsbuf->width;
|
pipe_surface_size(fb->zsbuf, &width, &height);
|
||||||
height = fb->zsbuf->height;
|
|
||||||
}
|
}
|
||||||
for (i = 0; i < fb->nr_cbufs; ++i) {
|
for (i = 0; i < fb->nr_cbufs; ++i) {
|
||||||
if (fb->cbufs[i]) {
|
if (fb->cbufs[i]) {
|
||||||
if (width && height) {
|
if (width && height) {
|
||||||
if (fb->cbufs[i]->width != width ||
|
uint16_t cwidth, cheight;
|
||||||
fb->cbufs[i]->height != height) {
|
pipe_surface_size(fb->cbufs[i], &cwidth, &cheight);
|
||||||
|
if (cwidth != width ||
|
||||||
|
cheight != height) {
|
||||||
debug_warning("Mixed-size color and depth/stencil surfaces "
|
debug_warning("Mixed-size color and depth/stencil surfaces "
|
||||||
"may not work properly");
|
"may not work properly");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
width = fb->cbufs[i]->width;
|
pipe_surface_size(fb->cbufs[i], &width, &height);
|
||||||
height = fb->cbufs[i]->height;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -305,8 +305,6 @@ svga_create_surface_view(struct pipe_context *pipe,
|
||||||
pipe_resource_reference(&s->base.texture, pt);
|
pipe_resource_reference(&s->base.texture, pt);
|
||||||
s->base.context = pipe;
|
s->base.context = pipe;
|
||||||
s->base.format = surf_tmpl->format;
|
s->base.format = surf_tmpl->format;
|
||||||
s->base.width = u_minify(pt->width0, surf_tmpl->u.tex.level);
|
|
||||||
s->base.height = u_minify(pt->height0, surf_tmpl->u.tex.level);
|
|
||||||
s->base.u.tex.level = surf_tmpl->u.tex.level;
|
s->base.u.tex.level = surf_tmpl->u.tex.level;
|
||||||
s->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
s->base.u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
s->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
s->base.u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -545,8 +545,12 @@ v3d_tlb_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
* This should be fine because we only get here if the src and dst boxes
|
* This should be fine because we only get here if the src and dst boxes
|
||||||
* match, so we know the blit involves the same tiles on both surfaces.
|
* match, so we know the blit involves the same tiles on both surfaces.
|
||||||
*/
|
*/
|
||||||
job->draw_width = MIN2(dst_surf->width, src_surf->width);
|
uint16_t dst_width, dst_height;
|
||||||
job->draw_height = MIN2(dst_surf->height, src_surf->height);
|
pipe_surface_size(dst_surf, &dst_width, &dst_height);
|
||||||
|
uint16_t src_width, src_height;
|
||||||
|
pipe_surface_size(src_surf, &src_width, &src_height);
|
||||||
|
job->draw_width = MIN2(dst_width, src_width);
|
||||||
|
job->draw_height = MIN2(dst_height, src_height);
|
||||||
|
|
||||||
job->tile_desc.width = tile_width;
|
job->tile_desc.width = tile_width;
|
||||||
job->tile_desc.height = tile_height;
|
job->tile_desc.height = tile_height;
|
||||||
|
|
@ -818,9 +822,11 @@ v3d_sand8_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
* size now we are using a cpp=4 format. Next dimension take into
|
* size now we are using a cpp=4 format. Next dimension take into
|
||||||
* account the UIF microtile layouts.
|
* account the UIF microtile layouts.
|
||||||
*/
|
*/
|
||||||
dst_surf->width = align(dst_surf->width, 8) / 2;
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(dst_surf, &width, &height);
|
||||||
|
width = align(width, 8) / 2;
|
||||||
if (src->cpp == 1)
|
if (src->cpp == 1)
|
||||||
dst_surf->height /= 2;
|
height /= 2;
|
||||||
|
|
||||||
/* Set the constant buffer. */
|
/* Set the constant buffer. */
|
||||||
struct pipe_constant_buffer cb_uniforms = {
|
struct pipe_constant_buffer cb_uniforms = {
|
||||||
|
|
@ -849,7 +855,7 @@ v3d_sand8_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 0, 0, NULL);
|
pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 0, 0, NULL);
|
||||||
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
|
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
|
||||||
|
|
||||||
util_blitter_custom_shader(v3d->blitter, dst_surf,
|
util_blitter_custom_shader(v3d->blitter, dst_surf, width, height,
|
||||||
v3d_get_sand8_vs(pctx),
|
v3d_get_sand8_vs(pctx),
|
||||||
v3d_get_sand8_fs(pctx, src->cpp));
|
v3d_get_sand8_fs(pctx, src->cpp));
|
||||||
|
|
||||||
|
|
@ -1137,10 +1143,12 @@ v3d_sand30_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
* size now we are using a cpp=8 format. Next dimension take into
|
* size now we are using a cpp=8 format. Next dimension take into
|
||||||
* account the UIF microtile layouts.
|
* account the UIF microtile layouts.
|
||||||
*/
|
*/
|
||||||
dst_surf->height /= 2;
|
uint16_t width, height;
|
||||||
dst_surf->width = align(dst_surf->width, 8);
|
pipe_surface_size(dst_surf, &width, &height);
|
||||||
|
height /= 2;
|
||||||
|
width = align(width, 8);
|
||||||
if (src->cpp == 2)
|
if (src->cpp == 2)
|
||||||
dst_surf->width /= 2;
|
width /= 2;
|
||||||
/* Set the constant buffer. */
|
/* Set the constant buffer. */
|
||||||
struct pipe_constant_buffer cb_uniforms = {
|
struct pipe_constant_buffer cb_uniforms = {
|
||||||
.user_buffer = &sand30_stride,
|
.user_buffer = &sand30_stride,
|
||||||
|
|
@ -1170,7 +1178,7 @@ v3d_sand30_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
NULL);
|
NULL);
|
||||||
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
|
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
|
||||||
|
|
||||||
util_blitter_custom_shader(v3d->blitter, dst_surf,
|
util_blitter_custom_shader(v3d->blitter, dst_surf, width, height,
|
||||||
v3d_get_sand30_vs(pctx),
|
v3d_get_sand30_vs(pctx),
|
||||||
v3d_get_sand30_fs(pctx));
|
v3d_get_sand30_fs(pctx));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1095,8 +1095,6 @@ v3d_create_surface(struct pipe_context *pctx,
|
||||||
|
|
||||||
psurf->context = pctx;
|
psurf->context = pctx;
|
||||||
psurf->format = surf_tmpl->format;
|
psurf->format = surf_tmpl->format;
|
||||||
psurf->width = u_minify(ptex->width0, level);
|
|
||||||
psurf->height = u_minify(ptex->height0, level);
|
|
||||||
psurf->u.tex.level = level;
|
psurf->u.tex.level = level;
|
||||||
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,8 @@ vc4_tile_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
job->draw_min_y = info->dst.box.y;
|
job->draw_min_y = info->dst.box.y;
|
||||||
job->draw_max_x = info->dst.box.x + info->dst.box.width;
|
job->draw_max_x = info->dst.box.x + info->dst.box.width;
|
||||||
job->draw_max_y = info->dst.box.y + info->dst.box.height;
|
job->draw_max_y = info->dst.box.y + info->dst.box.height;
|
||||||
job->draw_width = dst_surf->width;
|
job->draw_width = pipe_surface_width(dst_surf);
|
||||||
job->draw_height = dst_surf->height;
|
job->draw_height = pipe_surface_height(dst_surf);
|
||||||
|
|
||||||
job->tile_width = tile_width;
|
job->tile_width = tile_width;
|
||||||
job->tile_height = tile_height;
|
job->tile_height = tile_height;
|
||||||
|
|
@ -385,9 +385,11 @@ vc4_yuv_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
util_blitter_unset_running_flag(vc4->blitter);
|
util_blitter_unset_running_flag(vc4->blitter);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dst_surf->width = align(dst_surf->width, 8) / 2;
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(dst_surf, &width, &height);
|
||||||
|
width = align(width, 8) / 2;
|
||||||
if (dst->cpp == 1)
|
if (dst->cpp == 1)
|
||||||
dst_surf->height /= 2;
|
height /= 2;
|
||||||
|
|
||||||
/* Set the constant buffer. */
|
/* Set the constant buffer. */
|
||||||
uint32_t stride = src->slices[info->src.level].stride;
|
uint32_t stride = src->slices[info->src.level].stride;
|
||||||
|
|
@ -410,7 +412,7 @@ vc4_yuv_blit(struct pipe_context *pctx, struct pipe_blit_info *info)
|
||||||
pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 0, 0, NULL);
|
pctx->set_sampler_views(pctx, PIPE_SHADER_FRAGMENT, 0, 0, 0, NULL);
|
||||||
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
|
pctx->bind_sampler_states(pctx, PIPE_SHADER_FRAGMENT, 0, 0, NULL);
|
||||||
|
|
||||||
util_blitter_custom_shader(vc4->blitter, dst_surf,
|
util_blitter_custom_shader(vc4->blitter, dst_surf, width, height,
|
||||||
vc4_get_yuv_vs(pctx),
|
vc4_get_yuv_vs(pctx),
|
||||||
vc4_get_yuv_fs(pctx, src->cpp));
|
vc4_get_yuv_fs(pctx, src->cpp));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -778,8 +778,6 @@ vc4_create_surface(struct pipe_context *pctx,
|
||||||
|
|
||||||
psurf->context = pctx;
|
psurf->context = pctx;
|
||||||
psurf->format = surf_tmpl->format;
|
psurf->format = surf_tmpl->format;
|
||||||
psurf->width = u_minify(ptex->width0, level);
|
|
||||||
psurf->height = u_minify(ptex->height0, level);
|
|
||||||
psurf->u.tex.level = level;
|
psurf->u.tex.level = level;
|
||||||
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
psurf->u.tex.first_layer = surf_tmpl->u.tex.first_layer;
|
||||||
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
psurf->u.tex.last_layer = surf_tmpl->u.tex.last_layer;
|
||||||
|
|
@ -804,8 +802,8 @@ vc4_dump_surface_non_msaa(struct pipe_surface *psurf)
|
||||||
struct vc4_resource *rsc = vc4_resource(prsc);
|
struct vc4_resource *rsc = vc4_resource(prsc);
|
||||||
uint32_t *map = vc4_bo_map(rsc->bo);
|
uint32_t *map = vc4_bo_map(rsc->bo);
|
||||||
uint32_t stride = rsc->slices[0].stride / 4;
|
uint32_t stride = rsc->slices[0].stride / 4;
|
||||||
uint32_t width = psurf->width;
|
uint16_t width, height;
|
||||||
uint32_t height = psurf->height;
|
pipe_surface_size(psurf, &width, &height);
|
||||||
uint32_t chunk_w = width / 79;
|
uint32_t chunk_w = width / 79;
|
||||||
uint32_t chunk_h = height / 40;
|
uint32_t chunk_h = height / 40;
|
||||||
uint32_t found_colors[10] = { 0 };
|
uint32_t found_colors[10] = { 0 };
|
||||||
|
|
@ -899,8 +897,10 @@ vc4_surface_msaa_get_sample(struct pipe_surface *psurf,
|
||||||
{
|
{
|
||||||
struct pipe_resource *prsc = psurf->texture;
|
struct pipe_resource *prsc = psurf->texture;
|
||||||
struct vc4_resource *rsc = vc4_resource(prsc);
|
struct vc4_resource *rsc = vc4_resource(prsc);
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(psurf, &width, &height);
|
||||||
uint32_t tile_w = 32, tile_h = 32;
|
uint32_t tile_w = 32, tile_h = 32;
|
||||||
uint32_t tiles_w = DIV_ROUND_UP(psurf->width, 32);
|
uint32_t tiles_w = DIV_ROUND_UP(width, 32);
|
||||||
|
|
||||||
uint32_t tile_x = x / tile_w;
|
uint32_t tile_x = x / tile_w;
|
||||||
uint32_t tile_y = y / tile_h;
|
uint32_t tile_y = y / tile_h;
|
||||||
|
|
@ -971,23 +971,25 @@ static void
|
||||||
vc4_dump_surface_msaa(struct pipe_surface *psurf)
|
vc4_dump_surface_msaa(struct pipe_surface *psurf)
|
||||||
{
|
{
|
||||||
uint32_t tile_w = 32, tile_h = 32;
|
uint32_t tile_w = 32, tile_h = 32;
|
||||||
uint32_t tiles_w = DIV_ROUND_UP(psurf->width, tile_w);
|
uint16_t width, height;
|
||||||
uint32_t tiles_h = DIV_ROUND_UP(psurf->height, tile_h);
|
pipe_surface_size(psurf, &width, &height);
|
||||||
|
uint32_t tiles_w = DIV_ROUND_UP(width, tile_w);
|
||||||
|
uint32_t tiles_h = DIV_ROUND_UP(height, tile_h);
|
||||||
uint32_t char_w = 140, char_h = 60;
|
uint32_t char_w = 140, char_h = 60;
|
||||||
uint32_t char_w_per_tile = char_w / tiles_w - 1;
|
uint32_t char_w_per_tile = char_w / tiles_w - 1;
|
||||||
uint32_t char_h_per_tile = char_h / tiles_h - 1;
|
uint32_t char_h_per_tile = char_h / tiles_h - 1;
|
||||||
|
|
||||||
fprintf(stderr, "Surface: %dx%d (%dx MSAA)\n",
|
fprintf(stderr, "Surface: %dx%d (%dx MSAA)\n",
|
||||||
psurf->width, psurf->height, psurf->texture->nr_samples);
|
width, height, psurf->texture->nr_samples);
|
||||||
|
|
||||||
for (int x = 0; x < (char_w_per_tile + 1) * tiles_w; x++)
|
for (int x = 0; x < (char_w_per_tile + 1) * tiles_w; x++)
|
||||||
fprintf(stderr, "-");
|
fprintf(stderr, "-");
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
for (int ty = 0; ty < psurf->height; ty += tile_h) {
|
for (int ty = 0; ty < height; ty += tile_h) {
|
||||||
for (int y = 0; y < char_h_per_tile; y++) {
|
for (int y = 0; y < char_h_per_tile; y++) {
|
||||||
|
|
||||||
for (int tx = 0; tx < psurf->width; tx += tile_w) {
|
for (int tx = 0; tx < width; tx += tile_w) {
|
||||||
for (int x = 0; x < char_w_per_tile; x++) {
|
for (int x = 0; x < char_w_per_tile; x++) {
|
||||||
uint32_t bx1 = (x * tile_w /
|
uint32_t bx1 = (x * tile_w /
|
||||||
char_w_per_tile);
|
char_w_per_tile);
|
||||||
|
|
|
||||||
|
|
@ -373,8 +373,6 @@ static struct pipe_surface *virgl_create_surface(struct pipe_context *ctx,
|
||||||
surf->base.context = ctx;
|
surf->base.context = ctx;
|
||||||
surf->base.format = templ->format;
|
surf->base.format = templ->format;
|
||||||
|
|
||||||
surf->base.width = u_minify(resource->width0, templ->u.tex.level);
|
|
||||||
surf->base.height = u_minify(resource->height0, templ->u.tex.level);
|
|
||||||
surf->base.u.tex.level = templ->u.tex.level;
|
surf->base.u.tex.level = templ->u.tex.level;
|
||||||
surf->base.u.tex.first_layer = templ->u.tex.first_layer;
|
surf->base.u.tex.first_layer = templ->u.tex.first_layer;
|
||||||
surf->base.u.tex.last_layer = templ->u.tex.last_layer;
|
surf->base.u.tex.last_layer = templ->u.tex.last_layer;
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ zink_clear(struct pipe_context *pctx,
|
||||||
color.f[3] = 1.0;
|
color.f[3] = 1.0;
|
||||||
pctx->clear_render_target(pctx, ctx->fb_state.cbufs[i], &color,
|
pctx->clear_render_target(pctx, ctx->fb_state.cbufs[i], &color,
|
||||||
0, 0,
|
0, 0,
|
||||||
ctx->fb_state.cbufs[i]->width, ctx->fb_state.cbufs[i]->height,
|
ctx->fb_state.width, ctx->fb_state.height,
|
||||||
ctx->render_condition_active);
|
ctx->render_condition_active);
|
||||||
}
|
}
|
||||||
pctx->clear_render_target(pctx, ctx->fb_state.cbufs[i], pcolor,
|
pctx->clear_render_target(pctx, ctx->fb_state.cbufs[i], pcolor,
|
||||||
|
|
@ -417,8 +417,13 @@ static void
|
||||||
set_clear_fb(struct pipe_context *pctx, struct pipe_surface *psurf, struct pipe_surface *zsurf)
|
set_clear_fb(struct pipe_context *pctx, struct pipe_surface *psurf, struct pipe_surface *zsurf)
|
||||||
{
|
{
|
||||||
struct pipe_framebuffer_state fb_state = {0};
|
struct pipe_framebuffer_state fb_state = {0};
|
||||||
fb_state.width = psurf ? psurf->width : zsurf->width;
|
uint16_t width, height;
|
||||||
fb_state.height = psurf ? psurf->height : zsurf->height;
|
if (psurf)
|
||||||
|
pipe_surface_size(psurf, &width, &height);
|
||||||
|
else
|
||||||
|
pipe_surface_size(zsurf, &width, &height);
|
||||||
|
fb_state.width = width;
|
||||||
|
fb_state.height = height;
|
||||||
fb_state.nr_cbufs = !!psurf;
|
fb_state.nr_cbufs = !!psurf;
|
||||||
fb_state.cbufs[0] = psurf;
|
fb_state.cbufs[0] = psurf;
|
||||||
fb_state.zsbuf = zsurf;
|
fb_state.zsbuf = zsurf;
|
||||||
|
|
|
||||||
|
|
@ -1135,8 +1135,6 @@ zink_kopper_fixup_depth_buffer(struct zink_context *ctx)
|
||||||
res->base.b.height0 = ctx->fb_state.height;
|
res->base.b.height0 = ctx->fb_state.height;
|
||||||
pipe_resource_reference(&pz, NULL);
|
pipe_resource_reference(&pz, NULL);
|
||||||
|
|
||||||
ctx->fb_state.zsbuf->width = ctx->fb_state.width;
|
|
||||||
ctx->fb_state.zsbuf->height = ctx->fb_state.height;
|
|
||||||
struct pipe_surface *psurf = ctx->base.create_surface(&ctx->base, &res->base.b, ctx->fb_state.zsbuf);
|
struct pipe_surface *psurf = ctx->base.create_surface(&ctx->base, &res->base.b, ctx->fb_state.zsbuf);
|
||||||
struct zink_ctx_surface *cz = (struct zink_ctx_surface*)psurf;
|
struct zink_ctx_surface *cz = (struct zink_ctx_surface*)psurf;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,8 +115,9 @@ init_surface_info(struct zink_screen *screen, struct zink_surface *surface, stru
|
||||||
VkImageViewUsageCreateInfo *usage_info = (VkImageViewUsageCreateInfo *)ivci->pNext;
|
VkImageViewUsageCreateInfo *usage_info = (VkImageViewUsageCreateInfo *)ivci->pNext;
|
||||||
surface->info.flags = res->obj->vkflags;
|
surface->info.flags = res->obj->vkflags;
|
||||||
surface->info.usage = usage_info ? usage_info->usage : res->obj->vkusage;
|
surface->info.usage = usage_info ? usage_info->usage : res->obj->vkusage;
|
||||||
surface->info.width = surface->base.width;
|
|
||||||
surface->info.height = surface->base.height;
|
surface->info.width = pipe_surface_width(&surface->base);
|
||||||
|
surface->info.height = pipe_surface_height(&surface->base);
|
||||||
surface->info.layerCount = ivci->subresourceRange.layerCount;
|
surface->info.layerCount = ivci->subresourceRange.layerCount;
|
||||||
surface->info.format[0] = ivci->format;
|
surface->info.format[0] = ivci->format;
|
||||||
if (res->obj->dt) {
|
if (res->obj->dt) {
|
||||||
|
|
@ -141,22 +142,6 @@ init_pipe_surface_info(struct pipe_context *pctx, struct pipe_surface *psurf, co
|
||||||
unsigned int level = templ->u.tex.level;
|
unsigned int level = templ->u.tex.level;
|
||||||
psurf->context = pctx;
|
psurf->context = pctx;
|
||||||
psurf->format = templ->format;
|
psurf->format = templ->format;
|
||||||
psurf->width = u_minify(pres->width0, level);
|
|
||||||
assert(psurf->width);
|
|
||||||
psurf->height = u_minify(pres->height0, level);
|
|
||||||
assert(psurf->height);
|
|
||||||
|
|
||||||
if (util_format_is_compressed(pres->format) &&
|
|
||||||
!util_format_is_compressed(psurf->format)) {
|
|
||||||
assert(util_format_get_blockwidth(psurf->format) == 1);
|
|
||||||
assert(util_format_get_blockheight(psurf->format) == 1);
|
|
||||||
|
|
||||||
psurf->width = DIV_ROUND_UP(psurf->width,
|
|
||||||
util_format_get_blockwidth(pres->format));
|
|
||||||
psurf->height = DIV_ROUND_UP(psurf->height,
|
|
||||||
util_format_get_blockheight(pres->format));
|
|
||||||
}
|
|
||||||
|
|
||||||
psurf->nr_samples = templ->nr_samples;
|
psurf->nr_samples = templ->nr_samples;
|
||||||
psurf->u.tex.level = level;
|
psurf->u.tex.level = level;
|
||||||
psurf->u.tex.first_layer = templ->u.tex.first_layer;
|
psurf->u.tex.first_layer = templ->u.tex.first_layer;
|
||||||
|
|
@ -557,8 +542,6 @@ zink_surface_swapchain_update(struct zink_context *ctx, struct zink_surface *sur
|
||||||
mesa_loge("ZINK: failed to allocate surface->swapchain!");
|
mesa_loge("ZINK: failed to allocate surface->swapchain!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
surface->base.width = res->base.b.width0;
|
|
||||||
surface->base.height = res->base.b.height0;
|
|
||||||
init_surface_info(screen, surface, res, &surface->ivci);
|
init_surface_info(screen, surface, res, &surface->ivci);
|
||||||
surface->dt_swapchain = cdt->swapchain;
|
surface->dt_swapchain = cdt->swapchain;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1220,8 +1220,6 @@ static struct pipe_surface *create_img_surface_bo(struct rendering_state *state,
|
||||||
VkImageSubresourceRange *range,
|
VkImageSubresourceRange *range,
|
||||||
struct pipe_resource *bo,
|
struct pipe_resource *bo,
|
||||||
enum pipe_format pformat,
|
enum pipe_format pformat,
|
||||||
int width,
|
|
||||||
int height,
|
|
||||||
int base_layer, int layer_count,
|
int base_layer, int layer_count,
|
||||||
int level)
|
int level)
|
||||||
{
|
{
|
||||||
|
|
@ -1230,8 +1228,6 @@ static struct pipe_surface *create_img_surface_bo(struct rendering_state *state,
|
||||||
|
|
||||||
const struct pipe_surface template = {
|
const struct pipe_surface template = {
|
||||||
.format = pformat,
|
.format = pformat,
|
||||||
.width = width,
|
|
||||||
.height = height,
|
|
||||||
.u.tex.first_layer = range->baseArrayLayer + base_layer,
|
.u.tex.first_layer = range->baseArrayLayer + base_layer,
|
||||||
.u.tex.last_layer = range->baseArrayLayer + base_layer + layer_count - 1,
|
.u.tex.last_layer = range->baseArrayLayer + base_layer + layer_count - 1,
|
||||||
.u.tex.level = range->baseMipLevel + level,
|
.u.tex.level = range->baseMipLevel + level,
|
||||||
|
|
@ -1243,8 +1239,7 @@ static struct pipe_surface *create_img_surface_bo(struct rendering_state *state,
|
||||||
}
|
}
|
||||||
static struct pipe_surface *create_img_surface(struct rendering_state *state,
|
static struct pipe_surface *create_img_surface(struct rendering_state *state,
|
||||||
struct lvp_image_view *imgv,
|
struct lvp_image_view *imgv,
|
||||||
VkFormat format, int width,
|
VkFormat format,
|
||||||
int height,
|
|
||||||
int base_layer, int layer_count)
|
int base_layer, int layer_count)
|
||||||
{
|
{
|
||||||
VkImageSubresourceRange imgv_subres =
|
VkImageSubresourceRange imgv_subres =
|
||||||
|
|
@ -1252,11 +1247,11 @@ static struct pipe_surface *create_img_surface(struct rendering_state *state,
|
||||||
|
|
||||||
return create_img_surface_bo(state, &imgv_subres, imgv->image->planes[0].bo,
|
return create_img_surface_bo(state, &imgv_subres, imgv->image->planes[0].bo,
|
||||||
lvp_vk_format_to_pipe_format(format),
|
lvp_vk_format_to_pipe_format(format),
|
||||||
width, height, base_layer, layer_count, 0);
|
base_layer, layer_count, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_img_view_surface(struct rendering_state *state,
|
static void add_img_view_surface(struct rendering_state *state,
|
||||||
struct lvp_image_view *imgv, int width, int height,
|
struct lvp_image_view *imgv,
|
||||||
int layer_count)
|
int layer_count)
|
||||||
{
|
{
|
||||||
if (imgv->surface) {
|
if (imgv->surface) {
|
||||||
|
|
@ -1266,7 +1261,6 @@ static void add_img_view_surface(struct rendering_state *state,
|
||||||
|
|
||||||
if (!imgv->surface) {
|
if (!imgv->surface) {
|
||||||
imgv->surface = create_img_surface(state, imgv, imgv->vk.format,
|
imgv->surface = create_img_surface(state, imgv, imgv->vk.format,
|
||||||
width, height,
|
|
||||||
0, layer_count);
|
0, layer_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1296,8 +1290,6 @@ static void clear_attachment_layers(struct rendering_state *state,
|
||||||
struct pipe_surface *clear_surf = create_img_surface(state,
|
struct pipe_surface *clear_surf = create_img_surface(state,
|
||||||
imgv,
|
imgv,
|
||||||
imgv->vk.format,
|
imgv->vk.format,
|
||||||
state->framebuffer.width,
|
|
||||||
state->framebuffer.height,
|
|
||||||
base_layer,
|
base_layer,
|
||||||
layer_count);
|
layer_count);
|
||||||
|
|
||||||
|
|
@ -1731,7 +1723,6 @@ handle_begin_rendering(struct vk_cmd_queue_entry *cmd,
|
||||||
if (state->color_att[i].imgv) {
|
if (state->color_att[i].imgv) {
|
||||||
struct lvp_image_view *imgv = state->color_att[i].imgv;
|
struct lvp_image_view *imgv = state->color_att[i].imgv;
|
||||||
add_img_view_surface(state, imgv,
|
add_img_view_surface(state, imgv,
|
||||||
state->framebuffer.width, state->framebuffer.height,
|
|
||||||
state->framebuffer.layers);
|
state->framebuffer.layers);
|
||||||
if (state->forced_sample_count && imgv->image->vk.samples == 1)
|
if (state->forced_sample_count && imgv->image->vk.samples == 1)
|
||||||
state->color_att[i].imgv = create_multisample_surface(state, imgv, state->forced_sample_count,
|
state->color_att[i].imgv = create_multisample_surface(state, imgv, state->forced_sample_count,
|
||||||
|
|
@ -1756,7 +1747,6 @@ handle_begin_rendering(struct vk_cmd_queue_entry *cmd,
|
||||||
state->stencil_att.imgv;
|
state->stencil_att.imgv;
|
||||||
struct lvp_image_view *imgv = state->ds_imgv;
|
struct lvp_image_view *imgv = state->ds_imgv;
|
||||||
add_img_view_surface(state, imgv,
|
add_img_view_surface(state, imgv,
|
||||||
state->framebuffer.width, state->framebuffer.height,
|
|
||||||
state->framebuffer.layers);
|
state->framebuffer.layers);
|
||||||
if (state->forced_sample_count && imgv->image->vk.samples == 1) {
|
if (state->forced_sample_count && imgv->image->vk.samples == 1) {
|
||||||
VkAttachmentLoadOp load_op;
|
VkAttachmentLoadOp load_op;
|
||||||
|
|
@ -3103,7 +3093,6 @@ static void handle_clear_ds_image(struct vk_cmd_queue_entry *cmd,
|
||||||
|
|
||||||
surf = create_img_surface_bo(state, range,
|
surf = create_img_surface_bo(state, range,
|
||||||
image->planes[0].bo, image->planes[0].bo->format,
|
image->planes[0].bo, image->planes[0].bo->format,
|
||||||
width, height,
|
|
||||||
0, depth, j);
|
0, depth, j);
|
||||||
|
|
||||||
state->pctx->clear_depth_stencil(state->pctx,
|
state->pctx->clear_depth_stencil(state->pctx,
|
||||||
|
|
|
||||||
|
|
@ -990,8 +990,10 @@ vlVaHandleSurfaceAllocate(vlVaDriver *drv, vlVaSurface *surface,
|
||||||
if (i > !!surface->buffer->interlaced)
|
if (i > !!surface->buffer->interlaced)
|
||||||
c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f;
|
c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f;
|
||||||
|
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(surfaces[i], &width, &height);
|
||||||
drv->pipe->clear_render_target(drv->pipe, surfaces[i], &c, 0, 0,
|
drv->pipe->clear_render_target(drv->pipe, surfaces[i], &c, 0, 0,
|
||||||
surfaces[i]->width, surfaces[i]->height,
|
width, height,
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
vlVaSurfaceFlush(drv, surface);
|
vlVaSurfaceFlush(drv, surface);
|
||||||
|
|
|
||||||
|
|
@ -356,8 +356,8 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
|
||||||
res_tmpl.usage = PIPE_USAGE_DEFAULT;
|
res_tmpl.usage = PIPE_USAGE_DEFAULT;
|
||||||
|
|
||||||
if (!vmixer->bicubic.filter) {
|
if (!vmixer->bicubic.filter) {
|
||||||
res_tmpl.width0 = dst->surface->width;
|
res_tmpl.width0 = pipe_surface_width(dst->surface);
|
||||||
res_tmpl.height0 = dst->surface->height;
|
res_tmpl.height0 = pipe_surface_height(dst->surface);
|
||||||
} else {
|
} else {
|
||||||
res_tmpl.width0 = surf->templat.width;
|
res_tmpl.width0 = surf->templat.width;
|
||||||
res_tmpl.height0 = surf->templat.height;
|
res_tmpl.height0 = surf->templat.height;
|
||||||
|
|
|
||||||
|
|
@ -823,8 +823,8 @@ VdpStatus vlVdpOutputSurfaceDMABuf(VdpOutputSurface surface,
|
||||||
mtx_unlock(&vlsurface->device->mutex);
|
mtx_unlock(&vlsurface->device->mutex);
|
||||||
|
|
||||||
result->handle = whandle.handle;
|
result->handle = whandle.handle;
|
||||||
result->width = vlsurface->surface->width;
|
result->width = pipe_surface_width(vlsurface->surface);
|
||||||
result->height = vlsurface->surface->height;
|
result->height = pipe_surface_height(vlsurface->surface);
|
||||||
result->offset = whandle.offset;
|
result->offset = whandle.offset;
|
||||||
result->stride = whandle.stride;
|
result->stride = whandle.stride;
|
||||||
result->format = PipeToFormatRGBA(vlsurface->surface->format);
|
result->format = PipeToFormatRGBA(vlsurface->surface->format);
|
||||||
|
|
|
||||||
|
|
@ -248,13 +248,13 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
|
||||||
|
|
||||||
dst_clip.x0 = 0;
|
dst_clip.x0 = 0;
|
||||||
dst_clip.y0 = 0;
|
dst_clip.y0 = 0;
|
||||||
dst_clip.x1 = clip_width ? clip_width : surf_draw->width;
|
dst_clip.x1 = clip_width ? clip_width : pipe_surface_width(surf_draw);
|
||||||
dst_clip.y1 = clip_height ? clip_height : surf_draw->height;
|
dst_clip.y1 = clip_height ? clip_height : pipe_surface_height(surf_draw);
|
||||||
|
|
||||||
src_rect.x0 = 0;
|
src_rect.x0 = 0;
|
||||||
src_rect.y0 = 0;
|
src_rect.y0 = 0;
|
||||||
src_rect.x1 = surf_draw->width;
|
src_rect.x1 = pipe_surface_width(surf_draw);
|
||||||
src_rect.y1 = surf_draw->height;
|
src_rect.y1 = pipe_surface_height(surf_draw);
|
||||||
|
|
||||||
vl_compositor_clear_layers(cstate);
|
vl_compositor_clear_layers(cstate);
|
||||||
vl_compositor_set_rgba_layer(cstate, compositor, 0, surf->sampler_view, &src_rect, NULL, NULL);
|
vl_compositor_set_rgba_layer(cstate, compositor, 0, surf->sampler_view, &src_rect, NULL, NULL);
|
||||||
|
|
|
||||||
|
|
@ -450,8 +450,10 @@ vlVdpVideoSurfaceClear(vlVdpSurface *vlsurf)
|
||||||
if (i > !!vlsurf->templat.interlaced)
|
if (i > !!vlsurf->templat.interlaced)
|
||||||
c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f;
|
c.f[0] = c.f[1] = c.f[2] = c.f[3] = 0.5f;
|
||||||
|
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(surfaces[i], &width, &height);
|
||||||
pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0,
|
pipe->clear_render_target(pipe, surfaces[i], &c, 0, 0,
|
||||||
surfaces[i]->width, surfaces[i]->height, false);
|
width, height, false);
|
||||||
}
|
}
|
||||||
pipe->flush(pipe, NULL, 0);
|
pipe->flush(pipe, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -534,10 +536,9 @@ VdpStatus vlVdpVideoSurfaceDMABuf(VdpVideoSurface surface,
|
||||||
}
|
}
|
||||||
|
|
||||||
mtx_unlock(&p_surf->device->mutex);
|
mtx_unlock(&p_surf->device->mutex);
|
||||||
|
|
||||||
result->handle = whandle.handle;
|
result->handle = whandle.handle;
|
||||||
result->width = surf->width;
|
result->width = pipe_surface_width(surf);
|
||||||
result->height = surf->height;
|
result->height = pipe_surface_height(surf);
|
||||||
result->offset = whandle.offset;
|
result->offset = whandle.offset;
|
||||||
result->stride = whandle.stride;
|
result->stride = whandle.stride;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -322,8 +322,8 @@ void
|
||||||
renderer_bind_destination(struct xa_context *r,
|
renderer_bind_destination(struct xa_context *r,
|
||||||
struct pipe_surface *surface)
|
struct pipe_surface *surface)
|
||||||
{
|
{
|
||||||
int width = surface->width;
|
uint16_t width, height;
|
||||||
int height = surface->height;
|
pipe_surface_size(surface, &width, &height);
|
||||||
|
|
||||||
struct pipe_framebuffer_state fb;
|
struct pipe_framebuffer_state fb;
|
||||||
struct pipe_viewport_state viewport;
|
struct pipe_viewport_state viewport;
|
||||||
|
|
@ -333,8 +333,7 @@ renderer_bind_destination(struct xa_context *r,
|
||||||
/* Framebuffer uses actual surface width/height
|
/* Framebuffer uses actual surface width/height
|
||||||
*/
|
*/
|
||||||
memset(&fb, 0, sizeof fb);
|
memset(&fb, 0, sizeof fb);
|
||||||
fb.width = surface->width;
|
pipe_surface_size(surface, &fb.width, &fb.height);
|
||||||
fb.height = surface->height;
|
|
||||||
fb.nr_cbufs = 1;
|
fb.nr_cbufs = 1;
|
||||||
fb.cbufs[0] = surface;
|
fb.cbufs[0] = surface;
|
||||||
fb.zsbuf = NULL;
|
fb.zsbuf = NULL;
|
||||||
|
|
|
||||||
|
|
@ -472,10 +472,6 @@ struct pipe_surface
|
||||||
struct pipe_resource *texture; /**< resource into which this is a view */
|
struct pipe_resource *texture; /**< resource into which this is a view */
|
||||||
struct pipe_context *context; /**< context this surface belongs to */
|
struct pipe_context *context; /**< context this surface belongs to */
|
||||||
|
|
||||||
/* XXX width/height should be removed */
|
|
||||||
uint16_t width; /**< logical width in pixels */
|
|
||||||
uint16_t height; /**< logical height in pixels */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Number of samples for the surface. This will be 0 if rendering
|
* Number of samples for the surface. This will be 0 if rendering
|
||||||
* should use the resource's nr_samples, or another value if the resource
|
* should use the resource's nr_samples, or another value if the resource
|
||||||
|
|
|
||||||
|
|
@ -663,8 +663,6 @@ _mesa_update_renderbuffer_surface(struct gl_context *ctx,
|
||||||
surf->texture->nr_storage_samples != rb->NumStorageSamples ||
|
surf->texture->nr_storage_samples != rb->NumStorageSamples ||
|
||||||
surf->format != format ||
|
surf->format != format ||
|
||||||
surf->texture != resource ||
|
surf->texture != resource ||
|
||||||
surf->width != rtt_width ||
|
|
||||||
surf->height != rtt_height ||
|
|
||||||
surf->nr_samples != nr_samples ||
|
surf->nr_samples != nr_samples ||
|
||||||
surf->u.tex.level != level ||
|
surf->u.tex.level != level ||
|
||||||
surf->u.tex.first_layer != first_layer ||
|
surf->u.tex.first_layer != first_layer ||
|
||||||
|
|
|
||||||
|
|
@ -61,11 +61,13 @@ static void
|
||||||
update_framebuffer_size(struct pipe_framebuffer_state *framebuffer,
|
update_framebuffer_size(struct pipe_framebuffer_state *framebuffer,
|
||||||
struct pipe_surface *surface)
|
struct pipe_surface *surface)
|
||||||
{
|
{
|
||||||
|
uint16_t width, height;
|
||||||
assert(surface);
|
assert(surface);
|
||||||
assert(surface->width < USHRT_MAX);
|
pipe_surface_size(surface, &width, &height);
|
||||||
assert(surface->height < USHRT_MAX);
|
assert(width < USHRT_MAX);
|
||||||
framebuffer->width = MIN2(framebuffer->width, surface->width);
|
assert(height < USHRT_MAX);
|
||||||
framebuffer->height = MIN2(framebuffer->height, surface->height);
|
framebuffer->width = MIN2(framebuffer->width, width);
|
||||||
|
framebuffer->height = MIN2(framebuffer->height, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -216,8 +216,7 @@ try_pbo_readpixels(struct st_context *st, struct gl_renderbuffer *rb,
|
||||||
|
|
||||||
/* Set up no-attachment framebuffer */
|
/* Set up no-attachment framebuffer */
|
||||||
memset(&fb, 0, sizeof(fb));
|
memset(&fb, 0, sizeof(fb));
|
||||||
fb.width = surface->width;
|
pipe_surface_size(surface, &fb.width, &fb.height);
|
||||||
fb.height = surface->height;
|
|
||||||
fb.samples = 1;
|
fb.samples = 1;
|
||||||
fb.layers = addr.depth;
|
fb.layers = addr.depth;
|
||||||
cso_set_framebuffer(cso, &fb);
|
cso_set_framebuffer(cso, &fb);
|
||||||
|
|
|
||||||
|
|
@ -1777,19 +1777,22 @@ try_pbo_upload_common(struct gl_context *ctx,
|
||||||
pipe_sampler_view_release(sampler_view);
|
pipe_sampler_view_release(sampler_view);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint16_t width, height;
|
||||||
|
pipe_surface_size(surface, &width, &height);
|
||||||
|
|
||||||
/* Framebuffer_state */
|
/* Framebuffer_state */
|
||||||
{
|
{
|
||||||
struct pipe_framebuffer_state fb;
|
struct pipe_framebuffer_state fb;
|
||||||
memset(&fb, 0, sizeof(fb));
|
memset(&fb, 0, sizeof(fb));
|
||||||
fb.width = surface->width;
|
fb.width = width;
|
||||||
fb.height = surface->height;
|
fb.height = height;
|
||||||
fb.nr_cbufs = 1;
|
fb.nr_cbufs = 1;
|
||||||
fb.cbufs[0] = surface;
|
fb.cbufs[0] = surface;
|
||||||
|
|
||||||
cso_set_framebuffer(cso, &fb);
|
cso_set_framebuffer(cso, &fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
cso_set_viewport_dims(cso, surface->width, surface->height, false);
|
cso_set_viewport_dims(cso, width, height, false);
|
||||||
|
|
||||||
/* Blend state */
|
/* Blend state */
|
||||||
cso_set_blend(cso, &st->pbo.upload_blend);
|
cso_set_blend(cso, &st->pbo.upload_blend);
|
||||||
|
|
@ -1804,7 +1807,7 @@ try_pbo_upload_common(struct gl_context *ctx,
|
||||||
/* Set up the fragment shader */
|
/* Set up the fragment shader */
|
||||||
cso_set_fragment_shader_handle(cso, fs);
|
cso_set_fragment_shader_handle(cso, fs);
|
||||||
|
|
||||||
success = st_pbo_draw(st, addr, surface->width, surface->height);
|
success = st_pbo_draw(st, addr, width, height);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
/* Unbind all because st/mesa won't do it if the current shader doesn't
|
/* Unbind all because st/mesa won't do it if the current shader doesn't
|
||||||
|
|
|
||||||
|
|
@ -203,9 +203,8 @@ st_set_ws_renderbuffer_surface(struct gl_renderbuffer *rb,
|
||||||
|
|
||||||
rb->surface = surf; /* just assign, don't ref */
|
rb->surface = surf; /* just assign, don't ref */
|
||||||
pipe_resource_reference(&rb->texture, surf->texture);
|
pipe_resource_reference(&rb->texture, surf->texture);
|
||||||
|
rb->Width = pipe_surface_width(surf);
|
||||||
rb->Width = surf->width;
|
rb->Height = pipe_surface_height(surf);
|
||||||
rb->Height = surf->height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue