Remove trailing whitespace, etc.
Trivial.
#include "svga_context.h"
#include "svga_resource_buffer.h"
-/***********************************************************************
- * Constant buffers
- */
-struct svga_constbuf
+struct svga_constbuf
{
unsigned type;
float (*data)[4];
-static void svga_set_constant_buffer(struct pipe_context *pipe,
- enum pipe_shader_type shader, uint index,
- const struct pipe_constant_buffer *cb)
+static void
+svga_set_constant_buffer(struct pipe_context *pipe,
+ enum pipe_shader_type shader, uint index,
+ const struct pipe_constant_buffer *cb)
{
struct svga_screen *svgascreen = svga_screen(pipe->screen);
struct svga_context *svga = svga_context(pipe);
}
-
-void svga_init_constbuffer_functions( struct svga_context *svga )
+void
+svga_init_constbuffer_functions(struct svga_context *svga)
{
svga->pipe.set_constant_buffer = svga_set_constant_buffer;
}
static void
-svga_buffer_transfer_flush_region( struct pipe_context *pipe,
- struct pipe_transfer *transfer,
- const struct pipe_box *box)
+svga_buffer_transfer_flush_region(struct pipe_context *pipe,
+ struct pipe_transfer *transfer,
+ const struct pipe_box *box)
{
struct svga_screen *ss = svga_screen(pipe->screen);
struct svga_buffer *sbuf = svga_buffer(transfer->resource);
static void
-svga_buffer_transfer_unmap( struct pipe_context *pipe,
- struct pipe_transfer *transfer )
+svga_buffer_transfer_unmap(struct pipe_context *pipe,
+ struct pipe_transfer *transfer)
{
struct svga_screen *ss = svga_screen(pipe->screen);
struct svga_context *svga = svga_context(pipe);
static void
-svga_buffer_destroy( struct pipe_screen *screen,
- struct pipe_resource *buf )
+svga_buffer_destroy(struct pipe_screen *screen,
+ struct pipe_resource *buf)
{
- struct svga_screen *ss = svga_screen(screen);
- struct svga_buffer *sbuf = svga_buffer( buf );
+ struct svga_screen *ss = svga_screen(screen);
+ struct svga_buffer *sbuf = svga_buffer(buf);
assert(!p_atomic_read(&buf->reference.count));
struct pipe_resource *
svga_buffer_create(struct pipe_screen *screen,
- const struct pipe_resource *template)
+ const struct pipe_resource *template)
{
struct svga_screen *ss = svga_screen(screen);
struct svga_buffer *sbuf;
svga_user_buffer_create(struct pipe_screen *screen,
void *ptr,
unsigned bytes,
- unsigned bind)
+ unsigned bind)
{
struct svga_buffer *sbuf;
struct svga_screen *ss = svga_screen(screen);
no_sbuf:
return NULL;
}
-
-
-
/**
* SVGA pipe buffer.
*/
-struct svga_buffer
+struct svga_buffer
{
struct u_resource b;
/**
* Regular (non DMA'able) memory.
- *
+ *
* Used for user buffers or for buffers which we know before hand that can
* never be used by the virtual hardware directly, such as constant buffers.
*/
void *swbuf;
-
- /**
+
+ /**
* Whether swbuf was created by the user or not.
*/
boolean user;
-
+
/**
* Creation key for the host surface handle.
- *
- * This structure describes all the host surface characteristics so that it
+ *
+ * This structure describes all the host surface characteristics so that it
* can be looked up in cache, since creating a host surface is often a slow
* operation.
*/
struct svga_host_surface_cache_key key;
-
+
/**
* Host surface handle.
- *
- * This is a platform independent abstraction for host SID. We create when
+ *
+ * This is a platform independent abstraction for host SID. We create when
* trying to bind.
*
* Only set for non-user buffers.
* Returns TRUE for user buffers. We may
* decide to use an alternate upload path for these buffers.
*/
-static inline boolean
-svga_buffer_is_user_buffer( struct pipe_resource *buffer )
+static inline boolean
+svga_buffer_is_user_buffer(struct pipe_resource *buffer)
{
if (buffer) {
return svga_buffer(buffer)->user;
svga_user_buffer_create(struct pipe_screen *screen,
void *ptr,
unsigned bytes,
- unsigned usage);
+ unsigned usage);
struct pipe_resource *
svga_buffer_create(struct pipe_screen *screen,
- const struct pipe_resource *template);
+ const struct pipe_resource *template);
struct svga_winsys_buffer *
svga_winsys_buffer_create(struct svga_context *svga,
- unsigned alignment,
+ unsigned alignment,
unsigned usage,
unsigned size);
/* Ensure any pending operations on host surfaces are queued on the command
* buffer first.
*/
- svga_surfaces_flush( svga );
+ svga_surfaces_flush(svga);
if (!st->swbuf) {
/* Do the DMA transfer in a single go */
static void
svga_texture_destroy(struct pipe_screen *screen,
- struct pipe_resource *pt)
+ struct pipe_resource *pt)
{
struct svga_screen *ss = svga_screen(screen);
struct svga_texture *tex = svga_texture(pt);
/* Destroy the backed surface handle if exists */
if (tex->backed_handle)
svga_screen_surface_destroy(ss, &tex->backed_key, &tex->backed_handle);
-
+
ss->hud.total_resource_bytes -= tex->size;
FREE(tex->defined);
*/
static void
svga_texture_transfer_unmap_dma(struct svga_context *svga,
- struct svga_transfer *st)
+ struct svga_transfer *st)
{
struct svga_winsys_screen *sws = svga_screen(svga->pipe.screen)->sws;
- if (st->hwbuf)
+ if (st->hwbuf)
sws->buffer_unmap(sws, st->hwbuf);
if (st->base.usage & PIPE_TRANSFER_WRITE) {
*/
static void
svga_texture_transfer_unmap_direct(struct svga_context *svga,
- struct svga_transfer *st)
+ struct svga_transfer *st)
{
struct pipe_transfer *transfer = &st->base;
struct svga_texture *tex = svga_texture(transfer->resource);
}
}
+
static void
svga_texture_transfer_unmap(struct pipe_context *pipe,
- struct pipe_transfer *transfer)
+ struct pipe_transfer *transfer)
{
struct svga_context *svga = svga_context(pipe);
struct svga_screen *ss = svga_screen(pipe->screen);
struct svga_winsys_surface *dstsurf;
struct pipe_resource *texture = st->base.resource;
struct svga_texture *tex = svga_texture(texture);
- enum pipe_error ret;
+ enum pipe_error ret;
unsigned subResource;
unsigned numMipLevels;
unsigned i, layer;
assert(svga->tex_upload);
assert(st->upload.buf);
-
+
/* unmap the texture upload buffer */
u_upload_unmap(svga->tex_upload);
extern struct u_resource_vtbl svga_texture_vtbl;
-struct svga_texture
+struct svga_texture
{
struct u_resource b;
ushort *defined;
-
+
struct svga_sampler_view *cached_view;
unsigned view_age[SVGA_MAX_TEXTURE_LEVELS];
/**
* Creation key for the host surface handle.
- *
- * This structure describes all the host surface characteristics so that it
+ *
+ * This structure describes all the host surface characteristics so that it
* can be looked up in cache, since creating a host surface is often a slow
* operation.
*/
/** array indexed by cube face or 3D/array slice, one bit per mipmap level.
* Set if the level is marked as dirty.
- */
+ */
ushort *dirty;
/**
struct pipe_resource *
svga_texture_from_handle(struct pipe_screen * screen,
- const struct pipe_resource *template,
- struct winsys_handle *whandle);
+ const struct pipe_resource *template,
+ struct winsys_handle *whandle);
boolean
svga_texture_generate_mipmap(struct pipe_context *pipe,
struct svga_screen *screen = svga_screen(svga->pipe.screen);
svga->swtnl.backend = svga_vbuf_render_create(svga);
- if(!svga->swtnl.backend)
+ if (!svga->swtnl.backend)
goto fail;
/*
unsigned last = decl->Range.Last;
unsigned idx;
- for(idx = first; idx <= last; idx++) {
+ for (idx = first; idx <= last; idx++) {
boolean ok = TRUE;
switch (decl->Declaration.File) {