renderer: CLEANUP: whitespace and reindent

this uses the mesa coding style, pray I never have to do
this again.

strip all trailing whitespace as much as possible
macos/master
Dave Airlie 10 years ago
parent 59b9cb549a
commit 7e85c2f114
  1. 4
      src/virgl_egl_context.c
  2. 27
      src/vrend_blitter.h
  3. 2
      src/vrend_decode.c
  4. 8
      src/vrend_formats.c
  5. 2
      src/vrend_renderer.c
  6. 8
      src/vrend_shader.c

@ -289,7 +289,7 @@ int virgl_egl_get_fourcc_for_texture(struct virgl_egl *ve, uint32_t tex_id, uint
#endif #endif
fallback: fallback:
*fourcc = virgl_egl_get_gbm_format(format); *fourcc = virgl_egl_get_gbm_format(format);
return ret; return ret;
} }
@ -337,7 +337,7 @@ int virgl_egl_get_fd_for_texture(struct virgl_egl *ve, uint32_t tex_id, int *fd)
#endif #endif
} }
ret = 0; ret = 0;
out_destroy: out_destroy:
eglDestroyImageKHR(ve->egl_display, image); eglDestroyImageKHR(ve->egl_display, image);
return ret; return ret;
} }

@ -1,5 +1,28 @@
#ifndef VREND_BLITTER /**************************************************************************
#define VREND_BLITTER *
* Copyright (C) 2014 Red Hat Inc.
*
* 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 without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* 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 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 NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 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.
*
**************************************************************************/
#ifndef VREND_BLITTER_H
#define VREND_BLITTER_H
/* shaders for blitting */ /* shaders for blitting */

@ -1210,7 +1210,7 @@ int vrend_decode_block(uint32_t ctx_id, uint32_t *block, int ndw)
gdctx->ds->buf_offset += (len) + 1; gdctx->ds->buf_offset += (len) + 1;
} }
return 0; return 0;
out: out:
return ret; return ret;
} }

@ -28,7 +28,7 @@
#include "util/u_format.h" #include "util/u_format.h"
/* fill the format table */ /* fill the format table */
static struct vrend_format_table base_rgba_formats[] = static struct vrend_format_table base_rgba_formats[] =
{ {
{ VIRGL_FORMAT_B8G8R8X8_UNORM, GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, 0 }, { VIRGL_FORMAT_B8G8R8X8_UNORM, GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, 0 },
{ VIRGL_FORMAT_B8G8R8A8_UNORM, GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, 0 }, { VIRGL_FORMAT_B8G8R8A8_UNORM, GL_RGBA8, GL_BGRA, GL_UNSIGNED_BYTE, 0 },
@ -51,10 +51,10 @@ static struct vrend_format_table base_rgba_formats[] =
{ VIRGL_FORMAT_R16G16B16X16_UNORM, GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT }, { VIRGL_FORMAT_R16G16B16X16_UNORM, GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT },
{ VIRGL_FORMAT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT }, { VIRGL_FORMAT_R16G16B16A16_UNORM, GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT },
}; };
static struct vrend_format_table base_depth_formats[] = static struct vrend_format_table base_depth_formats[] =
{ {
{ VIRGL_FORMAT_Z16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0 }, { VIRGL_FORMAT_Z16_UNORM, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 0 },
{ VIRGL_FORMAT_Z32_UNORM, GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0 }, { VIRGL_FORMAT_Z32_UNORM, GL_DEPTH_COMPONENT32, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 0 },
{ VIRGL_FORMAT_S8_UINT_Z24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0 }, { VIRGL_FORMAT_S8_UINT_Z24_UNORM, GL_DEPTH24_STENCIL8_EXT, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0 },
@ -62,7 +62,7 @@ static struct vrend_format_table base_depth_formats[] =
{ VIRGL_FORMAT_Z32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT }, { VIRGL_FORMAT_Z32_FLOAT, GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT, GL_FLOAT },
/* this is probably a separate format */ /* this is probably a separate format */
{ VIRGL_FORMAT_Z32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV}, { VIRGL_FORMAT_Z32_FLOAT_S8X24_UINT, GL_DEPTH32F_STENCIL8, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV},
}; };
static struct vrend_format_table base_la_formats[] = { static struct vrend_format_table base_la_formats[] = {
{ VIRGL_FORMAT_A8_UNORM, GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE }, { VIRGL_FORMAT_A8_UNORM, GL_ALPHA8, GL_ALPHA, GL_UNSIGNED_BYTE },

@ -1024,7 +1024,6 @@ int vrend_create_surface(struct vrend_context *ctx,
uint32_t handle, uint32_t handle,
uint32_t res_handle, uint32_t format, uint32_t res_handle, uint32_t format,
uint32_t val0, uint32_t val1) uint32_t val0, uint32_t val1)
{ {
struct vrend_surface *surf; struct vrend_surface *surf;
struct vrend_resource *res; struct vrend_resource *res;
@ -4589,7 +4588,6 @@ void vrend_set_stencil_ref(struct vrend_context *ctx,
ctx->sub->stencil_refs[1] = ref->ref_value[1]; ctx->sub->stencil_refs[1] = ref->ref_value[1];
ctx->sub->stencil_state_dirty = true; ctx->sub->stencil_state_dirty = true;
} }
} }
void vrend_set_blend_color(struct vrend_context *ctx, void vrend_set_blend_color(struct vrend_context *ctx,

@ -31,12 +31,6 @@
#include <errno.h> #include <errno.h>
#include "vrend_shader.h" #include "vrend_shader.h"
extern int vrend_dump_shaders; extern int vrend_dump_shaders;
/*
* TODO list
* loops
* DDX/DDY/TXD
* missing opcodes
*/
/* start convert of tgsi to glsl */ /* start convert of tgsi to glsl */
@ -1367,7 +1361,6 @@ iter_instruction(struct tgsi_iterate_context *iter,
imm_stypeprefix = "uintBitsToFloat"; imm_stypeprefix = "uintBitsToFloat";
} else if (stype == TGSI_TYPE_UNSIGNED || stype == TGSI_TYPE_SIGNED) } else if (stype == TGSI_TYPE_UNSIGNED || stype == TGSI_TYPE_SIGNED)
imm_stypeprefix = ""; imm_stypeprefix = "";
} }
/* build up a vec4 of immediates */ /* build up a vec4 of immediates */
@ -1822,7 +1815,6 @@ iter_instruction(struct tgsi_iterate_context *iter,
snprintf(buf, 255, "%s = clamp(%s, 0.0, 1.0);\n", dsts[0], dsts[0]); snprintf(buf, 255, "%s = clamp(%s, 0.0, 1.0);\n", dsts[0], dsts[0]);
EMIT_BUF_WITH_RET(ctx, buf); EMIT_BUF_WITH_RET(ctx, buf);
} }
return TRUE; return TRUE;
} }

Loading…
Cancel
Save