exa->num_bound_samplers = 0;
+#if 0
+ if ((pSrc && (exa->pipe->is_texture_referenced(exa->pipe, pSrc->tex, 0, 0) &
+ PIPE_REFERENCED_FOR_WRITE)) ||
+ (pMask && (exa->pipe->is_texture_referenced(exa->pipe, pMask->tex, 0, 0) &
+ PIPE_REFERENCED_FOR_WRITE)))
+ xorg_exa_flush(exa, PIPE_FLUSH_RENDER_CACHE, NULL);
+#endif
+
memset(&src_sampler, 0, sizeof(struct pipe_sampler_state));
memset(&mask_sampler, 0, sizeof(struct pipe_sampler_state));
if (exa->transform.has_mask)
mask_matrix = exa->transform.mask;
-#if 1
+#if 0
renderer_draw_textures(exa->renderer,
pos, width, height,
exa->bound_textures,
#define floatsEqual(x, y) (fabs(x - y) <= 0.00001f * MIN2(fabs(x), fabs(y)))
#define floatIsZero(x) (floatsEqual((x) + 1, 1))
+#define NUM_COMPONENTS 4
+
static INLINE boolean is_affine(float *matrix)
{
return floatIsZero(matrix[2]) && floatIsZero(matrix[5])
{
struct pipe_context *pipe = r->pipe;
struct pipe_buffer *buf = 0;
+ int num_verts = r->num_vertices/(r->num_attributes * NUM_COMPONENTS);
if (!r->num_vertices)
return;
if (buf) {
util_draw_vertex_buffer(pipe, buf, 0,
PIPE_PRIM_QUADS,
- 4, /* verts */
+ num_verts, /* verts */
r->num_attributes); /* attribs/vert */
pipe_buffer_reference(&buf, NULL);
int next_batch)
{
if (r->num_vertices + next_batch >= BUF_SIZE ||
- (next_batch == 0 && r->num_vertices))
+ (next_batch == 0 && r->num_vertices)) {
renderer_draw(r);
+ }
}
static void
int num_textures)
{
r->num_attributes = 1 + num_textures;
+ r->num_vertices = 0;
}
void renderer_texture(struct xorg_renderer *r,
* max number of attributes per vertex *
* max number of components per attribute
*
- * currently the max is 5 quads
+ * currently the max is 100 quads
*/
-#define BUF_SIZE (20 * 3 * 4)
+#define BUF_SIZE (100 * 4 * 3 * 4)
struct xorg_renderer {
struct pipe_context *pipe;