Merge commit 'origin/gallium-master-merge'
[mesa.git] / src / gallium / drivers / nv30 / nv30_state_blend.c
1 #include "nv30_context.h"
2
3 static boolean
4 nv30_state_blend_validate(struct nv30_context *nv30)
5 {
6 so_ref(nv30->blend->so, &nv30->state.hw[NV30_STATE_BLEND]);
7 return TRUE;
8 }
9
10 struct nv30_state_entry nv30_state_blend = {
11 .validate = nv30_state_blend_validate,
12 .dirty = {
13 .pipe = NV30_NEW_BLEND,
14 .hw = NV30_STATE_BLEND
15 }
16 };
17
18 static boolean
19 nv30_state_blend_colour_validate(struct nv30_context *nv30)
20 {
21 struct nouveau_stateobj *so = so_new(2, 0);
22 struct pipe_blend_color *bcol = &nv30->blend_colour;
23
24 so_method(so, nv30->screen->rankine, NV34TCL_BLEND_COLOR, 1);
25 so_data (so, ((float_to_ubyte(bcol->color[3]) << 24) |
26 (float_to_ubyte(bcol->color[0]) << 16) |
27 (float_to_ubyte(bcol->color[1]) << 8) |
28 (float_to_ubyte(bcol->color[2]) << 0)));
29
30 so_ref(so, &nv30->state.hw[NV30_STATE_BCOL]);
31 return TRUE;
32 }
33
34 struct nv30_state_entry nv30_state_blend_colour = {
35 .validate = nv30_state_blend_colour_validate,
36 .dirty = {
37 .pipe = NV30_NEW_BCOL,
38 .hw = NV30_STATE_BCOL
39 }
40 };