diff options
author | Chia-I Wu <[email protected]> | 2010-03-11 18:07:07 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-03-11 23:31:11 +0800 |
commit | 9f5de23d0a73454b00236743d24326ec7b0d96f9 (patch) | |
tree | 8930e957508c2e990702f8ee9ff2d888d12a8d96 | |
parent | 4c5c442f127419d4ea780fbc60bf58f4ed17d71e (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.
-rw-r--r-- | src/mesa/es/state_tracker/st_cb_drawtex.c | 11 |
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 0a5cba9d927..e4b89549917 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); } |