projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
199034a
)
[g3dvl] use instanced drawing to reduce the vertex buffer payload
author
Christian König
<deathsimple@vodafone.de>
Sat, 5 Mar 2011 15:36:38 +0000
(16:36 +0100)
committer
Christian König
<deathsimple@vodafone.de>
Sat, 5 Mar 2011 15:36:38 +0000
(16:36 +0100)
src/gallium/auxiliary/vl/vl_idct.c
patch
|
blob
|
history
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
patch
|
blob
|
history
src/gallium/auxiliary/vl/vl_vertex_buffers.c
patch
|
blob
|
history
src/gallium/auxiliary/vl/vl_vertex_buffers.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/vl/vl_idct.c
b/src/gallium/auxiliary/vl/vl_idct.c
index 89463a5c75c448a04c3abdc83e663e34ede8cea8..e1e57431a0b9578713f9f6f3e5d1eed7ea658063 100644
(file)
--- a/
src/gallium/auxiliary/vl/vl_idct.c
+++ b/
src/gallium/auxiliary/vl/vl_idct.c
@@
-752,7
+752,7
@@
vl_idct_flush(struct vl_idct *idct, struct vl_idct_buffer *buffer)
idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[0]);
idct->pipe->bind_vs_state(idct->pipe, idct->matrix_vs);
idct->pipe->bind_fs_state(idct->pipe, idct->matrix_fs);
idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[0]);
idct->pipe->bind_vs_state(idct->pipe, idct->matrix_vs);
idct->pipe->bind_fs_state(idct->pipe, idct->matrix_fs);
- util_draw_arrays
(idct->pipe, PIPE_PRIM_QUADS
, 0, num_verts);
+ util_draw_arrays
_instanced(idct->pipe, PIPE_PRIM_QUADS, 0, 4
, 0, num_verts);
/* second stage */
idct->pipe->set_framebuffer_state(idct->pipe, &buffer->fb_state[1]);
/* second stage */
idct->pipe->set_framebuffer_state(idct->pipe, &buffer->fb_state[1]);
@@
-761,6
+761,6
@@
vl_idct_flush(struct vl_idct *idct, struct vl_idct_buffer *buffer)
idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[1]);
idct->pipe->bind_vs_state(idct->pipe, idct->transpose_vs);
idct->pipe->bind_fs_state(idct->pipe, idct->transpose_fs);
idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[1]);
idct->pipe->bind_vs_state(idct->pipe, idct->transpose_vs);
idct->pipe->bind_fs_state(idct->pipe, idct->transpose_fs);
- util_draw_arrays
(idct->pipe, PIPE_PRIM_QUADS
, 0, num_verts);
+ util_draw_arrays
_instanced(idct->pipe, PIPE_PRIM_QUADS, 0, 4
, 0, num_verts);
}
}
}
}
diff --git
a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
index 484e781f0cb89d3976c300d917a45becaced0efb..2f68ec1704246c5b3822e59514c958a9d15d4929 100644
(file)
--- a/
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
+++ b/
src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c
@@
-1080,7
+1080,7
@@
vl_mpeg12_mc_renderer_flush(struct vl_mpeg12_mc_renderer *renderer, struct vl_mp
renderer->pipe->bind_vs_state(renderer->pipe, renderer->vs);
renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs);
renderer->pipe->bind_vs_state(renderer->pipe, renderer->vs);
renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs);
- util_draw_arrays
(renderer->pipe, PIPE_PRIM_QUADS, 0, buffer->num_macroblocks * 4
);
+ util_draw_arrays
_instanced(renderer->pipe, PIPE_PRIM_QUADS, 0, 4, 0, buffer->num_macroblocks
);
renderer->pipe->flush(renderer->pipe, PIPE_FLUSH_RENDER_CACHE, buffer->fence);
renderer->pipe->flush(renderer->pipe, PIPE_FLUSH_RENDER_CACHE, buffer->fence);
diff --git
a/src/gallium/auxiliary/vl/vl_vertex_buffers.c
b/src/gallium/auxiliary/vl/vl_vertex_buffers.c
index 552a0451fef084e3f0e6e330765937b3776efdc4..610f37e1f8947afdde2df628706717ee8a95b58d 100644
(file)
--- a/
src/gallium/auxiliary/vl/vl_vertex_buffers.c
+++ b/
src/gallium/auxiliary/vl/vl_vertex_buffers.c
@@
-106,7
+106,7
@@
vl_vb_element_helper(struct pipe_vertex_element* elements, unsigned num_elements
for ( i = 0; i < num_elements; ++i ) {
elements[i].src_offset = offset;
for ( i = 0; i < num_elements; ++i ) {
elements[i].src_offset = offset;
- elements[i].instance_divisor =
0
;
+ elements[i].instance_divisor =
1
;
elements[i].vertex_buffer_index = vertex_buffer_index;
offset += util_format_get_blocksize(elements[i].src_format);
}
elements[i].vertex_buffer_index = vertex_buffer_index;
offset += util_format_get_blocksize(elements[i].src_format);
}
diff --git
a/src/gallium/auxiliary/vl/vl_vertex_buffers.h
b/src/gallium/auxiliary/vl/vl_vertex_buffers.h
index b8e8766ec507d6ad08b2e3c133ae1b42018eb545..ca06abe202721730dc59c5b3f122f24986593bc3 100644
(file)
--- a/
src/gallium/auxiliary/vl/vl_vertex_buffers.h
+++ b/
src/gallium/auxiliary/vl/vl_vertex_buffers.h
@@
-57,16
+57,12
@@
static inline void
vl_vb_add_block(struct vl_vertex_buffer *buffer, void *elements)
{
void *pos;
vl_vb_add_block(struct vl_vertex_buffer *buffer, void *elements)
{
void *pos;
- unsigned i;
assert(buffer);
pos = buffer->vectors + buffer->num_verts * buffer->stride;
assert(buffer);
pos = buffer->vectors + buffer->num_verts * buffer->stride;
- for(i = 0; i < 4; ++i) {
- memcpy(pos, elements, buffer->stride);
- pos += buffer->stride;
- buffer->num_verts++;
- }
+ memcpy(pos, elements, buffer->stride);
+ buffer->num_verts++;
}
void vl_vb_unmap(struct vl_vertex_buffer *buffer, struct pipe_context *pipe);
}
void vl_vb_unmap(struct vl_vertex_buffer *buffer, struct pipe_context *pipe);