[cmake-developers] [CMake 0014349]: Add hlsl compiler support to Visual Studio 2012

Mantis Bug Tracker mantis at public.kitware.com
Sun Aug 11 01:59:25 EDT 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14349 
====================================================================== 
Reported By:                Chad Vernon
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14349
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-08-11 01:59 EDT
Last Modified:              2013-08-11 01:59 EDT
====================================================================== 
Summary:                    Add hlsl compiler support to Visual Studio 2012
Description: 
Adding *.hlsl files to a Visual Studio 2012 project should activate the HLSL
compiler for those files.  We should also be able to specify the Shader Type of
each hlsl file.

Currently, the hlsl files are added like the following in the project:

<ItemGroup>
  <None Include="..\shaders\simplePS.hlsl" />
  <None Include="..\shaders\simpleVS.hlsl" />
</ItemGroup>

They need to be added like so:

<ItemGroup>
  <FxCompile Include="..\shaders\simplePS.hlsl" />
  <FxCompile Include="..\shaders\simpleVS.hlsl" />
</ItemGroup>

And ideally, we could specify the type of shader from the following choices:
Effect, Vertex, Pixel, Geometry, Hull, Domain, Compute, Texture.
This would create the following:

<FxCompile Include="..\shaders\simplePS.hlsl">
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Pixel</ShaderType>
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Pixel</ShaderType>
</FxCompile>
<FxCompile Include="..\shaders\simpleVS.hlsl">
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">Vertex</ShaderType>
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
  <ShaderType
Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">Vertex</ShaderType>
</FxCompile>


Steps to Reproduce: 
Just create a Win32 executable project with Visual Studio 2012 and add an
test.hlsl file to it.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-08-11 01:59 Chad Vernon    New Issue                                    
======================================================================




More information about the cmake-developers mailing list