Browse Source

mesa/es: Fixes for gallium-resources.

gallium-resources
Chia-I Wu 15 years ago
parent
commit
49ec01dffb
1 changed files with 8 additions and 6 deletions
  1. 8
    6
      src/mesa/es/state_tracker/st_cb_drawtex.c

+ 8
- 6
src/mesa/es/state_tracker/st_cb_drawtex.c View File

struct st_context *st = ctx->st; struct st_context *st = ctx->st;
struct pipe_context *pipe = st->pipe; struct pipe_context *pipe = st->pipe;
struct cso_context *cso = ctx->st->cso_context; struct cso_context *cso = ctx->st->cso_context;
struct pipe_buffer *vbuffer;
struct pipe_resource *vbuffer;
struct pipe_transfer *vbuffer_transfer;
GLuint i, numTexCoords, numAttribs; GLuint i, numTexCoords, numAttribs;
GLboolean emitColor; GLboolean emitColor;
uint semantic_names[2 + MAX_TEXTURE_UNITS]; uint semantic_names[2 + MAX_TEXTURE_UNITS];




/* create the vertex buffer */ /* create the vertex buffer */
vbuffer = pipe_buffer_create(pipe->screen, 32, PIPE_BUFFER_USAGE_VERTEX,
vbuffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER,
numAttribs * 4 * 4 * sizeof(GLfloat)); numAttribs * 4 * 4 * sizeof(GLfloat));


/* load vertex buffer */ /* load vertex buffer */
} while (0) } while (0)


const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height; const GLfloat x0 = x, y0 = y, x1 = x + width, y1 = y + height;
GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe->screen, vbuffer,
PIPE_BUFFER_USAGE_CPU_WRITE);
GLfloat *vbuf = (GLfloat *) pipe_buffer_map(pipe, vbuffer,
PIPE_TRANSFER_WRITE,
&vbuffer_transfer);
GLuint attr; GLuint attr;
z = CLAMP(z, 0.0f, 1.0f); z = CLAMP(z, 0.0f, 1.0f);
} }
} }


pipe_buffer_unmap(pipe->screen, vbuffer);
pipe_buffer_unmap(pipe, vbuffer, vbuffer_transfer);


#undef SET_ATTRIB #undef SET_ATTRIB
} }
numAttribs); /* attribs/vert */ numAttribs); /* attribs/vert */




pipe_buffer_reference(&vbuffer, NULL);
pipe_resource_reference(&vbuffer, NULL);


/* restore state */ /* restore state */
cso_restore_viewport(cso); cso_restore_viewport(cso);

Loading…
Cancel
Save