diff options
author | Chia-I Wu <[email protected]> | 2010-11-29 11:49:18 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-12-01 11:23:52 +0800 |
commit | e360f91f152615b35857a4d008d0439a3c3285a8 (patch) | |
tree | 0567639af63cafa34dcb26adbb6928432ff1870a /src/gallium/state_trackers/vega/shaders_cache.c | |
parent | 213e288e78bf5b0fb0a996cc17dfd959756c2c53 (diff) |
st/vega: Add color transformation support.
Per OpenVG 1.1. A new shader stage is added. It uses the first two
constants of the fragment shader for color transformation parameters.
Diffstat (limited to 'src/gallium/state_trackers/vega/shaders_cache.c')
-rw-r--r-- | src/gallium/state_trackers/vega/shaders_cache.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/vega/shaders_cache.c b/src/gallium/state_trackers/vega/shaders_cache.c index 49b451c1179..732d57de9a0 100644 --- a/src/gallium/state_trackers/vega/shaders_cache.c +++ b/src/gallium/state_trackers/vega/shaders_cache.c @@ -52,12 +52,13 @@ * of the pipeline. The stages are: * 1) Paint generation (color/gradient/pattern) * 2) Image composition (normal/multiply/stencil) - * 3) Mask - * 4) Extended blend (multiply/screen/darken/lighten) - * 5) Premultiply/Unpremultiply - * 6) Color transform (to black and white) + * 3) Color transform + * 4) Mask + * 5) Extended blend (multiply/screen/darken/lighten) + * 6) Premultiply/Unpremultiply + * 7) Color transform (to black and white) */ -#define SHADER_STAGES 6 +#define SHADER_STAGES 7 struct cached_shader { void *driver_shader; @@ -286,6 +287,19 @@ create_shader(struct pipe_context *pipe, assert(idx == ((!sh || sh == VEGA_IMAGE_NORMAL_SHADER) ? 1 : 2)); /* third stage */ + sh = SHADERS_GET_COLOR_TRANSFORM_SHADER(id); + switch (sh) { + case VEGA_COLOR_TRANSFORM_SHADER: + shaders[idx] = &shaders_color_transform_asm[ + (sh >> SHADERS_COLOR_TRANSFORM_SHIFT) - 1]; + assert(shaders[idx]->id == sh); + idx++; + break; + default: + break; + } + + /* fourth stage */ sh = SHADERS_GET_MASK_SHADER(id); switch (sh) { case VEGA_MASK_SHADER: @@ -297,7 +311,7 @@ create_shader(struct pipe_context *pipe, break; } - /* fourth stage */ + /* fifth stage */ sh = SHADERS_GET_BLEND_SHADER(id); switch (sh) { case VEGA_BLEND_MULTIPLY_SHADER: @@ -312,7 +326,7 @@ create_shader(struct pipe_context *pipe, break; } - /* fifth stage */ + /* sixth stage */ sh = SHADERS_GET_PREMULTIPLY_SHADER(id); switch (sh) { case VEGA_PREMULTIPLY_SHADER: @@ -326,7 +340,7 @@ create_shader(struct pipe_context *pipe, break; } - /* sixth stage */ + /* seventh stage */ sh = SHADERS_GET_BW_SHADER(id); switch (sh) { case VEGA_BW_SHADER: |