aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-08-20 16:54:35 -0600
committerBrian Paul <[email protected]>2013-08-21 17:55:06 -0600
commite4217396b7ffddb0464be07f17918cef26539c44 (patch)
tree7994483cfa25b4975f59b63172deaf179493bc0e /src/gallium/drivers/svga
parente6013e4bee7ebff6b7bd2f3b95eb16e8949e228c (diff)
svga: minor clean-ups in emit_hw_vs_vdecl()
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_state_vdecl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_state_vdecl.c b/src/gallium/drivers/svga/svga_state_vdecl.c
index 557f304d23e..a33627baaf5 100644
--- a/src/gallium/drivers/svga/svga_state_vdecl.c
+++ b/src/gallium/drivers/svga/svga_state_vdecl.c
@@ -42,13 +42,13 @@ static enum pipe_error
emit_hw_vs_vdecl(struct svga_context *svga, unsigned dirty)
{
const struct pipe_vertex_element *ve = svga->curr.velems->velem;
- SVGA3dVertexDecl decl;
unsigned i;
unsigned neg_bias = 0;
assert(svga->curr.velems->count >=
svga->curr.vs->base.info.file_count[TGSI_FILE_INPUT]);
+ /* specify number of vertex element declarations to come */
svga_hwtnl_reset_vdecl( svga->hwtnl,
svga->curr.velems->count );
@@ -70,16 +70,15 @@ emit_hw_vs_vdecl(struct svga_context *svga, unsigned dirty)
for (i = 0; i < svga->curr.velems->count; i++) {
const struct pipe_vertex_buffer *vb =
&svga->curr.vb[ve[i].vertex_buffer_index];
- struct svga_buffer *buffer;
+ const struct svga_buffer *buffer;
unsigned int offset = vb->buffer_offset + ve[i].src_offset;
- unsigned tmp_neg_bias = 0;
if (!vb->buffer)
continue;
buffer = svga_buffer(vb->buffer);
if (buffer->uploaded.start > offset) {
- tmp_neg_bias = buffer->uploaded.start - offset;
+ unsigned tmp_neg_bias = buffer->uploaded.start - offset;
if (vb->stride)
tmp_neg_bias = (tmp_neg_bias + vb->stride - 1) / vb->stride;
neg_bias = MAX2(neg_bias, tmp_neg_bias);
@@ -90,12 +89,13 @@ emit_hw_vs_vdecl(struct svga_context *svga, unsigned dirty)
const struct pipe_vertex_buffer *vb =
&svga->curr.vb[ve[i].vertex_buffer_index];
unsigned usage, index;
- struct svga_buffer *buffer;
+ const struct svga_buffer *buffer;
+ SVGA3dVertexDecl decl;
if (!vb->buffer)
continue;
- buffer= svga_buffer(vb->buffer);
+ buffer = svga_buffer(vb->buffer);
svga_generate_vdecl_semantics( i, &usage, &index );
/* SVGA_NEW_VELEMENT