llvmpipe: Ensure FTZ/DAZ flags are set on deferred draw flushes.
authorZack Rusin <zackr@vmware.com>
Mon, 22 Jul 2013 17:08:48 +0000 (18:08 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 22 Jul 2013 17:11:39 +0000 (18:11 +0100)
Tested-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_rast.c

index 772c9d7c681cc06684898fa2ae5751c97fc0961e..49cdbfeff8e6df32386c544f4dd1a56742d3ce74 100644 (file)
@@ -697,6 +697,12 @@ lp_rast_queue_scene( struct lp_rasterizer *rast,
 
    if (rast->num_threads == 0) {
       /* no threading */
+      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);
 
       lp_rast_begin( rast, scene );
 
@@ -704,6 +710,8 @@ lp_rast_queue_scene( struct lp_rasterizer *rast,
 
       lp_rast_end( rast );
 
+      util_fpstate_set(fpstate);
+
       rast->curr_scene = NULL;
    }
    else {