summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_tex.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-04-06 14:52:05 +0200
committerChristoph Bumiller <[email protected]>2013-04-12 13:02:18 +0200
commit4da54c91d24da891c56957f29274e7821c8254f6 (patch)
tree8bd4fa434f7494a3bc9049d7304f49bb8dd7f264 /src/gallium/drivers/nvc0/nvc0_tex.c
parent71c1c8a9b89ca1ecca1857c53cd8c648c9c9a871 (diff)
nvc0: implement multisample textures
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_tex.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_tex.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_tex.c b/src/gallium/drivers/nvc0/nvc0_tex.c
index ffd285473a9..c11d3f791fe 100644
--- a/src/gallium/drivers/nvc0/nvc0_tex.c
+++ b/src/gallium/drivers/nvc0/nvc0_tex.c
@@ -78,6 +78,7 @@ nvc0_create_texture_view(struct pipe_context *pipe,
uint64_t address;
uint32_t *tic;
uint32_t swz[4];
+ uint32_t width, height;
uint32_t depth;
struct nv50_tic_entry *view;
struct nv50_miptree *mt;
@@ -168,7 +169,6 @@ nvc0_create_texture_view(struct pipe_context *pipe,
case PIPE_TEXTURE_1D:
tic[2] |= NV50_TIC_2_TARGET_1D;
break;
-/* case PIPE_TEXTURE_2D_MS: */
case PIPE_TEXTURE_2D:
tic[2] |= NV50_TIC_2_TARGET_2D;
break;
@@ -185,7 +185,6 @@ nvc0_create_texture_view(struct pipe_context *pipe,
case PIPE_TEXTURE_1D_ARRAY:
tic[2] |= NV50_TIC_2_TARGET_1D_ARRAY;
break;
-/* case PIPE_TEXTURE_2D_ARRAY_MS: */
case PIPE_TEXTURE_2D_ARRAY:
tic[2] |= NV50_TIC_2_TARGET_2D_ARRAY;
break;
@@ -194,30 +193,35 @@ nvc0_create_texture_view(struct pipe_context *pipe,
tic[2] |= NV50_TIC_2_TARGET_CUBE_ARRAY;
break;
default:
- NOUVEAU_ERR("invalid texture target: %d\n", mt->base.base.target);
+ NOUVEAU_ERR("unexpected/invalid texture target: %d\n",
+ mt->base.base.target);
return FALSE;
}
- if (mt->base.base.target == PIPE_BUFFER)
- tic[3] = mt->base.base.width0;
- else
- tic[3] = (flags & NV50_TEXVIEW_FILTER_MSAA8) ? 0x20000000 : 0x00300000;
+ tic[3] = (flags & NV50_TEXVIEW_FILTER_MSAA8) ? 0x20000000 : 0x00300000;
+
+ if (flags & NV50_TEXVIEW_ACCESS_RESOLVE) {
+ width = mt->base.base.width0 << mt->ms_x;
+ height = mt->base.base.height0 << mt->ms_y;
+ } else {
+ width = mt->base.base.width0;
+ height = mt->base.base.height0;
+ }
- tic[4] = (1 << 31) | (mt->base.base.width0 << mt->ms_x);
+ tic[4] = (1 << 31) | width;
- tic[5] = (mt->base.base.height0 << mt->ms_y) & 0xffff;
+ tic[5] = height & 0xffff;
tic[5] |= depth << 16;
tic[5] |= mt->base.base.last_level << 28;
- tic[6] = (mt->ms_x > 1) ? 0x88000000 : 0x03000000; /* sampling points */
+ /* sampling points: (?) */
+ if (flags & NV50_TEXVIEW_ACCESS_RESOLVE)
+ tic[6] = (mt->ms_x > 1) ? 0x88000000 : 0x03000000;
+ else
+ tic[6] = 0x03000000;
tic[7] = (view->pipe.u.tex.last_level << 4) | view->pipe.u.tex.first_level;
-
- /*
- if (mt->base.base.target == PIPE_TEXTURE_2D_MS ||
- mt->base.base.target == PIPE_TEXTURE_2D_ARRAY_MS)
- tic[7] |= mt->ms_mode << 12;
- */
+ tic[7] |= mt->ms_mode << 12;
return &view->pipe;
}