From 83d8d02b64b4327bf330443ffd28ed5a96d284a1 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 12 Jul 2023 10:00:25 -0500 Subject: [PATCH 1/3] Fix runtime shaders path for cross-compile case --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 907f057b..fdd87127 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,7 +120,7 @@ endfunction(buildExamples) if(RESOURCE_INSTALL_DIR) add_definitions(-DVK_EXAMPLE_ASSETS_DIR=\"${RESOURCE_INSTALL_DIR}/\") - add_definitions(-DVK_EXAMPLE_SHADERS_DIR=\"${RESOURCE_INSTALL_DIR}/\") + add_definitions(-DVK_EXAMPLE_SHADERS_DIR=\"${RESOURCE_INSTALL_DIR}/shaders/\") install(DIRECTORY assets/ DESTINATION ${RESOURCE_INSTALL_DIR}/assets/) install(DIRECTORY shaders/ DESTINATION ${RESOURCE_INSTALL_DIR}/shaders/) else() From a0ef2fcea62ac26e8cf4301ff80bbeea004d7e83 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 12 Jul 2023 10:00:34 -0500 Subject: [PATCH 2/3] Fix shaders path for computeheadless and renderheadless --- examples/computeheadless/computeheadless.cpp | 2 +- examples/renderheadless/renderheadless.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/computeheadless/computeheadless.cpp b/examples/computeheadless/computeheadless.cpp index 2ae6291b..2156a79d 100644 --- a/examples/computeheadless/computeheadless.cpp +++ b/examples/computeheadless/computeheadless.cpp @@ -414,7 +414,7 @@ public: if (commandLineParser.isSet("shaders")) { shaderDir = commandLineParser.getValueAsString("shaders", "glsl"); } - const std::string shadersPath = getAssetPath() + "shaders/"+shaderDir+"/computeheadless/"; + const std::string shadersPath = getShaderBasePath() + shaderDir + "/computeheadless/"; VkPipelineShaderStageCreateInfo shaderStage = {}; shaderStage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; diff --git a/examples/renderheadless/renderheadless.cpp b/examples/renderheadless/renderheadless.cpp index 920eaeb5..931cd400 100644 --- a/examples/renderheadless/renderheadless.cpp +++ b/examples/renderheadless/renderheadless.cpp @@ -647,7 +647,7 @@ public: if (commandLineParser.isSet("shaders")) { shaderDir = commandLineParser.getValueAsString("shaders", "glsl"); } - const std::string shadersPath = getAssetPath() + "shaders/" + shaderDir + "/renderheadless/"; + const std::string shadersPath = getShaderBasePath() + shaderDir + "/renderheadless/"; shaderStages[0].sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO; shaderStages[0].stage = VK_SHADER_STAGE_VERTEX_BIT; From 56064066046d2858697a327965f1c6c991fc64b8 Mon Sep 17 00:00:00 2001 From: Tom Hochstein Date: Wed, 12 Jul 2023 10:00:38 -0500 Subject: [PATCH 3/3] Revert recent change to assets install for cross-compile Since existing textures and models are still installed at the root, it didn't have any noticeable effect other than to create an empty folder. The change was made because it looked like it should be updated like the shaders folder, but it wasn't solving any problem, so switching it back seems the best. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdd87127..c8fa838b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,7 +121,7 @@ endfunction(buildExamples) if(RESOURCE_INSTALL_DIR) add_definitions(-DVK_EXAMPLE_ASSETS_DIR=\"${RESOURCE_INSTALL_DIR}/\") add_definitions(-DVK_EXAMPLE_SHADERS_DIR=\"${RESOURCE_INSTALL_DIR}/shaders/\") - install(DIRECTORY assets/ DESTINATION ${RESOURCE_INSTALL_DIR}/assets/) + install(DIRECTORY assets/ DESTINATION ${RESOURCE_INSTALL_DIR}/) install(DIRECTORY shaders/ DESTINATION ${RESOURCE_INSTALL_DIR}/shaders/) else() add_definitions(-DVK_EXAMPLE_ASSETS_DIR=\"${CMAKE_SOURCE_DIR}/assets/\")