return float24;
}
-static void r300_emit_fragment_depth_config(struct r300_context* r300)
-{
- CS_LOCALS(r300);
- if (r300_fragment_shader_writes_depth(r300_fs(r300))) {
- OUT_CS_REG(R300_FG_DEPTH_SRC, R300_FG_DEPTH_SRC_SHADER);
- OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W24 | R300_W_SRC_US);
- } else {
- OUT_CS_REG(R300_FG_DEPTH_SRC, R300_FG_DEPTH_SRC_SCAN);
- OUT_CS_REG(R300_US_W_FMT, R300_W_FMT_W0 | R300_W_SRC_US);
- }
-}
-
unsigned r300_get_fs_atom_size(struct r300_context *r300)
{
struct r300_fragment_shader *fs = r300_fs(r300);
}
}
- r300_emit_fragment_depth_config(r300);
- cs_count -= 4;
+ OUT_CS_REG(R300_FG_DEPTH_SRC, fs->shader->fg_depth_src);
+ OUT_CS_REG(R300_US_W_FMT, fs->shader->us_out_w);
END_CS;
}
}
}
- r300_emit_fragment_depth_config(r300);
- cs_count -= 4;
+ OUT_CS_REG(R300_FG_DEPTH_SRC, fs->shader->fg_depth_src);
+ OUT_CS_REG(R300_US_W_FMT, fs->shader->us_out_w);
END_CS;
}
#include "r300_context.h"
#include "r300_screen.h"
#include "r300_fs.h"
+#include "r300_reg.h"
#include "r300_tgsi_to_rc.h"
#include "radeon_code.h"
}
}
+ /* Setup shader depth output. */
+ if (shader->code.writes_depth) {
+ shader->fg_depth_src = R300_FG_DEPTH_SRC_SHADER;
+ shader->us_out_w = R300_W_FMT_W24 | R300_W_SRC_US;
+ } else {
+ shader->fg_depth_src = R300_FG_DEPTH_SRC_SCAN;
+ shader->us_out_w = R300_W_FMT_W0 | R300_W_SRC_US;
+ }
+
/* And, finally... */
rc_destroy(&compiler.Base);
}
unsigned immediates_count;
unsigned rc_state_count;
+ /* Registers for fragment depth output setup. */
+ uint32_t fg_depth_src; /* R300_FG_DEPTH_SRC: 0x4bd8 */
+ uint32_t us_out_w; /* R300_US_W_FMT: 0x46b4 */
+
struct r300_fragment_program_external_state compare_state;
struct rX00_fragment_program_code code;