summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_render.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-01-09 05:34:36 +0100
committerMarek Olšák <maraeo@gmail.com>2011-01-09 06:14:23 +0100
commit3332229b3ba7a183a9f120ae4bbf9865e96df110 (patch)
tree244c11039fcd1b48d10c711f4b5534faa2926309 /src/gallium/drivers/r300/r300_render.c
parent69191d41231b95af7565e32393c5487163859d7e (diff)
r300g: fix crash when flushing ZMASK
https://bugs.freedesktop.org/show_bug.cgi?id=32912 The fix is to call update_derived_state before user buffer uploads. I've also moved some code around. Unfortunately, there are still some ZMASK-related bugs which cause misrendering, i.e. flushing doesn't always work and glean/fbo fails.
Diffstat (limited to 'src/gallium/drivers/r300/r300_render.c')
-rw-r--r--src/gallium/drivers/r300/r300_render.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index e660ca68f1..b35822c82f 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -39,7 +39,6 @@
#include "r300_screen_buffer.h"
#include "r300_emit.h"
#include "r300_reg.h"
-#include "r300_state_derived.h"
#include <limits.h>
@@ -569,8 +568,6 @@ static void r300_draw_range_elements(struct pipe_context* pipe,
r300_translate_index_buffer(r300, &indexBuffer, &indexSize, index_offset,
&start, count);
- r300_update_derived_state(r300);
-
/* Fallback for misaligned ushort indices. */
if (indexSize == 2 && (start & 1) &&
!r300_is_user_buffer(indexBuffer)) {
@@ -643,8 +640,6 @@ static void r300_draw_arrays(struct pipe_context* pipe, unsigned mode,
r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0);
unsigned short_count;
- r300_update_derived_state(r300);
-
if (immd_is_good_idea(r300, count)) {
r300_emit_draw_arrays_immediate(r300, mode, start, count);
} else {
@@ -720,6 +715,8 @@ static void r300_draw_vbo(struct pipe_context* pipe,
return;
}
+ r300_update_derived_state(r300);
+
/* Set up the fallback for an incompatible vertex layout if needed. */
if (r300->incompatible_vb_layout || r300->velems->incompatible_layout) {
r300_begin_vertex_translate(r300, real_min_index, real_max_index);
@@ -737,6 +734,8 @@ static void r300_draw_vbo(struct pipe_context* pipe,
min_index = MAX2(min_index, info->start);
max_index = MIN2(max_index, info->start + count - 1);
+ r300_update_derived_state(r300);
+
/* Set up the fallback for an incompatible vertex layout if needed. */
if (r300->incompatible_vb_layout || r300->velems->incompatible_layout) {
r300_begin_vertex_translate(r300, min_index, max_index);