[Mesa-dev] [PATCH 4/4] graw: trivial coding style fixes
Emil Velikov
emil.l.velikov at gmail.com
Mon Jan 16 16:25:44 UTC 2017
From: Emil Velikov <emil.velikov at collabora.com>
Remove trailing whitespace and properly use brackets.
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
src/gallium/auxiliary/draw/draw_vs.c | 47 +++++++++++++++---------------------
1 file changed, 20 insertions(+), 27 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c
index 48a1a34ee6..0def8462eb 100644
--- a/src/gallium/auxiliary/draw/draw_vs.c
+++ b/src/gallium/auxiliary/draw/draw_vs.c
@@ -55,20 +55,16 @@ draw_create_vertex_shader(struct draw_context *draw,
{
struct draw_vertex_shader *vs = NULL;
- if (draw->dump_vs) {
+ if (draw->dump_vs)
tgsi_dump(shader->tokens, 0);
- }
- if (draw->pt.middle.llvm) {
+ if (draw->pt.middle.llvm)
vs = draw_create_vs_llvm(draw, shader);
- }
- if (!vs) {
+ if (!vs)
vs = draw_create_vs_exec( draw, shader );
- }
- if (vs)
- {
+ if (vs) {
uint i;
bool found_clipvertex = FALSE;
vs->position_output = -1;
@@ -105,9 +101,8 @@ draw_bind_vertex_shader(struct draw_context *draw,
struct draw_vertex_shader *dvs)
{
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
-
- if (dvs)
- {
+
+ if (dvs) {
draw->vs.vertex_shader = dvs;
draw->vs.num_vs_outputs = dvs->info.num_outputs;
draw->vs.position_output = dvs->position_output;
@@ -132,7 +127,7 @@ draw_delete_vertex_shader(struct draw_context *draw,
{
unsigned i;
- for (i = 0; i < dvs->nr_variants; i++)
+ for (i = 0; i < dvs->nr_variants; i++)
dvs->variant[i]->destroy( dvs->variant[i] );
dvs->nr_variants = 0;
@@ -142,7 +137,7 @@ draw_delete_vertex_shader(struct draw_context *draw,
-boolean
+boolean
draw_vs_init( struct draw_context *draw )
{
draw->dump_vs = debug_get_option_gallium_dump_vs();
@@ -154,11 +149,11 @@ draw_vs_init( struct draw_context *draw )
}
draw->vs.emit_cache = translate_cache_create();
- if (!draw->vs.emit_cache)
+ if (!draw->vs.emit_cache)
return FALSE;
-
+
draw->vs.fetch_cache = translate_cache_create();
- if (!draw->vs.fetch_cache)
+ if (!draw->vs.fetch_cache)
return FALSE;
return TRUE;
@@ -185,19 +180,19 @@ draw_vs_lookup_variant( struct draw_vertex_shader *vs,
struct draw_vs_variant *variant;
unsigned i;
- /* Lookup existing variant:
+ /* Lookup existing variant:
*/
for (i = 0; i < vs->nr_variants; i++)
if (draw_vs_variant_key_compare(key, &vs->variant[i]->key) == 0)
return vs->variant[i];
-
- /* Else have to create a new one:
+
+ /* Else have to create a new one:
*/
variant = vs->create_variant( vs, key );
if (!variant)
return NULL;
- /* Add it to our list, could be smarter:
+ /* Add it to our list, could be smarter:
*/
if (vs->nr_variants < ARRAY_SIZE(vs->variant)) {
vs->variant[vs->nr_variants++] = variant;
@@ -209,7 +204,7 @@ draw_vs_lookup_variant( struct draw_vertex_shader *vs,
vs->variant[vs->last_variant] = variant;
}
- /* Done
+ /* Done
*/
return variant;
}
@@ -220,12 +215,11 @@ draw_vs_get_fetch( struct draw_context *draw,
struct translate_key *key )
{
if (!draw->vs.fetch ||
- translate_key_compare(&draw->vs.fetch->key, key) != 0)
- {
+ translate_key_compare(&draw->vs.fetch->key, key) != 0) {
translate_key_sanitize(key);
draw->vs.fetch = translate_cache_find(draw->vs.fetch_cache, key);
}
-
+
return draw->vs.fetch;
}
@@ -234,12 +228,11 @@ draw_vs_get_emit( struct draw_context *draw,
struct translate_key *key )
{
if (!draw->vs.emit ||
- translate_key_compare(&draw->vs.emit->key, key) != 0)
- {
+ translate_key_compare(&draw->vs.emit->key, key) != 0) {
translate_key_sanitize(key);
draw->vs.emit = translate_cache_find(draw->vs.emit_cache, key);
}
-
+
return draw->vs.emit;
}
--
2.11.0
More information about the mesa-dev
mailing list