#define NV50_3D_UNK0F8C 0x00000f8c
-#define NV50_3D_UNK0F90 0x00000f90
+#define NV50_3D_COLOR_MASK_COMMON 0x00000f90
#define NV50_3D_UNK0F94 0x00000f94
#define NV50_3D_TEX_CACHE_CTL_UNK1__MASK 0x00000030
#define NV50_3D_TEX_CACHE_CTL_UNK1__SHIFT 4
-#define NV50_3D_UNK133C 0x0000133c
+#define NV50_3D_BLEND_SEPARATE_ALPHA 0x0000133c
#define NV50_3D_BLEND_EQUATION_RGB 0x00001340
#define NV50_3D_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
#define NV50_3D_BLEND_FUNC_DST_ALPHA 0x00001358
-#define NV50_3D_UNK135C 0x0000135c
+#define NV50_3D_BLEND_ENABLE_COMMON 0x0000135c
#define NV50_3D_BLEND_ENABLE(i0) (0x00001360 + 0x4*(i0))
#define NV50_3D_BLEND_ENABLE__ESIZE 0x00000004
OUT_RING (chan, 0);
BEGIN_RING(chan, RING_3D(LINE_LAST_PIXEL), 1);
OUT_RING (chan, 0);
+ BEGIN_RING(chan, RING_3D(BLEND_SEPARATE_ALPHA), 1);
+ OUT_RING (chan, 1);
BEGIN_RING(chan, RING_3D(SCREEN_Y_CONTROL), 1);
OUT_RING (chan, 0);
so->pipe = *cso;
- SB_BEGIN_3D(so, BLEND_ENABLE(0), 8);
+ SB_BEGIN_3D(so, COLOR_MASK_COMMON, 1);
+ SB_DATA (so, !cso->independent_blend_enable);
+
+ SB_BEGIN_3D(so, BLEND_ENABLE_COMMON, 1);
+ SB_DATA (so, !cso->independent_blend_enable);
+
if (cso->independent_blend_enable) {
+ SB_BEGIN_3D(so, BLEND_ENABLE(0), 8);
for (i = 0; i < 8; ++i) {
SB_DATA(so, cso->rt[i].blend_enable);
if (cso->rt[i].blend_enable)
}
}
} else {
- for (i = 0; i < 8; ++i)
- SB_DATA(so, cso->rt[0].blend_enable);
+ SB_BEGIN_3D(so, BLEND_ENABLE(0), 1);
+ SB_DATA (so, cso->rt[0].blend_enable);
}
if (emit_common_func) {
SB_DATA (so, 0);
}
- SB_BEGIN_3D(so, COLOR_MASK(0), 8);
if (cso->independent_blend_enable) {
+ SB_BEGIN_3D(so, COLOR_MASK(0), 8);
for (i = 0; i < 8; ++i)
SB_DATA(so, nv50_colormask(cso->rt[i].colormask));
} else {
- uint32_t cmask = nv50_colormask(cso->rt[0].colormask);
- for (i = 0; i < 8; ++i)
- SB_DATA(so, cmask);
+ SB_BEGIN_3D(so, COLOR_MASK(0), 1);
+ SB_DATA (so, nv50_colormask(cso->rt[0].colormask));
}
assert(so->size <= (sizeof(so->state) / sizeof(so->state[0])));
struct nv50_blend_stateobj {
struct pipe_blend_state pipe;
int size;
- uint32_t state[78];
+ uint32_t state[82]; // TODO: allocate less if !independent_blend_enable
};
struct nv50_rasterizer_stateobj {
#define NVC0_3D_VERTEX_RUNOUT_ADDRESS_LOW 0x00000f88
+#define NVC0_3D_COLOR_MASK_COMMON 0x00000f90
+
#define NVC0_3D_DEPTH_BOUNDS(i0) (0x00000f9c + 0x4*(i0))
#define NVC0_3D_DEPTH_BOUNDS__ESIZE 0x00000004
#define NVC0_3D_DEPTH_BOUNDS__LEN 0x00000002
#define NVC0_3D_TEX_CACHE_CTL_UNK1__MASK 0x00000030
#define NVC0_3D_TEX_CACHE_CTL_UNK1__SHIFT 4
+#define NVC0_3D_BLEND_SEPARATE_ALPHA 0x0000133c
+
#define NVC0_3D_BLEND_EQUATION_RGB 0x00001340
#define NVC0_3D_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
#define NVC0_3D_BLEND_EQUATION_RGB_MIN 0x00008007
#define NVC0_3D_BLEND_FUNC_DST_ALPHA 0x00001358
+#define NVC0_3D_BLEND_ENABLE_COMMON 0x0000135c
+
#define NVC0_3D_BLEND_ENABLE(i0) (0x00001360 + 0x4*(i0))
#define NVC0_3D_BLEND_ENABLE__ESIZE 0x00000004
#define NVC0_3D_BLEND_ENABLE__LEN 0x00000008
#define NVC0_3D_TFB_VARYING_LOCS__ESIZE 0x00000004
#define NVC0_3D_TFB_VARYING_LOCS__LEN 0x00000020
-#define NVC0_3D_COLOR_MASK_BROADCAST 0x00003808
-
#define NVC0_3D_VERTEX_ARRAY_SELECT 0x00003820
#define NVC0_3D_BLEND_ENABLES 0x00003858
0x00001841, /* 0x0b: send $r3 */
};
-static const uint32_t nvc0_9097_color_mask_brdc[] =
-{
- 0x05a00021, /* maddr [NVC0_3D_COLOR_MASK(0), increment = 4] */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x000008c1, /* exit send $r1 */
- 0x00000841, /* send $r1 */
-};
-
/*
* [GL_POLYGON_MODE_FRONT] = arg;
*
BEGIN_RING(chan, RING_3D_(0x0fac), 1);
OUT_RING (chan, 0);
- BEGIN_RING(chan, RING_3D_(0x0f90), 1);
- OUT_RING (chan, 0);
}
static void
OUT_RING (chan, 1);
BEGIN_RING(chan, RING_3D(LINE_LAST_PIXEL), 1);
OUT_RING (chan, 0);
+ BEGIN_RING(chan, RING_3D(BLEND_SEPARATE_ALPHA), 1);
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, RING_3D(BLEND_ENABLE_COMMON), 1);
+ OUT_RING (chan, 0);
nvc0_magic_3d_init(chan);
MK_MACRO(NVC0_3D_GP_SELECT, nvc0_9097_gp_select);
MK_MACRO(NVC0_3D_POLYGON_MODE_FRONT, nvc0_9097_poly_mode_front);
MK_MACRO(NVC0_3D_POLYGON_MODE_BACK, nvc0_9097_poly_mode_back);
- MK_MACRO(NVC0_3D_COLOR_MASK_BROADCAST, nvc0_9097_color_mask_brdc);
BEGIN_RING(chan, RING_3D(RASTERIZE_ENABLE), 1);
OUT_RING (chan, 1);
SB_DATA (so, nvc0_blend_fac(cso->rt[0].alpha_dst_factor));
}
- SB_BEGIN_3D(so, COLOR_MASK_BROADCAST, 1);
+ SB_IMMED_3D(so, COLOR_MASK_COMMON, 1);
+ SB_BEGIN_3D(so, COLOR_MASK(0), 1);
SB_DATA (so, nvc0_colormask(cso->rt[0].colormask));
} else {
uint8_t en = 0;
}
SB_IMMED_3D(so, BLEND_ENABLES, en);
+ SB_IMMED_3D(so, COLOR_MASK_COMMON, 0);
SB_BEGIN_3D(so, COLOR_MASK(0), 8);
for (i = 0; i < 8; ++i)
SB_DATA(so, nvc0_colormask(cso->rt[i].colormask));
struct nvc0_blend_stateobj {
struct pipe_blend_state pipe;
int size;
- uint32_t state[69];
+ uint32_t state[70];
};
struct nvc0_rasterizer_stateobj {