summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_context.h
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2014-10-14 12:20:54 -0400
committerRob Clark <[email protected]>2014-10-15 15:49:48 -0400
commitd5d80b37392c7f15c4fb39b6b1826230239930fd (patch)
treea70ad7ceaea741ea2040996759c7d982fb875011 /src/gallium/drivers/freedreno/freedreno_context.h
parent57de9bbb632ed7639d07d37965dcee5a1fe3bf30 (diff)
freedreno/a3xx: refactor vertex state emit
Get rid of fd3_vertex_buf and use fd_vertex_state directly for all draws. Removes a tiny bit of CPU overhead for munging around the vertex state every time it is emitted, but more importantly it cleans things up for later optimizations, so the emit paths don't have to special case internal draws (gmem<->mem, clears, etc) with regular draws. Instead of constructing fd3_vertex_buf array each time for internal draws, and context init time pre-create solid_vbuf_state and blit_vbuf_state. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_context.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h
index b7e016bb469..be2c2638a17 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.h
+++ b/src/gallium/drivers/freedreno/freedreno_context.h
@@ -82,6 +82,15 @@ struct fd_vertex_stateobj {
unsigned num_elements;
};
+/* group together the vertex and vertexbuf state.. for ease of passing
+ * around, and because various internal operations (gmem<->mem, etc)
+ * need their own vertex state:
+ */
+struct fd_vertex_state {
+ struct fd_vertex_stateobj *vtx;
+ struct fd_vertexbuf_stateobj vertexbuf;
+};
+
/* Bitmask of stages in rendering that a particular query query is
* active. Queries will be automatically started/stopped (generating
* additional fd_hw_sample_period's) on entrance/exit from stages that
@@ -304,7 +313,7 @@ struct fd_context {
struct fd_program_stateobj prog;
- struct fd_vertex_stateobj *vtx;
+ struct fd_vertex_state vtx;
struct pipe_blend_color blend_color;
struct pipe_stencil_ref stencil_ref;
@@ -313,7 +322,6 @@ struct fd_context {
struct pipe_poly_stipple stipple;
struct pipe_viewport_state viewport;
struct fd_constbuf_stateobj constbuf[PIPE_SHADER_TYPES];
- struct fd_vertexbuf_stateobj vertexbuf;
struct pipe_index_buffer indexbuf;
/* GMEM/tile handling fxns: */