mesa/mesa-8.0.1-git.patch

266 lines
7.9 KiB
Diff
Raw Normal View History

diff --git a/docs/relnotes-8.0.1.html b/docs/relnotes-8.0.1.html
index 8c8cd3f..29a314c 100644
--- a/docs/relnotes-8.0.1.html
+++ b/docs/relnotes-8.0.1.html
@@ -28,7 +28,9 @@ for DRI hardware acceleration.
<h2>MD5 checksums</h2>
<pre>
-tdb
+4855c2d93bd2ebd43f384bdcc92c9a27 MesaLib-8.0.1.tar.gz
+24eeebf66971809d8f40775a379b36c9 MesaLib-8.0.1.tar.bz2
+54e745d14dac5717f7f65b4e2d5c1df2 MesaLib-8.0.1.zip
</pre>
<h2>New features</h2>
diff --git a/src/gallium/auxiliary/rtasm/rtasm_cpu.c b/src/gallium/auxiliary/rtasm/rtasm_cpu.c
index 0461c81..7afcf14 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_cpu.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_cpu.c
@@ -25,43 +25,43 @@
*
**************************************************************************/
+#include "pipe/p_config.h"
+#include "rtasm_cpu.h"
+
+#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
#include "util/u_debug.h"
-#include "rtasm_cpu.h"
+#include "util/u_cpu_detect.h"
+DEBUG_GET_ONCE_BOOL_OPTION(nosse, "GALLIUM_NOSSE", FALSE);
-#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
-static boolean rtasm_sse_enabled(void)
+static struct util_cpu_caps *get_cpu_caps(void)
{
- static boolean firsttime = 1;
- static boolean enabled;
-
- /* This gets called quite often at the moment:
- */
- if (firsttime) {
- enabled = !debug_get_bool_option("GALLIUM_NOSSE", FALSE);
- firsttime = FALSE;
- }
- return enabled;
+ util_cpu_detect();
+ return &util_cpu_caps;
}
-#endif
int rtasm_cpu_has_sse(void)
{
- /* FIXME: actually detect this at run-time */
-#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
- return rtasm_sse_enabled();
-#else
- return 0;
-#endif
+ return !debug_get_option_nosse() && get_cpu_caps()->has_sse;
}
int rtasm_cpu_has_sse2(void)
{
- /* FIXME: actually detect this at run-time */
-#if defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64)
- return rtasm_sse_enabled();
+ return !debug_get_option_nosse() && get_cpu_caps()->has_sse2;
+}
+
+
#else
+
+int rtasm_cpu_has_sse(void)
+{
return 0;
-#endif
}
+
+int rtasm_cpu_has_sse2(void)
+{
+ return 0;
+}
+
+#endif
diff --git a/src/gallium/drivers/r300/compiler/radeon_program_alu.c b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
index dd1dfb3..c48f936 100644
--- a/src/gallium/drivers/r300/compiler/radeon_program_alu.c
+++ b/src/gallium/drivers/r300/compiler/radeon_program_alu.c
@@ -1165,35 +1165,79 @@ int radeonTransformDeriv(struct radeon_compiler* c,
}
/**
+ * IF Temp[0].x -> IF Temp[0].x
+ * ... -> ...
+ * KILP -> KIL -abs(Temp[0].x)
+ * ... -> ...
+ * ENDIF -> ENDIF
+ *
+ * === OR ===
+ *
* IF Temp[0].x -\
* KILP - > KIL -abs(Temp[0].x)
* ENDIF -/
*
- * This needs to be done in its own pass, because it modifies the instructions
- * before and after KILP.
+ * === OR ===
+ *
+ * IF Temp[0].x -> IF Temp[0].x
+ * ... -> ...
+ * ELSE -> ELSE
+ * ... -> ...
+ * KILP -> KIL -abs(Temp[0].x)
+ * ... -> ...
+ * ENDIF -> ENDIF
+ *
+ * === OR ===
+ *
+ * KILP -> KIL -none.1111
+ *
+ * This needs to be done in its own pass, because it might modify the
+ * instructions before and after KILP.
*/
void rc_transform_KILP(struct radeon_compiler * c, void *user)
{
struct rc_instruction * inst;
for (inst = c->Program.Instructions.Next;
inst != &c->Program.Instructions; inst = inst->Next) {
+ struct rc_instruction * if_inst;
+ unsigned in_if = 0;
if (inst->U.I.Opcode != RC_OPCODE_KILP)
continue;
+ for (if_inst = inst->Prev; if_inst != &c->Program.Instructions;
+ if_inst = if_inst->Prev) {
+
+ if (if_inst->U.I.Opcode == RC_OPCODE_IF) {
+ in_if = 1;
+ break;
+ }
+ }
+
inst->U.I.Opcode = RC_OPCODE_KIL;
- if (inst->Prev->U.I.Opcode != RC_OPCODE_IF
- || inst->Next->U.I.Opcode != RC_OPCODE_ENDIF) {
+ if (!in_if) {
inst->U.I.SrcReg[0] = negate(builtin_one);
} else {
-
+ /* This should work even if the KILP is inside the ELSE
+ * block, because -0.0 is considered negative. */
inst->U.I.SrcReg[0] =
- negate(absolute(inst->Prev->U.I.SrcReg[0]));
- /* Remove IF */
- rc_remove_instruction(inst->Prev);
- /* Remove ENDIF */
- rc_remove_instruction(inst->Next);
+ negate(absolute(if_inst->U.I.SrcReg[0]));
+
+ if (inst->Prev->U.I.Opcode != RC_OPCODE_IF
+ && inst->Next->U.I.Opcode != RC_OPCODE_ENDIF) {
+
+ /* Optimize the special case:
+ * IF Temp[0].x
+ * KILP
+ * ENDIF
+ */
+
+ /* Remove IF */
+ rc_remove_instruction(inst->Prev);
+ /* Remove ENDIF */
+ rc_remove_instruction(inst->Next);
+ }
}
}
}
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 82a3ff2..e22deb4 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -235,7 +235,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
case PIPE_SHADER_CAP_MAX_TEMPS:
if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_FRAGMENT_SHADER_TEMPS, &result))
return 32;
- return result.u;
+ return MIN2(result.u, SVGA3D_TEMPREG_MAX);
case PIPE_SHADER_CAP_MAX_ADDRS:
case PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR:
/*
@@ -286,7 +286,7 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
case PIPE_SHADER_CAP_MAX_TEMPS:
if (!sws->get_cap(sws, SVGA3D_DEVCAP_MAX_VERTEX_SHADER_TEMPS, &result))
return 32;
- return result.u;
+ return MIN2(result.u, SVGA3D_TEMPREG_MAX);
case PIPE_SHADER_CAP_MAX_ADDRS:
return 1;
case PIPE_SHADER_CAP_MAX_PREDS:
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 3347157..b2581da 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -2188,7 +2188,7 @@ void brw_fb_WRITE(struct brw_compile *p,
msg_type,
msg_length,
header_present,
- 1, /* last render target write */
+ eot, /* last render target write */
response_length,
eot,
0 /* send_commit_msg */);
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index a2959a8..4b27e06 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -1159,17 +1159,17 @@ _mesa_GetBufferParameterivARB(GLenum target, GLenum pname, GLint *params)
*params = _mesa_bufferobj_mapped(bufObj);
return;
case GL_BUFFER_ACCESS_FLAGS:
- if (ctx->VersionMajor < 3)
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = bufObj->AccessFlags;
return;
case GL_BUFFER_MAP_OFFSET:
- if (ctx->VersionMajor < 3)
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = (GLint) bufObj->Offset;
return;
case GL_BUFFER_MAP_LENGTH:
- if (ctx->VersionMajor < 3)
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = (GLint) bufObj->Length;
return;
@@ -1210,7 +1210,7 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
*params = simplified_access_mode(bufObj->AccessFlags);
return;
case GL_BUFFER_ACCESS_FLAGS:
- if (ctx->VersionMajor < 3)
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = bufObj->AccessFlags;
return;
@@ -1218,12 +1218,12 @@ _mesa_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
*params = _mesa_bufferobj_mapped(bufObj);
return;
case GL_BUFFER_MAP_OFFSET:
- if (ctx->VersionMajor < 3)
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = bufObj->Offset;
return;
case GL_BUFFER_MAP_LENGTH:
- if (ctx->VersionMajor < 3)
+ if (!ctx->Extensions.ARB_map_buffer_range)
goto invalid_pname;
*params = bufObj->Length;
return;