#include "st_draw.h"
#include "st_program.h"
#include "st_cb_bitmap.h"
+#include "st_cb_drawpixels.h"
#include "st_sampler_view.h"
#include "st_texture.h"
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_inlines.h"
-#include "util/u_simple_shaders.h"
#include "util/u_upload_mgr.h"
#include "program/prog_instruction.h"
#include "cso_cache/cso_context.h"
cso_set_fragment_shader_handle(cso, fpv->driver_shader);
/* vertex shader state: position + texcoord pass-through */
- cso_set_vertex_shader_handle(cso, st->bitmap.vs);
+ cso_set_vertex_shader_handle(cso, st->passthrough_vs);
/* disable other shaders */
cso_set_tessctrl_shader_handle(cso, NULL);
struct pipe_screen *screen = pipe->screen;
/* This function should only be called once */
- assert(st->bitmap.vs == NULL);
+ assert(!st->bitmap.tex_format);
assert(st->internal_target == PIPE_TEXTURE_2D ||
st->internal_target == PIPE_TEXTURE_RECT);
}
/* Create the vertex shader */
- {
- const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
- TGSI_SEMANTIC_COLOR,
- st->needs_texcoord_semantic ? TGSI_SEMANTIC_TEXCOORD :
- TGSI_SEMANTIC_GENERIC };
- const uint semantic_indexes[] = { 0, 0, 0 };
- st->bitmap.vs = util_make_vertex_passthrough_shader(st->pipe, 3,
- semantic_names,
- semantic_indexes,
- FALSE);
- }
+ st_make_passthrough_vertex_shader(st);
reset_cache(st);
}
st_invalidate_readpix_cache(st);
- if (!st->bitmap.vs) {
+ if (!st->bitmap.tex_format) {
init_bitmap_state(st);
}
struct pipe_vertex_buffer vb = {0};
unsigned i;
- if (!st->bitmap.vs) {
+ if (!st->bitmap.tex_format) {
init_bitmap_state(st);
}
struct pipe_context *pipe = st->pipe;
struct st_bitmap_cache *cache = &st->bitmap.cache;
- if (st->bitmap.vs) {
- cso_delete_vertex_shader(st->cso_context, st->bitmap.vs);
- st->bitmap.vs = NULL;
- }
-
if (cache->trans && cache->buffer) {
pipe_transfer_unmap(pipe, cache->trans);
}