From 398f7b9536d5a7fbc4236088d59407d79830d428 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 9 May 2012 09:26:35 +0100 Subject: [PATCH 1/1] Put HLSL shaders into their own directory. --- apps/CMakeLists.txt | 4 ++++ apps/d3d10/CMakeLists.txt | 1 + apps/d3d11/CMakeLists.txt | 2 +- apps/hlsl/CMakeLists.txt | 13 +++++++++++++ apps/{d3d10 => hlsl}/tri.fx | 0 apps/{d3d10 => hlsl}/tri_ps.h | 0 apps/{d3d10 => hlsl}/tri_vs.h | 0 7 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 apps/hlsl/CMakeLists.txt rename apps/{d3d10 => hlsl}/tri.fx (100%) rename apps/{d3d10 => hlsl}/tri_ps.h (100%) rename apps/{d3d10 => hlsl}/tri_vs.h (100%) diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index b622505..6412f68 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -32,6 +32,10 @@ if (EGL_FOUND) add_subdirectory (egl) endif () +if (DirectX_FXC_EXECUTABLE) + add_subdirectory (hlsl) +endif () + if (DirectX_D3D11_FOUND) add_subdirectory (d3d11) endif () diff --git a/apps/d3d10/CMakeLists.txt b/apps/d3d10/CMakeLists.txt index 3664f5f..a9da968 100644 --- a/apps/d3d10/CMakeLists.txt +++ b/apps/d3d10/CMakeLists.txt @@ -1,4 +1,5 @@ include_directories ( + ${CMAKE_CURRENT_SOURCE_DIR}/../hlsl ${APITRACE_SOURCE_DIR}/dispatch ${DirectX_D3D10_INCLUDE_DIR} ) diff --git a/apps/d3d11/CMakeLists.txt b/apps/d3d11/CMakeLists.txt index 5517cd4..91c3c78 100644 --- a/apps/d3d11/CMakeLists.txt +++ b/apps/d3d11/CMakeLists.txt @@ -1,5 +1,5 @@ include_directories ( - ${CMAKE_CURRENT_SOURCE_DIR}/../d3d10 + ${CMAKE_CURRENT_SOURCE_DIR}/../hlsl ${APITRACE_SOURCE_DIR}/dispatch ${DirectX_D3D11_INCLUDE_DIR} ) diff --git a/apps/hlsl/CMakeLists.txt b/apps/hlsl/CMakeLists.txt new file mode 100644 index 0000000..2bf14fe --- /dev/null +++ b/apps/hlsl/CMakeLists.txt @@ -0,0 +1,13 @@ +add_custom_command ( + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tri_vs.h + COMMAND ${DirectX_FXC_EXECUTABLE} /nologo /T vs_4_0 /E VS /Fh ${CMAKE_CURRENT_SOURCE_DIR}/tri_vs.h ${CMAKE_CURRENT_SOURCE_DIR}/tri.fx + DEPENDS tri.fx +) + +add_custom_command ( + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/tri_ps.h + COMMAND ${DirectX_FXC_EXECUTABLE} /nologo /T ps_4_0 /E PS /Fh ${CMAKE_CURRENT_SOURCE_DIR}/tri_ps.h ${CMAKE_CURRENT_SOURCE_DIR}/tri.fx + DEPENDS tri.fx +) + +add_custom_target (hlsl DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/tri_vs.h ${CMAKE_CURRENT_SOURCE_DIR}/tri_ps.h) diff --git a/apps/d3d10/tri.fx b/apps/hlsl/tri.fx similarity index 100% rename from apps/d3d10/tri.fx rename to apps/hlsl/tri.fx diff --git a/apps/d3d10/tri_ps.h b/apps/hlsl/tri_ps.h similarity index 100% rename from apps/d3d10/tri_ps.h rename to apps/hlsl/tri_ps.h diff --git a/apps/d3d10/tri_vs.h b/apps/hlsl/tri_vs.h similarity index 100% rename from apps/d3d10/tri_vs.h rename to apps/hlsl/tri_vs.h -- 2.43.0