nv50,nvc0: never convert in resource copy when format sizes match
If there are any cases left where the st thinks that RGBA -> BGRA will swap components, it will get what it deserves. Now the GPU's 2D engine goes unused. What a shame.
This commit is contained in:
parent
425b179faf
commit
9e466e87e6
|
@ -198,6 +198,7 @@ nv50_resource_copy_region(struct pipe_context *pipe,
|
||||||
{
|
{
|
||||||
struct nv50_screen *screen = nv50_context(pipe)->screen;
|
struct nv50_screen *screen = nv50_context(pipe)->screen;
|
||||||
int ret;
|
int ret;
|
||||||
|
boolean m2mf;
|
||||||
unsigned dst_layer = dstz, src_layer = src_box->z;
|
unsigned dst_layer = dstz, src_layer = src_box->z;
|
||||||
|
|
||||||
/* Fallback for buffers. */
|
/* Fallback for buffers. */
|
||||||
|
@ -207,9 +208,15 @@ nv50_resource_copy_region(struct pipe_context *pipe,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(src->nr_samples == dst->nr_samples);
|
||||||
|
|
||||||
|
m2mf = (src->format == dst->format) ||
|
||||||
|
(util_format_get_blocksizebits(src->format) ==
|
||||||
|
util_format_get_blocksizebits(dst->format));
|
||||||
|
|
||||||
nv04_resource(dst)->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
nv04_resource(dst)->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
||||||
|
|
||||||
if (src->format == dst->format && src->nr_samples == dst->nr_samples) {
|
if (m2mf) {
|
||||||
struct nv50_m2mf_rect drect, srect;
|
struct nv50_m2mf_rect drect, srect;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned nx = util_format_get_nblocksx(src->format, src_box->width);
|
unsigned nx = util_format_get_nblocksx(src->format, src_box->width);
|
||||||
|
|
|
@ -205,6 +205,7 @@ nvc0_resource_copy_region(struct pipe_context *pipe,
|
||||||
{
|
{
|
||||||
struct nvc0_screen *screen = nvc0_context(pipe)->screen;
|
struct nvc0_screen *screen = nvc0_context(pipe)->screen;
|
||||||
int ret;
|
int ret;
|
||||||
|
boolean m2mf;
|
||||||
unsigned dst_layer = dstz, src_layer = src_box->z;
|
unsigned dst_layer = dstz, src_layer = src_box->z;
|
||||||
|
|
||||||
/* Fallback for buffers. */
|
/* Fallback for buffers. */
|
||||||
|
@ -214,9 +215,15 @@ nvc0_resource_copy_region(struct pipe_context *pipe,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(src->nr_samples == dst->nr_samples);
|
||||||
|
|
||||||
|
m2mf = (src->format == dst->format) ||
|
||||||
|
(util_format_get_blocksizebits(src->format) ==
|
||||||
|
util_format_get_blocksizebits(dst->format));
|
||||||
|
|
||||||
nv04_resource(dst)->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
nv04_resource(dst)->status |= NOUVEAU_BUFFER_STATUS_GPU_WRITING;
|
||||||
|
|
||||||
if (src->format == dst->format && src->nr_samples == dst->nr_samples) {
|
if (m2mf) {
|
||||||
struct nv50_m2mf_rect drect, srect;
|
struct nv50_m2mf_rect drect, srect;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
unsigned nx = util_format_get_nblocksx(src->format, src_box->width);
|
unsigned nx = util_format_get_nblocksx(src->format, src_box->width);
|
||||||
|
|
Loading…
Reference in New Issue