summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_fs.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-04-14 02:33:17 +0200
committerMarek Olšák <maraeo@gmail.com>2010-04-14 04:48:19 +0200
commit6793506faa13c259b1f36fb4cbe21841f851e248 (patch)
tree862b71a07c411e82dc5a2cf71511c8c489943527 /src/gallium/drivers/r300/r300_fs.c
parent075d9698eda4e8728872ffa1648f02d8d2748857 (diff)
downloadexternal_mesa3d-6793506faa13c259b1f36fb4cbe21841f851e248.zip
external_mesa3d-6793506faa13c259b1f36fb4cbe21841f851e248.tar.gz
external_mesa3d-6793506faa13c259b1f36fb4cbe21841f851e248.tar.bz2
r300g: make setting up fragment depth output less hackish
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 f75d282..8da0796 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);
}