summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-07-14 12:18:40 -0700
committerEric Anholt <[email protected]>2015-07-14 15:17:58 -0700
commit0f4d2b0a2dd3fa39426f2789bf2a8fc939adf001 (patch)
tree26d4ddbb5a071ff24c224c6453a6f3064165ed1c /src/gallium/drivers/vc4/vc4_context.h
parent1835ce6e35e6a186c2ba1bdf39b73783a2cb2ad5 (diff)
vc4: Cache texture p0/p1 setup for the sampler view.
In exchange for a bit of space and computation in CSO setup, we cut vc4_uniform.c (draw time) code size by 4.8%.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.h')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
index d5d6be16f6e..be7df1bd347 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -69,6 +69,12 @@
#define VC4_DIRTY_UNCOMPILED_FS (1 << 22)
#define VC4_DIRTY_COMPILED_FS (1 << 24)
+struct vc4_sampler_view {
+ struct pipe_sampler_view base;
+ uint32_t texture_p0;
+ uint32_t texture_p1;
+};
+
struct vc4_texture_stateobj {
struct pipe_sampler_view *textures[PIPE_MAX_SAMPLERS];
unsigned num_textures;
@@ -326,6 +332,12 @@ vc4_context(struct pipe_context *pcontext)
return (struct vc4_context *)pcontext;
}
+static inline struct vc4_sampler_view *
+vc4_sampler_view(struct pipe_sampler_view *psview)
+{
+ return (struct vc4_sampler_view *)psview;
+}
+
struct pipe_context *vc4_context_create(struct pipe_screen *pscreen,
void *priv);
void vc4_draw_init(struct pipe_context *pctx);