summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorNian Wu <[email protected]>2007-03-14 17:00:15 +0800
committerNian Wu <[email protected]>2007-03-14 17:00:15 +0800
commit805b1cf4821aa807ce0f87d03dc464c0ee01a33a (patch)
tree5aac096ed7372f84b1afa37cebd72768fe010632 /src/mesa
parent4110fac38958003935f64e278d3a7b880523efe2 (diff)
parenta6cc9ab493a2efa9a0ea91cddba0e85c8c8c83f1 (diff)
Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i810/i810context.c2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_tnl.c27
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_context.c2
-rw-r--r--src/mesa/drivers/dri/mga/mga_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/r128/r128_context.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_ioctl.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h8
-rw-r--r--src/mesa/drivers/dri/r300/r300_render.c8
-rw-r--r--src/mesa/drivers/dri/r300/radeon_mm.c2
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_context.c2
-rw-r--r--src/mesa/drivers/dri/savage/savage_xmesa.c2
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.c2
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.c2
-rw-r--r--src/mesa/tnl/t_vp_build.c12
-rw-r--r--src/mesa/x86/read_rgba_span_x86.S2
15 files changed, 47 insertions, 32 deletions
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index db8f7a19a23..f0332d9ae8b 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -65,6 +65,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
#include "extension_helper.h"
#ifndef I810_DEBUG
@@ -129,6 +130,7 @@ const struct dri_extension card_extensions[] =
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_EXT_texture_env_combine", NULL },
diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
index c05a9b5ea10..e22a26b2917 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
@@ -850,14 +850,13 @@ static struct ureg calculate_light_attenuation( struct tnl_program *p,
/* Calculate spot attenuation:
*/
if (!p->state->unit[i].light_spotcutoff_is_180) {
- struct ureg spot_dir = register_param3(p, STATE_LIGHT, i,
- STATE_SPOT_DIRECTION);
+ struct ureg spot_dir_norm = register_param3(p, STATE_INTERNAL,
+ STATE_SPOT_DIR_NORMALIZED, i);
struct ureg spot = get_temp(p);
struct ureg slt = get_temp(p);
-
- emit_normalize_vec3( p, spot, spot_dir ); /* XXX: precompute! */
- emit_op2(p, OPCODE_DP3, spot, 0, ureg_negate(VPpli), spot);
- emit_op2(p, OPCODE_SLT, slt, 0, swizzle1(spot_dir,W), spot);
+
+ emit_op2(p, OPCODE_DP3, spot, 0, ureg_negate(VPpli), spot_dir_norm);
+ emit_op2(p, OPCODE_SLT, slt, 0, swizzle1(spot_dir_norm,W), spot);
emit_op2(p, OPCODE_POW, spot, 0, spot, swizzle1(attenuation, W));
emit_op2(p, OPCODE_MUL, att, 0, slt, spot);
@@ -1166,7 +1165,8 @@ static void build_fog( struct tnl_program *p )
if (p->state->fog_option &&
p->state->tnl_do_vertex_fog) {
- struct ureg params = register_param1(p, STATE_FOG_PARAMS);
+ struct ureg params = register_param2(p, STATE_INTERNAL,
+ STATE_FOG_PARAMS_OPTIMIZED);
struct ureg tmp = get_temp(p);
struct ureg id = get_identity_param(p);
@@ -1174,8 +1174,7 @@ static void build_fog( struct tnl_program *p )
switch (p->state->fog_option) {
case FOG_LINEAR: {
- emit_op1(p, OPCODE_ABS, tmp, 0, input);
- emit_op2(p, OPCODE_SUB, tmp, 0, swizzle1(params,Z), tmp);
+ emit_op3(p, OPCODE_MAD, tmp, 0, input, swizzle1(params,X), swizzle1(params,Y));
emit_op2(p, OPCODE_MUL, tmp, 0, tmp, swizzle1(params,W));
emit_op2(p, OPCODE_MAX, tmp, 0, tmp, swizzle1(id,X)); /* saturate */
emit_op2(p, OPCODE_MIN, fog, WRITEMASK_X, tmp, swizzle1(id,W));
@@ -1183,15 +1182,13 @@ static void build_fog( struct tnl_program *p )
}
case FOG_EXP:
emit_op1(p, OPCODE_ABS, tmp, 0, input);
- emit_op2(p, OPCODE_MUL, tmp, 0, tmp, swizzle1(params,X));
- emit_op2(p, OPCODE_POW, fog, WRITEMASK_X,
- register_const1f(p, M_E), ureg_negate(tmp));
+ emit_op2(p, OPCODE_MUL, tmp, 0, tmp, swizzle1(params,Z));
+ emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, ureg_negate(tmp));
break;
case FOG_EXP2:
- emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,X));
+ emit_op2(p, OPCODE_MUL, tmp, 0, input, swizzle1(params,W));
emit_op2(p, OPCODE_MUL, tmp, 0, tmp, tmp);
- emit_op2(p, OPCODE_POW, fog, WRITEMASK_X,
- register_const1f(p, M_E), ureg_negate(tmp));
+ emit_op1(p, OPCODE_EX2, fog, WRITEMASK_X, ureg_negate(tmp));
break;
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index 5a6c301da2d..ad661e198cd 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -58,6 +58,7 @@
#include "vblank.h"
#define need_GL_ARB_multisample
+#define need_GL_ARB_vertex_buffer_object
#include "extension_helper.h"
#ifndef MACH64_DEBUG
@@ -83,6 +84,7 @@ const struct dri_extension card_extensions[] =
{
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
{ "GL_MESA_ycbcr_texture", NULL },
{ "GL_SGIS_generate_mipmap", NULL },
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index 67a6f8bdf09..ca2c8faa183 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -72,6 +72,7 @@
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_ARB_vertex_program
#define need_GL_EXT_fog_coord
#define need_GL_EXT_multi_draw_arrays
@@ -401,6 +402,7 @@ static const struct dri_extension card_extensions[] =
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_rectangle", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_multi_draw_arrays", GL_EXT_multi_draw_arrays_functions },
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index 89ddafa02a5..95e54a6af50 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -68,6 +68,7 @@ int R128_DEBUG = 0;
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
@@ -80,6 +81,7 @@ const struct dri_extension card_extensions[] =
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_env_add", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_texture_edge_clamp", NULL },
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index f0741f978d4..f674fea7c9e 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -162,11 +162,11 @@ static void r300ClearBuffer(r300ContextPtr r300, int flags, int buffer)
cmd2[8].u = r300PackFloat32(ctx->Color.ClearColor[3]);
reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(R300_RB3D_DSTCACHE_0A);
+ e32(R300_RB3D_DSTCACHE_UNKNOWN_0A);
reg_start(R300_RB3D_ZCACHE_CTLSTAT,0);
- e32(R300_RB3D_ZCACHE_CTLSTAT_03);
+ e32(R300_RB3D_ZCACHE_UNKNOWN_03);
cp_wait(rmesa, R300_WAIT_3D | R300_WAIT_3D_CLEAN);
}
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index f9accadf61c..3de15752b16 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -1324,8 +1324,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Set to 0A before 3D operations, set to 02 afterwards.
*/
#define R300_RB3D_DSTCACHE_CTLSTAT 0x4E4C
-# define R300_RB3D_DSTCACHE_02 0x00000002
-# define R300_RB3D_DSTCACHE_0A 0x0000000A
+# define R300_RB3D_DSTCACHE_UNKNOWN_02 0x00000002
+# define R300_RB3D_DSTCACHE_UNKNOWN_0A 0x0000000A
/* gap */
/* There seems to be no "write only" setting, so use Z-test = ALWAYS
@@ -1397,8 +1397,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
/* gap */
#define R300_RB3D_ZCACHE_CTLSTAT 0x4F18 /* GUESS */
-# define R300_RB3D_ZCACHE_CTLSTAT_01 0x1
-# define R300_RB3D_ZCACHE_CTLSTAT_03 0x3
+# define R300_RB3D_ZCACHE_UNKNOWN_01 0x1
+# define R300_RB3D_ZCACHE_UNKNOWN_03 0x3
/* gap */
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index 659ec3ff54c..0864558e8dc 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -344,10 +344,10 @@ GLboolean r300_run_vb_render(GLcontext *ctx,
r300UpdateShaderStates(rmesa);
reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(R300_RB3D_DSTCACHE_0A);
+ e32(R300_RB3D_DSTCACHE_UNKNOWN_0A);
reg_start(R300_RB3D_ZCACHE_CTLSTAT,0);
- e32(R300_RB3D_ZCACHE_CTLSTAT_03);
+ e32(R300_RB3D_ZCACHE_UNKNOWN_03);
r300EmitState(rmesa);
@@ -360,10 +360,10 @@ GLboolean r300_run_vb_render(GLcontext *ctx,
}
reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(R300_RB3D_DSTCACHE_0A /*R300_RB3D_DSTCACHE_02*/);
+ e32(R300_RB3D_DSTCACHE_UNKNOWN_0A /*R300_RB3D_DSTCACHE_UNKNOWN_02*/);
reg_start(R300_RB3D_ZCACHE_CTLSTAT,0);
- e32(R300_RB3D_ZCACHE_CTLSTAT_03 /*R300_RB3D_ZCACHE_CTLSTAT_01*/);
+ e32(R300_RB3D_ZCACHE_UNKNOWN_03 /*R300_RB3D_ZCACHE_UNKNOWN_01*/);
#ifdef USER_BUFFERS
r300UseArrays(ctx);
diff --git a/src/mesa/drivers/dri/r300/radeon_mm.c b/src/mesa/drivers/dri/r300/radeon_mm.c
index 065f288e4ca..1502dac8fc3 100644
--- a/src/mesa/drivers/dri/r300/radeon_mm.c
+++ b/src/mesa/drivers/dri/r300/radeon_mm.c
@@ -284,7 +284,7 @@ static void emit_lin_cp(r300ContextPtr rmesa, unsigned long dst, unsigned long s
}
reg_start(R300_RB3D_DSTCACHE_CTLSTAT,0);
- e32(R300_RB3D_DSTCACHE_0A);
+ e32(R300_RB3D_DSTCACHE_UNKNOWN_0A);
reg_start(0x342c,0);
e32(0x00000005);
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 0d25951b648..d7c2d1407d6 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -64,6 +64,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_blend_minmax
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
@@ -122,6 +123,7 @@ const struct dri_extension card_extensions[] =
{ "GL_ARB_texture_env_crossbar", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_blend_logic_op", NULL },
{ "GL_EXT_blend_subtract", GL_EXT_blend_minmax_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c
index f859217069c..43422db9a82 100644
--- a/src/mesa/drivers/dri/savage/savage_xmesa.c
+++ b/src/mesa/drivers/dri/savage/savage_xmesa.c
@@ -61,6 +61,7 @@
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
@@ -135,6 +136,7 @@ static const struct dri_extension card_extensions[] =
{ "GL_ARB_multisample", GL_ARB_multisample_functions },
{ "GL_ARB_multitexture", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_stencil_wrap", NULL },
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c
index 89b81da347a..b21df0a61ea 100644
--- a/src/mesa/drivers/dri/sis/sis_context.c
+++ b/src/mesa/drivers/dri/sis/sis_context.c
@@ -60,6 +60,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#define need_GL_ARB_multisample
#define need_GL_ARB_texture_compression
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
@@ -79,6 +80,7 @@ struct dri_extension card_extensions[] =
{ "GL_ARB_texture_border_clamp", NULL },
{ "GL_ARB_texture_compression", GL_ARB_texture_compression_functions },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
/*{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },*/
{ "GL_EXT_texture_lod_bias", NULL },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c
index bc5a414df60..89533421b46 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.c
+++ b/src/mesa/drivers/dri/unichrome/via_context.c
@@ -64,6 +64,7 @@
#define need_GL_ARB_multisample
#define need_GL_ARB_point_parameters
+#define need_GL_ARB_vertex_buffer_object
#define need_GL_EXT_fog_coord
#define need_GL_EXT_secondary_color
#include "extension_helper.h"
@@ -372,6 +373,7 @@ const struct dri_extension card_extensions[] =
{ "GL_ARB_texture_env_combine", NULL },
/* { "GL_ARB_texture_env_dot3", NULL }, */
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_EXT_fog_coord", GL_EXT_fog_coord_functions },
{ "GL_EXT_secondary_color", GL_EXT_secondary_color_functions },
{ "GL_EXT_stencil_wrap", NULL },
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index 2a97a1c8c76..2663d993049 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -1329,14 +1329,16 @@ static void build_pointsize( struct tnl_program *p )
struct ureg out = register_output(p, VERT_RESULT_PSIZ);
struct ureg ut = get_temp(p);
+ /* dist = |eyez| */
+ emit_op1(p, OPCODE_ABS, ut, WRITEMASK_Y, swizzle1(eye, Z));
/* p1 + dist * (p2 + dist * p3); */
- emit_op3(p, OPCODE_MAD, ut, 0, negate(swizzle1(eye, Z)),
+ emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y),
swizzle1(state_attenuation, Z), swizzle1(state_attenuation, Y));
- emit_op3(p, OPCODE_MAD, ut, 0, negate(swizzle1(eye, Z)),
+ emit_op3(p, OPCODE_MAD, ut, WRITEMASK_X, swizzle1(ut, Y),
ut, swizzle1(state_attenuation, X));
/* 1 / sqrt(factor) */
- emit_op1(p, OPCODE_RSQ, ut, 0, ut );
+ emit_op1(p, OPCODE_RSQ, ut, WRITEMASK_X, ut );
#if 1
/* out = pointSize / sqrt(factor) */
@@ -1344,8 +1346,8 @@ static void build_pointsize( struct tnl_program *p )
#else
/* not sure, might make sense to do clamping here,
but it's not done in t_vb_points neither */
- emit_op2(p, OPCODE_MUL, ut, 0, ut, state_size);
- emit_op2(p, OPCODE_MAX, ut, 0, ut, swizzle1(state_size, Y));
+ emit_op2(p, OPCODE_MUL, ut, WRITEMASK_X, ut, state_size);
+ emit_op2(p, OPCODE_MAX, ut, WRITEMASK_X, ut, swizzle1(state_size, Y));
emit_op2(p, OPCODE_MIN, out, WRITEMASK_X, ut, swizzle1(state_size, Z));
#endif
diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S
index a6902838164..3cbcd719960 100644
--- a/src/mesa/x86/read_rgba_span_x86.S
+++ b/src/mesa/x86/read_rgba_span_x86.S
@@ -369,7 +369,7 @@ _generic_read_RGBA_span_BGRA8888_REV_SSE2:
movdqa mask, %xmm1
movdqa mask+16, %xmm2
*/
- LOAD_MASK(movdqa,%xmm1,%xmm2)
+ LOAD_MASK(movdqu,%xmm1,%xmm2)
movl 12(%esp), %ebx /* source pointer */
movl 20(%esp), %edx /* number of pixels to copy */