mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 19:40:10 +01:00
gallium/radeon: don't call u_format helpers if we have that info already
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
692f2640ab
commit
c66a550385
2 changed files with 8 additions and 10 deletions
|
|
@ -53,8 +53,7 @@ bool r600_prepare_for_dma_blit(struct r600_common_context *rctx,
|
|||
if (!rctx->dma.cs)
|
||||
return false;
|
||||
|
||||
if (util_format_get_blocksizebits(rdst->resource.b.b.format) !=
|
||||
util_format_get_blocksizebits(rsrc->resource.b.b.format))
|
||||
if (rdst->surface.bpe != rsrc->surface.bpe)
|
||||
return false;
|
||||
|
||||
/* MSAA: Blits don't exist in the real world. */
|
||||
|
|
@ -181,12 +180,10 @@ static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600
|
|||
static unsigned r600_texture_get_offset(struct r600_texture *rtex, unsigned level,
|
||||
const struct pipe_box *box)
|
||||
{
|
||||
enum pipe_format format = rtex->resource.b.b.format;
|
||||
|
||||
return rtex->surface.level[level].offset +
|
||||
box->z * rtex->surface.level[level].slice_size +
|
||||
box->y / util_format_get_blockheight(format) * rtex->surface.level[level].pitch_bytes +
|
||||
box->x / util_format_get_blockwidth(format) * util_format_get_blocksize(format);
|
||||
box->y / rtex->surface.blk_h * rtex->surface.level[level].pitch_bytes +
|
||||
box->x / rtex->surface.blk_w * rtex->surface.bpe;
|
||||
}
|
||||
|
||||
static int r600_init_surface(struct r600_common_screen *rscreen,
|
||||
|
|
@ -2195,7 +2192,7 @@ static void evergreen_set_clear_color(struct r600_texture *rtex,
|
|||
|
||||
memset(&uc, 0, sizeof(uc));
|
||||
|
||||
if (util_format_get_blocksizebits(surface_format) == 128) {
|
||||
if (rtex->surface.bpe == 16) {
|
||||
/* DCC fast clear only:
|
||||
* CLEAR_WORD0 = R = G = B
|
||||
* CLEAR_WORD1 = A
|
||||
|
|
@ -2502,7 +2499,7 @@ void evergreen_do_fast_color_clear(struct r600_common_context *rctx,
|
|||
tex->separate_dcc_dirty = true;
|
||||
} else {
|
||||
/* 128-bit formats are unusupported */
|
||||
if (util_format_get_blocksizebits(fb->cbufs[i]->format) > 64) {
|
||||
if (tex->surface.bpe > 8) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -838,6 +838,7 @@ void si_resource_copy_region(struct pipe_context *ctx,
|
|||
const struct pipe_box *src_box)
|
||||
{
|
||||
struct si_context *sctx = (struct si_context *)ctx;
|
||||
struct r600_texture *rsrc = (struct r600_texture*)src;
|
||||
struct pipe_surface *dst_view, dst_templ;
|
||||
struct pipe_sampler_view src_templ, *src_view;
|
||||
unsigned dst_width, dst_height, src_width0, src_height0;
|
||||
|
|
@ -867,7 +868,7 @@ void si_resource_copy_region(struct pipe_context *ctx,
|
|||
|
||||
if (util_format_is_compressed(src->format) ||
|
||||
util_format_is_compressed(dst->format)) {
|
||||
unsigned blocksize = util_format_get_blocksize(src->format);
|
||||
unsigned blocksize = rsrc->surface.bpe;
|
||||
|
||||
if (blocksize == 8)
|
||||
src_templ.format = PIPE_FORMAT_R16G16B16A16_UINT; /* 64-bit block */
|
||||
|
|
@ -909,7 +910,7 @@ void si_resource_copy_region(struct pipe_context *ctx,
|
|||
sbox.width = util_format_get_nblocksx(src->format, src_box->width);
|
||||
src_box = &sbox;
|
||||
} else {
|
||||
unsigned blocksize = util_format_get_blocksize(src->format);
|
||||
unsigned blocksize = rsrc->surface.bpe;
|
||||
|
||||
switch (blocksize) {
|
||||
case 1:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue