summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
diff options
context:
space:
mode:
authorIlia Mirkin <imirkin@alum.mit.edu>2014-03-06 00:51:48 -0500
committerIlia Mirkin <imirkin@alum.mit.edu>2014-03-09 01:32:06 -0500
commit253314d4872ab4c4f01c0f1cd31ce4b71877ec30 (patch)
treef66554730b614b6a2889bb657ca10ad5c76e103f /src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
parent507f0230d4ca2238c818006499e21abb4c133203 (diff)
nv50: adjust blit_3d handling of ms output textures
This fixes some unwanted scaling when the output is multisampled. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at> Cc: "10.0 10.1" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_surface.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_surface.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
index 32d234e3453..d1bcfda3d16 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_surface.c
@@ -855,6 +855,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
float x0, x1, y0, y1, z;
float dz;
float x_range, y_range;
+ float tri_x, tri_y;
blit->mode = nv50_blit_select_mode(info);
blit->color_mask = nv50_blit_derive_color_mask(info);
@@ -877,8 +878,11 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
x0 = (float)info->src.box.x - x_range * (float)info->dst.box.x;
y0 = (float)info->src.box.y - y_range * (float)info->dst.box.y;
- x1 = x0 + 16384.0f * x_range;
- y1 = y0 + 16384.0f * y_range;
+ tri_x = 65536 << nv50_miptree(dst)->ms_x;
+ tri_y = 65536 << nv50_miptree(dst)->ms_y;
+
+ x1 = x0 + tri_x * x_range;
+ y1 = y0 + tri_y * y_range;
x0 *= (float)(1 << nv50_miptree(src)->ms_x);
x1 *= (float)(1 << nv50_miptree(src)->ms_x);
@@ -953,7 +957,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
PUSH_DATAf(push, z);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, 0x74200);
- PUSH_DATAf(push, 16384 << nv50_miptree(dst)->ms_x);
+ PUSH_DATAf(push, tri_x);
PUSH_DATAf(push, 0.0f);
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 4);
PUSH_DATA (push, 0x74301);
@@ -963,7 +967,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info)
BEGIN_NVC0(push, NVC0_3D(VTX_ATTR_DEFINE), 3);
PUSH_DATA (push, 0x74200);
PUSH_DATAf(push, 0.0f);
- PUSH_DATAf(push, 16384 << nv50_miptree(dst)->ms_y);
+ PUSH_DATAf(push, tri_y);
IMMED_NVC0(push, NVC0_3D(VERTEX_END_GL), 0);
}