r300g: attempt to fix texture corruption on RV505
[mesa.git] / src / gallium / drivers / nvfx / nvfx_state_blend.c
1 #include "nvfx_context.h"
2
3 void
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 }
9
10 void
11 nvfx_state_blend_colour_validate(struct nvfx_context *nvfx)
12 {
13 struct nouveau_channel* chan = nvfx->screen->base.channel;
14 struct pipe_blend_color *bcol = &nvfx->blend_colour;
15
16 WAIT_RING(chan, 2);
17 OUT_RING(chan, RING_3D(NV34TCL_BLEND_COLOR, 1));
18 OUT_RING(chan, ((float_to_ubyte(bcol->color[3]) << 24) |
19 (float_to_ubyte(bcol->color[0]) << 16) |
20 (float_to_ubyte(bcol->color[1]) << 8) |
21 (float_to_ubyte(bcol->color[2]) << 0)));
22 }