summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2008-09-23 17:08:24 -0700
committerKeith Whitwell <[email protected]>2008-09-23 17:23:14 -0700
commit2cb3d2b7a0d8f505131e98053d3e19982012fccd (patch)
treeda9a95967c877f4b71c40dcdea681480f2e75cf2
parent9e7c0724bbc62c86dc302a9fe76b3e4288fc4461 (diff)
parentec76910187adc88fc54907ffa3506309ee2abcf3 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/glapi/glapi_getproc.c src/mesa/main/image.c src/mesa/shader/slang/slang_link.c
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h5
-rw-r--r--src/mesa/drivers/dri/i965/brw_curbe.c3
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw.c9
-rw-r--r--src/mesa/drivers/dri/i965/brw_draw_upload.c6
-rw-r--r--src/mesa/drivers/dri/i965/brw_vtbl.c3
-rw-r--r--src/mesa/drivers/dri/intel/intel_pixel_draw.c2
6 files changed, 16 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 5f180fd65fc..b04487ecee9 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -557,6 +557,11 @@ struct brw_context
GLfloat *last_buf;
GLuint last_bufsz;
+ /**
+ * Whether we should create a new bo instead of reusing the old one
+ * (if we just dispatch the batch pointing at the old one.
+ */
+ GLboolean need_new_bo;
} curbe;
struct {
diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c
index c4e06af6b1f..7cddd3a7dee 100644
--- a/src/mesa/drivers/dri/i965/brw_curbe.c
+++ b/src/mesa/drivers/dri/i965/brw_curbe.c
@@ -282,7 +282,8 @@ static void prepare_constant_buffer(struct brw_context *brw)
brw->curbe.last_bufsz = bufsz;
if (brw->curbe.curbe_bo != NULL &&
- brw->curbe.curbe_next_offset + bufsz > brw->curbe.curbe_bo->size)
+ (brw->curbe.need_new_bo ||
+ brw->curbe.curbe_next_offset + bufsz > brw->curbe.curbe_bo->size))
{
dri_bo_unreference(brw->curbe.curbe_bo);
brw->curbe.curbe_bo = NULL;
diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c
index 542639ab77a..9a353fc7b66 100644
--- a/src/mesa/drivers/dri/i965/brw_draw.c
+++ b/src/mesa/drivers/dri/i965/brw_draw.c
@@ -156,11 +156,13 @@ static void brw_emit_prim( struct brw_context *brw,
static void brw_merge_inputs( struct brw_context *brw,
const struct gl_client_array *arrays[])
{
- struct brw_vertex_element *inputs = brw->vb.inputs;
struct brw_vertex_info old = brw->vb.info;
GLuint i;
- memset(inputs, 0, sizeof(*inputs));
+ for (i = 0; i < VERT_ATTRIB_MAX; i++)
+ dri_bo_unreference(brw->vb.inputs[i].bo);
+
+ memset(&brw->vb.inputs, 0, sizeof(brw->vb.inputs));
memset(&brw->vb.info, 0, sizeof(brw->vb.info));
for (i = 0; i < VERT_ATTRIB_MAX; i++) {
@@ -171,7 +173,8 @@ static void brw_merge_inputs( struct brw_context *brw,
if (arrays[i]->StrideB != 0)
brw->vb.info.varying |= 1 << i;
- brw->vb.info.sizes[i/16] |= (inputs[i].glarray->Size - 1) << ((i%16) * 2);
+ brw->vb.info.sizes[i/16] |= (brw->vb.inputs[i].glarray->Size - 1) <<
+ ((i%16) * 2);
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c
index 55a8defa992..303eaac5cf9 100644
--- a/src/mesa/drivers/dri/i965/brw_draw_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c
@@ -455,12 +455,6 @@ static void brw_emit_vertices(struct brw_context *brw)
input->offset);
OUT_BATCH(brw->vb.max_index);
OUT_BATCH(0); /* Instance data step rate */
-
- /* Unreference the buffer so it can get freed, now that we won't
- * touch it any more.
- */
- dri_bo_unreference(input->bo);
- input->bo = NULL;
}
ADVANCE_BATCH();
diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c
index 89e10f6285e..2a03fc59f3e 100644
--- a/src/mesa/drivers/dri/i965/brw_vtbl.c
+++ b/src/mesa/drivers/dri/i965/brw_vtbl.c
@@ -97,8 +97,7 @@ static void brw_new_batch( struct intel_context *intel )
/* Check that we didn't just wrap our batchbuffer at a bad time. */
assert(!brw->no_batch_wrap);
- dri_bo_unreference(brw->curbe.curbe_bo);
- brw->curbe.curbe_bo = NULL;
+ brw->curbe.need_new_bo = GL_TRUE;
/* Mark all context state as needing to be re-emitted.
* This is probably not as severe as on 915, since almost all of our state
diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
index 0ddc3aa30d8..be213e7b961 100644
--- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c
@@ -32,8 +32,10 @@
#include "main/macros.h"
#include "main/bufferobj.h"
#include "main/teximage.h"
+#include "main/texenv.h"
#include "main/texobj.h"
#include "main/texstate.h"
+#include "main/texparam.h"
#include "main/matrix.h"
#include "main/varray.h"
#include "main/attrib.h"