summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-01-07 14:16:27 -0700
committerBrian Paul <[email protected]>2012-01-07 14:16:27 -0700
commit994c33db875c6af2f5b535a7a173ff3bfa24fc32 (patch)
treebca510120de52f4fb064be1d6b213bc087e6b0c3 /src/gallium/auxiliary/draw
parent488dd2c1912132fe7ee5e81b05fb64ba62a46098 (diff)
draw: whitespace fixes, etc.
Diffstat (limited to 'src/gallium/auxiliary/draw')
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_emit.c77
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch.c50
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_emit.c89
-rw-r--r--src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c117
4 files changed, 160 insertions, 173 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_emit.c b/src/gallium/auxiliary/draw/draw_pt_emit.c
index 8f483828e15..fbbaa8138f4 100644
--- a/src/gallium/auxiliary/draw/draw_pt_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_emit.c
@@ -45,21 +45,22 @@ struct pt_emit {
const struct vertex_info *vinfo;
};
-void draw_pt_emit_prepare( struct pt_emit *emit,
- unsigned prim,
- unsigned *max_vertices )
+
+void
+draw_pt_emit_prepare(struct pt_emit *emit,
+ unsigned prim,
+ unsigned *max_vertices)
{
struct draw_context *draw = emit->draw;
const struct vertex_info *vinfo;
unsigned dst_offset;
struct translate_key hw_key;
unsigned i;
-
- /* XXX: need to flush to get prim_vbuf.c to release its allocation??
+
+ /* XXX: need to flush to get prim_vbuf.c to release its allocation??
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
-
/* XXX: may need to defensively reset this later on as clipping can
* clobber this state in the render backend.
*/
@@ -71,7 +72,6 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
*/
emit->vinfo = vinfo = draw->render->get_vertex_info(draw->render);
-
/* Translate from pipeline vertices to hw vertices.
*/
dst_offset = 0;
@@ -107,20 +107,20 @@ void draw_pt_emit_prepare( struct pt_emit *emit,
hw_key.output_stride = vinfo->size * 4;
if (!emit->translate ||
- translate_key_compare(&emit->translate->key, &hw_key) != 0)
- {
- translate_key_sanitize(&hw_key);
- emit->translate = translate_cache_find(emit->cache, &hw_key);
- }
+ translate_key_compare(&emit->translate->key, &hw_key) != 0) {
+ translate_key_sanitize(&hw_key);
+ emit->translate = translate_cache_find(emit->cache, &hw_key);
+ }
- *max_vertices = (draw->render->max_vertex_buffer_bytes /
+ *max_vertices = (draw->render->max_vertex_buffer_bytes /
(vinfo->size * 4));
}
-void draw_pt_emit( struct pt_emit *emit,
- const struct draw_vertex_info *vert_info,
- const struct draw_prim_info *prim_info)
+void
+draw_pt_emit(struct pt_emit *emit,
+ const struct draw_vertex_info *vert_info,
+ const struct draw_prim_info *prim_info)
{
const float (*vertex_data)[4] = (const float (*)[4])vert_info->verts->data;
unsigned vertex_count = vert_info->count;
@@ -132,7 +132,7 @@ void draw_pt_emit( struct pt_emit *emit,
unsigned start, i;
void *hw_verts;
- /* XXX: need to flush to get prim_vbuf.c to release its allocation??
+ /* XXX: need to flush to get prim_vbuf.c to release its allocation??
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
@@ -154,28 +154,26 @@ void draw_pt_emit( struct pt_emit *emit,
return;
}
- translate->set_buffer(translate,
- 0,
+ translate->set_buffer(translate,
+ 0,
vertex_data,
stride,
~0);
- translate->set_buffer(translate,
- 1,
+ translate->set_buffer(translate,
+ 1,
&draw->rasterizer->point_size,
0,
~0);
/* fetch/translate vertex attribs to fill hw_verts[] */
- translate->run( translate,
- 0,
- vertex_count,
- draw->instance_id,
- hw_verts );
+ translate->run(translate,
+ 0,
+ vertex_count,
+ draw->instance_id,
+ hw_verts );
- render->unmap_vertices( render,
- 0,
- vertex_count - 1 );
+ render->unmap_vertices(render, 0, vertex_count - 1);
for (start = i = 0;
i < prim_info->primitive_count;
@@ -190,9 +188,10 @@ void draw_pt_emit( struct pt_emit *emit,
}
-void draw_pt_emit_linear(struct pt_emit *emit,
- const struct draw_vertex_info *vert_info,
- const struct draw_prim_info *prim_info)
+void
+draw_pt_emit_linear(struct pt_emit *emit,
+ const struct draw_vertex_info *vert_info,
+ const struct draw_prim_info *prim_info)
{
const float (*vertex_data)[4] = (const float (*)[4])vert_info->verts->data;
unsigned stride = vert_info->stride;
@@ -206,7 +205,7 @@ void draw_pt_emit_linear(struct pt_emit *emit,
#if 0
debug_printf("Linear emit\n");
#endif
- /* XXX: need to flush to get prim_vbuf.c to release its allocation??
+ /* XXX: need to flush to get prim_vbuf.c to release its allocation??
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
@@ -241,8 +240,8 @@ void draw_pt_emit_linear(struct pt_emit *emit,
unsigned i;
for (i = 0; i < count; i++) {
debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
- draw_dump_emitted_vertex( emit->vinfo,
- (const uint8_t *)hw_verts +
+ draw_dump_emitted_vertex( emit->vinfo,
+ (const uint8_t *)hw_verts +
translate->key.output_stride * i );
}
}
@@ -267,7 +266,9 @@ fail:
return;
}
-struct pt_emit *draw_pt_emit_create( struct draw_context *draw )
+
+struct pt_emit *
+draw_pt_emit_create(struct draw_context *draw)
{
struct pt_emit *emit = CALLOC_STRUCT(pt_emit);
if (!emit)
@@ -283,7 +284,9 @@ struct pt_emit *draw_pt_emit_create( struct draw_context *draw )
return emit;
}
-void draw_pt_emit_destroy( struct pt_emit *emit )
+
+void
+draw_pt_emit_destroy(struct pt_emit *emit)
{
if (emit->cache)
translate_cache_destroy(emit->cache);
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c
index 534a07700bf..b0032e5ad0e 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c
@@ -46,7 +46,8 @@ struct pt_fetch {
};
-/* Perform the fetch from API vertex elements & vertex buffers, to a
+/**
+ * Perform the fetch from API vertex elements & vertex buffers, to a
* contiguous set of float[4] attributes as required for the
* vertex_shader->run_linear() method.
*
@@ -55,10 +56,11 @@ struct pt_fetch {
* directly to hw vertices.
*
*/
-void draw_pt_fetch_prepare( struct pt_fetch *fetch,
- unsigned vs_input_count,
- unsigned vertex_size,
- unsigned instance_id_index )
+void
+draw_pt_fetch_prepare(struct pt_fetch *fetch,
+ unsigned vs_input_count,
+ unsigned vertex_size,
+ unsigned instance_id_index)
{
struct draw_context *draw = fetch->draw;
unsigned nr_inputs;
@@ -141,43 +143,41 @@ void draw_pt_fetch_prepare( struct pt_fetch *fetch,
translate_key_sanitize(&key);
fetch->translate = translate_cache_find(fetch->cache, &key);
}
-
}
-
-
-void draw_pt_fetch_run( struct pt_fetch *fetch,
- const unsigned *elts,
- unsigned count,
- char *verts )
+void
+draw_pt_fetch_run(struct pt_fetch *fetch,
+ const unsigned *elts,
+ unsigned count,
+ char *verts)
{
struct draw_context *draw = fetch->draw;
struct translate *translate = fetch->translate;
unsigned i;
for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
- translate->set_buffer(translate,
- i,
- ((char *)draw->pt.user.vbuffer[i] +
+ translate->set_buffer(translate,
+ i,
+ ((char *)draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.max_index);
}
translate->run_elts( translate,
- elts,
+ elts,
count,
draw->instance_id,
verts );
-
}
-void draw_pt_fetch_run_linear( struct pt_fetch *fetch,
- unsigned start,
- unsigned count,
- char *verts )
+void
+draw_pt_fetch_run_linear(struct pt_fetch *fetch,
+ unsigned start,
+ unsigned count,
+ char *verts)
{
struct draw_context *draw = fetch->draw;
struct translate *translate = fetch->translate;
@@ -200,7 +200,8 @@ void draw_pt_fetch_run_linear( struct pt_fetch *fetch,
}
-struct pt_fetch *draw_pt_fetch_create( struct draw_context *draw )
+struct pt_fetch *
+draw_pt_fetch_create(struct draw_context *draw)
{
struct pt_fetch *fetch = CALLOC_STRUCT(pt_fetch);
if (!fetch)
@@ -216,11 +217,12 @@ struct pt_fetch *draw_pt_fetch_create( struct draw_context *draw )
return fetch;
}
-void draw_pt_fetch_destroy( struct pt_fetch *fetch )
+
+void
+draw_pt_fetch_destroy(struct pt_fetch *fetch)
{
if (fetch->cache)
translate_cache_destroy(fetch->cache);
FREE(fetch);
}
-
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
index 97d66e5f11d..84850812f3a 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,7 +22,7 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
/*
@@ -40,15 +40,15 @@
#include "translate/translate.h"
#include "translate/translate_cache.h"
-/* The simplest 'middle end' in the new vertex code.
- *
+/* The simplest 'middle end' in the new vertex code.
+ *
* The responsibilities of a middle end are to:
* - perform vertex fetch using
* - draw vertex element/buffer state
* - a list of fetch indices we received as an input
* - run the vertex shader
- * - cliptest,
- * - clip coord calculation
+ * - cliptest,
+ * - clip coord calculation
* - viewport transformation
* - if necessary, run the primitive pipeline, passing it:
* - a linear array of vertex_header vertices constructed here
@@ -75,7 +75,7 @@
struct fetch_emit_middle_end {
struct draw_pt_middle_end base;
struct draw_context *draw;
-
+
struct translate *translate;
const struct vertex_info *vinfo;
@@ -87,8 +87,6 @@ struct fetch_emit_middle_end {
};
-
-
static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
unsigned prim,
unsigned opt,
@@ -99,20 +97,15 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
const struct vertex_info *vinfo;
unsigned i, dst_offset;
struct translate_key key;
-
- unsigned gs_out_prim = (draw->gs.geometry_shader ?
+ unsigned gs_out_prim = (draw->gs.geometry_shader ?
draw->gs.geometry_shader->output_primitive :
prim);
-
-
draw->render->set_primitive(draw->render, gs_out_prim);
-
+
/* Must do this after set_primitive() above:
*/
vinfo = feme->vinfo = draw->render->get_vertex_info(draw->render);
-
-
/* Transform from API vertices to HW vertices, skipping the
* pipeline_vertex intermediate step.
@@ -148,7 +141,7 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
key.element[i].instance_divisor = src->instance_divisor;
key.element[i].output_format = output_format;
key.element[i].output_offset = dst_offset;
-
+
dst_offset += emit_sz;
}
@@ -158,39 +151,35 @@ static void fetch_emit_prepare( struct draw_pt_middle_end *middle,
/* Don't bother with caching at this stage:
*/
if (!feme->translate ||
- translate_key_compare(&feme->translate->key, &key) != 0)
+ translate_key_compare(&feme->translate->key, &key) != 0)
{
translate_key_sanitize(&key);
feme->translate = translate_cache_find(feme->cache,
&key);
-
- feme->translate->set_buffer(feme->translate,
- draw->pt.nr_vertex_buffers,
+ feme->translate->set_buffer(feme->translate,
+ draw->pt.nr_vertex_buffers,
&feme->point_size,
0,
~0);
}
-
+
feme->point_size = draw->rasterizer->point_size;
for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
- feme->translate->set_buffer(feme->translate,
- i,
- ((char *)draw->pt.user.vbuffer[i] +
+ feme->translate->set_buffer(feme->translate,
+ i,
+ ((char *)draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.max_index);
}
- *max_vertices = (draw->render->max_vertex_buffer_bytes /
+ *max_vertices = (draw->render->max_vertex_buffer_bytes /
(vinfo->size * 4));
}
-
-
-
static void fetch_emit_run( struct draw_pt_middle_end *middle,
const unsigned *fetch_elts,
unsigned fetch_count,
@@ -201,8 +190,8 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle,
struct fetch_emit_middle_end *feme = (struct fetch_emit_middle_end *)middle;
struct draw_context *draw = feme->draw;
void *hw_verts;
-
- /* XXX: need to flush to get prim_vbuf.c to release its allocation??
+
+ /* XXX: need to flush to get prim_vbuf.c to release its allocation??
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
@@ -215,11 +204,10 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle,
assert(0);
return;
}
-
-
+
/* Single routine to fetch vertices and emit HW verts.
*/
- feme->translate->run_elts( feme->translate,
+ feme->translate->run_elts( feme->translate,
fetch_elts,
fetch_count,
draw->instance_id,
@@ -229,23 +217,23 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle,
unsigned i;
for (i = 0; i < fetch_count; i++) {
debug_printf("\n\nvertex %d:\n", i);
- draw_dump_emitted_vertex( feme->vinfo,
+ draw_dump_emitted_vertex( feme->vinfo,
(const uint8_t *)hw_verts + feme->vinfo->size * 4 * i );
}
}
- draw->render->unmap_vertices( draw->render,
- 0,
+ draw->render->unmap_vertices( draw->render,
+ 0,
(ushort)(fetch_count - 1) );
/* XXX: Draw arrays path to avoid re-emitting index list again and
* again.
*/
- draw->render->draw_elements( draw->render,
- draw_elts,
+ draw->render->draw_elements( draw->render,
+ draw_elts,
draw_count );
- /* Done -- that was easy, wasn't it:
+ /* Done -- that was easy, wasn't it:
*/
draw->render->release_vertices( draw->render );
@@ -267,11 +255,11 @@ static void fetch_emit_run_linear( struct draw_pt_middle_end *middle,
if (!draw->render->allocate_vertices( draw->render,
(ushort)feme->translate->key.output_stride,
- (ushort)count ))
+ (ushort)count ))
goto fail;
hw_verts = draw->render->map_vertices( draw->render );
- if (!hw_verts)
+ if (!hw_verts)
goto fail;
/* Single routine to fetch vertices and emit HW verts.
@@ -330,7 +318,7 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
return FALSE;
hw_verts = draw->render->map_vertices( draw->render );
- if (!hw_verts)
+ if (!hw_verts)
return FALSE;
/* Single routine to fetch vertices and emit HW verts.
@@ -346,8 +334,8 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
/* XXX: Draw arrays path to avoid re-emitting index list again and
* again.
*/
- draw->render->draw_elements( draw->render,
- draw_elts,
+ draw->render->draw_elements( draw->render,
+ draw_elts,
draw_count );
/* Done -- that was easy, wasn't it:
@@ -358,13 +346,12 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
}
-
-
static void fetch_emit_finish( struct draw_pt_middle_end *middle )
{
/* nothing to do */
}
+
static void fetch_emit_destroy( struct draw_pt_middle_end *middle )
{
struct fetch_emit_middle_end *feme = (struct fetch_emit_middle_end *)middle;
@@ -396,7 +383,7 @@ struct draw_pt_middle_end *draw_pt_fetch_emit( struct draw_context *draw )
fetch_emit->base.destroy = fetch_emit_destroy;
fetch_emit->draw = draw;
-
+
return &fetch_emit->base;
}
diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
index 4bed256dfb0..b875f64e3b2 100644
--- a/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
+++ b/src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c
@@ -1,8 +1,8 @@
/**************************************************************************
- *
+ *
* Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
* All Rights Reserved.
- *
+ *
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -10,11 +10,11 @@
* distribute, sub license, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
- *
+ *
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial portions
* of the Software.
- *
+ *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
@@ -22,7 +22,7 @@
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
+ *
**************************************************************************/
/*
@@ -50,7 +50,6 @@ struct fetch_shade_emit {
struct draw_pt_middle_end base;
struct draw_context *draw;
-
/* Temporaries:
*/
const float *constants;
@@ -61,16 +60,16 @@ struct fetch_shade_emit {
struct draw_vs_variant_key key;
struct draw_vs_variant *active;
-
const struct vertex_info *vinfo;
};
-static void fse_prepare( struct draw_pt_middle_end *middle,
- unsigned prim,
- unsigned opt,
- unsigned *max_vertices )
+static void
+fse_prepare(struct draw_pt_middle_end *middle,
+ unsigned prim,
+ unsigned opt,
+ unsigned *max_vertices)
{
struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle;
struct draw_context *draw = fse->draw;
@@ -89,7 +88,6 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
*/
fse->vinfo = vinfo = draw->render->get_vertex_info(draw->render);
-
fse->key.output_stride = vinfo->size * 4;
fse->key.nr_outputs = vinfo->num_attribs;
fse->key.nr_inputs = num_vs_inputs;
@@ -101,7 +99,7 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
fse->key.clip = draw->clip_xy || draw->clip_z || draw->clip_user;
fse->key.const_vbuffers = 0;
- memset(fse->key.element, 0,
+ memset(fse->key.element, 0,
fse->key.nr_elements * sizeof(fse->key.element[0]));
for (i = 0; i < num_vs_inputs; i++) {
@@ -115,14 +113,14 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
fse->key.element[i].in.offset = src->src_offset;
nr_vbs = MAX2(nr_vbs, src->vertex_buffer_index + 1);
}
-
+
for (i = 0; i < 5 && i < nr_vbs; i++) {
if (draw->pt.vertex_buffer[i].stride == 0)
fse->key.const_vbuffers |= (1<<i);
}
if (0) debug_printf("%s: lookup const_vbuffers: %x\n", __FUNCTION__, fse->key.const_vbuffers);
-
+
{
unsigned dst_offset = 0;
@@ -139,14 +137,13 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
fse->key.element[i].out.format = vinfo->attrib[i].emit;
fse->key.element[i].out.vs_output = vinfo->attrib[i].src_index;
fse->key.element[i].out.offset = dst_offset;
-
+
dst_offset += emit_sz;
assert(fse->key.output_stride >= dst_offset);
}
}
-
- fse->active = draw_vs_lookup_variant( draw->vs.vertex_shader,
+ fse->active = draw_vs_lookup_variant( draw->vs.vertex_shader,
&fse->key );
if (!fse->active) {
@@ -154,21 +151,21 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
return ;
}
- if (0) debug_printf("%s: found const_vbuffers: %x\n", __FUNCTION__,
+ if (0) debug_printf("%s: found const_vbuffers: %x\n", __FUNCTION__,
fse->active->key.const_vbuffers);
/* Now set buffer pointers:
*/
for (i = 0; i < draw->pt.nr_vertex_buffers; i++) {
- fse->active->set_buffer( fse->active,
- i,
- ((const ubyte *) draw->pt.user.vbuffer[i] +
+ fse->active->set_buffer( fse->active,
+ i,
+ ((const ubyte *) draw->pt.user.vbuffer[i] +
draw->pt.vertex_buffer[i].buffer_offset),
draw->pt.vertex_buffer[i].stride,
draw->pt.max_index );
}
- *max_vertices = (draw->render->max_vertex_buffer_bytes /
+ *max_vertices = (draw->render->max_vertex_buffer_bytes /
(vinfo->size * 4));
/* Probably need to do this somewhere (or fix exec shader not to
@@ -182,10 +179,11 @@ static void fse_prepare( struct draw_pt_middle_end *middle,
-static void fse_run_linear( struct draw_pt_middle_end *middle,
- unsigned start,
- unsigned count,
- unsigned prim_flags )
+static void
+fse_run_linear(struct draw_pt_middle_end *middle,
+ unsigned start,
+ unsigned count,
+ unsigned prim_flags)
{
struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle;
struct draw_context *draw = fse->draw;
@@ -208,11 +206,10 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
* Clipping is done elsewhere -- either by the API or on hardware,
* or for some other reason not required...
*/
- fse->active->run_linear( fse->active,
+ fse->active->run_linear( fse->active,
start, count,
hw_verts );
-
if (0) {
unsigned i;
for (i = 0; i < count; i++) {
@@ -220,11 +217,11 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
fse->key.output_stride,
fse->key.output_stride * i);
- draw_dump_emitted_vertex( fse->vinfo,
+ draw_dump_emitted_vertex( fse->vinfo,
(const uint8_t *)hw_verts + fse->key.output_stride * i );
}
}
-
+
draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );
/* Draw arrays path to avoid re-emitting index list again and
@@ -233,7 +230,6 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
draw->render->draw_arrays( draw->render,
0,
count );
-
draw->render->release_vertices( draw->render );
@@ -256,8 +252,8 @@ fse_run(struct draw_pt_middle_end *middle,
struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle;
struct draw_context *draw = fse->draw;
void *hw_verts;
-
- /* XXX: need to flush to get prim_vbuf.c to release its allocation??
+
+ /* XXX: need to flush to get prim_vbuf.c to release its allocation??
*/
draw_do_flush( draw, DRAW_FLUSH_BACKEND );
@@ -266,35 +262,32 @@ fse_run(struct draw_pt_middle_end *middle,
(ushort)fetch_count ))
goto fail;
- hw_verts = draw->render->map_vertices( draw->render );
- if (!hw_verts)
+ hw_verts = draw->render->map_vertices( draw->render );
+ if (!hw_verts)
goto fail;
-
-
+
/* Single routine to fetch vertices, run shader and emit HW verts.
*/
- fse->active->run_elts( fse->active,
+ fse->active->run_elts( fse->active,
fetch_elts,
fetch_count,
hw_verts );
-
if (0) {
unsigned i;
for (i = 0; i < fetch_count; i++) {
debug_printf("\n\n%s vertex %d:\n", __FUNCTION__, i);
- draw_dump_emitted_vertex( fse->vinfo,
- (const uint8_t *)hw_verts +
+ draw_dump_emitted_vertex( fse->vinfo,
+ (const uint8_t *)hw_verts +
fse->key.output_stride * i );
}
}
draw->render->unmap_vertices( draw->render, 0, (ushort)(fetch_count - 1) );
-
- draw->render->draw_elements( draw->render,
- draw_elts,
- draw_count );
+ draw->render->draw_elements( draw->render,
+ draw_elts,
+ draw_count );
draw->render->release_vertices( draw->render );
return;
@@ -306,12 +299,13 @@ fail:
-static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle,
- unsigned start,
- unsigned count,
- const ushort *draw_elts,
- unsigned draw_count,
- unsigned prim_flags )
+static boolean
+fse_run_linear_elts(struct draw_pt_middle_end *middle,
+ unsigned start,
+ unsigned count,
+ const ushort *draw_elts,
+ unsigned draw_count,
+ unsigned prim_flags)
{
struct fetch_shade_emit *fse = (struct fetch_shade_emit *)middle;
struct draw_context *draw = fse->draw;
@@ -327,22 +321,20 @@ static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle,
return FALSE;
hw_verts = draw->render->map_vertices( draw->render );
- if (!hw_verts)
+ if (!hw_verts)
return FALSE;
/* Single routine to fetch vertices, run shader and emit HW verts.
* Clipping is done elsewhere -- either by the API or on hardware,
* or for some other reason not required...
*/
- fse->active->run_linear( fse->active,
+ fse->active->run_linear( fse->active,
start, count,
hw_verts );
-
- draw->render->draw_elements( draw->render,
- draw_elts,
+ draw->render->draw_elements( draw->render,
+ draw_elts,
draw_count );
-
draw->render->unmap_vertices( draw->render, 0, (ushort)(count - 1) );
@@ -353,18 +345,21 @@ static boolean fse_run_linear_elts( struct draw_pt_middle_end *middle,
-static void fse_finish( struct draw_pt_middle_end *middle )
+static void
+fse_finish(struct draw_pt_middle_end *middle)
{
}
static void
-fse_destroy( struct draw_pt_middle_end *middle )
+fse_destroy(struct draw_pt_middle_end *middle)
{
FREE(middle);
}
-struct draw_pt_middle_end *draw_pt_middle_fse( struct draw_context *draw )
+
+struct draw_pt_middle_end *
+draw_pt_middle_fse(struct draw_context *draw)
{
struct fetch_shade_emit *fse = CALLOC_STRUCT(fetch_shade_emit);
if (!fse)