From cfd4bcb323d54834caa3df7f97c92f63b3aa0307 Mon Sep 17 00:00:00 2001
From: Rickey Bowers Jr <bitrake@gmail.com>
Date: Mon, 25 Jan 2021 17:51:17 -0700
Subject: [PATCH] Updated for VS2019. Data path updated to find resources.

---
 .gitignore                                            | 1 +
 Project/Common/GUI.cpp                                | 4 ++--
 Project/Samples/01 - Frame Resources Count/Sample.cpp | 8 ++++----
 Project/build.bat                                     | 2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index e5f99c4..714df74 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
+/.vs
 /Project/build
diff --git a/Project/Common/GUI.cpp b/Project/Common/GUI.cpp
index 809096b..1984b2a 100644
--- a/Project/Common/GUI.cpp
+++ b/Project/Common/GUI.cpp
@@ -306,8 +306,8 @@ namespace ApiWithoutSecrets {
   }
 
   void GUI::CreateGraphicsPipeline() {
-    vk::UniqueShaderModule vertex_shader_module = Parent.CreateShaderModule( "Data/Common/gui.vert.spv" );
-    vk::UniqueShaderModule fragment_shader_module = Parent.CreateShaderModule( "Data/Common/gui.frag.spv" );
+    vk::UniqueShaderModule vertex_shader_module = Parent.CreateShaderModule( "../Data/Common/gui.vert.spv" );
+    vk::UniqueShaderModule fragment_shader_module = Parent.CreateShaderModule( "../Data/Common/gui.frag.spv" );
 
     std::vector<vk::PipelineShaderStageCreateInfo> shader_stage_create_infos = {
       // Vertex shader
diff --git a/Project/Samples/01 - Frame Resources Count/Sample.cpp b/Project/Samples/01 - Frame Resources Count/Sample.cpp
index 4fdac66..4d46fe8 100644
--- a/Project/Samples/01 - Frame Resources Count/Sample.cpp	
+++ b/Project/Samples/01 - Frame Resources Count/Sample.cpp	
@@ -323,7 +323,7 @@ namespace ApiWithoutSecrets {
     // Background texture
     {
       int width = 0, height = 0, data_size = 0;
-      std::vector<char> texture_data = Tools::GetImageData( "Data/Common/Background.png", 4, &width, &height, nullptr, &data_size );
+      std::vector<char> texture_data = Tools::GetImageData( "../Data/Common/Background.png", 4, &width, &height, nullptr, &data_size );
       // Create descriptor resources
       {
         Parameters.BackgroundTexture = SampleCommon::CreateImage( width, height, vk::Format::eR8G8B8A8Unorm, vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled, vk::MemoryPropertyFlagBits::eDeviceLocal, vk::ImageAspectFlagBits::eColor );
@@ -355,7 +355,7 @@ namespace ApiWithoutSecrets {
     // Sample texture
     {
       int width = 0, height = 0, data_size = 0;
-      std::vector<char> texture_data = Tools::GetImageData( "Data/" PROJECT_NUMBER_STRING "/FrameResources.png", 4, &width, &height, nullptr, &data_size );
+      std::vector<char> texture_data = Tools::GetImageData( "../Data/" PROJECT_NUMBER_STRING "/FrameResources.png", 4, &width, &height, nullptr, &data_size );
       // Create descriptor resources
       {
         Parameters.Texture = SampleCommon::CreateImage( width, height, vk::Format::eR8G8B8A8Unorm, vk::ImageUsageFlagBits::eTransferDst | vk::ImageUsageFlagBits::eSampled, vk::MemoryPropertyFlagBits::eDeviceLocal, vk::ImageAspectFlagBits::eColor );
@@ -396,8 +396,8 @@ namespace ApiWithoutSecrets {
   }
 
   void Sample::CreateGraphicsPipeline() {
-    vk::UniqueShaderModule vertex_shader_module = SampleCommon::CreateShaderModule( "Data/" PROJECT_NUMBER_STRING "/shader.vert.spv" );
-    vk::UniqueShaderModule fragment_shader_module = SampleCommon::CreateShaderModule( "Data/" PROJECT_NUMBER_STRING "/shader.frag.spv" );
+    vk::UniqueShaderModule vertex_shader_module = SampleCommon::CreateShaderModule( "../Data/" PROJECT_NUMBER_STRING "/shader.vert.spv" );
+    vk::UniqueShaderModule fragment_shader_module = SampleCommon::CreateShaderModule( "../Data/" PROJECT_NUMBER_STRING "/shader.frag.spv" );
 
     std::vector<vk::PipelineShaderStageCreateInfo> shader_stage_create_infos = {
       // Vertex shader
diff --git a/Project/build.bat b/Project/build.bat
index 59ab57f..f2df74d 100644
--- a/Project/build.bat
+++ b/Project/build.bat
@@ -21,7 +21,7 @@ echo Preparing 'API without Secrets: The Practical Approach to Vulkan' solution.
 mkdir build
 cd build
 
-cmake.exe .. -DUSE_PLATFORM=VK_USE_PLATFORM_WIN32_KHR -G "Visual Studio 15 2017 Win64"
+cmake.exe .. -DUSE_PLATFORM=VK_USE_PLATFORM_WIN32_KHR -G "Visual Studio 16 2019" -DARCHITECTURE=x64
 
 start "" "PracticalApproachToVulkan.sln"