summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_setup.c
diff options
context:
space:
mode:
authorJames Benton <[email protected]>2012-09-13 16:04:42 +0100
committerJosé Fonseca <[email protected]>2012-11-28 19:14:36 +0000
commitfa1b481c09b14e01eca1b3db8e0854033f6dee3d (patch)
tree170810687d31e60041309682e8f923f409174077 /src/gallium/drivers/llvmpipe/lp_setup.c
parent1d3789bccbbcc814fd7b339e9f5b5631e30d9f0e (diff)
llvmpipe: Unswizzled rendering.
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c
index 60144c34bac..a06acb27b83 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup.c
@@ -390,7 +390,7 @@ lp_setup_try_clear( struct lp_setup_context *setup,
if (flags & PIPE_CLEAR_COLOR) {
for (i = 0; i < 4; i++)
- color_arg.clear_color[i] = float_to_ubyte(color[i]);
+ color_arg.clear_color[i] = color[i];
}
if (flags & PIPE_CLEAR_DEPTHSTENCIL) {
@@ -805,14 +805,26 @@ try_update_scene_state( struct lp_setup_context *setup )
if(setup->dirty & LP_SETUP_NEW_BLEND_COLOR) {
uint8_t *stored;
+ float* fstored;
unsigned i, j;
+ unsigned size;
+
+ /* Alloc u8_blend_color (16 x i8) and f_blend_color (4 or 8 x f32) */
+ size = 4 * 16 * sizeof(uint8_t);
+ size += (LP_MAX_VECTOR_LENGTH / 4) * sizeof(float);
+ stored = lp_scene_alloc_aligned(scene, size, LP_MAX_VECTOR_LENGTH);
- stored = lp_scene_alloc_aligned(scene, 4 * 16, 16);
if (!stored) {
assert(!new_scene);
return FALSE;
}
+ /* Store floating point colour */
+ fstored = (float*)(stored + 4*16);
+ for (i = 0; i < (LP_MAX_VECTOR_LENGTH / 4); ++i) {
+ fstored[i] = setup->blend_color.current.color[i % 4];
+ }
+
/* smear each blend color component across 16 ubyte elements */
for (i = 0; i < 4; ++i) {
uint8_t c = float_to_ubyte(setup->blend_color.current.color[i]);
@@ -821,7 +833,8 @@ try_update_scene_state( struct lp_setup_context *setup )
}
setup->blend_color.stored = stored;
- setup->fs.current.jit_context.blend_color = setup->blend_color.stored;
+ setup->fs.current.jit_context.u8_blend_color = stored;
+ setup->fs.current.jit_context.f_blend_color = fstored;
setup->dirty |= LP_SETUP_NEW_FS;
}