#include "main/imports.h"
#include "main/image.h"
-#include "main/bufferobj.h"
-#include "main/drawtex.h"
#include "main/macros.h"
-#include "main/state.h"
-#include "main/texformat.h"
-#include "shader/program.h"
-#include "shader/prog_parameter.h"
-#include "shader/prog_print.h"
+#include "main/mfeatures.h"
+#include "program/program.h"
+#include "program/prog_print.h"
#include "st_context.h"
#include "st_atom.h"
-#include "st_atom_constbuf.h"
-#include "st_draw.h"
#include "st_cb_drawtex.h"
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
#include "pipe/p_shader_tokens.h"
-#include "util/u_tile.h"
#include "util/u_draw_quad.h"
#include "util/u_simple_shaders.h"
#include "cso_cache/cso_context.h"
+#if FEATURE_OES_draw_texture
+
+
struct cached_shader
{
- //struct pipe_shader_state shader;
void *handle;
uint num_attribs;
static GLuint NumCachedShaders = 0;
-#if FEATURE_OES_draw_texture
-
-
static void *
lookup_shader(struct pipe_context *pipe,
uint num_attribs,
}
static void
-st_DrawTex(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z,
+st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
GLfloat width, GLfloat height)
{
struct st_context *st = ctx->st;
/* create the vertex buffer */
vbuffer = pipe_buffer_create(pipe->screen, PIPE_BIND_VERTEX_BUFFER,
+ PIPE_USAGE_STREAM,
numAttribs * 4 * 4 * sizeof(GLfloat));
/* load vertex buffer */
}
}
- pipe_buffer_unmap(pipe, vbuffer, vbuffer_transfer);
+ pipe_buffer_unmap(pipe, vbuffer_transfer);
#undef SET_ATTRIB
}
cso_save_viewport(cso);
cso_save_vertex_shader(cso);
cso_save_vertex_elements(cso);
+ cso_save_vertex_buffers(cso);
{
void *vs = lookup_shader(pipe, numAttribs,
}
- util_draw_vertex_buffer(pipe, vbuffer,
+ util_draw_vertex_buffer(pipe, cso, vbuffer,
0, /* offset */
PIPE_PRIM_TRIANGLE_FAN,
4, /* verts */
cso_restore_viewport(cso);
cso_restore_vertex_shader(cso);
cso_restore_vertex_elements(cso);
+ cso_restore_vertex_buffers(cso);
}
-#endif /* FEATURE_OES_draw_texture */
-
-
void
st_init_drawtex_functions(struct dd_function_table *functions)
{
- _MESA_INIT_DRAWTEX_FUNCTIONS(functions, st_);
+ functions->DrawTex = st_DrawTex;
}
}
NumCachedShaders = 0;
}
+
+
+#endif /* FEATURE_OES_draw_texture */