summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_state.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-07-11 18:02:27 +0200
committerChristoph Bumiller <[email protected]>2011-07-14 12:51:06 +0200
commitb2dcf880e8bcd61be59602f5a2d18c77a5fc60c1 (patch)
tree7b1846a331066f2ad75b8a493c674544d561637f /src/gallium/drivers/nvc0/nvc0_state.c
parentc011f94b7b4e1e93d5563f4bfd9906fa29e2ffb0 (diff)
nv50,nvc0: add support for multi-sample resources
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_state.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c
index b0b2065167e..9f9921cc09e 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -88,6 +88,7 @@ nvc0_blend_state_create(struct pipe_context *pipe,
{
struct nvc0_blend_stateobj *so = CALLOC_STRUCT(nvc0_blend_stateobj);
int i;
+ uint32_t ms;
so->pipe = *cso;
@@ -144,6 +145,15 @@ nvc0_blend_state_create(struct pipe_context *pipe,
SB_DATA(so, nvc0_colormask(cso->rt[i].colormask));
}
+ ms = 0;
+ if (cso->alpha_to_coverage)
+ ms |= NVC0_3D_MULTISAMPLE_CTRL_ALPHA_TO_COVERAGE;
+ if (cso->alpha_to_one)
+ ms |= NVC0_3D_MULTISAMPLE_CTRL_ALPHA_TO_ONE;
+
+ SB_BEGIN_3D(so, MULTISAMPLE_CTRL, 1);
+ SB_DATA (so, ms);
+
assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
return so;
}
@@ -190,6 +200,8 @@ nvc0_rasterizer_state_create(struct pipe_context *pipe,
SB_BEGIN_3D(so, FRAG_COLOR_CLAMP_EN, 1);
SB_DATA (so, cso->clamp_fragment_color ? 0x11111111 : 0x00000000);
+ SB_IMMED_3D(so, MULTISAMPLE_ENABLE, cso->multisample);
+
SB_IMMED_3D(so, LINE_SMOOTH_ENABLE, cso->line_smooth);
if (cso->line_smooth)
SB_BEGIN_3D(so, LINE_WIDTH_SMOOTH, 1);