struct r300_textures_state *texstate = r300->textures_state.state;
unsigned i;
+ state->alpha_to_one = r300->alpha_to_one && r300->msaa_enable;
+
for (i = 0; i < texstate->sampler_state_count; i++) {
struct r300_sampler_state *s = texstate->sampler_states[i];
struct r300_sampler_view *v = texstate->sampler_views[i];
}
state->unit[i].non_normalized_coords = !s->state.normalized_coords;
- state->unit[i].convert_unorm_to_snorm =
- v->base.format == PIPE_FORMAT_RGTC1_SNORM ||
- v->base.format == PIPE_FORMAT_LATC1_SNORM;
/* Pass texture swizzling to the compiler, some lowering passes need it. */
- if (v->base.format == PIPE_FORMAT_RGTC1_SNORM ||
- v->base.format == PIPE_FORMAT_LATC1_SNORM) {
- unsigned char swizzle[4];
-
- util_format_compose_swizzles(
- util_format_description(v->base.format)->swizzle,
- v->swizzle,
- swizzle);
-
- state->unit[i].texture_swizzle =
- RC_MAKE_SWIZZLE(swizzle[0], swizzle[1],
- swizzle[2], swizzle[3]);
- } else if (state->unit[i].compare_mode_enabled) {
+ if (state->unit[i].compare_mode_enabled) {
state->unit[i].texture_swizzle =
RC_MAKE_SWIZZLE(v->swizzle[0], v->swizzle[1],
v->swizzle[2], v->swizzle[3]);
state->unit[i].wrap_mode = RC_WRAP_NONE;
}
- if (t->b.b.b.target == PIPE_TEXTURE_3D)
+ if (t->b.b.target == PIPE_TEXTURE_3D)
state->unit[i].clamp_and_scale_before_fetch = TRUE;
}
}
/* Setup the compiler. */
memset(&compiler, 0, sizeof(compiler));
- rc_init(&compiler.Base);
+ rc_init(&compiler.Base, &r300->fs_regalloc_state);
DBG_ON(r300, DBG_FP) ? compiler.Base.Debug |= RC_DBG_LOG : 0;
DBG_ON(r300, DBG_P_STAT) ? compiler.Base.Debug |= RC_DBG_STATS : 0;
find_output_registers(&compiler, shader);
- shader->write_all = FALSE;
- for (i = 0; i < shader->info.num_properties; i++) {
- if (shader->info.properties[i].name == TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS) {
- shader->write_all = TRUE;
- }
- }
+ shader->write_all =
+ shader->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS];
if (compiler.Base.Debug & RC_DBG_LOG) {
DBG(r300, DBG_FP, "r300: Initial fragment program\n");
boolean r300_pick_fragment_shader(struct r300_context* r300)
{
struct r300_fragment_shader* fs = r300_fs(r300);
- struct r300_fragment_program_external_state state = {{{ 0 }}};
+ struct r300_fragment_program_external_state state;
struct r300_fragment_shader_code* ptr;
+ memset(&state, 0, sizeof(state));
get_external_state(r300, &state);
if (!fs->first) {