From d507cd749b468751b880194a52ea7171b5dac75c Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 9 Dec 2008 09:29:08 -0800 Subject: tnl: Avoid undefined input value use in insert_3f_viewport_2(). Bug #16520. --- src/mesa/tnl/t_vertex_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index f763522f91..9812f8c808 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -113,7 +113,7 @@ static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLu DEBUG_INSERT; out[0] = vp[0] * in[0] + vp[12]; out[1] = vp[5] * in[1] + vp[13]; - out[2] = vp[10] * in[2] + vp[14]; + out[2] = vp[14]; } static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v, -- cgit v1.2.3 From 6e29a3c8e2dc920b6216a0df6357abd8234f1ec4 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 9 Dec 2008 11:42:24 -0800 Subject: tnl: Fix typo that resulted in fallback from SSE for EMIT_3UB_3F_RGB/BGR. Bug #16520 --- src/mesa/tnl/t_vertex_sse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index 76043bd1b5..d8021a3d2c 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -539,8 +539,8 @@ static GLboolean build_vertex_emit( struct x86_program *p ) } else { _mesa_printf("Can't emit 3ub\n"); + return GL_FALSE; /* add this later */ } - return GL_FALSE; /* add this later */ break; case EMIT_4UB_4F_RGBA: -- cgit v1.2.3 From b66495a0d915f5d5cc5ab50c843c9c1b296a5851 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 9 Dec 2008 13:10:56 -0800 Subject: tnl: Optimize SSE load[23]f_1 since they don't need the identity swizzle. SSE movss from memory zeroes out everything above the destination dword, so we get the (a, 0) or (a, 0, 0) result that these functions needed. Bug #16520. --- src/mesa/tnl/t_vertex_sse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index d8021a3d2c..07adc1ed79 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -146,7 +146,8 @@ static void emit_load3f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { - emit_load4f_1(p, dest, arg0); + /* Loading from memory erases the upper bits. */ + sse_movss(&p->func, dest, arg0); } static void emit_load2f_2( struct x86_program *p, @@ -160,7 +161,8 @@ static void emit_load2f_1( struct x86_program *p, struct x86_reg dest, struct x86_reg arg0 ) { - emit_load4f_1(p, dest, arg0); + /* Loading from memory erases the upper bits. */ + sse_movss(&p->func, dest, arg0); } static void emit_load1f_1( struct x86_program *p, -- cgit v1.2.3 From 3b9bc821e1dfe39905585746166183264c335416 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 9 Dec 2008 13:15:05 -0800 Subject: tnl: Fix zeroing of the 3ub part of a 3ub+1ub attrib pair in SSE. Bug #16520. --- src/mesa/tnl/t_vertex_sse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c index 07adc1ed79..7a255d680a 100644 --- a/src/mesa/tnl/t_vertex_sse.c +++ b/src/mesa/tnl/t_vertex_sse.c @@ -354,6 +354,7 @@ static GLboolean build_vertex_emit( struct x86_program *p ) struct x86_reg temp = x86_make_reg(file_XMM, 0); struct x86_reg vp0 = x86_make_reg(file_XMM, 1); struct x86_reg vp1 = x86_make_reg(file_XMM, 2); + struct x86_reg temp2 = x86_make_reg(file_XMM, 3); GLubyte *fixup, *label; /* Push a few regs? @@ -526,7 +527,8 @@ static GLboolean build_vertex_emit( struct x86_program *p ) sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z)); get_src_ptr(p, srcECX, vtxESI, &a[1]); - emit_load(p, temp, 1, x86_deref(srcECX), a[1].inputsize); + emit_load(p, temp2, 1, x86_deref(srcECX), a[1].inputsize); + sse_movss(&p->func, temp, temp2); update_src_ptr(p, srcECX, vtxESI, &a[1]); /* Rearrange and possibly do BGR conversion: -- cgit v1.2.3 From c8b505d8260cccf289c947c629471df8f5c81c0d Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Thu, 11 Dec 2008 14:03:00 +0800 Subject: i915: fallback for cube map texture. The i915 (and related graphics cores) only support TEXCOORDMODE_CLAMP and TEXCOORDMODE_CUBE when using cube map texture coordinates, so fall back to software rendering for other modes to avoid potential gpu hang issue. This fixes scorched3d issue on 945GM(see bug 14539). --- src/mesa/drivers/dri/i915/i915_texstate.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index d1b0dcdf31..d53e2cbd5a 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -295,6 +295,13 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) wt == GL_CLAMP_TO_BORDER || wr == GL_CLAMP_TO_BORDER)) return GL_FALSE; + /* Only support TEXCOORDMODE_CLAMP_EDGE and TEXCOORDMODE_CUBE (not + * used) when using cube map texture coordinates + */ + if (tObj->Target == GL_TEXTURE_CUBE_MAP_ARB && + (((ws != GL_CLAMP) && (ws != GL_CLAMP_TO_EDGE)) || + ((wr != GL_CLAMP) && (wr != GL_CLAMP_TO_EDGE)))) + return GL_FALSE; state[I915_TEXREG_SS3] = ss3; /* SS3_NORMALIZED_COORDS */ -- cgit v1.2.3 From 8b69c42b356d51c3a37bc0af41738b016c2adc5b Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Fri, 12 Dec 2008 10:02:05 +0800 Subject: intel: check for null texture. (fix #13902) --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index b96ba72853..c677ddd63c 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -111,9 +111,9 @@ intel_miptree_create(struct intel_context *intel, first_level, last_level, width0, height0, depth0, cpp, compress_byte); /* - * pitch == 0 indicates the null texture + * pitch == 0 || height == 0 indicates the null texture */ - if (!mt || !mt->pitch) + if (!mt || !mt->pitch || !mt->total_height) return NULL; mt->region = intel_region_alloc(intel, -- cgit v1.2.3