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);
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;
}
-#include "util/u_format.h"
#include "util/u_viewport.h"
#include "nv50/nv50_context.h"
}
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;
{ 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 },
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 {
struct nvc0_blend_stateobj *so = CALLOC_STRUCT(nvc0_blend_stateobj);
int i;
int r; /* reference */
+ uint32_t ms;
uint8_t blend_en = 0;
bool indep_masks = false;
bool indep_funcs = false;
}
}
+ 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 <= ARRAY_SIZE(so->state));
return so;
}
-#include "util/u_format.h"
#include "util/u_framebuffer.h"
#include "util/u_math.h"
#include "util/u_viewport.h"
}
static void
-nvc0_validate_blend_fb(struct nvc0_context *nvc0)
-{
- struct nouveau_pushbuf *push = nvc0->base.pushbuf;
- struct pipe_framebuffer_state *fb = &nvc0->framebuffer;
- uint32_t ms = 0;
-
- if ((!fb->nr_cbufs || !fb->cbufs[0] ||
- !util_format_is_pure_integer(fb->cbufs[0]->format)) && nvc0->blend) {
- if (nvc0->blend->pipe.alpha_to_coverage)
- ms |= NVC0_3D_MULTISAMPLE_CTRL_ALPHA_TO_COVERAGE;
- if (nvc0->blend->pipe.alpha_to_one)
- ms |= NVC0_3D_MULTISAMPLE_CTRL_ALPHA_TO_ONE;
- }
-
- BEGIN_NVC0(push, NVC0_3D(MULTISAMPLE_CTRL), 1);
- PUSH_DATA (push, ms);
-}
-
-static void
nvc0_validate_rast_fb(struct nvc0_context *nvc0)
{
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
{ nvc0_validate_fp_zsa_rast, NVC0_NEW_3D_FRAGPROG | NVC0_NEW_3D_ZSA |
NVC0_NEW_3D_RASTERIZER },
{ nvc0_validate_zsa_fb, NVC0_NEW_3D_ZSA | NVC0_NEW_3D_FRAMEBUFFER },
- { nvc0_validate_blend_fb, NVC0_NEW_3D_BLEND | NVC0_NEW_3D_FRAMEBUFFER },
{ nvc0_validate_rast_fb, NVC0_NEW_3D_RASTERIZER | NVC0_NEW_3D_FRAMEBUFFER },
{ nvc0_validate_clip, NVC0_NEW_3D_CLIP | NVC0_NEW_3D_RASTERIZER |
NVC0_NEW_3D_VERTPROG |
struct nvc0_blend_stateobj {
struct pipe_blend_state pipe;
int size;
- uint32_t state[70];
+ uint32_t state[72];
};
struct nvc0_rasterizer_stateobj {