summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_context.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-06-13 04:37:45 +0200
committerMarek Olšák <maraeo@gmail.com>2010-06-13 17:43:39 +0200
commitf8032116293a1faf4dd76f2cbc10a455b8cde6d7 (patch)
tree11fea8c909c1f20cff387dc41f9a1b1a734bfcd4 /src/gallium/drivers/r300/r300_context.c
parent9dd50993c6540729fe7c7397b4a947b3068db162 (diff)
r300g: turn clip state into a CB
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r--src/gallium/drivers/r300/r300_context.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index aac3660207..57cf68f013 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -26,6 +26,7 @@
#include "util/u_simple_list.h"
#include "util/u_upload_mgr.h"
+#include "r300_cb.h"
#include "r300_context.h"
#include "r300_emit.h"
#include "r300_screen.h"
@@ -143,7 +144,7 @@ static void r300_setup_atoms(struct r300_context* r300)
/* Some non-CSO atoms need explicit space to store the state locally. */
r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state);
- r300->clip_state.state = CALLOC_STRUCT(pipe_clip_state);
+ r300->clip_state.state = CALLOC_STRUCT(r300_clip_state);
r300->fb_state.state = CALLOC_STRUCT(pipe_framebuffer_state);
r300->rs_block_state.state = CALLOC_STRUCT(r300_rs_block);
r300->scissor_state.state = CALLOC_STRUCT(pipe_scissor_state);
@@ -171,10 +172,20 @@ static void r300_init_states(struct pipe_context *pipe)
struct pipe_blend_color bc = {{0}};
struct pipe_clip_state cs = {{{0}}};
struct pipe_scissor_state ss = {0};
+ struct r300_clip_state *clip =
+ (struct r300_clip_state*)r300_context(pipe)->clip_state.state;
+ CB_LOCALS;
pipe->set_blend_color(pipe, &bc);
- pipe->set_clip_state(pipe, &cs);
pipe->set_scissor_state(pipe, &ss);
+
+ if (r300_context(pipe)->screen->caps.has_tcl) {
+ pipe->set_clip_state(pipe, &cs);
+ } else {
+ BEGIN_CB(clip->cb, 2);
+ OUT_CB_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE);
+ END_CB;
+ }
}
struct pipe_context* r300_create_context(struct pipe_screen* screen,