nvfx: so->sb: blend
[mesa.git] / src / gallium / drivers / nvfx / nvfx_state_blend.c
1 #include "nvfx_context.h"
2
3 static boolean
4 nvfx_state_blend_validate(struct nvfx_context *nvfx)
5 {
6 struct nouveau_channel* chan = nvfx->screen->base.channel;
7 sb_emit(chan, nvfx->blend->sb, nvfx->blend->sb_len);
8 return TRUE;
9 }
10
11 struct nvfx_state_entry nvfx_state_blend = {
12 .validate = nvfx_state_blend_validate,
13 .dirty = {
14 .pipe = NVFX_NEW_BLEND,
15 }
16 };
17
18 static boolean
19 nvfx_state_blend_colour_validate(struct nvfx_context *nvfx)
20 {
21 struct nouveau_channel* chan = nvfx->screen->base.channel;
22 struct pipe_blend_color *bcol = &nvfx->blend_colour;
23
24 WAIT_RING(chan, 2);
25 OUT_RING(chan, RING_3D(NV34TCL_BLEND_COLOR, 1));
26 OUT_RING(chan, ((float_to_ubyte(bcol->color[3]) << 24) |
27 (float_to_ubyte(bcol->color[0]) << 16) |
28 (float_to_ubyte(bcol->color[1]) << 8) |
29 (float_to_ubyte(bcol->color[2]) << 0)));
30 return TRUE;
31 }
32
33 struct nvfx_state_entry nvfx_state_blend_colour = {
34 .validate = nvfx_state_blend_colour_validate,
35 .dirty = {
36 .pipe = NVFX_NEW_BCOL,
37 }
38 };