X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fr300_fs.c;h=c00f55f5d903d89a4f9d1b34f76a406a33bd239a;hb=a38e8de643fac4990d666cea3da895f9120b9e28;hp=e3a1bc4a0f4e7b8894d7a7e4ecce276ccc7cd918;hpb=fa31b1095eeea97695125ad5770239805bed37da;p=mesa.git diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index e3a1bc4a0f4..c00f55f5d90 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -38,8 +38,7 @@ #include "r300_texture.h" #include "r300_tgsi_to_rc.h" -#include "radeon_code.h" -#include "radeon_compiler.h" +#include "compiler/radeon_compiler.h" /* Convert info about FS input semantics to r300_shader_semantics. */ void r300_shader_read_fs_inputs(struct tgsi_shader_info* info, @@ -148,10 +147,9 @@ static void get_external_state( struct r300_fragment_program_external_state* state) { struct r300_textures_state *texstate = r300->textures_state.state; - struct r300_rs_state *rs = r300->rs_state.state; unsigned i; - state->frag_clamp = rs ? rs->rs.clamp_fragment_color : 0; + 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]; @@ -181,9 +179,10 @@ static void get_external_state( v->base.format == PIPE_FORMAT_LATC1_SNORM) { unsigned char swizzle[4]; - util_format_combine_swizzles(swizzle, + util_format_compose_swizzles( util_format_description(v->base.format)->swizzle, - v->swizzle); + v->swizzle, + swizzle); state->unit[i].texture_swizzle = RC_MAKE_SWIZZLE(swizzle[0], swizzle[1], @@ -215,7 +214,7 @@ static void get_external_state( 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; } } @@ -445,7 +444,7 @@ static void r300_translate_fragment_shader( /* 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; @@ -456,6 +455,7 @@ static void r300_translate_fragment_shader( compiler.Base.disable_optimizations = DBG_ON(r300, DBG_NO_OPT); compiler.Base.has_half_swizzles = TRUE; compiler.Base.has_presub = TRUE; + compiler.Base.has_omod = TRUE; compiler.Base.max_temp_regs = compiler.Base.is_r500 ? 128 : (compiler.Base.is_r400 ? 64 : 32); compiler.Base.max_constants = compiler.Base.is_r500 ? 256 : 32; @@ -468,12 +468,8 @@ static void r300_translate_fragment_shader( 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");