changeset 5053:d411893f2d5e

Fix to RT-32879: D3D: Prism shouldn't set D3DRS_CLIPPING to false Reviewed-by: kcr
author Chien Yang <chien.yang@orcale.com>
date Wed, 11 Sep 2013 16:29:16 -0700
parents c52636b4d2ee
children 7a302d988f83
files modules/graphics/src/main/native-prism-d3d/D3DContext.cc
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/native-prism-d3d/D3DContext.cc	Wed Sep 11 16:17:08 2013 -0700
+++ b/modules/graphics/src/main/native-prism-d3d/D3DContext.cc	Wed Sep 11 16:29:16 2013 -0700
@@ -504,8 +504,7 @@
         //       invalidated on the Java side.
         SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE)) &&
         SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID)) &&
-        SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE)) &&
-        SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_CLIPPING, FALSE));
+        SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE));
     }
     return res;
 }
@@ -555,7 +554,6 @@
         SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE)) &&
         SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE)) &&
         SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_LIGHTING, TRUE)) &&
-        SUCCEEDED(res = pd3dDevice->SetRenderState(D3DRS_CLIPPING, TRUE)) &&
         // Set texture unit 0 to its default texture addressing mode for Prism
         SUCCEEDED(res = pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP)) &&
         SUCCEEDED(res = pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP));
@@ -598,12 +596,14 @@
     // disable some of the unneeded and costly d3d functionality
     pd3dDevice->SetRenderState(D3DRS_SPECULARENABLE, FALSE);
     pd3dDevice->SetRenderState(D3DRS_LIGHTING,  FALSE);
-    pd3dDevice->SetRenderState(D3DRS_CLIPPING,  FALSE);
     pd3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
     pd3dDevice->SetRenderState(D3DRS_ZWRITEENABLE, D3DZB_FALSE);
     pd3dDevice->SetRenderState(D3DRS_COLORVERTEX, FALSE);
     pd3dDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
 
+    // set clipping to true inorder support near and far clipping
+    pd3dDevice->SetRenderState(D3DRS_CLIPPING,  TRUE);
+
     // set the default texture addressing mode
     pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
     pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);