summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300/r300_fs.c')
-rw-r--r--src/gallium/drivers/r300/r300_fs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/r300/r300_fs.c b/src/gallium/drivers/r300/r300_fs.c
index f75d282205e..8da0796e70f 100644
--- a/src/gallium/drivers/r300/r300_fs.c
+++ b/src/gallium/drivers/r300/r300_fs.c
@@ -31,6 +31,7 @@
#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"
@@ -298,6 +299,15 @@ static void r300_translate_fragment_shader(
}
}
+ /* 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);
}