texenvprogram: fix for ARB_draw_buffers.
[mesa.git] / src / gallium / drivers / nv40 / nv40_state_blend.c
1 #include "nv40_context.h"
2
3 static boolean
4 nv40_state_blend_validate(struct nv40_context *nv40)
5 {
6 so_ref(nv40->blend->so, &nv40->state.hw[NV40_STATE_BLEND]);
7 return TRUE;
8 }
9
10 struct nv40_state_entry nv40_state_blend = {
11 .validate = nv40_state_blend_validate,
12 .dirty = {
13 .pipe = NV40_NEW_BLEND,
14 .hw = NV40_STATE_BLEND
15 }
16 };
17
18 static boolean
19 nv40_state_blend_colour_validate(struct nv40_context *nv40)
20 {
21 struct nouveau_stateobj *so = so_new(1, 1, 0);
22 struct pipe_blend_color *bcol = &nv40->blend_colour;
23
24 so_method(so, nv40->screen->curie, NV40TCL_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, &nv40->state.hw[NV40_STATE_BCOL]);
31 so_ref(NULL, &so);
32 return TRUE;
33 }
34
35 struct nv40_state_entry nv40_state_blend_colour = {
36 .validate = nv40_state_blend_colour_validate,
37 .dirty = {
38 .pipe = NV40_NEW_BCOL,
39 .hw = NV40_STATE_BCOL
40 }
41 };