Date: Fri, 12 Sep 2008 12:04:49 -0600
Subject: cell: more documentation updates
---
docs/cell.html | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/docs/cell.html b/docs/cell.html
index d61b57da80..34d9a92723 100644
--- a/docs/cell.html
+++ b/docs/cell.html
@@ -6,7 +6,7 @@
-Mesa Cell Driver
+Mesa/Gallium Cell Driver
The Mesa
@@ -23,6 +23,7 @@ Two phases are planned.
First, to implement the framework for parallel rasterization using the Cell
SPEs, including texture mapping.
Second, to implement a full-featured OpenGL driver with support for GLSL, etc.
+The second phase is now underway.
@@ -43,12 +44,13 @@ or the Cell Simulator (untested, though).
-If using Cell SDK 3.0, first edit configs/linux-cell and add
--DSPU_MAIN_PARAM_LONG_LONG
to the SPU_CFLAGS.
+If using Cell SDK 2.1, see the configs/linux-cell file for some
+special changes.
To compile the code, run make linux-cell
.
+To build in debug mode, run make linux-cell-debug
.
@@ -102,6 +104,26 @@ This will be addressed in the future.
+
Debug Options
+
+
+The CELL_DEBUG env var can be set to a comma-separated list of one or
+more of the following debug options:
+
+
+- checker - use a different background clear color for each SPU.
+ This lets you see which SPU is rendering which screen tiles.
+
- sync - wait/synchronize after each DMA transfer
+
+
+
+If the GALLIUM_NOCELL env var is set, the softpipe driver will be used
+intead of the Cell driver.
+This is useful for comparison/validation.
+
+
+
+
Contributing
--
cgit v1.2.3
From c9c2b1b0163aa8803dc7ffb7fe1ef8f948f1e030 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 12:05:10 -0600
Subject: mesa: bump gallium version string to 0.2
---
src/mesa/state_tracker/st_cb_strings.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_cb_strings.c b/src/mesa/state_tracker/st_cb_strings.c
index 066124f8f3..09545aa8fb 100644
--- a/src/mesa/state_tracker/st_cb_strings.c
+++ b/src/mesa/state_tracker/st_cb_strings.c
@@ -40,7 +40,7 @@
#include "st_context.h"
#include "st_cb_strings.h"
-#define ST_VERSION_STRING "0.1"
+#define ST_VERSION_STRING "0.2"
static const GLubyte *
st_get_string(GLcontext * ctx, GLenum name)
--
cgit v1.2.3
From 272810125b7dacde34d2d0a55a2afa19c72f5ee8 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Fri, 12 Sep 2008 13:24:05 -0600
Subject: Makefile was previously checked in with merge diffs still present.
I just selected HEAD and removed the old.
---
progs/fp/Makefile | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
mode change 100644 => 100755 progs/fp/Makefile
diff --git a/progs/fp/Makefile b/progs/fp/Makefile
old mode 100644
new mode 100755
index ab43cde4f3..ef6644cce2
--- a/progs/fp/Makefile
+++ b/progs/fp/Makefile
@@ -67,21 +67,15 @@ getproclist.h: $(TOP)/src/mesa/glapi/gl_API.xml getprocaddress.c getprocaddress.
texrect: texrect.o readtex.o
-<<<<<<< HEAD:progs/fp/Makefile
$(CC) $(CFLAGS) $(LDFLAGS) texrect.o readtex.o $(LIBS) -o $@
-=======
- $(APP_CC) texrect.o readtex.o $(LIBS) -o $@
->>>>>>> origin/gallium-0.1:progs/fp/Makefile
+# $(APP_CC) texrect.o readtex.o $(LIBS) -o $@
texrect.o: texrect.c readtex.h
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
invert: invert.o readtex.o
-<<<<<<< HEAD:progs/fp/Makefile
$(CC) $(CFLAGS) $(LDFLAGS) invert.o readtex.o $(LIBS) -o $@
-=======
- $(APP_CC) invert.o readtex.o $(LIBS) -o $@
->>>>>>> origin/gallium-0.1:progs/fp/Makefile
+# $(APP_CC) invert.o readtex.o $(LIBS) -o $@
invert.o: invert.c readtex.h
$(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
--
cgit v1.2.3
From 201d3419a6432a0f35dff48e606649092afb7ff7 Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Thu, 11 Sep 2008 09:50:47 -0700
Subject: intel: Remove dead allow_batchbuffer param.
---
src/mesa/drivers/dri/intel/intel_screen.c | 5 -----
src/mesa/drivers/dri/intel/intel_screen.h | 1 -
2 files changed, 6 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 1de1ac49ea..de098e5b72 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -298,11 +298,6 @@ static GLboolean intelInitDriver(__DRIscreenPrivate *sPriv)
&intelScreen->irq_active))
return GL_FALSE;
- /* Determine if batchbuffers are allowed */
- if (!intel_get_param(sPriv, I915_PARAM_ALLOW_BATCHBUFFER,
- &intelScreen->allow_batchbuffer))
- return GL_FALSE;
-
sPriv->extensions = intelScreenExtensions;
return GL_TRUE;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h
index daf2ab4c58..fc913da5bf 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.h
+++ b/src/mesa/drivers/dri/intel/intel_screen.h
@@ -74,7 +74,6 @@ typedef struct
int drmMinor;
int irq_active;
- int allow_batchbuffer;
GLboolean no_hw;
--
cgit v1.2.3
From 34bba445a12f7b81654a416fd1630c8890cfc178 Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 12 Sep 2008 13:47:37 -0700
Subject: intel: Don't segfault on TFP from a bad drawable.
---
src/mesa/drivers/dri/intel/intel_context.c | 3 +++
src/mesa/drivers/dri/intel/intel_tex_image.c | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 7065bb35ee..007dee449c 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -233,6 +233,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
&count,
drawable->loaderPrivate);
+ if (buffers == NULL)
+ return;
+
drawable->x = 0;
drawable->y = 0;
drawable->backX = 0;
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index d1f540b0f1..70b0b3e245 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -733,6 +733,12 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
intel_update_renderbuffers(pDRICtx, dPriv);
rb = intel_fb->color_rb[0];
+ /* If the region isn't set, then intel_update_renderbuffers was unable
+ * to get the buffers for the drawable.
+ */
+ if (rb->region == NULL)
+ return;
+
type = GL_BGRA;
format = GL_UNSIGNED_BYTE;
internalFormat = (rb->region->cpp == 3 ? 3 : 4);
--
cgit v1.2.3
From d598a5d2301faea810a2449db7a32ff48e80b979 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 15:07:04 -0600
Subject: cell: disable invalid spe_release_func() calls, fixes crash on exit
---
src/gallium/drivers/cell/ppu/cell_pipe_state.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c
index 475c6ef0ce..ea820aca74 100644
--- a/src/gallium/drivers/cell/ppu/cell_pipe_state.c
+++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.c
@@ -72,7 +72,9 @@ cell_delete_blend_state(struct pipe_context *pipe, void *blend)
{
struct cell_blend_state *cb = (struct cell_blend_state *) blend;
+#if 0
spe_release_func(& cb->code);
+#endif
FREE(cb);
}
@@ -128,7 +130,9 @@ cell_delete_depth_stencil_alpha_state(struct pipe_context *pipe, void *depth)
struct cell_depth_stencil_alpha_state *cdsa =
(struct cell_depth_stencil_alpha_state *) depth;
+#if 0
spe_release_func(& cdsa->code);
+#endif
FREE(cdsa);
}
--
cgit v1.2.3
From bdc8ac4ae2c711e2569618136bf7d9c7b25be53e Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 12 Sep 2008 14:18:14 -0700
Subject: Finish off the previous fix for TFP.
A couple of those lines of debug printfs I deleted weren't actually debug
printfs.
---
src/glx/x11/dri2_glx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c
index c56adfa558..3c366bfa1e 100644
--- a/src/glx/x11/dri2_glx.c
+++ b/src/glx/x11/dri2_glx.c
@@ -211,6 +211,9 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
buffers = DRI2GetBuffers(pdraw->base.psc->dpy, pdraw->base.xDrawable,
width, height, attachments, count, out_count);
+ if (buffers == NULL)
+ return NULL;
+
pdraw->width = *width;
pdraw->height = *height;
--
cgit v1.2.3
From 5ab221549d5cdbf72817ff612464d83256765389 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 16:11:52 -0600
Subject: cell: evaluate multiple fragment inputs
---
src/gallium/drivers/cell/spu/spu_tri.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/cell/spu/spu_tri.c b/src/gallium/drivers/cell/spu/spu_tri.c
index b7faae6d60..0a8fb56a62 100644
--- a/src/gallium/drivers/cell/spu/spu_tri.c
+++ b/src/gallium/drivers/cell/spu/spu_tri.c
@@ -356,8 +356,14 @@ emit_quad( int x, int y, mask_t mask )
vector float fragZ = eval_z((float) x, (float) y);
/* setup inputs */
+#if 0
eval_coeff_soa(1, (float) x, (float) y, inputs);
-
+#else
+ uint i;
+ for (i = 0; i < spu.vertex_info.num_attribs; i++) {
+ eval_coeff_soa(i+1, (float) x, (float) y, inputs + i * 4);
+ }
+#endif
ASSERT(spu.fragment_program);
ASSERT(spu.fragment_ops);
--
cgit v1.2.3
From af2ca5dc3823269636bfa8377ed971a761096b2e Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 16:31:53 -0600
Subject: cell: initial support for IF/ELSE/ENDIF in fragment shader codegen
Only one level of if/else/endif nesting is currently working.
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 193 ++++++++++++++++++++++++++---
1 file changed, 175 insertions(+), 18 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index d7a8846ab3..8d8dfea039 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -71,6 +71,11 @@ struct codegen
int num_itemps;
int itemps[3];
+ /** Current IF/ELSE/ENDIF nesting level */
+ int if_nesting;
+ /** Index of execution mask register */
+ int exec_mask_reg;
+
struct spe_function *f;
boolean error;
};
@@ -112,18 +117,43 @@ get_const_one_reg(struct codegen *gen)
{
if (gen->one_reg <= 0) {
gen->one_reg = spe_allocate_available_register(gen->f);
- }
- /* one = {1.0, 1.0, 1.0, 1.0} */
- spe_load_float(gen->f, gen->one_reg, 1.0f);
+ /* one = {1.0, 1.0, 1.0, 1.0} */
+ spe_load_float(gen->f, gen->one_reg, 1.0f);
#if DISASSEM
- printf("il\tr%d, 1.0f\n", gen->one_reg);
+ printf("\til\tr%d, 1.0f\n", gen->one_reg);
#endif
+ }
return gen->one_reg;
}
+/**
+ * Return index of the pixel execution mask.
+ * The register is allocated an initialized upon the first call.
+ *
+ * The pixel execution mask controls which pixels in a quad are
+ * modified, according to surrounding conditionals, loops, etc.
+ */
+static int
+get_exec_mask_reg(struct codegen *gen)
+{
+ if (gen->exec_mask_reg <= 0) {
+ gen->exec_mask_reg = spe_allocate_available_register(gen->f);
+
+ /* exec_mask = {~0, ~0, ~0, ~0} */
+ spe_load_int(gen->f, gen->exec_mask_reg, ~0);
+#if DISASSEM
+ printf("INIT EXEC MASK:\n");
+ printf("\tload\tr%d, 0x%x\n", gen->exec_mask_reg, ~0);
+#endif
+ }
+
+ return gen->exec_mask_reg;
+}
+
+
/**
* Return the index of the SPU temporary containing the named TGSI
* source register. If the TGSI register is a TGSI_FILE_TEMPORARY we
@@ -136,7 +166,7 @@ get_src_reg(struct codegen *gen,
int channel,
const struct tgsi_full_src_register *src)
{
- int reg;
+ int reg = -1;
int swizzle = tgsi_util_get_full_src_register_extswizzle(src, channel);
assert(swizzle >= 0);
@@ -156,7 +186,7 @@ get_src_reg(struct codegen *gen,
/* Load: reg = memory[(machine_reg) + offset] */
spe_lqd(gen->f, reg, gen->inputs_reg, offset);
#if DISASSEM
- printf("lqd\tr%d, r%d + %d\n", reg, gen->inputs_reg, offset);
+ printf("\tlqd\tr%d, r%d + %d\n", reg, gen->inputs_reg, offset);
#endif
}
break;
@@ -184,11 +214,14 @@ get_dst_reg(struct codegen *gen,
int channel,
const struct tgsi_full_dst_register *dest)
{
- int reg;
+ int reg = -1;
switch (dest->DstRegister.File) {
case TGSI_FILE_TEMPORARY:
- reg = gen->temp_regs[dest->DstRegister.Index][channel];
+ if (gen->if_nesting > 0)
+ reg = get_itemp(gen);
+ else
+ reg = gen->temp_regs[dest->DstRegister.Index][channel];
break;
case TGSI_FILE_OUTPUT:
reg = get_itemp(gen);
@@ -214,17 +247,56 @@ store_dest_reg(struct codegen *gen,
{
switch (dest->DstRegister.File) {
case TGSI_FILE_TEMPORARY:
- /* no-op */
+ if (gen->if_nesting > 0) {
+ int d_reg = gen->temp_regs[dest->DstRegister.Index][channel];
+ int exec_reg = get_exec_mask_reg(gen);
+ /* Mix d with new value according to exec mask:
+ * d[i] = mask_reg[i] ? value_reg : d_reg
+ */
+ spe_selb(gen->f, d_reg, d_reg, value_reg, exec_reg);
+#if DISASSEM
+ printf("\tselb\tr%d, r%d, r%d, r%d # EXEC MASK'ed\n",
+ d_reg, d_reg, value_reg, exec_reg);
+#endif
+ }
+ else {
+ /* we're not inside a condition or loop: do nothing special */
+ }
break;
case TGSI_FILE_OUTPUT:
{
/* offset is measured in quadwords, not bytes */
int offset = dest->DstRegister.Index * 4 + channel;
- /* Store: memory[(machine_reg) + offset] = reg */
- spe_stqd(gen->f, value_reg, gen->outputs_reg, offset);
+ if (gen->if_nesting > 0) {
+ int exec_reg = get_exec_mask_reg(gen);
+ int curval_reg = get_itemp(gen);
+ /* First read the current value from memory:
+ * Load: curval = memory[(machine_reg) + offset]
+ */
+ spe_lqd(gen->f, curval_reg, gen->outputs_reg, offset);
+ /* Mix curval with newvalue according to exec mask:
+ * d[i] = mask_reg[i] ? value_reg : d_reg
+ */
+ spe_selb(gen->f, curval_reg, curval_reg, value_reg, exec_reg);
+ /* Store: memory[(machine_reg) + offset] = curval */
+ spe_stqd(gen->f, curval_reg, gen->outputs_reg, offset);
#if DISASSEM
- printf("stqd\tr%d, r%d + %d\n", value_reg, gen->outputs_reg, offset);
+ printf("\tlqd\tr%d, r%d + %d\n",
+ curval_reg, gen->outputs_reg, offset);
+ printf("\tselb\tr%d, r%d, r%d, r%d # EXEC MASK'ed\n",
+ curval_reg, curval_reg, value_reg, exec_reg);
+ printf("\tstqd\tr%d, r%d + %d\n",
+ curval_reg, gen->outputs_reg, offset);
#endif
+ }
+ else {
+ /* Store: memory[(machine_reg) + offset] = reg */
+ spe_stqd(gen->f, value_reg, gen->outputs_reg, offset);
+#if DISASSEM
+ printf("\tstqd\tr%d, r%d + %d\n",
+ value_reg, gen->outputs_reg, offset);
+#endif
+ }
}
break;
default:
@@ -237,6 +309,9 @@ static boolean
emit_MOV(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
+#if DISASSEM
+ printf("MOV:\n");
+#endif
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int src_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -244,7 +319,7 @@ emit_MOV(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* XXX we don't always need to actually emit a mov instruction here */
spe_move(gen->f, dst_reg, src_reg);
#if DISASSEM
- printf("mov\tr%d, r%d\n", dst_reg, src_reg);
+ printf("\tmov\tr%d, r%d\n", dst_reg, src_reg);
#endif
store_dest_reg(gen, dst_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
@@ -254,6 +329,7 @@ emit_MOV(struct codegen *gen, const struct tgsi_full_instruction *inst)
}
+
/**
* Emit addition instructions. Recall that a single TGSI_OPCODE_ADD
* becomes (up to) four SPU "fa" instructions because we're doing SOA
@@ -263,6 +339,9 @@ static boolean
emit_ADD(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
+#if DISASSEM
+ printf("ADD:\n");
+#endif
/* Loop over Red/Green/Blue/Alpha channels */
for (ch = 0; ch < 4; ch++) {
/* If the dest R, G, B or A writemask is enabled... */
@@ -275,7 +354,7 @@ emit_ADD(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* Emit actual SPE instruction: d = s1 + s2 */
spe_fa(gen->f, d_reg, s1_reg, s2_reg);
#if DISASSEM
- printf("fa\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
+ printf("\tfa\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
#endif
/* Store the result (a no-op for TGSI_FILE_TEMPORARY dests) */
@@ -295,6 +374,9 @@ static boolean
emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
+#if DISASSEM
+ printf("MUL:\n");
+#endif
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -303,7 +385,7 @@ emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* d = s1 * s2 */
spe_fm(gen->f, d_reg, s1_reg, s2_reg);
#if DISASSEM
- printf("fm\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
+ printf("\tfm\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
#endif
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
@@ -324,6 +406,9 @@ emit_SGT(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
+#if DISASSEM
+ printf("SGT:\n");
+#endif
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -333,14 +418,14 @@ emit_SGT(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* d = (s1 > s2) */
spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
#if DISASSEM
- printf("fcgt\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
+ printf("\tfcgt\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
#endif
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
/* d = d & one_reg */
spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
#if DISASSEM
- printf("and\tr%d, r%d, r%d\n", d_reg, d_reg, get_const_one_reg(gen));
+ printf("\tand\tr%d, r%d, r%d\n", d_reg, d_reg, get_const_one_reg(gen));
#endif
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
@@ -352,6 +437,71 @@ emit_SGT(struct codegen *gen, const struct tgsi_full_instruction *inst)
}
+static boolean
+emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ const int channel = 0;
+ const int exec_reg = get_exec_mask_reg(gen);
+
+ /* update execution mask with the predicate register */
+ int tmp_reg = spe_allocate_available_register(gen->f);
+ int s1_reg = get_src_reg(gen, channel, &inst->FullSrcRegisters[0]);
+
+ /* tmp = (s1_reg == 0) */
+ spe_ceqi(gen->f, tmp_reg, s1_reg, 0);
+ /* tmp = !tmp */
+ spe_complement(gen->f, tmp_reg);
+ /* exec_mask = exec_mask & tmp */
+ spe_and(gen->f, exec_reg, exec_reg, tmp_reg);
+#if DISASSEM
+ printf("IF:\n");
+ printf("\tseqi\tr%d, r%d, 0;\n", tmp_reg, s1_reg);
+ printf("\tcomp\tr%d\n", tmp_reg);
+ printf("\tand\tr%d, r%d, r%d\n", exec_reg, exec_reg, tmp_reg);
+#endif
+
+ gen->if_nesting++;
+
+ spe_release_register(gen->f, tmp_reg);
+
+ return true;
+}
+
+
+static boolean
+emit_ELSE(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ const int exec_reg = get_exec_mask_reg(gen);
+
+ /* exec_mask = !exec_mask */
+ spe_complement(gen->f, exec_reg);
+#if DISASSEM
+ printf("ELSE:\n");
+ printf("\tcomp\tr%d;\n", exec_reg);
+#endif
+ return true;
+}
+
+
+static boolean
+emit_ENDIF(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ const int exec_reg = get_exec_mask_reg(gen);
+
+ /* XXX todo: pop execution mask */
+
+ spe_load_int(gen->f, exec_reg, ~0x0);
+#if DISASSEM
+ printf("ENDIF:\n");
+ printf("\tli\tr%d, ~0x0\n", exec_reg);
+#endif
+
+ gen->if_nesting--;
+ return true;
+}
+
+
+
/**
* Emit END instruction.
* We just return from the shader function at this point.
@@ -365,7 +515,7 @@ emit_END(struct codegen *gen)
/* return from function call */
spe_bi(gen->f, SPE_REG_RA, 0, 0);
#if DISASSEM
- printf("bi\trRA\n");
+ printf("\tbi\trRA\n");
#endif
return true;
}
@@ -390,6 +540,13 @@ emit_instruction(struct codegen *gen,
case TGSI_OPCODE_END:
return emit_END(gen);
+ case TGSI_OPCODE_IF:
+ return emit_IF(gen, inst);
+ case TGSI_OPCODE_ELSE:
+ return emit_ELSE(gen, inst);
+ case TGSI_OPCODE_ENDIF:
+ return emit_ENDIF(gen, inst);
+
/* XXX lots more cases to do... */
default:
--
cgit v1.2.3
From 8db761409dadc2e899d4e7107eff3aa07b07aa11 Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Fri, 12 Sep 2008 15:48:13 -0700
Subject: intel: Add a width field to regions, and use it for making miptrees
in TFP.
Otherwise, we would use the pitch as width of the texture, and compiz would
render the pitch padding on the right hand side.
---
src/mesa/drivers/dri/intel/intel_context.c | 3 ++-
src/mesa/drivers/dri/intel/intel_fbo.c | 2 +-
src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 7 +++++--
src/mesa/drivers/dri/intel/intel_regions.c | 16 ++++++++++------
src/mesa/drivers/dri/intel/intel_regions.h | 10 ++++++----
src/mesa/drivers/dri/intel/intel_tex_image.c | 2 +-
6 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 007dee449c..23e0f6331a 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -301,8 +301,9 @@ intel_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable)
}
else
region = intel_region_alloc_for_handle(intel, buffers[i].cpp,
- buffers[i].pitch / buffers[i].cpp,
+ drawable->w,
drawable->h,
+ buffers[i].pitch / buffers[i].cpp,
buffers[i].name,
region_name);
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 5bd2ebfdcf..6570f6e69b 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -296,7 +296,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width,
height, pitch);
- irb->region = intel_region_alloc(intel, cpp, pitch, height);
+ irb->region = intel_region_alloc(intel, cpp, width, height, pitch);
if (!irb->region)
return GL_FALSE; /* out of memory? */
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 9be7e02eff..f28fac8394 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -117,7 +117,10 @@ intel_miptree_create(struct intel_context *intel,
return NULL;
mt->region = intel_region_alloc(intel,
- mt->cpp, mt->pitch, mt->total_height);
+ mt->cpp,
+ mt->pitch,
+ mt->total_height,
+ mt->pitch);
if (!mt->region) {
free(mt);
@@ -141,7 +144,7 @@ intel_miptree_create_for_region(struct intel_context *intel,
mt = intel_miptree_create_internal(intel, target, internal_format,
first_level, last_level,
- region->pitch, region->height, depth0,
+ region->width, region->height, 1,
region->cpp, compress_byte);
if (!mt)
return mt;
diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c
index 1cfc8ddd64..cb0f4ba083 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.c
+++ b/src/mesa/drivers/dri/intel/intel_regions.c
@@ -105,7 +105,8 @@ intel_set_region_tiling_gem(struct intel_context *intel,
static struct intel_region *
intel_region_alloc_internal(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
dri_bo *buffer)
{
struct intel_region *region;
@@ -117,8 +118,9 @@ intel_region_alloc_internal(struct intel_context *intel,
region = calloc(sizeof(*region), 1);
region->cpp = cpp;
+ region->width = width;
+ region->height = height;
region->pitch = pitch;
- region->height = height; /* needed? */
region->refcount = 1;
region->buffer = buffer;
@@ -131,19 +133,20 @@ intel_region_alloc_internal(struct intel_context *intel,
struct intel_region *
intel_region_alloc(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height)
+ GLuint cpp, GLuint width, GLuint height, GLuint pitch)
{
dri_bo *buffer;
buffer = dri_bo_alloc(intel->bufmgr, "region",
pitch * cpp * height, 64);
- return intel_region_alloc_internal(intel, cpp, pitch, height, buffer);
+ return intel_region_alloc_internal(intel, cpp, width, height, pitch, buffer);
}
struct intel_region *
intel_region_alloc_for_handle(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
GLuint handle, const char *name)
{
struct intel_region *region;
@@ -151,7 +154,8 @@ intel_region_alloc_for_handle(struct intel_context *intel,
buffer = intel_bo_gem_create_from_name(intel->bufmgr, name, handle);
- region = intel_region_alloc_internal(intel, cpp, pitch, height, buffer);
+ region = intel_region_alloc_internal(intel, cpp,
+ width, height, pitch, buffer);
if (region == NULL)
return region;
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index a561de485e..62eb049fba 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -55,8 +55,9 @@ struct intel_region
dri_bo *buffer; /**< buffer manager's buffer */
GLuint refcount; /**< Reference count for region */
GLuint cpp; /**< bytes per pixel */
- GLuint pitch; /**< in pixels */
+ GLuint width; /**< in pixels */
GLuint height; /**< in pixels */
+ GLuint pitch; /**< in pixels */
GLubyte *map; /**< only non-NULL when region is actually mapped */
GLuint map_refcount; /**< Reference count for mapping */
@@ -72,12 +73,13 @@ struct intel_region
* copied by calling intel_reference_region().
*/
struct intel_region *intel_region_alloc(struct intel_context *intel,
- GLuint cpp,
- GLuint pitch, GLuint height);
+ GLuint cpp, GLuint width,
+ GLuint height, GLuint pitch);
struct intel_region *
intel_region_alloc_for_handle(struct intel_context *intel,
- GLuint cpp, GLuint pitch, GLuint height,
+ GLuint cpp,
+ GLuint width, GLuint height, GLuint pitch,
unsigned int handle, const char *name);
void intel_region_reference(struct intel_region **dst,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 70b0b3e245..1820d3dc05 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -757,7 +757,7 @@ intelSetTexBuffer(__DRIcontext *pDRICtx, GLint target, __DRIdrawable *dPriv)
intelObj->mt = mt;
texImage = _mesa_get_tex_image(&intel->ctx, texObj, target, level);
_mesa_init_teximage_fields(&intel->ctx, target, texImage,
- rb->region->pitch, rb->region->height, 1,
+ rb->region->width, rb->region->height, 1,
0, internalFormat);
intelImage = intel_texture_image(texImage);
--
cgit v1.2.3
From 5f3ec823385b34b8db6013fdf701c5522dc86524 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 17:10:20 -0600
Subject: cell: implement TGSI immediates in SPE code generator
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 75 +++++++++++++++++++++++++-----
1 file changed, 63 insertions(+), 12 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 8d8dfea039..33579fc703 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -52,7 +52,11 @@
/** Set to 1 to enable debug/disassembly printfs */
-#define DISASSEM 01
+#define DISASSEM 0
+
+
+#define MAX_TEMPS 16
+#define MAX_IMMED 8
/**
@@ -63,7 +67,10 @@ struct codegen
int inputs_reg; /**< 1st function parameter */
int outputs_reg; /**< 2nd function parameter */
int constants_reg; /**< 3rd function parameter */
- int temp_regs[8][4]; /**< maps TGSI temps to SPE registers */
+ int temp_regs[MAX_TEMPS][4]; /**< maps TGSI temps to SPE registers */
+ int imm_regs[MAX_IMMED][4]; /**< maps TGSI immediates to SPE registers */
+
+ int num_imm; /**< number of immediates */
int one_reg; /**< register containing {1.0, 1.0, 1.0, 1.0} */
@@ -191,7 +198,8 @@ get_src_reg(struct codegen *gen,
}
break;
case TGSI_FILE_IMMEDIATE:
- /* xxx fall-through for now / fix */
+ reg = gen->imm_regs[src->SrcRegister.Index][channel];
+ break;
case TGSI_FILE_CONSTANT:
/* xxx fall-through for now / fix */
default:
@@ -558,12 +566,53 @@ emit_instruction(struct codegen *gen,
+/**
+ * Emit code for a TGSI immediate value (vector of four floats).
+ * This involves register allocation and initialization.
+ * XXX the initialization should be done by a "prepare" stage, not
+ * per quad execution!
+ */
+static boolean
+emit_immediate(struct codegen *gen, const struct tgsi_full_immediate *immed)
+{
+ int ch;
+
+ assert(gen->num_imm < MAX_TEMPS);
+
+#if DISASSEM
+ printf("IMMEDIATE %d:\n", gen->num_imm);
+#endif
+
+ for (ch = 0; ch < 4; ch++) {
+ float val = immed->u.ImmediateFloat32[ch].Float;
+ int reg = spe_allocate_available_register(gen->f);
+
+ if (reg < 0)
+ return false;
+
+ /* update immediate map */
+ gen->imm_regs[gen->num_imm][ch] = reg;
+
+ /* emit initializer instruction */
+ spe_load_float(gen->f, reg, val);
+#if DISASSEM
+ printf("\tload\tr%d, %f\n", reg, val);
+#endif
+ }
+
+ gen->num_imm++;
+
+ return true;
+}
+
+
+
/**
* Emit "code" for a TGSI declaration.
* We only care about TGSI TEMPORARY register declarations at this time.
* For each TGSI TEMPORARY we allocate four SPE registers.
*/
-static void
+static boolean
emit_declaration(struct codegen *gen, const struct tgsi_full_declaration *decl)
{
int i, ch;
@@ -578,8 +627,11 @@ emit_declaration(struct codegen *gen, const struct tgsi_full_declaration *decl)
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last;
i++) {
+ assert(i < MAX_TEMPS);
for (ch = 0; ch < 4; ch++) {
gen->temp_regs[i][ch] = spe_allocate_available_register(gen->f);
+ if (gen->temp_regs[i][ch] < 0)
+ return false; /* out of regs */
}
/* XXX if we run out of SPE registers, we need to spill
@@ -598,6 +650,8 @@ emit_declaration(struct codegen *gen, const struct tgsi_full_declaration *decl)
default:
; /* ignore */
}
+
+ return true;
}
@@ -642,25 +696,22 @@ cell_gen_fragment_program(struct cell_context *cell,
switch (parse.FullToken.Token.Type) {
case TGSI_TOKEN_TYPE_IMMEDIATE:
-#if 0
- if (!note_immediate(&gen, &parse.FullToken.FullImmediate ))
- goto fail;
-#endif
+ if (!emit_immediate(&gen, &parse.FullToken.FullImmediate))
+ gen.error = true;
break;
case TGSI_TOKEN_TYPE_DECLARATION:
- emit_declaration(&gen, &parse.FullToken.FullDeclaration);
+ if (!emit_declaration(&gen, &parse.FullToken.FullDeclaration))
+ gen.error = true;
break;
case TGSI_TOKEN_TYPE_INSTRUCTION:
- if (!emit_instruction(&gen, &parse.FullToken.FullInstruction )) {
+ if (!emit_instruction(&gen, &parse.FullToken.FullInstruction))
gen.error = true;
- }
break;
default:
assert(0);
-
}
}
--
cgit v1.2.3
From 31a112cad4d2e515bc668b58abd4e402b4362c70 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 21:08:01 -0600
Subject: gallium: added spe_splat_word()
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 25 +++++++++++++++++++++++++
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h | 4 ++++
2 files changed, 29 insertions(+)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
index 62e3adb357..89f8e24ce6 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
@@ -540,4 +540,29 @@ spe_zero(struct spe_function *p, unsigned rT)
}
+void
+spe_splat_word(struct spe_function *p, unsigned rT, unsigned rA, int word)
+{
+ assert(word >= 0);
+ assert(word <= 3);
+
+ if (word == 0) {
+ int tmp1 = rT;
+ spe_ila(p, tmp1, 66051);
+ spe_shufb(p, rT, rA, rA, tmp1);
+ }
+ else {
+ /* XXX review this, we may not need the rotqbyi instruction */
+ int tmp1 = rT;
+ int tmp2 = spe_allocate_available_register(p);
+
+ spe_ila(p, tmp1, 66051);
+ spe_rotqbyi(p, tmp2, rA, 4 * word);
+ spe_shufb(p, rT, tmp2, tmp2, tmp1);
+
+ spe_release_register(p, tmp2);
+ }
+}
+
+
#endif /* GALLIUM_CELL */
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
index d95e5aace3..7a3ab9ace5 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
@@ -308,6 +308,10 @@ spe_move(struct spe_function *p, unsigned rT, unsigned rA);
extern void
spe_zero(struct spe_function *p, unsigned rT);
+/** rT = splat(rA, word) */
+extern void
+spe_splat_word(struct spe_function *p, unsigned rT, unsigned rA, int word);
+
/* Floating-point instructions
*/
--
cgit v1.2.3
From 6f3eee921327ce76c05620eec714f2ff4f500826 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 21:09:10 -0600
Subject: cell: implement DDX/DDY codegen (untested)
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 37 ++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 33579fc703..a7b7dd03d3 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -509,6 +509,38 @@ emit_ENDIF(struct codegen *gen, const struct tgsi_full_instruction *inst)
}
+static boolean
+emit_DDX_DDY(struct codegen *gen, const struct tgsi_full_instruction *inst,
+ boolean ddx)
+{
+ int ch;
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ int t1_reg = get_itemp(gen);
+ int t2_reg = get_itemp(gen);
+
+ spe_splat_word(gen->f, t1_reg, s_reg, 0); /* upper-left pixel */
+ if (ddx) {
+ spe_splat_word(gen->f, t2_reg, s_reg, 1); /* upper-right pixel */
+ }
+ else {
+ spe_splat_word(gen->f, t2_reg, s_reg, 2); /* lower-left pixel */
+ }
+ spe_fs(gen->f, d_reg, t2_reg, t1_reg);
+
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
+
+
/**
* Emit END instruction.
@@ -555,6 +587,11 @@ emit_instruction(struct codegen *gen,
case TGSI_OPCODE_ENDIF:
return emit_ENDIF(gen, inst);
+ case TGSI_OPCODE_DDX:
+ return emit_DDX_DDY(gen, inst, true);
+ case TGSI_OPCODE_DDY:
+ return emit_DDX_DDY(gen, inst, false);
+
/* XXX lots more cases to do... */
default:
--
cgit v1.2.3
From 8b5013d232bf6846717fac093465e8a39064e0b6 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 21:52:47 -0600
Subject: gallium: added print/dump code to SPE code emitter
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 128 ++++++++++++++++++++++------
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h | 10 +++
2 files changed, 113 insertions(+), 25 deletions(-)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
index 89f8e24ce6..8718be9ded 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
@@ -27,12 +27,16 @@
* Real-time assembly generation interface for Cell B.E. SPEs.
*
* \author Ian Romanick
+ * \author Brian Paul
*/
+
+#include
#include "pipe/p_compiler.h"
#include "util/u_memory.h"
#include "rtasm_ppc_spe.h"
+
#ifdef GALLIUM_CELL
/**
* SPE instruction types
@@ -143,8 +147,25 @@ union spe_inst_RI18 {
/*@}*/
+static void
+indent(const struct spe_function *p)
+{
+ int i;
+ for (i = 0; i < p->indent; i++) {
+ putchar(' ');
+ }
+}
+
+
+static const char *
+rem_prefix(const char *longname)
+{
+ return longname + 4;
+}
+
+
static void emit_RR(struct spe_function *p, unsigned op, unsigned rT,
- unsigned rA, unsigned rB)
+ unsigned rA, unsigned rB, const char *name)
{
union spe_inst_RR inst;
inst.inst.op = op;
@@ -153,11 +174,15 @@ static void emit_RR(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rT = rT;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, r%d, r%d\n", rem_prefix(name), rT, rA, rB);
+ }
}
static void emit_RRR(struct spe_function *p, unsigned op, unsigned rT,
- unsigned rA, unsigned rB, unsigned rC)
+ unsigned rA, unsigned rB, unsigned rC, const char *name)
{
union spe_inst_RRR inst;
inst.inst.op = op;
@@ -167,11 +192,15 @@ static void emit_RRR(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rC = rC;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, r%d, r%d, r%d\n", rem_prefix(name), rT, rA, rB, rB);
+ }
}
static void emit_RI7(struct spe_function *p, unsigned op, unsigned rT,
- unsigned rA, int imm)
+ unsigned rA, int imm, const char *name)
{
union spe_inst_RI7 inst;
inst.inst.op = op;
@@ -180,12 +209,16 @@ static void emit_RI7(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rT = rT;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, r%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
+ }
}
static void emit_RI8(struct spe_function *p, unsigned op, unsigned rT,
- unsigned rA, int imm)
+ unsigned rA, int imm, const char *name)
{
union spe_inst_RI8 inst;
inst.inst.op = op;
@@ -194,12 +227,16 @@ static void emit_RI8(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rT = rT;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, r%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
+ }
}
static void emit_RI10(struct spe_function *p, unsigned op, unsigned rT,
- unsigned rA, int imm)
+ unsigned rA, int imm, const char *name)
{
union spe_inst_RI10 inst;
inst.inst.op = op;
@@ -208,11 +245,15 @@ static void emit_RI10(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rT = rT;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, r%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
+ }
}
static void emit_RI16(struct spe_function *p, unsigned op, unsigned rT,
- int imm)
+ int imm, const char *name)
{
union spe_inst_RI16 inst;
inst.inst.op = op;
@@ -220,11 +261,15 @@ static void emit_RI16(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rT = rT;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, 0x%x\n", rem_prefix(name), rT, imm);
+ }
}
static void emit_RI18(struct spe_function *p, unsigned op, unsigned rT,
- int imm)
+ int imm, const char *name)
{
union spe_inst_RI18 inst;
inst.inst.op = op;
@@ -232,6 +277,10 @@ static void emit_RI18(struct spe_function *p, unsigned op, unsigned rT,
inst.inst.rT = rT;
p->store[p->num_inst++] = inst.bits;
assert(p->num_inst <= p->max_inst);
+ if (p->print) {
+ indent(p);
+ printf("%s\tr%d, 0x%x\n", rem_prefix(name), rT, imm);
+ }
}
@@ -240,61 +289,61 @@ static void emit_RI18(struct spe_function *p, unsigned op, unsigned rT,
#define EMIT_(_name, _op) \
void _name (struct spe_function *p, unsigned rT) \
{ \
- emit_RR(p, _op, rT, 0, 0); \
+ emit_RR(p, _op, rT, 0, 0, __FUNCTION__); \
}
#define EMIT_R(_name, _op) \
void _name (struct spe_function *p, unsigned rT, unsigned rA) \
{ \
- emit_RR(p, _op, rT, rA, 0); \
+ emit_RR(p, _op, rT, rA, 0, __FUNCTION__); \
}
#define EMIT_RR(_name, _op) \
void _name (struct spe_function *p, unsigned rT, unsigned rA, unsigned rB) \
{ \
- emit_RR(p, _op, rT, rA, rB); \
+ emit_RR(p, _op, rT, rA, rB, __FUNCTION__); \
}
#define EMIT_RRR(_name, _op) \
void _name (struct spe_function *p, unsigned rT, unsigned rA, unsigned rB, unsigned rC) \
{ \
- emit_RRR(p, _op, rT, rA, rB, rC); \
+ emit_RRR(p, _op, rT, rA, rB, rC, __FUNCTION__); \
}
#define EMIT_RI7(_name, _op) \
void _name (struct spe_function *p, unsigned rT, unsigned rA, int imm) \
{ \
- emit_RI7(p, _op, rT, rA, imm); \
+ emit_RI7(p, _op, rT, rA, imm, __FUNCTION__); \
}
#define EMIT_RI8(_name, _op, bias) \
void _name (struct spe_function *p, unsigned rT, unsigned rA, int imm) \
{ \
- emit_RI8(p, _op, rT, rA, bias - imm); \
+ emit_RI8(p, _op, rT, rA, bias - imm, __FUNCTION__); \
}
#define EMIT_RI10(_name, _op) \
void _name (struct spe_function *p, unsigned rT, unsigned rA, int imm) \
{ \
- emit_RI10(p, _op, rT, rA, imm); \
+ emit_RI10(p, _op, rT, rA, imm, __FUNCTION__); \
}
#define EMIT_RI16(_name, _op) \
void _name (struct spe_function *p, unsigned rT, int imm) \
{ \
- emit_RI16(p, _op, rT, imm); \
+ emit_RI16(p, _op, rT, imm, __FUNCTION__); \
}
#define EMIT_RI18(_name, _op) \
void _name (struct spe_function *p, unsigned rT, int imm) \
{ \
- emit_RI18(p, _op, rT, imm); \
+ emit_RI18(p, _op, rT, imm, __FUNCTION__); \
}
#define EMIT_I16(_name, _op) \
void _name (struct spe_function *p, int imm) \
{ \
- emit_RI16(p, _op, 0, imm); \
+ emit_RI16(p, _op, 0, imm, __FUNCTION__); \
}
#include "rtasm_ppc_spe.h"
@@ -314,6 +363,9 @@ void spe_init_func(struct spe_function *p, unsigned code_size)
*/
p->regs[0] = ~7;
p->regs[1] = (1U << (80 - 64)) - 1;
+
+ p->print = false;
+ p->indent = 0;
}
@@ -382,6 +434,32 @@ void spe_release_register(struct spe_function *p, int reg)
}
+void
+spe_print_code(struct spe_function *p, boolean enable)
+{
+ p->print = enable;
+}
+
+
+void
+spe_indent(struct spe_function *p, int spaces)
+{
+ p->indent += spaces;
+}
+
+
+extern void
+spe_comment(struct spe_function *p, int rel_indent, const char *s)
+{
+ if (p->print) {
+ p->indent += rel_indent;
+ indent(p);
+ p->indent -= rel_indent;
+ printf("%s\n", s);
+ }
+}
+
+
/**
* For branch instructions:
* \param d if 1, disable interupts if branch is taken
@@ -392,51 +470,51 @@ void spe_release_register(struct spe_function *p, int reg)
/** Branch Indirect to address in rA */
void spe_bi(struct spe_function *p, unsigned rA, int d, int e)
{
- emit_RI7(p, 0x1a8, 0, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x1a8, 0, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Interupt Return */
void spe_iret(struct spe_function *p, unsigned rA, int d, int e)
{
- emit_RI7(p, 0x1aa, 0, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x1aa, 0, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Branch indirect and set link on external data */
void spe_bisled(struct spe_function *p, unsigned rT, unsigned rA, int d,
int e)
{
- emit_RI7(p, 0x1ab, rT, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x1ab, rT, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Branch indirect and set link. Save PC in rT, jump to rA. */
void spe_bisl(struct spe_function *p, unsigned rT, unsigned rA, int d,
int e)
{
- emit_RI7(p, 0x1a9, rT, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x1a9, rT, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Branch indirect if zero word. If rT.word[0]==0, jump to rA. */
void spe_biz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
{
- emit_RI7(p, 0x128, rT, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x128, rT, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Branch indirect if non-zero word. If rT.word[0]!=0, jump to rA. */
void spe_binz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
{
- emit_RI7(p, 0x129, rT, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x129, rT, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Branch indirect if zero halfword. If rT.halfword[1]==0, jump to rA. */
void spe_bihz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
{
- emit_RI7(p, 0x12a, rT, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x12a, rT, rA, (d << 5) | (e << 4), __FUNCTION__);
}
/** Branch indirect if non-zero halfword. If rT.halfword[1]!=0, jump to rA. */
void spe_bihnz(struct spe_function *p, unsigned rT, unsigned rA, int d, int e)
{
- emit_RI7(p, 0x12b, rT, rA, (d << 5) | (e << 4));
+ emit_RI7(p, 0x12b, rT, rA, (d << 5) | (e << 4), __FUNCTION__);
}
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
index 7a3ab9ace5..2579045232 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
@@ -28,6 +28,7 @@
* For details, see /opt/cell/sdk/docs/arch/SPU_ISA_v1.2_27Jan2007_pub.pdf
*
* \author Ian Romanick
+ * \author Brian Paul
*/
#ifndef RTASM_PPC_SPE_H
@@ -63,8 +64,12 @@ struct spe_function
* spe_release_register
*/
uint64_t regs[SPE_NUM_REGS / 64];
+
+ boolean print; /**< print/dump instructions as they're emitted? */
+ int indent; /**< number of spaces to indent */
};
+
extern void spe_init_func(struct spe_function *p, unsigned code_size);
extern void spe_release_func(struct spe_function *p);
@@ -72,6 +77,11 @@ extern int spe_allocate_available_register(struct spe_function *p);
extern int spe_allocate_register(struct spe_function *p, int reg);
extern void spe_release_register(struct spe_function *p, int reg);
+extern void spe_print_code(struct spe_function *p, boolean enable);
+extern void spe_indent(struct spe_function *p, int spaces);
+extern void spe_comment(struct spe_function *p, int rel_indent, const char *s);
+
+
#endif /* RTASM_PPC_SPE_H */
#ifndef EMIT_
--
cgit v1.2.3
From 8d768c51018841b66dbed87ae6b50358e53ad2c4 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Fri, 12 Sep 2008 21:54:25 -0600
Subject: cell: remove old disassembly/dump code; use dumper code in SPE
emitter.
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 104 ++++++++---------------------
1 file changed, 28 insertions(+), 76 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index a7b7dd03d3..0712d05b40 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -125,11 +125,13 @@ get_const_one_reg(struct codegen *gen)
if (gen->one_reg <= 0) {
gen->one_reg = spe_allocate_available_register(gen->f);
+ spe_indent(gen->f, 4);
+ spe_comment(gen->f, -4, "INIT CONSTANT 1.0:");
+
/* one = {1.0, 1.0, 1.0, 1.0} */
spe_load_float(gen->f, gen->one_reg, 1.0f);
-#if DISASSEM
- printf("\til\tr%d, 1.0f\n", gen->one_reg);
-#endif
+
+ spe_indent(gen->f, -4);
}
return gen->one_reg;
@@ -149,12 +151,13 @@ get_exec_mask_reg(struct codegen *gen)
if (gen->exec_mask_reg <= 0) {
gen->exec_mask_reg = spe_allocate_available_register(gen->f);
+ spe_indent(gen->f, 4);
+ spe_comment(gen->f, -4, "INIT EXEC MASK = ~0:");
+
/* exec_mask = {~0, ~0, ~0, ~0} */
spe_load_int(gen->f, gen->exec_mask_reg, ~0);
-#if DISASSEM
- printf("INIT EXEC MASK:\n");
- printf("\tload\tr%d, 0x%x\n", gen->exec_mask_reg, ~0);
-#endif
+
+ spe_indent(gen->f, -4);
}
return gen->exec_mask_reg;
@@ -192,9 +195,6 @@ get_src_reg(struct codegen *gen,
reg = get_itemp(gen);
/* Load: reg = memory[(machine_reg) + offset] */
spe_lqd(gen->f, reg, gen->inputs_reg, offset);
-#if DISASSEM
- printf("\tlqd\tr%d, r%d + %d\n", reg, gen->inputs_reg, offset);
-#endif
}
break;
case TGSI_FILE_IMMEDIATE:
@@ -262,10 +262,6 @@ store_dest_reg(struct codegen *gen,
* d[i] = mask_reg[i] ? value_reg : d_reg
*/
spe_selb(gen->f, d_reg, d_reg, value_reg, exec_reg);
-#if DISASSEM
- printf("\tselb\tr%d, r%d, r%d, r%d # EXEC MASK'ed\n",
- d_reg, d_reg, value_reg, exec_reg);
-#endif
}
else {
/* we're not inside a condition or loop: do nothing special */
@@ -288,22 +284,10 @@ store_dest_reg(struct codegen *gen,
spe_selb(gen->f, curval_reg, curval_reg, value_reg, exec_reg);
/* Store: memory[(machine_reg) + offset] = curval */
spe_stqd(gen->f, curval_reg, gen->outputs_reg, offset);
-#if DISASSEM
- printf("\tlqd\tr%d, r%d + %d\n",
- curval_reg, gen->outputs_reg, offset);
- printf("\tselb\tr%d, r%d, r%d, r%d # EXEC MASK'ed\n",
- curval_reg, curval_reg, value_reg, exec_reg);
- printf("\tstqd\tr%d, r%d + %d\n",
- curval_reg, gen->outputs_reg, offset);
-#endif
}
else {
/* Store: memory[(machine_reg) + offset] = reg */
spe_stqd(gen->f, value_reg, gen->outputs_reg, offset);
-#if DISASSEM
- printf("\tstqd\tr%d, r%d + %d\n",
- value_reg, gen->outputs_reg, offset);
-#endif
}
}
break;
@@ -317,18 +301,13 @@ static boolean
emit_MOV(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
-#if DISASSEM
- printf("MOV:\n");
-#endif
+ spe_comment(gen->f, -4, "MOV:");
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int src_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
int dst_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
/* XXX we don't always need to actually emit a mov instruction here */
spe_move(gen->f, dst_reg, src_reg);
-#if DISASSEM
- printf("\tmov\tr%d, r%d\n", dst_reg, src_reg);
-#endif
store_dest_reg(gen, dst_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
}
@@ -347,9 +326,7 @@ static boolean
emit_ADD(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
-#if DISASSEM
- printf("ADD:\n");
-#endif
+ spe_comment(gen->f, -4, "ADD:");
/* Loop over Red/Green/Blue/Alpha channels */
for (ch = 0; ch < 4; ch++) {
/* If the dest R, G, B or A writemask is enabled... */
@@ -361,9 +338,6 @@ emit_ADD(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* Emit actual SPE instruction: d = s1 + s2 */
spe_fa(gen->f, d_reg, s1_reg, s2_reg);
-#if DISASSEM
- printf("\tfa\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
-#endif
/* Store the result (a no-op for TGSI_FILE_TEMPORARY dests) */
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
@@ -382,9 +356,7 @@ static boolean
emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
-#if DISASSEM
- printf("MUL:\n");
-#endif
+ spe_comment(gen->f, -4, "MUL:");
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -392,9 +364,6 @@ emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
/* d = s1 * s2 */
spe_fm(gen->f, d_reg, s1_reg, s2_reg);
-#if DISASSEM
- printf("\tfm\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
-#endif
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
}
@@ -414,9 +383,8 @@ emit_SGT(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
-#if DISASSEM
- printf("SGT:\n");
-#endif
+ spe_comment(gen->f, -4, "SGT:");
+
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -425,16 +393,10 @@ emit_SGT(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* d = (s1 > s2) */
spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
-#if DISASSEM
- printf("\tfcgt\tr%d, r%d, r%d\n", d_reg, s1_reg, s2_reg);
-#endif
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
/* d = d & one_reg */
spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
-#if DISASSEM
- printf("\tand\tr%d, r%d, r%d\n", d_reg, d_reg, get_const_one_reg(gen));
-#endif
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
@@ -451,6 +413,8 @@ emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
const int channel = 0;
const int exec_reg = get_exec_mask_reg(gen);
+ spe_comment(gen->f, -4, "IF:");
+
/* update execution mask with the predicate register */
int tmp_reg = spe_allocate_available_register(gen->f);
int s1_reg = get_src_reg(gen, channel, &inst->FullSrcRegisters[0]);
@@ -461,12 +425,6 @@ emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
spe_complement(gen->f, tmp_reg);
/* exec_mask = exec_mask & tmp */
spe_and(gen->f, exec_reg, exec_reg, tmp_reg);
-#if DISASSEM
- printf("IF:\n");
- printf("\tseqi\tr%d, r%d, 0;\n", tmp_reg, s1_reg);
- printf("\tcomp\tr%d\n", tmp_reg);
- printf("\tand\tr%d, r%d, r%d\n", exec_reg, exec_reg, tmp_reg);
-#endif
gen->if_nesting++;
@@ -481,12 +439,11 @@ emit_ELSE(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
const int exec_reg = get_exec_mask_reg(gen);
+ spe_comment(gen->f, -4, "ELSE:");
+
/* exec_mask = !exec_mask */
spe_complement(gen->f, exec_reg);
-#if DISASSEM
- printf("ELSE:\n");
- printf("\tcomp\tr%d;\n", exec_reg);
-#endif
+
return true;
}
@@ -496,13 +453,11 @@ emit_ENDIF(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
const int exec_reg = get_exec_mask_reg(gen);
+ spe_comment(gen->f, -4, "ENDIF:");
+
/* XXX todo: pop execution mask */
spe_load_int(gen->f, exec_reg, ~0x0);
-#if DISASSEM
- printf("ENDIF:\n");
- printf("\tli\tr%d, ~0x0\n", exec_reg);
-#endif
gen->if_nesting--;
return true;
@@ -515,6 +470,8 @@ emit_DDX_DDY(struct codegen *gen, const struct tgsi_full_instruction *inst,
{
int ch;
+ spe_comment(gen->f, -4, ddx ? "DDX:" : "DDY:");
+
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -552,11 +509,9 @@ emit_DDX_DDY(struct codegen *gen, const struct tgsi_full_instruction *inst,
static boolean
emit_END(struct codegen *gen)
{
+ spe_comment(gen->f, -4, "END:");
/* return from function call */
spe_bi(gen->f, SPE_REG_RA, 0, 0);
-#if DISASSEM
- printf("\tbi\trRA\n");
-#endif
return true;
}
@@ -616,9 +571,7 @@ emit_immediate(struct codegen *gen, const struct tgsi_full_immediate *immed)
assert(gen->num_imm < MAX_TEMPS);
-#if DISASSEM
- printf("IMMEDIATE %d:\n", gen->num_imm);
-#endif
+ spe_comment(gen->f, -4, "IMMEDIATE:");
for (ch = 0; ch < 4; ch++) {
float val = immed->u.ImmediateFloat32[ch].Float;
@@ -632,9 +585,6 @@ emit_immediate(struct codegen *gen, const struct tgsi_full_immediate *immed)
/* emit initializer instruction */
spe_load_float(gen->f, reg, val);
-#if DISASSEM
- printf("\tload\tr%d, %f\n", reg, val);
-#endif
}
gen->num_imm++;
@@ -722,6 +672,8 @@ cell_gen_fragment_program(struct cell_context *cell,
spe_allocate_register(f, gen.constants_reg);
#if DISASSEM
+ spe_print_code(f, true);
+ spe_indent(f, 8);
printf("Begin %s\n", __FUNCTION__);
tgsi_dump(tokens, 0);
#endif
--
cgit v1.2.3
From 6e51febc6b4ab92588c27bc9a2754d940baadeef Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:20:14 -0600
Subject: GLU: fix asst warnings
---
src/glu/sgi/libnurbs/interface/mystdio.h | 6 +++---
src/glu/sgi/libnurbs/internals/backend.cc | 2 +-
src/glu/sgi/libnurbs/internals/backend.h | 2 +-
src/glu/sgi/libnurbs/internals/bufpool.cc | 2 +-
src/glu/sgi/libnurbs/internals/bufpool.h | 4 ++--
src/glu/sgi/libnurbs/internals/knotvector.cc | 2 +-
src/glu/sgi/libnurbs/internals/knotvector.h | 2 +-
src/glu/sgi/libnurbs/internals/nurbstess.cc | 2 +-
src/glu/sgi/libnurbs/internals/nurbstess.h | 2 +-
9 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/glu/sgi/libnurbs/interface/mystdio.h b/src/glu/sgi/libnurbs/interface/mystdio.h
index 6d737257f7..21c047c8ae 100644
--- a/src/glu/sgi/libnurbs/interface/mystdio.h
+++ b/src/glu/sgi/libnurbs/interface/mystdio.h
@@ -43,7 +43,7 @@
#define __glumystdio_h_
#ifdef STANDALONE
-inline void _glu_dprintf( char *, ... ) { }
+inline void _glu_dprintf( const char *, ... ) { }
#endif
#ifdef LIBRARYBUILD
@@ -51,12 +51,12 @@ inline void _glu_dprintf( char *, ... ) { }
#include
#define _glu_dprintf printf
#else
-inline void _glu_dprintf( char *, ... ) { }
+inline void _glu_dprintf( const char *, ... ) { }
#endif
#endif
#ifdef GLBUILD
-inline void _glu_dprintf( char *, ... ) { }
+inline void _glu_dprintf( const char *, ... ) { }
#endif
#ifndef NULL
diff --git a/src/glu/sgi/libnurbs/internals/backend.cc b/src/glu/sgi/libnurbs/internals/backend.cc
index 97775a9768..c4123fe627 100644
--- a/src/glu/sgi/libnurbs/internals/backend.cc
+++ b/src/glu/sgi/libnurbs/internals/backend.cc
@@ -246,7 +246,7 @@ Backend::evalVStrip(int n_left, REAL u_left, REAL* left_val,
*-------------------------------------------------------------------------
*/
void
-Backend::bgntmesh( char * )
+Backend::bgntmesh( const char * )
{
#ifndef NOWIREFRAME
diff --git a/src/glu/sgi/libnurbs/internals/backend.h b/src/glu/sgi/libnurbs/internals/backend.h
index c1f00b1a01..6f1d39416f 100644
--- a/src/glu/sgi/libnurbs/internals/backend.h
+++ b/src/glu/sgi/libnurbs/internals/backend.h
@@ -65,7 +65,7 @@ public:
void surfbbox( long, REAL *, REAL * );
void surfgrid( REAL, REAL, long, REAL, REAL, long );
void surfmesh( long, long, long, long );
- void bgntmesh( char * );
+ void bgntmesh( const char * );
void endtmesh( void );
void swaptmesh( void );
void tmeshvert( GridTrimVertex * );
diff --git a/src/glu/sgi/libnurbs/internals/bufpool.cc b/src/glu/sgi/libnurbs/internals/bufpool.cc
index d8d9c23db3..1edb069253 100644
--- a/src/glu/sgi/libnurbs/internals/bufpool.cc
+++ b/src/glu/sgi/libnurbs/internals/bufpool.cc
@@ -48,7 +48,7 @@
* Pool - allocate a new pool of buffers
*-----------------------------------------------------------------------------
*/
-Pool::Pool( int _buffersize, int initpoolsize, char *n )
+Pool::Pool( int _buffersize, int initpoolsize, const char *n )
{
if((unsigned)_buffersize < sizeof(Buffer))
buffersize = sizeof(Buffer);
diff --git a/src/glu/sgi/libnurbs/internals/bufpool.h b/src/glu/sgi/libnurbs/internals/bufpool.h
index 02e4ff247b..b48c4404f8 100644
--- a/src/glu/sgi/libnurbs/internals/bufpool.h
+++ b/src/glu/sgi/libnurbs/internals/bufpool.h
@@ -55,7 +55,7 @@ class Buffer {
class Pool {
public:
- Pool( int, int, char * );
+ Pool( int, int, const char * );
~Pool( void );
inline void* new_buffer( void );
inline void free_buffer( void * );
@@ -74,7 +74,7 @@ protected:
int nextfree; /* byte offset past next free buffer */
int initsize;
enum Magic { is_allocated = 0xf3a1, is_free = 0xf1a2 };
- char *name; /* name of the pool */
+ const char *name; /* name of the pool */
Magic magic; /* marker for valid pool */
};
diff --git a/src/glu/sgi/libnurbs/internals/knotvector.cc b/src/glu/sgi/libnurbs/internals/knotvector.cc
index 610046674c..9eb5cbace9 100644
--- a/src/glu/sgi/libnurbs/internals/knotvector.cc
+++ b/src/glu/sgi/libnurbs/internals/knotvector.cc
@@ -126,7 +126,7 @@ int Knotvector::validate( void )
return 0;
}
-void Knotvector::show( char *msg )
+void Knotvector::show( const char *msg )
{
#ifndef NDEBUG
_glu_dprintf( "%s\n", msg );
diff --git a/src/glu/sgi/libnurbs/internals/knotvector.h b/src/glu/sgi/libnurbs/internals/knotvector.h
index bb1e593326..4860ea2588 100644
--- a/src/glu/sgi/libnurbs/internals/knotvector.h
+++ b/src/glu/sgi/libnurbs/internals/knotvector.h
@@ -49,7 +49,7 @@ struct Knotvector { /* a knot vector */
~Knotvector( void );
void init( long, long, long, INREAL * );
int validate( void );
- void show( char * );
+ void show( const char * );
long order; /* order of spline */
long knotcount; /* number of knots */
diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.cc b/src/glu/sgi/libnurbs/internals/nurbstess.cc
index adf7c74626..aef56f317e 100644
--- a/src/glu/sgi/libnurbs/internals/nurbstess.cc
+++ b/src/glu/sgi/libnurbs/internals/nurbstess.cc
@@ -677,7 +677,7 @@ NurbsTessellator::do_nurbserror( int msg )
}
int
-NurbsTessellator::do_check_knots( Knotvector *knots, char *msg )
+NurbsTessellator::do_check_knots( Knotvector *knots, const char *msg )
{
int status = knots->validate();
if( status ) {
diff --git a/src/glu/sgi/libnurbs/internals/nurbstess.h b/src/glu/sgi/libnurbs/internals/nurbstess.h
index 3577088a9c..0e81facc0f 100644
--- a/src/glu/sgi/libnurbs/internals/nurbstess.h
+++ b/src/glu/sgi/libnurbs/internals/nurbstess.h
@@ -112,7 +112,7 @@ protected:
private:
void resetObjects( void );
- int do_check_knots( Knotvector *, char * );
+ int do_check_knots( Knotvector *, const char * );
void do_nurbserror( int );
void do_bgncurve( O_curve * );
void do_endcurve( void );
--
cgit v1.2.3
From ee2c8d6d3e3df674f14e9d58947bd6b5e70a6f74 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:21:50 -0600
Subject: silence warning
---
progs/demos/rain.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/progs/demos/rain.cxx b/progs/demos/rain.cxx
index 5c53d4248c..59b6471ef8 100644
--- a/progs/demos/rain.cxx
+++ b/progs/demos/rain.cxx
@@ -114,7 +114,7 @@ static void calcposobs(void)
rainParticle::setRainingArea(obs[0]-7.0f,-0.2f,obs[2]-7.0f,obs[0]+7.0f,8.0f,obs[2]+7.0f);
}
-static void printstring(void *font, char *string)
+static void printstring(void *font, const char *string)
{
int len,i;
--
cgit v1.2.3
From 5d4c8ec5e04eb15969dac1abb9ea3a254eb98d44 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:22:15 -0600
Subject: remove invalid XDestroyWindow() call
---
progs/xdemos/glxinfo.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c
index 6cf127afa2..445d3ea94b 100644
--- a/progs/xdemos/glxinfo.c
+++ b/progs/xdemos/glxinfo.c
@@ -447,7 +447,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
if (!ctx) {
fprintf(stderr, "Error: glXCreateContext failed\n");
XFree(visinfo);
- XDestroyWindow(dpy, win);
return;
}
--
cgit v1.2.3
From d2e0504d4e1d00bfc59d6661f9f0d33db1768f42 Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:23:14 -0600
Subject: mesa: #include
---
src/mesa/glapi/glthread.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mesa/glapi/glthread.c b/src/mesa/glapi/glthread.c
index 813d6f9dbc..b818f4e26e 100644
--- a/src/mesa/glapi/glthread.c
+++ b/src/mesa/glapi/glthread.c
@@ -34,6 +34,7 @@
#endif
#include
+#include
#include "glthread.h"
--
cgit v1.2.3
From 11a889db8f182fb1d11c998e5156deac8ca9f91d Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:23:39 -0600
Subject: mesa: return after _mesa_problem() calls
---
src/mesa/main/texformat_tmp.h | 1 +
src/mesa/swrast/s_texfilter.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h
index 63939f4011..7499ba7b36 100644
--- a/src/mesa/main/texformat_tmp.h
+++ b/src/mesa/main/texformat_tmp.h
@@ -1117,6 +1117,7 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage,
break;;
default:
_mesa_problem(ctx, "Bad palette format in fetch_texel_ci8");
+ return;
}
#if CHAN_TYPE == GL_UNSIGNED_BYTE
COPY_4UBV(texel, texelUB);
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index c9e9db132f..ee6131649a 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -342,6 +342,7 @@ lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c,
break; \
default: \
_mesa_problem(ctx, "Bad wrap mode"); \
+ return; \
} \
}
@@ -462,6 +463,7 @@ lerp_rgba_3d(GLchan result[4], GLfloat a, GLfloat b, GLfloat c,
break; \
default: \
_mesa_problem(ctx, "Bad wrap mode"); \
+ return; \
} \
}
--
cgit v1.2.3
From 811d8b86eb43b140de86e2674d50b19223d74c5e Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:24:31 -0600
Subject: glx: fix 64-bit datatype issue
---
src/glx/x11/indirect_vertex_program.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/glx/x11/indirect_vertex_program.c b/src/glx/x11/indirect_vertex_program.c
index 8d7cec9dd2..4f1485a850 100644
--- a/src/glx/x11/indirect_vertex_program.c
+++ b/src/glx/x11/indirect_vertex_program.c
@@ -193,7 +193,13 @@ void __indirect_glGetVertexAttribivARB( GLuint index, GLenum pname,
get_vertex_attrib( gc, 1303, index, pname, (xReply *) & reply );
if ( reply.size != 0 ) {
- if ( ! get_attrib_array_data( state, index, pname, params ) ) {
+ GLintptr data;
+
+
+ if ( get_attrib_array_data( state, index, pname, & data ) ) {
+ *params = (GLint) data;
+ }
+ else {
if (reply.size == 1) {
*params = (GLint) reply.pad3;
}
--
cgit v1.2.3
From 87ccb9504dfda502746c3a00eb607f1837dd265d Mon Sep 17 00:00:00 2001
From: Guillaume Melquiond
Date: Sat, 13 Sep 2008 14:25:02 -0600
Subject: i915: fix himask constant init for 64-bit build
---
src/mesa/drivers/dri/i915/i915_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c
index 8eb1c5b49e..eb1a052b9e 100644
--- a/src/mesa/drivers/dri/i915/i915_debug.c
+++ b/src/mesa/drivers/dri/i915/i915_debug.c
@@ -177,7 +177,7 @@ static GLboolean debug_variable_length_prim( struct debug_stream *stream )
#define BITS( dw, hi, lo, ... ) \
do { \
- unsigned himask = ~0UL >> (31 - (hi)); \
+ unsigned himask = 0xffffffffU >> (31 - (hi)); \
PRINTF("\t\t "); \
PRINTF(__VA_ARGS__); \
PRINTF(": 0x%x\n", ((dw) & himask) >> (lo)); \
--
cgit v1.2.3
From 68a19e353e1f68d6a5725c6bcb5d89949a4efe3f Mon Sep 17 00:00:00 2001
From: Jakub Bogusz
Date: Sat, 13 Sep 2008 14:35:02 -0600
Subject: tdfx: fix crash and lack of visuals bug
---
src/mesa/drivers/dri/tdfx/tdfx_screen.c | 77 +++++++++++----------------------
1 file changed, 25 insertions(+), 52 deletions(-)
diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
index fd21d8d51b..bb1f362540 100644
--- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c
+++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c
@@ -65,6 +65,7 @@ DRI_CONF_END;
static const __DRIextension *tdfxExtensions[] = {
&driReadDrawableExtension,
+ NULL
};
static const GLuint __driNConfigOptions = 1;
@@ -350,12 +351,7 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
unsigned stencil_bits,
GLboolean have_back_buffer)
{
- __DRIconfig **configs, **c;
- __GLcontextModes *m;
- unsigned num_modes;
- unsigned vis[2] = { GLX_TRUE_COLOR, GLX_DIRECT_COLOR };
unsigned deep = (depth_bits > 17);
- unsigned i, db, depth, accum, stencil;
/* Right now GLX_SWAP_COPY_OML isn't supported, but it would be easy
* enough to add support. Basically, if a context is created with an
@@ -363,55 +359,32 @@ tdfxFillInModes(__DRIscreenPrivate *psp,
* will never be used.
*/
- num_modes = (depth_bits == 16) ? 32 : 16;
-
- configs = _mesa_malloc(num_modes * sizeof *configs);
- c = configs;
-
- for (i = 0; i <= 1; i++) {
- for (db = 0; db <= 1; db++) {
- for (depth = 0; depth <= 1; depth++) {
- for (accum = 0; accum <= 1; accum++) {
- for (stencil = 0; stencil <= !deep; stencil++) {
- *c = _mesa_malloc(sizeof **c);
- m = &(*c++)->modes;
- if (deep) stencil = depth;
- m->redBits = deep ? 8 : 5;
- m->greenBits = deep ? 8 : 6;
- m->blueBits = deep ? 8 : 5;
- m->alphaBits = deep ? 8 : 0;
- m->redMask = deep ?0xFF000000 :0x0000F800;
- m->greenMask = deep ?0x00FF0000 :0x000007E0;
- m->blueMask = deep ?0x0000FF00 :0x0000001F;
- m->alphaMask = deep ? 0x000000FF : 0;
- m->rgbBits = m->redBits + m->greenBits +
- m->blueBits + m->alphaBits;
- m->accumRedBits = accum ? 16 : 0;
- m->accumGreenBits = accum ? 16 : 0;
- m->accumBlueBits = accum ? 16 : 0;
- m->accumAlphaBits = (accum && deep) ? 16 : 0;
- m->stencilBits = stencil ? 8 : 0;
- m->depthBits = deep
- ? (depth ? 24 : 0)
- : (depth ? 0 : depth_bits);
- m->visualType = vis[i];
- m->renderType = GLX_RGBA_BIT;
- m->drawableType = GLX_WINDOW_BIT;
- m->rgbMode = GL_TRUE;
- m->doubleBufferMode = db ? GL_TRUE : GL_FALSE;
- if (db)
- m->swapMethod = GLX_SWAP_UNDEFINED_OML;
- m->visualRating = ((stencil && !deep) || accum)
- ? GLX_SLOW_CONFIG
- : GLX_NONE;
- if (deep) stencil = 0;
- }
- }
- }
- }
+ static const GLenum db_modes[2] = { GLX_NONE, GLX_SWAP_UNDEFINED_OML };
+ uint8_t depth_bits_array[4];
+ uint8_t stencil_bits_array[4];
+ if(deep) {
+ depth_bits_array[0] = 0;
+ depth_bits_array[1] = 24;
+ stencil_bits_array[0] = 0;
+ stencil_bits_array[1] = 8;
+ } else {
+ depth_bits_array[0] = depth_bits;
+ depth_bits_array[1] = 0;
+ depth_bits_array[2] = depth_bits;
+ depth_bits_array[3] = 0;
+ stencil_bits_array[0] = 0;
+ stencil_bits_array[1] = 0;
+ stencil_bits_array[2] = 8;
+ stencil_bits_array[3] = 8;
}
- return (const __DRIconfig **) configs;
+ return driCreateConfigs(
+ deep ? GL_RGBA : GL_RGB,
+ deep ? GL_UNSIGNED_INT_8_8_8_8 : GL_UNSIGNED_SHORT_5_6_5,
+ depth_bits_array,
+ stencil_bits_array,
+ deep ? 2 : 4,
+ db_modes, 2);
}
/**
--
cgit v1.2.3
From 809e81c0b424839cb742ff2502b1010c0258b368 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Sat, 13 Sep 2008 15:21:58 -0600
Subject: gallium: add another value check to util_fast_pow()
Fixes glitches seen in morph3d demo.
---
src/gallium/auxiliary/util/u_math.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 9b4ca39371..0b10622ee7 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -272,8 +272,10 @@ util_fast_log2(float val)
static INLINE float
util_fast_pow(float x, float y)
{
- /* XXX this test may need adjustment */
- if (y >= 3.0 && -0.02f <= x && x <= 0.02f)
+ /* XXX these tests may need adjustment */
+ if (y >= 3.0f && (-0.02f <= x && x <= 0.02f))
+ return 0.0f;
+ if (y >= 50.0f && (-0.9f <= x && x <= 0.9f))
return 0.0f;
return util_fast_exp2(util_fast_log2(x) * y);
}
--
cgit v1.2.3
From 75c19eb5a1caf0c36e04270174579d0d7fec9ccb Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Sat, 13 Sep 2008 15:20:31 -0600
Subject: gallium: add another value check to util_fast_pow()
Fixes glitches seen in morph3d demo.
---
src/gallium/auxiliary/util/u_math.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 9b4ca39371..0b10622ee7 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -272,8 +272,10 @@ util_fast_log2(float val)
static INLINE float
util_fast_pow(float x, float y)
{
- /* XXX this test may need adjustment */
- if (y >= 3.0 && -0.02f <= x && x <= 0.02f)
+ /* XXX these tests may need adjustment */
+ if (y >= 3.0f && (-0.02f <= x && x <= 0.02f))
+ return 0.0f;
+ if (y >= 50.0f && (-0.9f <= x && x <= 0.9f))
return 0.0f;
return util_fast_exp2(util_fast_log2(x) * y);
}
--
cgit v1.2.3
From 870afb831921a5c38f22817d9e64d6be7fab235c Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Sat, 13 Sep 2008 15:31:46 -0600
Subject: negate.txt - test negation of a src reg
---
progs/fp/negate.txt | 6 ++++++
1 file changed, 6 insertions(+)
create mode 100644 progs/fp/negate.txt
diff --git a/progs/fp/negate.txt b/progs/fp/negate.txt
new file mode 100644
index 0000000000..3d00a04a58
--- /dev/null
+++ b/progs/fp/negate.txt
@@ -0,0 +1,6 @@
+!!ARBfp1.0
+# this should result in fragment color passing through unchanged
+TEMP R0;
+ADD R0, fragment.color, fragment.color;
+ADD result.color, R0, -fragment.color;
+END
--
cgit v1.2.3
From 777aca8fc99986dacf043cc3c25911df4252cb42 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Sat, 13 Sep 2008 15:32:46 -0600
Subject: cell: implement negation, absolute value and set-sign for src regs in
code gen
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 44 ++++++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 0712d05b40..8d8c095a7e 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -178,6 +178,8 @@ get_src_reg(struct codegen *gen,
{
int reg = -1;
int swizzle = tgsi_util_get_full_src_register_extswizzle(src, channel);
+ boolean reg_is_itemp = FALSE;
+ uint sign_op;
assert(swizzle >= 0);
assert(swizzle <= 3);
@@ -193,6 +195,7 @@ get_src_reg(struct codegen *gen,
/* offset is measured in quadwords, not bytes */
int offset = src->SrcRegister.Index * 4 + channel;
reg = get_itemp(gen);
+ reg_is_itemp = TRUE;
/* Load: reg = memory[(machine_reg) + offset] */
spe_lqd(gen->f, reg, gen->inputs_reg, offset);
}
@@ -206,6 +209,43 @@ get_src_reg(struct codegen *gen,
assert(0);
}
+ /*
+ * Handle absolute value, negate or set-negative of src register.
+ */
+ sign_op = tgsi_util_get_full_src_register_sign_mode(src, channel);
+ if (sign_op != TGSI_UTIL_SIGN_KEEP) {
+ /*
+ * All sign ops are done by manipulating bit 31, the IEEE float sign bit.
+ */
+ const int bit31mask_reg = get_itemp(gen);
+ int result_reg;
+
+ if (reg_is_itemp) {
+ /* re-use 'reg' for the result */
+ result_reg = reg;
+ }
+ else {
+ /* alloc a new reg for the result */
+ result_reg = get_itemp(gen);
+ }
+
+ /* mask with bit 31 set, the rest cleared */
+ spe_load_int(gen->f, bit31mask_reg, (1 << 31));
+
+ if (sign_op == TGSI_UTIL_SIGN_CLEAR) {
+ spe_andc(gen->f, result_reg, reg, bit31mask_reg);
+ }
+ else if (sign_op == TGSI_UTIL_SIGN_SET) {
+ spe_and(gen->f, result_reg, reg, bit31mask_reg);
+ }
+ else {
+ assert(sign_op == TGSI_UTIL_SIGN_TOGGLE);
+ spe_xor(gen->f, result_reg, reg, bit31mask_reg);
+ }
+
+ reg = result_reg;
+ }
+
return reg;
}
@@ -416,7 +456,7 @@ emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
spe_comment(gen->f, -4, "IF:");
/* update execution mask with the predicate register */
- int tmp_reg = spe_allocate_available_register(gen->f);
+ int tmp_reg = get_itemp(gen);
int s1_reg = get_src_reg(gen, channel, &inst->FullSrcRegisters[0]);
/* tmp = (s1_reg == 0) */
@@ -428,7 +468,7 @@ emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
gen->if_nesting++;
- spe_release_register(gen->f, tmp_reg);
+ free_itemps(gen);
return true;
}
--
cgit v1.2.3
From e852232ebf256d1587ae0d456c366553749fd275 Mon Sep 17 00:00:00 2001
From: Michal Krol
Date: Sun, 14 Sep 2008 19:04:53 +0200
Subject: draw: Silence compiler warnings on Windows.
---
src/gallium/auxiliary/draw/draw_vs_exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/draw/draw_vs_exec.c b/src/gallium/auxiliary/draw/draw_vs_exec.c
index 8041705b9c..79a19d6be2 100644
--- a/src/gallium/auxiliary/draw/draw_vs_exec.c
+++ b/src/gallium/auxiliary/draw/draw_vs_exec.c
@@ -46,7 +46,7 @@
struct exec_vertex_shader {
struct draw_vertex_shader base;
struct tgsi_exec_machine *machine;
- struct tgsi_token *machine_tokens;
+ const struct tgsi_token *machine_tokens;
};
static struct exec_vertex_shader *exec_vertex_shader( struct draw_vertex_shader *vs )
--
cgit v1.2.3
From 641b80275b7d0237c1d5bc79c19d12a0f422173a Mon Sep 17 00:00:00 2001
From: Shane Blackett
Date: Sun, 14 Sep 2008 17:51:01 -0600
Subject: glut: s/glut_fbc.c/glut_fcb.c/
---
src/glut/glx/Makefile.mgw | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/glut/glx/Makefile.mgw b/src/glut/glx/Makefile.mgw
index 9fff2e1503..5e1fde03de 100644
--- a/src/glut/glx/Makefile.mgw
+++ b/src/glut/glx/Makefile.mgw
@@ -122,7 +122,7 @@ SRCS = \
glut_dstr.c \
glut_event.c \
glut_ext.c \
- glut_fbc.c \
+ glut_fcb.c \
glut_fullscrn.c \
glut_gamemode.c \
glut_get.c \
--
cgit v1.2.3
From a30d2c5727b67a88feee9aff2f7d9128fca9408b Mon Sep 17 00:00:00 2001
From: Keith Whitwell
Date: Mon, 15 Sep 2008 13:47:12 +0100
Subject: add dlist-degenerate test case
---
progs/trivial/Makefile | 1 +
progs/trivial/dlist-degenerate.c | 153 +++++++++++++++++++++++++++++++++++++++
2 files changed, 154 insertions(+)
create mode 100644 progs/trivial/dlist-degenerate.c
diff --git a/progs/trivial/Makefile b/progs/trivial/Makefile
index e72fb07889..36a5548488 100644
--- a/progs/trivial/Makefile
+++ b/progs/trivial/Makefile
@@ -47,6 +47,7 @@ SOURCES = \
dlist-edgeflag.c \
dlist-dangling.c \
dlist-edgeflag-dangling.c \
+ dlist-degenerate.c \
drawrange.c \
drawelements.c \
drawarrays.c \
diff --git a/progs/trivial/dlist-degenerate.c b/progs/trivial/dlist-degenerate.c
new file mode 100644
index 0000000000..c7f2d2a6e9
--- /dev/null
+++ b/progs/trivial/dlist-degenerate.c
@@ -0,0 +1,153 @@
+/**
+ * Test display list corner cases.
+ */
+
+
+#include
+#include
+#include
+#include
+
+
+static int Win;
+static GLfloat Xrot = 0, Yrot = 0, Zrot = 0;
+static GLboolean Anim = GL_FALSE;
+static GLuint List1 = 0, List2 = 0;
+
+
+static void
+Idle(void)
+{
+ Xrot += 3.0;
+ Yrot += 4.0;
+ Zrot += 2.0;
+ glutPostRedisplay();
+}
+
+
+static void
+Draw(void)
+{
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ glPushMatrix();
+ glRotatef(Xrot, 1, 0, 0);
+ glRotatef(Yrot, 0, 1, 0);
+ glRotatef(Zrot, 0, 0, 1);
+
+ glCallList(List1);
+ glCallList(List2);
+
+ glPopMatrix();
+
+ glutSwapBuffers();
+}
+
+
+static void
+Reshape(int width, int height)
+{
+ glViewport(0, 0, width, height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1.0, 1.0, -1.0, 1.0, 5.0, 25.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0.0, 0.0, -15.0);
+}
+
+
+static void
+Key(unsigned char key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case 'a':
+ Anim = !Anim;
+ if (Anim)
+ glutIdleFunc(Idle);
+ else
+ glutIdleFunc(NULL);
+ break;
+ case 'z':
+ Zrot -= step;
+ break;
+ case 'Z':
+ Zrot += step;
+ break;
+ case 27:
+ glutDestroyWindow(Win);
+ exit(0);
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+SpecialKey(int key, int x, int y)
+{
+ const GLfloat step = 3.0;
+ (void) x;
+ (void) y;
+ switch (key) {
+ case GLUT_KEY_UP:
+ Xrot -= step;
+ break;
+ case GLUT_KEY_DOWN:
+ Xrot += step;
+ break;
+ case GLUT_KEY_LEFT:
+ Yrot -= step;
+ break;
+ case GLUT_KEY_RIGHT:
+ Yrot += step;
+ break;
+ }
+ glutPostRedisplay();
+}
+
+
+static void
+Init(void)
+{
+ /* List1: start of primitive */
+ List1 = glGenLists(1);
+ glNewList(List1, GL_COMPILE);
+ glBegin(GL_POLYGON);
+ glVertex2f(-1, -1);
+ glVertex2f( 1, -1);
+ glEndList();
+
+ /* List2: end of primitive */
+ List2 = glGenLists(1);
+ glNewList(List2, GL_COMPILE);
+ glVertex2f( 1, 1);
+ glVertex2f(-1, 1);
+ glEnd();
+ glEndList();
+
+ glEnable(GL_DEPTH_TEST);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+ glutInit(&argc, argv);
+ glutInitWindowPosition(0, 0);
+ glutInitWindowSize(400, 400);
+ glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
+ Win = glutCreateWindow(argv[0]);
+ glutReshapeFunc(Reshape);
+ glutKeyboardFunc(Key);
+ glutSpecialFunc(SpecialKey);
+ glutDisplayFunc(Draw);
+ if (Anim)
+ glutIdleFunc(Idle);
+ Init();
+ glutMainLoop();
+ return 0;
+}
--
cgit v1.2.3
From bd953e872f22690bd232a758383883100d9347d0 Mon Sep 17 00:00:00 2001
From: Keith Whitwell
Date: Mon, 15 Sep 2008 13:47:25 +0100
Subject: mesa: get another class of degenerate dlists working
Primitive begin in one dlist, end in another.
---
src/mesa/main/dlist.c | 7 +++++--
src/mesa/vbo/vbo_save_api.c | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 63a00e04f5..9f6f4d96f4 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -6788,6 +6788,11 @@ _mesa_EndList(void)
_mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
return;
}
+
+ /* Call before emitting END_OF_LIST, in case the driver wants to
+ * emit opcodes itself.
+ */
+ ctx->Driver.EndList(ctx);
(void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
@@ -6801,8 +6806,6 @@ _mesa_EndList(void)
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
mesa_print_display_list(ctx->ListState.CurrentListNum);
- ctx->Driver.EndList(ctx);
-
ctx->ListState.CurrentList = NULL;
ctx->ListState.CurrentListNum = 0;
ctx->ListState.CurrentListPtr = NULL;
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 88d573f128..f93ef3a02a 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1045,6 +1045,30 @@ void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode )
void vbo_save_EndList( GLcontext *ctx )
{
struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ /* EndList called inside a (saved) Begin/End pair?
+ */
+ if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ GLint i = save->prim_count - 1;
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+
+ /* Make sure this vertex list gets replayed by the "loopback"
+ * mechanism:
+ */
+ save->dangling_attr_ref = 1;
+ vbo_save_SaveFlushVertices( ctx );
+
+ /* Swap out this vertex format while outside begin/end. Any color,
+ * etc. received between here and the next begin will be compiled
+ * as opcodes.
+ */
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+ }
+
unmap_vertex_store( ctx, save->vertex_store );
assert(save->vertex_size == 0);
--
cgit v1.2.3
From d36f4ef16b338f42342cac5a7f2ec55e17fc0893 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 15 Sep 2008 09:07:32 -0600
Subject: mesa: remove some assertions that are invalid during context
tear-down
---
src/mesa/main/bufferobj.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 1b58f5e96a..918e87246f 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -205,11 +205,14 @@ _mesa_reference_buffer_object(GLcontext *ctx,
if (deleteFlag) {
/* some sanity checking: don't delete a buffer still in use */
+#if 0
+ /* unfortunately, these tests are invalid during context tear-down */
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
ASSERT(ctx->Array.ElementArrayBufferObj != bufObj);
ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj);
- ASSERT(ctx->Driver.DeleteBuffer);
+#endif
+ ASSERT(ctx->Driver.DeleteBuffer);
ctx->Driver.DeleteBuffer(ctx, oldObj);
}
--
cgit v1.2.3
From cd23c5c5998f3c48153a22bed53986b4293f797a Mon Sep 17 00:00:00 2001
From: Keith Whitwell
Date: Mon, 15 Sep 2008 13:47:25 +0100
Subject: mesa: get another class of degenerate dlists working
Primitive begin in one dlist, end in another.
---
src/mesa/main/dlist.c | 7 +++++--
src/mesa/vbo/vbo_save_api.c | 24 ++++++++++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index b4ed300b2e..ffe6dbfe08 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -6737,6 +6737,11 @@ _mesa_EndList(void)
_mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
return;
}
+
+ /* Call before emitting END_OF_LIST, in case the driver wants to
+ * emit opcodes itself.
+ */
+ ctx->Driver.EndList(ctx);
(void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
@@ -6750,8 +6755,6 @@ _mesa_EndList(void)
if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
mesa_print_display_list(ctx->ListState.CurrentListNum);
- ctx->Driver.EndList(ctx);
-
ctx->ListState.CurrentList = NULL;
ctx->ListState.CurrentListNum = 0;
ctx->ListState.CurrentListPtr = NULL;
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index 88d573f128..f93ef3a02a 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1045,6 +1045,30 @@ void vbo_save_NewList( GLcontext *ctx, GLuint list, GLenum mode )
void vbo_save_EndList( GLcontext *ctx )
{
struct vbo_save_context *save = &vbo_context(ctx)->save;
+
+ /* EndList called inside a (saved) Begin/End pair?
+ */
+ if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
+ GLint i = save->prim_count - 1;
+
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+
+ /* Make sure this vertex list gets replayed by the "loopback"
+ * mechanism:
+ */
+ save->dangling_attr_ref = 1;
+ vbo_save_SaveFlushVertices( ctx );
+
+ /* Swap out this vertex format while outside begin/end. Any color,
+ * etc. received between here and the next begin will be compiled
+ * as opcodes.
+ */
+ _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt );
+ }
+
unmap_vertex_store( ctx, save->vertex_store );
assert(save->vertex_size == 0);
--
cgit v1.2.3
From 987c4b35b8f552a88e1b6459adaabbf544d6bbf6 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 15 Sep 2008 09:07:32 -0600
Subject: mesa: remove some assertions that are invalid during context
tear-down
---
src/mesa/main/bufferobj.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index f1e0932b07..ecdb4d219c 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -205,11 +205,14 @@ _mesa_reference_buffer_object(GLcontext *ctx,
if (deleteFlag) {
/* some sanity checking: don't delete a buffer still in use */
+#if 0
+ /* unfortunately, these tests are invalid during context tear-down */
ASSERT(ctx->Array.ArrayBufferObj != bufObj);
ASSERT(ctx->Array.ElementArrayBufferObj != bufObj);
ASSERT(ctx->Array.ArrayObj->Vertex.BufferObj != bufObj);
- ASSERT(ctx->Driver.DeleteBuffer);
+#endif
+ ASSERT(ctx->Driver.DeleteBuffer);
ctx->Driver.DeleteBuffer(ctx, oldObj);
}
--
cgit v1.2.3
From 4c9cd725d54edf9baacef83d94c6487c7d592090 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Mon, 15 Sep 2008 17:55:09 +0200
Subject: i915simple: dri winsys does now compile and works
Glxgears hits an assert, but tri works
---
src/gallium/winsys/drm/intel/dri/intel_screen.c | 387 +++++++++++++++---------
1 file changed, 242 insertions(+), 145 deletions(-)
diff --git a/src/gallium/winsys/drm/intel/dri/intel_screen.c b/src/gallium/winsys/drm/intel/dri/intel_screen.c
index 3a486481f5..3465f8a4d9 100644
--- a/src/gallium/winsys/drm/intel/dri/intel_screen.c
+++ b/src/gallium/winsys/drm/intel/dri/intel_screen.c
@@ -113,7 +113,118 @@ static PFNGLXCREATECONTEXTMODES create_context_modes = NULL;
extern const struct dri_extension card_extensions[];
+static GLboolean
+intel_get_param(__DRIscreenPrivate *psp, int param, int *value)
+{
+ int ret;
+ struct drm_i915_getparam gp;
+ gp.param = param;
+ gp.value = value;
+
+ ret = drmCommandWriteRead(psp->fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
+ if (ret) {
+ fprintf(stderr, "drm_i915_getparam: %d\n", ret);
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static void
+intelSetTexOffset(__DRIcontext *pDRICtx, int texname,
+ unsigned long long offset, int depth, uint pitch)
+{
+ abort();
+#if 0
+ struct intel_context *intel = (struct intel_context*)
+ ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
+ struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
+ struct st_texture_object *stObj = st_texture_object(tObj);
+
+ if (!stObj)
+ return;
+
+ if (stObj->pt)
+ st->pipe->texture_release(intel->st->pipe, &stObj->pt);
+
+ stObj->imageOverride = GL_TRUE;
+ stObj->depthOverride = depth;
+ stObj->pitchOverride = pitch;
+
+ if (offset)
+ stObj->textureOffset = offset;
+#endif
+}
+
+
+#if 0
+static void
+intelHandleDrawableConfig(__DRIdrawablePrivate *dPriv,
+ __DRIcontextPrivate *pcp,
+ __DRIDrawableConfigEvent *event)
+{
+ (void) dPriv;
+ (void) pcp;
+ (void) event;
+}
+#endif
+
+#if 0
+static void
+intelHandleBufferAttach(__DRIdrawablePrivate *dPriv,
+ __DRIcontextPrivate *pcp,
+ __DRIBufferAttachEvent *ba)
+{
+ struct intel_screen *intelScreen = intel_screen(dPriv->driScreenPriv);
+
+ switch (ba->buffer.attachment) {
+ case DRI_DRAWABLE_BUFFER_FRONT_LEFT:
+ intelScreen->front.width = dPriv->w;
+ intelScreen->front.height = dPriv->h;
+ intelScreen->front.cpp = ba->buffer.cpp;
+ intelScreen->front.pitch = ba->buffer.pitch;
+ driGenBuffers(intelScreen->base.staticPool, "front", 1, &intelScreen->front.buffer, 0, 0, 0);
+ driBOSetReferenced(intelScreen->front.buffer, ba->buffer.handle);
+ break;
+
+ case DRI_DRAWABLE_BUFFER_BACK_LEFT:
+ case DRI_DRAWABLE_BUFFER_DEPTH:
+ case DRI_DRAWABLE_BUFFER_STENCIL:
+ case DRI_DRAWABLE_BUFFER_ACCUM:
+ /* anything ?? */
+ break;
+
+ default:
+ fprintf(stderr, "unhandled buffer attach event, attachment type %d\n",
+ ba->buffer.attachment);
+ return;
+ }
+}
+#endif
+
+static const __DRItexOffsetExtension intelTexOffsetExtension = {
+ { __DRI_TEX_OFFSET },
+ intelSetTexOffset,
+};
+
+#if 0
+static const __DRItexBufferExtension intelTexBufferExtension = {
+ { __DRI_TEX_BUFFER, __DRI_TEX_BUFFER_VERSION },
+ intelSetTexBuffer,
+};
+#endif
+
+static const __DRIextension *intelScreenExtensions[] = {
+ &driReadDrawableExtension,
+ &driCopySubBufferExtension.base,
+ &driSwapControlExtension.base,
+ &driFrameTrackingExtension.base,
+ &driMediaStreamCounterExtension.base,
+ &intelTexOffsetExtension.base,
+// &intelTexBufferExtension.base,
+ NULL
+};
static void
@@ -232,7 +343,8 @@ intelCreatePools(__DRIscreenPrivate * sPriv)
intelScreen->havePools = GL_TRUE;
- intelUpdateScreenRotation(sPriv, intelScreen->sarea);
+ if (intelScreen->sarea)
+ intelUpdateScreenRotation(sPriv, intelScreen->sarea);
return GL_TRUE;
}
@@ -253,10 +365,12 @@ intel_flush_frontbuffer( struct pipe_winsys *winsys,
struct pipe_surface *surf,
void *context_private)
{
- struct intel_context *intel = (struct intel_context *) context_private;
- __DRIdrawablePrivate *dPriv = intel->driDrawable;
+ //struct intel_context *intel = (struct intel_context *) context_private;
+ //__DRIdrawablePrivate *dPriv = intel->driDrawable;
- intelDisplaySurface(dPriv, surf, NULL);
+ //assert((int)"Doesn't work currently" & 0);
+
+ //intelDisplaySurface(dPriv, surf, NULL);
}
static boolean
@@ -265,11 +379,6 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
struct intel_screen *intelScreen;
I830DRIPtr gDRIPriv = (I830DRIPtr) sPriv->pDevPriv;
- PFNGLXSCRENABLEEXTENSIONPROC glx_enable_extension =
- (PFNGLXSCRENABLEEXTENSIONPROC) (*dri_interface->
- getProcAddress("glxEnableExtension"));
- void *const psc = sPriv->psc->screenConfigs;
-
if (sPriv->devPrivSize != sizeof(I830DRIRec)) {
fprintf(stderr,
"\nERROR! sizeof(I830DRIRec) does not match passed size from device driver\n");
@@ -286,28 +395,19 @@ intelInitDriver(__DRIscreenPrivate * sPriv)
__driConfigOptions, __driNConfigOptions);
sPriv->private = (void *) intelScreen;
-
intelScreen->sarea = (drmI830Sarea *) (((GLubyte *) sPriv->pSAREA) +
- gDRIPriv->sarea_priv_offset);
- intelScreen->deviceID = gDRIPriv->deviceID;
- intelScreen->front.cpp = gDRIPriv->cpp;
- intelScreen->drmMinor = sPriv->drmMinor;
+ gDRIPriv->sarea_priv_offset);
- assert(gDRIPriv->bitsPerPixel == 16 ||
- gDRIPriv->bitsPerPixel == 32);
+ intelScreen->deviceID = gDRIPriv->deviceID;
+ intelScreen->front.cpp = gDRIPriv->cpp;
+ intelScreen->drmMinor = sPriv->drm_version.minor;
intelUpdateScreenRotation(sPriv, intelScreen->sarea);
if (0)
intelPrintDRIInfo(intelScreen, sPriv, gDRIPriv);
- if (glx_enable_extension != NULL) {
- (*glx_enable_extension) (psc, "GLX_SGI_swap_control");
- (*glx_enable_extension) (psc, "GLX_SGI_video_sync");
- (*glx_enable_extension) (psc, "GLX_MESA_swap_control");
- (*glx_enable_extension) (psc, "GLX_MESA_swap_frame_usage");
- (*glx_enable_extension) (psc, "GLX_SGI_make_current_read");
- }
+ sPriv->extensions = intelScreenExtensions;
intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
intelScreen->base.base.get_name = intel_get_name;
@@ -406,65 +506,19 @@ intelGetSwapInfo(__DRIdrawablePrivate * dPriv, __DRIswapInfo * sInfo)
return 0;
}
-
-static void
-intelSetTexOffset(__DRIcontext *pDRICtx, int texname,
- unsigned long long offset, int depth, uint pitch)
+static __DRIconfig **
+intelFillInModes(__DRIscreenPrivate *psp,
+ unsigned pixel_bits, unsigned depth_bits,
+ unsigned stencil_bits, GLboolean have_back_buffer)
{
- abort();
-#if 0
- struct intel_context *intel = (struct intel_context*)
- ((__DRIcontextPrivate*)pDRICtx->private)->driverPrivate;
- struct gl_texture_object *tObj = _mesa_lookup_texture(&intel->ctx, texname);
- struct st_texture_object *stObj = st_texture_object(tObj);
-
- if (!stObj)
- return;
-
- if (stObj->pt)
- st->pipe->texture_release(intel->st->pipe, &stObj->pt);
-
- stObj->imageOverride = GL_TRUE;
- stObj->depthOverride = depth;
- stObj->pitchOverride = pitch;
-
- if (offset)
- stObj->textureOffset = offset;
-#endif
-}
-
-
-static const struct __DriverAPIRec intelAPI = {
- .InitDriver = intelInitDriver,
- .DestroyScreen = intelDestroyScreen,
- .CreateContext = intelCreateContext,
- .DestroyContext = intelDestroyContext,
- .CreateBuffer = intelCreateBuffer,
- .DestroyBuffer = intelDestroyBuffer,
- .SwapBuffers = intelSwapBuffers,
- .MakeCurrent = intelMakeCurrent,
- .UnbindContext = intelUnbindContext,
- .GetSwapInfo = intelGetSwapInfo,
- .GetMSC = driGetMSC32,
- .WaitForMSC = driWaitForMSC32,
- .WaitForSBC = NULL,
- .SwapBuffersMSC = NULL,
- .CopySubBuffer = intelCopySubBuffer,
- .setTexOffset = intelSetTexOffset,
-};
-
-
-static __GLcontextModes *
-intelFillInModes(unsigned pixel_bits, unsigned depth_bits,
- unsigned stencil_bits, boolean have_back_buffer)
-{
- __GLcontextModes *modes;
+ __DRIconfig **configs;
__GLcontextModes *m;
unsigned num_modes;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
GLenum fb_format;
GLenum fb_type;
+ int i;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
@@ -508,100 +562,143 @@ intelFillInModes(unsigned pixel_bits, unsigned depth_bits,
fb_type = GL_UNSIGNED_INT_8_8_8_8_REV;
}
- modes =
- (*dri_interface->createContextModes) (num_modes,
- sizeof(__GLcontextModes));
- m = modes;
- if (!driFillInModes(&m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor, msaa_samples_array, 1, GLX_TRUE_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
- __LINE__);
- return NULL;
- }
- if (!driFillInModes(&m, fb_format, fb_type,
- depth_bits_array, stencil_bits_array,
- depth_buffer_factor, back_buffer_modes,
- back_buffer_factor, msaa_samples_array, 1, GLX_DIRECT_COLOR)) {
- fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
+ configs = driCreateConfigs(fb_format, fb_type,
+ depth_bits_array, stencil_bits_array,
+ depth_buffer_factor, back_buffer_modes,
+ back_buffer_factor);
+ if (configs == NULL) {
+ fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__,
__LINE__);
return NULL;
}
/* Mark the visual as slow if there are "fake" stencil bits.
*/
- for (m = modes; m != NULL; m = m->next) {
+ for (i = 0; configs[i]; i++) {
+ m = &configs[i]->modes;
if ((m->stencilBits != 0) && (m->stencilBits != stencil_bits)) {
m->visualRating = GLX_SLOW_CONFIG;
}
}
- return modes;
+ return configs;
}
-
/**
- * This is the bootstrap function for the driver. libGL supplies all of the
- * requisite information about the system, and the driver initializes itself.
- * This routine also fills in the linked list pointed to by \c driver_modes
- * with the \c __GLcontextModes that the driver can support for windows or
- * pbuffers.
+ * This is the driver specific part of the createNewScreen entry point.
+ *
+ * \todo maybe fold this into intelInitDriver
*
- * \return A pointer to a \c __DRIscreenPrivate on success, or \c NULL on
- * failure.
+ * \return the __GLcontextModes supported by this driver
*/
-PUBLIC void *
-__driCreateNewScreen_20050727(__DRInativeDisplay * dpy, int scrn,
- __DRIscreen * psc,
- const __GLcontextModes * modes,
- const __DRIversion * ddx_version,
- const __DRIversion * dri_version,
- const __DRIversion * drm_version,
- const __DRIframebuffer * frame_buffer,
- drmAddress pSAREA, int fd,
- int internal_api_version,
- const __DRIinterfaceMethods * interface,
- __GLcontextModes ** driver_modes)
+static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp)
{
- __DRIscreenPrivate *psp;
- static const __DRIversion ddx_expected = { 1, 7, 0 };
+#ifdef I915
+ static const __DRIversion ddx_expected = { 1, 5, 0 };
+#else
+ static const __DRIversion ddx_expected = { 1, 6, 0 };
+#endif
static const __DRIversion dri_expected = { 4, 0, 0 };
- static const __DRIversion drm_expected = { 1, 7, 0 };
-
- dri_interface = interface;
+ static const __DRIversion drm_expected = { 1, 5, 0 };
+ I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
if (!driCheckDriDdxDrmVersions2("i915",
- dri_version, &dri_expected,
- ddx_version, &ddx_expected,
- drm_version, &drm_expected)) {
+ &psp->dri_version, &dri_expected,
+ &psp->ddx_version, &ddx_expected,
+ &psp->drm_version, &drm_expected)) {
return NULL;
}
- psp = __driUtilCreateNewScreen(dpy, scrn, psc, NULL,
- ddx_version, dri_version, drm_version,
- frame_buffer, pSAREA, fd,
- internal_api_version, &intelAPI);
-
- if (psp != NULL) {
- I830DRIPtr dri_priv = (I830DRIPtr) psp->pDevPriv;
- *driver_modes = intelFillInModes(dri_priv->cpp * 8,
- (dri_priv->cpp == 2) ? 16 : 24,
- (dri_priv->cpp == 2) ? 0 : 8, 1);
-
- /* Calling driInitExtensions here, with a NULL context pointer,
- * does not actually enable the extensions. It just makes sure
- * that all the dispatch offsets for all the extensions that
- * *might* be enables are known. This is needed because the
- * dispatch offsets need to be known when _mesa_context_create
- * is called, but we can't enable the extensions until we have a
- * context pointer.
- *
- * Hello chicken. Hello egg. How are you two today?
- */
- driInitExtensions(NULL, card_extensions, GL_FALSE);
+ /* Calling driInitExtensions here, with a NULL context pointer,
+ * does not actually enable the extensions. It just makes sure
+ * that all the dispatch offsets for all the extensions that
+ * *might* be enables are known. This is needed because the
+ * dispatch offsets need to be known when _mesa_context_create is
+ * called, but we can't enable the extensions until we have a
+ * context pointer.
+ *
+ * Hello chicken. Hello egg. How are you two today?
+ */
+ //intelInitExtensions(NULL, GL_TRUE);
+
+ if (!intelInitDriver(psp))
+ return NULL;
+
+ psp->extensions = intelScreenExtensions;
+
+ return (const __DRIconfig **)
+ intelFillInModes(psp, dri_priv->cpp * 8,
+ (dri_priv->cpp == 2) ? 16 : 24,
+ (dri_priv->cpp == 2) ? 0 : 8, 1);
+}
+
+/**
+ * This is the driver specific part of the createNewScreen entry point.
+ *
+ * \return the __GLcontextModes supported by this driver
+ */
+static const
+__DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp)
+{
+ struct intel_screen *intelScreen;
+
+ /* Calling driInitExtensions here, with a NULL context pointer,
+ * does not actually enable the extensions. It just makes sure
+ * that all the dispatch offsets for all the extensions that
+ * *might* be enables are known. This is needed because the
+ * dispatch offsets need to be known when _mesa_context_create is
+ * called, but we can't enable the extensions until we have a
+ * context pointer.
+ *
+ * Hello chicken. Hello egg. How are you two today?
+ */
+ //intelInitExtensions(NULL, GL_TRUE);
+
+ /* Allocate the private area */
+ intelScreen = CALLOC_STRUCT(intel_screen);
+ if (!intelScreen) {
+ fprintf(stderr, "\nERROR! Allocating private area failed\n");
+ return GL_FALSE;
}
+ /* parse information in __driConfigOptions */
+ driParseOptionInfo(&intelScreen->optionCache,
+ __driConfigOptions, __driNConfigOptions);
+
+ psp->private = (void *) intelScreen;
- return (void *) psp;
+ intelScreen->drmMinor = psp->drm_version.minor;
+
+ /* Determine chipset ID? */
+ if (!intel_get_param(psp, I915_PARAM_CHIPSET_ID,
+ &intelScreen->deviceID))
+ return GL_FALSE;
+
+ psp->extensions = intelScreenExtensions;
+
+ intel_be_init_device(&intelScreen->base, psp->fd, intelScreen->deviceID);
+ intelScreen->base.base.flush_frontbuffer = intel_flush_frontbuffer;
+ intelScreen->base.base.get_name = intel_get_name;
+
+ return driConcatConfigs(intelFillInModes(psp, 16, 16, 0, 1),
+ intelFillInModes(psp, 32, 24, 8, 1));
}
+const struct __DriverAPIRec driDriverAPI = {
+ .InitScreen = intelInitScreen,
+ .DestroyScreen = intelDestroyScreen,
+ .CreateContext = intelCreateContext,
+ .DestroyContext = intelDestroyContext,
+ .CreateBuffer = intelCreateBuffer,
+ .DestroyBuffer = intelDestroyBuffer,
+ .SwapBuffers = intelSwapBuffers,
+ .MakeCurrent = intelMakeCurrent,
+ .UnbindContext = intelUnbindContext,
+ .GetSwapInfo = intelGetSwapInfo,
+ .GetDrawableMSC = driDrawableGetMSC32,
+ .WaitForMSC = driWaitForMSC32,
+ .CopySubBuffer = intelCopySubBuffer,
+
+ //.InitScreen2 = intelInitScreen2,
+ //.HandleDrawableConfig = intelHandleDrawableConfig,
+ //.HandleBufferAttach = intelHandleBufferAttach,
+};
--
cgit v1.2.3
From 367774a62aa0627c5589e91ab7b411634113c815 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Mon, 15 Sep 2008 11:56:21 -0600
Subject: Fixed emit_RRR
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
index 8718be9ded..74cd4176e7 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
@@ -194,7 +194,7 @@ static void emit_RRR(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, r%d, r%d, r%d\n", rem_prefix(name), rT, rA, rB, rB);
+ printf("%s\tr%d, r%d, r%d, r%d\n", rem_prefix(name), rT, rA, rB, rC);
}
}
--
cgit v1.2.3
From 5a4ab148a76f6c6d33b9784f99531a6bf2d9101b Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Mon, 15 Sep 2008 11:56:51 -0600
Subject: Added support for SUB and MAD instructions
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 61 ++++++++++++++++++++++++++++--
1 file changed, 58 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 8d8c095a7e..9eae57bb76 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -52,7 +52,7 @@
/** Set to 1 to enable debug/disassembly printfs */
-#define DISASSEM 0
+#define DISASSEM 1
#define MAX_TEMPS 16
@@ -76,7 +76,7 @@ struct codegen
/** Per-instruction temps / intermediate temps */
int num_itemps;
- int itemps[3];
+ int itemps[4];
/** Current IF/ELSE/ENDIF nesting level */
int if_nesting;
@@ -388,6 +388,58 @@ emit_ADD(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit subtract. See emit_ADD for comments.
+ */
+static boolean
+emit_SUB(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "SUB:");
+ /* Loop over Red/Green/Blue/Alpha channels */
+ for (ch = 0; ch < 4; ch++) {
+ /* If the dest R, G, B or A writemask is enabled... */
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ /* get indexes of the two src, one dest SPE registers */
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* Emit actual SPE instruction: d = s1 - s2 */
+ spe_fs(gen->f, d_reg, s1_reg, s2_reg);
+
+ /* Store the result (a no-op for TGSI_FILE_TEMPORARY dests) */
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ /* Free any intermediate temps we allocated */
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
+/**
+ * Emit multiply add. See emit_ADD for comments.
+ */
+static boolean
+emit_MAD(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "MUL:");
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int s3_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[2]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+ /* d = s1 * s2 + s3 */
+ spe_fma(gen->f, d_reg, s1_reg, s2_reg, s3_reg);
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
/**
* Emit multiply. See emit_ADD for comments.
@@ -411,7 +463,6 @@ emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
-
/**
* Emit set-if-greater-than.
* Note that the SPE fcgt instruction produces 0x0 and 0xffffffff as
@@ -570,6 +621,10 @@ emit_instruction(struct codegen *gen,
return emit_MUL(gen, inst);
case TGSI_OPCODE_ADD:
return emit_ADD(gen, inst);
+ case TGSI_OPCODE_SUB:
+ return emit_SUB(gen, inst);
+ case TGSI_OPCODE_MAD:
+ return emit_MAD(gen, inst);
case TGSI_OPCODE_SGT:
return emit_SGT(gen, inst);
case TGSI_OPCODE_END:
--
cgit v1.2.3
From 0a75773fed3f2d74d697fae5aee9ae8f18298631 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Mon, 15 Sep 2008 12:27:10 -0600
Subject: cell: Added support for ABS instruction
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 31 +++++++++++++++++++++++++++++-
1 file changed, 30 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 9eae57bb76..33f3c74b56 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -424,7 +424,7 @@ static boolean
emit_MAD(struct codegen *gen, const struct tgsi_full_instruction *inst)
{
int ch;
- spe_comment(gen->f, -4, "MUL:");
+ spe_comment(gen->f, -4, "MAD:");
for (ch = 0; ch < 4; ch++) {
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
@@ -463,6 +463,33 @@ emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit absolute value. See emit_ADD for comments.
+ */
+static boolean
+emit_ABS(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "ABS:");
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+ const int bit31mask_reg = get_itemp(gen);
+
+ /* mask with bit 31 set, the rest cleared */
+ spe_load_int(gen->f, bit31mask_reg, (1 << 31));
+
+ /* d = sign bit cleared in s1 */
+ spe_andc(gen->f, d_reg, s1_reg, bit31mask_reg);
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
/**
* Emit set-if-greater-than.
* Note that the SPE fcgt instruction produces 0x0 and 0xffffffff as
@@ -625,6 +652,8 @@ emit_instruction(struct codegen *gen,
return emit_SUB(gen, inst);
case TGSI_OPCODE_MAD:
return emit_MAD(gen, inst);
+ case TGSI_OPCODE_ABS:
+ return emit_ABS(gen, inst);
case TGSI_OPCODE_SGT:
return emit_SGT(gen, inst);
case TGSI_OPCODE_END:
--
cgit v1.2.3
From 81aa90e8837128423e37a776cdfbf63b0604903f Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Mon, 15 Sep 2008 13:45:09 -0600
Subject: cell: Added support for SLT, SEQ and SNE instructions
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 100 +++++++++++++++++++++++++++++
1 file changed, 100 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 33f3c74b56..c48200d5cc 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -524,6 +524,100 @@ emit_SGT(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit set-if_less-then. See emit_SGT for comments.
+ */
+static boolean
+emit_SLT(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "SLT:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 < s2) */
+ spe_fcgt(gen->f, d_reg, s2_reg, s1_reg);
+
+ /* convert d from 0x0/0xffffffff to 0.0/1.0 */
+ /* d = d & one_reg */
+ spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Emit set-if_equal. See emit_SGT for comments.
+ */
+static boolean
+emit_SEQ(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "SEQ:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 == s2) */
+ spe_fceq(gen->f, d_reg, s1_reg, s2_reg);
+
+ /* convert d from 0x0/0xffffffff to 0.0/1.0 */
+ /* d = d & one_reg */
+ spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Emit set-if_not_equal. See emit_SGT for comments.
+ */
+static boolean
+emit_SNE(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "SNE:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 != s2) */
+ spe_fceq(gen->f, d_reg, s1_reg, s2_reg);
+ spe_nor(gen->f, d_reg, d_reg, d_reg);
+
+ /* convert d from 0x0/0xffffffff to 0.0/1.0 */
+ /* d = d & one_reg */
+ spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
static boolean
emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
@@ -656,6 +750,12 @@ emit_instruction(struct codegen *gen,
return emit_ABS(gen, inst);
case TGSI_OPCODE_SGT:
return emit_SGT(gen, inst);
+ case TGSI_OPCODE_SLT:
+ return emit_SLT(gen, inst);
+ case TGSI_OPCODE_SEQ:
+ return emit_SEQ(gen, inst);
+ case TGSI_OPCODE_SNE:
+ return emit_SNE(gen, inst);
case TGSI_OPCODE_END:
return emit_END(gen);
--
cgit v1.2.3
From ae3373441dd4548702f23fe44bd04830e4902241 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 15 Sep 2008 15:10:02 -0600
Subject: gallium: emit SPU instructions in assembler-compatible syntax
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
index 74cd4176e7..870ae802c5 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
@@ -176,7 +176,7 @@ static void emit_RR(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, r%d, r%d\n", rem_prefix(name), rT, rA, rB);
+ printf("%s\t$%d, $%d, $%d\n", rem_prefix(name), rT, rA, rB);
}
}
@@ -194,7 +194,7 @@ static void emit_RRR(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, r%d, r%d, r%d\n", rem_prefix(name), rT, rA, rB, rC);
+ printf("%s\t$%d, $%d, $%d, $%d\n", rem_prefix(name), rT, rA, rB, rC);
}
}
@@ -211,7 +211,7 @@ static void emit_RI7(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, r%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
+ printf("%s\t$%d, $%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
}
}
@@ -229,7 +229,7 @@ static void emit_RI8(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, r%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
+ printf("%s\t$%d, $%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
}
}
@@ -247,7 +247,11 @@ static void emit_RI10(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, r%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
+ if (strcmp(name, "spe_lqd") == 0 ||
+ strcmp(name, "spe_stqd") == 0)
+ printf("%s\t$%d, 0x%x($%d)\n", rem_prefix(name), rT, imm, rA);
+ else
+ printf("%s\t$%d, $%d, 0x%x\n", rem_prefix(name), rT, rA, imm);
}
}
@@ -263,7 +267,7 @@ static void emit_RI16(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, 0x%x\n", rem_prefix(name), rT, imm);
+ printf("%s\t$%d, 0x%x\n", rem_prefix(name), rT, imm);
}
}
@@ -279,7 +283,7 @@ static void emit_RI18(struct spe_function *p, unsigned op, unsigned rT,
assert(p->num_inst <= p->max_inst);
if (p->print) {
indent(p);
- printf("%s\tr%d, 0x%x\n", rem_prefix(name), rT, imm);
+ printf("%s\t$%d, 0x%x\n", rem_prefix(name), rT, imm);
}
}
@@ -455,7 +459,7 @@ spe_comment(struct spe_function *p, int rel_indent, const char *s)
p->indent += rel_indent;
indent(p);
p->indent -= rel_indent;
- printf("%s\n", s);
+ printf("# %s\n", s);
}
}
--
cgit v1.2.3
From e67374b6b2f6fd846c368ec70e80f0f4cf508f97 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Mon, 15 Sep 2008 15:45:51 -0600
Subject: cell: Added LERP instruction
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 92 +++++++++++++++++++++++++++++-
1 file changed, 91 insertions(+), 1 deletion(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index c48200d5cc..7a672478c5 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -52,7 +52,7 @@
/** Set to 1 to enable debug/disassembly printfs */
-#define DISASSEM 1
+#define DISASSEM 0
#define MAX_TEMPS 16
@@ -441,6 +441,31 @@ emit_MAD(struct codegen *gen, const struct tgsi_full_instruction *inst)
}
+/**
+ * Emit linear interpolate. See emit_ADD for comments.
+ */
+static boolean
+emit_LERP(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "LERP:");
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int s3_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[2]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+ /* d = s3 + s1(s2 - s3) */
+ spe_fs(gen->f, d_reg, s2_reg, s3_reg);
+ spe_fm(gen->f, d_reg, d_reg, s1_reg);
+ spe_fa(gen->f, d_reg, d_reg, s3_reg);
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
/**
* Emit multiply. See emit_ADD for comments.
*/
@@ -618,6 +643,65 @@ emit_SNE(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit max. See emit_SGT for comments.
+ */
+static boolean
+emit_MAX(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "MAX:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 > s2) ? s1 : s2 */
+ spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
+ spe_and(gen->f, d_reg, d_reg, s1_reg);
+ spe_nor(gen->f, d_reg, d_reg, d_reg);
+ spe_and(gen->f, d_reg, d_reg, s2_reg);
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Emit max. See emit_SGT for comments.
+ */
+static boolean
+emit_MIN(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "MIN:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 < s2) ? s1 : s2 */
+ spe_fcgt(gen->f, d_reg, s2_reg, s1_reg);
+ spe_and(gen->f, d_reg, d_reg, s1_reg);
+ spe_nor(gen->f, d_reg, d_reg, d_reg);
+ spe_and(gen->f, d_reg, d_reg, s2_reg);
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
static boolean
emit_IF(struct codegen *gen, const struct tgsi_full_instruction *inst)
@@ -746,6 +830,8 @@ emit_instruction(struct codegen *gen,
return emit_SUB(gen, inst);
case TGSI_OPCODE_MAD:
return emit_MAD(gen, inst);
+ case TGSI_OPCODE_LERP:
+ return emit_LERP(gen, inst);
case TGSI_OPCODE_ABS:
return emit_ABS(gen, inst);
case TGSI_OPCODE_SGT:
@@ -756,6 +842,10 @@ emit_instruction(struct codegen *gen,
return emit_SEQ(gen, inst);
case TGSI_OPCODE_SNE:
return emit_SNE(gen, inst);
+ case TGSI_OPCODE_MAX:
+ return emit_MAX(gen, inst);
+ case TGSI_OPCODE_MIN:
+ return emit_MIN(gen, inst);
case TGSI_OPCODE_END:
return emit_END(gen);
--
cgit v1.2.3
From b1f5fbe1cb937bc639cc335acfcfb8c09dfeb3ec Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 15 Sep 2008 17:10:04 -0600
Subject: mesa: fix MSAA enable state in update_multisample()
---
src/mesa/main/state.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 344af91e17..d355f78a0e 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -295,10 +295,10 @@ static void
update_multisample(GLcontext *ctx)
{
ctx->Multisample._Enabled = GL_FALSE;
- if (ctx->DrawBuffer) {
- if (ctx->DrawBuffer->Visual.sampleBuffers)
- ctx->Multisample._Enabled = GL_TRUE;
- }
+ if (ctx->Multisample.Enabled &&
+ ctx->DrawBuffer &&
+ ctx->DrawBuffer->Visual.sampleBuffers)
+ ctx->Multisample._Enabled = GL_TRUE;
}
--
cgit v1.2.3
From 9d48a7832b78658d2422ae5a185276c41750010d Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 15 Sep 2008 17:10:04 -0600
Subject: mesa: fix MSAA enable state in update_multisample()
---
src/mesa/main/state.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
index 7192bed4a3..d60b9a13d8 100644
--- a/src/mesa/main/state.c
+++ b/src/mesa/main/state.c
@@ -1067,10 +1067,10 @@ static void
update_multisample(GLcontext *ctx)
{
ctx->Multisample._Enabled = GL_FALSE;
- if (ctx->DrawBuffer) {
- if (ctx->DrawBuffer->Visual.sampleBuffers)
- ctx->Multisample._Enabled = GL_TRUE;
- }
+ if (ctx->Multisample.Enabled &&
+ ctx->DrawBuffer &&
+ ctx->DrawBuffer->Visual.sampleBuffers)
+ ctx->Multisample._Enabled = GL_TRUE;
}
--
cgit v1.2.3
From 32250eb959b1355b2f6984ea892a86a6ecf9d3c3 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Mon, 15 Sep 2008 19:38:39 -0600
Subject: cell: export CELL_DEBUG=asm to dump SPU assembly code
---
src/gallium/drivers/cell/common.h | 3 +-
src/gallium/drivers/cell/ppu/cell_context.c | 1 +
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 56 ++++++++++++++---------------
3 files changed, 31 insertions(+), 29 deletions(-)
diff --git a/src/gallium/drivers/cell/common.h b/src/gallium/drivers/cell/common.h
index cb0631baf5..8f08854117 100644
--- a/src/gallium/drivers/cell/common.h
+++ b/src/gallium/drivers/cell/common.h
@@ -106,7 +106,8 @@
#define CELL_DEBUG_CHECKER (1 << 0)
-#define CELL_DEBUG_SYNC (1 << 1)
+#define CELL_DEBUG_ASM (1 << 1)
+#define CELL_DEBUG_SYNC (1 << 2)
diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c
index 0a5c0baa47..b418271dca 100644
--- a/src/gallium/drivers/cell/ppu/cell_context.c
+++ b/src/gallium/drivers/cell/ppu/cell_context.c
@@ -87,6 +87,7 @@ cell_draw_create(struct cell_context *cell)
static const struct debug_named_value cell_debug_flags[] = {
{"checker", CELL_DEBUG_CHECKER},/**< modulate tile clear color by SPU ID */
+ {"asm", CELL_DEBUG_ASM}, /**< dump SPU asm code */
{"sync", CELL_DEBUG_SYNC}, /**< SPUs do synchronous DMA */
{NULL, 0}
};
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 7a672478c5..98ee5af279 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -51,10 +51,6 @@
#include "cell_gen_fp.h"
-/** Set to 1 to enable debug/disassembly printfs */
-#define DISASSEM 0
-
-
#define MAX_TEMPS 16
#define MAX_IMMED 8
@@ -864,6 +860,8 @@ emit_instruction(struct codegen *gen,
/* XXX lots more cases to do... */
default:
+ fprintf(stderr, "Cell: unimplemented TGSI instruction %d!\n",
+ inst->Instruction.Opcode);
return false;
}
@@ -914,17 +912,19 @@ emit_immediate(struct codegen *gen, const struct tgsi_full_immediate *immed)
* For each TGSI TEMPORARY we allocate four SPE registers.
*/
static boolean
-emit_declaration(struct codegen *gen, const struct tgsi_full_declaration *decl)
+emit_declaration(struct cell_context *cell,
+ struct codegen *gen, const struct tgsi_full_declaration *decl)
{
int i, ch;
switch (decl->Declaration.File) {
case TGSI_FILE_TEMPORARY:
-#if DISASSEM
- printf("Declare temp reg %d .. %d\n",
- decl->DeclarationRange.First,
- decl->DeclarationRange.Last);
-#endif
+ if (cell->debug_flags & CELL_DEBUG_ASM) {
+ printf("Declare temp reg %d .. %d\n",
+ decl->DeclarationRange.First,
+ decl->DeclarationRange.Last);
+ }
+
for (i = decl->DeclarationRange.First;
i <= decl->DeclarationRange.Last;
i++) {
@@ -939,13 +939,13 @@ emit_declaration(struct codegen *gen, const struct tgsi_full_declaration *decl)
* to SPU memory. someday...
*/
-#if DISASSEM
- printf(" SPE regs: %d %d %d %d\n",
- gen->temp_regs[i][0],
- gen->temp_regs[i][1],
- gen->temp_regs[i][2],
- gen->temp_regs[i][3]);
-#endif
+ if (cell->debug_flags & CELL_DEBUG_ASM) {
+ printf(" SPE regs: %d %d %d %d\n",
+ gen->temp_regs[i][0],
+ gen->temp_regs[i][1],
+ gen->temp_regs[i][2],
+ gen->temp_regs[i][3]);
+ }
}
break;
default:
@@ -985,12 +985,12 @@ cell_gen_fragment_program(struct cell_context *cell,
spe_allocate_register(f, gen.outputs_reg);
spe_allocate_register(f, gen.constants_reg);
-#if DISASSEM
- spe_print_code(f, true);
- spe_indent(f, 8);
- printf("Begin %s\n", __FUNCTION__);
- tgsi_dump(tokens, 0);
-#endif
+ if (cell->debug_flags & CELL_DEBUG_ASM) {
+ spe_print_code(f, true);
+ spe_indent(f, 8);
+ printf("Begin %s\n", __FUNCTION__);
+ tgsi_dump(tokens, 0);
+ }
tgsi_parse_init(&parse, tokens);
@@ -1004,7 +1004,7 @@ cell_gen_fragment_program(struct cell_context *cell,
break;
case TGSI_TOKEN_TYPE_DECLARATION:
- if (!emit_declaration(&gen, &parse.FullToken.FullDeclaration))
+ if (!emit_declaration(cell, &gen, &parse.FullToken.FullDeclaration))
gen.error = true;
break;
@@ -1024,10 +1024,10 @@ cell_gen_fragment_program(struct cell_context *cell,
return emit_END(&gen);
}
-#if DISASSEM
- printf("cell_gen_fragment_program nr instructions: %d\n", f->num_inst);
- printf("End %s\n", __FUNCTION__);
-#endif
+ if (cell->debug_flags & CELL_DEBUG_ASM) {
+ printf("cell_gen_fragment_program nr instructions: %d\n", f->num_inst);
+ printf("End %s\n", __FUNCTION__);
+ }
tgsi_parse_free( &parse );
--
cgit v1.2.3
From eef2edadf33cdb4ce033565ebc5b6aaf56e9288f Mon Sep 17 00:00:00 2001
From: José Fonseca
Date: Tue, 16 Sep 2008 20:24:43 +0900
Subject: trace: Fix typo in build instructions.
---
src/gallium/drivers/trace/README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gallium/drivers/trace/README b/src/gallium/drivers/trace/README
index e7a2f12b02..f0e1cd596d 100644
--- a/src/gallium/drivers/trace/README
+++ b/src/gallium/drivers/trace/README
@@ -10,7 +10,7 @@ This directory contains a Gallium3D pipe driver which traces all incoming calls.
To build, invoke scons on the top dir as
- scons statetrackers=mesa drivers=softpipe,i915simple,trace winsys=xlib
+ scons statetrackers=mesa drivers=softpipe,i965simple,trace winsys=xlib
= Usage =
--
cgit v1.2.3
From ad16ecbbe4fe8c1bcb18ed8fbbd672c68a0b17fa Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Tue, 16 Sep 2008 16:16:54 +0200
Subject: tgsi: Make tgsi_sanity.c compile with make
---
src/gallium/auxiliary/tgsi/Makefile | 1 +
src/gallium/auxiliary/tgsi/tgsi_sanity.c | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/src/gallium/auxiliary/tgsi/Makefile b/src/gallium/auxiliary/tgsi/Makefile
index 806a2bd4c5..c5d2082087 100644
--- a/src/gallium/auxiliary/tgsi/Makefile
+++ b/src/gallium/auxiliary/tgsi/Makefile
@@ -4,6 +4,7 @@ include $(TOP)/configs/current
LIBNAME = tgsi
C_SOURCES = \
+ tgsi_sanity.c \
tgsi_build.c \
tgsi_dump.c \
tgsi_exec.c \
diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
index c659027296..20b32477be 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
@@ -152,6 +152,12 @@ check_register_usage(
{
if (!check_file_name( ctx, file ))
return FALSE;
+
+ if (index < 0 || index > MAX_REGISTERS) {
+ report_error( ctx, "%s[%i]: Invalid index %s", file_names[file], index, name );
+ return FALSE;
+ }
+
if (indirect_access) {
if (!is_any_register_declared( ctx, file ))
report_error( ctx, "%s: Undeclared %s register", file_names[file], name );
--
cgit v1.2.3
From 358aab12c60d5e627d2ce54c1407659cbc207e8c Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Tue, 16 Sep 2008 16:17:46 +0200
Subject: mesa: State tracker now checks for faulty shaders on debug
---
src/mesa/state_tracker/st_mesa_to_tgsi.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 5ec9fddd7f..e822c8ac61 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -35,10 +35,12 @@
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_build.h"
#include "tgsi/tgsi_util.h"
+#include "tgsi/tgsi_dump.h"
+#include "tgsi/tgsi_sanity.h"
#include "st_mesa_to_tgsi.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
-
+#include "pipe/p_debug.h"
/*
* Map mesa register file to TGSI register file.
@@ -980,5 +982,14 @@ tgsi_translate_mesa_program(
maxTokens - ti );
}
+#if DEBUG
+ if(!tgsi_sanity_check(tokens)) {
+ //debug_printf("Due to sanity check failure the following shader program is invalid\n");
+ tgsi_dump(tokens, 0);
+
+ assert(0);
+ }
+#endif
+
return ti;
}
--
cgit v1.2.3
From 4992806ae54d7d1db86eed9c6524aa05f4a2fbd6 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 08:49:43 -0600
Subject: mesa: protect against double-free in _vbo_DestroyContext()
---
src/mesa/vbo/vbo_context.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/mesa/vbo/vbo_context.c b/src/mesa/vbo/vbo_context.c
index dc7c534251..b452ac8a38 100644
--- a/src/mesa/vbo/vbo_context.c
+++ b/src/mesa/vbo/vbo_context.c
@@ -246,12 +246,14 @@ void _vbo_DestroyContext( GLcontext *ctx )
ctx->aelt_context = NULL;
}
- vbo_exec_destroy(ctx);
+ if (vbo_context(ctx)) {
+ vbo_exec_destroy(ctx);
#if FEATURE_dlist
- vbo_save_destroy(ctx);
+ vbo_save_destroy(ctx);
#endif
- FREE(vbo_context(ctx));
- ctx->swtnl_im = NULL;
+ FREE(vbo_context(ctx));
+ ctx->swtnl_im = NULL;
+ }
}
--
cgit v1.2.3
From 753635f733c5548ac8e662e792f65d41b454052a Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 08:51:28 -0600
Subject: gallium: move _vbo_DestroyContext() call
Call it before freeing core Mesa state to avoid references to freed buffer objects.
---
src/mesa/state_tracker/st_context.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 08d4db7f7f..534c7c12ac 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -188,8 +188,6 @@ static void st_destroy_context_priv( struct st_context *st )
st_destroy_drawtex(st);
#endif
- _vbo_DestroyContext(st->ctx);
-
for (i = 0; i < Elements(st->state.sampler_texture); i++) {
pipe_texture_reference(&st->state.sampler_texture[i], NULL);
}
@@ -223,6 +221,8 @@ void st_destroy_context( struct st_context *st )
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
+ _vbo_DestroyContext(st->ctx);
+
_mesa_free_context_data(ctx);
st_destroy_context_priv(st);
--
cgit v1.2.3
From ea9568dfbe7415db1a529ca4ecc1b9c41cae10b1 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 08:55:54 -0600
Subject: mesa: fix bug in get_uniform_rows_cols(): sometimes returned too many
rows
---
src/mesa/shader/shader_api.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index d8b210be53..a86ef56c65 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1108,7 +1108,8 @@ get_matrix_dims(GLenum type, GLint *rows, GLint *cols)
/**
* Determine the number of rows and columns occupied by a uniform
- * according to its datatype.
+ * according to its datatype. For non-matrix types (such as GL_FLOAT_VEC4),
+ * the number of rows = 1 and cols = number of elements in the vector.
*/
static void
get_uniform_rows_cols(const struct gl_program_parameter *p,
@@ -1117,11 +1118,17 @@ get_uniform_rows_cols(const struct gl_program_parameter *p,
get_matrix_dims(p->DataType, rows, cols);
if (*rows == 0 && *cols == 0) {
/* not a matrix type, probably a float or vector */
- *rows = p->Size / 4 + 1;
- if (p->Size % 4 == 0)
- *cols = 4;
- else
- *cols = p->Size % 4;
+ if (p->Size <= 4) {
+ *rows = 1;
+ *cols = p->Size;
+ }
+ else {
+ *rows = p->Size / 4 + 1;
+ if (p->Size % 4 == 0)
+ *cols = 4;
+ else
+ *cols = p->Size % 4;
+ }
}
}
--
cgit v1.2.3
From 2c54a6ee798ae22f92ef1fc4a1658ec5e701388a Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Tue, 16 Sep 2008 09:36:38 -0600
Subject: cell: Fixed MIN/MAX algorithm
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 98ee5af279..612749507b 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -657,9 +657,7 @@ emit_MAX(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* d = (s1 > s2) ? s1 : s2 */
spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
- spe_and(gen->f, d_reg, d_reg, s1_reg);
- spe_nor(gen->f, d_reg, d_reg, d_reg);
- spe_and(gen->f, d_reg, d_reg, s2_reg);
+ spe_selb(gen->f, d_reg, s2_reg, s1_reg, d_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
@@ -685,11 +683,9 @@ emit_MIN(struct codegen *gen, const struct tgsi_full_instruction *inst)
int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
- /* d = (s1 < s2) ? s1 : s2 */
+ /* d = (s2 > s1) ? s1 : s2 */
spe_fcgt(gen->f, d_reg, s2_reg, s1_reg);
- spe_and(gen->f, d_reg, d_reg, s1_reg);
- spe_nor(gen->f, d_reg, d_reg, d_reg);
- spe_and(gen->f, d_reg, d_reg, s2_reg);
+ spe_selb(gen->f, d_reg, s2_reg, s1_reg, d_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
--
cgit v1.2.3
From dd75ca89ebce58a69da20c1efbf2a53575b2c96e Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Tue, 16 Sep 2008 09:42:28 -0600
Subject: cell: Optimized LERP with fma Please enter the commit message for
your changes.
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 612749507b..a80d8ff5d6 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -453,8 +453,7 @@ emit_LERP(struct codegen *gen, const struct tgsi_full_instruction *inst)
int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
/* d = s3 + s1(s2 - s3) */
spe_fs(gen->f, d_reg, s2_reg, s3_reg);
- spe_fm(gen->f, d_reg, d_reg, s1_reg);
- spe_fa(gen->f, d_reg, d_reg, s3_reg);
+ spe_fma(gen->f, d_reg, d_reg, s1_reg, s3_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
}
@@ -657,7 +656,7 @@ emit_MAX(struct codegen *gen, const struct tgsi_full_instruction *inst)
/* d = (s1 > s2) ? s1 : s2 */
spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
- spe_selb(gen->f, d_reg, s2_reg, s1_reg, d_reg);
+ spe_selb(gen->f, d_reg, s2_reg, s1_reg, d_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
--
cgit v1.2.3
From 2010cd7810da50484fea03259e777ffac0593007 Mon Sep 17 00:00:00 2001
From: Michal Krol
Date: Tue, 16 Sep 2008 19:26:28 +0200
Subject: st: hash-warning not recognised on Windows.
---
src/mesa/state_tracker/st_atom_framebuffer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index d3886f95cd..d07fd2517a 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -153,7 +153,9 @@ update_framebuffer_state( struct st_context *st )
st->frontbuffer_status = FRONT_STATUS_DIRTY;
}
#else
+#if !defined(PIPE_OS_WINDOWS)
#warning "fix me"
+#endif
st->frontbuffer_status = FRONT_STATUS_DIRTY;
#endif
}
--
cgit v1.2.3
From 8cdab20c9a0d8794d5d85dbeef478b982ce39506 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 12:52:19 -0600
Subject: gallium: fix info entries for KIL, KILP
KIL takes 1 src register. KILP uses no registers (uses cond codes).
---
src/gallium/auxiliary/tgsi/tgsi_info.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_info.c b/src/gallium/auxiliary/tgsi/tgsi_info.c
index a4899cd4c2..68c7a6b7f5 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_info.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_info.c
@@ -69,7 +69,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
{ 1, 1, 0, 0, "COS" },
{ 1, 1, 0, 0, "DDX" },
{ 1, 1, 0, 0, "DDY" },
- { 0, 1, 0, 0, "KILP" },
+ { 0, 0, 0, 0, "KILP" },
{ 1, 1, 0, 0, "PK2H" },
{ 1, 1, 0, 0, "PK2US" },
{ 1, 1, 0, 0, "PK4B" },
@@ -146,7 +146,7 @@ static const struct tgsi_opcode_info opcode_info[TGSI_OPCODE_LAST] =
{ 0, 1, 0, 0, "CALLNZ" },
{ 0, 1, 0, 0, "IFC" },
{ 0, 1, 0, 0, "BREAKC" },
- { 0, 0, 0, 0, "KIL" },
+ { 0, 1, 0, 0, "KIL" },
{ 0, 0, 0, 0, "END" },
{ 1, 1, 0, 0, "SWZ" }
};
--
cgit v1.2.3
From d43951192baa7b76d3e035d689f73c1d2955cddb Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 13:23:01 -0600
Subject: mesa: fix display list regression (check if save->prim_count > 0 in
vbo_save_EndList())
---
src/mesa/vbo/vbo_save_api.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f93ef3a02a..f69a33d817 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1049,12 +1049,14 @@ void vbo_save_EndList( GLcontext *ctx )
/* EndList called inside a (saved) Begin/End pair?
*/
if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
- GLint i = save->prim_count - 1;
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- save->prim[i].end = 0;
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
+ if (save->prim_count > 0) {
+ GLint i = save->prim_count - 1;
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+ }
/* Make sure this vertex list gets replayed by the "loopback"
* mechanism:
--
cgit v1.2.3
From 39cb5b9f73318a069e2d8553243ae17955a85695 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 13:23:01 -0600
Subject: mesa: fix display list regression (check if save->prim_count > 0 in
vbo_save_EndList())
---
src/mesa/vbo/vbo_save_api.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f93ef3a02a..f69a33d817 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -1049,12 +1049,14 @@ void vbo_save_EndList( GLcontext *ctx )
/* EndList called inside a (saved) Begin/End pair?
*/
if (ctx->Driver.CurrentSavePrimitive != PRIM_OUTSIDE_BEGIN_END) {
- GLint i = save->prim_count - 1;
- ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
- save->prim[i].end = 0;
- save->prim[i].count = (save->vert_count -
- save->prim[i].start);
+ if (save->prim_count > 0) {
+ GLint i = save->prim_count - 1;
+ ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
+ save->prim[i].end = 0;
+ save->prim[i].count = (save->vert_count -
+ save->prim[i].start);
+ }
/* Make sure this vertex list gets replayed by the "loopback"
* mechanism:
--
cgit v1.2.3
From 37607aeaf8b0fd35213635ba1c3743b6e059d48f Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 11:59:24 -0600
Subject: gallium: fix glTexImage(width=height=depth=0) case
Free old teximage/level data, then stop.
---
src/mesa/state_tracker/st_cb_texture.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index a3e8fc992d..2ba3766939 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -455,6 +455,11 @@ st_TexImage(GLcontext * ctx,
_mesa_align_free(texImage->Data);
}
+ if (width == 0 || height == 0 || depth == 0) {
+ /* stop after freeing old image */
+ return;
+ }
+
/* If this is the only mipmap level in the texture, could call
* bmBufferData with NULL data to free the old block and avoid
* waiting on any outstanding fences.
--
cgit v1.2.3
From fbbaad14a6b6de07631d5a9fd6e4b847a9e9dd5a Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Tue, 16 Sep 2008 13:56:56 -0600
Subject: cell: Added DP3 and DP4 instructions
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 81 ++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index a80d8ff5d6..34d283b51e 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -54,6 +54,10 @@
#define MAX_TEMPS 16
#define MAX_IMMED 8
+#define CHAN_X 0
+#define CHAN_Y 1
+#define CHAN_Z 2
+#define CHAN_W 3
/**
* Context needed during code generation.
@@ -510,6 +514,79 @@ emit_ABS(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit 3 component dot product. See emit_ADD for comments.
+ */
+static boolean
+emit_DP3(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "DP3:");
+
+ int s1_reg = get_src_reg(gen, CHAN_X, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, CHAN_X, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, CHAN_X, &inst->FullDstRegisters[0]);
+ /* d = x * x */
+ spe_fm(gen->f, d_reg, s1_reg, s2_reg);
+
+ s1_reg = get_src_reg(gen, CHAN_Y, &inst->FullSrcRegisters[0]);
+ s2_reg = get_src_reg(gen, CHAN_Y, &inst->FullSrcRegisters[1]);
+ /* d = y * y + d */
+ spe_fma(gen->f, d_reg, s1_reg, s2_reg, d_reg);
+
+ s1_reg = get_src_reg(gen, CHAN_Z, &inst->FullSrcRegisters[0]);
+ s2_reg = get_src_reg(gen, CHAN_Z, &inst->FullSrcRegisters[1]);
+ /* d = z * z + d */
+ spe_fma(gen->f, d_reg, s1_reg, s2_reg, d_reg);
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
+/**
+ * Emit 4 component dot product. See emit_ADD for comments.
+ */
+static boolean
+emit_DP4(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "DP3:");
+
+ int s1_reg = get_src_reg(gen, CHAN_X, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, CHAN_X, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, CHAN_X, &inst->FullDstRegisters[0]);
+ /* d = x * x */
+ spe_fm(gen->f, d_reg, s1_reg, s2_reg);
+
+ s1_reg = get_src_reg(gen, CHAN_Y, &inst->FullSrcRegisters[0]);
+ s2_reg = get_src_reg(gen, CHAN_Y, &inst->FullSrcRegisters[1]);
+ /* d = y * y + d */
+ spe_fma(gen->f, d_reg, s1_reg, s2_reg, d_reg);
+
+ s1_reg = get_src_reg(gen, CHAN_Z, &inst->FullSrcRegisters[0]);
+ s2_reg = get_src_reg(gen, CHAN_Z, &inst->FullSrcRegisters[1]);
+ /* d = z * z + d */
+ spe_fma(gen->f, d_reg, s1_reg, s2_reg, d_reg);
+
+ s1_reg = get_src_reg(gen, CHAN_W, &inst->FullSrcRegisters[0]);
+ s2_reg = get_src_reg(gen, CHAN_W, &inst->FullSrcRegisters[1]);
+ /* d = w * w + d */
+ spe_fma(gen->f, d_reg, s1_reg, s2_reg, d_reg);
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
/**
* Emit set-if-greater-than.
* Note that the SPE fcgt instruction produces 0x0 and 0xffffffff as
@@ -823,6 +900,10 @@ emit_instruction(struct codegen *gen,
return emit_MAD(gen, inst);
case TGSI_OPCODE_LERP:
return emit_LERP(gen, inst);
+ case TGSI_OPCODE_DP3:
+ return emit_DP3(gen, inst);
+ case TGSI_OPCODE_DP4:
+ return emit_DP4(gen, inst);
case TGSI_OPCODE_ABS:
return emit_ABS(gen, inst);
case TGSI_OPCODE_SGT:
--
cgit v1.2.3
From e53296c928d80c6627a9551345c160533aa1a19e Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 15:50:44 -0600
Subject: mesa: rework GLSL vertex attribute binding
Calls to glBindAttribLocation() should not take effect until the next time
that glLinkProgram() is called.
gl_shader_program::Attributes now just contains user-defined bindings.
gl_shader_program::VertexProgram->Attributes contains the actual/final bindings.
---
src/mesa/main/mtypes.h | 4 +-
src/mesa/shader/shader_api.c | 62 +++++++++--------
src/mesa/shader/slang/slang_link.c | 139 +++++++++++++++++++------------------
src/mesa/shader/slang/slang_link.h | 8 +--
4 files changed, 110 insertions(+), 103 deletions(-)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 71a4ca55bc..2fc169493b 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2143,12 +2143,14 @@ struct gl_shader_program
GLuint NumShaders; /**< number of attached shaders */
struct gl_shader **Shaders; /**< List of attached the shaders */
+ /** User-defined attribute bindings (glBindAttribLocation) */
+ struct gl_program_parameter_list *Attributes;
+
/* post-link info: */
struct gl_vertex_program *VertexProgram; /**< Linked vertex program */
struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
struct gl_uniform_list *Uniforms;
struct gl_program_parameter_list *Varying;
- struct gl_program_parameter_list *Attributes; /**< Vertex attributes */
GLboolean LinkStatus; /**< GL_LINK_STATUS */
GLboolean Validated;
GLchar *InfoLog;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index a86ef56c65..decdec53ed 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.2
*
* Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
*
@@ -497,10 +497,14 @@ _mesa_get_attrib_location(GLcontext *ctx, GLuint program,
if (!name)
return -1;
- if (shProg->Attributes) {
- GLint i = _mesa_lookup_parameter_index(shProg->Attributes, -1, name);
- if (i >= 0) {
- return shProg->Attributes->Parameters[i].StateIndexes[0];
+ if (shProg->VertexProgram) {
+ const struct gl_program_parameter_list *attribs =
+ shProg->VertexProgram->Base.Attributes;
+ if (attribs) {
+ GLint i = _mesa_lookup_parameter_index(attribs, -1, name);
+ if (i >= 0) {
+ return attribs->Parameters[i].StateIndexes[0];
+ }
}
}
return -1;
@@ -513,7 +517,7 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
{
struct gl_shader_program *shProg;
const GLint size = -1; /* unknown size */
- GLint i, oldIndex;
+ GLint i;
GLenum datatype = GL_FLOAT_VEC4;
shProg = _mesa_lookup_shader_program_err(ctx, program,
@@ -536,14 +540,6 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
return;
}
- if (shProg->LinkStatus) {
- /* get current index/location for the attribute */
- oldIndex = _mesa_get_attrib_location(ctx, program, name);
- }
- else {
- oldIndex = -1;
- }
-
/* this will replace the current value if it's already in the list */
i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
if (i < 0) {
@@ -551,12 +547,10 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
return;
}
- if (shProg->VertexProgram && oldIndex >= 0 && oldIndex != index) {
- /* If the index changed, need to search/replace references to that attribute
- * in the vertex program.
- */
- _slang_remap_attribute(&shProg->VertexProgram->Base, oldIndex, index);
- }
+ /*
+ * Note that this attribute binding won't go into effect until
+ * glLinkProgram is called again.
+ */
}
@@ -798,24 +792,29 @@ _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index,
GLsizei maxLength, GLsizei *length, GLint *size,
GLenum *type, GLchar *nameOut)
{
+ const struct gl_program_parameter_list *attribs = NULL;
struct gl_shader_program *shProg;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
if (!shProg)
return;
- if (!shProg->Attributes || index >= shProg->Attributes->NumParameters) {
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+
+ if (!attribs || index >= attribs->NumParameters) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
return;
}
- copy_string(nameOut, maxLength, length,
- shProg->Attributes->Parameters[index].Name);
+ copy_string(nameOut, maxLength, length, attribs->Parameters[index].Name);
+
if (size)
- *size = shProg->Attributes->Parameters[index].Size
- / sizeof_glsl_type(shProg->Attributes->Parameters[index].DataType);
+ *size = attribs->Parameters[index].Size
+ / sizeof_glsl_type(attribs->Parameters[index].DataType);
+
if (type)
- *type = shProg->Attributes->Parameters[index].DataType;
+ *type = attribs->Parameters[index].DataType;
}
@@ -937,6 +936,7 @@ static void
_mesa_get_programiv(GLcontext *ctx, GLuint program,
GLenum pname, GLint *params)
{
+ const struct gl_program_parameter_list *attribs;
struct gl_shader_program *shProg
= _mesa_lookup_shader_program(ctx, program);
@@ -945,6 +945,11 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
return;
}
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+ else
+ attribs = NULL;
+
switch (pname) {
case GL_DELETE_STATUS:
*params = shProg->DeletePending;
@@ -962,11 +967,10 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
*params = shProg->NumShaders;
break;
case GL_ACTIVE_ATTRIBUTES:
- *params = shProg->Attributes ? shProg->Attributes->NumParameters : 0;
+ *params = attribs ? attribs->NumParameters : 0;
break;
case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
- *params = _mesa_longest_parameter_name(shProg->Attributes,
- PROGRAM_INPUT) + 1;
+ *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1;
break;
case GL_ACTIVE_UNIFORMS:
*params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0;
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 57dbfc2388..30035b4fee 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.2
*
- * Copyright (C) 2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -215,74 +215,110 @@ link_uniform_vars(struct gl_shader_program *shProg,
* For example, if the vertex shader declared "attribute vec4 foobar" we'll
* allocate a generic vertex attribute for "foobar" and plug that value into
* the vertex program instructions.
+ * But if the user called glBindAttributeLocation(), those bindings will
+ * have priority.
*/
static GLboolean
_slang_resolve_attributes(struct gl_shader_program *shProg,
- struct gl_program *prog)
+ const struct gl_program *origProg,
+ struct gl_program *linkedProg)
{
+ GLint attribMap[MAX_VERTEX_ATTRIBS];
GLuint i, j;
GLbitfield usedAttributes;
- assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
+ assert(origProg != linkedProg);
+ assert(origProg->Target == GL_VERTEX_PROGRAM_ARB);
+ assert(linkedProg->Target == GL_VERTEX_PROGRAM_ARB);
if (!shProg->Attributes)
shProg->Attributes = _mesa_new_parameter_list();
+ if (linkedProg->Attributes) {
+ _mesa_free_parameter_list(linkedProg->Attributes);
+ }
+ linkedProg->Attributes = _mesa_new_parameter_list();
+
+
/* Build a bitmask indicating which attribute indexes have been
* explicitly bound by the user with glBindAttributeLocation().
*/
usedAttributes = 0x0;
for (i = 0; i < shProg->Attributes->NumParameters; i++) {
GLint attr = shProg->Attributes->Parameters[i].StateIndexes[0];
- usedAttributes |= attr;
+ usedAttributes |= (1 << attr);
+ }
+
+ /* initialize the generic attribute map entries to -1 */
+ for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
+ attribMap[i] = -1;
}
/*
* Scan program for generic attribute references
*/
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
+ for (i = 0; i < linkedProg->NumInstructions; i++) {
+ struct prog_instruction *inst = linkedProg->Instructions + i;
for (j = 0; j < 3; j++) {
if (inst->SrcReg[j].File == PROGRAM_INPUT &&
inst->SrcReg[j].Index >= VERT_ATTRIB_GENERIC0) {
- /* this is a generic attrib */
- const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0;
- const char *name = prog->Attributes->Parameters[k].Name;
- /* See if this attrib name is in the program's attribute list
- * (i.e. was bound by the user).
+ /*
+ * OK, we've found a generic vertex attribute reference.
*/
- GLint index = _mesa_lookup_parameter_index(shProg->Attributes,
- -1, name);
- GLint attr;
- if (index >= 0) {
- /* found, user must have specified a binding */
- attr = shProg->Attributes->Parameters[index].StateIndexes[0];
- }
- else {
- /* Not found, choose our own attribute number.
- * Start at 1 since generic attribute 0 always aliases
- * glVertex/position.
+ const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0;
+
+ GLint attr = attribMap[k];
+
+ if (attr < 0) {
+ /* Need to figure out attribute mapping now.
+ */
+ const char *name = origProg->Attributes->Parameters[k].Name;
+ const GLint size = origProg->Attributes->Parameters[k].Size;
+ const GLenum type =origProg->Attributes->Parameters[k].DataType;
+ GLint index, attr;
+
+ /* See if there's a user-defined attribute binding for
+ * this name.
*/
- GLint size = prog->Attributes->Parameters[k].Size;
- GLenum datatype = prog->Attributes->Parameters[k].DataType;
- for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) {
- if (((1 << attr) & usedAttributes) == 0)
- break;
+ index = _mesa_lookup_parameter_index(shProg->Attributes,
+ -1, name);
+ if (index >= 0) {
+ /* Found a user-defined binding */
+ attr = shProg->Attributes->Parameters[index].StateIndexes[0];
}
- if (attr == MAX_VERTEX_ATTRIBS) {
- /* too many! XXX record error log */
- return GL_FALSE;
+ else {
+ /* No user-defined binding, choose our own attribute number.
+ * Start at 1 since generic attribute 0 always aliases
+ * glVertex/position.
+ */
+ for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) {
+ if (((1 << attr) & usedAttributes) == 0)
+ break;
+ }
+ if (attr == MAX_VERTEX_ATTRIBS) {
+ link_error(shProg, "Too many vertex attributes");
+ return GL_FALSE;
+ }
+
+ /* mark this attribute as used */
+ usedAttributes |= (1 << attr);
}
- _mesa_add_attribute(shProg->Attributes, name, size, datatype,attr);
- /* set the attribute as used */
- usedAttributes |= 1<attrib binding so it can be queried
+ * with glGetAttributeLocation().
+ */
+ _mesa_add_attribute(linkedProg->Attributes, name,
+ size, type, attr);
}
+ /* update the instruction's src reg */
inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + attr;
}
}
}
+
return GL_TRUE;
}
@@ -344,36 +380,6 @@ _slang_update_inputs_outputs(struct gl_program *prog)
}
-/**
- * Scan a vertex program looking for instances of
- * (PROGRAM_INPUT, VERT_ATTRIB_GENERIC0 + oldAttrib) and replace with
- * (PROGRAM_INPUT, VERT_ATTRIB_GENERIC0 + newAttrib).
- * This is used when the user calls glBindAttribLocation on an already linked
- * shader program.
- */
-void
-_slang_remap_attribute(struct gl_program *prog, GLuint oldAttrib, GLuint newAttrib)
-{
- GLuint i, j;
-
- assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
-
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- for (j = 0; j < 3; j++) {
- if (inst->SrcReg[j].File == PROGRAM_INPUT) {
- if (inst->SrcReg[j].Index == VERT_ATTRIB_GENERIC0 + oldAttrib) {
- inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + newAttrib;
- }
- }
- }
- }
-
- _slang_update_inputs_outputs(prog);
-}
-
-
-
/** cast wrapper */
static struct gl_vertex_program *
vertex_program(struct gl_program *prog)
@@ -492,9 +498,8 @@ _slang_link(GLcontext *ctx,
/*_mesa_print_uniforms(shProg->Uniforms);*/
if (shProg->VertexProgram) {
- if (!_slang_resolve_attributes(shProg, &shProg->VertexProgram->Base)) {
- /*goto cleanup;*/
- _mesa_problem(ctx, "_slang_resolve_attributes() failed");
+ if (!_slang_resolve_attributes(shProg, &vertProg->Base,
+ &shProg->VertexProgram->Base)) {
return;
}
}
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
index 8ef8a6b4b3..2b44d20787 100644
--- a/src/mesa/shader/slang/slang_link.h
+++ b/src/mesa/shader/slang/slang_link.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.2
*
- * Copyright (C) 2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -32,10 +32,6 @@ extern void
_slang_link(GLcontext *ctx, GLhandleARB h,
struct gl_shader_program *shProg);
-extern void
-_slang_remap_attribute(struct gl_program *prog, GLuint oldAttrib,
- GLuint newAttrib);
-
#endif
--
cgit v1.2.3
From a3a797ffa84975330d5632ce7a71c65c9c2ad0d8 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Tue, 16 Sep 2008 16:00:42 -0600
Subject: cell: Added RCP and RSQ instruction support.
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 48 ++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 34d283b51e..77386b3025 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -487,6 +487,50 @@ emit_MUL(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit reciprocal. See emit_ADD for comments.
+ */
+static boolean
+emit_RCP(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "RCP:");
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+ /* d = 1/s1 */
+ spe_frest(gen->f, d_reg, s1_reg);
+ spe_fi(gen->f, d_reg, s1_reg, d_reg);
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
+/**
+ * Emit reciprocal sqrt. See emit_ADD for comments.
+ */
+static boolean
+emit_RSQ(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+ spe_comment(gen->f, -4, "RSQ:");
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+ /* d = 1/s1 */
+ spe_frsqest(gen->f, d_reg, s1_reg);
+ spe_fi(gen->f, d_reg, s1_reg, d_reg);
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+ return true;
+}
+
/**
* Emit absolute value. See emit_ADD for comments.
*/
@@ -904,6 +948,10 @@ emit_instruction(struct codegen *gen,
return emit_DP3(gen, inst);
case TGSI_OPCODE_DP4:
return emit_DP4(gen, inst);
+ case TGSI_OPCODE_RCP:
+ return emit_RCP(gen, inst);
+ case TGSI_OPCODE_RSQ:
+ return emit_RSQ(gen, inst);
case TGSI_OPCODE_ABS:
return emit_ABS(gen, inst);
case TGSI_OPCODE_SGT:
--
cgit v1.2.3
From 27341a97a17b23fdf57d33f78b475a474db71e4a Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Tue, 16 Sep 2008 16:28:36 -0600
Subject: mesa: rework GLSL vertex attribute binding
Calls to glBindAttribLocation() should not take effect until the next time
that glLinkProgram() is called.
gl_shader_program::Attributes now just contains user-defined bindings.
gl_shader_program::VertexProgram->Attributes contains the actual/final bindings.
---
src/mesa/main/mtypes.h | 4 +-
src/mesa/shader/shader_api.c | 62 +++++++++--------
src/mesa/shader/slang/slang_link.c | 139 +++++++++++++++++++------------------
src/mesa/shader/slang/slang_link.h | 8 +--
4 files changed, 110 insertions(+), 103 deletions(-)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 6f17e46d0e..f06e4a446c 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2125,12 +2125,14 @@ struct gl_shader_program
GLuint NumShaders; /**< number of attached shaders */
struct gl_shader **Shaders; /**< List of attached the shaders */
+ /** User-defined attribute bindings (glBindAttribLocation) */
+ struct gl_program_parameter_list *Attributes;
+
/* post-link info: */
struct gl_vertex_program *VertexProgram; /**< Linked vertex program */
struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */
struct gl_uniform_list *Uniforms;
struct gl_program_parameter_list *Varying;
- struct gl_program_parameter_list *Attributes; /**< Vertex attributes */
GLboolean LinkStatus; /**< GL_LINK_STATUS */
GLboolean Validated;
GLchar *InfoLog;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 64b023119b..430d165a82 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -1,6 +1,6 @@
/*
* Mesa 3-D graphics library
- * Version: 7.1
+ * Version: 7.2
*
* Copyright (C) 2004-2008 Brian Paul All Rights Reserved.
*
@@ -492,10 +492,14 @@ _mesa_get_attrib_location(GLcontext *ctx, GLuint program,
if (!name)
return -1;
- if (shProg->Attributes) {
- GLint i = _mesa_lookup_parameter_index(shProg->Attributes, -1, name);
- if (i >= 0) {
- return shProg->Attributes->Parameters[i].StateIndexes[0];
+ if (shProg->VertexProgram) {
+ const struct gl_program_parameter_list *attribs =
+ shProg->VertexProgram->Base.Attributes;
+ if (attribs) {
+ GLint i = _mesa_lookup_parameter_index(attribs, -1, name);
+ if (i >= 0) {
+ return attribs->Parameters[i].StateIndexes[0];
+ }
}
}
return -1;
@@ -508,7 +512,7 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
{
struct gl_shader_program *shProg;
const GLint size = -1; /* unknown size */
- GLint i, oldIndex;
+ GLint i;
GLenum datatype = GL_FLOAT_VEC4;
shProg = _mesa_lookup_shader_program_err(ctx, program,
@@ -531,14 +535,6 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
return;
}
- if (shProg->LinkStatus) {
- /* get current index/location for the attribute */
- oldIndex = _mesa_get_attrib_location(ctx, program, name);
- }
- else {
- oldIndex = -1;
- }
-
/* this will replace the current value if it's already in the list */
i = _mesa_add_attribute(shProg->Attributes, name, size, datatype, index);
if (i < 0) {
@@ -546,12 +542,10 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
return;
}
- if (shProg->VertexProgram && oldIndex >= 0 && oldIndex != index) {
- /* If the index changed, need to search/replace references to that attribute
- * in the vertex program.
- */
- _slang_remap_attribute(&shProg->VertexProgram->Base, oldIndex, index);
- }
+ /*
+ * Note that this attribute binding won't go into effect until
+ * glLinkProgram is called again.
+ */
}
@@ -763,24 +757,29 @@ _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index,
GLsizei maxLength, GLsizei *length, GLint *size,
GLenum *type, GLchar *nameOut)
{
+ const struct gl_program_parameter_list *attribs = NULL;
struct gl_shader_program *shProg;
shProg = _mesa_lookup_shader_program_err(ctx, program, "glGetActiveAttrib");
if (!shProg)
return;
- if (!shProg->Attributes || index >= shProg->Attributes->NumParameters) {
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+
+ if (!attribs || index >= attribs->NumParameters) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetActiveAttrib(index)");
return;
}
- copy_string(nameOut, maxLength, length,
- shProg->Attributes->Parameters[index].Name);
+ copy_string(nameOut, maxLength, length, attribs->Parameters[index].Name);
+
if (size)
- *size = shProg->Attributes->Parameters[index].Size
- / sizeof_glsl_type(shProg->Attributes->Parameters[index].DataType);
+ *size = attribs->Parameters[index].Size
+ / sizeof_glsl_type(attribs->Parameters[index].DataType);
+
if (type)
- *type = shProg->Attributes->Parameters[index].DataType;
+ *type = attribs->Parameters[index].DataType;
}
@@ -878,6 +877,7 @@ static void
_mesa_get_programiv(GLcontext *ctx, GLuint program,
GLenum pname, GLint *params)
{
+ const struct gl_program_parameter_list *attribs;
struct gl_shader_program *shProg
= _mesa_lookup_shader_program(ctx, program);
@@ -886,6 +886,11 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
return;
}
+ if (shProg->VertexProgram)
+ attribs = shProg->VertexProgram->Base.Attributes;
+ else
+ attribs = NULL;
+
switch (pname) {
case GL_DELETE_STATUS:
*params = shProg->DeletePending;
@@ -903,11 +908,10 @@ _mesa_get_programiv(GLcontext *ctx, GLuint program,
*params = shProg->NumShaders;
break;
case GL_ACTIVE_ATTRIBUTES:
- *params = shProg->Attributes ? shProg->Attributes->NumParameters : 0;
+ *params = attribs ? attribs->NumParameters : 0;
break;
case GL_ACTIVE_ATTRIBUTE_MAX_LENGTH:
- *params = _mesa_longest_parameter_name(shProg->Attributes,
- PROGRAM_INPUT) + 1;
+ *params = _mesa_longest_parameter_name(attribs, PROGRAM_INPUT) + 1;
break;
case GL_ACTIVE_UNIFORMS:
*params = shProg->Uniforms ? shProg->Uniforms->NumUniforms : 0;
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 57dbfc2388..30035b4fee 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.2
*
- * Copyright (C) 2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -215,74 +215,110 @@ link_uniform_vars(struct gl_shader_program *shProg,
* For example, if the vertex shader declared "attribute vec4 foobar" we'll
* allocate a generic vertex attribute for "foobar" and plug that value into
* the vertex program instructions.
+ * But if the user called glBindAttributeLocation(), those bindings will
+ * have priority.
*/
static GLboolean
_slang_resolve_attributes(struct gl_shader_program *shProg,
- struct gl_program *prog)
+ const struct gl_program *origProg,
+ struct gl_program *linkedProg)
{
+ GLint attribMap[MAX_VERTEX_ATTRIBS];
GLuint i, j;
GLbitfield usedAttributes;
- assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
+ assert(origProg != linkedProg);
+ assert(origProg->Target == GL_VERTEX_PROGRAM_ARB);
+ assert(linkedProg->Target == GL_VERTEX_PROGRAM_ARB);
if (!shProg->Attributes)
shProg->Attributes = _mesa_new_parameter_list();
+ if (linkedProg->Attributes) {
+ _mesa_free_parameter_list(linkedProg->Attributes);
+ }
+ linkedProg->Attributes = _mesa_new_parameter_list();
+
+
/* Build a bitmask indicating which attribute indexes have been
* explicitly bound by the user with glBindAttributeLocation().
*/
usedAttributes = 0x0;
for (i = 0; i < shProg->Attributes->NumParameters; i++) {
GLint attr = shProg->Attributes->Parameters[i].StateIndexes[0];
- usedAttributes |= attr;
+ usedAttributes |= (1 << attr);
+ }
+
+ /* initialize the generic attribute map entries to -1 */
+ for (i = 0; i < MAX_VERTEX_ATTRIBS; i++) {
+ attribMap[i] = -1;
}
/*
* Scan program for generic attribute references
*/
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
+ for (i = 0; i < linkedProg->NumInstructions; i++) {
+ struct prog_instruction *inst = linkedProg->Instructions + i;
for (j = 0; j < 3; j++) {
if (inst->SrcReg[j].File == PROGRAM_INPUT &&
inst->SrcReg[j].Index >= VERT_ATTRIB_GENERIC0) {
- /* this is a generic attrib */
- const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0;
- const char *name = prog->Attributes->Parameters[k].Name;
- /* See if this attrib name is in the program's attribute list
- * (i.e. was bound by the user).
+ /*
+ * OK, we've found a generic vertex attribute reference.
*/
- GLint index = _mesa_lookup_parameter_index(shProg->Attributes,
- -1, name);
- GLint attr;
- if (index >= 0) {
- /* found, user must have specified a binding */
- attr = shProg->Attributes->Parameters[index].StateIndexes[0];
- }
- else {
- /* Not found, choose our own attribute number.
- * Start at 1 since generic attribute 0 always aliases
- * glVertex/position.
+ const GLint k = inst->SrcReg[j].Index - VERT_ATTRIB_GENERIC0;
+
+ GLint attr = attribMap[k];
+
+ if (attr < 0) {
+ /* Need to figure out attribute mapping now.
+ */
+ const char *name = origProg->Attributes->Parameters[k].Name;
+ const GLint size = origProg->Attributes->Parameters[k].Size;
+ const GLenum type =origProg->Attributes->Parameters[k].DataType;
+ GLint index, attr;
+
+ /* See if there's a user-defined attribute binding for
+ * this name.
*/
- GLint size = prog->Attributes->Parameters[k].Size;
- GLenum datatype = prog->Attributes->Parameters[k].DataType;
- for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) {
- if (((1 << attr) & usedAttributes) == 0)
- break;
+ index = _mesa_lookup_parameter_index(shProg->Attributes,
+ -1, name);
+ if (index >= 0) {
+ /* Found a user-defined binding */
+ attr = shProg->Attributes->Parameters[index].StateIndexes[0];
}
- if (attr == MAX_VERTEX_ATTRIBS) {
- /* too many! XXX record error log */
- return GL_FALSE;
+ else {
+ /* No user-defined binding, choose our own attribute number.
+ * Start at 1 since generic attribute 0 always aliases
+ * glVertex/position.
+ */
+ for (attr = 1; attr < MAX_VERTEX_ATTRIBS; attr++) {
+ if (((1 << attr) & usedAttributes) == 0)
+ break;
+ }
+ if (attr == MAX_VERTEX_ATTRIBS) {
+ link_error(shProg, "Too many vertex attributes");
+ return GL_FALSE;
+ }
+
+ /* mark this attribute as used */
+ usedAttributes |= (1 << attr);
}
- _mesa_add_attribute(shProg->Attributes, name, size, datatype,attr);
- /* set the attribute as used */
- usedAttributes |= 1<attrib binding so it can be queried
+ * with glGetAttributeLocation().
+ */
+ _mesa_add_attribute(linkedProg->Attributes, name,
+ size, type, attr);
}
+ /* update the instruction's src reg */
inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + attr;
}
}
}
+
return GL_TRUE;
}
@@ -344,36 +380,6 @@ _slang_update_inputs_outputs(struct gl_program *prog)
}
-/**
- * Scan a vertex program looking for instances of
- * (PROGRAM_INPUT, VERT_ATTRIB_GENERIC0 + oldAttrib) and replace with
- * (PROGRAM_INPUT, VERT_ATTRIB_GENERIC0 + newAttrib).
- * This is used when the user calls glBindAttribLocation on an already linked
- * shader program.
- */
-void
-_slang_remap_attribute(struct gl_program *prog, GLuint oldAttrib, GLuint newAttrib)
-{
- GLuint i, j;
-
- assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
-
- for (i = 0; i < prog->NumInstructions; i++) {
- struct prog_instruction *inst = prog->Instructions + i;
- for (j = 0; j < 3; j++) {
- if (inst->SrcReg[j].File == PROGRAM_INPUT) {
- if (inst->SrcReg[j].Index == VERT_ATTRIB_GENERIC0 + oldAttrib) {
- inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + newAttrib;
- }
- }
- }
- }
-
- _slang_update_inputs_outputs(prog);
-}
-
-
-
/** cast wrapper */
static struct gl_vertex_program *
vertex_program(struct gl_program *prog)
@@ -492,9 +498,8 @@ _slang_link(GLcontext *ctx,
/*_mesa_print_uniforms(shProg->Uniforms);*/
if (shProg->VertexProgram) {
- if (!_slang_resolve_attributes(shProg, &shProg->VertexProgram->Base)) {
- /*goto cleanup;*/
- _mesa_problem(ctx, "_slang_resolve_attributes() failed");
+ if (!_slang_resolve_attributes(shProg, &vertProg->Base,
+ &shProg->VertexProgram->Base)) {
return;
}
}
diff --git a/src/mesa/shader/slang/slang_link.h b/src/mesa/shader/slang/slang_link.h
index 8ef8a6b4b3..2b44d20787 100644
--- a/src/mesa/shader/slang/slang_link.h
+++ b/src/mesa/shader/slang/slang_link.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.3
+ * Version: 7.2
*
- * Copyright (C) 2007 Brian Paul All Rights Reserved.
+ * Copyright (C) 2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -32,10 +32,6 @@ extern void
_slang_link(GLcontext *ctx, GLhandleARB h,
struct gl_shader_program *shProg);
-extern void
-_slang_remap_attribute(struct gl_program *prog, GLuint oldAttrib,
- GLuint newAttrib);
-
#endif
--
cgit v1.2.3
From 904f31a62444d9f7e9b12ddafaa4beeb7fed6dfa Mon Sep 17 00:00:00 2001
From: Eric Anholt
Date: Tue, 16 Sep 2008 17:01:06 -0700
Subject: intel: Destroy bufmgr in screen destroy, not context.
Caused server crashes on second context creation since
7e0bbdcf033981282978554c2e68ce48b55aa291.
Bug #17600.
---
src/mesa/drivers/dri/intel/intel_context.c | 2 --
src/mesa/drivers/dri/intel/intel_screen.c | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 23e0f6331a..2ca5732606 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -822,8 +822,6 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
/* free the Mesa context */
_mesa_free_context_data(&intel->ctx);
-
- dri_bufmgr_destroy(intel->bufmgr);
}
}
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index de098e5b72..373e0e155e 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -309,6 +309,7 @@ intelDestroyScreen(__DRIscreenPrivate * sPriv)
{
intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private;
+ dri_bufmgr_destroy(intelScreen->bufmgr);
intelUnmapScreenRegions(intelScreen);
FREE(intelScreen);
--
cgit v1.2.3
From 858ced051551aa5d0ddd41936253d3a4ee5c142f Mon Sep 17 00:00:00 2001
From: Robert Ellison
Date: Wed, 17 Sep 2008 02:30:20 -0600
Subject: CELL: fleshing out the blending fragment ops
- Added two new debug flags (to be used with the CELL_DEBUG environment
variable). The first, "CELL_DEBUG=fragops", activates SPE fragment
ops debug messages. The second, "CELL_DEBUG=fragopfallback", will
eventually be used to disable the use of generated SPE code for
fragment ops in favor of the default fallback reference routine.
(During development, though, the parity of this flag is reversed:
all users will get the reference code *unless* CELL_DEBUG=fragopfallback
is set. This will prevent hiccups in code generation from affecting
the other developers.)
- Formalized debug message usage and macros in spu/spu_main.c.
- Added lots of new code to ppu/cell_gen_fragment.c to extend the
number of supported source RGB factors from 4 to 15, and to
complete the list of supported blend equations.
More coming, to complete the source and destination RGB and alpha
factors, and to complete the rest of the fragment operations...
---
src/gallium/drivers/cell/common.h | 11 +-
src/gallium/drivers/cell/ppu/cell_context.c | 2 +
src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 272 ++++++++++++++++++++++-
src/gallium/drivers/cell/ppu/cell_state_emit.c | 5 +
src/gallium/drivers/cell/spu/spu_main.c | 115 +++++-----
5 files changed, 337 insertions(+), 68 deletions(-)
diff --git a/src/gallium/drivers/cell/common.h b/src/gallium/drivers/cell/common.h
index 8f08854117..f0ff96eb47 100644
--- a/src/gallium/drivers/cell/common.h
+++ b/src/gallium/drivers/cell/common.h
@@ -104,12 +104,11 @@
#define CELL_BUFFER_STATUS_FREE 10
#define CELL_BUFFER_STATUS_USED 20
-
-#define CELL_DEBUG_CHECKER (1 << 0)
-#define CELL_DEBUG_ASM (1 << 1)
-#define CELL_DEBUG_SYNC (1 << 2)
-
-
+#define CELL_DEBUG_CHECKER (1 << 0)
+#define CELL_DEBUG_ASM (1 << 1)
+#define CELL_DEBUG_SYNC (1 << 2)
+#define CELL_DEBUG_FRAGMENT_OPS (1 << 3)
+#define CELL_DEBUG_FRAGMENT_OP_FALLBACK (1 << 4)
/** Max instructions for doing per-fragment operations */
#define SPU_MAX_FRAGMENT_OPS_INSTS 64
diff --git a/src/gallium/drivers/cell/ppu/cell_context.c b/src/gallium/drivers/cell/ppu/cell_context.c
index b418271dca..62e213ea35 100644
--- a/src/gallium/drivers/cell/ppu/cell_context.c
+++ b/src/gallium/drivers/cell/ppu/cell_context.c
@@ -89,6 +89,8 @@ static const struct debug_named_value cell_debug_flags[] = {
{"checker", CELL_DEBUG_CHECKER},/**< modulate tile clear color by SPU ID */
{"asm", CELL_DEBUG_ASM}, /**< dump SPU asm code */
{"sync", CELL_DEBUG_SYNC}, /**< SPUs do synchronous DMA */
+ {"fragops", CELL_DEBUG_FRAGMENT_OPS}, /**< SPUs emit fragment ops debug messages*/
+ {"fragopfallback", CELL_DEBUG_FRAGMENT_OP_FALLBACK}, /**< SPUs use reference implementation for fragment ops*/
{NULL, 0}
};
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
index 06219d4e98..2c8c9e0d2c 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
@@ -229,7 +229,36 @@ gen_alpha_test(const struct pipe_depth_stencil_alpha_state *dsa,
spe_release_register(f, amask_reg);
}
+/* This is a convenient and oft-used sequence. It chooses
+ * the smaller of each element of reg1 and reg2, and combines them
+ * into the result register, as follows:
+ *
+ * The Float Compare Greater Than (fcgt) instruction will put
+ * 1s into compare_reg where reg1 > reg2, and 0s where reg1 <= reg2.
+ *
+ * Then the Select Bits (selb) instruction will take bits from
+ * reg1 where compare_reg is 0, and from reg2 where compare_reg is
+ * 1. Ergo, result_reg will have the bits from reg1 where reg1 <= reg2,
+ * and the bits from reg2 where reg1 > reg2, which is exactly the
+ * MIN operation.
+ */
+#define FLOAT_VECTOR_MIN(f, result_reg, reg1, reg2) {\
+ int compare_reg = spe_allocate_available_register(f); \
+ spe_fcgt(f, compare_reg, reg1, reg2); \
+ spe_selb(f, result_reg, reg1, reg2, compare_reg); \
+ spe_release_register(f, compare_reg); \
+}
+/* The FLOAT_VECTOR_MAX sequence is similar to the FLOAT_VECTOR_MIN
+ * sequence above, except that the registers specified when selecting
+ * bits are reversed.
+ */
+#define FLOAT_VECTOR_MAX(f, result_reg, reg1, reg2) {\
+ int compare_reg = spe_allocate_available_register(f); \
+ spe_fcgt(f, compare_reg, reg1, reg2); \
+ spe_selb(f, result_reg, reg2, reg1, compare_reg); \
+ spe_release_register(f, compare_reg); \
+}
/**
* Generate SPE code to implement the given blend mode for a quad of pixels.
@@ -242,6 +271,7 @@ gen_alpha_test(const struct pipe_depth_stencil_alpha_state *dsa,
*/
static void
gen_blend(const struct pipe_blend_state *blend,
+ const struct pipe_blend_color *blend_color,
struct spe_function *f,
enum pipe_format color_format,
int fragR_reg, int fragG_reg, int fragB_reg, int fragA_reg,
@@ -262,10 +292,53 @@ gen_blend(const struct pipe_blend_state *blend,
int fbB_reg = spe_allocate_available_register(f);
int fbA_reg = spe_allocate_available_register(f);
- int one_reg = spe_allocate_available_register(f);
int tmp_reg = spe_allocate_available_register(f);
- boolean one_reg_set = false; /* avoid setting one_reg more than once */
+ /* These values might or might not eventually get put into
+ * registers. We avoid allocating them and setting them until
+ * they're actually needed; then we avoid setting them more than
+ * once, and release them at the end of code generation.
+ */
+ boolean one_reg_set = false;
+ int one_reg;
+#define SET_ONE_REG_IF_UNSET(f) if (!one_reg_set) {\
+ one_reg = spe_allocate_available_register(f); \
+ spe_load_float(f, one_reg, 1.0f); \
+ one_reg_set = true; \
+}
+#define RELEASE_ONE_REG_IF_USED(f) if (one_reg_set) {\
+ spe_release_register(f, one_reg); \
+}
+
+ boolean const_color_set = false;
+ int constR_reg, constG_reg, constB_reg;
+#define SET_CONST_COLOR_IF_UNSET(f, blend_color) if (!const_color_set) {\
+ constR_reg = spe_allocate_available_register(f); \
+ constG_reg = spe_allocate_available_register(f); \
+ constG_reg = spe_allocate_available_register(f); \
+ spe_load_float(f, constR_reg, blend_color->color[0]); \
+ spe_load_float(f, constG_reg, blend_color->color[1]); \
+ spe_load_float(f, constB_reg, blend_color->color[2]); \
+ const_color_set = true;\
+}
+#define RELEASE_CONST_COLOR_IF_USED(f) if (const_color_set) {\
+ spe_release_register(f, constR_reg); \
+ spe_release_register(f, constG_reg); \
+ spe_release_register(f, constB_reg); \
+}
+
+ boolean const_alpha_set = false;
+ int constA_reg;
+#define SET_CONST_ALPHA_IF_UNSET(f, blend_color) if (!const_alpha_set) {\
+ constA_reg = spe_allocate_available_register(f); \
+ spe_load_float(f, constA_reg, blend_color->color[3]); \
+ const_alpha_set = true; \
+}
+#define RELEASE_CONST_ALPHA_IF_USED(f) if (const_alpha_set) {\
+ spe_release_register(f, constA_reg); \
+}
+
+ /* Real code starts here */
ASSERT(blend->blend_enable);
@@ -348,30 +421,161 @@ gen_blend(const struct pipe_blend_state *blend,
/*
- * Compute Src RGB terms
+ * Compute Src RGB terms. We're actually looking for the value
+ * of (the appropriate RGB factors) * (the incoming source RGB color).
*/
switch (blend->rgb_src_factor) {
case PIPE_BLENDFACTOR_ONE:
+ /* factors = (1,1,1), so term = (R,G,B) */
spe_move(f, term1R_reg, fragR_reg);
spe_move(f, term1G_reg, fragG_reg);
spe_move(f, term1B_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_ZERO:
- spe_zero(f, term1R_reg);
- spe_zero(f, term1G_reg);
- spe_zero(f, term1B_reg);
+ /* factors = (0,0,0), so term = (0,0,0) */
+ spe_load_float(f, term1R_reg, 0.0f);
+ spe_load_float(f, term1G_reg, 0.0f);
+ spe_load_float(f, term1B_reg, 0.0f);
break;
case PIPE_BLENDFACTOR_SRC_COLOR:
+ /* factors = (R,G,B), so term = (R*R, G*G, B*B) */
spe_fm(f, term1R_reg, fragR_reg, fragR_reg);
spe_fm(f, term1G_reg, fragG_reg, fragG_reg);
spe_fm(f, term1B_reg, fragB_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_SRC_ALPHA:
+ /* factors = (A,A,A), so term = (R*A, G*A, B*A) */
spe_fm(f, term1R_reg, fragR_reg, fragA_reg);
spe_fm(f, term1G_reg, fragG_reg, fragA_reg);
spe_fm(f, term1B_reg, fragB_reg, fragA_reg);
break;
- /* XXX more cases */
+ case PIPE_BLENDFACTOR_INV_SRC_COLOR:
+ /* factors = (1-R,1-G,1-B), so term = (R*(1-R), G*(1-G), B*(1-B)) */
+ /* we'll need the optional constant {1,1,1,1} register */
+ SET_ONE_REG_IF_UNSET(f)
+ /* tmp = 1 - R */
+ spe_fs(f, tmp_reg, one_reg, fragR_reg);
+ /* term = R * tmp */
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ /* repeat for G and B */
+ spe_fs(f, tmp_reg, one_reg, fragG_reg);
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fs(f, tmp_reg, one_reg, fragB_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+ case PIPE_BLENDFACTOR_DST_COLOR:
+ /* factors = (Rfb,Gfb,Bfb), so term = (R*Rfb, G*Gfb, B*Bfb) */
+ spe_fm(f, term1R_reg, fragR_reg, fbR_reg);
+ spe_fm(f, term1G_reg, fragG_reg, fbG_reg);
+ spe_fm(f, term1B_reg, fragB_reg, fbB_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_DST_COLOR:
+ /* factors = (1-Rfb,1-Gfb,1-Bfb), so term = (R*(1-Rfb),G*(1-Gfb),B*(1-Bfb)) */
+ /* we'll need the optional constant {1,1,1,1} register */
+ SET_ONE_REG_IF_UNSET(f)
+ /* tmp = 1 - Rfb */
+ spe_fs(f, tmp_reg, one_reg, fbR_reg);
+ /* term = R * tmp */
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ /* repeat for G and B */
+ spe_fs(f, tmp_reg, one_reg, fbG_reg);
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fs(f, tmp_reg, one_reg, fbB_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+ /* factors = (1-A,1-A,1-A), so term = (R*(1-A),G*(1-A),B*(1-A)) */
+ /* we'll need the optional constant {1,1,1,1} register */
+ SET_ONE_REG_IF_UNSET(f)
+ /* tmp = 1 - A */
+ spe_fs(f, tmp_reg, one_reg, fragA_reg);
+ /* term = R * tmp */
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ /* repeat for G and B with the same (1-A) factor */
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+ case PIPE_BLENDFACTOR_DST_ALPHA:
+ /* factors = (Afb, Afb, Afb), so term = (R*Afb, G*Afb, B*Afb) */
+ spe_fm(f, term1R_reg, fragR_reg, fbA_reg);
+ spe_fm(f, term1G_reg, fragG_reg, fbA_reg);
+ spe_fm(f, term1B_reg, fragB_reg, fbA_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_DST_ALPHA:
+ /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (R*(1-Afb),G*(1-Afb),B*(1-Afb)) */
+ /* we'll need the optional constant {1,1,1,1} register */
+ SET_ONE_REG_IF_UNSET(f)
+ /* tmp = 1 - A */
+ spe_fs(f, tmp_reg, one_reg, fbA_reg);
+ /* term = R * tmp, G*tmp, and B*tmp */
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+ case PIPE_BLENDFACTOR_CONST_COLOR:
+ /* We'll need the optional blend color registers */
+ SET_CONST_COLOR_IF_UNSET(f,blend_color)
+ /* now, factor = (Rc,Gc,Bc), so term = (R*Rc,G*Gc,B*Bc) */
+ spe_fm(f, term1R_reg, fragR_reg, constR_reg);
+ spe_fm(f, term1G_reg, fragG_reg, constG_reg);
+ spe_fm(f, term1B_reg, fragB_reg, constB_reg);
+ break;
+ case PIPE_BLENDFACTOR_CONST_ALPHA:
+ /* we'll need the optional constant alpha register */
+ SET_CONST_ALPHA_IF_UNSET(f, blend_color)
+ /* factor = (Ac,Ac,Ac), so term = (R*Ac,G*Ac,B*Ac) */
+ spe_fm(f, term1R_reg, fragR_reg, constA_reg);
+ spe_fm(f, term1G_reg, fragG_reg, constA_reg);
+ spe_fm(f, term1B_reg, fragB_reg, constA_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_CONST_COLOR:
+ /* We need both the optional {1,1,1,1} register, and the optional
+ * constant color registers
+ */
+ SET_ONE_REG_IF_UNSET(f)
+ SET_CONST_COLOR_IF_UNSET(f, blend_color)
+ /* factor = (1-Rc,1-Gc,1-Bc), so term = (R*(1-Rc),G*(1-Gc),B*(1-Bc)) */
+ spe_fs(f, tmp_reg, one_reg, constR_reg);
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ spe_fs(f, tmp_reg, one_reg, constG_reg);
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fs(f, tmp_reg, one_reg, constB_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
+ /* We need the optional {1,1,1,1} register and the optional
+ * constant alpha register
+ */
+ SET_ONE_REG_IF_UNSET(f)
+ SET_CONST_ALPHA_IF_UNSET(f, blend_color)
+ /* factor = (1-Ac,1-Ac,1-Ac), so term = (R*(1-Ac),G*(1-Ac),B*(1-Ac)) */
+ spe_fs(f, tmp_reg, one_reg, constA_reg);
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+ case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
+ /* We'll need the optional {1,1,1,1} register */
+ SET_ONE_REG_IF_UNSET(f)
+ /* factor = (min(A,1-Afb),min(A,1-Afb),min(A,1-Afb)), so
+ * term = (R*min(A,1-Afb), G*min(A,1-Afb), B*min(A,1-Afb))
+ */
+ /* tmp = 1 - Afb */
+ spe_fs(f, tmp_reg, one_reg, fbA_reg);
+ /* tmp = min(A,tmp) */
+ FLOAT_VECTOR_MIN(f, tmp_reg, fragA_reg, tmp_reg)
+ /* term = R*tmp */
+ spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
+ spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
+ spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ break;
+
+ /* non-OpenGL cases? */
+ case PIPE_BLENDFACTOR_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_SRC1_ALPHA:
+ case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
+
default:
ASSERT(0);
}
@@ -421,6 +625,7 @@ gen_blend(const struct pipe_blend_state *blend,
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
/* one = {1.0, 1.0, 1.0, 1.0} */
if (!one_reg_set) {
+ one_reg = spe_allocate_available_register(f);
spe_load_float(f, one_reg, 1.0f);
one_reg_set = true;
}
@@ -432,6 +637,14 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term2B_reg, fbB_reg, tmp_reg);
break;
/* XXX more cases */
+ // GL_ONE_MINUS_SRC_COLOR
+ // GL_DST_COLOR
+ // GL_ONE_MINUS_DST_COLOR
+ // GL_DST_ALPHA
+ // GL_CONSTANT_COLOR
+ // GL_ONE_MINUS_CONSTANT_COLOR
+ // GL_CONSTANT_ALPHA
+ // GL_ONE_MINUS_CONSTANT_ALPHA
default:
ASSERT(0);
}
@@ -452,6 +665,7 @@ gen_blend(const struct pipe_blend_state *blend,
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
/* one = {1.0, 1.0, 1.0, 1.0} */
if (!one_reg_set) {
+ one_reg = spe_allocate_available_register(f);
spe_load_float(f, one_reg, 1.0f);
one_reg_set = true;
}
@@ -461,6 +675,14 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term2A_reg, fbA_reg, tmp_reg);
break;
/* XXX more cases */
+ // GL_ONE_MINUS_SRC_COLOR
+ // GL_DST_COLOR
+ // GL_ONE_MINUS_DST_COLOR
+ // GL_DST_ALPHA
+ // GL_CONSTANT_COLOR
+ // GL_ONE_MINUS_CONSTANT_COLOR
+ // GL_CONSTANT_ALPHA
+ // GL_ONE_MINUS_CONSTANT_ALPHA
default:
ASSERT(0);
}
@@ -479,7 +701,21 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fs(f, fragG_reg, term1G_reg, term2G_reg);
spe_fs(f, fragB_reg, term1B_reg, term2B_reg);
break;
- /* XXX more cases */
+ case PIPE_BLEND_REVERSE_SUBTRACT:
+ spe_fs(f, fragR_reg, term2R_reg, term1R_reg);
+ spe_fs(f, fragG_reg, term2G_reg, term1G_reg);
+ spe_fs(f, fragB_reg, term2B_reg, term1B_reg);
+ break;
+ case PIPE_BLEND_MIN:
+ FLOAT_VECTOR_MIN(f, fragR_reg, term1R_reg, term2R_reg)
+ FLOAT_VECTOR_MIN(f, fragG_reg, term1G_reg, term2G_reg)
+ FLOAT_VECTOR_MIN(f, fragB_reg, term1B_reg, term2B_reg)
+ break;
+ case PIPE_BLEND_MAX:
+ FLOAT_VECTOR_MAX(f, fragR_reg, term1R_reg, term2R_reg)
+ FLOAT_VECTOR_MAX(f, fragG_reg, term1G_reg, term2G_reg)
+ FLOAT_VECTOR_MAX(f, fragB_reg, term1B_reg, term2B_reg)
+ break;
default:
ASSERT(0);
}
@@ -494,7 +730,15 @@ gen_blend(const struct pipe_blend_state *blend,
case PIPE_BLEND_SUBTRACT:
spe_fs(f, fragA_reg, term1A_reg, term2A_reg);
break;
- /* XXX more cases */
+ case PIPE_BLEND_REVERSE_SUBTRACT:
+ spe_fs(f, fragA_reg, term2A_reg, term1A_reg);
+ break;
+ case PIPE_BLEND_MIN:
+ FLOAT_VECTOR_MIN(f, fragA_reg, term1A_reg, term2A_reg)
+ break;
+ case PIPE_BLEND_MAX:
+ FLOAT_VECTOR_MAX(f, fragA_reg, term1A_reg, term2A_reg)
+ break;
default:
ASSERT(0);
}
@@ -514,8 +758,12 @@ gen_blend(const struct pipe_blend_state *blend,
spe_release_register(f, fbB_reg);
spe_release_register(f, fbA_reg);
- spe_release_register(f, one_reg);
spe_release_register(f, tmp_reg);
+
+ /* Free any optional registers that actually got used */
+ RELEASE_ONE_REG_IF_USED(f)
+ RELEASE_CONST_COLOR_IF_USED(f)
+ RELEASE_CONST_ALPHA_IF_USED(f)
}
@@ -629,6 +877,7 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
const struct pipe_depth_stencil_alpha_state *dsa =
&cell->depth_stencil->base;
const struct pipe_blend_state *blend = &cell->blend->base;
+ const struct pipe_blend_color *blend_color = &cell->blend_color;
const enum pipe_format color_format = cell->framebuffer.cbufs[0]->format;
/* For SPE function calls: reg $3 = first param, $4 = second param, etc. */
@@ -651,7 +900,6 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
int fbRGBA_reg; /**< framebuffer's RGBA colors for quad */
int fbZS_reg; /**< framebuffer's combined z/stencil values for quad */
- spe_init_func(f, SPU_MAX_FRAGMENT_OPS_INSTS * SPE_INST_SIZE);
spe_allocate_register(f, x_reg);
spe_allocate_register(f, y_reg);
spe_allocate_register(f, color_tile_reg);
@@ -816,7 +1064,7 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
if (blend->blend_enable) {
- gen_blend(blend, f, color_format,
+ gen_blend(blend, blend_color, f, color_format,
fragR_reg, fragG_reg, fragB_reg, fragA_reg, fbRGBA_reg);
}
diff --git a/src/gallium/drivers/cell/ppu/cell_state_emit.c b/src/gallium/drivers/cell/ppu/cell_state_emit.c
index 2da3097983..8a389cd6aa 100644
--- a/src/gallium/drivers/cell/ppu/cell_state_emit.c
+++ b/src/gallium/drivers/cell/ppu/cell_state_emit.c
@@ -100,14 +100,19 @@ cell_emit_state(struct cell_context *cell)
= cell_batch_alloc(cell, sizeof(*fops));
struct spe_function spe_code;
+ /* Prepare the buffer that will hold the generated code. */
+ spe_init_func(&spe_code, SPU_MAX_FRAGMENT_OPS_INSTS * SPE_INST_SIZE);
+
/* generate new code */
cell_gen_fragment_function(cell, &spe_code);
+
/* put the new code into the batch buffer */
fops->opcode = CELL_CMD_STATE_FRAGMENT_OPS;
memcpy(&fops->code, spe_code.store,
SPU_MAX_FRAGMENT_OPS_INSTS * SPE_INST_SIZE);
fops->dsa = cell->depth_stencil->base;
fops->blend = cell->blend->base;
+
/* free codegen buffer */
spe_release_func(&spe_code);
}
diff --git a/src/gallium/drivers/cell/spu/spu_main.c b/src/gallium/drivers/cell/spu/spu_main.c
index 78260c4259..da2cb08972 100644
--- a/src/gallium/drivers/cell/spu/spu_main.c
+++ b/src/gallium/drivers/cell/spu/spu_main.c
@@ -50,7 +50,31 @@ helpful headers:
/opt/cell/sdk/usr/include/libmisc.h
*/
+/* Set to 0 to disable all extraneous debugging code */
+#define DEBUG 1
+
+#if DEBUG
boolean Debug = FALSE;
+boolean force_fragment_ops_fallback = TRUE;
+
+/* These debug macros use the unusual construction ", ##__VA_ARGS__"
+ * which expands to the expected comma + args if variadic arguments
+ * are supplied, but swallows the comma if there are no variadic
+ * arguments (which avoids syntax errors that would otherwise occur).
+ */
+#define DEBUG_PRINTF(format,...) \
+ if (Debug) \
+ printf("SPU %u: " format, spu.init.id, ##__VA_ARGS__)
+#define D_PRINTF(flag, format,...) \
+ if (spu.init.debug_flags & (flag)) \
+ printf("SPU %u: " format, spu.init.id, ##__VA_ARGS__)
+
+#else
+
+#define DEBUG_PRINTF(...)
+#define D_PRINTF(...)
+
+#endif
struct spu_global spu;
@@ -133,9 +157,7 @@ really_clear_tiles(uint surfaceIndex)
static void
cmd_clear_surface(const struct cell_command_clear_surface *clear)
{
- if (Debug)
- printf("SPU %u: CLEAR SURF %u to 0x%08x\n", spu.init.id,
- clear->surface, clear->value);
+ DEBUG_PRINTF("CLEAR SURF %u to 0x%08x\n", clear->surface, clear->value);
if (clear->surface == 0) {
spu.fb.color_clear_value = clear->value;
@@ -203,17 +225,14 @@ cmd_clear_surface(const struct cell_command_clear_surface *clear)
#endif /* CLEAR_OPT */
- if (Debug)
- printf("SPU %u: CLEAR SURF done\n", spu.init.id);
+ DEBUG_PRINTF("CLEAR SURF done\n");
}
static void
cmd_release_verts(const struct cell_command_release_verts *release)
{
- if (Debug)
- printf("SPU %u: RELEASE VERTS %u\n",
- spu.init.id, release->vertex_buf);
+ DEBUG_PRINTF("RELEASE VERTS %u\n", release->vertex_buf);
ASSERT(release->vertex_buf != ~0U);
release_buffer(release->vertex_buf);
}
@@ -228,16 +247,30 @@ cmd_release_verts(const struct cell_command_release_verts *release)
static void
cmd_state_fragment_ops(const struct cell_command_fragment_ops *fops)
{
- if (Debug)
- printf("SPU %u: CMD_STATE_FRAGMENT_OPS\n", spu.init.id);
+ DEBUG_PRINTF("CMD_STATE_FRAGMENT_OPS\n");
/* Copy SPU code from batch buffer to spu buffer */
memcpy(spu.fragment_ops_code, fops->code, SPU_MAX_FRAGMENT_OPS_INSTS * 4);
/* Copy state info (for fallback case only) */
memcpy(&spu.depth_stencil_alpha, &fops->dsa, sizeof(fops->dsa));
memcpy(&spu.blend, &fops->blend, sizeof(fops->blend));
- /* Point function pointer at new code */
- spu.fragment_ops = (spu_fragment_ops_func) spu.fragment_ops_code;
+ /* Parity twist! For now, always use the fallback code by default,
+ * only switching to codegen when specifically requested. This
+ * allows us to develop freely without risking taking down the
+ * branch.
+ *
+ * Later, the parity of this check will be reversed, so that
+ * codegen is *always* used, unless we specifically indicate that
+ * we don't want it.
+ *
+ * Eventually, the option will be removed completely, because in
+ * final code we'll always use codegen and won't even provide the
+ * raw state records that the fallback code requires.
+ */
+ if (spu.init.debug_flags & CELL_DEBUG_FRAGMENT_OP_FALLBACK) {
+ spu.fragment_ops = (spu_fragment_ops_func) spu.fragment_ops_code;
+ }
+ /* otherwise, the default fallback code remains in place */
spu.read_depth = spu.depth_stencil_alpha.depth.enabled;
spu.read_stencil = spu.depth_stencil_alpha.stencil[0].enabled;
@@ -247,8 +280,7 @@ cmd_state_fragment_ops(const struct cell_command_fragment_ops *fops)
static void
cmd_state_fragment_program(const struct cell_command_fragment_program *fp)
{
- if (Debug)
- printf("SPU %u: CMD_STATE_FRAGMENT_PROGRAM\n", spu.init.id);
+ DEBUG_PRINTF("CMD_STATE_FRAGMENT_PROGRAM\n");
/* Copy SPU code from batch buffer to spu buffer */
memcpy(spu.fragment_program_code, fp->code,
SPU_MAX_FRAGMENT_PROGRAM_INSTS * 4);
@@ -262,9 +294,7 @@ cmd_state_fragment_program(const struct cell_command_fragment_program *fp)
static void
cmd_state_framebuffer(const struct cell_command_framebuffer *cmd)
{
- if (Debug)
- printf("SPU %u: FRAMEBUFFER: %d x %d at %p, cformat 0x%x zformat 0x%x\n",
- spu.init.id,
+ DEBUG_PRINTF("FRAMEBUFFER: %d x %d at %p, cformat 0x%x zformat 0x%x\n",
cmd->width,
cmd->height,
cmd->color_start,
@@ -309,9 +339,7 @@ cmd_state_framebuffer(const struct cell_command_framebuffer *cmd)
static void
cmd_state_sampler(const struct cell_command_sampler *sampler)
{
- if (Debug)
- printf("SPU %u: SAMPLER [%u]\n",
- spu.init.id, sampler->unit);
+ DEBUG_PRINTF("SAMPLER [%u]\n", sampler->unit);
spu.sampler[sampler->unit] = sampler->state;
if (spu.sampler[sampler->unit].min_img_filter == PIPE_TEX_FILTER_LINEAR)
@@ -328,11 +356,9 @@ cmd_state_texture(const struct cell_command_texture *texture)
const uint width = texture->width;
const uint height = texture->height;
- if (Debug) {
- printf("SPU %u: TEXTURE [%u] at %p size %u x %u\n", spu.init.id,
+ DEBUG_PRINTF("TEXTURE [%u] at %p size %u x %u\n",
texture->unit, texture->start,
texture->width, texture->height);
- }
spu.texture[unit].start = texture->start;
spu.texture[unit].width = width;
@@ -351,10 +377,7 @@ cmd_state_texture(const struct cell_command_texture *texture)
static void
cmd_state_vertex_info(const struct vertex_info *vinfo)
{
- if (Debug) {
- printf("SPU %u: VERTEX_INFO num_attribs=%u\n", spu.init.id,
- vinfo->num_attribs);
- }
+ DEBUG_PRINTF("VERTEX_INFO num_attribs=%u\n", vinfo->num_attribs);
ASSERT(vinfo->num_attribs >= 1);
ASSERT(vinfo->num_attribs <= 8);
memcpy(&spu.vertex_info, vinfo, sizeof(*vinfo));
@@ -393,8 +416,7 @@ cmd_state_attrib_fetch(const struct cell_attribute_fetch_code *code)
static void
cmd_finish(void)
{
- if (Debug)
- printf("SPU %u: FINISH\n", spu.init.id);
+ DEBUG_PRINTF("FINISH\n");
really_clear_tiles(0);
/* wait for all outstanding DMAs to finish */
mfc_write_tag_mask(~0);
@@ -419,9 +441,8 @@ cmd_batch(uint opcode)
const unsigned usize = size / sizeof(buffer[0]);
uint pos;
- if (Debug)
- printf("SPU %u: BATCH buffer %u, len %u, from %p\n",
- spu.init.id, buf, size, spu.init.buffers[buf]);
+ DEBUG_PRINTF("BATCH buffer %u, len %u, from %p\n",
+ buf, size, spu.init.buffers[buf]);
ASSERT((opcode & CELL_CMD_OPCODE_MASK) == CELL_CMD_BATCH);
@@ -440,8 +461,7 @@ cmd_batch(uint opcode)
wait_on_mask(1 << TAG_BATCH_BUFFER);
/* Tell PPU we're done copying the buffer to local store */
- if (Debug)
- printf("SPU %u: release batch buf %u\n", spu.init.id, buf);
+ DEBUG_PRINTF("release batch buf %u\n", buf);
release_buffer(buf);
/*
@@ -571,8 +591,7 @@ cmd_batch(uint opcode)
}
}
- if (Debug)
- printf("SPU %u: BATCH complete\n", spu.init.id);
+ DEBUG_PRINTF("BATCH complete\n");
}
@@ -585,8 +604,7 @@ main_loop(void)
struct cell_command cmd;
int exitFlag = 0;
- if (Debug)
- printf("SPU %u: Enter main loop\n", spu.init.id);
+ DEBUG_PRINTF("Enter main loop\n");
ASSERT((sizeof(struct cell_command) & 0xf) == 0);
ASSERT_ALIGN16(&cmd);
@@ -595,14 +613,12 @@ main_loop(void)
unsigned opcode;
int tag = 0;
- if (Debug)
- printf("SPU %u: Wait for cmd...\n", spu.init.id);
+ DEBUG_PRINTF("Wait for cmd...\n");
/* read/wait from mailbox */
opcode = (unsigned int) spu_read_in_mbox();
- if (Debug)
- printf("SPU %u: got cmd 0x%x\n", spu.init.id, opcode);
+ DEBUG_PRINTF("got cmd 0x%x\n", opcode);
/* command payload */
mfc_get(&cmd, /* dest */
@@ -619,8 +635,7 @@ main_loop(void)
switch (opcode & CELL_CMD_OPCODE_MASK) {
case CELL_CMD_EXIT:
- if (Debug)
- printf("SPU %u: EXIT\n", spu.init.id);
+ DEBUG_PRINTF("EXIT\n");
exitFlag = 1;
break;
case CELL_CMD_VS_EXECUTE:
@@ -632,13 +647,12 @@ main_loop(void)
cmd_batch(opcode);
break;
default:
- printf("Bad opcode!\n");
+ printf("Bad opcode 0x%x!\n", opcode & CELL_CMD_OPCODE_MASK);
}
}
- if (Debug)
- printf("SPU %u: Exit main loop\n", spu.init.id);
+ DEBUG_PRINTF("Exit main loop\n");
spu_dcache_report();
}
@@ -653,7 +667,8 @@ one_time_init(void)
invalidate_tex_cache();
/* Install default/fallback fragment processing function.
- * This will normally be overriden by a code-gen'd function.
+ * This will normally be overriden by a code-gen'd function
+ * unless CELL_FORCE_FRAGMENT_OPS_FALLBACK is set.
*/
spu.fragment_ops = spu_fallback_fragment_ops;
}
@@ -685,8 +700,8 @@ main(main_param_t speid, main_param_t argp)
one_time_init();
- if (Debug)
- printf("SPU: main() speid=%lu\n", (unsigned long) speid);
+ DEBUG_PRINTF("main() speid=%lu\n", (unsigned long) speid);
+ D_PRINTF(CELL_DEBUG_FRAGMENT_OP_FALLBACK, "using fragment op fallback\n");
mfc_get(&spu.init, /* dest */
(unsigned int) argp, /* src */
--
cgit v1.2.3
From 05aeb92a092c26e7773beb95692fc72e70a40e56 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 08:11:42 -0600
Subject: cell: dump generated code if CELL_DEBUG=asm
---
progs/demos/fslight.c | 2 +-
src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 13 ++++++++++-
src/gallium/drivers/cell/ppu/cell_screen.c | 14 ++++++------
src/gallium/drivers/softpipe/sp_fs_exec.c | 29 ++++++++++++++++++++----
4 files changed, 44 insertions(+), 14 deletions(-)
diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c
index e79b5cc197..c7931f4697 100644
--- a/progs/demos/fslight.c
+++ b/progs/demos/fslight.c
@@ -45,7 +45,7 @@ static GLint uTexture;
static GLuint SphereList, RectList, CurList;
static GLint win = 0;
-static GLboolean anim = GL_TRUE;
+static GLboolean anim = 0*GL_TRUE;
static GLboolean wire = GL_FALSE;
static GLboolean pixelLight = GL_TRUE;
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
index 2c8c9e0d2c..99407b8ace 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
@@ -900,6 +900,14 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
int fbRGBA_reg; /**< framebuffer's RGBA colors for quad */
int fbZS_reg; /**< framebuffer's combined z/stencil values for quad */
+ spe_init_func(f, SPU_MAX_FRAGMENT_OPS_INSTS * SPE_INST_SIZE);
+
+ if (cell->debug_flags & CELL_DEBUG_ASM) {
+ spe_print_code(f, true);
+ spe_indent(f, 8);
+ spe_comment(f, -4, "Begin per-fragment ops");
+ }
+
spe_allocate_register(f, x_reg);
spe_allocate_register(f, y_reg);
spe_allocate_register(f, color_tile_reg);
@@ -1114,5 +1122,8 @@ cell_gen_fragment_function(struct cell_context *cell, struct spe_function *f)
spe_release_register(f, fbRGBA_reg);
spe_release_register(f, fbZS_reg);
spe_release_register(f, quad_offset_reg);
-}
+ if (cell->debug_flags & CELL_DEBUG_ASM) {
+ spe_comment(f, -4, "End per-fragment ops");
+ }
+}
diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c
index 139b3719b6..47ba6fa290 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -58,9 +58,9 @@ cell_get_param(struct pipe_screen *screen, int param)
case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
return CELL_MAX_SAMPLERS;
case PIPE_CAP_NPOT_TEXTURES:
- return 0;
+ return 1;
case PIPE_CAP_TWO_SIDED_STENCIL:
- return 0;
+ return 1;
case PIPE_CAP_GLSL:
return 1;
case PIPE_CAP_S3TC:
@@ -68,13 +68,13 @@ cell_get_param(struct pipe_screen *screen, int param)
case PIPE_CAP_ANISOTROPIC_FILTER:
return 0;
case PIPE_CAP_POINT_SPRITE:
- return 0;
+ return 1;
case PIPE_CAP_MAX_RENDER_TARGETS:
return 1;
case PIPE_CAP_OCCLUSION_QUERY:
- return 0;
+ return 1;
case PIPE_CAP_TEXTURE_SHADOW_MAP:
- return 0;
+ return 10;
case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
return 12; /* max 2Kx2K */
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
@@ -82,7 +82,7 @@ cell_get_param(struct pipe_screen *screen, int param)
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return 12; /* max 2Kx2K */
default:
- return 0;
+ return 10;
}
}
@@ -108,7 +108,7 @@ cell_get_paramf(struct pipe_screen *screen, int param)
return 16.0; /* arbitrary */
default:
- return 0;
+ return 10;
}
}
diff --git a/src/gallium/drivers/softpipe/sp_fs_exec.c b/src/gallium/drivers/softpipe/sp_fs_exec.c
index 701ee4c72f..ffc0c5e578 100644
--- a/src/gallium/drivers/softpipe/sp_fs_exec.c
+++ b/src/gallium/drivers/softpipe/sp_fs_exec.c
@@ -39,11 +39,20 @@
#include "tgsi/tgsi_exec.h"
#include "tgsi/tgsi_parse.h"
-struct sp_exec_fragment_shader {
+struct sp_exec_fragment_shader
+{
struct sp_fragment_shader base;
+ struct tgsi_token *machine_tokens;
};
+/** cast wrapper */
+static INLINE struct sp_exec_fragment_shader *
+sp_exec_fragment_shader(struct sp_fragment_shader *base)
+{
+ return (struct sp_exec_fragment_shader *) base;
+}
+
/**
* Compute quad X,Y,Z,W for the four fragments in a quad.
@@ -86,10 +95,20 @@ exec_prepare( const struct sp_fragment_shader *base,
struct tgsi_exec_machine *machine,
struct tgsi_sampler *samplers )
{
- tgsi_exec_machine_bind_shader( machine,
- base->shader.tokens,
- PIPE_MAX_SAMPLERS,
- samplers );
+ struct sp_exec_fragment_shader *spefs =
+ sp_exec_fragment_shader(base);
+
+ /*
+ * Bind tokens/shader to the interpreter's machine state.
+ * Avoid redundant binding.
+ */
+ if (spefs->machine_tokens != base->shader.tokens) {
+ tgsi_exec_machine_bind_shader( machine,
+ base->shader.tokens,
+ PIPE_MAX_SAMPLERS,
+ samplers );
+ spefs->machine_tokens = base->shader.tokens;
+ }
}
--
cgit v1.2.3
From f631093ce76ad14dee63293761d7da7b7b42fc6d Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 08:17:02 -0600
Subject: cell: example of doing fs/fm sequence with fnms in blending
---
src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
index 99407b8ace..2c80dd712e 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
@@ -623,6 +623,7 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term2B_reg, fbB_reg, fragA_reg);
break;
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+#if 0
/* one = {1.0, 1.0, 1.0, 1.0} */
if (!one_reg_set) {
one_reg = spe_allocate_available_register(f);
@@ -635,6 +636,15 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term2R_reg, fbR_reg, tmp_reg);
spe_fm(f, term2G_reg, fbG_reg, tmp_reg);
spe_fm(f, term2B_reg, fbB_reg, tmp_reg);
+#else
+ /* Compute: term2x = fbx * (1.0 - fragA)
+ * Which is: term2x = fbx - fbx * fragA
+ * Use fnms t,a,b,c which computes t=c-a*b
+ */
+ spe_fnms(f, term2R_reg, fbR_reg, fragA_reg, fbR_reg);
+ spe_fnms(f, term2G_reg, fbG_reg, fragA_reg, fbG_reg);
+ spe_fnms(f, term2B_reg, fbB_reg, fragA_reg, fbB_reg);
+#endif
break;
/* XXX more cases */
// GL_ONE_MINUS_SRC_COLOR
@@ -663,6 +673,7 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term2A_reg, fbA_reg, fragA_reg);
break;
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
+#if 0
/* one = {1.0, 1.0, 1.0, 1.0} */
if (!one_reg_set) {
one_reg = spe_allocate_available_register(f);
@@ -673,6 +684,13 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fs(f, tmp_reg, one_reg, fragA_reg);
/* termA = fbA * tmp */
spe_fm(f, term2A_reg, fbA_reg, tmp_reg);
+#else
+ /* Compute: term2A = fbA * (1.0 - fragA)
+ * Which is: term2A = fbA - fbA * fragA
+ * Use fnms t,a,b,c which computes t=c-a*b
+ */
+ spe_fnms(f, term2A_reg, fbA_reg, fragA_reg, fbA_reg);
+#endif
break;
/* XXX more cases */
// GL_ONE_MINUS_SRC_COLOR
--
cgit v1.2.3
From 0d20c88f626dfcfd8ad0b95f9e05feed19151e35 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 09:05:04 -0600
Subject: mesa: fix bug in previous changes to _slang_resolve_attributes()
---
src/mesa/shader/slang/slang_link.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 30035b4fee..a6390846b2 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -275,7 +275,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
const char *name = origProg->Attributes->Parameters[k].Name;
const GLint size = origProg->Attributes->Parameters[k].Size;
const GLenum type =origProg->Attributes->Parameters[k].DataType;
- GLint index, attr;
+ GLint index;
/* See if there's a user-defined attribute binding for
* this name.
@@ -313,6 +313,8 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
size, type, attr);
}
+ assert(attr >= 0);
+
/* update the instruction's src reg */
inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + attr;
}
--
cgit v1.2.3
From 5e530d8384b0d9bb867d6407315587c84a443902 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 09:05:04 -0600
Subject: mesa: fix bug in previous changes to _slang_resolve_attributes()
---
src/mesa/shader/slang/slang_link.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index 30035b4fee..a6390846b2 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -275,7 +275,7 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
const char *name = origProg->Attributes->Parameters[k].Name;
const GLint size = origProg->Attributes->Parameters[k].Size;
const GLenum type =origProg->Attributes->Parameters[k].DataType;
- GLint index, attr;
+ GLint index;
/* See if there's a user-defined attribute binding for
* this name.
@@ -313,6 +313,8 @@ _slang_resolve_attributes(struct gl_shader_program *shProg,
size, type, attr);
}
+ assert(attr >= 0);
+
/* update the instruction's src reg */
inst->SrcReg[j].Index = VERT_ATTRIB_GENERIC0 + attr;
}
--
cgit v1.2.3
From f10e7f0d288530a31a7ed3bc976a537fe640ce69 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 09:47:51 -0600
Subject: gallium: fix lack of surface reference counting in
cso_set/save/restore_framebuffer()
Fixes asst problems with FBO / render to texture.
---
src/gallium/auxiliary/cso_cache/cso_context.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index f22ba40824..b1ccfc0374 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -765,12 +765,30 @@ void cso_restore_vertex_shader(struct cso_context *ctx)
}
+/**
+ * Copy framebuffer state from src to dst with refcounting of surfaces.
+ */
+static void
+copy_framebuffer_state(struct pipe_framebuffer_state *dst,
+ const struct pipe_framebuffer_state *src)
+{
+ uint i;
+
+ dst->width = src->width;
+ dst->height = src->height;
+ dst->num_cbufs = src->num_cbufs;
+ for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&dst->cbufs[i], src->cbufs[i]);
+ }
+ pipe_surface_reference(&dst->zsbuf, src->zsbuf);
+}
+
enum pipe_error cso_set_framebuffer(struct cso_context *ctx,
const struct pipe_framebuffer_state *fb)
{
if (memcmp(&ctx->fb, fb, sizeof(*fb)) != 0) {
- ctx->fb = *fb;
+ copy_framebuffer_state(&ctx->fb, fb);
ctx->pipe->set_framebuffer_state(ctx->pipe, fb);
}
return PIPE_OK;
@@ -778,13 +796,13 @@ enum pipe_error cso_set_framebuffer(struct cso_context *ctx,
void cso_save_framebuffer(struct cso_context *ctx)
{
- ctx->fb_saved = ctx->fb;
+ copy_framebuffer_state(&ctx->fb_saved, &ctx->fb);
}
void cso_restore_framebuffer(struct cso_context *ctx)
{
if (memcmp(&ctx->fb, &ctx->fb_saved, sizeof(ctx->fb))) {
- ctx->fb = ctx->fb_saved;
+ copy_framebuffer_state(&ctx->fb, &ctx->fb_saved);
ctx->pipe->set_framebuffer_state(ctx->pipe, &ctx->fb);
}
}
--
cgit v1.2.3
From f8a5cb8cb2fde732016888a2554872d702803c01 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Wed, 17 Sep 2008 18:08:03 +0200
Subject: tgsi: More debug printing on sanity check error
---
src/mesa/state_tracker/st_mesa_to_tgsi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index e822c8ac61..49abee15a1 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -984,9 +984,12 @@ tgsi_translate_mesa_program(
#if DEBUG
if(!tgsi_sanity_check(tokens)) {
- //debug_printf("Due to sanity check failure the following shader program is invalid\n");
+ debug_printf("Due to sanity check failure(s) above the following shader program is invalid:\n");
+ debug_printf("\nOriginal program:\n%s", program->String);
+ debug_printf("\nMesa program:\n");
+ _mesa_print_program(program);
+ debug_printf("\nTGSI program:\n");
tgsi_dump(tokens, 0);
-
assert(0);
}
#endif
--
cgit v1.2.3
From ec8398d62f5e5084e9eeb98ed55324ab98214248 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Wed, 17 Sep 2008 18:11:35 +0200
Subject: tgsi: Add a ugly fix for CONSTANT problems
---
src/mesa/state_tracker/st_mesa_to_tgsi.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 49abee15a1..ff0bc04619 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -241,6 +241,15 @@ compile_instruction(
immediateMapping,
indirectAccess );
+ /**
+ * This not at all the correct solution.
+ * FIXME: Roll this up in the above map functions
+ */
+ if (fullsrc->SrcRegister.File == TGSI_FILE_IMMEDIATE && fullsrc->SrcRegister.Index == ~0) {
+ fullsrc->SrcRegister.File = TGSI_FILE_CONSTANT;
+ fullsrc->SrcRegister.Index = inst->SrcReg[i].Index;
+ }
+
/* swizzle (ext swizzle also depends on negation) */
{
GLuint swz[4];
--
cgit v1.2.3
From 63b915d743e1807696a55f5e52a1fe9df799aeb3 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 10:20:49 -0600
Subject: gallium: new assertion on surface->texture
---
src/mesa/state_tracker/st_cb_fbo.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 8406bf247f..00076f61e0 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -170,6 +170,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
0, 0, 0,
surface_usage );
+ assert(strb->surface->texture);
assert(strb->surface->buffer);
assert(strb->surface->format);
assert(strb->surface->block.size);
--
cgit v1.2.3
From 66682651b622be201b211d50c7311e0b81b2b4a5 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 10:22:38 -0600
Subject: gallium: need to finish, not flush, in st_copy_texsubimage()
---
src/mesa/state_tracker/st_cb_texture.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 2ba3766939..2e1ad93942 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1053,7 +1053,8 @@ st_copy_texsubimage(GLcontext *ctx,
GLboolean use_fallback = GL_TRUE;
GLboolean matching_base_formats;
- st_flush(ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL);
+ /* any rendering in progress must complete before we grab the fb image */
+ st_finish(ctx->st);
/* determine if copying depth or color data */
if (texBaseFormat == GL_DEPTH_COMPONENT) {
--
cgit v1.2.3
From 095ca0acd8019e8f2da89f9320b92ce4a96a140e Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 10:25:18 -0600
Subject: gallium: include prog_print.h to silence warning
---
src/mesa/state_tracker/st_mesa_to_tgsi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index ff0bc04619..b9807bb807 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -40,6 +40,7 @@
#include "st_mesa_to_tgsi.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
#include "pipe/p_debug.h"
/*
--
cgit v1.2.3
From 133693ebe8904de785610efd38219bca67b75222 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 13:13:02 -0600
Subject: mesa: update program->NumAddressRegs field in
_slang_update_inputs_outputs()
---
src/mesa/shader/slang/slang_link.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index a6390846b2..a44d001477 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -363,6 +363,7 @@ static void
_slang_update_inputs_outputs(struct gl_program *prog)
{
GLuint i, j;
+ GLuint maxAddrReg = 0;
prog->InputsRead = 0x0;
prog->OutputsWritten = 0x0;
@@ -374,11 +375,19 @@ _slang_update_inputs_outputs(struct gl_program *prog)
if (inst->SrcReg[j].File == PROGRAM_INPUT) {
prog->InputsRead |= 1 << inst->SrcReg[j].Index;
}
+ else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) {
+ maxAddrReg = MAX2(maxAddrReg, inst->SrcReg[j].Index + 1);
+ }
}
if (inst->DstReg.File == PROGRAM_OUTPUT) {
prog->OutputsWritten |= 1 << inst->DstReg.Index;
}
+ else if (inst->DstReg.File == PROGRAM_ADDRESS) {
+ maxAddrReg = MAX2(maxAddrReg, inst->DstReg.Index + 1);
+ }
}
+
+ prog->NumAddressRegs = maxAddrReg;
}
--
cgit v1.2.3
From e6a120fefea44078b3a8d4292d83671e6c41357f Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 13:14:57 -0600
Subject: gallium: fix tgsi sanity checker with respect to END.
Subroutine code may be found after the END instruction so it's not always
the last instruction.
At least check for presence of exactly one END instruction though.
---
src/gallium/auxiliary/tgsi/tgsi_sanity.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
index 20b32477be..11659247c0 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c
@@ -180,12 +180,10 @@ iter_instruction(
const struct tgsi_opcode_info *info;
uint i;
- /* There must be no other instructions after END.
- */
- if (ctx->index_of_END != ~0) {
- report_error( ctx, "Unexpected instruction after END" );
- }
- else if (inst->Instruction.Opcode == TGSI_OPCODE_END) {
+ if (inst->Instruction.Opcode == TGSI_OPCODE_END) {
+ if (ctx->index_of_END != ~0) {
+ report_error( ctx, "Too many END instructions" );
+ }
ctx->index_of_END = ctx->num_instructions;
}
@@ -307,10 +305,10 @@ epilog(
struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
uint file;
- /* There must be an END instruction at the end.
+ /* There must be an END instruction somewhere.
*/
- if (ctx->index_of_END == ~0 || ctx->index_of_END != ctx->num_instructions - 1) {
- report_error( ctx, "Expected END at end of instruction sequence" );
+ if (ctx->index_of_END == ~0) {
+ report_error( ctx, "Missing END instruction" );
}
/* Check if all declared registers were used.
--
cgit v1.2.3
From 1a820f52f6fa125786538c1adf2aa350e66b8c1e Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 14:32:33 -0600
Subject: gallium: clean-up/fix msaa override in state tracker
---
src/mesa/state_tracker/st_atom_rasterizer.c | 2 +-
src/mesa/state_tracker/st_context.c | 15 +++++++++++++++
src/mesa/state_tracker/st_context.h | 6 ++++++
src/mesa/state_tracker/st_framebuffer.c | 11 +++++------
4 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index e286dc5116..fc47896c24 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -254,7 +254,7 @@ static void update_raster_state( struct st_context *st )
raster->line_stipple_factor = ctx->Line.StippleFactor - 1;
/* _NEW_MULTISAMPLE */
- if (ctx->Multisample._Enabled)
+ if (ctx->Multisample._Enabled || st->force_msaa)
raster->multisample = 1;
/* _NEW_SCISSOR */
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 534c7c12ac..cca808d328 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -88,6 +88,19 @@ void st_invalidate_state(GLcontext * ctx, GLuint new_state)
}
+/**
+ * Check for multisample env var override.
+ */
+int
+st_get_msaa(void)
+{
+ const char *msaa = _mesa_getenv("__GL_FSAA_MODE");
+ if (msaa)
+ return atoi(msaa);
+ return 0;
+}
+
+
static struct st_context *
st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
{
@@ -141,6 +154,8 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
st->pixel_xfer.cache = _mesa_new_program_cache();
+ st->force_msaa = st_get_msaa();
+
/* GL limits and extensions */
st_init_limits(st);
st_init_extensions(st);
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 4314d9af5c..1d1aca3111 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -181,6 +181,8 @@ struct st_context
struct blit_state *blit;
struct cso_context *cso_context;
+
+ int force_msaa;
};
@@ -238,4 +240,8 @@ st_fb_orientation(const struct gl_framebuffer *fb)
}
+extern int
+st_get_msaa(void);
+
+
#endif
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index 0f4a03fa48..ec8928f200 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -51,13 +51,12 @@ st_create_framebuffer( const __GLcontextModes *visual,
{
struct st_framebuffer *stfb = CALLOC_STRUCT(st_framebuffer);
if (stfb) {
- int samples = 0;
- const char *msaa_override = _mesa_getenv("__GL_FSAA_MODE");
+ int samples = st_get_msaa();
+
+ if (visual->sampleBuffers)
+ samples = visual->samples;
+
_mesa_initialize_framebuffer(&stfb->Base, visual);
- if (visual->sampleBuffers) samples = visual->samples;
- if (msaa_override) {
- samples = _mesa_atoi(msaa_override);
- }
{
/* fake frontbuffer */
--
cgit v1.2.3
From 3b3d34d637d413af48fa5bd037b579ccb4ea7bb5 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 15:29:59 -0600
Subject: egl: print multisample info
---
progs/egl/eglinfo.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/progs/egl/eglinfo.c b/progs/egl/eglinfo.c
index 89feec9be4..14620a9759 100644
--- a/progs/egl/eglinfo.c
+++ b/progs/egl/eglinfo.c
@@ -48,9 +48,9 @@ PrintConfigs(EGLDisplay d)
eglGetConfigs(d, configs, MAX_CONFIGS, &numConfigs);
printf("Configurations:\n");
- printf(" bf lv d st colorbuffer dp st vis supported\n");
- printf(" id sz l b ro r g b a th cl id surfaces \n");
- printf("---------------------------------------------------\n");
+ printf(" bf lv d st colorbuffer dp st ms vis supported\n");
+ printf(" id sz l b ro r g b a th cl ns b id surfaces \n");
+ printf("--------------------------------------------------------\n");
for (i = 0; i < numConfigs; i++) {
EGLint id, size, level;
EGLint red, green, blue, alpha;
@@ -58,6 +58,7 @@ PrintConfigs(EGLDisplay d)
EGLint surfaces;
EGLint doubleBuf = 1, stereo = 0;
EGLint vid;
+ EGLint samples, sampleBuffers;
char surfString[100] = "";
eglGetConfigAttrib(d, configs[i], EGL_CONFIG_ID, &id);
@@ -73,6 +74,9 @@ PrintConfigs(EGLDisplay d)
eglGetConfigAttrib(d, configs[i], EGL_NATIVE_VISUAL_ID, &vid);
eglGetConfigAttrib(d, configs[i], EGL_SURFACE_TYPE, &surfaces);
+ eglGetConfigAttrib(d, configs[i], EGL_SAMPLES, &samples);
+ eglGetConfigAttrib(d, configs[i], EGL_SAMPLE_BUFFERS, &sampleBuffers);
+
if (surfaces & EGL_WINDOW_BIT)
strcat(surfString, "win,");
if (surfaces & EGL_PBUFFER_BIT)
@@ -86,12 +90,13 @@ PrintConfigs(EGLDisplay d)
if (strlen(surfString) > 0)
surfString[strlen(surfString) - 1] = 0;
- printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d 0x%02x %-12s\n",
+ printf("0x%02x %2d %2d %c %c %2d %2d %2d %2d %2d %2d %2d%2d 0x%02x %-12s\n",
id, size, level,
doubleBuf ? 'y' : '.',
stereo ? 'y' : '.',
red, green, blue, alpha,
- depth, stencil, vid, surfString);
+ depth, stencil,
+ samples, sampleBuffers, vid, surfString);
}
}
--
cgit v1.2.3
From d7a7b0a10dd355fbeb7a404091a42d4ab558c820 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 16:48:13 -0600
Subject: mesa: new gl_fragment_program fields indicating use of fog,
front-facing, point coord
---
src/mesa/main/mtypes.h | 5 +++-
src/mesa/shader/slang/slang_link.c | 50 ++++++++++++++++++++++++--------------
2 files changed, 36 insertions(+), 19 deletions(-)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2fc169493b..a5e1cf6a27 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1953,7 +1953,10 @@ struct gl_fragment_program
{
struct gl_program Base; /**< base class */
GLenum FogOption;
- GLboolean UsesKill;
+ GLboolean UsesKill; /**< shader uses KIL instruction */
+ GLboolean UsesPointCoord; /**< shader uses gl_PointCoord */
+ GLboolean UsesFrontFacing; /**< shader used gl_FrontFacing */
+ GLboolean UsesFogFragCoord; /**< shader used gl_FogFragCoord */
};
diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c
index a44d001477..dd7d5be6d8 100644
--- a/src/mesa/shader/slang/slang_link.c
+++ b/src/mesa/shader/slang/slang_link.c
@@ -42,6 +42,24 @@
#include "slang_link.h"
+/** cast wrapper */
+static struct gl_vertex_program *
+vertex_program(struct gl_program *prog)
+{
+ assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
+ return (struct gl_vertex_program *) prog;
+}
+
+
+/** cast wrapper */
+static struct gl_fragment_program *
+fragment_program(struct gl_program *prog)
+{
+ assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB);
+ return (struct gl_fragment_program *) prog;
+}
+
+
/**
* Record a linking error.
*/
@@ -374,6 +392,20 @@ _slang_update_inputs_outputs(struct gl_program *prog)
for (j = 0; j < numSrc; j++) {
if (inst->SrcReg[j].File == PROGRAM_INPUT) {
prog->InputsRead |= 1 << inst->SrcReg[j].Index;
+ if (prog->Target == GL_FRAGMENT_PROGRAM_ARB &&
+ inst->SrcReg[j].Index == FRAG_ATTRIB_FOGC) {
+ /* The fragment shader FOGC input is used for fog,
+ * front-facing and sprite/point coord.
+ */
+ struct gl_fragment_program *fp = fragment_program(prog);
+ const GLint swz = GET_SWZ(inst->SrcReg[j].Swizzle, 0);
+ if (swz == SWIZZLE_X)
+ fp->UsesFogFragCoord = GL_TRUE;
+ else if (swz == SWIZZLE_Y)
+ fp->UsesFrontFacing = GL_TRUE;
+ else if (swz == SWIZZLE_Z || swz == SWIZZLE_W)
+ fp->UsesPointCoord = GL_TRUE;
+ }
}
else if (inst->SrcReg[j].File == PROGRAM_ADDRESS) {
maxAddrReg = MAX2(maxAddrReg, inst->SrcReg[j].Index + 1);
@@ -391,24 +423,6 @@ _slang_update_inputs_outputs(struct gl_program *prog)
}
-/** cast wrapper */
-static struct gl_vertex_program *
-vertex_program(struct gl_program *prog)
-{
- assert(prog->Target == GL_VERTEX_PROGRAM_ARB);
- return (struct gl_vertex_program *) prog;
-}
-
-
-/** cast wrapper */
-static struct gl_fragment_program *
-fragment_program(struct gl_program *prog)
-{
- assert(prog->Target == GL_FRAGMENT_PROGRAM_ARB);
- return (struct gl_fragment_program *) prog;
-}
-
-
/**
* Shader linker. Currently:
*
--
cgit v1.2.3
From 4ee8d1ad679ea8540e91616933a880cdb3836a19 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 16:49:26 -0600
Subject: gallium: fix fog vs. pointcoord attribute handling in mesa->TGSI
conversion
---
src/mesa/state_tracker/st_program.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 936a6e32ea..b2abf0286e 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -409,7 +409,10 @@ st_translate_fragment_program(struct st_context *st,
interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
break;
case FRAG_ATTRIB_FOGC:
- stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
+ if (stfp->Base.UsesPointCoord)
+ stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ else
+ stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
stfp->input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
break;
--
cgit v1.2.3
From a06d38a74e865a0373a7314aad26b25c27ef8c57 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Wed, 17 Sep 2008 16:51:53 -0600
Subject: gallium: fix wide point / point coord semantic info (generic, not
fog)
---
src/gallium/auxiliary/draw/draw_pipe_wide_point.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
index 4f1326053d..e1af9e56a2 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_wide_point.c
@@ -222,8 +222,8 @@ static void widepoint_first_point( struct draw_stage *stage,
/* find fragment shader PointCoord/Fog input */
wide->point_coord_fs_input = 0; /* XXX fix this! */
- /* setup extra vp output */
- draw->extra_vp_outputs.semantic_name = TGSI_SEMANTIC_FOG;
+ /* setup extra vp output (point coord implemented as a texcoord) */
+ draw->extra_vp_outputs.semantic_name = TGSI_SEMANTIC_GENERIC;
draw->extra_vp_outputs.semantic_index = 0;
draw->extra_vp_outputs.slot = draw->vs.num_vs_outputs;
}
--
cgit v1.2.3
From 1672e8e05996d48e51a1998bd7e9b08b78e012f5 Mon Sep 17 00:00:00 2001
From: José Fonseca
Date: Thu, 18 Sep 2008 11:10:09 +0900
Subject: pipebuffer: New callback to flush all temporary-held buffers.
Used mostly to aid debugging memory issues or to clean up resources when
the drivers are long lived.
---
.../auxiliary/pipebuffer/pb_buffer_malloc.c | 14 +++++++++---
src/gallium/auxiliary/pipebuffer/pb_bufmgr.h | 14 ++++++++----
src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c | 16 +++++++++++++
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 11 ++++++---
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 11 +++++++++
.../auxiliary/pipebuffer/pb_bufmgr_fenced.c | 14 ++++++++++++
src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c | 10 ++++++++-
src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c | 8 +++++++
src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c | 26 ++++++++++++++++++++++
9 files changed, 113 insertions(+), 11 deletions(-)
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
index 20fc87b39d..1bf22a2ec0 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
@@ -129,7 +129,7 @@ pb_malloc_buffer_create(size_t size,
static struct pb_buffer *
-pb_malloc_buffer_create_buffer(struct pb_manager *mgr,
+pb_malloc_bufmgr_create_buffer(struct pb_manager *mgr,
size_t size,
const struct pb_desc *desc)
{
@@ -137,6 +137,13 @@ pb_malloc_buffer_create_buffer(struct pb_manager *mgr,
}
+static void
+pb_malloc_bufmgr_flush(struct pb_manager *mgr)
+{
+ /* No-op */
+}
+
+
static void
pb_malloc_bufmgr_destroy(struct pb_manager *mgr)
{
@@ -146,8 +153,9 @@ pb_malloc_bufmgr_destroy(struct pb_manager *mgr)
static struct pb_manager
pb_malloc_bufmgr = {
- pb_malloc_buffer_create_buffer,
- pb_malloc_bufmgr_destroy
+ pb_malloc_bufmgr_destroy,
+ pb_malloc_bufmgr_create_buffer,
+ pb_malloc_bufmgr_flush
};
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
index 32867029ee..cafbee045a 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr.h
@@ -69,13 +69,22 @@ struct pipe_winsys;
*/
struct pb_manager
{
+ void
+ (*destroy)( struct pb_manager *mgr );
+
struct pb_buffer *
(*create_buffer)( struct pb_manager *mgr,
size_t size,
const struct pb_desc *desc);
+ /**
+ * Flush all temporary-held buffers.
+ *
+ * Used mostly to aid debugging memory issues or to clean up resources when
+ * the drivers are long lived.
+ */
void
- (*destroy)( struct pb_manager *mgr );
+ (*flush)( struct pb_manager *mgr );
};
@@ -153,9 +162,6 @@ struct pb_manager *
pb_cache_manager_create(struct pb_manager *provider,
unsigned usecs);
-void
-pb_cache_flush(struct pb_manager *mgr);
-
/**
* Fenced buffer manager.
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c
index 2afaeafa1a..c956924cc7 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c
@@ -75,6 +75,21 @@ pb_alt_manager_create_buffer(struct pb_manager *_mgr,
}
+static void
+pb_alt_manager_flush(struct pb_manager *_mgr)
+{
+ struct pb_alt_manager *mgr = pb_alt_manager(_mgr);
+
+ assert(mgr->provider1->flush);
+ if(mgr->provider1->flush)
+ mgr->provider1->flush(mgr->provider1);
+
+ assert(mgr->provider2->flush);
+ if(mgr->provider2->flush)
+ mgr->provider2->flush(mgr->provider2);
+}
+
+
static void
pb_alt_manager_destroy(struct pb_manager *mgr)
{
@@ -97,6 +112,7 @@ pb_alt_manager_create(struct pb_manager *provider1,
mgr->base.destroy = pb_alt_manager_destroy;
mgr->base.create_buffer = pb_alt_manager_create_buffer;
+ mgr->base.flush = pb_alt_manager_flush;
mgr->provider1 = provider1;
mgr->provider2 = provider2;
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
index 1ec422fb19..8f118874ec 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
@@ -306,8 +306,8 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
}
-void
-pb_cache_flush(struct pb_manager *_mgr)
+static void
+pb_cache_manager_flush(struct pb_manager *_mgr)
{
struct pb_cache_manager *mgr = pb_cache_manager(_mgr);
struct list_head *curr, *next;
@@ -323,13 +323,17 @@ pb_cache_flush(struct pb_manager *_mgr)
next = curr->next;
}
pipe_mutex_unlock(mgr->mutex);
+
+ assert(mgr->provider->flush);
+ if(mgr->provider->flush)
+ mgr->provider->flush(mgr->provider);
}
static void
pb_cache_manager_destroy(struct pb_manager *mgr)
{
- pb_cache_flush(mgr);
+ pb_cache_manager_flush(mgr);
FREE(mgr);
}
@@ -349,6 +353,7 @@ pb_cache_manager_create(struct pb_manager *provider,
mgr->base.destroy = pb_cache_manager_destroy;
mgr->base.create_buffer = pb_cache_manager_create_buffer;
+ mgr->base.flush = pb_cache_manager_flush;
mgr->provider = provider;
mgr->usecs = usecs;
LIST_INITHEAD(&mgr->delayed);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
index 5f1ed3e5a8..1675e6e182 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
@@ -313,6 +313,16 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr,
}
+static void
+pb_debug_manager_flush(struct pb_manager *_mgr)
+{
+ struct pb_debug_manager *mgr = pb_debug_manager(_mgr);
+ assert(mgr->provider->flush);
+ if(mgr->provider->flush)
+ mgr->provider->flush(mgr->provider);
+}
+
+
static void
pb_debug_manager_destroy(struct pb_manager *_mgr)
{
@@ -336,6 +346,7 @@ pb_debug_manager_create(struct pb_manager *provider, size_t band_size)
mgr->base.destroy = pb_debug_manager_destroy;
mgr->base.create_buffer = pb_debug_manager_create_buffer;
+ mgr->base.flush = pb_debug_manager_flush;
mgr->provider = provider;
mgr->band_size = band_size;
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
index 8fc63ce648..633ee70a75 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
@@ -94,6 +94,19 @@ fenced_bufmgr_create_buffer(struct pb_manager *mgr,
}
+static void
+fenced_bufmgr_flush(struct pb_manager *mgr)
+{
+ struct fenced_pb_manager *fenced_mgr = fenced_pb_manager(mgr);
+
+ fenced_buffer_list_check_free(fenced_mgr->fenced_list, TRUE);
+
+ assert(fenced_mgr->provider->flush);
+ if(fenced_mgr->provider->flush)
+ fenced_mgr->provider->flush(fenced_mgr->provider);
+}
+
+
static void
fenced_bufmgr_destroy(struct pb_manager *mgr)
{
@@ -123,6 +136,7 @@ fenced_bufmgr_create(struct pb_manager *provider,
fenced_mgr->base.destroy = fenced_bufmgr_destroy;
fenced_mgr->base.create_buffer = fenced_bufmgr_create_buffer;
+ fenced_mgr->base.flush = fenced_bufmgr_flush;
fenced_mgr->provider = provider;
fenced_mgr->fenced_list = fenced_buffer_list_create(winsys);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
index e8c7f8e1f8..fe80ca30ee 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
@@ -199,6 +199,13 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
}
+static void
+mm_bufmgr_flush(struct pb_manager *mgr)
+{
+ /* No-op */
+}
+
+
static void
mm_bufmgr_destroy(struct pb_manager *mgr)
{
@@ -230,8 +237,9 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer,
if (!mm)
return NULL;
- mm->base.create_buffer = mm_bufmgr_create_buffer;
mm->base.destroy = mm_bufmgr_destroy;
+ mm->base.create_buffer = mm_bufmgr_create_buffer;
+ mm->base.flush = mm_bufmgr_flush;
mm->size = size;
mm->align2 = align2; /* 64-byte alignment */
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
index 3ef72c5bbb..61ac291ed7 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
@@ -202,6 +202,13 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
}
+static void
+pool_bufmgr_flush(struct pb_manager *mgr)
+{
+ /* No-op */
+}
+
+
static void
pool_bufmgr_destroy(struct pb_manager *mgr)
{
@@ -238,6 +245,7 @@ pool_bufmgr_create(struct pb_manager *provider,
pool->base.destroy = pool_bufmgr_destroy;
pool->base.create_buffer = pool_bufmgr_create_buffer;
+ pool->base.flush = pool_bufmgr_flush;
LIST_INITHEAD(&pool->free);
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
index 8698c4cff6..2a80154920 100644
--- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
+++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
@@ -406,6 +406,17 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr,
}
+static void
+pb_slab_manager_flush(struct pb_manager *_mgr)
+{
+ struct pb_slab_manager *mgr = pb_slab_manager(_mgr);
+
+ assert(mgr->provider->flush);
+ if(mgr->provider->flush)
+ mgr->provider->flush(mgr->provider);
+}
+
+
static void
pb_slab_manager_destroy(struct pb_manager *_mgr)
{
@@ -430,6 +441,7 @@ pb_slab_manager_create(struct pb_manager *provider,
mgr->base.destroy = pb_slab_manager_destroy;
mgr->base.create_buffer = pb_slab_manager_create_buffer;
+ mgr->base.flush = pb_slab_manager_flush;
mgr->provider = provider;
mgr->bufSize = bufSize;
@@ -465,6 +477,19 @@ pb_slab_range_manager_create_buffer(struct pb_manager *_mgr,
}
+static void
+pb_slab_range_manager_flush(struct pb_manager *_mgr)
+{
+ struct pb_slab_range_manager *mgr = pb_slab_range_manager(_mgr);
+
+ /* Individual slabs don't hold any temporary buffers so no need to call them */
+
+ assert(mgr->provider->flush);
+ if(mgr->provider->flush)
+ mgr->provider->flush(mgr->provider);
+}
+
+
static void
pb_slab_range_manager_destroy(struct pb_manager *_mgr)
{
@@ -499,6 +524,7 @@ pb_slab_range_manager_create(struct pb_manager *provider,
mgr->base.destroy = pb_slab_range_manager_destroy;
mgr->base.create_buffer = pb_slab_range_manager_create_buffer;
+ mgr->base.flush = pb_slab_range_manager_flush;
mgr->provider = provider;
mgr->minBufSize = minBufSize;
--
cgit v1.2.3
From f8bba34d4e12ef4c620cac881a4b697a1e668377 Mon Sep 17 00:00:00 2001
From: Robert Ellison
Date: Thu, 18 Sep 2008 01:29:41 -0600
Subject: CELL: finish fragment ops blending (except for unusual D3D modes)
- Added new "macro" functions spe_float_min() and spe_float_max()
to rtasm_ppc_spe.{ch}. These emit instructions that cause
the minimum or maximum of each element in a vector of floats
to be saved in the destination register.
- Major changes to cell_gen_fragment.c to implement all the blending
modes (except for the mysterious D3D-based PIPE_BLENDFACTOR_SRC1_COLOR,
PIPE_BLENDFACTOR_SRC1_ALPHA, PIPE_BLENDFACTOR_INV_SRC1_COLOR, and
PIPE_BLENDFACTOR_INV_SRC1_ALPHA).
- Some revamping of code in cell_gen_fragment.c: use the new spe_float_min()
and spe_float_max() functions (instead of expanding these calculations
inline via macros); create and use an inline utility function for handling
"optional" register allocation (for the {1,1,1,1} vector, and the
blend color vectors) instead of expanding with macros; use the Float
Multiply and Subtract (fnms) instruction to simplify and optimize many
blending calculations.
---
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c | 41 +-
src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h | 8 +
src/gallium/drivers/cell/ppu/cell_gen_fragment.c | 546 ++++++++++++++---------
3 files changed, 377 insertions(+), 218 deletions(-)
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
index 870ae802c5..12e0826fb9 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.c
@@ -384,7 +384,7 @@ void spe_release_func(struct spe_function *p)
/**
- * Alloate a SPE register.
+ * Allocate a SPE register.
* \return register index or -1 if none left.
*/
int spe_allocate_available_register(struct spe_function *p)
@@ -646,5 +646,44 @@ spe_splat_word(struct spe_function *p, unsigned rT, unsigned rA, int word)
}
}
+/* For each 32-bit float element of rA and rB, choose the smaller of the
+ * two, compositing them into the rT register.
+ *
+ * The Float Compare Greater Than (fcgt) instruction will put 1s into
+ * compare_reg where rA > rB, and 0s where rA <= rB.
+ *
+ * Then the Select Bits (selb) instruction will take bits from rA where
+ * compare_reg is 0, and from rB where compare_reg is 1; i.e., from rA
+ * where rA <= rB and from rB where rB > rA, which is exactly the
+ * "min" operation.
+ *
+ * The compare_reg could in many cases be the same as rT, unless
+ * rT == rA || rt == rB. But since this is common in constructions
+ * like "x = min(x, a)", we always allocate a new register to be safe.
+ */
+void
+spe_float_min(struct spe_function *p, unsigned int rT, unsigned int rA, unsigned int rB)
+{
+ unsigned int compare_reg = spe_allocate_available_register(p);
+ spe_fcgt(p, compare_reg, rA, rB);
+ spe_selb(p, rT, rA, rB, compare_reg);
+ spe_release_register(p, compare_reg);
+}
+
+/* For each 32-bit float element of rA and rB, choose the greater of the
+ * two, compositing them into the rT register.
+ *
+ * The logic is similar to that of spe_float_min() above; the only
+ * difference is that the registers on spe_selb() have been reversed,
+ * so that the larger of the two is selected instead of the smaller.
+ */
+void
+spe_float_max(struct spe_function *p, unsigned int rT, unsigned int rA, unsigned int rB)
+{
+ unsigned int compare_reg = spe_allocate_available_register(p);
+ spe_fcgt(p, compare_reg, rA, rB);
+ spe_selb(p, rT, rB, rA, compare_reg);
+ spe_release_register(p, compare_reg);
+}
#endif /* GALLIUM_CELL */
diff --git a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
index 2579045232..4ef05ea27d 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
+++ b/src/gallium/auxiliary/rtasm/rtasm_ppc_spe.h
@@ -322,6 +322,14 @@ spe_zero(struct spe_function *p, unsigned rT);
extern void
spe_splat_word(struct spe_function *p, unsigned rT, unsigned rA, int word);
+/** rT = float min(rA, rB) */
+extern void
+spe_float_min(struct spe_function *p, unsigned rT, unsigned rA, unsigned rB);
+
+/** rT = float max(rA, rB) */
+extern void
+spe_float_max(struct spe_function *p, unsigned rT, unsigned rA, unsigned rB);
+
/* Floating-point instructions
*/
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
index 2c80dd712e..9d25e820ad 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fragment.c
@@ -229,35 +229,26 @@ gen_alpha_test(const struct pipe_depth_stencil_alpha_state *dsa,
spe_release_register(f, amask_reg);
}
-/* This is a convenient and oft-used sequence. It chooses
- * the smaller of each element of reg1 and reg2, and combines them
- * into the result register, as follows:
- *
- * The Float Compare Greater Than (fcgt) instruction will put
- * 1s into compare_reg where reg1 > reg2, and 0s where reg1 <= reg2.
- *
- * Then the Select Bits (selb) instruction will take bits from
- * reg1 where compare_reg is 0, and from reg2 where compare_reg is
- * 1. Ergo, result_reg will have the bits from reg1 where reg1 <= reg2,
- * and the bits from reg2 where reg1 > reg2, which is exactly the
- * MIN operation.
+/* This pair of functions is used inline to allocate and deallocate
+ * optional constant registers. Once a constant is discovered to be
+ * needed, we will likely need it again, so we don't want to deallocate
+ * it and have to allocate and load it again unnecessarily.
*/
-#define FLOAT_VECTOR_MIN(f, result_reg, reg1, reg2) {\
- int compare_reg = spe_allocate_available_register(f); \
- spe_fcgt(f, compare_reg, reg1, reg2); \
- spe_selb(f, result_reg, reg1, reg2, compare_reg); \
- spe_release_register(f, compare_reg); \
+static inline void
+setup_const_register(struct spe_function *f, boolean *is_already_set, unsigned int *r, float value)
+{
+ if (*is_already_set) return;
+ *r = spe_allocate_available_register(f);
+ spe_load_float(f, *r, value);
+ *is_already_set = true;
}
-/* The FLOAT_VECTOR_MAX sequence is similar to the FLOAT_VECTOR_MIN
- * sequence above, except that the registers specified when selecting
- * bits are reversed.
- */
-#define FLOAT_VECTOR_MAX(f, result_reg, reg1, reg2) {\
- int compare_reg = spe_allocate_available_register(f); \
- spe_fcgt(f, compare_reg, reg1, reg2); \
- spe_selb(f, result_reg, reg2, reg1, compare_reg); \
- spe_release_register(f, compare_reg); \
+static inline void
+release_const_register(struct spe_function *f, boolean *is_already_set, unsigned int r)
+{
+ if (!*is_already_set) return;
+ spe_release_register(f, r);
+ *is_already_set = false;
}
/**
@@ -294,51 +285,15 @@ gen_blend(const struct pipe_blend_state *blend,
int tmp_reg = spe_allocate_available_register(f);
- /* These values might or might not eventually get put into
- * registers. We avoid allocating them and setting them until
- * they're actually needed; then we avoid setting them more than
- * once, and release them at the end of code generation.
+ /* Optional constant registers we might or might not end up using;
+ * if we do use them, make sure we only allocate them once by
+ * keeping a flag on each one.
*/
- boolean one_reg_set = false;
- int one_reg;
-#define SET_ONE_REG_IF_UNSET(f) if (!one_reg_set) {\
- one_reg = spe_allocate_available_register(f); \
- spe_load_float(f, one_reg, 1.0f); \
- one_reg_set = true; \
-}
-#define RELEASE_ONE_REG_IF_USED(f) if (one_reg_set) {\
- spe_release_register(f, one_reg); \
-}
-
- boolean const_color_set = false;
- int constR_reg, constG_reg, constB_reg;
-#define SET_CONST_COLOR_IF_UNSET(f, blend_color) if (!const_color_set) {\
- constR_reg = spe_allocate_available_register(f); \
- constG_reg = spe_allocate_available_register(f); \
- constG_reg = spe_allocate_available_register(f); \
- spe_load_float(f, constR_reg, blend_color->color[0]); \
- spe_load_float(f, constG_reg, blend_color->color[1]); \
- spe_load_float(f, constB_reg, blend_color->color[2]); \
- const_color_set = true;\
-}
-#define RELEASE_CONST_COLOR_IF_USED(f) if (const_color_set) {\
- spe_release_register(f, constR_reg); \
- spe_release_register(f, constG_reg); \
- spe_release_register(f, constB_reg); \
-}
-
- boolean const_alpha_set = false;
- int constA_reg;
-#define SET_CONST_ALPHA_IF_UNSET(f, blend_color) if (!const_alpha_set) {\
- constA_reg = spe_allocate_available_register(f); \
- spe_load_float(f, constA_reg, blend_color->color[3]); \
- const_alpha_set = true; \
-}
-#define RELEASE_CONST_ALPHA_IF_USED(f) if (const_alpha_set) {\
- spe_release_register(f, constA_reg); \
-}
-
- /* Real code starts here */
+ boolean one_reg_set = false;
+ unsigned int one_reg;
+ boolean constR_reg_set = false, constG_reg_set = false,
+ constB_reg_set = false, constA_reg_set = false;
+ unsigned int constR_reg, constG_reg, constB_reg, constA_reg;
ASSERT(blend->blend_enable);
@@ -419,10 +374,11 @@ gen_blend(const struct pipe_blend_state *blend,
spe_release_register(f, mask_reg);
}
-
/*
* Compute Src RGB terms. We're actually looking for the value
- * of (the appropriate RGB factors) * (the incoming source RGB color).
+ * of (the appropriate RGB factors) * (the incoming source RGB color),
+ * because in some cases (like PIPE_BLENDFACTOR_ONE and
+ * PIPE_BLENDFACTOR_ZERO) we can avoid doing unnecessary math.
*/
switch (blend->rgb_src_factor) {
case PIPE_BLENDFACTOR_ONE:
@@ -450,18 +406,13 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term1B_reg, fragB_reg, fragA_reg);
break;
case PIPE_BLENDFACTOR_INV_SRC_COLOR:
- /* factors = (1-R,1-G,1-B), so term = (R*(1-R), G*(1-G), B*(1-B)) */
- /* we'll need the optional constant {1,1,1,1} register */
- SET_ONE_REG_IF_UNSET(f)
- /* tmp = 1 - R */
- spe_fs(f, tmp_reg, one_reg, fragR_reg);
- /* term = R * tmp */
- spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
- /* repeat for G and B */
- spe_fs(f, tmp_reg, one_reg, fragG_reg);
- spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
- spe_fs(f, tmp_reg, one_reg, fragB_reg);
- spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ /* factors = (1-R,1-G,1-B), so term = (R*(1-R), G*(1-G), B*(1-B))
+ * or in other words term = (R-R*R, G-G*G, B-B*B)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term1R_reg, fragR_reg, fragR_reg, fragR_reg);
+ spe_fnms(f, term1G_reg, fragG_reg, fragG_reg, fragG_reg);
+ spe_fnms(f, term1B_reg, fragB_reg, fragB_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_DST_COLOR:
/* factors = (Rfb,Gfb,Bfb), so term = (R*Rfb, G*Gfb, B*Bfb) */
@@ -470,30 +421,22 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term1B_reg, fragB_reg, fbB_reg);
break;
case PIPE_BLENDFACTOR_INV_DST_COLOR:
- /* factors = (1-Rfb,1-Gfb,1-Bfb), so term = (R*(1-Rfb),G*(1-Gfb),B*(1-Bfb)) */
- /* we'll need the optional constant {1,1,1,1} register */
- SET_ONE_REG_IF_UNSET(f)
- /* tmp = 1 - Rfb */
- spe_fs(f, tmp_reg, one_reg, fbR_reg);
- /* term = R * tmp */
- spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
- /* repeat for G and B */
- spe_fs(f, tmp_reg, one_reg, fbG_reg);
- spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
- spe_fs(f, tmp_reg, one_reg, fbB_reg);
- spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ /* factors = (1-Rfb,1-Gfb,1-Bfb), so term = (R*(1-Rfb),G*(1-Gfb),B*(1-Bfb))
+ * or term = (R-R*Rfb, G-G*Gfb, B-B*Bfb)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term1R_reg, fragR_reg, fbR_reg, fragR_reg);
+ spe_fnms(f, term1G_reg, fragG_reg, fbG_reg, fragG_reg);
+ spe_fnms(f, term1B_reg, fragB_reg, fbB_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
- /* factors = (1-A,1-A,1-A), so term = (R*(1-A),G*(1-A),B*(1-A)) */
- /* we'll need the optional constant {1,1,1,1} register */
- SET_ONE_REG_IF_UNSET(f)
- /* tmp = 1 - A */
- spe_fs(f, tmp_reg, one_reg, fragA_reg);
- /* term = R * tmp */
- spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
- /* repeat for G and B with the same (1-A) factor */
- spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
- spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ /* factors = (1-A,1-A,1-A), so term = (R*(1-A),G*(1-A),B*(1-A))
+ * or term = (R-R*A,G-G*A,B-B*A)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term1R_reg, fragR_reg, fragA_reg, fragR_reg);
+ spe_fnms(f, term1G_reg, fragG_reg, fragA_reg, fragG_reg);
+ spe_fnms(f, term1B_reg, fragB_reg, fragA_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_DST_ALPHA:
/* factors = (Afb, Afb, Afb), so term = (R*Afb, G*Afb, B*Afb) */
@@ -502,19 +445,19 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fm(f, term1B_reg, fragB_reg, fbA_reg);
break;
case PIPE_BLENDFACTOR_INV_DST_ALPHA:
- /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (R*(1-Afb),G*(1-Afb),B*(1-Afb)) */
- /* we'll need the optional constant {1,1,1,1} register */
- SET_ONE_REG_IF_UNSET(f)
- /* tmp = 1 - A */
- spe_fs(f, tmp_reg, one_reg, fbA_reg);
- /* term = R * tmp, G*tmp, and B*tmp */
- spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
- spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
- spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (R*(1-Afb),G*(1-Afb),B*(1-Afb))
+ * or term = (R-R*Afb,G-G*Afb,b-B*Afb)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term1R_reg, fragR_reg, fbA_reg, fragR_reg);
+ spe_fnms(f, term1G_reg, fragG_reg, fbA_reg, fragG_reg);
+ spe_fnms(f, term1B_reg, fragB_reg, fbA_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_CONST_COLOR:
- /* We'll need the optional blend color registers */
- SET_CONST_COLOR_IF_UNSET(f,blend_color)
+ /* We need the optional constant color registers */
+ setup_const_register(f, &constR_reg_set, &constR_reg, blend_color->color[0]);
+ setup_const_register(f, &constG_reg_set, &constG_reg, blend_color->color[1]);
+ setup_const_register(f, &constB_reg_set, &constB_reg, blend_color->color[2]);
/* now, factor = (Rc,Gc,Bc), so term = (R*Rc,G*Gc,B*Bc) */
spe_fm(f, term1R_reg, fragR_reg, constR_reg);
spe_fm(f, term1G_reg, fragG_reg, constG_reg);
@@ -522,55 +465,61 @@ gen_blend(const struct pipe_blend_state *blend,
break;
case PIPE_BLENDFACTOR_CONST_ALPHA:
/* we'll need the optional constant alpha register */
- SET_CONST_ALPHA_IF_UNSET(f, blend_color)
+ setup_const_register(f, &constA_reg_set, &constA_reg, blend_color->color[3]);
/* factor = (Ac,Ac,Ac), so term = (R*Ac,G*Ac,B*Ac) */
spe_fm(f, term1R_reg, fragR_reg, constA_reg);
spe_fm(f, term1G_reg, fragG_reg, constA_reg);
spe_fm(f, term1B_reg, fragB_reg, constA_reg);
break;
case PIPE_BLENDFACTOR_INV_CONST_COLOR:
- /* We need both the optional {1,1,1,1} register, and the optional
- * constant color registers
+ /* We need the optional constant color registers */
+ setup_const_register(f, &constR_reg_set, &constR_reg, blend_color->color[0]);
+ setup_const_register(f, &constG_reg_set, &constG_reg, blend_color->color[1]);
+ setup_const_register(f, &constB_reg_set, &constB_reg, blend_color->color[2]);
+ /* factor = (1-Rc,1-Gc,1-Bc), so term = (R*(1-Rc),G*(1-Gc),B*(1-Bc))
+ * or term = (R-R*Rc, G-G*Gc, B-B*Bc)
+ * fnms(a,b,c,d) computes a = d - b*c
*/
- SET_ONE_REG_IF_UNSET(f)
- SET_CONST_COLOR_IF_UNSET(f, blend_color)
- /* factor = (1-Rc,1-Gc,1-Bc), so term = (R*(1-Rc),G*(1-Gc),B*(1-Bc)) */
- spe_fs(f, tmp_reg, one_reg, constR_reg);
- spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
- spe_fs(f, tmp_reg, one_reg, constG_reg);
- spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
- spe_fs(f, tmp_reg, one_reg, constB_reg);
- spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ spe_fnms(f, term1R_reg, fragR_reg, constR_reg, fragR_reg);
+ spe_fnms(f, term1G_reg, fragG_reg, constG_reg, fragG_reg);
+ spe_fnms(f, term1B_reg, fragB_reg, constB_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
- /* We need the optional {1,1,1,1} register and the optional
- * constant alpha register
+ /* We need the optional constant color registers */
+ setup_const_register(f, &constR_reg_set, &constR_reg, blend_color->color[0]);
+ setup_const_register(f, &constG_reg_set, &constG_reg, blend_color->color[1]);
+ setup_const_register(f, &constB_reg_set, &constB_reg, blend_color->color[2]);
+ /* factor = (1-Ac,1-Ac,1-Ac), so term = (R*(1-Ac),G*(1-Ac),B*(1-Ac))
+ * or term = (R-R*Ac,G-G*Ac,B-B*Ac)
+ * fnms(a,b,c,d) computes a = d - b*c
*/
- SET_ONE_REG_IF_UNSET(f)
- SET_CONST_ALPHA_IF_UNSET(f, blend_color)
- /* factor = (1-Ac,1-Ac,1-Ac), so term = (R*(1-Ac),G*(1-Ac),B*(1-Ac)) */
- spe_fs(f, tmp_reg, one_reg, constA_reg);
- spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
- spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
- spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
+ spe_fnms(f, term1R_reg, fragR_reg, constA_reg, fragR_reg);
+ spe_fnms(f, term1G_reg, fragG_reg, constA_reg, fragG_reg);
+ spe_fnms(f, term1B_reg, fragB_reg, constA_reg, fragB_reg);
break;
case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE:
/* We'll need the optional {1,1,1,1} register */
- SET_ONE_REG_IF_UNSET(f)
+ setup_const_register(f, &one_reg_set, &one_reg, 1.0f);
/* factor = (min(A,1-Afb),min(A,1-Afb),min(A,1-Afb)), so
* term = (R*min(A,1-Afb), G*min(A,1-Afb), B*min(A,1-Afb))
+ * We could expand the term (as a*min(b,c) == min(a*b,a*c)
+ * as long as a is positive), but then we'd have to do three
+ * spe_float_min() functions instead of one, so this is simpler.
*/
/* tmp = 1 - Afb */
spe_fs(f, tmp_reg, one_reg, fbA_reg);
/* tmp = min(A,tmp) */
- FLOAT_VECTOR_MIN(f, tmp_reg, fragA_reg, tmp_reg)
+ spe_float_min(f, tmp_reg, fragA_reg, tmp_reg);
/* term = R*tmp */
spe_fm(f, term1R_reg, fragR_reg, tmp_reg);
spe_fm(f, term1G_reg, fragG_reg, tmp_reg);
spe_fm(f, term1B_reg, fragB_reg, tmp_reg);
break;
- /* non-OpenGL cases? */
+ /* These are special D3D cases involving a second color output
+ * from the fragment shader. I'm not sure we can support them
+ * yet... XXX
+ */
case PIPE_BLENDFACTOR_SRC1_COLOR:
case PIPE_BLENDFACTOR_SRC1_ALPHA:
case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
@@ -581,132 +530,293 @@ gen_blend(const struct pipe_blend_state *blend,
}
/*
- * Compute Src Alpha term
+ * Compute Src Alpha term. Like the above, we're looking for
+ * the full term A*factor, not just the factor itself, because
+ * in many cases we can avoid doing unnecessary multiplies.
*/
switch (blend->alpha_src_factor) {
+ case PIPE_BLENDFACTOR_ZERO:
+ /* factor = 0, so term = 0 */
+ spe_load_float(f, term1A_reg, 0.0f);
+ break;
+
+ case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: /* fall through */
case PIPE_BLENDFACTOR_ONE:
+ /* factor = 1, so term = A */
spe_move(f, term1A_reg, fragA_reg);
break;
+
case PIPE_BLENDFACTOR_SRC_COLOR:
+ /* factor = A, so term = A*A */
spe_fm(f, term1A_reg, fragA_reg, fragA_reg);
break;
case PIPE_BLENDFACTOR_SRC_ALPHA:
spe_fm(f, term1A_reg, fragA_reg, fragA_reg);
break;
- /* XXX more cases */
+
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_INV_SRC_COLOR:
+ /* factor = 1-A, so term = A*(1-A) = A-A*A */
+ /* fnms(a,b,c,d) computes a = d - b*c */
+ spe_fnms(f, term1A_reg, fragA_reg, fragA_reg, fragA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_DST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_DST_COLOR:
+ /* factor = Afb, so term = A*Afb */
+ spe_fm(f, term1A_reg, fragA_reg, fbA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_INV_DST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_INV_DST_COLOR:
+ /* factor = 1-Afb, so term = A*(1-Afb) = A - A*Afb */
+ /* fnms(a,b,c,d) computes a = d - b*c */
+ spe_fnms(f, term1A_reg, fragA_reg, fbA_reg, fragA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_CONST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_CONST_COLOR:
+ /* We need the optional constA_reg register */
+ setup_const_register(f, &constA_reg_set, &constA_reg, blend_color->color[3]);
+ /* factor = Ac, so term = A*Ac */
+ spe_fm(f, term1A_reg, fragA_reg, constA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_INV_CONST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_INV_CONST_COLOR:
+ /* We need the optional constA_reg register */
+ setup_const_register(f, &constA_reg_set, &constA_reg, blend_color->color[3]);
+ /* factor = 1-Ac, so term = A*(1-Ac) = A-A*Ac */
+ /* fnms(a,b,c,d) computes a = d - b*c */
+ spe_fnms(f, term1A_reg, fragA_reg, constA_reg, fragA_reg);
+ break;
+
+ /* These are special D3D cases involving a second color output
+ * from the fragment shader. I'm not sure we can support them
+ * yet... XXX
+ */
+ case PIPE_BLENDFACTOR_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_SRC1_ALPHA:
+ case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
default:
ASSERT(0);
}
/*
- * Compute Dest RGB terms
+ * Compute Dest RGB term. Like the above, we're looking for
+ * the full term (Rfb,Gfb,Bfb)*(factor), not just the factor itself, because
+ * in many cases we can avoid doing unnecessary multiplies.
*/
switch (blend->rgb_dst_factor) {
case PIPE_BLENDFACTOR_ONE:
+ /* factors = (1,1,1), so term = (Rfb,Gfb,Bfb) */
spe_move(f, term2R_reg, fbR_reg);
spe_move(f, term2G_reg, fbG_reg);
spe_move(f, term2B_reg, fbB_reg);
break;
case PIPE_BLENDFACTOR_ZERO:
- spe_zero(f, term2R_reg);
- spe_zero(f, term2G_reg);
- spe_zero(f, term2B_reg);
+ /* factor s= (0,0,0), so term = (0,0,0) */
+ spe_load_float(f, term2R_reg, 0.0f);
+ spe_load_float(f, term2G_reg, 0.0f);
+ spe_load_float(f, term2B_reg, 0.0f);
break;
case PIPE_BLENDFACTOR_SRC_COLOR:
+ /* factors = (R,G,B), so term = (R*Rfb, G*Gfb, B*Bfb) */
spe_fm(f, term2R_reg, fbR_reg, fragR_reg);
spe_fm(f, term2G_reg, fbG_reg, fragG_reg);
spe_fm(f, term2B_reg, fbB_reg, fragB_reg);
break;
+ case PIPE_BLENDFACTOR_INV_SRC_COLOR:
+ /* factors = (1-R,1-G,1-B), so term = (Rfb*(1-R), Gfb*(1-G), Bfb*(1-B))
+ * or in other words term = (Rfb-Rfb*R, Gfb-Gfb*G, Bfb-Bfb*B)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term2R_reg, fragR_reg, fbR_reg, fbR_reg);
+ spe_fnms(f, term2G_reg, fragG_reg, fbG_reg, fbG_reg);
+ spe_fnms(f, term2B_reg, fragB_reg, fbB_reg, fbB_reg);
+ break;
case PIPE_BLENDFACTOR_SRC_ALPHA:
+ /* factors = (A,A,A), so term = (Rfb*A, Gfb*A, Bfb*A) */
spe_fm(f, term2R_reg, fbR_reg, fragA_reg);
spe_fm(f, term2G_reg, fbG_reg, fragA_reg);
spe_fm(f, term2B_reg, fbB_reg, fragA_reg);
break;
case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
-#if 0
- /* one = {1.0, 1.0, 1.0, 1.0} */
- if (!one_reg_set) {
- one_reg = spe_allocate_available_register(f);
- spe_load_float(f, one_reg, 1.0f);
- one_reg_set = true;
- }
- /* tmp = one - fragA */
- spe_fs(f, tmp_reg, one_reg, fragA_reg);
- /* term = fb * tmp */
- spe_fm(f, term2R_reg, fbR_reg, tmp_reg);
- spe_fm(f, term2G_reg, fbG_reg, tmp_reg);
- spe_fm(f, term2B_reg, fbB_reg, tmp_reg);
-#else
- /* Compute: term2x = fbx * (1.0 - fragA)
- * Which is: term2x = fbx - fbx * fragA
- * Use fnms t,a,b,c which computes t=c-a*b
- */
+ /* factors = (1-A,1-A,1-A) so term = (Rfb-Rfb*A,Gfb-Gfb*A,Bfb-Bfb*A) */
+ /* fnms(a,b,c,d) computes a = d - b*c */
spe_fnms(f, term2R_reg, fbR_reg, fragA_reg, fbR_reg);
spe_fnms(f, term2G_reg, fbG_reg, fragA_reg, fbG_reg);
spe_fnms(f, term2B_reg, fbB_reg, fragA_reg, fbB_reg);
-#endif
break;
- /* XXX more cases */
- // GL_ONE_MINUS_SRC_COLOR
- // GL_DST_COLOR
- // GL_ONE_MINUS_DST_COLOR
- // GL_DST_ALPHA
- // GL_CONSTANT_COLOR
- // GL_ONE_MINUS_CONSTANT_COLOR
- // GL_CONSTANT_ALPHA
- // GL_ONE_MINUS_CONSTANT_ALPHA
+ case PIPE_BLENDFACTOR_DST_COLOR:
+ /* factors = (Rfb,Gfb,Bfb), so term = (Rfb*Rfb, Gfb*Gfb, Bfb*Bfb) */
+ spe_fm(f, term2R_reg, fbR_reg, fbR_reg);
+ spe_fm(f, term2G_reg, fbG_reg, fbG_reg);
+ spe_fm(f, term2B_reg, fbB_reg, fbB_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_DST_COLOR:
+ /* factors = (1-Rfb,1-Gfb,1-Bfb), so term = (Rfb*(1-Rfb),Gfb*(1-Gfb),Bfb*(1-Bfb))
+ * or term = (Rfb-Rfb*Rfb, Gfb-Gfb*Gfb, Bfb-Bfb*Bfb)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term2R_reg, fbR_reg, fbR_reg, fbR_reg);
+ spe_fnms(f, term2G_reg, fbG_reg, fbG_reg, fbG_reg);
+ spe_fnms(f, term2B_reg, fbB_reg, fbB_reg, fbB_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_DST_ALPHA:
+ /* factors = (Afb, Afb, Afb), so term = (Rfb*Afb, Gfb*Afb, Bfb*Afb) */
+ spe_fm(f, term2R_reg, fbR_reg, fbA_reg);
+ spe_fm(f, term2G_reg, fbG_reg, fbA_reg);
+ spe_fm(f, term2B_reg, fbB_reg, fbA_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_DST_ALPHA:
+ /* factors = (1-Afb, 1-Afb, 1-Afb), so term = (Rfb*(1-Afb),Gfb*(1-Afb),Bfb*(1-Afb))
+ * or term = (Rfb-Rfb*Afb,Gfb-Gfb*Afb,Bfb-Bfb*Afb)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term2R_reg, fbR_reg, fbA_reg, fbR_reg);
+ spe_fnms(f, term2G_reg, fbG_reg, fbA_reg, fbG_reg);
+ spe_fnms(f, term2B_reg, fbB_reg, fbA_reg, fbB_reg);
+ break;
+ case PIPE_BLENDFACTOR_CONST_COLOR:
+ /* We need the optional constant color registers */
+ setup_const_register(f, &constR_reg_set, &constR_reg, blend_color->color[0]);
+ setup_const_register(f, &constG_reg_set, &constG_reg, blend_color->color[1]);
+ setup_const_register(f, &constB_reg_set, &constB_reg, blend_color->color[2]);
+ /* now, factor = (Rc,Gc,Bc), so term = (Rfb*Rc,Gfb*Gc,Bfb*Bc) */
+ spe_fm(f, term2R_reg, fbR_reg, constR_reg);
+ spe_fm(f, term2G_reg, fbG_reg, constG_reg);
+ spe_fm(f, term2B_reg, fbB_reg, constB_reg);
+ break;
+ case PIPE_BLENDFACTOR_CONST_ALPHA:
+ /* we'll need the optional constant alpha register */
+ setup_const_register(f, &constA_reg_set, &constA_reg, blend_color->color[3]);
+ /* factor = (Ac,Ac,Ac), so term = (Rfb*Ac,Gfb*Ac,Bfb*Ac) */
+ spe_fm(f, term2R_reg, fbR_reg, constA_reg);
+ spe_fm(f, term2G_reg, fbG_reg, constA_reg);
+ spe_fm(f, term2B_reg, fbB_reg, constA_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_CONST_COLOR:
+ /* We need the optional constant color registers */
+ setup_const_register(f, &constR_reg_set, &constR_reg, blend_color->color[0]);
+ setup_const_register(f, &constG_reg_set, &constG_reg, blend_color->color[1]);
+ setup_const_register(f, &constB_reg_set, &constB_reg, blend_color->color[2]);
+ /* factor = (1-Rc,1-Gc,1-Bc), so term = (Rfb*(1-Rc),Gfb*(1-Gc),Bfb*(1-Bc))
+ * or term = (Rfb-Rfb*Rc, Gfb-Gfb*Gc, Bfb-Bfb*Bc)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term2R_reg, fbR_reg, constR_reg, fbR_reg);
+ spe_fnms(f, term2G_reg, fbG_reg, constG_reg, fbG_reg);
+ spe_fnms(f, term2B_reg, fbB_reg, constB_reg, fbB_reg);
+ break;
+ case PIPE_BLENDFACTOR_INV_CONST_ALPHA:
+ /* We need the optional constant color registers */
+ setup_const_register(f, &constR_reg_set, &constR_reg, blend_color->color[0]);
+ setup_const_register(f, &constG_reg_set, &constG_reg, blend_color->color[1]);
+ setup_const_register(f, &constB_reg_set, &constB_reg, blend_color->color[2]);
+ /* factor = (1-Ac,1-Ac,1-Ac), so term = (Rfb*(1-Ac),Gfb*(1-Ac),Bfb*(1-Ac))
+ * or term = (Rfb-Rfb*Ac,Gfb-Gfb*Ac,Bfb-Bfb*Ac)
+ * fnms(a,b,c,d) computes a = d - b*c
+ */
+ spe_fnms(f, term2R_reg, fbR_reg, constA_reg, fbR_reg);
+ spe_fnms(f, term2G_reg, fbG_reg, constA_reg, fbG_reg);
+ spe_fnms(f, term2B_reg, fbB_reg, constA_reg, fbB_reg);
+ break;
+ case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: /* not supported for dest RGB */
+ ASSERT(0);
+ break;
+
+ /* These are special D3D cases involving a second color output
+ * from the fragment shader. I'm not sure we can support them
+ * yet... XXX
+ */
+ case PIPE_BLENDFACTOR_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_SRC1_ALPHA:
+ case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
+
default:
ASSERT(0);
}
/*
- * Compute Dest Alpha term
+ * Compute Dest Alpha term. Like the above, we're looking for
+ * the full term Afb*factor, not just the factor itself, because
+ * in many cases we can avoid doing unnecessary multiplies.
*/
switch (blend->alpha_dst_factor) {
case PIPE_BLENDFACTOR_ONE:
+ /* factor = 1, so term = Afb */
spe_move(f, term2A_reg, fbA_reg);
break;
case PIPE_BLENDFACTOR_ZERO:
- spe_zero(f, term2A_reg);
+ /* factor = 0, so term = 0 */
+ spe_load_float(f, term2A_reg, 0.0f);
break;
- case PIPE_BLENDFACTOR_SRC_ALPHA:
+
+ case PIPE_BLENDFACTOR_SRC_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_SRC_COLOR:
+ /* factor = A, so term = Afb*A */
spe_fm(f, term2A_reg, fbA_reg, fragA_reg);
break;
- case PIPE_BLENDFACTOR_INV_SRC_ALPHA:
-#if 0
- /* one = {1.0, 1.0, 1.0, 1.0} */
- if (!one_reg_set) {
- one_reg = spe_allocate_available_register(f);
- spe_load_float(f, one_reg, 1.0f);
- one_reg_set = true;
- }
- /* tmp = one - fragA */
- spe_fs(f, tmp_reg, one_reg, fragA_reg);
- /* termA = fbA * tmp */
- spe_fm(f, term2A_reg, fbA_reg, tmp_reg);
-#else
- /* Compute: term2A = fbA * (1.0 - fragA)
- * Which is: term2A = fbA - fbA * fragA
- * Use fnms t,a,b,c which computes t=c-a*b
- */
+
+ case PIPE_BLENDFACTOR_INV_SRC_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_INV_SRC_COLOR:
+ /* factor = 1-A, so term = Afb*(1-A) = Afb-Afb*A */
+ /* fnms(a,b,c,d) computes a = d - b*c */
spe_fnms(f, term2A_reg, fbA_reg, fragA_reg, fbA_reg);
-#endif
break;
- /* XXX more cases */
- // GL_ONE_MINUS_SRC_COLOR
- // GL_DST_COLOR
- // GL_ONE_MINUS_DST_COLOR
- // GL_DST_ALPHA
- // GL_CONSTANT_COLOR
- // GL_ONE_MINUS_CONSTANT_COLOR
- // GL_CONSTANT_ALPHA
- // GL_ONE_MINUS_CONSTANT_ALPHA
+
+ case PIPE_BLENDFACTOR_DST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_DST_COLOR:
+ /* factor = Afb, so term = Afb*Afb */
+ spe_fm(f, term2A_reg, fbA_reg, fbA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_INV_DST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_INV_DST_COLOR:
+ /* factor = 1-Afb, so term = Afb*(1-Afb) = Afb - Afb*Afb */
+ /* fnms(a,b,c,d) computes a = d - b*c */
+ spe_fnms(f, term2A_reg, fbA_reg, fbA_reg, fbA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_CONST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_CONST_COLOR:
+ /* We need the optional constA_reg register */
+ setup_const_register(f, &constA_reg_set, &constA_reg, blend_color->color[3]);
+ /* factor = Ac, so term = Afb*Ac */
+ spe_fm(f, term2A_reg, fbA_reg, constA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_INV_CONST_ALPHA: /* fall through */
+ case PIPE_BLENDFACTOR_INV_CONST_COLOR:
+ /* We need the optional constA_reg register */
+ setup_const_register(f, &constA_reg_set, &constA_reg, blend_color->color[3]);
+ /* factor = 1-Ac, so term = Afb*(1-Ac) = Afb-Afb*Ac */
+ /* fnms(a,b,c,d) computes a = d - b*c */
+ spe_fnms(f, term2A_reg, fbA_reg, constA_reg, fbA_reg);
+ break;
+
+ case PIPE_BLENDFACTOR_SRC_ALPHA_SATURATE: /* not supported for dest alpha */
+ ASSERT(0);
+ break;
+
+ /* These are special D3D cases involving a second color output
+ * from the fragment shader. I'm not sure we can support them
+ * yet... XXX
+ */
+ case PIPE_BLENDFACTOR_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_SRC1_ALPHA:
+ case PIPE_BLENDFACTOR_INV_SRC1_COLOR:
+ case PIPE_BLENDFACTOR_INV_SRC1_ALPHA:
default:
ASSERT(0);
}
/*
- * Combine Src/Dest RGB terms
+ * Combine Src/Dest RGB terms as per the blend equation.
*/
switch (blend->rgb_func) {
case PIPE_BLEND_ADD:
@@ -725,14 +835,14 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fs(f, fragB_reg, term2B_reg, term1B_reg);
break;
case PIPE_BLEND_MIN:
- FLOAT_VECTOR_MIN(f, fragR_reg, term1R_reg, term2R_reg)
- FLOAT_VECTOR_MIN(f, fragG_reg, term1G_reg, term2G_reg)
- FLOAT_VECTOR_MIN(f, fragB_reg, term1B_reg, term2B_reg)
+ spe_float_min(f, fragR_reg, term1R_reg, term2R_reg);
+ spe_float_min(f, fragG_reg, term1G_reg, term2G_reg);
+ spe_float_min(f, fragB_reg, term1B_reg, term2B_reg);
break;
case PIPE_BLEND_MAX:
- FLOAT_VECTOR_MAX(f, fragR_reg, term1R_reg, term2R_reg)
- FLOAT_VECTOR_MAX(f, fragG_reg, term1G_reg, term2G_reg)
- FLOAT_VECTOR_MAX(f, fragB_reg, term1B_reg, term2B_reg)
+ spe_float_max(f, fragR_reg, term1R_reg, term2R_reg);
+ spe_float_max(f, fragG_reg, term1G_reg, term2G_reg);
+ spe_float_max(f, fragB_reg, term1B_reg, term2B_reg);
break;
default:
ASSERT(0);
@@ -752,10 +862,10 @@ gen_blend(const struct pipe_blend_state *blend,
spe_fs(f, fragA_reg, term2A_reg, term1A_reg);
break;
case PIPE_BLEND_MIN:
- FLOAT_VECTOR_MIN(f, fragA_reg, term1A_reg, term2A_reg)
+ spe_float_min(f, fragA_reg, term1A_reg, term2A_reg);
break;
case PIPE_BLEND_MAX:
- FLOAT_VECTOR_MAX(f, fragA_reg, term1A_reg, term2A_reg)
+ spe_float_max(f, fragA_reg, term1A_reg, term2A_reg);
break;
default:
ASSERT(0);
@@ -779,9 +889,11 @@ gen_blend(const struct pipe_blend_state *blend,
spe_release_register(f, tmp_reg);
/* Free any optional registers that actually got used */
- RELEASE_ONE_REG_IF_USED(f)
- RELEASE_CONST_COLOR_IF_USED(f)
- RELEASE_CONST_ALPHA_IF_USED(f)
+ release_const_register(f, &one_reg_set, one_reg);
+ release_const_register(f, &constR_reg_set, constR_reg);
+ release_const_register(f, &constG_reg_set, constG_reg);
+ release_const_register(f, &constB_reg_set, constB_reg);
+ release_const_register(f, &constA_reg_set, constA_reg);
}
--
cgit v1.2.3
From fa7529335c38d4c139e5b1fc17a518f7e5fa1d82 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Thu, 18 Sep 2008 14:14:56 +0200
Subject: progs/fp: Add a bit of local variable testing to fp-tri
---
progs/fp/fp-tri.c | 2 ++
progs/fp/local.txt | 11 +++++++++++
2 files changed, 13 insertions(+)
create mode 100644 progs/fp/local.txt
diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c
index cb991f803e..2512e824ee 100644
--- a/progs/fp/fp-tri.c
+++ b/progs/fp/fp-tri.c
@@ -130,6 +130,8 @@ static void Display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
+ glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1.0, 1.0, 0.0, 0.0);
+ glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0.0, 0.0, 1.0, 1.0);
glBegin(GL_TRIANGLES);
glColor3f(0,0,1);
glVertex3f( 0.9, -0.9, -30.0);
diff --git a/progs/fp/local.txt b/progs/fp/local.txt
new file mode 100644
index 0000000000..6cb2a2f13c
--- /dev/null
+++ b/progs/fp/local.txt
@@ -0,0 +1,11 @@
+!!ARBfp1.0
+TEMP R0;
+PARAM c[4] = { { 0, 0, 0, 0 },
+ program.local[0..1],
+ { 1, 1, 1, 1 } };
+MOV R0, c[1];
+SUB R0, R0, c[0];
+ADD R0, R0, c[2];
+MUL R0, R0, c[3];
+MOV result.color, R0;
+END
--
cgit v1.2.3
From 5e1ef85dc430a4439cd60b66262eab9062dd5f4f Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Thu, 18 Sep 2008 14:48:45 +0200
Subject: tgsi: Make tgsi dumps look more like mesa shader dumps.
---
src/gallium/auxiliary/tgsi/tgsi_dump.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c
index afc8ffa553..3177f54952 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_dump.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c
@@ -68,6 +68,7 @@ dump_enum(
#define CHR(C) ctx->printf( ctx, "%c", C )
#define UIX(I) ctx->printf( ctx, "0x%x", I )
#define UID(I) ctx->printf( ctx, "%u", I )
+#define INSTID(I) ctx->printf( ctx, "% 3u", I )
#define SID(I) ctx->printf( ctx, "%d", I )
#define FLT(F) ctx->printf( ctx, "%10.4f", F )
#define ENM(E,ENUMS) dump_enum( ctx, E, ENUMS, sizeof( ENUMS ) / sizeof( *ENUMS ) )
@@ -315,8 +316,8 @@ iter_instruction(
uint i;
boolean first_reg = TRUE;
- UID( instno );
- CHR( ':' );
+ INSTID( instno );
+ TXT( ": " );
TXT( tgsi_get_opcode_info( inst->Instruction.Opcode )->mnemonic );
switch (inst->Instruction.Saturate) {
--
cgit v1.2.3
From f68d2a0febca38bc7b31f9ab9718e944935b48bc Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 08:10:34 -0600
Subject: gallium: fix surface object memory leak in cso module
---
src/gallium/auxiliary/cso_cache/cso_context.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index b1ccfc0374..68508f24de 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -80,6 +80,10 @@ struct cso_context {
};
+static void
+free_framebuffer_state(struct pipe_framebuffer_state *fb);
+
+
static boolean delete_blend_state(struct cso_context *ctx, void *state)
{
struct cso_blend *cso = (struct cso_blend *)state;
@@ -252,6 +256,9 @@ void cso_release_all( struct cso_context *ctx )
pipe_texture_reference(&ctx->textures_saved[i], NULL);
}
+ free_framebuffer_state(&ctx->fb);
+ free_framebuffer_state(&ctx->fb_saved);
+
if (ctx->cache) {
cso_cache_delete( ctx->cache );
ctx->cache = NULL;
@@ -784,6 +791,18 @@ copy_framebuffer_state(struct pipe_framebuffer_state *dst,
}
+static void
+free_framebuffer_state(struct pipe_framebuffer_state *fb)
+{
+ uint i;
+
+ for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&fb->cbufs[i], NULL);
+ }
+ pipe_surface_reference(&fb->zsbuf, NULL);
+}
+
+
enum pipe_error cso_set_framebuffer(struct cso_context *ctx,
const struct pipe_framebuffer_state *fb)
{
@@ -804,6 +823,7 @@ void cso_restore_framebuffer(struct cso_context *ctx)
if (memcmp(&ctx->fb, &ctx->fb_saved, sizeof(ctx->fb))) {
copy_framebuffer_state(&ctx->fb, &ctx->fb_saved);
ctx->pipe->set_framebuffer_state(ctx->pipe, &ctx->fb);
+ free_framebuffer_state(&ctx->fb_saved);
}
}
--
cgit v1.2.3
From 451888ee8f9d9749a2d52351374a14525c07ef2b Mon Sep 17 00:00:00 2001
From: José Fonseca
Date: Thu, 18 Sep 2008 22:24:45 +0900
Subject: util: Add missing p_debug.h include.
---
src/gallium/auxiliary/util/u_math.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 0b10622ee7..196aeb28fa 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -40,6 +40,7 @@
#include "pipe/p_compiler.h"
+#include "pipe/p_debug.h"
#ifdef __cplusplus
--
cgit v1.2.3
From eb5c288df48fa818ecb2bbd71f263ec68ebbef8a Mon Sep 17 00:00:00 2001
From: José Fonseca
Date: Thu, 18 Sep 2008 23:00:18 +0900
Subject: util: A few more memory debugging checks.
---
src/gallium/auxiliary/util/p_debug_mem.c | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/src/gallium/auxiliary/util/p_debug_mem.c b/src/gallium/auxiliary/util/p_debug_mem.c
index ed18c6540e..9511479cbb 100644
--- a/src/gallium/auxiliary/util/p_debug_mem.c
+++ b/src/gallium/auxiliary/util/p_debug_mem.c
@@ -122,8 +122,12 @@ debug_malloc(const char *file, unsigned line, const char *function,
struct debug_memory_footer *ftr;
hdr = real_malloc(sizeof(*hdr) + size + sizeof(*ftr));
- if(!hdr)
+ if(!hdr) {
+ debug_printf("%s:%u:%s: out of memory when trying to allocate %lu bytes\n",
+ file, line, function,
+ (long unsigned)size);
return NULL;
+ }
hdr->no = last_no++;
hdr->file = file;
@@ -219,8 +223,12 @@ debug_realloc(const char *file, unsigned line, const char *function,
/* alloc new */
new_hdr = real_malloc(sizeof(*new_hdr) + new_size + sizeof(*new_ftr));
- if(!new_hdr)
+ if(!new_hdr) {
+ debug_printf("%s:%u:%s: out of memory when trying to allocate %lu bytes\n",
+ file, line, function,
+ (long unsigned)new_size);
return NULL;
+ }
new_hdr->no = old_hdr->no;
new_hdr->file = old_hdr->file;
new_hdr->line = old_hdr->line;
@@ -261,8 +269,19 @@ debug_memory_end(unsigned long start_no)
for (; entry != &list; entry = entry->prev) {
struct debug_memory_header *hdr;
void *ptr;
+ struct debug_memory_footer *ftr;
+
hdr = LIST_ENTRY(struct debug_memory_header, entry, head);
ptr = data_from_header(hdr);
+ ftr = footer_from_header(hdr);
+
+ if(hdr->magic != DEBUG_MEMORY_MAGIC) {
+ debug_printf("%s:%u:%s: bad or corrupted memory %p\n",
+ hdr->file, hdr->line, hdr->function,
+ ptr);
+ debug_assert(0);
+ }
+
if((start_no <= hdr->no && hdr->no < last_no) ||
(last_no < start_no && (hdr->no < last_no || start_no <= hdr->no))) {
debug_printf("%s:%u:%s: %u bytes at %p not freed\n",
@@ -270,7 +289,15 @@ debug_memory_end(unsigned long start_no)
hdr->size, ptr);
total_size += hdr->size;
}
+
+ if(ftr->magic != DEBUG_MEMORY_MAGIC) {
+ debug_printf("%s:%u:%s: buffer overflow %p\n",
+ hdr->file, hdr->line, hdr->function,
+ ptr);
+ debug_assert(0);
+ }
}
+
if(total_size) {
debug_printf("Total of %u KB of system memory apparently leaked\n",
(total_size + 1023)/1024);
--
cgit v1.2.3
From 0b8e19ffc51c29543796d4f1e3243e97d8c32671 Mon Sep 17 00:00:00 2001
From: Jakob Bornecrantz
Date: Thu, 18 Sep 2008 16:28:16 +0200
Subject: tgsi: Build tgsi_text with make
---
src/gallium/auxiliary/tgsi/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/auxiliary/tgsi/Makefile b/src/gallium/auxiliary/tgsi/Makefile
index c5d2082087..c7155a9316 100644
--- a/src/gallium/auxiliary/tgsi/Makefile
+++ b/src/gallium/auxiliary/tgsi/Makefile
@@ -13,6 +13,7 @@ C_SOURCES = \
tgsi_parse.c \
tgsi_scan.c \
tgsi_sse2.c \
+ tgsi_text.c \
tgsi_transform.c \
tgsi_util.c
--
cgit v1.2.3
From c868a1c32d70295f425333f9e8a35235b129704b Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Thu, 18 Sep 2008 10:36:09 -0600
Subject: cell: Added SGE and SLE instructions
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 62 ++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 77386b3025..92681408e9 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -696,6 +696,68 @@ emit_SLT(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit set-if_greater-then-or-equal. See emit_SGT for comments.
+ */
+static boolean
+emit_SGE(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "SGE:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 >= s2) */
+ spe_fcgt(gen->f, d_reg, s2_reg, s1_reg);
+
+ /* convert d from 0x0/0xffffffff to 0.0/1.0 */
+ /* d = d & ~one_reg */
+ spe_andc(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
+/**
+ * Emit set-if_less-then-or-equal. See emit_SGT for comments.
+ */
+static boolean
+emit_SLE(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "SLE:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 <= s2) */
+ spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
+
+ /* convert d from 0x0/0xffffffff to 0.0/1.0 */
+ /* d = d & ~one_reg */
+ spe_andc(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
/**
* Emit set-if_equal. See emit_SGT for comments.
*/
--
cgit v1.2.3
From 3d2449247afce18e6a0604b794778d1373c879be Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Thu, 18 Sep 2008 10:37:45 -0600
Subject: cell: Added SGE and SLE instructions to dispatch function
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 92681408e9..2607b410aa 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -1020,6 +1020,10 @@ emit_instruction(struct codegen *gen,
return emit_SGT(gen, inst);
case TGSI_OPCODE_SLT:
return emit_SLT(gen, inst);
+ case TGSI_OPCODE_SGE:
+ return emit_SGE(gen, inst);
+ case TGSI_OPCODE_SLE:
+ return emit_SLE(gen, inst);
case TGSI_OPCODE_SEQ:
return emit_SEQ(gen, inst);
case TGSI_OPCODE_SNE:
--
cgit v1.2.3
From 15fceac0404f450f026f10bd2f4bdd0c939b5d00 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Thu, 18 Sep 2008 11:11:49 -0600
Subject: cell: Fix bug with complement logic for SGE and SLE
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 42 +++++++++++++++++++++++++++---
1 file changed, 38 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 2607b410aa..4f01897199 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -716,8 +716,8 @@ emit_SGE(struct codegen *gen, const struct tgsi_full_instruction *inst)
spe_fcgt(gen->f, d_reg, s2_reg, s1_reg);
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
- /* d = d & ~one_reg */
- spe_andc(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+ /* d = ~d & one_reg */
+ spe_andc(gen->f, d_reg, get_const_one_reg(gen), d_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
@@ -747,8 +747,8 @@ emit_SLE(struct codegen *gen, const struct tgsi_full_instruction *inst)
spe_fcgt(gen->f, d_reg, s1_reg, s2_reg);
/* convert d from 0x0/0xffffffff to 0.0/1.0 */
- /* d = d & ~one_reg */
- spe_andc(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+ /* d = ~d & one_reg */
+ spe_andc(gen->f, d_reg, get_const_one_reg(gen), d_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
@@ -821,6 +821,38 @@ emit_SNE(struct codegen *gen, const struct tgsi_full_instruction *inst)
return true;
}
+/**
+ * Emit compare. See emit_SGT for comments.
+ */
+static boolean
+emit_CMP(struct codegen *gen, const struct tgsi_full_instruction *inst)
+{
+ int ch;
+
+ spe_comment(gen->f, -4, "CMP:");
+
+ for (ch = 0; ch < 4; ch++) {
+ if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
+ int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
+ int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+
+ /* d = (s1 != s2) */
+ spe_fceq(gen->f, d_reg, s1_reg, s2_reg);
+ spe_nor(gen->f, d_reg, d_reg, d_reg);
+
+ /* convert d from 0x0/0xffffffff to 0.0/1.0 */
+ /* d = d & one_reg */
+ spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+
+ store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
+ free_itemps(gen);
+ }
+ }
+
+ return true;
+}
+
/**
* Emit max. See emit_SGT for comments.
*/
@@ -1028,6 +1060,8 @@ emit_instruction(struct codegen *gen,
return emit_SEQ(gen, inst);
case TGSI_OPCODE_SNE:
return emit_SNE(gen, inst);
+ case TGSI_OPCODE_CMP:
+ return emit_CMP(gen, inst);
case TGSI_OPCODE_MAX:
return emit_MAX(gen, inst);
case TGSI_OPCODE_MIN:
--
cgit v1.2.3
From 3bb864682944a391c81e7c52e9bb36ed53b853f5 Mon Sep 17 00:00:00 2001
From: "Xiang, Haihao"
Date: Fri, 12 Sep 2008 09:25:34 +0800
Subject: i965: Add support for G41 chipset which is another 4 series.
---
src/mesa/drivers/dri/intel/intel_chipset.h | 4 +++-
src/mesa/drivers/dri/intel/intel_context.c | 3 +++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/mesa/drivers/dri/intel/intel_chipset.h b/src/mesa/drivers/dri/intel/intel_chipset.h
index 15b9ef4312..170efd060a 100644
--- a/src/mesa/drivers/dri/intel/intel_chipset.h
+++ b/src/mesa/drivers/dri/intel/intel_chipset.h
@@ -58,6 +58,7 @@
#define PCI_CHIP_IGD_E_G 0x2E02
#define PCI_CHIP_Q45_G 0x2E12
#define PCI_CHIP_G45_G 0x2E22
+#define PCI_CHIP_G41_G 0x2E32
#define IS_MOBILE(devid) (devid == PCI_CHIP_I855_GM || \
devid == PCI_CHIP_I915_GM || \
@@ -70,7 +71,8 @@
#define IS_GM45_GM(devid) (devid == PCI_CHIP_GM45_GM)
#define IS_G4X(devid) (devid == PCI_CHIP_IGD_E_G || \
devid == PCI_CHIP_Q45_G || \
- devid == PCI_CHIP_G45_G)
+ devid == PCI_CHIP_G45_G || \
+ devid == PCI_CHIP_G41_G)
#define IS_915(devid) (devid == PCI_CHIP_I915_G || \
devid == PCI_CHIP_E7221_G || \
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 4d1a742698..7065bb35ee 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -179,6 +179,9 @@ intelGetString(GLcontext * ctx, GLenum name)
case PCI_CHIP_Q45_G:
chipset = "Intel(R) Q45/Q43";
break;
+ case PCI_CHIP_G41_G:
+ chipset = "Intel(R) G41";
+ break;
default:
chipset = "Unknown Intel Chipset";
break;
--
cgit v1.2.3
From 841205e365fabf7cfa5d4f6cdba80f6507086b4e Mon Sep 17 00:00:00 2001
From: George Sapountzis
Date: Fri, 12 Sep 2008 12:43:10 +0300
Subject: dri/swrast: fix swapBuffers after dri2
---
src/glx/x11/drisw_glx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c
index bcf7e144ef..ad7b5ebd0c 100644
--- a/src/glx/x11/drisw_glx.c
+++ b/src/glx/x11/drisw_glx.c
@@ -335,6 +335,11 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
return pdraw;
}
+static void driSwapBuffers(__GLXDRIdrawable *pdraw)
+{
+ (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable);
+}
+
static void driDestroyScreen(__GLXscreenConfigs *psc)
{
/* Free the direct rendering per screen data */
@@ -398,6 +403,7 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
psp->destroyScreen = driDestroyScreen;
psp->createContext = driCreateContext;
psp->createDrawable = driCreateDrawable;
+ psp->swapBuffers = driSwapBuffers;
return psp;
--
cgit v1.2.3
From 1074e8e4e47bb4af73c7ef730d0fec40e826cc7e Mon Sep 17 00:00:00 2001
From: Keith Whitwell
Date: Fri, 12 Sep 2008 15:10:50 +0100
Subject: mesa: bring sources into line with sources.mak, but omit gallium code
---
src/mesa/sources | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/src/mesa/sources b/src/mesa/sources
index 2db1843239..d006191f30 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -2,6 +2,7 @@
MAIN_SOURCES = \
main/api_arrayelt.c \
+ main/api_exec.c \
main/api_loopback.c \
main/api_noop.c \
main/api_validate.c \
@@ -11,6 +12,7 @@ MAIN_SOURCES = \
main/blend.c \
main/bufferobj.c \
main/buffers.c \
+ main/clear.c \
main/clip.c \
main/colortab.c \
main/context.c \
@@ -27,6 +29,7 @@ MAIN_SOURCES = \
main/extensions.c \
main/fbobject.c \
main/feedback.c \
+ main/ffvertex_prog.c \
main/fog.c \
main/framebuffer.c \
main/get.c \
@@ -41,23 +44,30 @@ MAIN_SOURCES = \
main/matrix.c \
main/mipmap.c \
main/mm.c \
+ main/multisample.c \
main/pixel.c \
+ main/pixelstore.c \
main/points.c \
main/polygon.c \
main/queryobj.c \
main/rastpos.c \
main/rbadaptors.c \
+ main/readpix.c \
main/renderbuffer.c \
+ main/scissor.c \
main/shaders.c \
main/state.c \
main/stencil.c \
main/texcompress.c \
main/texcompress_s3tc.c \
main/texcompress_fxt1.c \
+ main/texenv.c \
main/texenvprogram.c \
main/texformat.c \
+ main/texgen.c \
main/teximage.c \
main/texobj.c \
+ main/texparam.c \
main/texrender.c \
main/texstate.c \
main/texstore.c \
@@ -67,6 +77,7 @@ MAIN_SOURCES = \
GLAPI_SOURCES = \
main/dispatch.c \
glapi/glapi.c \
+ glapi/glapi_getproc.c \
glapi/glthread.c
MATH_SOURCES = \
@@ -118,6 +129,7 @@ TNL_SOURCES = \
tnl/t_context.c \
tnl/t_pipeline.c \
tnl/t_draw.c \
+ tnl/t_rasterpos.c \
tnl/t_vb_program.c \
tnl/t_vb_render.c \
tnl/t_vb_texgen.c \
@@ -159,6 +171,7 @@ SHADER_SOURCES = \
shader/nvprogram.c \
shader/nvvertparse.c \
shader/program.c \
+ shader/prog_cache.c \
shader/prog_debug.c \
shader/prog_execute.c \
shader/prog_instruction.c \
@@ -260,20 +273,19 @@ MESA_SOURCES = \
ALL_SOURCES = \
$(MESA_SOURCES) \
$(GLAPI_SOURCES) \
- $(ASM_SOURCES) \
+ $(MESA_ASM_SOURCES) \
$(COMMON_DRIVER_SOURCES)
-
### Object files
MESA_OBJECTS = \
$(MESA_SOURCES:.c=.o) \
- $(ASM_SOURCES:.S=.o)
+ $(MESA_ASM_SOURCES:.S=.o)
GLAPI_OBJECTS = \
$(GLAPI_SOURCES:.c=.o) \
- $(ASM_API:.S=.o)
+ $(GLAPI_ASM_SOURCES:.S=.o)
COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
@@ -284,13 +296,4 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
- -I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mesa/glapi \
- -I$(TOP)/src/mesa/math \
- -I$(TOP)/src/mesa/tnl \
- -I$(TOP)/src/mesa/shader \
- -I$(TOP)/src/mesa/shader/grammar \
- -I$(TOP)/src/mesa/shader/slang \
- -I$(TOP)/src/mesa/swrast \
- -I$(TOP)/src/mesa/swrast_setup
+ -I$(TOP)/src/mesa
--
cgit v1.2.3
From bbd287103dad776d8a45c87c4e51fbc26d9b80d5 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 12:26:54 -0600
Subject: mesa: prefix a bunch of #include lines with "main/".
This is another step toward removing a whole bunch of -I flags from
the cc commands. Still need to address driver code...
---
src/mesa/drivers/common/driverfuncs.c | 37 +++++++++++++++++-----------------
src/mesa/glapi/glapi.c | 2 +-
src/mesa/main/dispatch.c | 12 +++++------
src/mesa/math/m_debug_clip.c | 8 ++++----
src/mesa/math/m_debug_norm.c | 8 ++++----
src/mesa/math/m_debug_xform.c | 8 ++++----
src/mesa/math/m_matrix.c | 8 ++++----
src/mesa/math/m_translate.c | 6 +++---
src/mesa/math/m_vector.c | 8 ++++----
src/mesa/math/m_vector.h | 9 ++++-----
src/mesa/math/m_xform.h | 8 ++++----
src/mesa/ppc/common_ppc.c | 3 +++
src/mesa/ppc/common_ppc_features.h | 3 +++
src/mesa/shader/arbprogparse.c | 6 +++---
src/mesa/shader/arbprogparse.h | 2 +-
src/mesa/shader/arbprogram.c | 12 +++++------
src/mesa/shader/atifragshader.c | 14 ++++++-------
src/mesa/shader/grammar/grammar_mesa.h | 2 +-
src/mesa/shader/nvfragparse.c | 10 ++++-----
src/mesa/shader/nvprogram.c | 12 +++++------
src/mesa/shader/nvvertparse.c | 8 ++++----
src/mesa/shader/prog_debug.c | 6 +++---
src/mesa/shader/prog_execute.c | 6 +++---
src/mesa/shader/prog_instruction.c | 6 +++---
src/mesa/shader/prog_print.c | 6 +++---
src/mesa/shader/prog_statevars.c | 12 +++++------
src/mesa/shader/prog_statevars.h | 2 +-
src/mesa/shader/program.c | 6 +++---
src/mesa/shader/program.h | 2 +-
src/mesa/shader/shader_api.c | 18 ++++++++---------
src/mesa/shader/shader_api.h | 4 ++--
src/mesa/sources | 3 +++
src/mesa/swrast/s_aaline.c | 8 ++++----
src/mesa/swrast/s_aaline.h | 1 -
src/mesa/swrast/s_aatriangle.c | 12 +++++------
src/mesa/swrast/s_aatriangle.h | 1 -
src/mesa/swrast/s_accum.c | 10 ++++-----
src/mesa/swrast/s_accum.h | 2 +-
src/mesa/swrast/s_alpha.c | 8 ++++----
src/mesa/swrast/s_alpha.h | 1 -
src/mesa/swrast/s_atifragshader.c | 9 ++++-----
src/mesa/swrast/s_bitmap.c | 10 ++++-----
src/mesa/swrast/s_blend.c | 8 ++++----
src/mesa/swrast/s_blend.h | 1 -
src/mesa/swrast/s_blit.c | 4 ++--
src/mesa/swrast/s_buffers.c | 10 ++++-----
src/mesa/swrast/s_context.c | 14 ++++++-------
src/mesa/swrast/s_copypix.c | 18 ++++++++---------
src/mesa/swrast/s_depth.c | 10 ++++-----
src/mesa/swrast/s_depth.h | 1 -
src/mesa/swrast/s_drawpix.c | 18 ++++++++---------
src/mesa/swrast/s_drawpix.h | 1 -
src/mesa/swrast/s_feedback.c | 12 +++++------
src/mesa/swrast/s_feedback.h | 1 -
src/mesa/swrast/s_fog.c | 8 ++++----
src/mesa/swrast/s_fog.h | 1 -
src/mesa/swrast/s_imaging.c | 5 +++--
src/mesa/swrast/s_lines.c | 8 ++++----
src/mesa/swrast/s_lines.h | 2 +-
src/mesa/swrast/s_logic.c | 8 ++++----
src/mesa/swrast/s_logic.h | 1 -
src/mesa/swrast/s_masking.c | 4 ++--
src/mesa/swrast/s_masking.h | 1 -
src/mesa/swrast/s_points.c | 10 ++++-----
src/mesa/swrast/s_points.h | 2 +-
src/mesa/swrast/s_readpix.c | 22 ++++++++++----------
src/mesa/swrast/s_span.c | 12 +++++------
src/mesa/swrast/s_span.h | 1 -
src/mesa/swrast/s_stencil.c | 6 +++---
src/mesa/swrast/s_stencil.h | 1 -
src/mesa/swrast/s_texcombine.c | 12 +++++------
src/mesa/swrast/s_texcombine.h | 1 -
src/mesa/swrast/s_texfilter.c | 10 ++++-----
src/mesa/swrast/s_texfilter.h | 1 -
src/mesa/swrast/s_texstore.c | 22 ++++++++++----------
src/mesa/swrast/s_triangle.c | 12 +++++------
src/mesa/swrast/s_triangle.h | 1 -
src/mesa/swrast/s_zoom.c | 8 ++++----
src/mesa/swrast/s_zoom.h | 1 -
src/mesa/swrast_setup/ss_context.c | 13 ++++++------
src/mesa/swrast_setup/ss_context.h | 2 +-
src/mesa/swrast_setup/ss_triangle.c | 8 ++++----
src/mesa/swrast_setup/ss_triangle.h | 1 -
src/mesa/tnl/t_draw.c | 14 ++++++-------
src/mesa/tnl/t_pipeline.h | 2 +-
src/mesa/tnl/t_vb_cull.c | 12 +++++------
src/mesa/tnl/t_vb_fog.c | 12 +++++------
src/mesa/tnl/t_vb_light.c | 14 ++++++-------
src/mesa/tnl/t_vb_normals.c | 12 +++++------
src/mesa/tnl/t_vb_points.c | 4 ++--
src/mesa/tnl/t_vb_render.c | 12 +++++------
src/mesa/tnl/t_vb_texgen.c | 12 +++++------
src/mesa/tnl/t_vb_texmat.c | 12 +++++------
src/mesa/tnl/t_vb_vertex.c | 12 +++++------
src/mesa/tnl/t_vertex.c | 6 +++---
src/mesa/tnl/t_vertex.h | 2 +-
src/mesa/tnl/t_vertex_generic.c | 8 ++++----
src/mesa/tnl/t_vertex_sse.c | 10 ++++-----
src/mesa/tnl/t_vp_build.c | 6 +++---
src/mesa/tnl/t_vp_build.h | 2 +-
src/mesa/x86/3dnow.c | 4 ++--
src/mesa/x86/common_x86.c | 2 +-
src/mesa/x86/rtasm/x86sse.c | 2 +-
src/mesa/x86/sse.c | 4 ++--
src/mesa/x86/x86.c | 4 ++--
105 files changed, 381 insertions(+), 388 deletions(-)
diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c
index e61b9f59cf..f6411f303b 100644
--- a/src/mesa/drivers/common/driverfuncs.c
+++ b/src/mesa/drivers/common/driverfuncs.c
@@ -23,35 +23,36 @@
*/
-#include "glheader.h"
-#include "imports.h"
-#include "arrayobj.h"
-#include "buffers.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "mipmap.h"
-#include "queryobj.h"
-#include "renderbuffer.h"
-#include "texcompress.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "texstore.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/arrayobj.h"
+#include "main/buffers.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/mipmap.h"
+#include "main/queryobj.h"
+#include "main/renderbuffer.h"
+#include "main/texcompress.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
#if FEATURE_ARB_vertex_buffer_object
-#include "bufferobj.h"
+#include "main/bufferobj.h"
#endif
#if FEATURE_EXT_framebuffer_object
-#include "fbobject.h"
-#include "texrender.h"
+#include "main/fbobject.h"
+#include "main/texrender.h"
#endif
#include "shader/program.h"
#include "shader/prog_execute.h"
#include "shader/shader_api.h"
-#include "driverfuncs.h"
#include "tnl/tnl.h"
#include "swrast/swrast.h"
+#include "driverfuncs.h"
+
/**
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 08a26980e1..e939947cc9 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -57,7 +57,7 @@
#else
-#include "glheader.h"
+#include "main/glheader.h"
#endif
diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c
index 05c1c36c0d..34127cb248 100644
--- a/src/mesa/main/dispatch.c
+++ b/src/mesa/main/dispatch.c
@@ -39,10 +39,10 @@
#ifndef GLX_USE_APPLEGL
-#include "glheader.h"
-#include "glapi.h"
-#include "glapitable.h"
-#include "glthread.h"
+#include "main/glheader.h"
+#include "glapi/glapi.h"
+#include "glapi/glapitable.h"
+#include "glapi/glthread.h"
#if !(defined(USE_X86_ASM) || defined(USE_X86_64_ASM) || defined(USE_SPARC_ASM))
@@ -87,8 +87,8 @@
#define GLAPIENTRY
#endif
-#include "dispatch.h"
-#include "glapitemp.h"
+#include "glapi/dispatch.h"
+#include "glapi/glapitemp.h"
#endif /* USE_X86_ASM */
diff --git a/src/mesa/math/m_debug_clip.c b/src/mesa/math/m_debug_clip.c
index ab28818359..460fed4a75 100644
--- a/src/mesa/math/m_debug_clip.c
+++ b/src/mesa/math/m_debug_clip.c
@@ -25,10 +25,10 @@
* Gareth Hughes
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
#include "m_matrix.h"
#include "m_xform.h"
diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c
index 11cae6bba7..89c632e7d5 100644
--- a/src/mesa/math/m_debug_norm.c
+++ b/src/mesa/math/m_debug_norm.c
@@ -26,10 +26,10 @@
* Gareth Hughes
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
#include "m_matrix.h"
#include "m_xform.h"
diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c
index 2af837cf64..ec22c7052d 100644
--- a/src/mesa/math/m_debug_xform.c
+++ b/src/mesa/math/m_debug_xform.c
@@ -26,10 +26,10 @@
* Updated for P6 architecture by Gareth Hughes.
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
#include "m_matrix.h"
#include "m_xform.h"
diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c
index b4ba1bc2a0..84b4cae4ad 100644
--- a/src/mesa/math/m_matrix.c
+++ b/src/mesa/math/m_matrix.c
@@ -34,10 +34,10 @@
*/
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/imports.h"
#include "m_matrix.h"
diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c
index c7423e9d9d..4a20f45ee4 100644
--- a/src/mesa/math/m_translate.c
+++ b/src/mesa/math/m_translate.c
@@ -28,9 +28,9 @@
*/
-#include "glheader.h"
-#include "mtypes.h" /* GLchan hack */
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h" /* GLchan hack */
+#include "main/colormac.h"
#include "m_translate.h"
diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c
index 3ad81d468b..c5e2fd1de1 100644
--- a/src/mesa/math/m_vector.c
+++ b/src/mesa/math/m_vector.c
@@ -28,10 +28,10 @@
*/
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/imports.h"
#include "m_vector.h"
diff --git a/src/mesa/math/m_vector.h b/src/mesa/math/m_vector.h
index 222b47f6e1..647388ac7d 100644
--- a/src/mesa/math/m_vector.h
+++ b/src/mesa/math/m_vector.h
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 7.3
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -31,8 +30,8 @@
#ifndef _M_VECTOR_H_
#define _M_VECTOR_H_
-#include "glheader.h"
-#include "mtypes.h" /* hack for GLchan */
+#include "main/glheader.h"
+#include "main/mtypes.h" /* hack for GLchan */
#define VEC_DIRTY_0 0x1
diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h
index 99b071a46b..24e8ddbd57 100644
--- a/src/mesa/math/m_xform.h
+++ b/src/mesa/math/m_xform.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.1
+ * Version: 7.3
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -27,8 +27,8 @@
#define _M_XFORM_H
-#include "glheader.h"
-#include "config.h"
+#include "main/glheader.h"
+#include "main/config.h"
#include "math/m_vector.h"
#include "math/m_matrix.h"
diff --git a/src/mesa/ppc/common_ppc.c b/src/mesa/ppc/common_ppc.c
index 13526df78c..786e1817ac 100644
--- a/src/mesa/ppc/common_ppc.c
+++ b/src/mesa/ppc/common_ppc.c
@@ -38,6 +38,9 @@
#include
#endif
+#include "common_ppc_features.h"
+
+
unsigned long _mesa_ppc_cpu_features = 0;
/**
diff --git a/src/mesa/ppc/common_ppc_features.h b/src/mesa/ppc/common_ppc_features.h
index 4d46ca04c9..9cde422d72 100644
--- a/src/mesa/ppc/common_ppc_features.h
+++ b/src/mesa/ppc/common_ppc_features.h
@@ -48,4 +48,7 @@ extern unsigned long _mesa_ppc_cpu_features;
#define cpu_has_fpu ((_mesa_ppc_cpu_features & PPC_FEATURE_HAS_FPU) != 0)
#endif /* USE_PPC_ASM */
+
+extern void _mesa_init_all_ppc_transform_asm( void );
+
#endif /* COMMON_PPC_FEATURES_H */
diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c
index f10233e5fe..8ce5348c09 100644
--- a/src/mesa/shader/arbprogparse.c
+++ b/src/mesa/shader/arbprogparse.c
@@ -32,14 +32,14 @@
#include "main/glheader.h"
#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "shader/grammar/grammar_mesa.h"
#include "arbprogparse.h"
#include "program.h"
#include "prog_parameter.h"
#include "prog_statevars.h"
-#include "context.h"
-#include "macros.h"
-#include "mtypes.h"
#include "prog_instruction.h"
diff --git a/src/mesa/shader/arbprogparse.h b/src/mesa/shader/arbprogparse.h
index 4574e5cd55..980d39fb9f 100644
--- a/src/mesa/shader/arbprogparse.h
+++ b/src/mesa/shader/arbprogparse.h
@@ -26,7 +26,7 @@
#ifndef ARBPROGPARSE_H
#define ARBPROGPARSE_H
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void
_mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target,
diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c
index 81c20a0150..760dac2399 100644
--- a/src/mesa/shader/arbprogram.c
+++ b/src/mesa/shader/arbprogram.c
@@ -29,14 +29,14 @@
*/
-#include "glheader.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "arbprogram.h"
#include "arbprogparse.h"
-#include "context.h"
-#include "hash.h"
-#include "imports.h"
-#include "macros.h"
-#include "mtypes.h"
#include "program.h"
diff --git a/src/mesa/shader/atifragshader.c b/src/mesa/shader/atifragshader.c
index 854c911874..ac087d415c 100644
--- a/src/mesa/shader/atifragshader.c
+++ b/src/mesa/shader/atifragshader.c
@@ -21,13 +21,13 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
-#include "context.h"
-#include "hash.h"
-#include "imports.h"
-#include "macros.h"
-#include "enums.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
#include "atifragshader.h"
#define MESA_DEBUG_ATI_FS 0
diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h
index c14033a9d4..6c92c5812d 100644
--- a/src/mesa/shader/grammar/grammar_mesa.h
+++ b/src/mesa/shader/grammar/grammar_mesa.h
@@ -26,7 +26,7 @@
#define GRAMMAR_MESA_H
-#include "imports.h"
+#include "main/imports.h"
/* NOTE: include Mesa 3-D specific headers here */
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c
index 0f1a1eade4..20e4781372 100644
--- a/src/mesa/shader/nvfragparse.c
+++ b/src/mesa/shader/nvfragparse.c
@@ -37,14 +37,14 @@
* including any use thereof or modifications thereto.
*/
-#include "glheader.h"
-#include "context.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "program.h"
#include "prog_parameter.h"
#include "prog_instruction.h"
#include "nvfragparse.h"
-#include "program.h"
#define INPUT_1V 1
diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c
index 409c61cdc1..88272fff3f 100644
--- a/src/mesa/shader/nvprogram.c
+++ b/src/mesa/shader/nvprogram.c
@@ -37,17 +37,17 @@
* including any use thereof or modifications thereto.
*/
-#include "glheader.h"
-#include "context.h"
-#include "hash.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "program.h"
#include "prog_parameter.h"
#include "prog_instruction.h"
#include "nvfragparse.h"
#include "nvvertparse.h"
#include "nvprogram.h"
-#include "program.h"
diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c
index ac96d4a60e..08538c0ee4 100644
--- a/src/mesa/shader/nvvertparse.c
+++ b/src/mesa/shader/nvvertparse.c
@@ -37,10 +37,10 @@
* including any use thereof or modifications thereto.
*/
-#include "glheader.h"
-#include "context.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "nvprogram.h"
#include "nvvertparse.h"
#include "prog_instruction.h"
diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c
index 57929fcbca..7bcb2ef734 100644
--- a/src/mesa/shader/prog_debug.c
+++ b/src/mesa/shader/prog_debug.c
@@ -23,9 +23,9 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
#include "nvfragparse.h"
#include "nvvertparse.h"
#include "program.h"
diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c
index b9b7712f3f..e9957d3a5f 100644
--- a/src/mesa/shader/prog_execute.c
+++ b/src/mesa/shader/prog_execute.c
@@ -35,9 +35,9 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
#include "program.h"
#include "prog_execute.h"
#include "prog_instruction.h"
diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c
index bea5d0551e..1033496d97 100644
--- a/src/mesa/shader/prog_instruction.c
+++ b/src/mesa/shader/prog_instruction.c
@@ -23,9 +23,9 @@
*/
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "prog_instruction.h"
diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c
index 7343b761a2..32708ed706 100644
--- a/src/mesa/shader/prog_print.c
+++ b/src/mesa/shader/prog_print.c
@@ -28,9 +28,9 @@
* \author Brian Paul
*/
-#include "glheader.h"
-#include "context.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
#include "prog_instruction.h"
#include "prog_parameter.h"
#include "prog_print.h"
diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c
index 91392650a3..63f028567d 100644
--- a/src/mesa/shader/prog_statevars.c
+++ b/src/mesa/shader/prog_statevars.c
@@ -29,12 +29,12 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "hash.h"
-#include "imports.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "prog_statevars.h"
#include "prog_parameter.h"
#include "nvvertparse.h"
diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h
index da75ca77a1..2efe166e1a 100644
--- a/src/mesa/shader/prog_statevars.h
+++ b/src/mesa/shader/prog_statevars.h
@@ -25,7 +25,7 @@
#ifndef PROG_STATEVARS_H
#define PROG_STATEVARS_H
-#include "mtypes.h"
+#include "main/mtypes.h"
/**
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 693d73baa2..9f9d5955ea 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -29,9 +29,9 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "hash.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
#include "program.h"
#include "prog_parameter.h"
#include "prog_instruction.h"
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index d227aaa1ca..48176162c3 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -40,7 +40,7 @@
#ifndef PROGRAM_H
#define PROGRAM_H
-#include "mtypes.h"
+#include "main/mtypes.h"
extern struct gl_program _mesa_DummyProgram;
diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c
index 430d165a82..7c5a20bbbe 100644
--- a/src/mesa/shader/shader_api.c
+++ b/src/mesa/shader/shader_api.c
@@ -35,15 +35,15 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "hash.h"
-#include "macros.h"
-#include "program.h"
-#include "prog_parameter.h"
-#include "prog_print.h"
-#include "prog_statevars.h"
-#include "prog_uniform.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/hash.h"
+#include "main/macros.h"
+#include "shader/program.h"
+#include "shader/prog_parameter.h"
+#include "shader/prog_print.h"
+#include "shader/prog_statevars.h"
+#include "shader/prog_uniform.h"
#include "shader/shader_api.h"
#include "shader/slang/slang_compile.h"
#include "shader/slang/slang_link.h"
diff --git a/src/mesa/shader/shader_api.h b/src/mesa/shader/shader_api.h
index 5521c585b5..e7f1266915 100644
--- a/src/mesa/shader/shader_api.h
+++ b/src/mesa/shader/shader_api.h
@@ -27,8 +27,8 @@
#define SHADER_API_H
-#include "glheader.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
/**
diff --git a/src/mesa/sources b/src/mesa/sources
index 2db1843239..bc8498d0e7 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -281,6 +281,9 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
### Include directories
+### XXX we should be able to trim this down to just -Iinclude/ and -Isrc/mesa/
+### since most #includes have been changed from #include "mtypes.h" to
+### #include "main/mtypes.h", etc.
INCLUDE_DIRS = \
-I$(TOP)/include \
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index d6a9afb421..9bfa8f2e61 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -23,14 +23,14 @@
*/
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "swrast/s_aaline.h"
#include "swrast/s_context.h"
#include "swrast/s_span.h"
#include "swrast/swrast.h"
-#include "mtypes.h"
#define SUB_PIXEL 4
diff --git a/src/mesa/swrast/s_aaline.h b/src/mesa/swrast/s_aaline.h
index 41e7e5fd4d..f1d708ec80 100644
--- a/src/mesa/swrast/s_aaline.h
+++ b/src/mesa/swrast/s_aaline.h
@@ -28,7 +28,6 @@
#define S_AALINE_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c
index 66891f9fec..078f16aea0 100644
--- a/src/mesa/swrast/s_aatriangle.c
+++ b/src/mesa/swrast/s_aatriangle.c
@@ -28,12 +28,12 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
#include "s_aatriangle.h"
#include "s_context.h"
#include "s_span.h"
diff --git a/src/mesa/swrast/s_aatriangle.h b/src/mesa/swrast/s_aatriangle.h
index ebb828eb19..4b57fa73a2 100644
--- a/src/mesa/swrast/s_aatriangle.h
+++ b/src/mesa/swrast/s_aatriangle.h
@@ -28,7 +28,6 @@
#define S_AATRIANGLE_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index b74f794d09..ff741777e7 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -23,11 +23,11 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "fbobject.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/fbobject.h"
#include "s_accum.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_accum.h b/src/mesa/swrast/s_accum.h
index 97d2bef4c3..42e38cf02b 100644
--- a/src/mesa/swrast/s_accum.h
+++ b/src/mesa/swrast/s_accum.h
@@ -27,7 +27,7 @@
#define S_ACCUM_H
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void
diff --git a/src/mesa/swrast/s_alpha.c b/src/mesa/swrast/s_alpha.c
index 3c55d3e9e3..5761bb00b4 100644
--- a/src/mesa/swrast/s_alpha.c
+++ b/src/mesa/swrast/s_alpha.c
@@ -27,10 +27,10 @@
* \brief Functions to apply alpha test.
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "s_alpha.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_alpha.h b/src/mesa/swrast/s_alpha.h
index a85ef8a83a..7a5b72e650 100644
--- a/src/mesa/swrast/s_alpha.h
+++ b/src/mesa/swrast/s_alpha.h
@@ -28,7 +28,6 @@
#define S_ALPHA_H
-#include "mtypes.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 55ec757ee0..21cbd3cf37 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -1,5 +1,4 @@
/*
- *
* Copyright (C) 2004 David Airlie All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -20,10 +19,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
#include "shader/program.h"
#include "shader/atifragshader.h"
#include "swrast/s_atifragshader.h"
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index f3dda12e25..35b34e654f 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -28,11 +28,11 @@
* \author Brian Paul
*/
-#include "glheader.h"
-#include "bufferobj.h"
-#include "image.h"
-#include "macros.h"
-#include "pixel.h"
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/pixel.h"
#include "s_context.h"
#include "s_span.h"
diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c
index 4531f0ae02..95c83432a9 100644
--- a/src/mesa/swrast/s_blend.c
+++ b/src/mesa/swrast/s_blend.c
@@ -35,10 +35,10 @@
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "s_blend.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_blend.h b/src/mesa/swrast/s_blend.h
index 0b8cbed1a0..8d5a81635d 100644
--- a/src/mesa/swrast/s_blend.h
+++ b/src/mesa/swrast/s_blend.h
@@ -27,7 +27,6 @@
#define S_BLEND_H
-#include "mtypes.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_blit.c b/src/mesa/swrast/s_blit.c
index af4350990c..bc4b2ac625 100644
--- a/src/mesa/swrast/s_blit.c
+++ b/src/mesa/swrast/s_blit.c
@@ -23,8 +23,8 @@
*/
-#include "glheader.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/macros.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 0d1e9bac1c..9e87d6d485 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -24,11 +24,11 @@
/** XXX This file should be named s_clear.c */
-#include "glheader.h"
-#include "colormac.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "s_accum.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index b64156a82d..62857ddeb0 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -26,15 +26,15 @@
* Brian Paul
*/
-#include "imports.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "colormac.h"
-#include "mtypes.h"
-#include "teximage.h"
-#include "swrast.h"
+#include "main/imports.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/mtypes.h"
+#include "main/teximage.h"
#include "shader/prog_parameter.h"
#include "shader/prog_statevars.h"
+#include "swrast.h"
#include "s_blend.h"
#include "s_context.h"
#include "s_lines.h"
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 3962721a61..fc5990b261 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -23,15 +23,15 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "convolve.h"
-#include "histogram.h"
-#include "image.h"
-#include "macros.h"
-#include "imports.h"
-#include "pixel.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/convolve.h"
+#include "main/histogram.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/pixel.h"
#include "s_context.h"
#include "s_depth.h"
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 408174c990..293eb8628e 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -23,11 +23,11 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "fbobject.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/fbobject.h"
#include "s_depth.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_depth.h b/src/mesa/swrast/s_depth.h
index d1ed050efd..3688625683 100644
--- a/src/mesa/swrast/s_depth.h
+++ b/src/mesa/swrast/s_depth.h
@@ -27,7 +27,6 @@
#define S_DEPTH_H
-#include "mtypes.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 730798c908..b0ba2a4a4e 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -23,15 +23,15 @@
*/
-#include "glheader.h"
-#include "bufferobj.h"
-#include "context.h"
-#include "convolve.h"
-#include "image.h"
-#include "macros.h"
-#include "imports.h"
-#include "pixel.h"
-#include "state.h"
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/context.h"
+#include "main/convolve.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/pixel.h"
+#include "main/state.h"
#include "s_context.h"
#include "s_drawpix.h"
diff --git a/src/mesa/swrast/s_drawpix.h b/src/mesa/swrast/s_drawpix.h
index 66067115dd..706c42a0f8 100644
--- a/src/mesa/swrast/s_drawpix.h
+++ b/src/mesa/swrast/s_drawpix.h
@@ -28,7 +28,6 @@
#define S_DRAWPIXELS_H
-#include "mtypes.h"
#include "swrast.h"
/* XXX kill this header? */
diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c
index 07b7409ab5..aa79531277 100644
--- a/src/mesa/swrast/s_feedback.c
+++ b/src/mesa/swrast/s_feedback.c
@@ -22,12 +22,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "feedback.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/feedback.h"
+#include "main/macros.h"
#include "s_context.h"
#include "s_feedback.h"
diff --git a/src/mesa/swrast/s_feedback.h b/src/mesa/swrast/s_feedback.h
index 73f45c10be..9feab75dbb 100644
--- a/src/mesa/swrast/s_feedback.h
+++ b/src/mesa/swrast/s_feedback.h
@@ -28,7 +28,6 @@
#define S_FEEDBACK_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_fog.c b/src/mesa/swrast/s_fog.c
index 7b143f6e5b..b9ba265db6 100644
--- a/src/mesa/swrast/s_fog.c
+++ b/src/mesa/swrast/s_fog.c
@@ -23,10 +23,10 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
#include "s_context.h"
#include "s_fog.h"
diff --git a/src/mesa/swrast/s_fog.h b/src/mesa/swrast/s_fog.h
index 9639bee2cc..50760d88af 100644
--- a/src/mesa/swrast/s_fog.h
+++ b/src/mesa/swrast/s_fog.h
@@ -28,7 +28,6 @@
#define S_FOG_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c
index 73aaba1ec9..591857c342 100644
--- a/src/mesa/swrast/s_imaging.c
+++ b/src/mesa/swrast/s_imaging.c
@@ -27,10 +27,11 @@
* extensions into either swrast or a sister module.
*/
+#include "main/glheader.h"
+#include "main/colortab.h"
+#include "main/convolve.h"
#include "s_context.h"
#include "s_span.h"
-#include "colortab.h"
-#include "convolve.h"
void
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index 3de438760b..23cb9b57ef 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -23,10 +23,10 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "s_aaline.h"
#include "s_context.h"
#include "s_depth.h"
diff --git a/src/mesa/swrast/s_lines.h b/src/mesa/swrast/s_lines.h
index 5372b99b91..22979a02b6 100644
--- a/src/mesa/swrast/s_lines.h
+++ b/src/mesa/swrast/s_lines.h
@@ -27,7 +27,7 @@
#ifndef S_LINES_H
#define S_LINES_H
-#include "mtypes.h"
+#include "swrast.h"
void
_swrast_choose_line( GLcontext *ctx );
diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c
index 0af9063968..f0274b4c0b 100644
--- a/src/mesa/swrast/s_logic.c
+++ b/src/mesa/swrast/s_logic.c
@@ -23,10 +23,10 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "s_context.h"
#include "s_logic.h"
diff --git a/src/mesa/swrast/s_logic.h b/src/mesa/swrast/s_logic.h
index 0bc2c3f8a8..ba20cd7b32 100644
--- a/src/mesa/swrast/s_logic.h
+++ b/src/mesa/swrast/s_logic.h
@@ -27,7 +27,6 @@
#define S_LOGIC_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_masking.c b/src/mesa/swrast/s_masking.c
index a69720e83a..df779b0739 100644
--- a/src/mesa/swrast/s_masking.c
+++ b/src/mesa/swrast/s_masking.c
@@ -28,8 +28,8 @@
*/
-#include "glheader.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/macros.h"
#include "s_context.h"
#include "s_masking.h"
diff --git a/src/mesa/swrast/s_masking.h b/src/mesa/swrast/s_masking.h
index 0596cb3f45..3260ca34e3 100644
--- a/src/mesa/swrast/s_masking.h
+++ b/src/mesa/swrast/s_masking.h
@@ -27,7 +27,6 @@
#define S_MASKING_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index 1a8fd7d6db..846c485f15 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -23,11 +23,11 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "texstate.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/texstate.h"
#include "s_context.h"
#include "s_feedback.h"
#include "s_points.h"
diff --git a/src/mesa/swrast/s_points.h b/src/mesa/swrast/s_points.h
index 40b442e951..9e39c601ef 100644
--- a/src/mesa/swrast/s_points.h
+++ b/src/mesa/swrast/s_points.h
@@ -27,7 +27,7 @@
#ifndef S_POINTS_H
#define S_POINTS_H
-#include "mtypes.h"
+#include "swrast.h"
extern void
_swrast_choose_point( GLcontext *ctx );
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 9140d12ea0..f263045170 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -23,17 +23,17 @@
*/
-#include "glheader.h"
-#include "bufferobj.h"
-#include "colormac.h"
-#include "convolve.h"
-#include "context.h"
-#include "feedback.h"
-#include "image.h"
-#include "macros.h"
-#include "imports.h"
-#include "pixel.h"
-#include "state.h"
+#include "main/glheader.h"
+#include "main/bufferobj.h"
+#include "main/colormac.h"
+#include "main/convolve.h"
+#include "main/context.h"
+#include "main/feedback.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/pixel.h"
+#include "main/state.h"
#include "s_context.h"
#include "s_depth.h"
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c
index 4c58f8de87..214c2a1b6f 100644
--- a/src/mesa/swrast/s_span.c
+++ b/src/mesa/swrast/s_span.c
@@ -30,12 +30,12 @@
* \author Brian Paul
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "image.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/image.h"
#include "s_atifragshader.h"
#include "s_alpha.h"
diff --git a/src/mesa/swrast/s_span.h b/src/mesa/swrast/s_span.h
index 512134db0f..c4b47df58f 100644
--- a/src/mesa/swrast/s_span.h
+++ b/src/mesa/swrast/s_span.h
@@ -27,7 +27,6 @@
#define S_SPAN_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index cae1e09929..c925922463 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -23,9 +23,9 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
#include "s_context.h"
#include "s_depth.h"
diff --git a/src/mesa/swrast/s_stencil.h b/src/mesa/swrast/s_stencil.h
index 1fcb538fec..cd6cbc57b0 100644
--- a/src/mesa/swrast/s_stencil.h
+++ b/src/mesa/swrast/s_stencil.h
@@ -27,7 +27,6 @@
#define S_STENCIL_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
index 4ac7222daa..4e3d329075 100644
--- a/src/mesa/swrast/s_texcombine.c
+++ b/src/mesa/swrast/s_texcombine.c
@@ -23,12 +23,12 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "imports.h"
-#include "macros.h"
-#include "pixel.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/pixel.h"
#include "s_context.h"
#include "s_texcombine.h"
diff --git a/src/mesa/swrast/s_texcombine.h b/src/mesa/swrast/s_texcombine.h
index 3bf70e0b86..9ed96efb87 100644
--- a/src/mesa/swrast/s_texcombine.h
+++ b/src/mesa/swrast/s_texcombine.h
@@ -27,7 +27,6 @@
#define S_TEXCOMBINE_H
-#include "mtypes.h"
#include "swrast.h"
extern void
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index ee6131649a..9e44fba3da 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -23,11 +23,11 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "imports.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/texformat.h"
#include "s_context.h"
#include "s_texfilter.h"
diff --git a/src/mesa/swrast/s_texfilter.h b/src/mesa/swrast/s_texfilter.h
index e4445e79a0..2e265d685c 100644
--- a/src/mesa/swrast/s_texfilter.h
+++ b/src/mesa/swrast/s_texfilter.h
@@ -27,7 +27,6 @@
#define S_TEXFILTER_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c
index 547d5b9ea0..15d52aa587 100644
--- a/src/mesa/swrast/s_texstore.c
+++ b/src/mesa/swrast/s_texstore.c
@@ -36,17 +36,17 @@
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "convolve.h"
-#include "image.h"
-#include "macros.h"
-#include "mipmap.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/convolve.h"
+#include "main/image.h"
+#include "main/macros.h"
+#include "main/mipmap.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
#include "s_context.h"
#include "s_depth.h"
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index 59e15645f3..2033ab5529 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -29,12 +29,12 @@
* functions to draw triangles.
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
-#include "imports.h"
-#include "macros.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/texformat.h"
#include "s_aatriangle.h"
#include "s_context.h"
diff --git a/src/mesa/swrast/s_triangle.h b/src/mesa/swrast/s_triangle.h
index 0de812500c..b81932c730 100644
--- a/src/mesa/swrast/s_triangle.h
+++ b/src/mesa/swrast/s_triangle.h
@@ -28,7 +28,6 @@
#define S_TRIANGLES_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index 4473078b78..a48eae1925 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -22,10 +22,10 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
-#include "macros.h"
-#include "imports.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/colormac.h"
#include "s_context.h"
#include "s_span.h"
diff --git a/src/mesa/swrast/s_zoom.h b/src/mesa/swrast/s_zoom.h
index 6ca11ac211..d2815b41a0 100644
--- a/src/mesa/swrast/s_zoom.h
+++ b/src/mesa/swrast/s_zoom.h
@@ -25,7 +25,6 @@
#ifndef S_ZOOM_H
#define S_ZOOM_H
-#include "mtypes.h"
#include "swrast.h"
diff --git a/src/mesa/swrast_setup/ss_context.c b/src/mesa/swrast_setup/ss_context.c
index a4f949ddfe..f4d90c514b 100644
--- a/src/mesa/swrast_setup/ss_context.c
+++ b/src/mesa/swrast_setup/ss_context.c
@@ -25,16 +25,17 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "ss_context.h"
-#include "ss_triangle.h"
-#include "swrast_setup.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/colormac.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "tnl/t_vertex.h"
+#include "swrast_setup.h"
+#include "ss_context.h"
+#include "ss_triangle.h"
+
/* Need to check lighting state and vertex program state to know
* if two-sided lighting is in effect.
diff --git a/src/mesa/swrast_setup/ss_context.h b/src/mesa/swrast_setup/ss_context.h
index 11f9ded3ff..1ec293fade 100644
--- a/src/mesa/swrast_setup/ss_context.h
+++ b/src/mesa/swrast_setup/ss_context.h
@@ -28,7 +28,7 @@
#ifndef SS_CONTEXT_H
#define SS_CONTEXT_H
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#include "swrast_setup.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c
index 5a0f1f2429..54e24c4c44 100644
--- a/src/mesa/swrast_setup/ss_triangle.c
+++ b/src/mesa/swrast_setup/ss_triangle.c
@@ -25,10 +25,10 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/swrast_setup/ss_triangle.h b/src/mesa/swrast_setup/ss_triangle.h
index 78833269e6..007fa2e914 100644
--- a/src/mesa/swrast_setup/ss_triangle.h
+++ b/src/mesa/swrast_setup/ss_triangle.h
@@ -29,7 +29,6 @@
#ifndef SS_TRIANGLE_H
#define SS_TRIANGLE_H
-#include "mtypes.h"
#include "ss_context.h"
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 46b8b536a2..fd647c1f4a 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -25,13 +25,13 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "context.h"
-#include "imports.h"
-#include "state.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/state.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "t_context.h"
#include "t_pipeline.h"
diff --git a/src/mesa/tnl/t_pipeline.h b/src/mesa/tnl/t_pipeline.h
index 0952854b85..d110010f04 100644
--- a/src/mesa/tnl/t_pipeline.h
+++ b/src/mesa/tnl/t_pipeline.h
@@ -30,7 +30,7 @@
#ifndef _T_PIPELINE_H_
#define _T_PIPELINE_H_
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "t_context.h"
extern void _tnl_run_pipeline( GLcontext *ctx );
diff --git a/src/mesa/tnl/t_vb_cull.c b/src/mesa/tnl/t_vb_cull.c
index 21a32e5b1d..712901acf3 100644
--- a/src/mesa/tnl/t_vb_cull.c
+++ b/src/mesa/tnl/t_vb_cull.c
@@ -26,12 +26,12 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "math/m_xform.h"
diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c
index 99e5a09c75..f3a7bd49f4 100644
--- a/src/mesa/tnl/t_vb_fog.c
+++ b/src/mesa/tnl/t_vb_fog.c
@@ -26,12 +26,12 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "math/m_xform.h"
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c
index 12f2cc7735..f47f99397c 100644
--- a/src/mesa/tnl/t_vb_light.c
+++ b/src/mesa/tnl/t_vb_light.c
@@ -24,13 +24,13 @@
-#include "glheader.h"
-#include "colormac.h"
-#include "light.h"
-#include "macros.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/light.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "main/mtypes.h"
#include "math/m_translate.h"
diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c
index 01fad0cee2..a4821cc1cc 100644
--- a/src/mesa/tnl/t_vb_normals.c
+++ b/src/mesa/tnl/t_vb_normals.c
@@ -26,12 +26,12 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "math/m_xform.h"
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index 1ac14fedf9..01d055c1dd 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -25,8 +25,8 @@
* Brian Paul
*/
-#include "mtypes.h"
-#include "imports.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
#include "t_context.h"
#include "t_pipeline.h"
diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c
index c38f0745e1..c1bebc9942 100644
--- a/src/mesa/tnl/t_vb_render.c
+++ b/src/mesa/tnl/t_vb_render.c
@@ -38,12 +38,12 @@
*/
-#include "glheader.h"
-#include "context.h"
-#include "enums.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "t_pipeline.h"
diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c
index e98ab743c5..14d3876e54 100644
--- a/src/mesa/tnl/t_vb_texgen.c
+++ b/src/mesa/tnl/t_vb_texgen.c
@@ -35,12 +35,12 @@
* including any use thereof or modifications thereto.
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "math/m_xform.h"
diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c
index 674d36f8cb..0abe8cc35d 100644
--- a/src/mesa/tnl/t_vb_texmat.c
+++ b/src/mesa/tnl/t_vb_texmat.c
@@ -26,12 +26,12 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "math/m_xform.h"
diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c
index 276305b5e6..30aa7c4086 100644
--- a/src/mesa/tnl/t_vb_vertex.c
+++ b/src/mesa/tnl/t_vb_vertex.c
@@ -26,12 +26,12 @@
*/
-#include "glheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "math/m_xform.h"
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index a6728c318f..b661524c87 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -25,9 +25,9 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
#include "t_context.h"
#include "t_vertex.h"
diff --git a/src/mesa/tnl/t_vertex.h b/src/mesa/tnl/t_vertex.h
index fda8f151d3..712311a146 100644
--- a/src/mesa/tnl/t_vertex.h
+++ b/src/mesa/tnl/t_vertex.h
@@ -28,7 +28,7 @@
#ifndef _TNL_VERTEX_H
#define _TNL_VERTEX_H
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "t_context.h"
/* New mechanism to specify hardware vertices so that tnl can build
diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c
index 236a5bedc8..db70ad4dad 100644
--- a/src/mesa/tnl/t_vertex_generic.c
+++ b/src/mesa/tnl/t_vertex_generic.c
@@ -26,12 +26,12 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/simple_list.h"
#include "t_context.h"
#include "t_vertex.h"
-#include "simple_list.h"
diff --git a/src/mesa/tnl/t_vertex_sse.c b/src/mesa/tnl/t_vertex_sse.c
index f1c98fe2d1..76043bd1b5 100644
--- a/src/mesa/tnl/t_vertex_sse.c
+++ b/src/mesa/tnl/t_vertex_sse.c
@@ -25,13 +25,13 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "context.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
#include "t_context.h"
#include "t_vertex.h"
-#include "simple_list.h"
-#include "enums.h"
#if defined(USE_SSE_ASM)
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index cb879da93f..1a2d9b8a57 100644
--- a/src/mesa/tnl/t_vp_build.c
+++ b/src/mesa/tnl/t_vp_build.c
@@ -30,9 +30,9 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
diff --git a/src/mesa/tnl/t_vp_build.h b/src/mesa/tnl/t_vp_build.h
index 4a98fff026..2ad3abe45a 100644
--- a/src/mesa/tnl/t_vp_build.h
+++ b/src/mesa/tnl/t_vp_build.h
@@ -26,7 +26,7 @@
#ifndef _T_ARB_BUILD_H
#define _T_ARB_BUILD_H
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx );
diff --git a/src/mesa/x86/3dnow.c b/src/mesa/x86/3dnow.c
index 032aa661f4..be3d40de71 100644
--- a/src/mesa/x86/3dnow.c
+++ b/src/mesa/x86/3dnow.c
@@ -29,8 +29,8 @@
* Holger Waechtler
*/
-#include "glheader.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/context.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c
index 0caa36a5a0..5321547935 100644
--- a/src/mesa/x86/common_x86.c
+++ b/src/mesa/x86/common_x86.c
@@ -48,8 +48,8 @@
#include
#endif
+#include "main/imports.h"
#include "common_x86_asm.h"
-#include "imports.h"
int _mesa_x86_cpu_features = 0;
diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c
index 772471c723..e68f8dfec1 100644
--- a/src/mesa/x86/rtasm/x86sse.c
+++ b/src/mesa/x86/rtasm/x86sse.c
@@ -1,6 +1,6 @@
#if defined(__i386__) || defined(__386__)
-#include "imports.h"
+#include "main/imports.h"
#include "x86sse.h"
#define DISASSEM 0
diff --git a/src/mesa/x86/sse.c b/src/mesa/x86/sse.c
index 4b016a1e85..1c185387c6 100644
--- a/src/mesa/x86/sse.c
+++ b/src/mesa/x86/sse.c
@@ -27,8 +27,8 @@
* Andre Werthmann
*/
-#include "glheader.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/context.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/x86/x86.c b/src/mesa/x86/x86.c
index 6b74e9e375..69f7610398 100644
--- a/src/mesa/x86/x86.c
+++ b/src/mesa/x86/x86.c
@@ -28,8 +28,8 @@
* Intel x86 assembly code by Josh Vanderhoof
*/
-#include "glheader.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/context.h"
#include "math/m_xform.h"
#include "tnl/t_context.h"
--
cgit v1.2.3
From 3537da87de2601fa53eeda3e8d7fa0bca6eb6716 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 13:23:06 -0600
Subject: glx: remove depency on glheader.h and GLboolean type in XF86DRI code
Return Bool instead of GLboolean to match other functions.
Define PUBLIC/USED macros locally.
---
src/glx/x11/XF86dri.c | 20 +++++++++++++++-----
src/glx/x11/xf86dri.h | 6 +++---
2 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/src/glx/x11/XF86dri.c b/src/glx/x11/XF86dri.c
index 5b0bf14afe..a33de935ee 100644
--- a/src/glx/x11/XF86dri.c
+++ b/src/glx/x11/XF86dri.c
@@ -43,9 +43,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
#include
#include
-#include "glheader.h"
#include "xf86dristr.h"
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+# define PUBLIC __attribute__((visibility("default")))
+# define USED __attribute__((used))
+#else
+# define PUBLIC
+# define USED
+#endif
+
+
+
static XExtensionInfo _xf86dri_info_data;
static XExtensionInfo *xf86dri_info = &_xf86dri_info_data;
static char xf86dri_extension_name[] = XF86DRINAME;
@@ -375,7 +385,7 @@ PUBLIC Bool XF86DRICreateContext(dpy, screen, visual, context, hHWContext)
context, hHWContext );
}
-PUBLIC GLboolean XF86DRIDestroyContext(Display *dpy, int screen,
+PUBLIC Bool XF86DRIDestroyContext(Display *dpy, int screen,
XID context )
{
XExtDisplayInfo *info = find_display (dpy);
@@ -396,7 +406,7 @@ PUBLIC GLboolean XF86DRIDestroyContext(Display *dpy, int screen,
return True;
}
-PUBLIC GLboolean XF86DRICreateDrawable(Display *dpy, int screen,
+PUBLIC Bool XF86DRICreateDrawable(Display *dpy, int screen,
XID drawable, drm_drawable_t * hHWDrawable )
{
XExtDisplayInfo *info = find_display (dpy);
@@ -430,7 +440,7 @@ static int noopErrorHandler(Display *dpy, XErrorEvent *xerr)
return 0;
}
-PUBLIC GLboolean XF86DRIDestroyDrawable(Display *dpy, int screen,
+PUBLIC Bool XF86DRIDestroyDrawable(Display *dpy, int screen,
XID drawable )
{
XExtDisplayInfo *info = find_display (dpy);
@@ -452,7 +462,7 @@ PUBLIC GLboolean XF86DRIDestroyDrawable(Display *dpy, int screen,
* the windows is gone, by wrapping the destroy call in an error
* handler. */
- XSync(dpy, GL_FALSE);
+ XSync(dpy, False);
oldXErrorHandler = XSetErrorHandler(noopErrorHandler);
LockDisplay(dpy);
diff --git a/src/glx/x11/xf86dri.h b/src/glx/x11/xf86dri.h
index cd650b5829..a7d2a896d1 100644
--- a/src/glx/x11/xf86dri.h
+++ b/src/glx/x11/xf86dri.h
@@ -92,13 +92,13 @@ Bool XF86DRICreateContext( Display *dpy, int screen, Visual *visual,
Bool XF86DRICreateContextWithConfig( Display *dpy, int screen, int configID,
XID *ptr_to_returned_context_id, drm_context_t *hHWContext );
-extern GLboolean XF86DRIDestroyContext( Display *dpy, int screen,
+extern Bool XF86DRIDestroyContext( Display *dpy, int screen,
XID context_id );
-extern GLboolean XF86DRICreateDrawable( Display *dpy, int screen,
+extern Bool XF86DRICreateDrawable( Display *dpy, int screen,
XID drawable, drm_drawable_t *hHWDrawable );
-extern GLboolean XF86DRIDestroyDrawable( Display *dpy, int screen,
+extern Bool XF86DRIDestroyDrawable( Display *dpy, int screen,
XID drawable);
Bool XF86DRIGetDrawableInfo( Display *dpy, int screen, Drawable drawable,
--
cgit v1.2.3
From a25e1aa0aab6bd278eefa7c0748b491c9c6ae62c Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 13:26:30 -0600
Subject: glx: remove #include "glheader.h" lines
Was only used to get the PUBLIC/USED macros.
Also, replace "GL_FALSE" with "False" in a couple places.
---
src/glx/x11/Makefile | 1 -
src/glx/x11/dri2.c | 3 +--
src/glx/x11/dri2_glx.c | 1 -
src/glx/x11/dri_common.c | 2 +-
src/glx/x11/dri_glx.c | 1 -
src/glx/x11/drisw_glx.c | 1 -
src/glx/x11/glx_pbuffer.c | 1 -
src/glx/x11/glxclient.h | 17 +++++++++++++++++
src/glx/x11/glxcmds.c | 1 -
src/glx/x11/glxcurrent.c | 1 -
src/glx/x11/glxext.c | 2 +-
src/glx/x11/glxextensions.c | 2 +-
src/glx/x11/indirect_vertex_program.c | 1 -
src/glx/x11/pixelstore.c | 1 -
src/glx/x11/singlepix.c | 1 -
15 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/src/glx/x11/Makefile b/src/glx/x11/Makefile
index 5d9c61c983..8d4a23ff17 100644
--- a/src/glx/x11/Makefile
+++ b/src/glx/x11/Makefile
@@ -50,7 +50,6 @@ OBJECTS = $(SOURCES:.c=.o) $(MESA_GLAPI_OBJECTS)
INCLUDES = -I. \
-I$(TOP)/include \
-I$(TOP)/include/GL/internal \
- -I$(TOP)/src/mesa/main \
-I$(TOP)/src/mesa/glapi \
$(LIBDRM_CFLAGS) \
$(DRI2PROTO_CFLAGS) \
diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c
index dc60af90c1..5acf7ac531 100644
--- a/src/glx/x11/dri2.c
+++ b/src/glx/x11/dri2.c
@@ -36,7 +36,6 @@
#include
#include
#include
-#include "glheader.h"
#include "xf86drm.h"
#include "dri2.h"
@@ -289,7 +288,7 @@ void DRI2DestroyDrawable(Display *dpy, XID drawable)
XextSimpleCheckExtension (dpy, info, dri2ExtensionName);
- XSync(dpy, GL_FALSE);
+ XSync(dpy, False);
LockDisplay(dpy);
GetReq(DRI2DestroyDrawable, req);
diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c
index 3c366bfa1e..ed9054627f 100644
--- a/src/glx/x11/dri2_glx.c
+++ b/src/glx/x11/dri2_glx.c
@@ -35,7 +35,6 @@
#include
#include
#include
-#include "glheader.h"
#include "glxclient.h"
#include "glcontextmodes.h"
#include "xf86dri.h"
diff --git a/src/glx/x11/dri_common.c b/src/glx/x11/dri_common.c
index 8175f46c54..fbce6ac3e3 100644
--- a/src/glx/x11/dri_common.c
+++ b/src/glx/x11/dri_common.c
@@ -37,7 +37,7 @@
#include
#include
-#include "glheader.h"
+#include
#include "glxclient.h"
#include "glcontextmodes.h"
#include "dri_common.h"
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c
index 39bf6c430b..47203f5008 100644
--- a/src/glx/x11/dri_glx.c
+++ b/src/glx/x11/dri_glx.c
@@ -37,7 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
#include
#include
-#include "glheader.h"
#include "glxclient.h"
#include "glcontextmodes.h"
#include "xf86dri.h"
diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c
index ad7b5ebd0c..7bb4794f30 100644
--- a/src/glx/x11/drisw_glx.c
+++ b/src/glx/x11/drisw_glx.c
@@ -24,7 +24,6 @@
#ifdef GLX_DIRECT_RENDERING
#include
-#include "glheader.h"
#include "glxclient.h"
#include "glcontextmodes.h"
#include
diff --git a/src/glx/x11/glx_pbuffer.c b/src/glx/x11/glx_pbuffer.c
index 0f878f223f..fb2610a490 100644
--- a/src/glx/x11/glx_pbuffer.c
+++ b/src/glx/x11/glx_pbuffer.c
@@ -38,7 +38,6 @@
#include "glapi.h"
#include "glxextensions.h"
#include "glcontextmodes.h"
-#include "glheader.h"
/**
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h
index 412511247e..b10c2ae17b 100644
--- a/src/glx/x11/glxclient.h
+++ b/src/glx/x11/glxclient.h
@@ -68,6 +68,23 @@
#include "glxextensions.h"
+
+/* If we build the library with gcc's -fvisibility=hidden flag, we'll
+ * use the PUBLIC macro to mark functions that are to be exported.
+ *
+ * We also need to define a USED attribute, so the optimizer doesn't
+ * inline a static function that we later use in an alias. - ajax
+ */
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+# define PUBLIC __attribute__((visibility("default")))
+# define USED __attribute__((used))
+#else
+# define PUBLIC
+# define USED
+#endif
+
+
+
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 4
diff --git a/src/glx/x11/glxcmds.c b/src/glx/x11/glxcmds.c
index 9197130dca..bb0e53cee3 100644
--- a/src/glx/x11/glxcmds.c
+++ b/src/glx/x11/glxcmds.c
@@ -43,7 +43,6 @@
#include "glapi.h"
#include "glxextensions.h"
#include "glcontextmodes.h"
-#include "glheader.h"
#ifdef GLX_DIRECT_RENDERING
#include
diff --git a/src/glx/x11/glxcurrent.c b/src/glx/x11/glxcurrent.c
index 0d0c419a84..61cd9b39ea 100644
--- a/src/glx/x11/glxcurrent.c
+++ b/src/glx/x11/glxcurrent.c
@@ -40,7 +40,6 @@
#include "glxclient.h"
#include "glapi.h"
-#include "glheader.h"
#include "indirect_init.h"
#ifdef GLX_DIRECT_RENDERING
diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c
index 0d6d25ef3e..370a429f62 100644
--- a/src/glx/x11/glxext.c
+++ b/src/glx/x11/glxext.c
@@ -44,13 +44,13 @@
* \author Kevin E. Martin
*/
+#include
#include "glxclient.h"
#include
#include
#include "glapi.h"
#include "glxextensions.h"
#include "glcontextmodes.h"
-#include "glheader.h"
#ifdef USE_XCB
#include
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c
index e843718472..f2b169a0e4 100644
--- a/src/glx/x11/glxextensions.c
+++ b/src/glx/x11/glxextensions.c
@@ -34,7 +34,7 @@
#include
#include "glapi.h"
#include "glxextensions.h"
-#include "simple_list.h"
+
#define SET_BIT(m,b) (m[ (b) / 8 ] |= (1U << ((b) % 8)))
#define CLR_BIT(m,b) (m[ (b) / 8 ] &= ~(1U << ((b) % 8)))
diff --git a/src/glx/x11/indirect_vertex_program.c b/src/glx/x11/indirect_vertex_program.c
index 4f1485a850..0a1091eaef 100644
--- a/src/glx/x11/indirect_vertex_program.c
+++ b/src/glx/x11/indirect_vertex_program.c
@@ -23,7 +23,6 @@
* SOFTWARE.
*/
-#include "glheader.h"
#include
#include
#include "indirect.h"
diff --git a/src/glx/x11/pixelstore.c b/src/glx/x11/pixelstore.c
index 8431b29e90..3bf1b35ba3 100644
--- a/src/glx/x11/pixelstore.c
+++ b/src/glx/x11/pixelstore.c
@@ -34,7 +34,6 @@
**
*/
-#include "glheader.h"
#include "glxclient.h"
#include "indirect.h"
diff --git a/src/glx/x11/singlepix.c b/src/glx/x11/singlepix.c
index 77bd4a65ed..d8ad2b1bf0 100644
--- a/src/glx/x11/singlepix.c
+++ b/src/glx/x11/singlepix.c
@@ -34,7 +34,6 @@
**
*/
-#include "glheader.h"
#include "packsingle.h"
#include "indirect.h"
#include "dispatch.h"
--
cgit v1.2.3
From 06370a91b305e0697cb5ba1659e2423c7dfaf1fc Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 13:34:57 -0600
Subject: mesa: remove a bunch of -I paths from INCLUDE_DIRS
---
src/mesa/sources | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/mesa/sources b/src/mesa/sources
index bc8498d0e7..80e6e7c5a6 100644
--- a/src/mesa/sources
+++ b/src/mesa/sources
@@ -288,12 +288,4 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
INCLUDE_DIRS = \
-I$(TOP)/include \
-I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mesa/glapi \
- -I$(TOP)/src/mesa/math \
- -I$(TOP)/src/mesa/tnl \
- -I$(TOP)/src/mesa/shader \
- -I$(TOP)/src/mesa/shader/grammar \
- -I$(TOP)/src/mesa/shader/slang \
- -I$(TOP)/src/mesa/swrast \
- -I$(TOP)/src/mesa/swrast_setup
+ -I$(TOP)/src/mesa/main
--
cgit v1.2.3
From 374e7fd6cc95d3d91629a6e1c951d77e8a29c31c Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 13:46:47 -0600
Subject: mesa: prefix more #includes with "main/"
---
src/mesa/drivers/allegro/amesa.c | 10 ++++----
src/mesa/drivers/directfb/idirectfbgl_mesa.c | 20 ++++++++--------
src/mesa/drivers/dos/dmesa.c | 6 ++---
src/mesa/drivers/fbdev/glfbdev.c | 22 ++++++++---------
src/mesa/drivers/ggi/ggimesa.c | 16 ++++++-------
src/mesa/drivers/glide/fxapi.c | 2 +-
src/mesa/drivers/glide/fxdd.c | 16 ++++++-------
src/mesa/drivers/glide/fxddtex.c | 14 +++++------
src/mesa/drivers/glide/fxdrv.h | 10 ++++----
src/mesa/drivers/glide/fxsetup.c | 8 +++----
src/mesa/drivers/glide/fxtris.c | 8 +++----
src/mesa/drivers/glide/fxvb.c | 10 ++++----
src/mesa/drivers/glslcompiler/glslcompiler.c | 10 ++++----
src/mesa/drivers/svga/svgamesa.c | 12 +++++-----
src/mesa/drivers/svga/svgapix.h | 4 ++--
src/mesa/drivers/x11/fakeglx.c | 12 +++++-----
src/mesa/drivers/x11/glxheader.h | 2 +-
src/mesa/drivers/x11/xfonts.c | 4 ++--
src/mesa/drivers/x11/xm_api.c | 2 +-
src/mesa/drivers/x11/xm_buffer.c | 6 ++---
src/mesa/drivers/x11/xm_dd.c | 36 ++++++++++++++--------------
src/mesa/drivers/x11/xm_line.c | 6 ++---
src/mesa/drivers/x11/xm_span.c | 18 +++++++-------
src/mesa/drivers/x11/xm_tri.c | 8 +++----
src/mesa/drivers/x11/xmesaP.h | 2 +-
25 files changed, 132 insertions(+), 132 deletions(-)
diff --git a/src/mesa/drivers/allegro/amesa.c b/src/mesa/drivers/allegro/amesa.c
index c12d42148b..ade6251848 100644
--- a/src/mesa/drivers/allegro/amesa.c
+++ b/src/mesa/drivers/allegro/amesa.c
@@ -21,11 +21,11 @@
#include
#include
#include
-#include "buffers.h"
-#include "context.h"
-#include "imports.h"
-#include "matrix.h"
-#include "mtypes.h"
+#include "main/buffers.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/mtypes.h"
#include "GL/amesa.h"
diff --git a/src/mesa/drivers/directfb/idirectfbgl_mesa.c b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
index a364ada1f1..93593403c1 100644
--- a/src/mesa/drivers/directfb/idirectfbgl_mesa.c
+++ b/src/mesa/drivers/directfb/idirectfbgl_mesa.c
@@ -36,16 +36,16 @@
#include
#undef CLAMP
-#include "glheader.h"
-#include "buffers.h"
-#include "context.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "imports.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
+#include "main/glheader.h"
+#include "main/buffers.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/imports.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c
index ee87e63852..003c06a8ff 100644
--- a/src/mesa/drivers/dos/dmesa.c
+++ b/src/mesa/drivers/dos/dmesa.c
@@ -31,9 +31,9 @@
*/
-#include "context.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "video.h"
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index f3da4a5ba2..3c874ba57a 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -41,19 +41,19 @@
#ifdef USE_GLFBDEV_DRIVER
-#include "glheader.h"
#include
#include "GL/glfbdev.h"
-#include "buffers.h"
-#include "context.h"
-#include "extensions.h"
-#include "fbobject.h"
-#include "framebuffer.h"
-#include "imports.h"
-#include "renderbuffer.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
+#include "main/glheader.h"
+#include "main/buffers.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/imports.h"
+#include "main/renderbuffer.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c
index 85592d98da..bc08144d66 100644
--- a/src/mesa/drivers/ggi/ggimesa.c
+++ b/src/mesa/drivers/ggi/ggimesa.c
@@ -29,20 +29,20 @@
#include
#include
-#include "extensions.h"
-#include "buffers.h"
-#include "colormac.h"
-#include "imports.h"
-#include "matrix.h"
+#include "main/extensions.h"
+#include "main/buffers.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/teximage.h"
+#include "main/texformat.h"
+#include "main/texstore.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
#include "vbo/vbo.h"
-#include "teximage.h"
-#include "texformat.h"
-#include "texstore.h"
/* We use LibGG to manage config files */
#include
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c
index 00b9d29fac..b7708fd636 100644
--- a/src/mesa/drivers/glide/fxapi.c
+++ b/src/mesa/drivers/glide/fxapi.c
@@ -43,7 +43,7 @@
#include "fxdrv.h"
#include "drivers/common/driverfuncs.h"
-#include "framebuffer.h"
+#include "main/framebuffer.h"
#ifndef TDFX_DEBUG
int TDFX_DEBUG = (0
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index c082fd827f..213ef2382f 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -40,15 +40,15 @@
#if defined(FX)
-#include "image.h"
-#include "mtypes.h"
+#include "main/image.h"
+#include "main/mtypes.h"
#include "fxdrv.h"
-#include "buffers.h"
-#include "enums.h"
-#include "extensions.h"
-#include "macros.h"
-#include "texstore.h"
-#include "teximage.h"
+#include "main/buffers.h"
+#include "main/enums.h"
+#include "main/extensions.h"
+#include "main/macros.h"
+#include "main/texstore.h"
+#include "main/teximage.h"
#include "swrast/swrast.h"
#include "swrast/s_context.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c
index cb2c8554b1..f3cd908181 100644
--- a/src/mesa/drivers/glide/fxddtex.c
+++ b/src/mesa/drivers/glide/fxddtex.c
@@ -39,13 +39,13 @@
#if defined(FX)
#include "fxdrv.h"
-#include "enums.h"
-#include "image.h"
-#include "teximage.h"
-#include "texformat.h"
-#include "texcompress.h"
-#include "texobj.h"
-#include "texstore.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/teximage.h"
+#include "main/texformat.h"
+#include "main/texcompress.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
/* no borders! can't halve 1x1! (stride > width * comp) not allowed */
diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h
index dc19a912da..bee10de2f4 100644
--- a/src/mesa/drivers/glide/fxdrv.h
+++ b/src/mesa/drivers/glide/fxdrv.h
@@ -48,11 +48,11 @@
#include
#endif
-#include "context.h"
-#include "imports.h"
-#include "macros.h"
-#include "matrix.h"
-#include "mtypes.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/matrix.h"
+#include "main/mtypes.h"
#include "GL/fxmesa.h"
#include "fxglidew.h"
diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c
index 240e5e0b59..d48726a62a 100644
--- a/src/mesa/drivers/glide/fxsetup.c
+++ b/src/mesa/drivers/glide/fxsetup.c
@@ -41,11 +41,11 @@
#if defined(FX)
#include "fxdrv.h"
-#include "enums.h"
-#include "tnl.h"
+#include "main/enums.h"
+#include "main/texstore.h"
+#include "tnl/tnl.h"
#include "tnl/t_context.h"
-#include "swrast.h"
-#include "texstore.h"
+#include "swrast/swrast.h"
static void
diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c
index 0b9b3be582..aff91fe7d4 100644
--- a/src/mesa/drivers/glide/fxtris.c
+++ b/src/mesa/drivers/glide/fxtris.c
@@ -31,10 +31,10 @@
#ifdef FX
-#include "imports.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c
index 34ada61f4e..1dc5f9891a 100644
--- a/src/mesa/drivers/glide/fxvb.c
+++ b/src/mesa/drivers/glide/fxvb.c
@@ -34,11 +34,11 @@
#ifdef FX
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "math/m_translate.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c
index 016b53d57a..62a366858c 100644
--- a/src/mesa/drivers/glslcompiler/glslcompiler.c
+++ b/src/mesa/drivers/glslcompiler/glslcompiler.c
@@ -45,11 +45,11 @@
*/
-#include "imports.h"
-#include "context.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "shaders.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/shaders.h"
#include "shader/shader_api.h"
#include "shader/prog_print.h"
#include "drivers/common/driverfuncs.h"
diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c
index d138587569..d62d3e2247 100644
--- a/src/mesa/drivers/svga/svgamesa.c
+++ b/src/mesa/drivers/svga/svgamesa.c
@@ -39,12 +39,12 @@
#include
#include
#include "GL/svgamesa.h"
-#include "buffers.h"
-#include "context.h"
-#include "extensions.h"
-#include "imports.h"
-#include "matrix.h"
-#include "mtypes.h"
+#include "main/buffers.h"
+#include "main/context.h"
+#include "main/extensions.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#include "svgapix.h"
#include "svgamesa8.h"
diff --git a/src/mesa/drivers/svga/svgapix.h b/src/mesa/drivers/svga/svgapix.h
index 0b19551bf6..a49bdc49f3 100644
--- a/src/mesa/drivers/svga/svgapix.h
+++ b/src/mesa/drivers/svga/svgapix.h
@@ -33,8 +33,8 @@
#include "GL/gl.h"
#include "GL/svgamesa.h"
-#include "context.h"
-#include "colormac.h"
+#include "main/context.h"
+#include "main/colormac.h"
#include "vga.h"
struct svgamesa_context {
diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c
index e5cd8f0b80..827d39f995 100644
--- a/src/mesa/drivers/x11/fakeglx.c
+++ b/src/mesa/drivers/x11/fakeglx.c
@@ -43,12 +43,12 @@
#include "glxheader.h"
#include "glxapi.h"
#include "GL/xmesa.h"
-#include "context.h"
-#include "config.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "version.h"
+#include "main/context.h"
+#include "main/config.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/version.h"
#include "xfonts.h"
#include "xmesaP.h"
diff --git a/src/mesa/drivers/x11/glxheader.h b/src/mesa/drivers/x11/glxheader.h
index 15e8390583..d88afba20e 100644
--- a/src/mesa/drivers/x11/glxheader.h
+++ b/src/mesa/drivers/x11/glxheader.h
@@ -30,7 +30,7 @@
#include
#endif
-#include "glheader.h"
+#include "main/glheader.h"
#ifdef XFree86Server
diff --git a/src/mesa/drivers/x11/xfonts.c b/src/mesa/drivers/x11/xfonts.c
index d72c600bd1..f732c94586 100644
--- a/src/mesa/drivers/x11/xfonts.c
+++ b/src/mesa/drivers/x11/xfonts.c
@@ -33,8 +33,8 @@
#endif
#include "glxheader.h"
-#include "context.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/imports.h"
#include "xfonts.h"
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index 5bae69a472..c9009bad03 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -68,11 +68,11 @@
#include "main/context.h"
#include "main/extensions.h"
#include "main/framebuffer.h"
-#include "glapi/glthread.h"
#include "main/imports.h"
#include "main/macros.h"
#include "main/renderbuffer.h"
#include "main/teximage.h"
+#include "glapi/glthread.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "vbo/vbo.h"
diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c
index 51d183bb43..f104d44d05 100644
--- a/src/mesa/drivers/x11/xm_buffer.c
+++ b/src/mesa/drivers/x11/xm_buffer.c
@@ -32,9 +32,9 @@
#include "glxheader.h"
#include "GL/xmesa.h"
#include "xmesaP.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/imports.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#if defined(USE_XSHM) && !defined(XFree86Server)
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 54acbfe3cb..0a978e5cf7 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -29,29 +29,29 @@
*/
#include "glxheader.h"
-#include "bufferobj.h"
-#include "buffers.h"
-#include "context.h"
-#include "colormac.h"
-#include "depth.h"
-#include "drawpix.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "macros.h"
-#include "image.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "state.h"
-#include "texobj.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "xmesaP.h"
+#include "main/bufferobj.h"
+#include "main/buffers.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/depth.h"
+#include "main/drawpix.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/macros.h"
+#include "main/image.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/state.h"
+#include "main/texobj.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
#include "swrast/swrast.h"
#include "swrast/s_context.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
+#include "xmesaP.h"
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index 9833b4c9f0..f643b6d3a7 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -31,9 +31,9 @@
#include "glxheader.h"
-#include "depth.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "main/depth.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "xmesaP.h"
/* Internal swrast includes:
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index a24966b3ae..57b5749448 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -23,15 +23,15 @@
*/
#include "glxheader.h"
-#include "colormac.h"
-#include "context.h"
-#include "depth.h"
-#include "drawpix.h"
-#include "extensions.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "state.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/depth.h"
+#include "main/drawpix.h"
+#include "main/extensions.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/state.h"
#include "xmesaP.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 77fceec194..3a0cf80139 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -30,11 +30,11 @@
*/
+#include "main/depth.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "glxheader.h"
-#include "depth.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
#include "xmesaP.h"
/* Internal swrast includes:
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 95c41c3a41..98867ac710 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -28,7 +28,7 @@
#include "GL/xmesa.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
#if defined(FX)
#include "GL/fxmesa.h"
#include "xm_glide.h"
--
cgit v1.2.3
From 698bffb8844f6f45e09ed0c9fea39298ac6423d2 Mon Sep 17 00:00:00 2001
From: Jonathan White
Date: Thu, 18 Sep 2008 14:49:00 -0600
Subject: cell: Added CMP instruction
---
src/gallium/drivers/cell/ppu/cell_gen_fp.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
index 4f01897199..6f2b89c695 100644
--- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c
+++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c
@@ -835,15 +835,15 @@ emit_CMP(struct codegen *gen, const struct tgsi_full_instruction *inst)
if (inst->FullDstRegisters[0].DstRegister.WriteMask & (1 << ch)) {
int s1_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[0]);
int s2_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[1]);
+ int s3_reg = get_src_reg(gen, ch, &inst->FullSrcRegisters[2]);
int d_reg = get_dst_reg(gen, ch, &inst->FullDstRegisters[0]);
+ int zero_reg = get_itemp(gen);
+
+ spe_xor(gen->f, zero_reg, zero_reg, zero_reg);
- /* d = (s1 != s2) */
- spe_fceq(gen->f, d_reg, s1_reg, s2_reg);
- spe_nor(gen->f, d_reg, d_reg, d_reg);
-
- /* convert d from 0x0/0xffffffff to 0.0/1.0 */
- /* d = d & one_reg */
- spe_and(gen->f, d_reg, d_reg, get_const_one_reg(gen));
+ /* d = (s1 < 0) ? s2 : s3 */
+ spe_fcgt(gen->f, d_reg, zero_reg, s1_reg);
+ spe_selb(gen->f, d_reg, s3_reg, s2_reg, d_reg);
store_dest_reg(gen, d_reg, ch, &inst->FullDstRegisters[0]);
free_itemps(gen);
--
cgit v1.2.3
From ecadb51bbcb972a79f3ed79e65a7986b9396e757 Mon Sep 17 00:00:00 2001
From: Brian Paul
Date: Thu, 18 Sep 2008 15:17:05 -0600
Subject: mesa: added "main/" prefix to includes, remove some -I paths from
Makefile.template
---
src/mesa/drivers/dri/Makefile.template | 3 ---
src/mesa/drivers/dri/common/dri_util.c | 2 +-
src/mesa/drivers/dri/common/dri_util.h | 2 +-
src/mesa/drivers/dri/common/drirenderbuffer.c | 8 +++---
src/mesa/drivers/dri/common/drirenderbuffer.h | 2 +-
src/mesa/drivers/dri/common/extension_helper.h | 2 +-
src/mesa/drivers/dri/common/mmio.h | 2 +-
src/mesa/drivers/dri/common/spantmp2.h | 2 +-
src/mesa/drivers/dri/common/texmem.c | 8 +++---
src/mesa/drivers/dri/common/texmem.h | 4 +--
src/mesa/drivers/dri/common/utils.c | 6 ++---
src/mesa/drivers/dri/common/utils.h | 2 +-
src/mesa/drivers/dri/common/vblank.c | 8 +++---
src/mesa/drivers/dri/common/vblank.h | 2 +-
src/mesa/drivers/dri/common/xmlconfig.c | 4 +--
src/mesa/drivers/dri/fb/fb_dri.c | 8 +++---
src/mesa/drivers/dri/fb/fb_egl.c | 10 ++++----
src/mesa/drivers/dri/ffb/ffb_bitmap.c | 4 +--
src/mesa/drivers/dri/ffb/ffb_clear.c | 6 ++---
src/mesa/drivers/dri/ffb/ffb_context.h | 2 +-
src/mesa/drivers/dri/ffb/ffb_dd.c | 6 ++---
src/mesa/drivers/dri/ffb/ffb_dd.h | 4 +--
src/mesa/drivers/dri/ffb/ffb_depth.c | 3 +--
src/mesa/drivers/dri/ffb/ffb_lines.c | 6 ++---
src/mesa/drivers/dri/ffb/ffb_points.c | 2 +-
src/mesa/drivers/dri/ffb/ffb_points.h | 2 +-
src/mesa/drivers/dri/ffb/ffb_span.c | 2 +-
src/mesa/drivers/dri/ffb/ffb_state.c | 24 +++++++++---------
src/mesa/drivers/dri/ffb/ffb_stencil.c | 2 +-
src/mesa/drivers/dri/ffb/ffb_tex.c | 4 +--
src/mesa/drivers/dri/ffb/ffb_tris.c | 8 +++---
src/mesa/drivers/dri/ffb/ffb_vb.c | 2 +-
src/mesa/drivers/dri/ffb/ffb_vb.h | 4 +--
src/mesa/drivers/dri/ffb/ffb_vtxfmt.c | 14 +++++------
src/mesa/drivers/dri/ffb/ffb_xmesa.c | 14 +++++------
src/mesa/drivers/dri/ffb/ffb_xmesa.h | 2 +-
src/mesa/drivers/dri/gamma/gamma_context.c | 16 ++++++------
src/mesa/drivers/dri/gamma/gamma_context.h | 10 ++++----
src/mesa/drivers/dri/gamma/gamma_dd.c | 4 +--
src/mesa/drivers/dri/gamma/gamma_inithw.c | 2 +-
src/mesa/drivers/dri/gamma/gamma_lock.c | 2 +-
src/mesa/drivers/dri/gamma/gamma_macros.h | 2 +-
src/mesa/drivers/dri/gamma/gamma_render.c | 14 +++++------
src/mesa/drivers/dri/gamma/gamma_screen.c | 4 +--
src/mesa/drivers/dri/gamma/gamma_span.c | 2 +-
src/mesa/drivers/dri/gamma/gamma_state.c | 6 ++---
src/mesa/drivers/dri/gamma/gamma_tex.c | 18 +++++++-------
src/mesa/drivers/dri/gamma/gamma_texmem.c | 14 +++++------
src/mesa/drivers/dri/gamma/gamma_texstate.c | 16 ++++++------
src/mesa/drivers/dri/gamma/gamma_tris.c | 10 ++++----
src/mesa/drivers/dri/gamma/gamma_vb.c | 12 ++++-----
src/mesa/drivers/dri/gamma/gamma_vb.h | 2 +-
src/mesa/drivers/dri/gamma/gamma_xmesa.c | 6 ++---
src/mesa/drivers/dri/i810/i810context.c | 16 ++++++------
src/mesa/drivers/dri/i810/i810context.h | 6 ++---
src/mesa/drivers/dri/i810/i810ioctl.c | 12 ++++-----
src/mesa/drivers/dri/i810/i810render.c | 10 ++++----
src/mesa/drivers/dri/i810/i810screen.c | 16 ++++++------
src/mesa/drivers/dri/i810/i810span.c | 10 ++++----
src/mesa/drivers/dri/i810/i810state.c | 21 ++++++++--------
src/mesa/drivers/dri/i810/i810tex.c | 27 ++++++++++----------
src/mesa/drivers/dri/i810/i810tex.h | 4 +--
src/mesa/drivers/dri/i810/i810texmem.c | 17 ++++++-------
src/mesa/drivers/dri/i810/i810texstate.c | 15 ++++++------
src/mesa/drivers/dri/i810/i810tris.c | 10 ++++----
src/mesa/drivers/dri/i810/i810tris.h | 2 +-
src/mesa/drivers/dri/i810/i810vb.c | 11 ++++-----
src/mesa/drivers/dri/i810/i810vb.h | 2 +-
src/mesa/drivers/dri/i915/i830_context.c | 2 +-
src/mesa/drivers/dri/i915/i830_metaops.c | 8 +++---
src/mesa/drivers/dri/i915/i830_state.c | 10 ++++----
src/mesa/drivers/dri/i915/i830_tex.c | 20 +++++++--------
src/mesa/drivers/dri/i915/i830_texblend.c | 17 ++++++-------
src/mesa/drivers/dri/i915/i830_texstate.c | 6 ++---
src/mesa/drivers/dri/i915/i830_vtbl.c | 2 +-
src/mesa/drivers/dri/i915/i915_context.c | 2 +-
src/mesa/drivers/dri/i915/i915_debug.c | 2 +-
src/mesa/drivers/dri/i915/i915_fragprog.c | 6 ++---
src/mesa/drivers/dri/i915/i915_metaops.c | 8 +++---
src/mesa/drivers/dri/i915/i915_program.c | 6 ++---
src/mesa/drivers/dri/i915/i915_state.c | 10 ++++----
src/mesa/drivers/dri/i915/i915_tex.c | 20 +++++++--------
src/mesa/drivers/dri/i915/i915_tex_layout.c | 2 +-
src/mesa/drivers/dri/i915/i915_texstate.c | 6 ++---
src/mesa/drivers/dri/i915/i915_vtbl.c | 12 ++++-----
src/mesa/drivers/dri/i915/intel_pixel_read.c | 12 ++++-----
src/mesa/drivers/dri/i915/intel_render.c | 12 ++++-----
src/mesa/drivers/dri/i915/intel_state.c | 12 ++++-----
src/mesa/drivers/dri/i915/intel_tris.c | 14 +++++------
src/mesa/drivers/dri/i915/intel_tris.h | 2 +-
src/mesa/drivers/dri/i965/brw_cc.c | 4 +--
src/mesa/drivers/dri/i965/brw_clip.c | 6 ++---
src/mesa/drivers/dri/i965/brw_clip_line.c | 8 +++---
src/mesa/drivers/dri/i965/brw_clip_point.c | 8 +++---
src/mesa/drivers/dri/i965/brw_clip_state.c | 2 +-
src/mesa/drivers/dri/i965/brw_clip_tri.c | 8 +++---
src/mesa/drivers/dri/i965/brw_clip_unfilled.c | 8 +++---
src/mesa/drivers/dri/i965/brw_clip_util.c | 8 +++---
src/mesa/drivers/dri/i965/brw_context.c | 9 ++++---
src/mesa/drivers/dri/i965/brw_context.h | 2 +-
src/mesa/drivers/dri/i965/brw_curbe.c | 8 +++---
src/mesa/drivers/dri/i965/brw_draw.c | 10 ++++----
src/mesa/drivers/dri/i965/brw_draw.h | 2 +-
src/mesa/drivers/dri/i965/brw_draw_upload.c | 10 ++++----
src/mesa/drivers/dri/i965/brw_eu_debug.c | 4 +--
src/mesa/drivers/dri/i965/brw_fallback.c | 15 ++++++------
src/mesa/drivers/dri/i965/brw_fallback.h | 2 +-
src/mesa/drivers/dri/i965/brw_gs.c | 6 ++---
src/mesa/drivers/dri/i965/brw_gs_emit.c | 6 ++---
src/mesa/drivers/dri/i965/brw_gs_state.c | 2 +-
src/mesa/drivers/dri/i965/brw_metaops.c | 6 ++---
src/mesa/drivers/dri/i965/brw_sf.c | 6 ++---
src/mesa/drivers/dri/i965/brw_sf_emit.c | 6 ++---
src/mesa/drivers/dri/i965/brw_sf_state.c | 2 +-
src/mesa/drivers/dri/i965/brw_state_batch.c | 2 +-
src/mesa/drivers/dri/i965/brw_state_cache.c | 2 +-
src/mesa/drivers/dri/i965/brw_state_dump.c | 2 +-
src/mesa/drivers/dri/i965/brw_tex.c | 19 +++++++-------
src/mesa/drivers/dri/i965/brw_tex_layout.c | 2 +-
src/mesa/drivers/dri/i965/brw_util.c | 2 +-
src/mesa/drivers/dri/i965/brw_util.h | 2 +-
src/mesa/drivers/dri/i965/brw_vs_constval.c | 2 +-
src/mesa/drivers/dri/i965/brw_vs_state.c | 2 +-
src/mesa/drivers/dri/i965/brw_vs_tnl.c | 6 ++---
src/mesa/drivers/dri/i965/brw_vtbl.c | 10 ++++----
src/mesa/drivers/dri/i965/brw_wm_emit.c | 2 +-
src/mesa/drivers/dri/i965/brw_wm_fp.c | 6 ++---
src/mesa/drivers/dri/i965/brw_wm_glsl.c | 2 +-
src/mesa/drivers/dri/i965/brw_wm_iz.c | 2 +-
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 2 +-
src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 6 ++---
src/mesa/drivers/dri/i965/intel_state.c | 12 ++++-----
src/mesa/drivers/dri/intel/intel_batchbuffer.h | 2 +-
src/mesa/drivers/dri/intel/intel_blit.c | 6 ++---
src/mesa/drivers/dri/intel/intel_buffer_objects.c | 6 ++---
src/mesa/drivers/dri/intel/intel_buffer_objects.h | 2 +-
src/mesa/drivers/dri/intel/intel_buffers.c | 6 ++---
src/mesa/drivers/dri/intel/intel_context.c | 16 ++++++------
src/mesa/drivers/dri/intel/intel_context.h | 6 ++---
src/mesa/drivers/dri/intel/intel_depthstencil.c | 18 +++++++-------
src/mesa/drivers/dri/intel/intel_fbo.c | 16 ++++++------
src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 2 +-
src/mesa/drivers/dri/intel/intel_pixel.c | 4 +--
src/mesa/drivers/dri/intel/intel_pixel.h | 2 +-
src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 14 +++++------
src/mesa/drivers/dri/intel/intel_pixel_copy.c | 12 ++++-----
src/mesa/drivers/dri/intel/intel_pixel_draw.c | 12 ++++-----
src/mesa/drivers/dri/intel/intel_regions.h | 2 +-
src/mesa/drivers/dri/intel/intel_screen.c | 12 ++++-----
src/mesa/drivers/dri/intel/intel_span.c | 8 +++---
src/mesa/drivers/dri/intel/intel_tex.c | 6 ++---
src/mesa/drivers/dri/intel/intel_tex.h | 2 +-
src/mesa/drivers/dri/intel/intel_tex_copy.c | 10 ++++----
src/mesa/drivers/dri/intel/intel_tex_format.c | 4 +--
src/mesa/drivers/dri/intel/intel_tex_image.c | 26 ++++++++++----------
src/mesa/drivers/dri/intel/intel_tex_layout.c | 2 +-
src/mesa/drivers/dri/intel/intel_tex_layout.h | 2 +-
src/mesa/drivers/dri/intel/intel_tex_subimage.c | 10 ++++----
src/mesa/drivers/dri/intel/intel_tex_validate.c | 4 +--
src/mesa/drivers/dri/mach64/mach64_context.c | 12 ++++-----
src/mesa/drivers/dri/mach64/mach64_context.h | 2 +-
src/mesa/drivers/dri/mach64/mach64_dd.c | 5 ++--
src/mesa/drivers/dri/mach64/mach64_ioctl.c | 4 +--
src/mesa/drivers/dri/mach64/mach64_screen.c | 8 +++---
src/mesa/drivers/dri/mach64/mach64_state.c | 6 ++---
src/mesa/drivers/dri/mach64/mach64_tex.c | 18 +++++++-------
src/mesa/drivers/dri/mach64/mach64_texmem.c | 10 ++++----
src/mesa/drivers/dri/mach64/mach64_texstate.c | 10 ++++----
src/mesa/drivers/dri/mach64/mach64_tris.c | 8 +++---
src/mesa/drivers/dri/mach64/mach64_tris.h | 2 +-
src/mesa/drivers/dri/mach64/mach64_vb.c | 10 ++++----
src/mesa/drivers/dri/mach64/mach64_vb.h | 2 +-
src/mesa/drivers/dri/mga/mga_texcombine.c | 2 +-
src/mesa/drivers/dri/mga/mga_texstate.c | 14 +++++------
src/mesa/drivers/dri/mga/mga_xmesa.c | 14 +++++------
src/mesa/drivers/dri/mga/mga_xmesa.h | 2 +-
src/mesa/drivers/dri/mga/mgacontext.h | 8 +++---
src/mesa/drivers/dri/mga/mgadd.c | 6 ++---
src/mesa/drivers/dri/mga/mgadd.h | 2 +-
src/mesa/drivers/dri/mga/mgaioctl.c | 8 +++---
src/mesa/drivers/dri/mga/mgapixel.c | 6 ++---
src/mesa/drivers/dri/mga/mgapixel.h | 2 +-
src/mesa/drivers/dri/mga/mgarender.c | 10 ++++----
src/mesa/drivers/dri/mga/mgaspan.c | 2 +-
src/mesa/drivers/dri/mga/mgastate.c | 8 +++---
src/mesa/drivers/dri/mga/mgatex.c | 24 +++++++++---------
src/mesa/drivers/dri/mga/mgatexmem.c | 8 +++---
src/mesa/drivers/dri/mga/mgatris.c | 8 +++---
src/mesa/drivers/dri/mga/mgatris.h | 2 +-
src/mesa/drivers/dri/mga/mgavb.c | 10 ++++----
src/mesa/drivers/dri/mga/mgavb.h | 2 +-
src/mesa/drivers/dri/r128/r128_context.c | 12 ++++-----
src/mesa/drivers/dri/r128/r128_context.h | 2 +-
src/mesa/drivers/dri/r128/r128_dd.c | 4 +--
src/mesa/drivers/dri/r128/r128_dd.h | 2 +-
src/mesa/drivers/dri/r128/r128_ioctl.c | 4 +--
src/mesa/drivers/dri/r128/r128_lock.c | 2 +-
src/mesa/drivers/dri/r128/r128_screen.c | 8 +++---
src/mesa/drivers/dri/r128/r128_state.c | 6 ++---
src/mesa/drivers/dri/r128/r128_tex.c | 22 ++++++++---------
src/mesa/drivers/dri/r128/r128_texmem.c | 10 ++++----
src/mesa/drivers/dri/r128/r128_texobj.h | 2 +-
src/mesa/drivers/dri/r128/r128_texstate.c | 10 ++++----
src/mesa/drivers/dri/r128/r128_tris.c | 8 +++---
src/mesa/drivers/dri/r128/r128_tris.h | 2 +-
src/mesa/drivers/dri/r200/r200_cmdbuf.c | 10 ++++----
src/mesa/drivers/dri/r200/r200_context.c | 18 +++++++-------
src/mesa/drivers/dri/r200/r200_context.h | 8 +++---
src/mesa/drivers/dri/r200/r200_ioctl.c | 8 +++---
src/mesa/drivers/dri/r200/r200_ioctl.h | 2 +-
src/mesa/drivers/dri/r200/r200_lock.c | 2 +-
src/mesa/drivers/dri/r200/r200_maos_arrays.c | 10 ++++----
src/mesa/drivers/dri/r200/r200_pixel.c | 8 +++---
src/mesa/drivers/dri/r200/r200_sanity.c | 4 +--
src/mesa/drivers/dri/r200/r200_span.c | 6 ++---
src/mesa/drivers/dri/r200/r200_state.c | 14 +++++------
src/mesa/drivers/dri/r200/r200_state_init.c | 10 ++++----
src/mesa/drivers/dri/r200/r200_swtcl.c | 14 +++++------
src/mesa/drivers/dri/r200/r200_swtcl.h | 2 +-
src/mesa/drivers/dri/r200/r200_tcl.c | 12 ++++-----
src/mesa/drivers/dri/r200/r200_tex.c | 23 ++++++++---------
src/mesa/drivers/dri/r200/r200_texmem.c | 10 ++++----
src/mesa/drivers/dri/r200/r200_texstate.c | 14 +++++------
src/mesa/drivers/dri/r300/r300_cmdbuf.c | 12 ++++-----
src/mesa/drivers/dri/r300/r300_context.c | 18 +++++++-------
src/mesa/drivers/dri/r300/r300_context.h | 8 +++---
src/mesa/drivers/dri/r300/r300_emit.c | 12 ++++-----
src/mesa/drivers/dri/r300/r300_emit.h | 2 +-
src/mesa/drivers/dri/r300/r300_fragprog.c | 6 ++---
src/mesa/drivers/dri/r300/r300_fragprog.h | 6 ++---
src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h | 2 +-
src/mesa/drivers/dri/r300/r300_ioctl.c | 8 +++---
src/mesa/drivers/dri/r300/r300_render.c | 18 +++++++-------
src/mesa/drivers/dri/r300/r300_state.c | 22 ++++++++---------
src/mesa/drivers/dri/r300/r300_swtcl.c | 16 ++++++------
src/mesa/drivers/dri/r300/r300_swtcl.h | 2 +-
src/mesa/drivers/dri/r300/r300_tex.c | 23 ++++++++---------
src/mesa/drivers/dri/r300/r300_texmem.c | 12 ++++-----
src/mesa/drivers/dri/r300/r300_texstate.c | 16 ++++++------
src/mesa/drivers/dri/r300/r500_fragprog.h | 6 ++---
src/mesa/drivers/dri/r300/radeon_context.c | 12 ++++-----
src/mesa/drivers/dri/r300/radeon_context.h | 4 +--
src/mesa/drivers/dri/r300/radeon_ioctl.c | 8 +++---
src/mesa/drivers/dri/r300/radeon_ioctl.h | 4 +--
src/mesa/drivers/dri/r300/radeon_lock.c | 2 +-
src/mesa/drivers/dri/r300/radeon_program.h | 6 ++---
src/mesa/drivers/dri/r300/radeon_span.c | 2 +-
src/mesa/drivers/dri/r300/radeon_state.c | 15 ++++++------
src/mesa/drivers/dri/radeon/radeon_compat.c | 4 +--
src/mesa/drivers/dri/radeon/radeon_context.h | 8 +++---
src/mesa/drivers/dri/radeon/radeon_ioctl.c | 6 ++---
src/mesa/drivers/dri/radeon/radeon_ioctl.h | 2 +-
src/mesa/drivers/dri/radeon/radeon_lighting.c | 6 ++---
src/mesa/drivers/dri/radeon/radeon_lock.c | 4 +--
src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 10 ++++----
src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 6 ++---
src/mesa/drivers/dri/radeon/radeon_sanity.c | 2 +-
src/mesa/drivers/dri/radeon/radeon_screen.c | 11 ++++-----
src/mesa/drivers/dri/radeon/radeon_span.c | 2 +-
src/mesa/drivers/dri/radeon/radeon_state.c | 16 ++++++------
src/mesa/drivers/dri/radeon/radeon_state_init.c | 6 ++---
src/mesa/drivers/dri/radeon/radeon_swtcl.c | 12 ++++-----
src/mesa/drivers/dri/radeon/radeon_swtcl.h | 2 +-
src/mesa/drivers/dri/radeon/radeon_tcl.c | 10 ++++----
src/mesa/drivers/dri/radeon/radeon_tex.c | 23 +++++++++--------
src/mesa/drivers/dri/radeon/radeon_texmem.c | 8 +++---
src/mesa/drivers/dri/radeon/radeon_texstate.c | 16 ++++++------
src/mesa/drivers/dri/s3v/s3v_context.c | 12 ++++-----
src/mesa/drivers/dri/s3v/s3v_context.h | 8 +++---
src/mesa/drivers/dri/s3v/s3v_dd.c | 4 +--
src/mesa/drivers/dri/s3v/s3v_render.c | 8 +++---
src/mesa/drivers/dri/s3v/s3v_screen.h | 2 +-
src/mesa/drivers/dri/s3v/s3v_state.c | 4 +--
src/mesa/drivers/dri/s3v/s3v_tex.c | 16 ++++++------
src/mesa/drivers/dri/s3v/s3v_texmem.c | 12 ++++-----
src/mesa/drivers/dri/s3v/s3v_texstate.c | 12 ++++-----
src/mesa/drivers/dri/s3v/s3v_tris.c | 8 +++---
src/mesa/drivers/dri/s3v/s3v_vb.c | 8 +++---
src/mesa/drivers/dri/s3v/s3v_vb.h | 2 +-
src/mesa/drivers/dri/s3v/s3v_xmesa.c | 8 +++---
src/mesa/drivers/dri/savage/savage_init.h | 2 +-
src/mesa/drivers/dri/savage/savage_xmesa.c | 14 +++++------
src/mesa/drivers/dri/savage/savagecontext.h | 4 +--
src/mesa/drivers/dri/savage/savagedd.c | 8 +++---
src/mesa/drivers/dri/savage/savagedd.h | 2 +-
src/mesa/drivers/dri/savage/savageioctl.c | 12 ++++-----
src/mesa/drivers/dri/savage/savagerender.c | 10 ++++----
src/mesa/drivers/dri/savage/savagespan.c | 2 +-
src/mesa/drivers/dri/savage/savagestate.c | 10 ++++----
src/mesa/drivers/dri/savage/savagetex.c | 19 +++++++-------
src/mesa/drivers/dri/savage/savagetex.h | 2 +-
src/mesa/drivers/dri/savage/savagetris.c | 8 +++---
src/mesa/drivers/dri/savage/savagetris.h | 2 +-
src/mesa/drivers/dri/sis/sis6326_clear.c | 2 +-
src/mesa/drivers/dri/sis/sis6326_state.c | 6 ++---
src/mesa/drivers/dri/sis/sis_clear.c | 2 +-
src/mesa/drivers/dri/sis/sis_context.c | 8 +++---
src/mesa/drivers/dri/sis/sis_context.h | 2 +-
src/mesa/drivers/dri/sis/sis_dd.c | 4 +--
src/mesa/drivers/dri/sis/sis_fog.c | 2 +-
src/mesa/drivers/dri/sis/sis_lock.c | 2 +-
src/mesa/drivers/dri/sis/sis_screen.c | 8 +++---
src/mesa/drivers/dri/sis/sis_state.c | 6 ++---
src/mesa/drivers/dri/sis/sis_tex.c | 10 ++++----
src/mesa/drivers/dri/sis/sis_texstate.c | 12 ++++-----
src/mesa/drivers/dri/sis/sis_tris.c | 8 +++---
src/mesa/drivers/dri/sis/sis_tris.h | 2 +-
src/mesa/drivers/dri/swrast/swrast.c | 12 ++++-----
src/mesa/drivers/dri/swrast/swrast_priv.h | 2 +-
src/mesa/drivers/dri/swrast/swrast_spantemp.h | 2 +-
src/mesa/drivers/dri/tdfx/tdfx_context.c | 6 ++---
src/mesa/drivers/dri/tdfx/tdfx_context.h | 14 +++++------
src/mesa/drivers/dri/tdfx/tdfx_dd.c | 6 ++---
src/mesa/drivers/dri/tdfx/tdfx_dd.h | 4 +--
src/mesa/drivers/dri/tdfx/tdfx_pixels.c | 2 +-
src/mesa/drivers/dri/tdfx/tdfx_pixels.h | 2 +-
src/mesa/drivers/dri/tdfx/tdfx_screen.c | 4 +--
src/mesa/drivers/dri/tdfx/tdfx_span.h | 2 +-
src/mesa/drivers/dri/tdfx/tdfx_state.c | 10 ++++----
src/mesa/drivers/dri/tdfx/tdfx_state.h | 2 +-
src/mesa/drivers/dri/tdfx/tdfx_tex.c | 16 ++++++------
src/mesa/drivers/dri/tdfx/tdfx_texman.c | 4 +--
src/mesa/drivers/dri/tdfx/tdfx_tris.c | 8 +++---
src/mesa/drivers/dri/tdfx/tdfx_tris.h | 2 +-
src/mesa/drivers/dri/tdfx/tdfx_vb.c | 10 ++++----
src/mesa/drivers/dri/tdfx/tdfx_vb.h | 2 +-
src/mesa/drivers/dri/trident/trident_context.c | 16 ++++++------
src/mesa/drivers/dri/trident/trident_context.h | 6 ++---
src/mesa/drivers/dri/trident/trident_dd.c | 4 +--
src/mesa/drivers/dri/trident/trident_state.c | 2 +-
src/mesa/drivers/dri/trident/trident_vb.c | 8 +++---
src/mesa/drivers/dri/unichrome/via_context.c | 18 +++++++-------
src/mesa/drivers/dri/unichrome/via_context.h | 5 ++--
src/mesa/drivers/dri/unichrome/via_fb.c | 4 +--
src/mesa/drivers/dri/unichrome/via_ioctl.c | 10 ++++----
src/mesa/drivers/dri/unichrome/via_render.c | 8 +++---
src/mesa/drivers/dri/unichrome/via_screen.c | 12 ++++-----
src/mesa/drivers/dri/unichrome/via_span.c | 8 +++---
src/mesa/drivers/dri/unichrome/via_state.c | 16 ++++++------
src/mesa/drivers/dri/unichrome/via_tex.c | 30 +++++++++++------------
src/mesa/drivers/dri/unichrome/via_tex.h | 2 +-
src/mesa/drivers/dri/unichrome/via_texcombine.c | 10 ++++----
src/mesa/drivers/dri/unichrome/via_tris.c | 12 ++++-----
src/mesa/drivers/dri/unichrome/via_tris.h | 2 +-
344 files changed, 1296 insertions(+), 1299 deletions(-)
diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template
index 072d16ce8b..2dc3664cc6 100644
--- a/src/mesa/drivers/dri/Makefile.template
+++ b/src/mesa/drivers/dri/Makefile.template
@@ -39,10 +39,7 @@ SHARED_INCLUDES = \
-I$(TOP)/src/mesa/drivers/dri/common \
-Iserver \
-I$(TOP)/include \
- -I$(TOP)/include/GL/internal \
-I$(TOP)/src/mesa \
- -I$(TOP)/src/mesa/main \
- -I$(TOP)/src/mesa/glapi \
-I$(TOP)/src/egl/main \
-I$(TOP)/src/egl/drivers/dri \
$(LIBDRM_CFLAGS)
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index ce540624a5..ceedd914fb 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -26,7 +26,7 @@
#define MAP_FAILED ((void *)-1)
#endif
-#include "imports.h"
+#include "main/imports.h"
#define None 0
#include "dri_util.h"
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index 6104ac29f7..1d89a9a31c 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -53,7 +53,7 @@
#include
#include
#include
-#include "glheader.h"
+#include "main/glheader.h"
#include "GL/internal/glcore.h"
#include "GL/internal/dri_interface.h"
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c
index d36af3e5be..b99bf2033b 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.c
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.c
@@ -1,9 +1,9 @@
-#include "mtypes.h"
+#include "main/mtypes.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/imports.h"
#include "drirenderbuffer.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "imports.h"
/**
diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h
index 747f92fcdb..cf55286b30 100644
--- a/src/mesa/drivers/dri/common/drirenderbuffer.h
+++ b/src/mesa/drivers/dri/common/drirenderbuffer.h
@@ -10,7 +10,7 @@
#ifndef DRIRENDERBUFFER_H
#define DRIRENDERBUFFER_H
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "dri_util.h"
diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h
index ea5b9973dd..3143ea2b10 100644
--- a/src/mesa/drivers/dri/common/extension_helper.h
+++ b/src/mesa/drivers/dri/common/extension_helper.h
@@ -26,7 +26,7 @@
*/
#include "utils.h"
-#include "dispatch.h"
+#include "glapi/dispatch.h"
#ifndef NULL
# define NULL 0
diff --git a/src/mesa/drivers/dri/common/mmio.h b/src/mesa/drivers/dri/common/mmio.h
index 89871aab59..8485871bf5 100644
--- a/src/mesa/drivers/dri/common/mmio.h
+++ b/src/mesa/drivers/dri/common/mmio.h
@@ -33,7 +33,7 @@
#ifndef MMIO_H
#define MMIO_H
-#include "glheader.h"
+#include "main/glheader.h"
#if defined( __powerpc__ )
diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h
index a1e56eb148..f2868cb58a 100644
--- a/src/mesa/drivers/dri/common/spantmp2.h
+++ b/src/mesa/drivers/dri/common/spantmp2.h
@@ -33,7 +33,7 @@
* \author Ian Romanick
*/
-#include "colormac.h"
+#include "main/colormac.h"
#include "spantmp_common.h"
#ifndef DBG
diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c
index caabac3448..f32ecad872 100644
--- a/src/mesa/drivers/dri/common/texmem.c
+++ b/src/mesa/drivers/dri/common/texmem.c
@@ -44,10 +44,10 @@
*/
#include "texmem.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "macros.h"
-#include "texformat.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/texformat.h"
#include
diff --git a/src/mesa/drivers/dri/common/texmem.h b/src/mesa/drivers/dri/common/texmem.h
index 6692efcc30..3cb0c440a3 100644
--- a/src/mesa/drivers/dri/common/texmem.h
+++ b/src/mesa/drivers/dri/common/texmem.h
@@ -39,8 +39,8 @@
#ifndef DRI_TEXMEM_H
#define DRI_TEXMEM_H
-#include "mtypes.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
#include "xf86drm.h"
struct dri_tex_heap;
diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c
index c723dfdeb0..db6c5c389d 100644
--- a/src/mesa/drivers/dri/common/utils.c
+++ b/src/mesa/drivers/dri/common/utils.c
@@ -31,10 +31,10 @@
#include
#include
-#include "mtypes.h"
-#include "extensions.h"
+#include "main/mtypes.h"
+#include "main/extensions.h"
+#include "glapi/dispatch.h"
#include "utils.h"
-#include "dispatch.h"
int driDispatchRemapTable[ driDispatchRemapTable_size ];
diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h
index 0c09a7e68f..95d8e0176d 100644
--- a/src/mesa/drivers/dri/common/utils.h
+++ b/src/mesa/drivers/dri/common/utils.h
@@ -31,7 +31,7 @@
#include
#include
-#include "context.h"
+#include "main/context.h"
typedef struct __DRIutilversionRec2 __DRIutilversion2;
diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c
index dc2cbcc84d..0b92e35451 100644
--- a/src/mesa/drivers/dri/common/vblank.c
+++ b/src/mesa/drivers/dri/common/vblank.c
@@ -27,11 +27,11 @@
*/
/* $XFree86:$ */
-#include "glheader.h"
+#include "main/glheader.h"
#include "xf86drm.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/dd.h"
#include "vblank.h"
#include "xmlpool.h"
diff --git a/src/mesa/drivers/dri/common/vblank.h b/src/mesa/drivers/dri/common/vblank.h
index 4613c09222..8243ac52c5 100644
--- a/src/mesa/drivers/dri/common/vblank.h
+++ b/src/mesa/drivers/dri/common/vblank.h
@@ -30,7 +30,7 @@
#ifndef DRI_VBLANK_H
#define DRI_VBLANK_H
-#include "context.h"
+#include "main/context.h"
#include "dri_util.h"
#include "xmlconfig.h"
diff --git a/src/mesa/drivers/dri/common/xmlconfig.c b/src/mesa/drivers/dri/common/xmlconfig.c
index f6ae75520c..46ba2ffbfe 100644
--- a/src/mesa/drivers/dri/common/xmlconfig.c
+++ b/src/mesa/drivers/dri/common/xmlconfig.c
@@ -27,7 +27,7 @@
* \author Felix Kuehling
*/
-#include "glheader.h"
+#include "main/glheader.h"
#include
#include
@@ -35,7 +35,7 @@
#include
#include
#include
-#include "imports.h"
+#include "main/imports.h"
#include "dri_util.h"
#include "xmlconfig.h"
diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c
index 16efd33368..5573bab24e 100644
--- a/src/mesa/drivers/dri/fb/fb_dri.c
+++ b/src/mesa/drivers/dri/fb/fb_dri.c
@@ -47,14 +47,14 @@
#include "drirenderbuffer.h"
#include "buffers.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-#include "tnl/t_context.h"
+#include "tnl/tcontext.h"
#include "tnl/t_pipeline.h"
#include "drivers/common/driverfuncs.h"
diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c
index 517e71f888..15d3d20a2a 100644
--- a/src/mesa/drivers/dri/fb/fb_egl.c
+++ b/src/mesa/drivers/dri/fb/fb_egl.c
@@ -14,20 +14,20 @@
#include "utils.h"
#include "buffers.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#include "vbo/vbo.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-#include "tnl/t_context.h"
+#include "tnl/tcontext.h"
#include "tnl/t_pipeline.h"
#include "drivers/common/driverfuncs.h"
#include "drirenderbuffer.h"
#include "eglconfig.h"
-#include "eglcontext.h"
+#include "eglmain/context.h"
#include "egldisplay.h"
#include "egldriver.h"
#include "eglglobals.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_bitmap.c b/src/mesa/drivers/dri/ffb/ffb_bitmap.c
index 7263e83813..27c341bf66 100644
--- a/src/mesa/drivers/dri/ffb/ffb_bitmap.c
+++ b/src/mesa/drivers/dri/ffb/ffb_bitmap.c
@@ -30,8 +30,8 @@
#include "ffb_lock.h"
#include "ffb_bitmap.h"
#include "swrast/swrast.h"
-#include "image.h"
-#include "macros.h"
+#include "main/image.h"
+#include "main/macros.h"
/* Compute ceiling of integer quotient of A divided by B: */
#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
diff --git a/src/mesa/drivers/dri/ffb/ffb_clear.c b/src/mesa/drivers/dri/ffb/ffb_clear.c
index 2aa5836036..455ed9376f 100644
--- a/src/mesa/drivers/dri/ffb/ffb_clear.c
+++ b/src/mesa/drivers/dri/ffb/ffb_clear.c
@@ -25,10 +25,10 @@
* David S. Miller
*/
-#include "mtypes.h"
-#include "extensions.h"
+#include "main/mtypes.h"
+#include "main/extensions.h"
-#include "mm.h"
+#include "main/mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
#include "ffb_depth.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_context.h b/src/mesa/drivers/dri/ffb/ffb_context.h
index df1b65d748..cca39a526a 100644
--- a/src/mesa/drivers/dri/ffb/ffb_context.h
+++ b/src/mesa/drivers/dri/ffb/ffb_context.h
@@ -6,7 +6,7 @@
#include "dri_util.h"
#include "drm.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "ffb_xmesa.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.c b/src/mesa/drivers/dri/ffb/ffb_dd.c
index 53423bbae4..3cf83b5680 100644
--- a/src/mesa/drivers/dri/ffb/ffb_dd.c
+++ b/src/mesa/drivers/dri/ffb/ffb_dd.c
@@ -25,8 +25,9 @@
* David S. Miller
*/
-#include "mtypes.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
+#include "main/extensions.h"
#include "ffb_dd.h"
#include "ffb_span.h"
#include "ffb_depth.h"
@@ -35,7 +36,6 @@
#include "ffb_tris.h"
#include "ffb_clear.h"
#include "ffb_lock.h"
-#include "extensions.h"
#define FFB_DATE "20021125"
diff --git a/src/mesa/drivers/dri/ffb/ffb_dd.h b/src/mesa/drivers/dri/ffb/ffb_dd.h
index 4ffcbe6666..385d9741fa 100644
--- a/src/mesa/drivers/dri/ffb/ffb_dd.h
+++ b/src/mesa/drivers/dri/ffb/ffb_dd.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.h,v 1.1 2000/06/20 05:08:38 dawes Exp $
+/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_main/dd.h,v 1.1 2000/06/20 05:08:38 dawes Exp $
*
* GLX Hardware Device Driver for Sun Creator/Creator3D.
* Copyright (C) 2000 David S. Miller
@@ -28,7 +28,7 @@
#ifndef _FFB_DD_H
#define _FFB_DD_H
-#include "context.h"
+#include "main/context.h"
void ffbDDInitDriverFuncs(GLcontext *ctx);
void ffbDDExtensionsInit(GLcontext *ctx);
diff --git a/src/mesa/drivers/dri/ffb/ffb_depth.c b/src/mesa/drivers/dri/ffb/ffb_depth.c
index 68a2450eb7..fafae5de7e 100644
--- a/src/mesa/drivers/dri/ffb/ffb_depth.c
+++ b/src/mesa/drivers/dri/ffb/ffb_depth.c
@@ -25,7 +25,7 @@
* David S. Miller
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -33,7 +33,6 @@
#include "ffb_depth.h"
#include "ffb_lock.h"
-#include "swrast/swrast.h"
#undef DEPTH_TRACE
diff --git a/src/mesa/drivers/dri/ffb/ffb_lines.c b/src/mesa/drivers/dri/ffb/ffb_lines.c
index da1de18f36..6762683d1e 100644
--- a/src/mesa/drivers/dri/ffb/ffb_lines.c
+++ b/src/mesa/drivers/dri/ffb/ffb_lines.c
@@ -25,8 +25,9 @@
* David S. Miller
*/
-#include "mtypes.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
+#include "main/extensions.h"
#include "ffb_dd.h"
#include "ffb_span.h"
#include "ffb_depth.h"
@@ -35,7 +36,6 @@
#include "ffb_lines.h"
#include "ffb_tris.h"
#include "ffb_lock.h"
-#include "extensions.h"
#undef FFB_LINE_TRACE
diff --git a/src/mesa/drivers/dri/ffb/ffb_points.c b/src/mesa/drivers/dri/ffb/ffb_points.c
index a7496dd1d6..d7165da0bf 100644
--- a/src/mesa/drivers/dri/ffb/ffb_points.c
+++ b/src/mesa/drivers/dri/ffb/ffb_points.c
@@ -25,7 +25,7 @@
* David S. Miller
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "ffb_dd.h"
#include "ffb_context.h"
#include "ffb_vb.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_points.h b/src/mesa/drivers/dri/ffb/ffb_points.h
index 7d5c1f8a03..19137c698f 100644
--- a/src/mesa/drivers/dri/ffb/ffb_points.h
+++ b/src/mesa/drivers/dri/ffb/ffb_points.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_points.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_main/points.h,v 1.2 2002/02/22 21:32:59 dawes Exp $ */
#ifndef _FFB_POINTS_H
#define _FFB_POINTS_H
diff --git a/src/mesa/drivers/dri/ffb/ffb_span.c b/src/mesa/drivers/dri/ffb/ffb_span.c
index fff7fa1d3f..0798fcf352 100644
--- a/src/mesa/drivers/dri/ffb/ffb_span.c
+++ b/src/mesa/drivers/dri/ffb/ffb_span.c
@@ -25,7 +25,7 @@
* David S. Miller
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "ffb_dd.h"
#include "ffb_span.h"
#include "ffb_context.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_state.c b/src/mesa/drivers/dri/ffb/ffb_state.c
index eb13478166..1d0dbe4499 100644
--- a/src/mesa/drivers/dri/ffb/ffb_state.c
+++ b/src/mesa/drivers/dri/ffb/ffb_state.c
@@ -25,9 +25,18 @@
* David S. Miller
*/
-#include "mtypes.h"
-#include "colormac.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/mm.h"
+#include "main/extensions.h"
+#include "main/enums.h"
+
+#include "vbo/vbo.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
+
#include "ffb_dd.h"
#include "ffb_span.h"
#include "ffb_depth.h"
@@ -36,15 +45,6 @@
#include "ffb_tris.h"
#include "ffb_state.h"
#include "ffb_lock.h"
-#include "extensions.h"
-#include "enums.h"
-
-#include "swrast/swrast.h"
-#include "vbo/vbo.h"
-#include "tnl/tnl.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
#undef STATE_TRACE
diff --git a/src/mesa/drivers/dri/ffb/ffb_stencil.c b/src/mesa/drivers/dri/ffb/ffb_stencil.c
index 2f13ee9210..b18b0ce34c 100644
--- a/src/mesa/drivers/dri/ffb/ffb_stencil.c
+++ b/src/mesa/drivers/dri/ffb/ffb_stencil.c
@@ -25,7 +25,7 @@
* David S. Miller
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "ffb_dd.h"
#include "ffb_span.h"
#include "ffb_context.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_tex.c b/src/mesa/drivers/dri/ffb/ffb_tex.c
index d6763b7cd3..dc5273b58a 100644
--- a/src/mesa/drivers/dri/ffb/ffb_tex.c
+++ b/src/mesa/drivers/dri/ffb/ffb_tex.c
@@ -25,8 +25,8 @@
* David S. Miller
*/
-#include "glheader.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
#include "ffb_tex.h"
/* No texture unit, all software. */
diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.c b/src/mesa/drivers/dri/ffb/ffb_tris.c
index 9fae8c8283..891918895d 100644
--- a/src/mesa/drivers/dri/ffb/ffb_tris.c
+++ b/src/mesa/drivers/dri/ffb/ffb_tris.c
@@ -25,12 +25,12 @@
* David S. Miller
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
#include "swrast/s_context.h"
+#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.c b/src/mesa/drivers/dri/ffb/ffb_vb.c
index 6ba1eabbf2..5e2c435d09 100644
--- a/src/mesa/drivers/dri/ffb/ffb_vb.c
+++ b/src/mesa/drivers/dri/ffb/ffb_vb.c
@@ -28,7 +28,7 @@
#include "ffb_xmesa.h"
#include "ffb_context.h"
#include "ffb_vb.h"
-#include "imports.h"
+#include "main/imports.h"
#include "tnl/t_context.h"
#include "swrast_setup/swrast_setup.h"
#include "math/m_translate.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_vb.h b/src/mesa/drivers/dri/ffb/ffb_vb.h
index 9eb6759f61..8893ae007a 100644
--- a/src/mesa/drivers/dri/ffb/ffb_vb.h
+++ b/src/mesa/drivers/dri/ffb/ffb_vb.h
@@ -3,8 +3,8 @@
#ifndef _FFB_VB_H
#define _FFB_VB_H
-#include "mtypes.h"
-#include "macros.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "tnl/t_context.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c
index df0096b18f..a2657e7b90 100644
--- a/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c
+++ b/src/mesa/drivers/dri/ffb/ffb_vtxfmt.c
@@ -25,20 +25,20 @@
* David S. Miller
*/
-#include "glheader.h"
+#include "main/glheader.h"
#include "api_noop.h"
-#include "context.h"
+#include "main/context.h"
#include "light.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "simple_list.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/simple_list.h"
#include "vtxfmt.h"
#include "ffb_xmesa.h"
#include "ffb_context.h"
#include "ffb_vb.h"
#include "tnl/tnl.h"
-#include "tnl/t_context.h"
+#include "tnl/tcontext.h"
#include "ffb_vtxfmt.h"
diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c
index 7fd4e570d3..cf364c52ae 100644
--- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c
+++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c
@@ -26,12 +26,12 @@
*/
#include "ffb_xmesa.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/matrix.h"
+#include "main/renderbuffer.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
#include "utils.h"
#include "swrast/swrast.h"
@@ -226,7 +226,7 @@ ffbCreateContext(const __GLcontextModes *mesaVis,
fmesa->driScreen = sPriv;
fmesa->ffb_sarea = FFB_DRISHARE(sPriv->pSAREA);
- /* Register and framebuffer hw pointers. */
+ /* Register and framebuffer pointers. */
fmesa->regs = ffbScreen->regs;
fmesa->sfb32 = ffbScreen->sfb32;
diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.h b/src/mesa/drivers/dri/ffb/ffb_xmesa.h
index b7580780a6..8a9bb6b14a 100644
--- a/src/mesa/drivers/dri/ffb/ffb_xmesa.h
+++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.h
@@ -5,7 +5,7 @@
#include
#include "dri_util.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "ffb_drishare.h"
#include "ffb_regs.h"
#include "ffb_dac.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_context.c b/src/mesa/drivers/dri/gamma/gamma_context.c
index b1dcbfcdcf..c91bedce3a 100644
--- a/src/mesa/drivers/dri/gamma/gamma_context.c
+++ b/src/mesa/drivers/dri/gamma/gamma_context.c
@@ -24,7 +24,7 @@
* 3DLabs Gamma driver.
*
*/
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -35,16 +35,16 @@
#include "drivers/common/driverfuncs.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
#if defined(USE_X86_ASM)
#include "x86/common_x86_asm.h"
#endif
-#include "simple_list.h"
-#include "mm.h"
+#include "main/simple_list.h"
+#include "main/mm.h"
#include "gamma_vb.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_context.h b/src/mesa/drivers/dri/gamma/gamma_context.h
index ef7119c210..35b2386822 100644
--- a/src/mesa/drivers/dri/gamma/gamma_context.h
+++ b/src/mesa/drivers/dri/gamma/gamma_context.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_context.h,v 1.6 2002/12/16 16:18:50 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gammacontext.h,v 1.6 2002/12/16 16:18:50 dawes Exp $ */
/*
* Copyright 2001 by Alan Hourihane.
*
@@ -32,12 +32,12 @@
#include "drm_sarea.h"
#include "colormac.h"
#include "gamma_regs.h"
-#include "gamma_macros.h"
+#include "gamma_main/macros.h"
#include "gamma_screen.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
#include "glint_dri.h"
-#include "mm.h"
+#include "main/mm.h"
typedef union {
unsigned int i;
diff --git a/src/mesa/drivers/dri/gamma/gamma_dd.c b/src/mesa/drivers/dri/gamma/gamma_dd.c
index 63e3ab8fa5..7a81ef5993 100644
--- a/src/mesa/drivers/dri/gamma/gamma_dd.c
+++ b/src/mesa/drivers/dri/gamma/gamma_dd.c
@@ -23,14 +23,14 @@
*
*/
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_vb.h"
#include "gamma_lock.h"
#if defined(USE_X86_ASM)
#include "x86/common_x86_asm.h"
#endif
-#include "context.h"
+#include "main/context.h"
#include "swrast/swrast.h"
#define GAMMA_DATE "20021125"
diff --git a/src/mesa/drivers/dri/gamma/gamma_inithw.c b/src/mesa/drivers/dri/gamma/gamma_inithw.c
index 47eb802b4e..01f0edaf7b 100644
--- a/src/mesa/drivers/dri/gamma/gamma_inithw.c
+++ b/src/mesa/drivers/dri/gamma/gamma_inithw.c
@@ -25,7 +25,7 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_inithw.c,v 1.9 2002/10/30 12:51:29 alanh Exp $ */
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "glint_dri.h"
void gammaInitHW( gammaContextPtr gmesa )
diff --git a/src/mesa/drivers/dri/gamma/gamma_lock.c b/src/mesa/drivers/dri/gamma/gamma_lock.c
index 2ab387fa27..4a7778867f 100644
--- a/src/mesa/drivers/dri/gamma/gamma_lock.c
+++ b/src/mesa/drivers/dri/gamma/gamma_lock.c
@@ -1,6 +1,6 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_lock.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_lock.h"
#include "drirenderbuffer.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_macros.h b/src/mesa/drivers/dri/gamma/gamma_macros.h
index 974fe569df..a56f85dfc9 100644
--- a/src/mesa/drivers/dri/gamma/gamma_macros.h
+++ b/src/mesa/drivers/dri/gamma/gamma_macros.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_macros.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_main/macros.h,v 1.5 2002/02/22 21:33:02 dawes Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c
index 2bc579c3f9..32adeb8db8 100644
--- a/src/mesa/drivers/dri/gamma/gamma_render.c
+++ b/src/mesa/drivers/dri/gamma/gamma_render.c
@@ -25,15 +25,15 @@
*
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
-#include "tnl/t_context.h"
+#include "tnl/tcontext.h"
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_tris.h"
#include "gamma_vb.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_screen.c b/src/mesa/drivers/dri/gamma/gamma_screen.c
index 0b91d059e9..f899ebec96 100644
--- a/src/mesa/drivers/dri/gamma/gamma_screen.c
+++ b/src/mesa/drivers/dri/gamma/gamma_screen.c
@@ -23,11 +23,11 @@
*
*/
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_vb.h"
#include "glint_dri.h"
-#include "imports.h"
+#include "main/imports.h"
gammaScreenPtr gammaCreateScreen( __DRIscreenPrivate *sPriv )
{
diff --git a/src/mesa/drivers/dri/gamma/gamma_span.c b/src/mesa/drivers/dri/gamma/gamma_span.c
index 933f62c96c..4984016450 100644
--- a/src/mesa/drivers/dri/gamma/gamma_span.c
+++ b/src/mesa/drivers/dri/gamma/gamma_span.c
@@ -1,6 +1,6 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/gamma/gamma_span.c,v 1.4 2002/11/05 17:46:07 tsi Exp $ */
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_lock.h"
#include "colormac.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_state.c b/src/mesa/drivers/dri/gamma/gamma_state.c
index 8dbe0a97ca..d156329ad5 100644
--- a/src/mesa/drivers/dri/gamma/gamma_state.c
+++ b/src/mesa/drivers/dri/gamma/gamma_state.c
@@ -25,10 +25,10 @@
* 3DLabs Gamma driver
*/
-#include "gamma_context.h"
-#include "gamma_macros.h"
+#include "gammacontext.h"
+#include "gamma_main/macros.h"
#include "buffers.h"
-#include "macros.h"
+#include "main/macros.h"
#include "glint_dri.h"
#include "colormac.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c
index d4fc93f86b..57ab20088b 100644
--- a/src/mesa/drivers/dri/gamma/gamma_tex.c
+++ b/src/mesa/drivers/dri/gamma/gamma_tex.c
@@ -3,19 +3,19 @@
#include
#include
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/texstore.h"
#include "teximage.h"
-#include "texformat.h"
+#include "main/texformat.h"
#include "texobj.h"
#include "swrast/swrast.h"
-#include "mm.h"
-#include "gamma_context.h"
+#include "main/mm.h"
+#include "gammacontext.h"
#include "colormac.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_texmem.c b/src/mesa/drivers/dri/gamma/gamma_texmem.c
index 506b5c4c8f..58184ea7f1 100644
--- a/src/mesa/drivers/dri/gamma/gamma_texmem.c
+++ b/src/mesa/drivers/dri/gamma/gamma_texmem.c
@@ -3,16 +3,16 @@
#include
#include
-#include "glheader.h"
+#include "main/glheader.h"
#include "colormac.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
-#include "mm.h"
+#include "main/mm.h"
#include "glint_dri.h"
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_lock.h"
void gammaDestroyTexObj(gammaContextPtr gmesa, gammaTextureObjectPtr t)
diff --git a/src/mesa/drivers/dri/gamma/gamma_texstate.c b/src/mesa/drivers/dri/gamma/gamma_texstate.c
index a8d1b253c7..60bade271b 100644
--- a/src/mesa/drivers/dri/gamma/gamma_texstate.c
+++ b/src/mesa/drivers/dri/gamma/gamma_texstate.c
@@ -3,14 +3,14 @@
#include
#include
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
-#include "gamma_context.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+
+#include "main/mm.h"
+#include "gammacontext.h"
static void gammaSetTexImages( gammaContextPtr gmesa,
struct gl_texture_object *tObj )
diff --git a/src/mesa/drivers/dri/gamma/gamma_tris.c b/src/mesa/drivers/dri/gamma/gamma_tris.c
index 83bf56a141..2903daf3f1 100644
--- a/src/mesa/drivers/dri/gamma/gamma_tris.c
+++ b/src/mesa/drivers/dri/gamma/gamma_tris.c
@@ -25,19 +25,19 @@
* 3DLabs Gamma driver.
*/
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_vb.h"
#include "gamma_tris.h"
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "colormac.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/tnl.h"
-#include "tnl/t_context.h"
+#include "tnl/tcontext.h"
#include "tnl/t_pipeline.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.c b/src/mesa/drivers/dri/gamma/gamma_vb.c
index 80d35cba9e..bb36ffc980 100644
--- a/src/mesa/drivers/dri/gamma/gamma_vb.c
+++ b/src/mesa/drivers/dri/gamma/gamma_vb.c
@@ -26,17 +26,17 @@
* 3DLabs Gamma driver.
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "colormac.h"
#include "swrast_setup/swrast_setup.h"
-#include "tnl/t_context.h"
+#include "tnl/tcontext.h"
#include "tnl/tnl.h"
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_vb.h"
#include "gamma_tris.h"
diff --git a/src/mesa/drivers/dri/gamma/gamma_vb.h b/src/mesa/drivers/dri/gamma/gamma_vb.h
index feda25c4c6..8701226f59 100644
--- a/src/mesa/drivers/dri/gamma/gamma_vb.h
+++ b/src/mesa/drivers/dri/gamma/gamma_vb.h
@@ -28,7 +28,7 @@
#ifndef GAMMAVB_INC
#define GAMMAVB_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#define _GAMMA_NEW_VERTEX (_NEW_TEXTURE | \
diff --git a/src/mesa/drivers/dri/gamma/gamma_xmesa.c b/src/mesa/drivers/dri/gamma/gamma_xmesa.c
index 62f0bb578c..5e5f0fa154 100644
--- a/src/mesa/drivers/dri/gamma/gamma_xmesa.c
+++ b/src/mesa/drivers/dri/gamma/gamma_xmesa.c
@@ -25,10 +25,10 @@
* 3DLabs Gamma driver
*/
-#include "gamma_context.h"
+#include "gammacontext.h"
#include "gamma_vb.h"
-#include "context.h"
-#include "matrix.h"
+#include "main/context.h"
+#include "main/matrix.h"
#include "glint_dri.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index 9e09bddea3..0c5071fd61 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -33,14 +33,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "imports.h"
-#include "points.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/matrix.h"
+#include "main/simple_list.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/imports.h"
+#include "main/points.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/i810/i810context.h b/src/mesa/drivers/dri/i810/i810context.h
index b83500bbd0..415d4867a1 100644
--- a/src/mesa/drivers/dri/i810/i810context.h
+++ b/src/mesa/drivers/dri/i810/i810context.h
@@ -21,7 +21,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810context.h,v 1.9 2002/12/16 16:18:51 dawes Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/i810/main/context.h,v 1.9 2002/12/16 16:18:51 dawes Exp $ */
#ifndef I810CONTEXT_INC
#define I810CONTEXT_INC
@@ -31,8 +31,8 @@ typedef struct i810_context_t *i810ContextPtr;
typedef struct i810_texture_object_t *i810TextureObjectPtr;
#include "drm.h"
-#include "mtypes.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
#include "i810screen.h"
#include "i810tex.h"
diff --git a/src/mesa/drivers/dri/i810/i810ioctl.c b/src/mesa/drivers/dri/i810/i810ioctl.c
index 57c84193fa..d162f7650d 100644
--- a/src/mesa/drivers/dri/i810/i810ioctl.c
+++ b/src/mesa/drivers/dri/i810/i810ioctl.c
@@ -2,17 +2,17 @@
#include /* for usleep() */
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/dd.h"
#include "swrast/swrast.h"
-#include "mm.h"
+#include "main/mm.h"
#include "i810screen.h"
#include "i810_dri.h"
-#include "i810context.h"
+#include "main/context.h"
#include "i810ioctl.h"
#include "i810state.h"
diff --git a/src/mesa/drivers/dri/i810/i810render.c b/src/mesa/drivers/dri/i810/i810render.c
index d0225969b6..1d98e00688 100644
--- a/src/mesa/drivers/dri/i810/i810render.c
+++ b/src/mesa/drivers/dri/i810/i810render.c
@@ -31,11 +31,11 @@
* dma buffers. Use strip/fan hardware acceleration where possible.
*
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c
index 4bfe6f264f..47284d694c 100644
--- a/src/mesa/drivers/dri/i810/i810screen.c
+++ b/src/mesa/drivers/dri/i810/i810screen.c
@@ -33,14 +33,14 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "fbobject.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/fbobject.h"
+#include "main/matrix.h"
+#include "main/renderbuffer.h"
+#include "main/simple_list.h"
#include "utils.h"
#include "i810screen.h"
diff --git a/src/mesa/drivers/dri/i810/i810span.c b/src/mesa/drivers/dri/i810/i810span.c
index 59511de973..510723f445 100644
--- a/src/mesa/drivers/dri/i810/i810span.c
+++ b/src/mesa/drivers/dri/i810/i810span.c
@@ -1,14 +1,14 @@
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "swrast/swrast.h"
#include "i810screen.h"
#include "i810_dri.h"
#include "i810span.h"
#include "i810ioctl.h"
-#include "swrast/swrast.h"
#define DBG 0
diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c
index 4b3cb873b8..45d7e7a0fa 100644
--- a/src/mesa/drivers/dri/i810/i810state.c
+++ b/src/mesa/drivers/dri/i810/i810state.c
@@ -2,11 +2,16 @@
#include
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "dd.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/dd.h"
+#include "main/colormac.h"
+#include "swrast/swrast.h"
+#include "tnl/tnl.h"
+#include "tnl/t_pipeline.h"
+#include "vbo/vbo.h"
+#include "swrast_setup/swrast_setup.h"
#include "texmem.h"
@@ -20,12 +25,6 @@
#include "i810tris.h"
#include "i810ioctl.h"
-#include "swrast/swrast.h"
-#include "tnl/tnl.h"
-#include "vbo/vbo.h"
-#include "swrast_setup/swrast_setup.h"
-
-#include "tnl/t_pipeline.h"
static INLINE GLuint i810PackColor(GLuint format,
GLubyte r, GLubyte g,
diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c
index f657abe671..674d0214e3 100644
--- a/src/mesa/drivers/dri/i810/i810tex.c
+++ b/src/mesa/drivers/dri/i810/i810tex.c
@@ -23,20 +23,21 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810tex.c,v 1.9 2002/10/30 12:51:33 alanh Exp $ */
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texmem.h"
-#include "texobj.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/colormac.h"
+#include "main/texobj.h"
+#include "main/mm.h"
#include "swrast/swrast.h"
-#include "colormac.h"
-#include "texobj.h"
-#include "mm.h"
+
+#include "texmem.h"
#include "i810screen.h"
#include "i810_dri.h"
diff --git a/src/mesa/drivers/dri/i810/i810tex.h b/src/mesa/drivers/dri/i810/i810tex.h
index c6ab4c8e6d..d980927030 100644
--- a/src/mesa/drivers/dri/i810/i810tex.h
+++ b/src/mesa/drivers/dri/i810/i810tex.h
@@ -26,8 +26,8 @@
#ifndef I810TEX_INC
#define I810TEX_INC
-#include "mtypes.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
#include "i810context.h"
#include "i810_3d_reg.h"
diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c
index 9c24fcd8f5..5ad66dbf5c 100644
--- a/src/mesa/drivers/dri/i810/i810texmem.c
+++ b/src/mesa/drivers/dri/i810/i810texmem.c
@@ -23,18 +23,17 @@
*
*/
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "colormac.h"
-#include "mm.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/mm.h"
+#include "main/texformat.h"
#include "i810screen.h"
#include "i810_dri.h"
-
#include "i810context.h"
#include "i810tex.h"
#include "i810state.h"
diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c
index 558aef9eee..0e09f54c41 100644
--- a/src/mesa/drivers/dri/i810/i810texstate.c
+++ b/src/mesa/drivers/dri/i810/i810texstate.c
@@ -22,14 +22,13 @@
*
*/
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "texformat.h"
-#include "simple_list.h"
-#include "enums.h"
-
-#include "mm.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/texformat.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/mm.h"
#include "i810screen.h"
#include "i810_dri.h"
diff --git a/src/mesa/drivers/dri/i810/i810tris.c b/src/mesa/drivers/dri/i810/i810tris.c
index f6dd7a4d22..5c49d7f907 100644
--- a/src/mesa/drivers/dri/i810/i810tris.c
+++ b/src/mesa/drivers/dri/i810/i810tris.c
@@ -31,11 +31,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "enums.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/colormac.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/i810/i810tris.h b/src/mesa/drivers/dri/i810/i810tris.h
index 06c8b3fcd5..8d855ae21f 100644
--- a/src/mesa/drivers/dri/i810/i810tris.h
+++ b/src/mesa/drivers/dri/i810/i810tris.h
@@ -27,7 +27,7 @@
#ifndef I810TRIS_INC
#define I810TRIS_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void i810PrintRenderState( const char *msg, GLuint state );
extern void i810InitTriFuncs( GLcontext *ctx );
diff --git a/src/mesa/drivers/dri/i810/i810vb.c b/src/mesa/drivers/dri/i810/i810vb.c
index 5ce98a991d..4950b88718 100644
--- a/src/mesa/drivers/dri/i810/i810vb.c
+++ b/src/mesa/drivers/dri/i810/i810vb.c
@@ -25,18 +25,17 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/i810/i810vb.c,v 1.13 2003/03/26 20:43:48 tsi Exp $ */
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
#include "i810screen.h"
#include "i810_dri.h"
-
#include "i810context.h"
#include "i810vb.h"
#include "i810ioctl.h"
diff --git a/src/mesa/drivers/dri/i810/i810vb.h b/src/mesa/drivers/dri/i810/i810vb.h
index 1cced86ab2..014a17d5a5 100644
--- a/src/mesa/drivers/dri/i810/i810vb.h
+++ b/src/mesa/drivers/dri/i810/i810vb.h
@@ -27,7 +27,7 @@
#ifndef I810VB_INC
#define I810VB_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#define _I810_NEW_VERTEX (_NEW_TEXTURE | \
diff --git a/src/mesa/drivers/dri/i915/i830_context.c b/src/mesa/drivers/dri/i915/i830_context.c
index 116b52511f..09b1ec922f 100644
--- a/src/mesa/drivers/dri/i915/i830_context.c
+++ b/src/mesa/drivers/dri/i915/i830_context.c
@@ -26,7 +26,7 @@
**************************************************************************/
#include "i830_context.h"
-#include "imports.h"
+#include "main/imports.h"
#include "texmem.h"
#include "intel_tex.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/dri/i915/i830_metaops.c b/src/mesa/drivers/dri/i915/i830_metaops.c
index acfb3af910..2cce661c86 100644
--- a/src/mesa/drivers/dri/i915/i830_metaops.c
+++ b/src/mesa/drivers/dri/i915/i830_metaops.c
@@ -25,10 +25,10 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "utils.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/i915/i830_state.c b/src/mesa/drivers/dri/i915/i830_state.c
index e44a7dfca1..d9cad0c4bf 100644
--- a/src/mesa/drivers/dri/i915/i830_state.c
+++ b/src/mesa/drivers/dri/i915/i830_state.c
@@ -26,11 +26,11 @@
**************************************************************************/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/dd.h"
#include "texmem.h"
diff --git a/src/mesa/drivers/dri/i915/i830_tex.c b/src/mesa/drivers/dri/i915/i830_tex.c
index c0126ba19a..34ac42a78e 100644
--- a/src/mesa/drivers/dri/i915/i830_tex.c
+++ b/src/mesa/drivers/dri/i915/i830_tex.c
@@ -25,18 +25,18 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "image.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "texmem.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/mm.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
#include "swrast/swrast.h"
-#include "mm.h"
+#include "texmem.h"
#include "i830_context.h"
#include "i830_reg.h"
diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c
index dca72adeca..09f7f37e76 100644
--- a/src/mesa/drivers/dri/i915/i830_texblend.c
+++ b/src/mesa/drivers/dri/i915/i830_texblend.c
@@ -25,15 +25,14 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texformat.h"
-#include "texstore.h"
-
-#include "mm.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/texformat.h"
+#include "main/texstore.h"
+#include "main/mm.h"
#include "intel_screen.h"
#include "intel_tex.h"
diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c
index 314bbe32b6..c718bb0055 100644
--- a/src/mesa/drivers/dri/i915/i830_texstate.c
+++ b/src/mesa/drivers/dri/i915/i830_texstate.c
@@ -25,9 +25,9 @@
*
**************************************************************************/
-#include "mtypes.h"
-#include "enums.h"
-#include "texformat.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/texformat.h"
#include "intel_mipmap_tree.h"
#include "intel_tex.h"
diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c
index 40a50ff772..0ab27704d5 100644
--- a/src/mesa/drivers/dri/i915/i830_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i830_vtbl.c
@@ -25,7 +25,7 @@
*
**************************************************************************/
-#include "glapi.h"
+#include "glapi/glapi.h"
#include "i830_context.h"
#include "i830_reg.h"
diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c
index 940b02513d..efcac911aa 100644
--- a/src/mesa/drivers/dri/i915/i915_context.c
+++ b/src/mesa/drivers/dri/i915/i915_context.c
@@ -26,7 +26,7 @@
**************************************************************************/
#include "i915_context.h"
-#include "imports.h"
+#include "main/imports.h"
#include "intel_tex.h"
#include "intel_tris.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c
index eb1a052b9e..f7bb7ea44c 100644
--- a/src/mesa/drivers/dri/i915/i915_debug.c
+++ b/src/mesa/drivers/dri/i915/i915_debug.c
@@ -25,7 +25,7 @@
*
**************************************************************************/
-#include "imports.h"
+#include "main/imports.h"
#include "i915_reg.h"
#include "i915_context.h"
diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index 1876218ca0..8bd761ec6a 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -25,9 +25,9 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
diff --git a/src/mesa/drivers/dri/i915/i915_metaops.c b/src/mesa/drivers/dri/i915/i915_metaops.c
index bfe97f13e5..90a78c6082 100644
--- a/src/mesa/drivers/dri/i915/i915_metaops.c
+++ b/src/mesa/drivers/dri/i915/i915_metaops.c
@@ -25,10 +25,10 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "utils.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c
index f79d00ddcf..49193297a8 100644
--- a/src/mesa/drivers/dri/i915/i915_program.c
+++ b/src/mesa/drivers/dri/i915/i915_program.c
@@ -27,9 +27,9 @@
#include
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "tnl/t_context.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index c814f8d532..9d04358e4f 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -26,11 +26,11 @@
**************************************************************************/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "dd.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/dd.h"
#include "tnl/tnl.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/drivers/dri/i915/i915_tex.c b/src/mesa/drivers/dri/i915/i915_tex.c
index cb55bf6125..e38d8fe79d 100644
--- a/src/mesa/drivers/dri/i915/i915_tex.c
+++ b/src/mesa/drivers/dri/i915/i915_tex.c
@@ -25,18 +25,18 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "image.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "texmem.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/mm.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
#include "swrast/swrast.h"
-#include "mm.h"
+#include "texmem.h"
#include "i915_context.h"
#include "i915_reg.h"
diff --git a/src/mesa/drivers/dri/i915/i915_tex_layout.c b/src/mesa/drivers/dri/i915/i915_tex_layout.c
index b5085f49d4..d44a2f47b3 100644
--- a/src/mesa/drivers/dri/i915/i915_tex_layout.c
+++ b/src/mesa/drivers/dri/i915/i915_tex_layout.c
@@ -31,7 +31,7 @@
#include "intel_mipmap_tree.h"
#include "intel_tex_layout.h"
-#include "macros.h"
+#include "main/macros.h"
#include "intel_context.h"
#define FILE_DEBUG_FLAG DEBUG_TEXTURE
diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c
index 48137f025f..ae42b102db 100644
--- a/src/mesa/drivers/dri/i915/i915_texstate.c
+++ b/src/mesa/drivers/dri/i915/i915_texstate.c
@@ -25,9 +25,9 @@
*
**************************************************************************/
-#include "mtypes.h"
-#include "enums.h"
-#include "texformat.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/texformat.h"
#include "intel_mipmap_tree.h"
#include "intel_tex.h"
diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c
index 19f2206285..edbbe23e09 100644
--- a/src/mesa/drivers/dri/i915/i915_vtbl.c
+++ b/src/mesa/drivers/dri/i915/i915_vtbl.c
@@ -27,11 +27,11 @@
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "tnl/t_context.h"
#include "tnl/t_vertex.h"
@@ -44,7 +44,7 @@
#include "i915_reg.h"
#include "i915_context.h"
-#include "glapi.h"
+#include "glapi/glapi.h"
static void
i915_render_prevalidate(struct intel_context *intel)
diff --git a/src/mesa/drivers/dri/i915/intel_pixel_read.c b/src/mesa/drivers/dri/i915/intel_pixel_read.c
index 120c887abd..56087aacd4 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel_read.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel_read.c
@@ -25,12 +25,12 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "image.h"
-#include "bufferobj.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/image.h"
+#include "main/bufferobj.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c
index 838d450378..467abe4d7c 100644
--- a/src/mesa/drivers/dri/i915/intel_render.c
+++ b/src/mesa/drivers/dri/i915/intel_render.c
@@ -30,12 +30,12 @@
* dma buffers. Use strip/fan hardware acceleration where possible.
*
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
#include "tnl/t_context.h"
#include "tnl/t_vertex.h"
diff --git a/src/mesa/drivers/dri/i915/intel_state.c b/src/mesa/drivers/dri/i915/intel_state.c
index d1ca11dec4..09aa62da36 100644
--- a/src/mesa/drivers/dri/i915/intel_state.c
+++ b/src/mesa/drivers/dri/i915/intel_state.c
@@ -26,12 +26,12 @@
**************************************************************************/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "colormac.h"
-#include "dd.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/dd.h"
#include "intel_screen.h"
#include "intel_context.h"
diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index 5f4b852212..723cc70173 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -31,13 +31,13 @@
* primitives into it.
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "texobj.h"
-#include "state.h"
-#include "dd.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/texobj.h"
+#include "main/state.h"
+#include "main/dd.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/i915/intel_tris.h b/src/mesa/drivers/dri/i915/intel_tris.h
index 0e08986221..55b60a47f9 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.h
+++ b/src/mesa/drivers/dri/i915/intel_tris.h
@@ -28,7 +28,7 @@
#ifndef INTELTRIS_INC
#define INTELTRIS_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
#define INTEL_VB_SIZE (32 * 1024)
/** 3 dwords of state_immediate and 2 of 3dprim, in intel_flush_prim */
diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c
index 0458bf5983..fa8121e02d 100644
--- a/src/mesa/drivers/dri/i965/brw_cc.c
+++ b/src/mesa/drivers/dri/i965/brw_cc.c
@@ -34,8 +34,8 @@
#include "brw_state.h"
#include "brw_defines.h"
#include "brw_util.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/macros.h"
+#include "main/enums.h"
static void prepare_cc_vp( struct brw_context *brw )
{
diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c
index 22981fd2d9..38d8b704d7 100644
--- a/src/mesa/drivers/dri/i965/brw_clip.c
+++ b/src/mesa/drivers/dri/i965/brw_clip.c
@@ -29,9 +29,9 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/brw_clip_line.c b/src/mesa/drivers/dri/i965/brw_clip_line.c
index 0930e6a573..c87e5b9a12 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_line.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_line.c
@@ -29,11 +29,11 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
+
#include "intel_batchbuffer.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_clip_point.c b/src/mesa/drivers/dri/i965/brw_clip_point.c
index 2346980a56..d17b199b89 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_point.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_point.c
@@ -29,11 +29,11 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
+
#include "intel_batchbuffer.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_clip_state.c b/src/mesa/drivers/dri/i965/brw_clip_state.c
index 51045f9188..82d1e87357 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_state.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_state.c
@@ -32,7 +32,7 @@
#include "brw_context.h"
#include "brw_state.h"
#include "brw_defines.h"
-#include "macros.h"
+#include "main/macros.h"
struct brw_clip_unit_key {
unsigned int total_grf;
diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c
index 00039011b9..8459b59b46 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_tri.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c
@@ -29,11 +29,11 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
+
#include "intel_batchbuffer.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c
index 6f20d798d8..d7ca517927 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_unfilled.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_unfilled.c
@@ -29,11 +29,11 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
+
#include "intel_batchbuffer.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_clip_util.c b/src/mesa/drivers/dri/i965/brw_clip_util.c
index c32bd4ec24..9d3b0be694 100644
--- a/src/mesa/drivers/dri/i965/brw_clip_util.c
+++ b/src/mesa/drivers/dri/i965/brw_clip_util.c
@@ -30,11 +30,11 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
-
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
+
#include "intel_batchbuffer.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index b4e2619929..df4593e42f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -30,11 +30,15 @@
*/
+#include "main/imports.h"
+#include "main/api_noop.h"
+#include "main/vtxfmt.h"
+#include "shader/shader_api.h"
+
#include "brw_context.h"
#include "brw_defines.h"
#include "brw_draw.h"
#include "brw_vs.h"
-#include "imports.h"
#include "intel_tex.h"
#include "intel_blit.h"
#include "intel_batchbuffer.h"
@@ -43,10 +47,7 @@
#include "tnl/t_pipeline.h"
#include "utils.h"
-#include "api_noop.h"
-#include "vtxfmt.h"
-#include "shader/shader_api.h"
/***************************************
* Mesa's Driver Functions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 330d5714da..5f180fd65f 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -35,7 +35,7 @@
#include "intel_context.h"
#include "brw_structs.h"
-#include "imports.h"
+#include "main/imports.h"
/* Glossary:
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index 0a3600193b..c4e06af6b1 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -31,10 +31,10 @@
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/prog_parameter.h"
#include "shader/prog_statevars.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 95d798238d..542639ab77 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -27,11 +27,11 @@
#include
-#include "glheader.h"
-#include "context.h"
-#include "state.h"
-#include "api_validate.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/state.h"
+#include "main/api_validate.h"
+#include "main/enums.h"
#include "brw_draw.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_draw.h b/src/mesa/drivers/dri/i965/brw_draw.h
index e0bba589d5..9aebbdb1b8 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.h
+++ b/src/mesa/drivers/dri/i965/brw_draw.h
@@ -28,7 +28,7 @@
#ifndef BRW_DRAW_H
#define BRW_DRAW_H
-#include "mtypes.h" /* for GLcontext... */
+#include "main/mtypes.h" /* for GLcontext... */
#include "vbo/vbo.h"
struct brw_context;
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 465239f195..55a8defa99 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -27,11 +27,11 @@
#include
-#include "glheader.h"
-#include "context.h"
-#include "state.h"
-#include "api_validate.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/state.h"
+#include "main/api_validate.h"
+#include "main/enums.h"
#include "brw_draw.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_eu_debug.c b/src/mesa/drivers/dri/i965/brw_eu_debug.c
index 2dff1ad224..91dbbd5af6 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_debug.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_debug.c
@@ -30,9 +30,9 @@
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
#include "brw_eu.h"
-#include "imports.h"
void brw_print_reg( struct brw_reg hwreg )
{
diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c
index 693f68f32a..2f6b7febbd 100644
--- a/src/mesa/drivers/dri/i965/brw_fallback.c
+++ b/src/mesa/drivers/dri/i965/brw_fallback.c
@@ -25,19 +25,20 @@
*
**************************************************************************/
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+
#include "swrast_setup/swrast_setup.h"
#include "swrast/swrast.h"
#include "tnl/tnl.h"
-#include "context.h"
#include "brw_context.h"
#include "brw_fallback.h"
-#include "glheader.h"
-#include "enums.h"
-#include "glapi.h"
-#include "imports.h"
-#include "macros.h"
-#include "mtypes.h"
+#include "glapi/glapi.h"
#define FILE_DEBUG_FLAG DEBUG_FALLBACKS
diff --git a/src/mesa/drivers/dri/i965/brw_fallback.h b/src/mesa/drivers/dri/i965/brw_fallback.h
index 684a46cd17..50dcdacd17 100644
--- a/src/mesa/drivers/dri/i965/brw_fallback.h
+++ b/src/mesa/drivers/dri/i965/brw_fallback.h
@@ -28,7 +28,7 @@
#ifndef BRW_FALLBACK_H
#define BRW_FALLBACK_H
-#include "mtypes.h" /* for GLcontext... */
+#include "main/mtypes.h" /* for GLcontext... */
struct brw_context;
struct vbo_prim;
diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c
index 2daef0093b..a8b74a0afe 100644
--- a/src/mesa/drivers/dri/i965/brw_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_gs.c
@@ -29,9 +29,9 @@
* Keith Whitwell
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/brw_gs_emit.c b/src/mesa/drivers/dri/i965/brw_gs_emit.c
index 9abb94d82e..22e0d25c2e 100644
--- a/src/mesa/drivers/dri/i965/brw_gs_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_gs_emit.c
@@ -30,9 +30,9 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/brw_gs_state.c b/src/mesa/drivers/dri/i965/brw_gs_state.c
index 633e17cc9d..27023cf034 100644
--- a/src/mesa/drivers/dri/i965/brw_gs_state.c
+++ b/src/mesa/drivers/dri/i965/brw_gs_state.c
@@ -34,7 +34,7 @@
#include "brw_context.h"
#include "brw_state.h"
#include "brw_defines.h"
-#include "macros.h"
+#include "main/macros.h"
struct brw_gs_unit_key {
unsigned int total_grf;
diff --git a/src/mesa/drivers/dri/i965/brw_metaops.c b/src/mesa/drivers/dri/i965/brw_metaops.c
index 252a8996e2..41bfa2e256 100644
--- a/src/mesa/drivers/dri/i965/brw_metaops.c
+++ b/src/mesa/drivers/dri/i965/brw_metaops.c
@@ -32,9 +32,9 @@
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
#include "shader/arbprogparse.h"
diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c
index 5bb9e11310..9dce6cd8e6 100644
--- a/src/mesa/drivers/dri/i965/brw_sf.c
+++ b/src/mesa/drivers/dri/i965/brw_sf.c
@@ -30,9 +30,9 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index 6fba8c8908..ffdb0ae6df 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -30,9 +30,9 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c
index 07d0b4c798..4f925d1810 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_state.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_state.c
@@ -34,7 +34,7 @@
#include "brw_context.h"
#include "brw_state.h"
#include "brw_defines.h"
-#include "macros.h"
+#include "main/macros.h"
#include "intel_fbo.h"
static void upload_sf_vp(struct brw_context *brw)
diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c
index 77e2736d11..94ef924868 100644
--- a/src/mesa/drivers/dri/i965/brw_state_batch.c
+++ b/src/mesa/drivers/dri/i965/brw_state_batch.c
@@ -33,7 +33,7 @@
#include "brw_state.h"
#include "intel_batchbuffer.h"
-#include "imports.h"
+#include "main/imports.h"
diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c
index fc0c3bd9ff..1318dea594 100644
--- a/src/mesa/drivers/dri/i965/brw_state_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_state_cache.c
@@ -58,7 +58,7 @@
#include "brw_state.h"
#include "intel_batchbuffer.h"
-#include "imports.h"
+#include "main/imports.h"
/* XXX: Fixme - have to include these to get the sizes of the prog_key
* structs:
diff --git a/src/mesa/drivers/dri/i965/brw_state_dump.c b/src/mesa/drivers/dri/i965/brw_state_dump.c
index 3a93f9f732..b28c57c2bc 100644
--- a/src/mesa/drivers/dri/i965/brw_state_dump.c
+++ b/src/mesa/drivers/dri/i965/brw_state_dump.c
@@ -25,7 +25,7 @@
*
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "brw_context.h"
#include "brw_state.h"
diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c
index ab6393420a..0bb6f176a0 100644
--- a/src/mesa/drivers/dri/i965/brw_tex.c
+++ b/src/mesa/drivers/dri/i965/brw_tex.c
@@ -30,15 +30,16 @@
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "image.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/teximage.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
+
#include "texmem.h"
#include "intel_context.h"
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c
index e437c411dd..51a617fcb4 100644
--- a/src/mesa/drivers/dri/i965/brw_tex_layout.c
+++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c
@@ -36,7 +36,7 @@
#include "intel_mipmap_tree.h"
#include "intel_tex_layout.h"
#include "intel_context.h"
-#include "macros.h"
+#include "main/macros.h"
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c
index d8d35c574e..ce21aa4869 100644
--- a/src/mesa/drivers/dri/i965/brw_util.c
+++ b/src/mesa/drivers/dri/i965/brw_util.c
@@ -30,7 +30,7 @@
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "shader/prog_parameter.h"
#include "brw_util.h"
#include "brw_defines.h"
diff --git a/src/mesa/drivers/dri/i965/brw_util.h b/src/mesa/drivers/dri/i965/brw_util.h
index bd6cc0a268..33e7cd87e4 100644
--- a/src/mesa/drivers/dri/i965/brw_util.h
+++ b/src/mesa/drivers/dri/i965/brw_util.h
@@ -33,7 +33,7 @@
#ifndef BRW_UTIL_H
#define BRW_UTIL_H
-#include "mtypes.h"
+#include "main/mtypes.h"
extern GLuint brw_count_bits( GLuint val );
extern GLuint brw_parameter_list_state_flags(struct gl_program_parameter_list *paramList);
diff --git a/src/mesa/drivers/dri/i965/brw_vs_constval.c b/src/mesa/drivers/dri/i965/brw_vs_constval.c
index 734a926e96..6fbac02de6 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_constval.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_constval.c
@@ -30,7 +30,7 @@
*/
-#include "macros.h"
+#include "main/macros.h"
#include "brw_context.h"
#include "brw_vs.h"
diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c
index 24bf5567bd..6e66f54524 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_state.c
@@ -34,7 +34,7 @@
#include "brw_context.h"
#include "brw_state.h"
#include "brw_defines.h"
-#include "macros.h"
+#include "main/macros.h"
struct brw_vs_unit_key {
unsigned int total_grf;
diff --git a/src/mesa/drivers/dri/i965/brw_vs_tnl.c b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
index 2caa020e61..aa338493d6 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_tnl.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_tnl.c
@@ -30,9 +30,9 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/prog_parameter.h"
#include "shader/prog_print.h"
#include "brw_vs.h"
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index 31e96a250a..89e10f6285 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -32,11 +32,11 @@
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "intel_batchbuffer.h"
#include "intel_regions.h"
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c
index 9b919b9cfe..f1c14c98f9 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c
@@ -30,7 +30,7 @@
*/
-#include "macros.h"
+#include "main/macros.h"
#include "brw_context.h"
#include "brw_wm.h"
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c
index bc933fe7e4..d3e926c328 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_fp.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c
@@ -30,9 +30,9 @@
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "brw_context.h"
#include "brw_wm.h"
#include "brw_util.h"
diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
index 8dce40f25b..4d5e11f4b6 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c
@@ -1,4 +1,4 @@
-#include "macros.h"
+#include "main/macros.h"
#include "shader/prog_parameter.h"
#include "brw_context.h"
#include "brw_eu.h"
diff --git a/src/mesa/drivers/dri/i965/brw_wm_iz.c b/src/mesa/drivers/dri/i965/brw_wm_iz.c
index ec2b976faa..0bb5d5ba83 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_iz.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_iz.c
@@ -30,7 +30,7 @@
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "brw_wm.h"
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 e47dbe8b10..e1db31ec08 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -34,7 +34,7 @@
#include "brw_state.h"
#include "brw_defines.h"
-#include "macros.h"
+#include "main/macros.h"
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 8fcd50924f..47127c0421 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -30,9 +30,9 @@
*/
-#include "mtypes.h"
-#include "texformat.h"
-#include "texstore.h"
+#include "main/mtypes.h"
+#include "main/texformat.h"
+#include "main/texstore.h"
#include "intel_mipmap_tree.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/i965/intel_state.c b/src/mesa/drivers/dri/i965/intel_state.c
index 0fba5a771c..67ef5f78c1 100644
--- a/src/mesa/drivers/dri/i965/intel_state.c
+++ b/src/mesa/drivers/dri/i965/intel_state.c
@@ -26,12 +26,12 @@
**************************************************************************/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "enums.h"
-#include "colormac.h"
-#include "dd.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/dd.h"
#include "intel_screen.h"
#include "intel_context.h"
diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
index cf7d4a0633..1f8096b32e 100644
--- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h
+++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h
@@ -1,7 +1,7 @@
#ifndef INTEL_BATCHBUFFER_H
#define INTEL_BATCHBUFFER_H
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "intel_context.h"
#include "intel_bufmgr.h"
diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c
index 653f485dd0..2917401e02 100644
--- a/src/mesa/drivers/dri/intel/intel_blit.c
+++ b/src/mesa/drivers/dri/intel/intel_blit.c
@@ -29,9 +29,9 @@
#include
#include
-#include "mtypes.h"
-#include "context.h"
-#include "enums.h"
+#include "main/mtypes.h"
+#include "main/context.h"
+#include "main/enums.h"
#include "intel_blit.h"
#include "intel_buffers.h"
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
index 88484a07af..60d7bb3770 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c
@@ -26,9 +26,9 @@
**************************************************************************/
-#include "imports.h"
-#include "mtypes.h"
-#include "bufferobj.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/bufferobj.h"
#include "intel_context.h"
#include "intel_buffer_objects.h"
diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.h b/src/mesa/drivers/dri/intel/intel_buffer_objects.h
index 7cecc3232d..bf6dbd58f2 100644
--- a/src/mesa/drivers/dri/intel/intel_buffer_objects.h
+++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.h
@@ -28,7 +28,7 @@
#ifndef INTEL_BUFFEROBJ_H
#define INTEL_BUFFEROBJ_H
-#include "mtypes.h"
+#include "main/mtypes.h"
struct intel_context;
struct intel_region;
diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c
index 3fe67462d5..defa5b173d 100644
--- a/src/mesa/drivers/dri/intel/intel_buffers.c
+++ b/src/mesa/drivers/dri/intel/intel_buffers.c
@@ -35,11 +35,11 @@
#include "intel_regions.h"
#include "intel_batchbuffer.h"
#include "intel_reg.h"
-#include "context.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "swrast/swrast.h"
#include "utils.h"
#include "drirenderbuffer.h"
-#include "framebuffer.h"
-#include "swrast/swrast.h"
#include "vblank.h"
#include "i915_drm.h"
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 2ca5732606..eee03d022b 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -26,14 +26,14 @@
**************************************************************************/
-#include "glheader.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "imports.h"
-#include "points.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/matrix.h"
+#include "main/simple_list.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/imports.h"
+#include "main/points.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index 8bd75753ea..4af4cb9c96 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -30,10 +30,10 @@
-#include "mtypes.h"
-#include "drm.h"
-#include "mm.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
#include "texmem.h"
+#include "drm.h"
#include "intel_bufmgr.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/intel/intel_depthstencil.c b/src/mesa/drivers/dri/intel/intel_depthstencil.c
index 70ba68e9e3..c2b4d7728b 100644
--- a/src/mesa/drivers/dri/intel/intel_depthstencil.c
+++ b/src/mesa/drivers/dri/intel/intel_depthstencil.c
@@ -25,15 +25,15 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "depthstencil.h"
-#include "fbobject.h"
-#include "framebuffer.h"
-#include "hash.h"
-#include "mtypes.h"
-#include "renderbuffer.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/depthstencil.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/hash.h"
+#include "main/mtypes.h"
+#include "main/renderbuffer.h"
#include "intel_context.h"
#include "intel_fbo.h"
diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index 6570f6e69b..3677dd41d9 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -26,14 +26,14 @@
**************************************************************************/
-#include "imports.h"
-#include "mtypes.h"
-#include "fbobject.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "context.h"
-#include "texformat.h"
-#include "texrender.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/fbobject.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
+#include "main/context.h"
+#include "main/texformat.h"
+#include "main/texrender.h"
#include "intel_context.h"
#include "intel_buffers.h"
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index f28fac8394..b96ba72853 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -29,7 +29,7 @@
#include "intel_mipmap_tree.h"
#include "intel_regions.h"
#include "intel_chipset.h"
-#include "enums.h"
+#include "main/enums.h"
#define FILE_DEBUG_FLAG DEBUG_MIPTREE
diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c
index 6417866b20..f39fac13cf 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel.c
@@ -25,8 +25,8 @@
*
**************************************************************************/
-#include "enums.h"
-#include "state.h"
+#include "main/enums.h"
+#include "main/state.h"
#include "swrast/swrast.h"
#include "intel_context.h"
diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h
index 9c899b954c..6fa6effe83 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel.h
+++ b/src/mesa/drivers/dri/intel/intel_pixel.h
@@ -28,7 +28,7 @@
#ifndef INTEL_PIXEL_H
#define INTEL_PIXEL_H
-#include "mtypes.h"
+#include "main/mtypes.h"
void intelInitPixelFuncs(struct dd_function_table *functions);
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
index daa6d4be17..8963519893 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c
@@ -25,13 +25,13 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "enums.h"
-#include "image.h"
-#include "colormac.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "bufferobj.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/colormac.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/bufferobj.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
index 1c72d6179d..3fb8a3104c 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c
@@ -25,12 +25,12 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "enums.h"
-#include "image.h"
-#include "state.h"
-#include "mtypes.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/state.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index 47460da9aa..5e32d8a8ed 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -25,12 +25,12 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "enums.h"
-#include "image.h"
-#include "mtypes.h"
-#include "macros.h"
-#include "bufferobj.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/bufferobj.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h
index 62eb049fba..4b120ba4ce 100644
--- a/src/mesa/drivers/dri/intel/intel_regions.h
+++ b/src/mesa/drivers/dri/intel/intel_regions.h
@@ -36,7 +36,7 @@
#include
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "intel_bufmgr.h"
struct intel_context;
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 373e0e155e..c38b266eb7 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -25,12 +25,12 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "context.h"
-#include "framebuffer.h"
-#include "matrix.h"
-#include "renderbuffer.h"
-#include "simple_list.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+#include "main/matrix.h"
+#include "main/renderbuffer.h"
+#include "main/simple_list.h"
#include "utils.h"
#include "vblank.h"
#include "xmlpool.h"
diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c
index 0ea8576a02..8e2b4456f8 100644
--- a/src/mesa/drivers/dri/intel/intel_span.c
+++ b/src/mesa/drivers/dri/intel/intel_span.c
@@ -25,10 +25,10 @@
*
**************************************************************************/
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
#include "intel_fbo.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index 4fa18e2d54..23455a4c74 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -1,7 +1,7 @@
#include "swrast/swrast.h"
-#include "texobj.h"
-#include "teximage.h"
-#include "mipmap.h"
+#include "main/texobj.h"
+#include "main/teximage.h"
+#include "main/mipmap.h"
#include "intel_context.h"
#include "intel_mipmap_tree.h"
#include "intel_tex.h"
diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h
index fe7a8badf8..6219c1c953 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.h
+++ b/src/mesa/drivers/dri/intel/intel_tex.h
@@ -28,7 +28,7 @@
#ifndef INTELTEX_INC
#define INTELTEX_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "intel_context.h"
#include "texmem.h"
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index d0ab464a1c..a7b88b39c0 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -25,11 +25,11 @@
*
**************************************************************************/
-#include "mtypes.h"
-#include "enums.h"
-#include "image.h"
-#include "teximage.h"
-#include "mipmap.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/teximage.h"
+#include "main/mipmap.h"
#include "swrast/swrast.h"
#include "intel_screen.h"
diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c
index 8ae80e1601..2be060dd3e 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_format.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_format.c
@@ -1,7 +1,7 @@
#include "intel_context.h"
#include "intel_tex.h"
-#include "texformat.h"
-#include "enums.h"
+#include "main/texformat.h"
+#include "main/enums.h"
/* It works out that this function is fine for all the supported
* hardware. However, there is still a need to map the formats onto
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 1820d3dc05..2ac7dceb0f 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -2,19 +2,19 @@
#include
#include
-#include "glheader.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "colortab.h"
-#include "convolve.h"
-#include "context.h"
-#include "simple_list.h"
-#include "texcompress.h"
-#include "texformat.h"
-#include "texobj.h"
-#include "texstore.h"
-#include "teximage.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/colortab.h"
+#include "main/convolve.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/texcompress.h"
+#include "main/texformat.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
+#include "main/teximage.h"
#include "intel_context.h"
#include "intel_mipmap_tree.h"
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c
index edc3a2eaa4..e6f9a41779 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c
@@ -33,7 +33,7 @@
#include "intel_mipmap_tree.h"
#include "intel_tex_layout.h"
#include "intel_context.h"
-#include "macros.h"
+#include "main/macros.h"
GLuint intel_compressed_alignment(GLenum internalFormat)
{
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h
index 193699d3f7..dbc90e6f9b 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.h
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h
@@ -30,7 +30,7 @@
* Michel Dänzer
*/
-#include "macros.h"
+#include "main/macros.h"
static GLuint minify( GLuint d )
diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index 5428a1d068..b752361886 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -26,11 +26,11 @@
*
**************************************************************************/
-#include "mtypes.h"
-#include "texobj.h"
-#include "texstore.h"
-#include "texcompress.h"
-#include "enums.h"
+#include "main/mtypes.h"
+#include "main/texobj.h"
+#include "main/texstore.h"
+#include "main/texcompress.h"
+#include "main/enums.h"
#include "intel_context.h"
#include "intel_tex.h"
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index 5763f4ae1f..3dae738ac2 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -1,5 +1,5 @@
-#include "mtypes.h"
-#include "macros.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "intel_context.h"
#include "intel_batchbuffer.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c
index f730c831e4..0faf467435 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.c
+++ b/src/mesa/drivers/dri/mach64/mach64_context.c
@@ -29,12 +29,12 @@
* Jos�Fonseca
*/
-#include "glheader.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_context.h b/src/mesa/drivers/dri/mach64/mach64_context.h
index c602333024..28160b8256 100644
--- a/src/mesa/drivers/dri/mach64/mach64_context.h
+++ b/src/mesa/drivers/dri/mach64/mach64_context.h
@@ -36,7 +36,7 @@
#include "drm.h"
#include "mach64_drm.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "mach64_reg.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_dd.c b/src/mesa/drivers/dri/mach64/mach64_dd.c
index 17e8d74d9f..223e325d90 100644
--- a/src/mesa/drivers/dri/mach64/mach64_dd.c
+++ b/src/mesa/drivers/dri/mach64/mach64_dd.c
@@ -35,9 +35,10 @@
#include "mach64_vb.h"
#include "mach64_dd.h"
-#include "context.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
+
#include "utils.h"
-#include "framebuffer.h"
#define DRIVER_DATE "20051019"
diff --git a/src/mesa/drivers/dri/mach64/mach64_ioctl.c b/src/mesa/drivers/dri/mach64/mach64_ioctl.c
index 3bcec50cf8..61167cf04b 100644
--- a/src/mesa/drivers/dri/mach64/mach64_ioctl.c
+++ b/src/mesa/drivers/dri/mach64/mach64_ioctl.c
@@ -35,8 +35,8 @@
#include "mach64_ioctl.h"
#include "mach64_tex.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c
index 2dba50fc1f..19ff5ddb4c 100644
--- a/src/mesa/drivers/dri/mach64/mach64_screen.c
+++ b/src/mesa/drivers/dri/mach64/mach64_screen.c
@@ -35,10 +35,10 @@
#include "mach64_vb.h"
#include "mach64_span.h"
-#include "context.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#include "utils.h"
#include "vblank.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_state.c b/src/mesa/drivers/dri/mach64/mach64_state.c
index 10a5b40ba1..bef3ef4028 100644
--- a/src/mesa/drivers/dri/mach64/mach64_state.c
+++ b/src/mesa/drivers/dri/mach64/mach64_state.c
@@ -36,9 +36,9 @@
#include "mach64_vb.h"
#include "mach64_tex.h"
-#include "context.h"
-#include "enums.h"
-#include "colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/colormac.h"
#include "swrast/swrast.h"
#include "vbo/vbo.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c
index 5288d321ce..6c62dd2432 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.c
@@ -36,15 +36,15 @@
#include "mach64_tris.h"
#include "mach64_tex.h"
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/imports.h"
static void mach64SetTexWrap( mach64TexObjPtr t,
diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c
index 3b7b93b984..d771a0e4fd 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texmem.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c
@@ -38,11 +38,11 @@
#include "mach64_tris.h"
#include "mach64_tex.h"
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "main/texformat.h"
+#include "main/imports.h"
/* Destroy hardware state associated with texture `t'.
diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c
index 3ace370d70..3d42881fdb 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texstate.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c
@@ -29,11 +29,11 @@
* José Fonseca
*/
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/texformat.h"
#include "mach64_context.h"
#include "mach64_ioctl.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.c b/src/mesa/drivers/dri/mach64/mach64_tris.c
index 5ce348f34d..1c39c7c2c5 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tris.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tris.c
@@ -29,10 +29,10 @@
* José Fonseca
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_tris.h b/src/mesa/drivers/dri/mach64/mach64_tris.h
index 208703289d..c3025aeba6 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tris.h
+++ b/src/mesa/drivers/dri/mach64/mach64_tris.h
@@ -31,7 +31,7 @@
#ifndef __MACH64_TRIS_H__
#define __MACH64_TRIS_H__
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void mach64InitTriFuncs( GLcontext *ctx );
diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.c b/src/mesa/drivers/dri/mach64/mach64_vb.c
index 83a5f73e6b..a27241897d 100644
--- a/src/mesa/drivers/dri/mach64/mach64_vb.c
+++ b/src/mesa/drivers/dri/mach64/mach64_vb.c
@@ -29,11 +29,11 @@
* José Fonseca
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/drivers/dri/mach64/mach64_vb.h b/src/mesa/drivers/dri/mach64/mach64_vb.h
index bcc4759af3..1d9ff2fbb7 100644
--- a/src/mesa/drivers/dri/mach64/mach64_vb.h
+++ b/src/mesa/drivers/dri/mach64/mach64_vb.h
@@ -32,7 +32,7 @@
#ifndef __MACH64_VB_H__
#define __MACH64_VB_H__
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#include "mach64_context.h"
diff --git a/src/mesa/drivers/dri/mga/mga_texcombine.c b/src/mesa/drivers/dri/mga/mga_texcombine.c
index bbfa29be5f..24083d9651 100644
--- a/src/mesa/drivers/dri/mga/mga_texcombine.c
+++ b/src/mesa/drivers/dri/mga/mga_texcombine.c
@@ -23,7 +23,7 @@
* Ville Syrjala
*/
-#include "glheader.h"
+#include "main/glheader.h"
#include "mgacontext.h"
#include "mgatex.h"
diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c
index 71d264b0f1..319564120e 100644
--- a/src/mesa/drivers/dri/mga/mga_texstate.c
+++ b/src/mesa/drivers/dri/mga/mga_texstate.c
@@ -29,20 +29,20 @@
/* $XFree86:$ */
#include
-#include "mm.h"
+#include "main/mm.h"
#include "mgacontext.h"
#include "mgatex.h"
#include "mgaregs.h"
#include "mgatris.h"
#include "mgaioctl.h"
-#include "context.h"
-#include "enums.h"
-#include "macros.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/macros.h"
+#include "main/imports.h"
-#include "simple_list.h"
-#include "texformat.h"
+#include "main/simple_list.h"
+#include "main/texformat.h"
#define MGA_USE_TABLE_FOR_FORMAT
#ifdef MGA_USE_TABLE_FOR_FORMAT
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c
index c271c8ef59..4ec28b00da 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.c
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.c
@@ -35,12 +35,12 @@
#include "drm.h"
#include "mga_drm.h"
#include "mga_xmesa.h"
-#include "context.h"
-#include "matrix.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/matrix.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -65,7 +65,7 @@
#include "utils.h"
#include "vblank.h"
-#include "extensions.h"
+#include "main/extensions.h"
#include "drirenderbuffer.h"
#include "GL/internal/dri_interface.h"
diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.h b/src/mesa/drivers/dri/mga/mga_xmesa.h
index 0ab0c63f78..08b4b965fd 100644
--- a/src/mesa/drivers/dri/mga/mga_xmesa.h
+++ b/src/mesa/drivers/dri/mga/mga_xmesa.h
@@ -32,7 +32,7 @@
#include
#include "dri_util.h"
#include "mga_drm.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "mgaregs.h"
#include "xmlconfig.h"
diff --git a/src/mesa/drivers/dri/mga/mgacontext.h b/src/mesa/drivers/dri/mga/mgacontext.h
index 55d823810b..e04de77123 100644
--- a/src/mesa/drivers/dri/mga/mgacontext.h
+++ b/src/mesa/drivers/dri/mga/mgacontext.h
@@ -33,12 +33,12 @@
#include "drm.h"
#include "mga_drm.h"
#include "dri_util.h"
-#include "mtypes.h"
#include "xf86drm.h"
-#include "mm.h"
-#include "colormac.h"
+#include "main/mtypes.h"
+#include "main/mm.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "texmem.h"
-#include "macros.h"
#include "xmlconfig.h"
#define MGA_SET_FIELD(reg,mask,val) reg = ((reg) & (mask)) | ((val) & ~(mask))
diff --git a/src/mesa/drivers/dri/mga/mgadd.c b/src/mesa/drivers/dri/mga/mgadd.c
index 6d18bd83d8..9805ab45c2 100644
--- a/src/mesa/drivers/dri/mga/mgadd.c
+++ b/src/mesa/drivers/dri/mga/mgadd.c
@@ -27,10 +27,10 @@
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgadd.c,v 1.14 2002/10/30 12:51:35 alanh Exp $ */
-#include "mtypes.h"
-#include "framebuffer.h"
+#include "main/mtypes.h"
+#include "main/framebuffer.h"
+#include "main/mm.h"
-#include "mm.h"
#include "mgacontext.h"
#include "mgadd.h"
#include "mgastate.h"
diff --git a/src/mesa/drivers/dri/mga/mgadd.h b/src/mesa/drivers/dri/mga/mgadd.h
index f98bfdc878..2c9cfebef5 100644
--- a/src/mesa/drivers/dri/mga/mgadd.h
+++ b/src/mesa/drivers/dri/mga/mgadd.h
@@ -29,7 +29,7 @@
#ifndef MGADD_INC
#define MGADD_INC
-#include "context.h"
+#include "main/context.h"
extern void mgaInitDriverFuncs( struct dd_function_table *functions );
diff --git a/src/mesa/drivers/dri/mga/mgaioctl.c b/src/mesa/drivers/dri/mga/mgaioctl.c
index dee9399556..4438bad920 100644
--- a/src/mesa/drivers/dri/mga/mgaioctl.c
+++ b/src/mesa/drivers/dri/mga/mgaioctl.c
@@ -31,12 +31,12 @@
*/
#include
-#include "mtypes.h"
-#include "macros.h"
-#include "dd.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/dd.h"
#include "swrast/swrast.h"
-#include "mm.h"
+#include "main/mm.h"
#include "drm.h"
#include "mga_drm.h"
#include "mgacontext.h"
diff --git a/src/mesa/drivers/dri/mga/mgapixel.c b/src/mesa/drivers/dri/mga/mgapixel.c
index 2b9da8c181..4333b8c372 100644
--- a/src/mesa/drivers/dri/mga/mgapixel.c
+++ b/src/mesa/drivers/dri/mga/mgapixel.c
@@ -36,8 +36,8 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgapixel.c,v 1.9 2002/11/05 17:46:08 tsi Exp $ */
-#include "mtypes.h"
-#include "macros.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "mgadd.h"
#include "mgacontext.h"
#include "mgaioctl.h"
@@ -45,7 +45,7 @@
#include "mgastate.h"
#include "swrast/swrast.h"
-#include "imports.h"
+#include "main/imports.h"
#if 0
#define IS_AGP_MEM( mmesa, p ) \
diff --git a/src/mesa/drivers/dri/mga/mgapixel.h b/src/mesa/drivers/dri/mga/mgapixel.h
index c44fd769a8..e555ebc6df 100644
--- a/src/mesa/drivers/dri/mga/mgapixel.h
+++ b/src/mesa/drivers/dri/mga/mgapixel.h
@@ -29,7 +29,7 @@
#ifndef MGA_PIXELS_H
#define MGA_PIXELS_H
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void mgaDDInitPixelFuncs( GLcontext *ctx );
diff --git a/src/mesa/drivers/dri/mga/mgarender.c b/src/mesa/drivers/dri/mga/mgarender.c
index c151f79915..5619a3c435 100644
--- a/src/mesa/drivers/dri/mga/mgarender.c
+++ b/src/mesa/drivers/dri/mga/mgarender.c
@@ -39,11 +39,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* dma buffers. Use strip/fan hardware primitives where possible.
* Simulate missing primitives with indexed vertices.
*/
-#include "glheader.h"
-#include "context.h"
-#include "macros.h"
-#include "imports.h"
-#include "mtypes.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
#include "tnl/t_context.h"
diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c
index 7ac59661ac..5b6d323ca9 100644
--- a/src/mesa/drivers/dri/mga/mgaspan.c
+++ b/src/mesa/drivers/dri/mga/mgaspan.c
@@ -25,7 +25,7 @@
* Keith Whitwell
*/
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "mgadd.h"
#include "mgacontext.h"
#include "mgaspan.h"
diff --git a/src/mesa/drivers/dri/mga/mgastate.c b/src/mesa/drivers/dri/mga/mgastate.c
index 1d413d3473..7c830ec097 100644
--- a/src/mesa/drivers/dri/mga/mgastate.c
+++ b/src/mesa/drivers/dri/mga/mgastate.c
@@ -26,11 +26,11 @@
*/
-#include "mtypes.h"
-#include "colormac.h"
-#include "dd.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/dd.h"
+#include "main/mm.h"
-#include "mm.h"
#include "mgacontext.h"
#include "mgadd.h"
#include "mgastate.h"
diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c
index a7d74317a5..1ceb51d1e8 100644
--- a/src/mesa/drivers/dri/mga/mgatex.c
+++ b/src/mesa/drivers/dri/mga/mgatex.c
@@ -26,24 +26,24 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatex.c,v 1.14 2002/10/30 12:51:36 alanh Exp $ */
-#include "glheader.h"
-#include "mm.h"
+#include "main/glheader.h"
+#include "main/mm.h"
#include "mgacontext.h"
#include "mgatex.h"
#include "mgaregs.h"
#include "mgatris.h"
#include "mgaioctl.h"
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "macros.h"
-#include "texformat.h"
-#include "texstore.h"
-#include "teximage.h"
-#include "texobj.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/texformat.h"
+#include "main/texstore.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/mga/mgatexmem.c b/src/mesa/drivers/dri/mga/mgatexmem.c
index 18743331c6..49beaa9eae 100644
--- a/src/mesa/drivers/dri/mga/mgatexmem.c
+++ b/src/mesa/drivers/dri/mga/mgatexmem.c
@@ -26,17 +26,17 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatexmem.c,v 1.7 2002/10/30 12:51:36 alanh Exp $ */
-#include "glheader.h"
+#include "main/glheader.h"
-#include "mm.h"
+#include "main/mm.h"
#include "mgacontext.h"
#include "mgatex.h"
#include "mgaregs.h"
#include "mgaioctl.h"
#include "mga_xmesa.h"
-#include "imports.h"
-#include "simple_list.h"
+#include "main/imports.h"
+#include "main/simple_list.h"
/**
* Destroy any device-dependent state associated with the texture. This may
diff --git a/src/mesa/drivers/dri/mga/mgatris.c b/src/mesa/drivers/dri/mga/mgatris.c
index 9f270d7d6c..9afaccb81a 100644
--- a/src/mesa/drivers/dri/mga/mgatris.c
+++ b/src/mesa/drivers/dri/mga/mgatris.c
@@ -26,15 +26,15 @@
*/
/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.10 2002/10/30 12:51:36 alanh Exp $ */
-#include "mtypes.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
+#include "main/colormac.h"
+#include "main/mm.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
-#include "mm.h"
#include "mgacontext.h"
#include "mgaioctl.h"
#include "mgatris.h"
diff --git a/src/mesa/drivers/dri/mga/mgatris.h b/src/mesa/drivers/dri/mga/mgatris.h
index f3ece3a053..2856a5ace3 100644
--- a/src/mesa/drivers/dri/mga/mgatris.h
+++ b/src/mesa/drivers/dri/mga/mgatris.h
@@ -29,7 +29,7 @@
#ifndef MGATRIS_INC
#define MGATRIS_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void mgaDDInitTriFuncs( GLcontext *ctx );
extern void mgaChooseRenderState( GLcontext *ctx );
diff --git a/src/mesa/drivers/dri/mga/mgavb.c b/src/mesa/drivers/dri/mga/mgavb.c
index 902d8bd1c1..fc3a98c3e5 100644
--- a/src/mesa/drivers/dri/mga/mgavb.c
+++ b/src/mesa/drivers/dri/mga/mgavb.c
@@ -33,11 +33,11 @@
#include "mgaioctl.h"
#include "mga_xmesa.h"
-#include "glheader.h"
-#include "mtypes.h"
-#include "imports.h"
-#include "macros.h"
-#include "colormac.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/colormac.h"
#include "tnl/t_context.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/mga/mgavb.h b/src/mesa/drivers/dri/mga/mgavb.h
index 5f6454aca9..1fd03c2ff1 100644
--- a/src/mesa/drivers/dri/mga/mgavb.h
+++ b/src/mesa/drivers/dri/mga/mgavb.h
@@ -29,7 +29,7 @@
#ifndef MGAVB_INC
#define MGAVB_INC
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "mgacontext.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c
index cdea77642b..742ba3616e 100644
--- a/src/mesa/drivers/dri/r128/r128_context.c
+++ b/src/mesa/drivers/dri/r128/r128_context.c
@@ -33,12 +33,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#include "glheader.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/r128/r128_context.h b/src/mesa/drivers/dri/r128/r128_context.h
index 3f7416e9cc..676533b79d 100644
--- a/src/mesa/drivers/dri/r128/r128_context.h
+++ b/src/mesa/drivers/dri/r128/r128_context.h
@@ -40,7 +40,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "drm.h"
#include "r128_drm.h"
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "tnl/t_vertex.h"
#include "r128_reg.h"
diff --git a/src/mesa/drivers/dri/r128/r128_dd.c b/src/mesa/drivers/dri/r128/r128_dd.c
index 54f2b21b5d..833c0869ed 100644
--- a/src/mesa/drivers/dri/r128/r128_dd.c
+++ b/src/mesa/drivers/dri/r128/r128_dd.c
@@ -39,8 +39,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_dd.h"
#include "swrast/swrast.h"
-#include "context.h"
-#include "framebuffer.h"
+#include "main/context.h"
+#include "main/framebuffer.h"
#include "utils.h"
diff --git a/src/mesa/drivers/dri/r128/r128_dd.h b/src/mesa/drivers/dri/r128/r128_dd.h
index 7a0abb73f8..a9bfa49195 100644
--- a/src/mesa/drivers/dri/r128/r128_dd.h
+++ b/src/mesa/drivers/dri/r128/r128_dd.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_dd.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */
+/* $XFree86: xc/lib/GL/mesa/src/drv/r128/r128_main/dd.h,v 1.3 2001/01/08 01:07:20 martin Exp $ */
/**************************************************************************
Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc.,
diff --git a/src/mesa/drivers/dri/r128/r128_ioctl.c b/src/mesa/drivers/dri/r128/r128_ioctl.c
index 034261a535..a1bda75dcd 100644
--- a/src/mesa/drivers/dri/r128/r128_ioctl.c
+++ b/src/mesa/drivers/dri/r128/r128_ioctl.c
@@ -37,8 +37,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_context.h"
#include "r128_state.h"
#include "r128_ioctl.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
diff --git a/src/mesa/drivers/dri/r128/r128_lock.c b/src/mesa/drivers/dri/r128/r128_lock.c
index ea23b007f3..d6ada750a5 100644
--- a/src/mesa/drivers/dri/r128/r128_lock.c
+++ b/src/mesa/drivers/dri/r128/r128_lock.c
@@ -59,7 +59,7 @@ r128UpdatePageFlipping( r128ContextPtr rmesa )
rmesa->new_state |= R128_NEW_WINDOW;
}
-/* Update the hardware state. This is called if another context has
+/* Update the hardware state. This is called if another main/context.has
* grabbed the hardware lock, which includes the X server. This
* function also updates the driver's window state after the X server
* moves, resizes or restacks a window -- the change will be reflected
diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c
index 7b544acf3b..ab97ffd6ae 100644
--- a/src/mesa/drivers/dri/r128/r128_screen.c
+++ b/src/mesa/drivers/dri/r128/r128_screen.c
@@ -40,10 +40,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_span.h"
#include "r128_tris.h"
-#include "context.h"
-#include "imports.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
+#include "main/context.h"
+#include "main/imports.h"
+#include "main/framebuffer.h"
+#include "main/renderbuffer.h"
#include "utils.h"
#include "vblank.h"
diff --git a/src/mesa/drivers/dri/r128/r128_state.c b/src/mesa/drivers/dri/r128/r128_state.c
index 2abe59056e..5c974056f4 100644
--- a/src/mesa/drivers/dri/r128/r128_state.c
+++ b/src/mesa/drivers/dri/r128/r128_state.c
@@ -40,9 +40,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_tris.h"
#include "r128_tex.h"
-#include "context.h"
-#include "enums.h"
-#include "colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/colormac.h"
#include "swrast/swrast.h"
#include "vbo/vbo.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c
index 3b2d017c1f..ee58bca358 100644
--- a/src/mesa/drivers/dri/r128/r128_tex.c
+++ b/src/mesa/drivers/dri/r128/r128_tex.c
@@ -40,17 +40,17 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_tex.h"
#include "r128_texobj.h"
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "enums.h"
-#include "texstore.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "imports.h"
-#include "colormac.h"
-#include "texobj.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "main/texstore.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/imports.h"
+#include "main/colormac.h"
+#include "main/texobj.h"
#include "xmlpool.h"
diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c
index d011a75671..14022b6f2a 100644
--- a/src/mesa/drivers/dri/r128/r128_texmem.c
+++ b/src/mesa/drivers/dri/r128/r128_texmem.c
@@ -39,11 +39,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r128_tris.h"
#include "r128_tex.h"
-#include "context.h"
-#include "macros.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/simple_list.h"
+#include "main/texformat.h"
+#include "main/imports.h"
#define TEX_0 1
#define TEX_1 2
diff --git a/src/mesa/drivers/dri/r128/r128_texobj.h b/src/mesa/drivers/dri/r128/r128_texobj.h
index 282e887149..6e68cd33ef 100644
--- a/src/mesa/drivers/dri/r128/r128_texobj.h
+++ b/src/mesa/drivers/dri/r128/r128_texobj.h
@@ -36,7 +36,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef _R128_TEXOBJ_H_
#define _R128_TEXOBJ_H_
-#include "mm.h"
+#include "main/mm.h"
/* Individual texture image information.
*/
diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c
index 6b43f21cd4..60ebb23ffa 100644
--- a/src/mesa/drivers/dri/r128/r128_texstate.c
+++ b/src/mesa/drivers/dri/r128/r128_texstate.c
@@ -33,11 +33,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* Brian Paul
*/
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/texformat.h"
#include "r128_context.h"
#include "r128_state.h"
diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c
index f406e928c5..6256ddd9a0 100644
--- a/src/mesa/drivers/dri/r128/r128_tris.c
+++ b/src/mesa/drivers/dri/r128/r128_tris.c
@@ -33,10 +33,10 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/r128/r128_tris.h b/src/mesa/drivers/dri/r128/r128_tris.h
index 755d3320b0..5b9aab32ea 100644
--- a/src/mesa/drivers/dri/r128/r128_tris.h
+++ b/src/mesa/drivers/dri/r128/r128_tris.h
@@ -36,7 +36,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __R128_TRIS_H__
#define __R128_TRIS_H__
-#include "mtypes.h"
+#include "main/mtypes.h"
extern void r128InitTriFuncs( GLcontext *ctx );
diff --git a/src/mesa/drivers/dri/r200/r200_cmdbuf.c b/src/mesa/drivers/dri/r200/r200_cmdbuf.c
index c1d51e8700..e1633772a1 100644
--- a/src/mesa/drivers/dri/r200/r200_cmdbuf.c
+++ b/src/mesa/drivers/dri/r200/r200_cmdbuf.c
@@ -31,12 +31,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/context.h"
#include "swrast/swrast.h"
-#include "simple_list.h"
+#include "main/simple_list.h"
#include "r200_context.h"
#include "r200_state.h"
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index c567349335..5531e0a739 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -32,15 +32,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "state.h"
+#include "main/glheader.h"
+#include "main/api_arrayelt.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
+#include "main/framebuffer.h"
+#include "main/state.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h
index ee478e7d3c..14a1dda46a 100644
--- a/src/mesa/drivers/dri/r200/r200_context.h
+++ b/src/mesa/drivers/dri/r200/r200_context.h
@@ -41,9 +41,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri_util.h"
#include "texmem.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
#include "r200_reg.h"
#include "r200_vertprog.h"
@@ -63,7 +63,7 @@ typedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
#include "r200_lock.h"
#include "radeon_screen.h"
-#include "mm.h"
+#include "main/mm.h"
/* Flags for software fallback cases */
/* See correponding strings in r200_swtcl.c */
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c
index 20482a4124..ca2f96fa71 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -35,10 +35,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
#include
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/context.h"
#include "swrast/swrast.h"
#include "r200_context.h"
diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.h b/src/mesa/drivers/dri/r200/r200_ioctl.h
index 31431b7b03..f7458e4a0e 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.h
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.h
@@ -35,7 +35,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __R200_IOCTL_H__
#define __R200_IOCTL_H__
-#include "simple_list.h"
+#include "main/simple_list.h"
#include "radeon_dri.h"
#include "r200_lock.h"
diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c
index f89b526a31..99661a4bfb 100644
--- a/src/mesa/drivers/dri/r200/r200_lock.c
+++ b/src/mesa/drivers/dri/r200/r200_lock.c
@@ -60,7 +60,7 @@ r200UpdatePageFlipping( r200ContextPtr rmesa )
-/* Update the hardware state. This is called if another context has
+/* Update the hardware state. This is called if another main/context.has
* grabbed the hardware lock, which includes the X server. This
* function also updates the driver's window state after the X server
* moves, resizes or restacks a window -- the change will be reflected
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 7bc05e2f0b..8512b9af47 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -32,11 +32,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "swrast_setup/swrast_setup.h"
#include "math/m_translate.h"
diff --git a/src/mesa/drivers/dri/r200/r200_pixel.c b/src/mesa/drivers/dri/r200/r200_pixel.c
index 46d230767a..be68821dc1 100644
--- a/src/mesa/drivers/dri/r200/r200_pixel.c
+++ b/src/mesa/drivers/dri/r200/r200_pixel.c
@@ -31,10 +31,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "enums.h"
-#include "mtypes.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/enums.h"
+#include "main/mtypes.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
#include "r200_context.h"
diff --git a/src/mesa/drivers/dri/r200/r200_sanity.c b/src/mesa/drivers/dri/r200/r200_sanity.c
index 00d2f65c99..36530c224e 100644
--- a/src/mesa/drivers/dri/r200/r200_sanity.c
+++ b/src/mesa/drivers/dri/r200/r200_sanity.c
@@ -34,8 +34,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
-#include "glheader.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/imports.h"
#include "r200_context.h"
#include "r200_ioctl.h"
diff --git a/src/mesa/drivers/dri/r200/r200_span.c b/src/mesa/drivers/dri/r200/r200_span.c
index 3d7a000218..9783678028 100644
--- a/src/mesa/drivers/dri/r200/r200_span.c
+++ b/src/mesa/drivers/dri/r200/r200_span.c
@@ -32,10 +32,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/colormac.h"
#include "swrast/swrast.h"
-#include "colormac.h"
#include "r200_context.h"
#include "r200_ioctl.h"
diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c
index cf375171c8..7eaa1a1f9b 100644
--- a/src/mesa/drivers/dri/r200/r200_state.c
+++ b/src/mesa/drivers/dri/r200/r200_state.c
@@ -33,13 +33,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "api_arrayelt.h"
-#include "enums.h"
-#include "colormac.h"
-#include "light.h"
-#include "framebuffer.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/api_arrayelt.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/light.h"
+#include "main/framebuffer.h"
#include "swrast/swrast.h"
#include "vbo/vbo.h"
diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c
index 0c36cefc16..9e4677eda4 100644
--- a/src/mesa/drivers/dri/r200/r200_state_init.c
+++ b/src/mesa/drivers/dri/r200/r200_state_init.c
@@ -31,11 +31,11 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "enums.h"
-#include "colormac.h"
-#include "api_arrayelt.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/api_arrayelt.h"
#include "swrast/swrast.h"
#include "vbo/vbo.h"
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c
index a1ea0198be..b25f028244 100644
--- a/src/mesa/drivers/dri/r200/r200_swtcl.c
+++ b/src/mesa/drivers/dri/r200/r200_swtcl.c
@@ -32,13 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "enums.h"
-#include "image.h"
-#include "imports.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/imports.h"
+#include "main/macros.h"
#include "swrast/s_context.h"
#include "swrast/s_fog.h"
diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.h b/src/mesa/drivers/dri/r200/r200_swtcl.h
index 7458c54928..8c29fd0c99 100644
--- a/src/mesa/drivers/dri/r200/r200_swtcl.h
+++ b/src/mesa/drivers/dri/r200/r200_swtcl.h
@@ -34,7 +34,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef __R200_SWTCL_H__
#define __R200_SWTCL_H__
-#include "mtypes.h"
+#include "main/mtypes.h"
#include "swrast/swrast.h"
#include "r200_context.h"
diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c
index 78347d3cc2..99aecfe1e9 100644
--- a/src/mesa/drivers/dri/r200/r200_tcl.c
+++ b/src/mesa/drivers/dri/r200/r200_tcl.c
@@ -32,12 +32,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "mtypes.h"
-#include "enums.h"
-#include "colormac.h"
-#include "light.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/mtypes.h"
+#include "main/enums.h"
+#include "main/colormac.h"
+#include "main/light.h"
#include "vbo/vbo.h"
#include "tnl/tnl.h"
diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c
index 24b9b3b696..5a4db33f44 100644
--- a/src/mesa/drivers/dri/r200/r200_tex.c
+++ b/src/mesa/drivers/dri/r200/r200_tex.c
@@ -31,18 +31,19 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "colormac.h"
-#include "context.h"
-#include "enums.h"
-#include "image.h"
-#include "simple_list.h"
-#include "texformat.h"
-#include "texstore.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/colormac.h"
+#include "main/context.h"
+#include "main/enums.h"
+#include "main/image.h"
+#include "main/simple_list.h"
+#include "main/texformat.h"
+#include "main/texstore.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+
#include "texmem.h"
-#include "teximage.h"
-#include "texobj.h"
#include "r200_context.h"
#include "r200_state.h"
diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c
index 183c4ca424..3b81ac0c80 100644
--- a/src/mesa/drivers/dri/r200/r200_texmem.c
+++ b/src/mesa/drivers/dri/r200/r200_texmem.c
@@ -37,11 +37,11 @@ SOFTWARE.
#include
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "r200_context.h"
#include "r200_ioctl.h"
#include "r200_tex.h"
diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
index 4edf304438..3f9a2f4ac1 100644
--- a/src/mesa/drivers/dri/r200/r200_texstate.c
+++ b/src/mesa/drivers/dri/r200/r200_texstate.c
@@ -32,13 +32,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Keith Whitwell
*/
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-#include "texobj.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/texformat.h"
+#include "main/texobj.h"
+#include "main/enums.h"
#include "r200_context.h"
#include "r200_state.h"
diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
index c069660eea..c9e1dfe977 100644
--- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c
+++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c
@@ -33,13 +33,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* \author Nicolai Haehnle
*/
-#include "glheader.h"
-#include "state.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/state.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/context.h"
+#include "main/simple_list.h"
#include "swrast/swrast.h"
-#include "simple_list.h"
#include "drm.h"
#include "radeon_drm.h"
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index fcf571d206..0ff249cfca 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -35,15 +35,15 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* \author Nicolai Haehnle
*/
-#include "glheader.h"
-#include "api_arrayelt.h"
-#include "context.h"
-#include "simple_list.h"
-#include "imports.h"
-#include "matrix.h"
-#include "extensions.h"
-#include "state.h"
-#include "bufferobj.h"
+#include "main/glheader.h"
+#include "main/api_arrayelt.h"
+#include "main/context.h"
+#include "main/simple_list.h"
+#include "main/imports.h"
+#include "main/matrix.h"
+#include "main/extensions.h"
+#include "main/state.h"
+#include "main/bufferobj.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h
index d2017f8afe..c15e9fa300 100644
--- a/src/mesa/drivers/dri/r300/r300_context.h
+++ b/src/mesa/drivers/dri/r300/r300_context.h
@@ -43,9 +43,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "dri_util.h"
#include "texmem.h"
-#include "macros.h"
-#include "mtypes.h"
-#include "colormac.h"
+#include "main/macros.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
#define USER_BUFFERS
@@ -54,7 +54,7 @@ typedef struct r300_context r300ContextRec;
typedef struct r300_context *r300ContextPtr;
#include "radeon_lock.h"
-#include "mm.h"
+#include "main/mm.h"
/* From http://gcc.gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html .
I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble
diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c
index 2ea17ad0a7..80bd3389ae 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.c
+++ b/src/mesa/drivers/dri/r300/r300_emit.c
@@ -33,12 +33,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* \author Keith Whitwell
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "imports.h"
-#include "macros.h"
-#include "image.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/image.h"
#include "swrast_setup/swrast_setup.h"
#include "math/m_translate.h"
diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h
index 5950539cba..89d738339f 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.h
+++ b/src/mesa/drivers/dri/r300/r300_emit.h
@@ -39,7 +39,7 @@
#ifndef __R300_EMIT_H__
#define __R300_EMIT_H__
-#include "glheader.h"
+#include "main/glheader.h"
#include "r300_context.h"
#include "r300_cmdbuf.h"
#include "radeon_reg.h"
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index 453dda7431..4ef7f2bd78 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -36,9 +36,9 @@
* \author Jerome Glisse
*/
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/prog_instruction.h"
#include "shader/prog_parameter.h"
#include "shader/prog_print.h"
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.h b/src/mesa/drivers/dri/r300/r300_fragprog.h
index b3a3cd2e04..94fb554fb3 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.h
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.h
@@ -33,9 +33,9 @@
#ifndef __R300_FRAGPROG_H_
#define __R300_FRAGPROG_H_
-#include "glheader.h"
-#include "macros.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/macros.h"
+#include "main/enums.h"
#include "shader/program.h"
#include "shader/prog_instruction.h"
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h b/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h
index 3da99a9dbe..231bf4eef5 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_swizzle.h
@@ -28,7 +28,7 @@
#ifndef __R300_FRAGPROG_SWIZZLE_H_
#define __R300_FRAGPROG_SWIZZLE_H_
-#include "glheader.h"
+#include "main/glheader.h"
#include "shader/prog_instruction.h"
struct nqssadce_state;
diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c
index bd7f060435..ee85e229f0 100644
--- a/src/mesa/drivers/dri/r300/r300_ioctl.c
+++ b/src/mesa/drivers/dri/r300/r300_ioctl.c
@@ -40,10 +40,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
#include
-#include "glheader.h"
-#include "imports.h"
-#include "macros.h"
-#include "context.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/macros.h"
+#include "main/context.h"
#include "swrast/swrast.h"
#include "r300_context.h"
diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c
index 0a199e6faa..292f87a2b1 100644
--- a/src/mesa/drivers/dri/r300/r300_render.c
+++ b/src/mesa/drivers/dri/r300/r300_render.c
@@ -50,15 +50,15 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
* no bugs...
*/
-#include "glheader.h"
-#include "state.h"
-#include "imports.h"
-#include "enums.h"
-#include "macros.h"
-#include "context.h"
-#include "dd.h"
-#include "simple_list.h"
-#include "api_arrayelt.h"
+#include "main/glheader.h"
+#include "main/state.h"
+#include "main/imports.h"
+#include "main/enums.h"
+#include "main/macros.h"
+#include "main/context.h"
+#include "main/dd.h"
+#include "main/simple_list.h"
+#include "main/api_arrayelt.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
#include "vbo/vbo.h"
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 15cd053161..6a5c3633a2 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -35,23 +35,23 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* \author Nicolai Haehnle