summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJesse Barnes <[email protected]>2007-09-11 03:55:40 -0700
committerJesse Barnes <[email protected]>2007-09-11 03:55:40 -0700
commit7f6decf3e4c0fe17e149a97cbf2b56b86559d409 (patch)
treea6ed41b414ae901452a5b75d3df092c84192d634 /src/mesa
parent78b7e49c846c535f6907c18a9982d07c9e9feabb (diff)
parent0aedb9a2042bef9c13358500f93acaf8459a74cb (diff)
Merge branch 'master' of ssh://git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_sampler_state.c2
-rw-r--r--src/mesa/drivers/dri/i965/intel_pixel_bitmap.c17
2 files changed, 13 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index 81fc9ef2f0c..8afefdd4353 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -178,7 +178,7 @@ static void brw_update_sampler_state( struct gl_texture_unit *texUnit,
/* Set LOD bias:
*/
- sampler->ss0.lod_bias = S_FIXED(texUnit->LodBias + texObj->LodBias, 6);
+ sampler->ss0.lod_bias = S_FIXED(CLAMP(texUnit->LodBias + texObj->LodBias, -16, 15), 6);
sampler->ss0.lod_preclamp = 1; /* OpenGL mode */
sampler->ss0.default_color_mode = 0; /* OpenGL/DX10 mode */
diff --git a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
index 23f381fe917..79c1fee9c07 100644
--- a/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/i965/intel_pixel_bitmap.c
@@ -168,7 +168,8 @@ do_blit_bitmap( GLcontext *ctx,
{
struct intel_context *intel = intel_context(ctx);
struct intel_region *dst = intel_drawbuf_region(intel);
-
+ GLfloat tmpColor[4];
+
union {
GLuint ui;
GLubyte ub[4];
@@ -183,10 +184,16 @@ do_blit_bitmap( GLcontext *ctx,
return GL_TRUE; /* even though this is an error, we're done */
}
- UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], ctx->Current.RasterColor[2]);
- UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], ctx->Current.RasterColor[1]);
- UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], ctx->Current.RasterColor[0]);
- UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], ctx->Current.RasterColor[3]);
+ COPY_4V(tmpColor, ctx->Current.RasterColor);
+
+ if (NEED_SECONDARY_COLOR(ctx)) {
+ ADD_3V(tmpColor, tmpColor, ctx->Current.RasterSecondaryColor);
+ }
+
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[0], tmpColor[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[1], tmpColor[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[2], tmpColor[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(color.ub[3], tmpColor[3]);
/* Does zoom apply to bitmaps?
*/