summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Pohjolainen <[email protected]>2016-06-23 09:35:57 +0300
committerTopi Pohjolainen <[email protected]>2016-07-04 08:33:41 +0300
commit4f7e68799f8693e01bfe191f7c2420087145f087 (patch)
tree758cf677379dcb5f393e9bfd1fc41b6776c45ea0
parent575c8cbb540323a8a3065b8b16db378ff763b2e6 (diff)
i965/blorp: Split vertex data and element setup
Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/gen6_blorp.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.c b/src/mesa/drivers/dri/i965/gen6_blorp.c
index 7871a01fb08..e9340df084c 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.c
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.c
@@ -77,9 +77,9 @@ gen6_blorp_emit_vertex_buffer_state(struct brw_context *brw,
ADVANCE_BATCH();
}
-void
-gen6_blorp_emit_vertices(struct brw_context *brw,
- const struct brw_blorp_params *params)
+static void
+gen6_blorp_emit_vertex_data(struct brw_context *brw,
+ const struct brw_blorp_params *params)
{
uint32_t vertex_offset;
@@ -119,24 +119,28 @@ gen6_blorp_emit_vertices(struct brw_context *brw,
* instead of reading them from the buffer. See the vertex element setup
* below.
*/
- {
- float *vertex_data;
-
- const float vertices[] = {
- /* v0 */ (float)params->x0, (float)params->y1,
- /* v1 */ (float)params->x1, (float)params->y1,
- /* v2 */ (float)params->x0, (float)params->y0,
- };
-
- vertex_data = (float *) brw_state_batch(brw, AUB_TRACE_VERTEX_BUFFER,
- sizeof(vertices), 32,
- &vertex_offset);
- memcpy(vertex_data, vertices, sizeof(vertices));
-
- const unsigned blorp_num_vue_elems = 2;
- gen6_blorp_emit_vertex_buffer_state(brw, blorp_num_vue_elems,
- sizeof(vertices), vertex_offset);
- }
+ const float vertices[] = {
+ /* v0 */ (float)params->x0, (float)params->y1,
+ /* v1 */ (float)params->x1, (float)params->y1,
+ /* v2 */ (float)params->x0, (float)params->y0,
+ };
+
+ float *const vertex_data = (float *)brw_state_batch(
+ brw, AUB_TRACE_VERTEX_BUFFER,
+ sizeof(vertices), 32,
+ &vertex_offset);
+ memcpy(vertex_data, vertices, sizeof(vertices));
+
+ const unsigned blorp_num_vue_elems = 2;
+ gen6_blorp_emit_vertex_buffer_state(brw, blorp_num_vue_elems,
+ sizeof(vertices), vertex_offset);
+}
+
+void
+gen6_blorp_emit_vertices(struct brw_context *brw,
+ const struct brw_blorp_params *params)
+{
+ gen6_blorp_emit_vertex_data(brw, params);
/* 3DSTATE_VERTEX_ELEMENTS
*