summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-03-11 18:07:07 +0800
committerChia-I Wu <olv@lunarg.com>2010-03-11 23:31:11 +0800
commit9f5de23d0a73454b00236743d24326ec7b0d96f9 (patch)
tree8930e957508c2e990702f8ee9ff2d888d12a8d96 /src/mesa
parent4c5c442f127419d4ea780fbc60bf58f4ed17d71e (diff)
mesa/es: Fix GL_OES_draw_texture support.
st_DrawTex calls util_draw_vertex_buffer. Since ac4abaecd5f52e416c89bfe19b34ed7f4e014b21, the caller is expected to set vertex elements before calling.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/es/state_tracker/st_cb_drawtex.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/es/state_tracker/st_cb_drawtex.c b/src/mesa/es/state_tracker/st_cb_drawtex.c
index 0a5cba9d92..e4b8954991 100644
--- a/src/mesa/es/state_tracker/st_cb_drawtex.c
+++ b/src/mesa/es/state_tracker/st_cb_drawtex.c
@@ -120,6 +120,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
GLboolean emitColor;
uint semantic_names[2 + MAX_TEXTURE_UNITS];
uint semantic_indexes[2 + MAX_TEXTURE_UNITS];
+ struct pipe_vertex_element velements[2 + MAX_TEXTURE_UNITS];
GLbitfield inputs = VERT_BIT_POS;
/* determine if we need vertex color */
@@ -232,6 +233,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
cso_save_viewport(cso);
cso_save_vertex_shader(cso);
+ cso_save_vertex_elements(cso);
{
void *vs = lookup_shader(pipe, numAttribs,
@@ -239,6 +241,14 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
cso_set_vertex_shader_handle(cso, vs);
}
+ for (i = 0; i < numAttribs; i++) {
+ velements[i].src_offset = i * 4 * sizeof(float);
+ velements[i].instance_divisor = 0;
+ velements[i].vertex_buffer_index = 0;
+ velements[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ }
+ cso_set_vertex_elements(cso, numAttribs, velements);
+
/* viewport state: viewport matching window dims */
{
const struct gl_framebuffer *fb = st->ctx->DrawBuffer;
@@ -270,6 +280,7 @@ st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
/* restore state */
cso_restore_viewport(cso);
cso_restore_vertex_shader(cso);
+ cso_restore_vertex_elements(cso);
}