Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8057711

D3DShaderGen.c needs some maintenance.



    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: tbd
    • Component/s: client-libs
    • Labels:
    • Subcomponent:


      https://bugs.openjdk.java.net/browse/JDK-8056209 noted that D3DShaderGen.c isn't used in
      the build. But it does contain essential D3D shader code and it is run manually to re-generate
      the shaders. It has a few issues

      it needs a little work as it is but even more to run as part of the build
      and even more to verify the results from the later shader compilers.

      1. The sprintf in the code has a hardwired path to fxc which is not likely to work.
      2) the sprintf seems to have incorrectly broken up the format string
      3) This was written to use Summer 2004 DX SDK shader compiler
       - Summer 2006 and later default to generating DX10 code.
       - you need to pass /LD to use DX9 and that option is not available with the fxc in the Windows SDK,
       - you need the unbundled DX SDK
       See :- http://msdn.microsoft.com/en-us/library/windows/desktop/bb509710%28v=vs.85%29.aspx


      Differences between Direct3D 9 and Direct3D 10:

      Beginning with the December 2006 SDK, the DirectX 10 HLSL compiler (Effect-Compiler Tool) (which includes many improvements in code generation) is the default compiler. For applications that want to continue to compile against the DirectX 9 compiler rules (fxc.exe), you may use fxc.exe with the /LD switch (this requires the D3DX9_31.DLL).

      /LDCompile using the DirectX 9 HLSL compiler. See the limitations in Compiling for Legacy Shader Models.

      Note Only supported by the legacy DirectX SDK version of FXC, not the Windows SDK version.


      This somewhat complicates running this as part of the build as to find the right fxc
      you need to set up paths which are NOT the ones generally used in the rest of the
      build which can happily use the headers and libs that are part of the Windows SDK.
      Its not sufficient to find 'any' fxc.exe. We'd need to check for one that accepts /Ld

      4) I am seeing byte[] of decimal integers output by the Summer 2010 DX SDK 10
      whereas we have hexadecimal DWORDs in the current version. So its not easy to
      say if the results are equivalent. I have not found how to do this. I saw /Lx option
      mentioned :-
      /Lx Output hexadecimal literals.

      Note This option requires the D3dcompiler_47.dll or a later version of the DLL.

      But that isn't recognised by the standalone DX SDK fxc.exe

      5) We need to insert the GPL +cp header on this file as part of the auto-generation.

      6) Potentially this tool could live somewhere else but it may need additional pointers
      generated into D3DShaders.h to point to where its kept.


          Issue Links



              Unassigned Unassigned
              prr Philip Race
              0 Vote for this issue
              2 Start watching this issue