R300_INIT_ATOM(vertex_format_state, 26);
R300_INIT_ATOM(pvs_flush, 2);
R300_INIT_ATOM(vs_state, 1031);
+ R300_INIT_ATOM(texture_cache_inval, 2);
/* Some non-CSO atoms need explicit space to store the state locally. */
r300->blend_color_state.state = CALLOC_STRUCT(r300_blend_color_state);
struct r300_atom ztop_state;
/* PVS flush. */
struct r300_atom pvs_flush;
+ /* Texture cache invalidate. */
+ struct r300_atom texture_cache_inval;
/* Invariant state. This must be emitted to get the engine started. */
struct r300_atom invariant_state;
END_CS;
}
-void r300_flush_textures(struct r300_context* r300)
+void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, void* state)
{
CS_LOCALS(r300);
struct r300_screen* r300screen = r300_screen(r300->context.screen);
struct r300_atom* atom;
unsigned i;
- int dirty_tex = 0;
if (r300->dirty_state & R300_NEW_QUERY) {
r300_emit_query_start(r300);
r300->sampler_states[i],
r300->textures[i],
i);
- dirty_tex |= r300->dirty_state & (R300_NEW_TEXTURE << i);
}
r300->dirty_state &=
~((R300_NEW_SAMPLER << i) | (R300_NEW_TEXTURE << i));
r300->dirty_state &= ~(R300_ANY_NEW_SAMPLERS | R300_ANY_NEW_TEXTURES);
}
- if (dirty_tex) {
- r300_flush_textures(r300);
- }
-
if (r300->dirty_state & R300_NEW_VERTEX_SHADER_CONSTANTS) {
struct r300_vertex_shader* vs = r300->vs_state.state;
r300_emit_vs_constant_buffer(r300, &vs->code.constants);
void r300_emit_pvs_flush(struct r300_context* r300, unsigned size, void* state);
-void r300_flush_textures(struct r300_context* r300);
+void r300_emit_texture_cache_inval(struct r300_context* r300, unsigned size, void* state);
unsigned r300_get_num_dirty_dwords(struct r300_context *r300);
{
struct r300_context* r300 = r300_context(pipe);
boolean is_r500 = r300_screen(r300->context.screen)->caps->is_r500;
+ boolean dirty_tex = FALSE;
int i;
/* XXX magic num */
pipe_texture_reference((struct pipe_texture**)&r300->textures[i],
texture[i]);
r300->dirty_state |= (R300_NEW_TEXTURE << i);
+ dirty_tex = TRUE;
/* R300-specific - set the texrect factor in a fragment shader */
if (!is_r500 && r300->textures[i]->is_npot) {
}
r300->texture_count = count;
+
+ if (dirty_tex) {
+ r300->texture_cache_inval.dirty = TRUE;
+ }
}
static void r300_set_scissor_state(struct pipe_context* pipe,