summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_inlines.h
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-02-26 20:15:14 -0700
committerBrian <[email protected]>2008-02-26 20:15:14 -0700
commitaa59a937ccf41609081d3f9a4973df5478979785 (patch)
treead3fce8490b1d5f701cca1db318f864c8950225a /src/gallium/include/pipe/p_inlines.h
parentdc2b6e2c33b44c1ffc0578b6bf52d05f7c68bb5c (diff)
gallium: introduce 'pipe_screen' for context-independent functions
This will allow creating textures before a rendering context exists, for example. Only implemented in i915 driver for now. i915pipe->texture_create() just dispatches through to the i915screen->texture_create() to avoid state tracker changes for now.
Diffstat (limited to 'src/gallium/include/pipe/p_inlines.h')
-rw-r--r--src/gallium/include/pipe/p_inlines.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_inlines.h b/src/gallium/include/pipe/p_inlines.h
index 21d4827e675..a7e97fcd7db 100644
--- a/src/gallium/include/pipe/p_inlines.h
+++ b/src/gallium/include/pipe/p_inlines.h
@@ -30,6 +30,7 @@
#include "p_context.h"
#include "p_defines.h"
+#include "p_screen.h"
#include "p_winsys.h"
@@ -107,7 +108,15 @@ pipe_texture_reference(struct pipe_texture **ptr,
if (*ptr) {
struct pipe_context *pipe = (*ptr)->pipe;
- pipe->texture_release(pipe, ptr);
+ /* XXX temporary mess here */
+ if (pipe) {
+ pipe->texture_release(pipe, ptr);
+ }
+ else {
+ struct pipe_screen *screen = (*ptr)->screen;
+ screen->texture_release(screen, ptr);
+ }
+
assert(!*ptr);
}