• Advertisement
Sign in to follow this  

How to convert HLSL/CG to GPU ASM ?

This topic is 2627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all ,

Which tools are used to do this ?

I guess it is cgc.exe coming with CG Toolkit and fxc.exe for HLSL coming with DX SDK but i could not figure out the parameters

any help will be appreciated

Share this post


Link to post
Share on other sites
Advertisement
To be clear, there's no such thing as "GPU ASM". Direct3D has an intermediate "shader assembly" that's still the compilation target fro HLSL shaders. However the "ARB_vertex_program/ARB_fragment_program" program stuff is from back before GLSL, and thus doesn't have a modern feature set. Cg can be compiled to Nvidia's extended assembly set, but it's an Nvidia-only extension. Otherwise you have to cross-compile to GLSL. GLSL doesn't support any type of intermediate assembly language, you have to compile at runtime. The two notable exceptions to this is the new ARB_get_program_binary extension (which lets you save off a compiled shader in an opaque binary format that can only be loaded on the same GPU/driver combo) and the optional glShaderBinary for OpenGL ES (which has the same restrictions).

Anyway I'm not familiar enough with the CG toolkit to help you with that one, but fxc is really easy. At minimum you need to specify the shader profile (ps_2_0, vs_3_0, etc.) with the "/T" switch, the shader entry point function with "/E", and the name of the file containing the shader.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement