summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util/u_draw_quad.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-01-09 09:25:56 +0100
committerMarek Olšák <[email protected]>2011-02-14 21:50:07 +0100
commitd5062fb3a315c46d77d5c954a3e3c14be1907d33 (patch)
tree8cac3fad112fd32e6f37c1ae75b2e726d224e1f9 /src/gallium/auxiliary/util/u_draw_quad.c
parentcfaf217135d8a8e903b3fbf380f18170df018f0c (diff)
gallium: always save and restore vertex buffers using cso_cache
Diffstat (limited to 'src/gallium/auxiliary/util/u_draw_quad.c')
-rw-r--r--src/gallium/auxiliary/util/u_draw_quad.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/util/u_draw_quad.c b/src/gallium/auxiliary/util/u_draw_quad.c
index 0b6dc5880f3..2747cd4b0c1 100644
--- a/src/gallium/auxiliary/util/u_draw_quad.c
+++ b/src/gallium/auxiliary/util/u_draw_quad.c
@@ -31,6 +31,7 @@
#include "util/u_inlines.h"
#include "util/u_draw_quad.h"
#include "util/u_memory.h"
+#include "cso_cache/cso_context.h"
/**
@@ -39,6 +40,7 @@
*/
void
util_draw_vertex_buffer(struct pipe_context *pipe,
+ struct cso_context *cso,
struct pipe_resource *vbuf,
uint offset,
uint prim_type,
@@ -55,7 +57,12 @@ util_draw_vertex_buffer(struct pipe_context *pipe,
vbuffer.stride = num_attribs * 4 * sizeof(float); /* vertex size */
vbuffer.buffer_offset = offset;
vbuffer.max_index = num_verts - 1;
- pipe->set_vertex_buffers(pipe, 1, &vbuffer);
+
+ if (cso) {
+ cso_set_vertex_buffers(cso, 1, &vbuffer);
+ } else {
+ pipe->set_vertex_buffers(pipe, 1, &vbuffer);
+ }
/* note: vertex elements already set by caller */
@@ -70,7 +77,7 @@ util_draw_vertex_buffer(struct pipe_context *pipe,
* Note: this isn't especially efficient.
*/
void
-util_draw_texquad(struct pipe_context *pipe,
+util_draw_texquad(struct pipe_context *pipe, struct cso_context *cso,
float x0, float y0, float x1, float y1, float z)
{
uint numAttribs = 2, i, j;
@@ -118,7 +125,7 @@ util_draw_texquad(struct pipe_context *pipe,
if (!vbuf)
goto out;
- util_draw_vertex_buffer(pipe, vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, 2);
+ util_draw_vertex_buffer(pipe, cso, vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, 2);
out:
if (vbuf)