summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/identity
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/identity')
-rw-r--r--src/gallium/drivers/identity/id_context.c15
-rw-r--r--src/gallium/drivers/identity/id_context.h4
-rw-r--r--src/gallium/drivers/identity/id_drm.c17
-rw-r--r--src/gallium/drivers/identity/id_objects.c2
-rw-r--r--src/gallium/drivers/identity/id_public.h3
-rw-r--r--src/gallium/drivers/identity/id_screen.c16
6 files changed, 28 insertions, 29 deletions
diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c
index 9f5b4e6323..9955380e1f 100644
--- a/src/gallium/drivers/identity/id_context.c
+++ b/src/gallium/drivers/identity/id_context.c
@@ -29,7 +29,6 @@
#include "pipe/p_context.h"
#include "util/u_memory.h"
-#include "id_public.h"
#include "id_context.h"
#include "id_objects.h"
@@ -404,17 +403,17 @@ static void
identity_set_constant_buffer(struct pipe_context *_pipe,
uint shader,
uint index,
- const struct pipe_constant_buffer *_buffer)
+ struct pipe_buffer *_buffer)
{
struct identity_context *id_pipe = identity_context(_pipe);
struct pipe_context *pipe = id_pipe->pipe;
- struct pipe_constant_buffer unwrapped_buffer;
- struct pipe_constant_buffer *buffer = NULL;
+ struct pipe_buffer *unwrapped_buffer;
+ struct pipe_buffer *buffer = NULL;
- /* unwrap the input state */
+ /* XXX hmm? unwrap the input state */
if (_buffer) {
- unwrapped_buffer.buffer = identity_buffer_unwrap(_buffer->buffer);
- buffer = &unwrapped_buffer;
+ unwrapped_buffer = identity_buffer_unwrap(_buffer);
+ buffer = unwrapped_buffer;
}
pipe->set_constant_buffer(pipe,
@@ -692,7 +691,7 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
id_pipe->base.winsys = NULL;
id_pipe->base.screen = _screen;
- id_pipe->base.priv = pipe->priv;
+ id_pipe->base.priv = pipe->priv; /* expose wrapped data */
id_pipe->base.draw = NULL;
id_pipe->base.destroy = identity_destroy;
diff --git a/src/gallium/drivers/identity/id_context.h b/src/gallium/drivers/identity/id_context.h
index 75b73fc7df..6d3c1899d5 100644
--- a/src/gallium/drivers/identity/id_context.h
+++ b/src/gallium/drivers/identity/id_context.h
@@ -39,6 +39,10 @@ struct identity_context {
};
+struct pipe_context *
+identity_context_create(struct pipe_screen *screen, struct pipe_context *pipe);
+
+
static INLINE struct identity_context *
identity_context(struct pipe_context *pipe)
{
diff --git a/src/gallium/drivers/identity/id_drm.c b/src/gallium/drivers/identity/id_drm.c
index 14f68ac0d0..12b516b445 100644
--- a/src/gallium/drivers/identity/id_drm.c
+++ b/src/gallium/drivers/identity/id_drm.c
@@ -63,22 +63,6 @@ identity_drm_create_screen(struct drm_api *_api, int fd,
return identity_screen_create(screen);
}
-static struct pipe_context *
-identity_drm_create_context(struct drm_api *_api,
- struct pipe_screen *_screen)
-{
- struct identity_screen *id_screen = identity_screen(_screen);
- struct identity_drm_api *id_api = identity_drm_api(_api);
- struct pipe_screen *screen = id_screen->screen;
- struct drm_api *api = id_api->api;
- struct pipe_context *pipe;
-
- pipe = api->create_context(api, screen);
-
- pipe = identity_context_create(_screen, pipe);
-
- return pipe;
-}
static struct pipe_texture *
identity_drm_texture_from_shared_handle(struct drm_api *_api,
@@ -159,7 +143,6 @@ identity_drm_create(struct drm_api *api)
goto error;
id_api->base.create_screen = identity_drm_create_screen;
- id_api->base.create_context = identity_drm_create_context;
id_api->base.texture_from_shared_handle = identity_drm_texture_from_shared_handle;
id_api->base.shared_handle_from_texture = identity_drm_shared_handle_from_texture;
id_api->base.local_handle_from_texture = identity_drm_local_handle_from_texture;
diff --git a/src/gallium/drivers/identity/id_objects.c b/src/gallium/drivers/identity/id_objects.c
index bc9bc7121d..2b1a60c1bf 100644
--- a/src/gallium/drivers/identity/id_objects.c
+++ b/src/gallium/drivers/identity/id_objects.c
@@ -25,9 +25,9 @@
*
**************************************************************************/
+#include "util/u_inlines.h"
#include "util/u_memory.h"
-#include "id_public.h"
#include "id_screen.h"
#include "id_objects.h"
diff --git a/src/gallium/drivers/identity/id_public.h b/src/gallium/drivers/identity/id_public.h
index 3d2862eaa0..d0d5847c61 100644
--- a/src/gallium/drivers/identity/id_public.h
+++ b/src/gallium/drivers/identity/id_public.h
@@ -34,7 +34,4 @@ struct pipe_context;
struct pipe_screen *
identity_screen_create(struct pipe_screen *screen);
-struct pipe_context *
-identity_context_create(struct pipe_screen *screen, struct pipe_context *pipe);
-
#endif /* ID_PUBLIC_H */
diff --git a/src/gallium/drivers/identity/id_screen.c b/src/gallium/drivers/identity/id_screen.c
index 53eae3ef54..b85492114a 100644
--- a/src/gallium/drivers/identity/id_screen.c
+++ b/src/gallium/drivers/identity/id_screen.c
@@ -32,6 +32,7 @@
#include "id_public.h"
#include "id_screen.h"
+#include "id_context.h"
#include "id_objects.h"
@@ -103,6 +104,20 @@ identity_screen_is_format_supported(struct pipe_screen *_screen,
geom_flags);
}
+static struct pipe_context *
+identity_screen_context_create(struct pipe_screen *_screen,
+ void *priv)
+{
+ struct identity_screen *id_screen = identity_screen(_screen);
+ struct pipe_screen *screen = id_screen->screen;
+ struct pipe_context *result;
+
+ result = screen->context_create(screen, priv);
+ if (result)
+ return identity_context_create(_screen, result);
+ return NULL;
+}
+
static struct pipe_texture *
identity_screen_texture_create(struct pipe_screen *_screen,
const struct pipe_texture *templat)
@@ -478,6 +493,7 @@ identity_screen_create(struct pipe_screen *screen)
id_screen->base.get_param = identity_screen_get_param;
id_screen->base.get_paramf = identity_screen_get_paramf;
id_screen->base.is_format_supported = identity_screen_is_format_supported;
+ id_screen->base.context_create = identity_screen_context_create;
id_screen->base.texture_create = identity_screen_texture_create;
id_screen->base.texture_blanket = identity_screen_texture_blanket;
id_screen->base.texture_destroy = identity_screen_texture_destroy;