X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fr300_fs.c;h=ae4c62b2f1d830ad4cd1feb4c1f51387c345ce19;hb=ca0e88ce9298516087825758dd97dd0636d9f19c;hp=60ea9c171d5d9eef7090986dcf8080ce4fb1d8f7;hpb=7b5ad23c7f7f9016f725cb1caa3cf8971aeedbc8;p=mesa.git diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c index 60ea9c171d5..ae4c62b2f1d 100644 --- a/src/gallium/drivers/r300/r300_fs.c +++ b/src/gallium/drivers/r300/r300_fs.c @@ -49,12 +49,12 @@ void r300_shader_read_fs_inputs(struct tgsi_shader_info* info, switch (info->input_semantic_name[i]) { case TGSI_SEMANTIC_COLOR: - assert(index <= ATTR_COLOR_COUNT); + assert(index < ATTR_COLOR_COUNT); fs_inputs->color[index] = i; break; case TGSI_SEMANTIC_GENERIC: - assert(index <= ATTR_GENERIC_COUNT); + assert(index < ATTR_GENERIC_COUNT); fs_inputs->generic[index] = i; break; @@ -77,17 +77,21 @@ void r300_shader_read_fs_inputs(struct tgsi_shader_info* info, static void find_output_registers(struct r300_fragment_program_compiler * compiler, struct r300_fragment_shader * fs) { - unsigned i; + unsigned i, colorbuf_count = 0; /* Mark the outputs as not present initially */ - compiler->OutputColor = fs->info.num_outputs; + compiler->OutputColor[0] = fs->info.num_outputs; + compiler->OutputColor[1] = fs->info.num_outputs; + compiler->OutputColor[2] = fs->info.num_outputs; + compiler->OutputColor[3] = fs->info.num_outputs; compiler->OutputDepth = fs->info.num_outputs; /* Now see where they really are. */ for(i = 0; i < fs->info.num_outputs; ++i) { switch(fs->info.output_semantic_name[i]) { case TGSI_SEMANTIC_COLOR: - compiler->OutputColor = i; + compiler->OutputColor[colorbuf_count] = i; + colorbuf_count++; break; case TGSI_SEMANTIC_POSITION: compiler->OutputDepth = i; @@ -175,6 +179,7 @@ static void r300_translate_fragment_shader( /* Translate TGSI to our internal representation */ ttr.compiler = &compiler.Base; ttr.info = &fs->info; + ttr.use_half_swizzles = TRUE; r300_tgsi_to_rc(&ttr, fs->state.tokens);