#include "r300_reg.h"
#include "r300_screen.h"
#include "r300_screen_buffer.h"
+#include "r300_state.h"
#include "r300_state_inlines.h"
#include "r300_fs.h"
#include "r300_texture.h"
return (void*)fs;
}
-static void r300_mark_fs_code_dirty(struct r300_context *r300)
+void r300_mark_fs_code_dirty(struct r300_context *r300)
{
struct r300_fragment_shader* fs = r300_fs(r300);
state->sampler_state_count = count;
r300->textures_state.dirty = TRUE;
-
- /* Pick a fragment shader based on the texture compare state. */
- if (r300->fs.state && count) {
- if (r300_pick_fragment_shader(r300)) {
- r300_mark_fs_code_dirty(r300);
- }
- }
}
static void r300_lacks_vertex_textures(struct pipe_context* pipe,
struct r300_texture *texture;
unsigned i;
unsigned tex_units = r300->screen->caps.num_tex_units;
- boolean is_r500 = r300->screen->caps.is_r500;
boolean dirty_tex = FALSE;
if (count > tex_units) {
/* A new sampler view (= texture)... */
dirty_tex = TRUE;
- /* R300-specific - set the texrect factor in the fragment shader */
+ /* Set the texrect factor in the fragment shader.
+ * Needed for RECT and NPOT fallback. */
texture = r300_texture(views[i]->texture);
- if (!is_r500 && texture->uses_pitch) {
+ if (texture->uses_pitch) {
r300->fs_rc_constant_state.dirty = TRUE;
}
}
#include "r300_fs.h"
#include "r300_screen.h"
#include "r300_shader_semantics.h"
+#include "r300_state.h"
#include "r300_state_derived.h"
#include "r300_state_inlines.h"
#include "r300_vs.h"
}
r300->textures_state.size = size;
+
+ /* Pick a fragment shader based on either the texture compare state
+ * or the uses_pitch flag. */
+ if (r300->fs.state && count) {
+ if (r300_pick_fragment_shader(r300)) {
+ r300_mark_fs_code_dirty(r300);
+ }
+ }
}
void r300_update_derived_state(struct r300_context* r300)
{
- if (r300->rs_block_state.dirty) {
- r300_update_derived_shader_state(r300);
- }
-
if (r300->textures_state.dirty) {
r300_merge_textures_and_samplers(r300);
}
+ if (r300->rs_block_state.dirty) {
+ r300_update_derived_shader_state(r300);
+ }
+
if (r300->draw) {
memset(&r300->vertex_info, 0, sizeof(struct vertex_info));
r300_draw_emit_all_attribs(r300);