summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/galahad
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/galahad')
-rw-r--r--src/gallium/drivers/galahad/glhd_context.c20
-rw-r--r--src/gallium/drivers/galahad/glhd_objects.h2
-rw-r--r--src/gallium/drivers/galahad/glhd_screen.c12
3 files changed, 32 insertions, 2 deletions
diff --git a/src/gallium/drivers/galahad/glhd_context.c b/src/gallium/drivers/galahad/glhd_context.c
index 383c4489261..ff6d2aa00ab 100644
--- a/src/gallium/drivers/galahad/glhd_context.c
+++ b/src/gallium/drivers/galahad/glhd_context.c
@@ -54,6 +54,10 @@ galahad_draw_vbo(struct pipe_context *_pipe,
struct galahad_context *glhd_pipe = galahad_context(_pipe);
struct pipe_context *pipe = glhd_pipe->pipe;
+ /* XXX we should check that all bound resources are unmapped
+ * before drawing.
+ */
+
pipe->draw_vbo(pipe, info);
}
@@ -465,11 +469,11 @@ galahad_set_constant_buffer(struct pipe_context *_pipe,
if (index &&
index >=
- pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_CONST_BUFFERS)) {
+ pipe->screen->get_shader_param(pipe->screen, shader, PIPE_SHADER_CAP_MAX_CONST_BUFFERS)) {
glhd_error("Access to constant buffer %u requested, "
"but only %d are supported",
index,
- pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_CONST_BUFFERS));
+ pipe->screen->get_shader_param(pipe->screen, shader, PIPE_SHADER_CAP_MAX_CONST_BUFFERS));
}
/* XXX hmm? unwrap the input state */
@@ -860,6 +864,10 @@ galahad_context_transfer_map(struct pipe_context *_context,
struct pipe_context *context = glhd_context->pipe;
struct pipe_transfer *transfer = glhd_transfer->transfer;
+ struct galahad_resource *glhd_resource = galahad_resource(_transfer->resource);
+
+ glhd_resource->map_count++;
+
return context->transfer_map(context,
transfer);
}
@@ -890,6 +898,14 @@ galahad_context_transfer_unmap(struct pipe_context *_context,
struct galahad_transfer *glhd_transfer = galahad_transfer(_transfer);
struct pipe_context *context = glhd_context->pipe;
struct pipe_transfer *transfer = glhd_transfer->transfer;
+ struct galahad_resource *glhd_resource = galahad_resource(_transfer->resource);
+
+ if (glhd_resource->map_count < 1) {
+ glhd_warn("context::transfer_unmap() called too many times"
+ " (count = %d)\n", glhd_resource->map_count);
+ }
+
+ glhd_resource->map_count--;
context->transfer_unmap(context,
transfer);
diff --git a/src/gallium/drivers/galahad/glhd_objects.h b/src/gallium/drivers/galahad/glhd_objects.h
index 935803915db..dc74c5bebc9 100644
--- a/src/gallium/drivers/galahad/glhd_objects.h
+++ b/src/gallium/drivers/galahad/glhd_objects.h
@@ -42,6 +42,8 @@ struct galahad_resource
struct pipe_resource base;
struct pipe_resource *resource;
+
+ int map_count;
};
diff --git a/src/gallium/drivers/galahad/glhd_screen.c b/src/gallium/drivers/galahad/glhd_screen.c
index 75e4c2d82e9..288941b1066 100644
--- a/src/gallium/drivers/galahad/glhd_screen.c
+++ b/src/gallium/drivers/galahad/glhd_screen.c
@@ -79,6 +79,17 @@ galahad_screen_get_param(struct pipe_screen *_screen,
param);
}
+static int
+galahad_screen_get_shader_param(struct pipe_screen *_screen,
+ unsigned shader, enum pipe_shader_cap param)
+{
+ struct galahad_screen *glhd_screen = galahad_screen(_screen);
+ struct pipe_screen *screen = glhd_screen->screen;
+
+ return screen->get_shader_param(screen, shader,
+ param);
+}
+
static float
galahad_screen_get_paramf(struct pipe_screen *_screen,
enum pipe_cap param)
@@ -341,6 +352,7 @@ galahad_screen_create(struct pipe_screen *screen)
glhd_screen->base.get_name = galahad_screen_get_name;
glhd_screen->base.get_vendor = galahad_screen_get_vendor;
glhd_screen->base.get_param = galahad_screen_get_param;
+ glhd_screen->base.get_shader_param = galahad_screen_get_shader_param;
glhd_screen->base.get_paramf = galahad_screen_get_paramf;
glhd_screen->base.is_format_supported = galahad_screen_is_format_supported;
glhd_screen->base.context_create = galahad_screen_context_create;