JDK-8092272 : [D3D 3D] Need a robust 3D states management for texture
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2013-11-20
  • Updated: 2024-01-26
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Description
The current 3D states management for texture is quite problematic. The texture states in set at the beginning for the 2D to 3D state switch. It is better to follow the approach of es2 pipe where the texture states is set when a texture object is used.


See D3DContext.cc : 
setDeviceParametersFor3D()  {
...
        // Set texture unit 0 to its default texture addressing mode for Prism
        SUCCEEDED(res = pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP)) &&
        SUCCEEDED(res = pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP)) &&
        // Set texture filter to bilinear for 3D rendering
        SUCCEEDED(res = pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR)) &&
        SUCCEEDED(res = pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR));
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1281 Date: 2023-11-08 22:30:34 +0000
08-11-2023

Need to make sure the fix doesn't regress those old bugs.
21-11-2013

Yes, there were 3 bugs (RT-31110, RT-32721, RT-29527) fixed relying on the 4 lines of code. The problem is partly due to prism d3d does texture mostly in the native and d3d handle texture state differently than opengl. We need to cache the states and set it if necessary each time we use the texture.
21-11-2013

Chien, is there a bug that happens because of this pattern in D3D?
21-11-2013