summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/galahad
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2010-06-22 23:00:44 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2010-06-22 23:00:44 -0700
commitaa451d509df844e4652853f08e31bc1ee18c04ac (patch)
treec998badf7e19b6e31b39d9add5e1a9f1cf6cc1fa /src/gallium/drivers/galahad
parent3f758d4ed42f6b4c6bed60f8270ef908d3829ee5 (diff)
glhd: Grab framebuffer state checks from r300g.
Diffstat (limited to 'src/gallium/drivers/galahad')
-rw-r--r--src/gallium/drivers/galahad/glhd_context.c10
-rw-r--r--src/gallium/drivers/galahad/glhd_context.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index 6dfee2c7a7..7a856ef5e1 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -497,6 +497,16 @@ galahad_set_framebuffer_state(struct pipe_context *_pipe,
struct pipe_framebuffer_state *state = NULL;
unsigned i;
+ if (_state->nr_cbufs > PIPE_MAX_COLOR_BUFS) {
+ glhd_error("%d render targets bound, but only %d are permitted by API",
+ _state->nr_cbufs, PIPE_MAX_COLOR_BUFS);
+ } else if (_state->nr_cbufs >
+ pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS)) {
+ glhd_warn("%d render targets bound, but only %d are supported",
+ _state->nr_cbufs,
+ pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS));
+ }
+
/* unwrap the input state */
if (_state) {
memcpy(&unwrapped_state, _state, sizeof(unwrapped_state));
diff --git a/src/gallium/drivers/galahad/glhd_context.h b/src/gallium/drivers/galahad/glhd_context.h
index a8753d0255..4e71753ac3 100644
--- a/src/gallium/drivers/galahad/glhd_context.h
+++ b/src/gallium/drivers/galahad/glhd_context.h
@@ -58,4 +58,7 @@ do { \
fprintf(stderr, "\n"); \
} while (0)
+#define glhd_error(...) \
+ glhd_warn(__VA_ARGS__);
+
#endif /* GLHD_CONTEXT_H */