aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c6
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_main.c5
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 871cc50fb4c..e172dac40cb 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -751,6 +751,12 @@ static PIPE_THREAD_ROUTINE( thread_function, init_data )
struct lp_rasterizer_task *task = (struct lp_rasterizer_task *) init_data;
struct lp_rasterizer *rast = task->rast;
boolean debug = false;
+ unsigned fpstate = util_fpstate_get();
+
+ /* Make sure that denorms are treated like zeros. This is
+ * the behavior required by D3D10. OpenGL doesn't care.
+ */
+ util_fpstate_set_denorms_to_zero(fpstate);
while (1) {
/* wait for work */
diff --git a/src/gallium/drivers/llvmpipe/lp_test_main.c b/src/gallium/drivers/llvmpipe/lp_test_main.c
index 4c610923146..8a896becf53 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_main.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_main.c
@@ -370,6 +370,11 @@ int main(int argc, char **argv)
unsigned i;
boolean success;
boolean single = FALSE;
+ unsigned fpstate;
+
+ util_cpu_detect();
+ fpstate = util_fpstate_get();
+ util_fpstate_set_denorms_to_zero(fpstate);
for(i = 1; i < argc; ++i) {
if(strcmp(argv[i], "-v") == 0)