summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nv50
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2016-10-19 22:36:03 -0400
committerIlia Mirkin <[email protected]>2016-10-21 02:28:26 -0400
commit8cf0f057130ffb322344dbda8d18c93836ef6fed (patch)
tree1c705c20b0786727a24ae1137254352ad5f4b5f6 /src/gallium/drivers/nouveau/nv50
parent811eb7f178b8b85ac299121ac09a3180b9b55da2 (diff)
nv50,nvc0: don't keep track of whether fb rt0 is integer-only
This reverts commits 1af0641db345209c076e9b1ba4dca7524541671a and a6ad49cbbd599aec054d0a3163fff5ad724f2b18. st/mesa adjusts the rasterizer state for us now. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_state.c10
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_state_validate.c21
-rw-r--r--src/gallium/drivers/nouveau/nv50/nv50_stateobj.h2
3 files changed, 11 insertions, 22 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c
index 57b23e6af5c..99d70d129c2 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c
@@ -119,6 +119,7 @@ nv50_blend_state_create(struct pipe_context *pipe,
struct nv50_blend_stateobj *so = CALLOC_STRUCT(nv50_blend_stateobj);
int i;
bool emit_common_func = cso->rt[0].blend_enable;
+ uint32_t ms;
if (nv50_context(pipe)->screen->tesla->oclass >= NVA3_3D_CLASS) {
SB_BEGIN_3D(so, BLEND_INDEPENDENT, 1);
@@ -190,6 +191,15 @@ nv50_blend_state_create(struct pipe_context *pipe,
SB_DATA (so, nv50_colormask(cso->rt[0].colormask));
}
+ ms = 0;
+ if (cso->alpha_to_coverage)
+ ms |= NV50_3D_MULTISAMPLE_CTRL_ALPHA_TO_COVERAGE;
+ if (cso->alpha_to_one)
+ ms |= NV50_3D_MULTISAMPLE_CTRL_ALPHA_TO_ONE;
+
+ SB_BEGIN_3D(so, MULTISAMPLE_CTRL, 1);
+ SB_DATA (so, ms);
+
assert(so->size <= ARRAY_SIZE(so->state));
return so;
}
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c b/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
index 5a3bb3e719a..c6f0363075a 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_state_validate.c
@@ -1,5 +1,4 @@
-#include "util/u_format.h"
#include "util/u_viewport.h"
#include "nv50/nv50_context.h"
@@ -348,25 +347,6 @@ nv50_validate_derived_2(struct nv50_context *nv50)
}
static void
-nv50_validate_derived_3(struct nv50_context *nv50)
-{
- struct nouveau_pushbuf *push = nv50->base.pushbuf;
- struct pipe_framebuffer_state *fb = &nv50->framebuffer;
- uint32_t ms = 0;
-
- if ((!fb->nr_cbufs || !fb->cbufs[0] ||
- !util_format_is_pure_integer(fb->cbufs[0]->format)) && nv50->blend) {
- if (nv50->blend->pipe.alpha_to_coverage)
- ms |= NV50_3D_MULTISAMPLE_CTRL_ALPHA_TO_COVERAGE;
- if (nv50->blend->pipe.alpha_to_one)
- ms |= NV50_3D_MULTISAMPLE_CTRL_ALPHA_TO_ONE;
- }
-
- BEGIN_NV04(push, NV50_3D(MULTISAMPLE_CTRL), 1);
- PUSH_DATA (push, ms);
-}
-
-static void
nv50_validate_clip(struct nv50_context *nv50)
{
struct nouveau_pushbuf *push = nv50->base.pushbuf;
@@ -535,7 +515,6 @@ validate_list_3d[] = {
{ nv50_validate_derived_rs, NV50_NEW_3D_FRAGPROG | NV50_NEW_3D_RASTERIZER |
NV50_NEW_3D_VERTPROG | NV50_NEW_3D_GMTYPROG },
{ nv50_validate_derived_2, NV50_NEW_3D_ZSA | NV50_NEW_3D_FRAMEBUFFER },
- { nv50_validate_derived_3, NV50_NEW_3D_BLEND | NV50_NEW_3D_FRAMEBUFFER },
{ nv50_validate_clip, NV50_NEW_3D_CLIP | NV50_NEW_3D_RASTERIZER |
NV50_NEW_3D_VERTPROG | NV50_NEW_3D_GMTYPROG },
{ nv50_constbufs_validate, NV50_NEW_3D_CONSTBUF },
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_stateobj.h b/src/gallium/drivers/nouveau/nv50/nv50_stateobj.h
index 9598b04e0f4..579da9a110c 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_stateobj.h
+++ b/src/gallium/drivers/nouveau/nv50/nv50_stateobj.h
@@ -19,7 +19,7 @@
struct nv50_blend_stateobj {
struct pipe_blend_state pipe;
int size;
- uint32_t state[82]; // TODO: allocate less if !independent_blend_enable
+ uint32_t state[84]; // TODO: allocate less if !independent_blend_enable
};
struct nv50_rasterizer_stateobj {