Browse Source

added mesh and swapchain

Jef Belmans 2 years ago
parent
commit
f673aa63bf
43 changed files with 1213 additions and 139 deletions
  1. 4 0
      coral_renderer/CMakeLists.txt
  2. 18 6
      coral_renderer/coral_device.cpp
  3. 5 15
      coral_renderer/coral_device.h
  4. 179 0
      coral_renderer/coral_mesh.cpp
  5. 64 0
      coral_renderer/coral_mesh.h
  6. 25 9
      coral_renderer/coral_pipeline.cpp
  7. 2 1
      coral_renderer/coral_pipeline.h
  8. 301 0
      coral_renderer/coral_swapchain.cpp
  9. 100 0
      coral_renderer/coral_swapchain.h
  10. 2 0
      coral_renderer/coral_window.h
  11. 112 0
      coral_renderer/first_app.cpp
  12. 26 6
      coral_renderer/first_app.h
  13. 16 0
      coral_renderer/vk_types.h
  14. 2 2
      out/build/x64-Debug/.cmake/api/v1/reply/codemodel-v2-8309f8584c32333bd27d.json
  15. 2 2
      out/build/x64-Debug/.cmake/api/v1/reply/index-2023-07-04T13-14-41-0937.json
  16. 16 2
      out/build/x64-Debug/.cmake/api/v1/reply/target-Shaders-Debug-9713b874df703b070b85.json
  17. 32 4
      out/build/x64-Debug/.cmake/api/v1/reply/target-coral_renderer-Debug-4751cac1473a81c4d049.json
  18. BIN
      out/build/x64-Debug/.ninja_deps
  19. 67 55
      out/build/x64-Debug/.ninja_log
  20. 2 2
      out/build/x64-Debug/Testing/Temporary/LastTest.log
  21. 37 3
      out/build/x64-Debug/build.ninja
  22. BIN
      out/build/x64-Debug/coral_renderer/CMakeFiles/coral_renderer.dir/vc140.pdb
  23. BIN
      out/build/x64-Debug/coral_renderer/coral_renderer.ilk
  24. BIN
      out/build/x64-Debug/coral_renderer/coral_renderer.pdb
  25. BIN
      out/build/x64-Debug/coral_renderer/shaders/simple_shader.frag.spv
  26. BIN
      out/build/x64-Debug/coral_renderer/shaders/simple_shader.vert.spv
  27. BIN
      out/build/x64-Debug/third_party/CMakeFiles/tinyobjloader.dir/tinyobjloader.pdb
  28. BIN
      out/build/x64-Debug/third_party/CMakeFiles/vkbootstrap.dir/vkbootstrap.pdb
  29. BIN
      out/build/x64-Debug/third_party/GLFW/src/CMakeFiles/glfw.dir/glfw.pdb
  30. 2 2
      out/build/x64-Release/.cmake/api/v1/reply/codemodel-v2-ac648e5c53f91b8134f2.json
  31. 2 2
      out/build/x64-Release/.cmake/api/v1/reply/index-2023-07-04T12-29-44-0246.json
  32. 16 2
      out/build/x64-Release/.cmake/api/v1/reply/target-Shaders-Release-65cec1358e0fb2f582be.json
  33. 80 4
      out/build/x64-Release/.cmake/api/v1/reply/target-coral_renderer-Release-dca39ccbb87791bcfff6.json
  34. BIN
      out/build/x64-Release/.ninja_deps
  35. 24 17
      out/build/x64-Release/.ninja_log
  36. 2 2
      out/build/x64-Release/Testing/Temporary/LastTest.log
  37. 61 3
      out/build/x64-Release/build.ninja
  38. BIN
      out/build/x64-Release/coral_renderer/shaders/simple_shader.frag.spv
  39. BIN
      out/build/x64-Release/coral_renderer/shaders/simple_shader.vert.spv
  40. BIN
      shaders/compiled/simple_shader.frag.spv
  41. BIN
      shaders/compiled/simple_shader.vert.spv
  42. 7 0
      shaders/simple_shader.frag
  43. 7 0
      shaders/simple_shader.vert

+ 4 - 0
coral_renderer/CMakeLists.txt

@@ -11,6 +11,10 @@ add_executable(coral_renderer
     "vk_initializers.h"
     "vk_initializers.cpp"
     "vk_types.h"
+    "coral_swapchain.h"
+    "coral_swapchain.cpp"
+    "coral_mesh.h"
+    "coral_mesh.cpp"
 )
 
 add_dependencies(coral_renderer Shaders)

+ 18 - 6
coral_renderer/coral_device.cpp

@@ -72,7 +72,7 @@ VkFormat coral_device::find_supported_format(const std::vector<VkFormat>& candid
     throw std::runtime_error("failed to find supported format!");
 }
 
-AllocatedBuffer coral_device::create_buffer(size_t alloc_size, VkBufferUsageFlags usage, VmaMemoryUsage memory_usage)
+AllocatedBuffer coral_device::create_buffer(VkDeviceSize alloc_size, VkBufferUsageFlags usage, VmaMemoryUsage memory_usage)
 {
     VkBufferCreateInfo info{};
     info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
@@ -84,12 +84,12 @@ AllocatedBuffer coral_device::create_buffer(size_t alloc_size, VkBufferUsageFlag
     VmaAllocationCreateInfo vma_alloc_info{};
     vma_alloc_info.usage = memory_usage;
 
-    AllocatedBuffer new_buffer{};
+    AllocatedBuffer new_buffer;
 
     if(vmaCreateBuffer(allocator_, &info, &vma_alloc_info,
         &new_buffer.buffer,
         &new_buffer.allocation,
-        nullptr) != VK_SUCCESS);
+        nullptr) != VK_SUCCESS)
     {
         throw std::runtime_error(
             "ERROR! coral_device::create_buffer() >> Failed to create buffer!");
@@ -98,6 +98,19 @@ AllocatedBuffer coral_device::create_buffer(size_t alloc_size, VkBufferUsageFlag
     return new_buffer;
 }
 
+AllocatedImage coral_device::create_image(const VkImageCreateInfo& image_info, VmaMemoryUsage memory_usage)
+{
+    AllocatedImage new_image;
+
+    VmaAllocationCreateInfo alloc_info{};
+    alloc_info.usage = memory_usage;
+    alloc_info.requiredFlags = VkMemoryPropertyFlags(VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
+
+    vmaCreateImage(allocator_, &image_info, &alloc_info, &new_image.image, &new_image.allocation, nullptr);
+
+    return new_image;
+}
+
 void coral_device::immediate_submit(std::function<void(VkCommandBuffer cmd)>&& function)
 {
     VkCommandBuffer cmd{ upload_context_.command_buffer };
@@ -262,11 +275,10 @@ void coral_device::create_command_pool()
 
 void coral_3d::coral_device::create_command_buffers()
 {
-    auto indices{ find_physical_queue_families() };
-   
     // Allocate default command buffer that we will use for immediate commands
-    VkCommandBufferAllocateInfo alloc_info{
+    VkCommandBufferAllocateInfo alloc_info {
         vkinit::command_buffer_ai(upload_context_.command_pool, 1) };
+
     if (vkAllocateCommandBuffers(device_, &alloc_info, &upload_context_.command_buffer)
         != VK_SUCCESS)
     {

+ 5 - 15
coral_renderer/coral_device.h

@@ -6,25 +6,12 @@
 
 #include <string>
 #include <vector>
-#include <deque>
-#include <functional>
 
 #include "vk_types.h"
 
 namespace coral_3d
 {
-	struct DeletionQueue
-	{
-		std::deque <std::function<void()>> deletors;
-
-		void flush()
-		{
-			for (auto it = deletors.rbegin(); it != deletors.rend(); it++)
-				(*it)();
-
-			deletors.clear();
-		}
-	};
+	
 
 	struct UploadContext
 	{
@@ -70,6 +57,8 @@ namespace coral_3d
 
 		VkCommandPool get_command_pool() { return command_pool_; }
 		VkDevice device() { return device_; }
+		VkPhysicalDevice physical_device() { return physical_device_; }
+		VmaAllocator allocator() { return allocator_; }
 		VkSurfaceKHR surface() { return surface_; }
 		VkQueue graphics_queue() { return graphics_queue_; }
 		VkQueue present_queue() { return present_queue_; }
@@ -81,7 +70,8 @@ namespace coral_3d
 			const std::vector<VkFormat>& candidates, VkImageTiling tiling, VkFormatFeatureFlags features);
 
 		// Buffer helpers
-		AllocatedBuffer create_buffer(size_t alloc_size, VkBufferUsageFlags usage, VmaMemoryUsage memory_usage);
+		AllocatedBuffer create_buffer(VkDeviceSize alloc_size, VkBufferUsageFlags usage, VmaMemoryUsage memory_usage);
+		AllocatedImage create_image(const VkImageCreateInfo& image_info,VmaMemoryUsage memory_usage);
 		void immediate_submit(std::function<void(VkCommandBuffer cmd)>&& function);
 		void copy_buffer(AllocatedBuffer src_buffer, AllocatedBuffer dst_buffer, VkDeviceSize size);
 		void copy_buffer_to_image(AllocatedBuffer buffer, AllocatedImage image, uint32_t width, uint32_t height, uint32_t layer_count);

+ 179 - 0
coral_renderer/coral_mesh.cpp

@@ -0,0 +1,179 @@
+#include "coral_mesh.h"
+
+// LIBS
+#include <tiny_obj_loader.h>
+
+// STD
+#include <iostream>
+#include <cassert>
+
+using namespace coral_3d;
+
+VertexInputDescription Vertex::get_vert_desc()
+{
+    VertexInputDescription desc;
+
+    // We only have one vertex buffer binding, with a per-vertex rate
+    VkVertexInputBindingDescription main_binding{};
+    main_binding.binding = 0;
+    main_binding.stride = sizeof(Vertex);
+    main_binding.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
+
+    desc.bindings.emplace_back(main_binding);
+
+    // Position will be stored at Location 0
+    VkVertexInputAttributeDescription position_attrib{};
+    position_attrib.binding = 0;
+    position_attrib.location = 0;
+    position_attrib.format = VK_FORMAT_R32G32_SFLOAT;
+    position_attrib.offset = offsetof(Vertex, position);
+
+    //// Normal will be stored at Location 1
+    //VkVertexInputAttributeDescription normal_attrib{};
+    //normal_attrib.binding = 0;
+    //normal_attrib.location = 1;
+    //normal_attrib.format = VK_FORMAT_R32G32B32_SFLOAT;
+    //normal_attrib.offset = offsetof(Vertex, normal);
+
+    //// Color will be stored at Location 2
+    //VkVertexInputAttributeDescription color_attrib{};
+    //color_attrib.binding = 0;
+    //color_attrib.location = 2;
+    //color_attrib.format = VK_FORMAT_R32G32B32_SFLOAT;
+    //color_attrib.offset = offsetof(Vertex, color);
+
+    //// UV will be stored at Location 3
+    //VkVertexInputAttributeDescription texcoord_attrib{};
+    //texcoord_attrib.binding = 0;
+    //texcoord_attrib.location = 3;
+    //texcoord_attrib.format = VK_FORMAT_R32G32_SFLOAT;
+    //texcoord_attrib.offset = offsetof(Vertex, uv);
+
+    desc.attributes.emplace_back(position_attrib);
+    //desc.attributes.emplace_back(normal_attrib);
+    //desc.attributes.emplace_back(color_attrib);
+    //desc.attributes.emplace_back(texcoord_attrib);
+
+    return desc;
+}
+
+bool coral_mesh::load_from_obj(const char* filename)
+{
+    // attrib will contain the vertex arrays of the file
+    tinyobj::attrib_t attrib;
+    // shapes contains the info for each separate object in the file
+    std::vector<tinyobj::shape_t> shapes;
+    // materials contains the information about the material of each shape, not yet used.
+    std::vector<tinyobj::material_t> materials;
+
+    // error and warning output from the load function
+    std::string warn;
+    std::string err;
+
+    // load the OBJ file
+    tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, filename);
+
+    //make sure to output the warnings to the console, in case there are issues with the file
+    if (!warn.empty())
+    {
+        std::cout << "WARNING! Mesh::load_from_obj() >> " << warn << std::endl;
+    }
+
+    //if we have any error, print it to the console, and break the mesh loading.
+    //This happens if the file can't be found or is malformed
+    if (!err.empty())
+    {
+        std::cerr << err << std::endl;
+        return false;
+    }
+
+    // Loop over shapes
+    //for (size_t s = 0; s < shapes.size(); s++)
+    //{
+
+    //    // Loop over faces(polygon)
+    //    size_t index_offset = 0;
+    //    for (size_t f = 0; f < shapes[s].mesh.num_face_vertices.size(); f++)
+    //    {
+    //        //hardcode loading to triangles
+    //        int fv = 3;
+
+    //        // Loop over vertices in the face.
+    //        for (size_t v = 0; v < fv; v++)
+    //        {
+    //            // access to vertex
+    //            tinyobj::index_t idx = shapes[s].mesh.indices[index_offset + v];
+
+    //            //vertex position
+    //            tinyobj::real_t vx = attrib.vertices[3 * idx.vertex_index + 0];
+    //            tinyobj::real_t vy = attrib.vertices[3 * idx.vertex_index + 1];
+    //            tinyobj::real_t vz = attrib.vertices[3 * idx.vertex_index + 2];
+    //            //vertex normal
+    //            tinyobj::real_t nx = attrib.normals[3 * idx.normal_index + 0];
+    //            tinyobj::real_t ny = attrib.normals[3 * idx.normal_index + 1];
+    //            tinyobj::real_t nz = attrib.normals[3 * idx.normal_index + 2];
+
+    //            //copy it into our vertex
+    //            Vertex new_vert;
+    //            new_vert.position.x = vx;
+    //            new_vert.position.y = vy;
+    //            new_vert.position.z = vz;
+
+    //            new_vert.normal.x = nx;
+    //            new_vert.normal.y = ny;
+    //            new_vert.normal.z = nz;
+
+    //            //we are setting the vertex color as the vertex normal. This is just for display purposes
+    //            new_vert.color = new_vert.normal;
+
+    //            tinyobj::real_t ux{attrib.texcoords[2 * idx.texcoord_index + 0]};
+    //            tinyobj::real_t uy{attrib.texcoords[2 * idx.texcoord_index + 1]};
+
+    //            new_vert.uv = { ux, 1 - uy };
+
+    //            vertices_.push_back(new_vert);
+    //        }
+    //        index_offset += fv;
+    //    }
+    //}
+
+    return true;
+}
+
+coral_mesh::coral_mesh(coral_device& device, const std::vector<Vertex>& vertices)
+    : device_{device}
+    , vertices_{vertices}
+{
+    create_vertex_buffers();
+}
+
+coral_mesh::~coral_mesh()
+{
+    vmaDestroyBuffer(device_.allocator(), vertex_buffer_.buffer, vertex_buffer_.allocation);
+}
+
+void coral_mesh::bind(VkCommandBuffer command_buffer)
+{
+    VkBuffer buffers[]{ vertex_buffer_.buffer };
+    VkDeviceSize offsets[]{ 0 };
+    vkCmdBindVertexBuffers(command_buffer, 0, 1, buffers, offsets);
+}
+
+void coral_mesh::draw(VkCommandBuffer command_buffer)
+{
+    vkCmdDraw(command_buffer, vertex_count_, 1, 0, 0);
+}
+
+void coral_mesh::create_vertex_buffers()
+{
+    vertex_count_ = static_cast<uint32_t>(vertices_.size());
+    assert(vertex_count_ >= 3 && "ERROR! coral_mesh::create_vertex_buffers() >> Vertex count must be greater than or equal to 3");
+
+    VkDeviceSize buffer_size{ sizeof(Vertex) * vertex_count_ };
+    vertex_buffer_ = device_.create_buffer(buffer_size, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, VMA_MEMORY_USAGE_CPU_ONLY);
+
+    void* data;
+    vmaMapMemory(device_.allocator(), vertex_buffer_.allocation, &data);
+    memcpy(data, vertices_.data(), static_cast<size_t>(buffer_size));
+    vmaUnmapMemory(device_.allocator(), vertex_buffer_.allocation);
+}

+ 64 - 0
coral_renderer/coral_mesh.h

@@ -0,0 +1,64 @@
+#pragma once
+
+// STD
+#include <vector>
+
+// GLM
+#define GLM_FORCE_RADIANS
+#define GLM_FORCE_DEPTH_ZERO_TO_ONE
+#include <glm.hpp>
+
+#include "vk_types.h"
+#include "coral_device.h"
+
+namespace coral_3d
+{
+	struct VertexInputDescription
+	{
+		std::vector<VkVertexInputBindingDescription> bindings;
+		std::vector<VkVertexInputAttributeDescription> attributes;
+
+		VkPipelineVertexInputStateCreateFlags flags = 0;
+	};
+
+
+	struct Vertex
+	{
+		glm::vec2 position;
+
+		static VertexInputDescription get_vert_desc();
+	};
+
+	struct VertexBig
+	{
+		glm::vec3 position;
+		glm::vec3 normal;
+		glm::vec3 color;
+		glm::vec2 uv;
+
+		static VertexInputDescription get_vert_desc();
+	};
+
+	class coral_mesh final
+	{
+	public:
+		coral_mesh(coral_device& device, const std::vector<Vertex>& vertices);
+		~coral_mesh();
+		
+		coral_mesh(const coral_mesh&) = delete;
+		coral_mesh& operator=(const coral_mesh&) = delete;
+
+		void bind(VkCommandBuffer command_buffer);
+		void draw(VkCommandBuffer command_buffer);
+
+	private:
+		void create_vertex_buffers();
+
+		coral_device& device_;
+		std::vector<Vertex> vertices_;
+		uint32_t vertex_count_;
+		AllocatedBuffer vertex_buffer_;
+
+		bool load_from_obj(const char* filename);
+	};
+}

+ 25 - 9
coral_renderer/coral_pipeline.cpp

@@ -5,6 +5,7 @@
 #include <fstream>
 #include <cassert>
 
+#include "coral_mesh.h"
 #include "vk_initializers.h"
 
 using namespace coral_3d;
@@ -25,6 +26,11 @@ coral_pipeline::~coral_pipeline()
 	vkDestroyPipeline(device_.device(), graphics_pipeline_, nullptr);
 }
 
+void coral_pipeline::bind(VkCommandBuffer command_buffer)
+{
+	vkCmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, graphics_pipeline_);
+}
+
 PipelineConfigInfo coral_3d::coral_pipeline::default_pipeline_config_info(uint32_t width, uint32_t height)
 {
 	PipelineConfigInfo config_info{};
@@ -44,14 +50,6 @@ PipelineConfigInfo coral_3d::coral_pipeline::default_pipeline_config_info(uint32
 	config_info.scissor.offset = { 0,0 };
 	config_info.scissor.extent = {width, height};
 
-	// VIEWPORT INFO
-	config_info.viewport_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
-	config_info.viewport_info.pNext = nullptr;
-	config_info.viewport_info.viewportCount = 1;
-	config_info.viewport_info.pViewports = &config_info.viewport;
-	config_info.viewport_info.scissorCount = 1;
-	config_info.viewport_info.pScissors = &config_info.scissor;
-
 	// RASTERIZER
 	config_info.rasterization_info = vkinit::rasterization_state_ci(VK_POLYGON_MODE_FILL);
 
@@ -133,7 +131,25 @@ void coral_pipeline::create_graphics_pipeline(
 	shader_stages[1].flags = 0;
 	shader_stages[1].pSpecializationInfo = nullptr;
 
+	// VERTEX INPUT INFO
 	VkPipelineVertexInputStateCreateInfo vertex_input_info{ vkinit::vertex_input_state_ci() };
+	
+	VertexInputDescription vertex_desc{ Vertex::get_vert_desc() };
+	
+	vertex_input_info.vertexAttributeDescriptionCount = static_cast<uint32_t>(vertex_desc.attributes.size());
+	vertex_input_info.pVertexAttributeDescriptions = vertex_desc.attributes.data();
+
+	vertex_input_info.vertexBindingDescriptionCount = static_cast<uint32_t>(vertex_desc.bindings.size());
+	vertex_input_info.pVertexBindingDescriptions = vertex_desc.bindings.data();
+
+	// VIEWPORT INFO
+	VkPipelineViewportStateCreateInfo viewport_info{};
+	viewport_info.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
+	viewport_info.pNext = nullptr;
+	viewport_info.viewportCount = 1;
+	viewport_info.pViewports = &config_info.viewport;
+	viewport_info.scissorCount = 1;
+	viewport_info.pScissors = &config_info.scissor;
 
 	VkGraphicsPipelineCreateInfo pipeline_info{};
 	pipeline_info.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
@@ -141,7 +157,7 @@ void coral_pipeline::create_graphics_pipeline(
 	pipeline_info.pStages = shader_stages;
 	pipeline_info.pVertexInputState = &vertex_input_info;
 	pipeline_info.pInputAssemblyState = &config_info.input_assembly_info;
-	pipeline_info.pViewportState = &config_info.viewport_info;
+	pipeline_info.pViewportState = &viewport_info;
 	pipeline_info.pRasterizationState = &config_info.rasterization_info;
 	pipeline_info.pMultisampleState = &config_info.multisample_info;
 	pipeline_info.pColorBlendState = &config_info.color_blend_info;

+ 2 - 1
coral_renderer/coral_pipeline.h

@@ -12,7 +12,6 @@ namespace coral_3d
 	{
 		VkViewport viewport;
 		VkRect2D scissor;
-		VkPipelineViewportStateCreateInfo viewport_info;
 		VkPipelineInputAssemblyStateCreateInfo input_assembly_info;
 		VkPipelineRasterizationStateCreateInfo rasterization_info;
 		VkPipelineMultisampleStateCreateInfo multisample_info;
@@ -38,6 +37,8 @@ namespace coral_3d
 		coral_pipeline(const coral_pipeline&) = delete;
 		coral_pipeline& operator=(const coral_pipeline&) = delete;
 
+		void bind(VkCommandBuffer command_buffer);
+
 		static PipelineConfigInfo default_pipeline_config_info(uint32_t width, uint32_t height);
 
 	private:

+ 301 - 0
coral_renderer/coral_swapchain.cpp

@@ -0,0 +1,301 @@
+#include "coral_swapchain.h"
+
+// STD
+#include <array>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <limits>
+#include <set>
+#include <stdexcept>
+
+// VULKAN
+#include <VkBootstrap.h>
+#include "vk_initializers.h"
+
+using namespace coral_3d;
+
+coral_swapchain::coral_swapchain(coral_device& device, VkExtent2D extent)
+    :device_{ device }, window_extent_{ extent }
+{
+    create_swapchain();
+    create_render_pass();
+    create_depth_resources();
+    create_frame_buffers();
+    create_sync_structures();
+}
+
+coral_swapchain::~coral_swapchain()
+{
+	deletion_queue_.flush();
+}
+
+VkFormat coral_swapchain::find_depth_format()
+{
+	return device_.find_supported_format(
+		{ VK_FORMAT_D32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_D24_UNORM_S8_UINT },
+		VK_IMAGE_TILING_OPTIMAL,
+		VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT);
+}
+
+VkResult coral_3d::coral_swapchain::aqcuire_next_image(uint32_t* image_index)
+{
+	// NOTE: as of 04/07, vkDeviceWaitIdle is about 3% faster when rendering a single triangle.
+	vkDeviceWaitIdle(device_.device());
+	// vkWaitForFences(device_.device(), 1, &get_current_frame().render_fence, VK_TRUE, UINT64_MAX);
+	vkResetFences(device_.device(), 1, &get_current_frame().render_fence);
+
+	VkResult result = vkAcquireNextImageKHR(
+		device_.device(),
+		swapchain_,
+		UINT64_MAX,
+		get_current_frame().present_semaphore,  // must be a not signaled semaphore
+		VK_NULL_HANDLE,
+		image_index);
+
+	return result;
+}
+
+VkResult coral_swapchain::submit_command_buffer(const VkCommandBuffer* buffers, uint32_t* image_index)
+{
+	// Prepare to submit to the queue
+	VkPipelineStageFlags waitStage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+
+	VkSubmitInfo submit{};
+	submit.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
+	submit.pNext = nullptr;
+
+	submit.pWaitDstStageMask = &waitStage;
+
+	// Wait for image to be ready for rendering before rendering to it
+	submit.waitSemaphoreCount = 1;
+	submit.pWaitSemaphores = &get_current_frame().present_semaphore;
+
+	// Signal ready when finished rendering
+	submit.signalSemaphoreCount = 1;
+	submit.pSignalSemaphores = &get_current_frame().render_semaphore;
+
+	submit.commandBufferCount = 1;
+	submit.pCommandBuffers = buffers;
+
+	// Submit to the graphics queue
+	if (vkQueueSubmit(device_.graphics_queue(), 1, &submit, get_current_frame().render_fence) != VK_SUCCESS)
+		throw std::runtime_error("ERROR! coral_swapchain::submit_command_buffer() >> Failed to submit draw command buffer!");
+
+	// Present the image to the window when the rendering semaphore has signaled that rendering is done
+	VkPresentInfoKHR presentInfo{};
+	presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
+	presentInfo.pNext = nullptr;
+
+	presentInfo.pSwapchains = &swapchain_;
+	presentInfo.swapchainCount = 1;
+
+	presentInfo.waitSemaphoreCount = 1;
+	presentInfo.pWaitSemaphores = &get_current_frame().render_semaphore;
+
+	// Which image to present
+	presentInfo.pImageIndices = image_index;
+
+	auto result = vkQueuePresentKHR(device_.present_queue(), &presentInfo);
+
+	current_frame_ = (current_frame_ + 1) % MAX_FRAMES_IN_FLIGHT;
+	return result;
+}
+
+void coral_swapchain::create_swapchain()
+{
+	vkb::SwapchainBuilder swapchain_builder{ device_.physical_device(), device_.device(), device_.surface() };
+
+	vkb::Swapchain vkb_swapchain = swapchain_builder
+		.use_default_format_selection()
+		// use VSync present mode
+		.set_desired_present_mode(VK_PRESENT_MODE_MAILBOX_KHR)
+		.set_desired_extent(window_extent_.width, window_extent_.height)
+		.build()
+		.value();
+
+	// store swap chain and its related data
+	swapchain_ = vkb_swapchain.swapchain;
+	swapchain_images_ = vkb_swapchain.get_images().value();
+	swapchain_image_views_ = vkb_swapchain.get_image_views().value();
+	swapchain_image_format_ = vkb_swapchain.image_format;
+
+	swapchain_extent_ = vkb_swapchain.extent;
+
+	deletion_queue_.deletors.emplace_back([=]() {
+		vkDestroySwapchainKHR(device_.device(), swapchain_, nullptr);
+		});
+}
+
+void coral_swapchain::create_render_pass()
+{
+	// Description of the image that we will be writing rendering commands to
+	VkAttachmentDescription color_attachment{};
+
+	// format should be the same as the swap chain images
+	color_attachment.format = swapchain_image_format_;
+	// MSAA samples, set to 1 (no MSAA) by default
+	color_attachment.samples = VK_SAMPLE_COUNT_1_BIT;
+	// Clear when render pass begins
+	color_attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+	// Keep the attachment stored when render pass ends
+	color_attachment.storeOp = VK_ATTACHMENT_STORE_OP_STORE;
+	// Don't care about stencil data
+	color_attachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+	color_attachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+	// Image data layout before render pass starts (undefined = don't care)
+	color_attachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+	// Image data layout after render pass (to change to), set to present by default
+	color_attachment.finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
+
+	VkAttachmentReference color_attachment_ref{};
+	// Attachment number will index into the pAttachments array in the parent render pass itself
+	color_attachment_ref.attachment = 0;
+	// Optimal layout for writing to the image
+	color_attachment_ref.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+
+	// Description of the depth image
+	VkAttachmentDescription depth_attachment{};
+	depth_attachment.flags = 0;
+	depth_attachment.format = find_depth_format();
+	depth_attachment.samples = VK_SAMPLE_COUNT_1_BIT;
+	depth_attachment.loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
+	depth_attachment.storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+	depth_attachment.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
+	depth_attachment.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
+	depth_attachment.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+	depth_attachment.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+
+	VkAttachmentReference depth_attachment_ref{};
+	depth_attachment_ref.attachment = 1;
+	depth_attachment_ref.layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
+
+	// Create one sub pass (minimum one sub pass required)
+	VkSubpassDescription subpass{};
+	subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
+	subpass.colorAttachmentCount = 1;
+	subpass.pColorAttachments = &color_attachment_ref;
+	subpass.pDepthStencilAttachment = &depth_attachment_ref;
+
+	// These dependencies tell Vulkan that the attachment cannot be used before the previous renderpasses have finished using it
+	VkSubpassDependency dependency{};
+	dependency.srcSubpass = VK_SUBPASS_EXTERNAL;
+	dependency.dstSubpass = 0;
+	dependency.srcAccessMask = 0;
+	dependency.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+	dependency.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
+	dependency.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
+
+	std::array<VkAttachmentDescription, 2> attachments { color_attachment, depth_attachment };
+
+	VkRenderPassCreateInfo render_pass_info{};
+	render_pass_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
+	render_pass_info.pNext = nullptr;
+
+	// Connect the color attachment description to the info
+	render_pass_info.attachmentCount = static_cast<uint32_t>(attachments.size());
+	render_pass_info.pAttachments = attachments.data();
+
+	// Connect the subpass(es) to the info
+	render_pass_info.subpassCount = 1;
+	render_pass_info.pSubpasses = &subpass;
+
+	// Connect the dependency
+	render_pass_info.dependencyCount = 1;
+	render_pass_info.pDependencies = &dependency;
+
+	if (vkCreateRenderPass(device_.device(), &render_pass_info, nullptr, &render_pass_) != VK_SUCCESS)
+		throw std::runtime_error("ERROR! coral_swapchain::create_render_pass() >> Failed to create render pass!");
+
+	deletion_queue_.deletors.emplace_back([=]() {
+		vkDestroyRenderPass(device_.device(), render_pass_, nullptr);
+		});
+}
+
+void coral_swapchain::create_depth_resources()
+{
+	VkFormat depth_format{ find_depth_format() };
+
+	depth_images_.resize(image_count());
+	depth_image_views_.resize(image_count());
+
+	VkExtent3D depth_image_extent
+	{
+		swapchain_extent_.width,
+		swapchain_extent_.height,
+		1.f
+	};
+
+	VkImageCreateInfo image_info{ vkinit::image_ci(depth_format, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, depth_image_extent) };
+	
+	for (int i = 0; i < depth_images_.size(); i++)
+	{
+		depth_images_[i] = device_.create_image(image_info, VMA_MEMORY_USAGE_GPU_ONLY);
+
+		VkImageViewCreateInfo image_view_info{ vkinit::image_view_ci(depth_format, depth_images_[i].image, VK_IMAGE_ASPECT_DEPTH_BIT) };
+		if (vkCreateImageView(device_.device(), &image_view_info, nullptr, &depth_image_views_[i]) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! coral_swapchain::create_depth_resources() >> Failed to create texture image view!");
+
+		deletion_queue_.deletors.emplace_back([=]() {
+			vkDestroyImageView(device_.device(), depth_image_views_[i], nullptr);
+			vmaDestroyImage(device_.allocator(), depth_images_[i].image, depth_images_[i].allocation);
+			});
+	}
+}
+
+void coral_swapchain::create_frame_buffers()
+{
+	swapchain_frame_buffers_.resize(image_count());
+
+	VkFramebufferCreateInfo fb_info{};
+	fb_info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
+	fb_info.renderPass = render_pass_;
+	fb_info.width = swapchain_extent_.width;
+	fb_info.height = swapchain_extent_.height;
+	fb_info.layers = 1;
+
+	for (size_t i = 0; i < swapchain_frame_buffers_.size(); i++)
+	{
+		std::array<VkImageView, 2> attachments{swapchain_image_views_[i], depth_image_views_[i]};
+
+		fb_info.attachmentCount = static_cast<uint32_t>(attachments.size());
+		fb_info.pAttachments = attachments.data();
+
+		if (vkCreateFramebuffer(device_.device(), &fb_info, nullptr, &swapchain_frame_buffers_[i]) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! coral_swapchain::create_frame_buffers() >> Failed to create framebuffer!");
+
+		deletion_queue_.deletors.emplace_back([=]() {
+			vkDestroyFramebuffer(device_.device(), swapchain_frame_buffers_[i], nullptr);
+			vkDestroyImageView(device_.device(), swapchain_image_views_[i], nullptr);
+			});
+	}
+}
+
+void coral_swapchain::create_sync_structures()
+{
+	// Render fence
+	VkFenceCreateInfo fenceCreateInfo{ vkinit::fence_ci(VK_FENCE_CREATE_SIGNALED_BIT) };
+	// Sempahore needs no flags
+	VkSemaphoreCreateInfo semaphoreCreateInfo{ vkinit::semaphore_ci() };
+
+	for (int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++)
+	{
+		if (vkCreateFence(device_.device(), &fenceCreateInfo, nullptr, &frames_[i].render_fence) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! coral_swapchain::create_sync_structures() >> Failed to create render fence!");
+
+		deletion_queue_.deletors.emplace_back([=]() {
+			vkDestroyFence(device_.device(), frames_[i].render_fence, nullptr);
+			});
+
+		if(vkCreateSemaphore(device_.device(), &semaphoreCreateInfo, nullptr, &frames_[i].present_semaphore) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! coral_swapchain::create_sync_structures() >> Failed to create present semaphore!");
+		if(vkCreateSemaphore(device_.device(), &semaphoreCreateInfo, nullptr, &frames_[i].render_semaphore) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! coral_swapchain::create_sync_structures() >> Failed to create render semaphore!");
+
+		deletion_queue_.deletors.emplace_back([=]()
+			{
+				vkDestroySemaphore(device_.device(), frames_[i].present_semaphore, nullptr);
+				vkDestroySemaphore(device_.device(), frames_[i].render_semaphore, nullptr);
+			});
+	}
+}

+ 100 - 0
coral_renderer/coral_swapchain.h

@@ -0,0 +1,100 @@
+#pragma once
+
+#include "coral_device.h"
+
+// vulkan headers
+#include <vulkan/vulkan.h>
+
+// std lib headers
+#include <string>
+#include <vector>
+
+#include "vk_types.h"
+
+namespace coral_3d
+{
+
+    struct FrameData
+    {
+        // Sync objects
+        VkSemaphore present_semaphore{ VK_NULL_HANDLE }, render_semaphore{ VK_NULL_HANDLE };
+        VkFence render_fence{ VK_NULL_HANDLE };
+
+        // Commands
+        VkCommandPool command_pool{ VK_NULL_HANDLE };
+        VkCommandBuffer main_command_buffer{ VK_NULL_HANDLE };
+
+        // Buffers
+        AllocatedBuffer camera_buffer;
+        AllocatedBuffer object_buffer;
+        AllocatedBuffer indirect_buffer;
+
+        // Descriptors
+        VkDescriptorSet global_descriptor;
+        VkDescriptorSet object_descriptor;
+    };
+
+    class coral_swapchain final
+    {
+    public:
+        static constexpr int MAX_FRAMES_IN_FLIGHT = 2;
+
+        coral_swapchain(coral_device& device, VkExtent2D extent);
+        ~coral_swapchain();
+
+        coral_swapchain(const coral_swapchain&) = delete;
+        void operator=(const coral_swapchain&) = delete;
+
+        VkFramebuffer get_frame_buffers(int index) { return swapchain_frame_buffers_[index]; }
+        VkRenderPass get_render_pass() { return render_pass_; }
+        VkImageView get_image_view(int index) { return swapchain_image_views_[index]; }
+        size_t image_count() { return swapchain_images_.size(); }
+        VkFormat get_swapchain_format() { return swapchain_image_format_; }
+        VkExtent2D get_swapchain_extent() { return swapchain_extent_; }
+        uint32_t width() { return swapchain_extent_.width; }
+        uint32_t height() { return swapchain_extent_.height; }
+
+        float extent_aspect_ratio() {
+            return static_cast<float>(swapchain_extent_.width) / static_cast<float>(swapchain_extent_.height);
+        }
+        VkFormat find_depth_format();
+
+        VkResult aqcuire_next_image(uint32_t* image_index);
+        VkResult submit_command_buffer(const VkCommandBuffer* buffers, uint32_t* image_index);
+
+    private:
+        void create_swapchain();
+        void create_render_pass();
+        void create_depth_resources();
+        void create_frame_buffers();
+        void create_sync_structures();
+
+        // Helper functions
+        VkSurfaceFormatKHR choose_swapchain_format(const std::vector<VkSurfaceFormatKHR>& available_formats);
+        VkPresentModeKHR choose_present_mode(const std::vector<VkPresentModeKHR>& available_present_modes);
+        VkExtent2D choose_swap_extent(const VkSurfaceCapabilitiesKHR& capabilities);
+        FrameData& get_current_frame() { return frames_[current_frame_]; }
+
+        // Deletion
+        DeletionQueue deletion_queue_;
+
+        VkFormat swapchain_image_format_;
+        VkExtent2D swapchain_extent_;
+
+        std::vector<VkFramebuffer> swapchain_frame_buffers_;
+        VkRenderPass render_pass_;
+
+        std::vector<AllocatedImage> depth_images_;
+        std::vector<VkImageView> depth_image_views_;
+        std::vector<VkImage> swapchain_images_;
+        std::vector<VkImageView> swapchain_image_views_;
+
+        coral_device& device_;
+        VkExtent2D window_extent_;
+        VkSwapchainKHR swapchain_;
+
+        FrameData frames_[MAX_FRAMES_IN_FLIGHT];
+        size_t current_frame_ = 0;
+    };
+
+}  // namespace lve

+ 2 - 0
coral_renderer/coral_window.h

@@ -17,6 +17,8 @@ namespace coral_3d
 		coral_window& operator=(const coral_window&) = delete;
 
 		bool should_close() { return glfwWindowShouldClose(pWindow_); }
+		VkExtent2D get_extent() { return { static_cast<uint32_t>(c_width), static_cast<uint32_t>(c_height)}; }
+
 		void create_window_surface(VkInstance instance, VkSurfaceKHR* surface);
 
 	private:

+ 112 - 0
coral_renderer/first_app.cpp

@@ -1,11 +1,123 @@
 #include "first_app.h"
 
+// STD
+#include <stdexcept>
+#include <array>
+
+#include "vk_initializers.h"
+
 using namespace coral_3d;
 
+first_app::first_app()
+{
+	load_meshes();
+	create_pipeline_layout();
+	create_pipeline();
+	create_command_buffers();
+}
+
+first_app::~first_app()
+{
+	vkDestroyPipelineLayout(device_.device(), pipeline_layout_, nullptr);
+}
+
 void first_app::run()
 {
 	while (!window_.should_close())
 	{
 		glfwPollEvents();
+		draw_frame();
+	}
+
+	vkDeviceWaitIdle(device_.device());
+}
+
+void first_app::load_meshes()
+{
+	std::vector<Vertex> vertices
+	{
+		{{0.0f, -0.5f}},
+		{{0.5f,  0.5f}},
+		{{-0.5f, 0.5f}}
+	};
+
+	mesh_ = std::make_unique<coral_mesh>(device_, vertices);
+}
+
+void first_app::create_pipeline_layout()
+{
+	VkPipelineLayoutCreateInfo layout_info{ vkinit::pipeline_layout_ci() };
+	if (vkCreatePipelineLayout(device_.device(), &layout_info, nullptr, &pipeline_layout_) != VK_SUCCESS)
+		throw std::runtime_error("ERROR! first_app::create_pipeline_layout() >> Failed to create pipeline layout!");
+}
+
+void first_app::create_pipeline()
+{
+	auto pipeline_config{ coral_pipeline::default_pipeline_config_info(swapchain_.width(), swapchain_.height()) };
+	pipeline_config.render_pass = swapchain_.get_render_pass();
+	pipeline_config.pipeline_layout = pipeline_layout_;
+
+	pipeline_ = std::make_unique<coral_pipeline>(
+		device_,
+		// "shaders/PosNormCol.vert.spv",
+		// "shaders/PosNormCol.frag.spv",
+		"shaders/simple_shader.vert.spv",
+		"shaders/simple_shader.frag.spv",
+		pipeline_config
+	);
+}
+
+void first_app::create_command_buffers()
+{
+	command_buffers_.resize(swapchain_.image_count());
+
+	VkCommandBufferAllocateInfo alloc_info{ vkinit::command_buffer_ai(device_.get_command_pool(), static_cast<uint32_t>(command_buffers_.size())) };
+	if (vkAllocateCommandBuffers(device_.device(), &alloc_info, command_buffers_.data()) != VK_SUCCESS)
+		throw std::runtime_error("ERROR! first_app::create_command_buffers() >> Failed to allocate command buffers!");
+
+	for (int i = 0; i < command_buffers_.size(); i++)
+	{
+		VkCommandBufferBeginInfo begin_info{};
+		begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
+
+		if (vkBeginCommandBuffer(command_buffers_[i], &begin_info) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! first_app::create_command_buffers() >> Failed to begin recording command buffer!");
+
+		VkRenderPassBeginInfo render_pass_info{};
+		render_pass_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
+		render_pass_info.renderPass = swapchain_.get_render_pass();
+		render_pass_info.framebuffer = swapchain_.get_frame_buffers(i);
+
+		render_pass_info.renderArea.offset = { 0, 0 };
+		render_pass_info.renderArea.extent = swapchain_.get_swapchain_extent();
+
+		std::array<VkClearValue, 2> clear_values{};
+		clear_values[0].color = { 0.1f, 0.1f, 0.1f, 1.0f };
+		clear_values[1].depthStencil = { 1.0f, 0 };
+		render_pass_info.clearValueCount = static_cast<uint32_t>(clear_values.size());
+		render_pass_info.pClearValues = clear_values.data();
+
+		vkCmdBeginRenderPass(command_buffers_[i], &render_pass_info, VK_SUBPASS_CONTENTS_INLINE);
+
+		pipeline_->bind(command_buffers_[i]);
+		mesh_->bind(command_buffers_[i]);
+		mesh_->draw(command_buffers_[i]);
+
+		vkCmdEndRenderPass(command_buffers_[i]);
+
+		if (vkEndCommandBuffer(command_buffers_[i]) != VK_SUCCESS)
+			throw std::runtime_error("ERROR! first_app::create_command_buffers() >> Failed to record command buffer!");
 	}
 }
+
+void first_app::draw_frame()
+{
+	uint32_t image_index;
+	auto result = swapchain_.aqcuire_next_image(&image_index);
+	if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR)
+		throw std::runtime_error("ERROR! first_app::draw_frame() >> Failed to aquire swapchain image!");
+
+	result = swapchain_.submit_command_buffer(&command_buffers_[image_index], &image_index);
+	if(result != VK_SUCCESS)
+		throw std::runtime_error("ERROR! first_app::draw_frame() >> Failed to present swapchain image!");
+}

+ 26 - 6
coral_renderer/first_app.h

@@ -1,8 +1,14 @@
 #pragma once
 
+#include "coral_device.h"
 #include "coral_pipeline.h"
+#include "coral_swapchain.h"
 #include "coral_window.h"
-#include "coral_device.h"
+#include "coral_mesh.h"
+
+// STD
+#include <memory>
+#include <vector>
 
 namespace coral_3d
 {
@@ -12,15 +18,29 @@ namespace coral_3d
 		static constexpr int WIDTH{ 800 };
 		static constexpr int HEIGHT{ 600 };
 
+		first_app();
+		~first_app();
+
+		first_app(const first_app&) = delete;
+		first_app& operator=(const first_app&) = delete;
+
 		void run();
 
 	private:
+		void load_meshes();
+		void create_pipeline_layout();
+		void create_pipeline();
+		void create_command_buffers();
+		void draw_frame();
+
 		coral_window window_{ WIDTH, HEIGHT, "Coral Renderer" };
 		coral_device device_{ window_ };
-		coral_pipeline coral_pipeline_{
-			device_,
-			"shaders/PosNormCol.vert.spv",
-			"shaders/PosNormCol.frag.spv",
-			coral_pipeline::default_pipeline_config_info(WIDTH, HEIGHT)};
+		coral_swapchain swapchain_{ device_, window_.get_extent() };
+		std::unique_ptr<coral_pipeline> pipeline_;
+
+		VkPipelineLayout pipeline_layout_;
+		std::vector<VkCommandBuffer> command_buffers_;
+
+		std::unique_ptr<coral_mesh> mesh_;
 	};
 }

+ 16 - 0
coral_renderer/vk_types.h

@@ -2,6 +2,9 @@
 #include <vulkan/vulkan.h>
 #include <vk_mem_alloc.h>
 
+#include <deque>
+#include <functional>
+
 struct AllocatedBuffer
 {
 	VkBuffer buffer;
@@ -12,4 +15,17 @@ struct AllocatedImage
 {
 	VkImage image;
 	VmaAllocation allocation;
+};
+
+struct DeletionQueue
+{
+	std::deque <std::function<void()>> deletors;
+
+	void flush()
+	{
+		for (auto it = deletors.rbegin(); it != deletors.rend(); it++)
+			(*it)();
+
+		deletors.clear();
+	}
 };

+ 2 - 2
out/build/x64-Debug/.cmake/api/v1/reply/codemodel-v2-9ed5b9eadee087677b35.json → out/build/x64-Debug/.cmake/api/v1/reply/codemodel-v2-8309f8584c32333bd27d.json

@@ -139,14 +139,14 @@
 				{
 					"directoryIndex" : 1,
 					"id" : "Shaders::@189d46817749ee15bd40",
-					"jsonFile" : "target-Shaders-Debug-4d04420832e8090eb8fd.json",
+					"jsonFile" : "target-Shaders-Debug-9713b874df703b070b85.json",
 					"name" : "Shaders",
 					"projectIndex" : 0
 				},
 				{
 					"directoryIndex" : 1,
 					"id" : "coral_renderer::@189d46817749ee15bd40",
-					"jsonFile" : "target-coral_renderer-Debug-e0018bfd4eeb3d52c447.json",
+					"jsonFile" : "target-coral_renderer-Debug-4751cac1473a81c4d049.json",
 					"name" : "coral_renderer",
 					"projectIndex" : 0
 				},

+ 2 - 2
out/build/x64-Debug/.cmake/api/v1/reply/index-2023-07-03T16-34-28-0129.json → out/build/x64-Debug/.cmake/api/v1/reply/index-2023-07-04T13-14-41-0937.json

@@ -26,7 +26,7 @@
 	"objects" : 
 	[
 		{
-			"jsonFile" : "codemodel-v2-9ed5b9eadee087677b35.json",
+			"jsonFile" : "codemodel-v2-8309f8584c32333bd27d.json",
 			"kind" : "codemodel",
 			"version" : 
 			{
@@ -108,7 +108,7 @@
 						}
 					},
 					{
-						"jsonFile" : "codemodel-v2-9ed5b9eadee087677b35.json",
+						"jsonFile" : "codemodel-v2-8309f8584c32333bd27d.json",
 						"kind" : "codemodel",
 						"version" : 
 						{

+ 16 - 2
out/build/x64-Debug/.cmake/api/v1/reply/target-Shaders-Debug-4d04420832e8090eb8fd.json → out/build/x64-Debug/.cmake/api/v1/reply/target-Shaders-Debug-9713b874df703b070b85.json

@@ -18,7 +18,7 @@
 			{
 				"command" : 0,
 				"file" : 0,
-				"line" : 53,
+				"line" : 57,
 				"parent" : 0
 			}
 		]
@@ -45,7 +45,9 @@
 			[
 				1,
 				2,
-				3
+				3,
+				4,
+				5
 			]
 		}
 	],
@@ -74,6 +76,18 @@
 			"isGenerated" : true,
 			"path" : "shaders/compiled/PosNormCol.vert.spv.rule",
 			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 0,
+			"isGenerated" : true,
+			"path" : "shaders/compiled/simple_shader.frag.spv.rule",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 0,
+			"isGenerated" : true,
+			"path" : "shaders/compiled/simple_shader.vert.spv.rule",
+			"sourceGroupIndex" : 1
 		}
 	],
 	"type" : "UTILITY"

+ 32 - 4
out/build/x64-Debug/.cmake/api/v1/reply/target-coral_renderer-Debug-e0018bfd4eeb3d52c447.json → out/build/x64-Debug/.cmake/api/v1/reply/target-coral_renderer-Debug-4751cac1473a81c4d049.json

@@ -46,7 +46,7 @@
 			{
 				"command" : 2,
 				"file" : 0,
-				"line" : 16,
+				"line" : 20,
 				"parent" : 0
 			},
 			{
@@ -126,7 +126,9 @@
 				4,
 				6,
 				8,
-				10
+				10,
+				13,
+				15
 			]
 		}
 	],
@@ -212,7 +214,9 @@
 				4,
 				6,
 				8,
-				10
+				10,
+				13,
+				15
 			]
 		},
 		{
@@ -224,7 +228,9 @@
 				5,
 				7,
 				9,
-				11
+				11,
+				12,
+				14
 			]
 		}
 	],
@@ -295,6 +301,28 @@
 			"backtrace" : 1,
 			"path" : "coral_renderer/vk_types.h",
 			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/coral_swapchain.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/coral_swapchain.cpp",
+			"sourceGroupIndex" : 0
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/coral_mesh.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/coral_mesh.cpp",
+			"sourceGroupIndex" : 0
 		}
 	],
 	"type" : "EXECUTABLE"

BIN
out/build/x64-Debug/.ninja_deps


+ 67 - 55
out/build/x64-Debug/.ninja_log

@@ -1,56 +1,68 @@
 # ninja log v5
-83	880	7100896830474354	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_window.c.obj	a8e8a800f8bba3b2
-4	112	7100903934393469	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.frag.spv	fe5845b8ffa9c1e4
-49	879	7100896830274317	third_party/GLFW/src/CMakeFiles/glfw.dir/vulkan.c.obj	aa414f7e617935ab
-1622	1662	7100896838374290	third_party/tinyobjloader.lib	c2812261322ebfda
-13	183	7100896823585962	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.vert.spv	c8f5e229bc7280d6
-69	878	7100896830434348	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_monitor.c.obj	f3bcdc54fc50d40e
-33	884	7100896830594381	third_party/GLFW/src/CMakeFiles/glfw.dir/init.c.obj	4c5b5a61c74a0503
-44	877	7100896830284325	third_party/GLFW/src/CMakeFiles/glfw.dir/monitor.c.obj	9c133f055c1c47
-78	880	7100896830464361	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_thread.c.obj	ac4ae588ab2b3867
-12	1104	7101010250284312	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
-60	884	7100896830574384	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_init.c.obj	f9e962456dc8d656
-73	877	7100896830284325	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_time.c.obj	694a8d84a0a6a42f
-64	881	7100896830464361	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_joystick.c.obj	360eb123f11402ca
-93	867	7100896830284325	third_party/GLFW/src/CMakeFiles/glfw.dir/egl_context.c.obj	336c5a07a7e8f201
-28	882	7100896830494360	third_party/GLFW/src/CMakeFiles/glfw.dir/context.c.obj	40de073679fe6a2e
-88	883	7100896830544372	third_party/GLFW/src/CMakeFiles/glfw.dir/wgl_context.c.obj	e21c7032fbb2c637
-39	883	7100896830494360	third_party/GLFW/src/CMakeFiles/glfw.dir/input.c.obj	956df7c8cf242b34
-884	936	7100896831119011	third_party/GLFW/src/glfw3.lib	90fe5d3bf3988c3
-55	882	7100896830514374	third_party/GLFW/src/CMakeFiles/glfw.dir/window.c.obj	b364e0375cf5f3ae
-177	854	7100896830294323	third_party/GLFW/src/CMakeFiles/glfw.dir/osmesa_context.c.obj	e9ed1005530706e4
-1293	1484	7101010313989280	coral_renderer/coral_renderer.exe	9430c422cdae868a
-21	816	7101010247411132	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
-22	1622	7100896837972087	third_party/CMakeFiles/tinyobjloader.dir/tinyobjloader/tiny_obj_loader.cc.obj	1e9e954b98b13f50
-18	1747	7100896839230016	third_party/CMakeFiles/vkbootstrap.dir/vkbootstrap/VkBootstrap.cpp.obj	64385be2816b800a
-10	22	0	clean	21a4d0550fd2b6b1
-17	901	7100924294778084	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
-17	793	7101010247174908	coral_renderer/CMakeFiles/coral_renderer.dir/coral_window.cpp.obj	bedfd30a6102baa8
-1747	1783	7100896839604022	third_party/vkbootstrap.lib	b339a5cc36d209fb
-11	1292	7101010312856146	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-9	92	7101052779454361	coral_renderer/CMakeFiles/coral_renderer.dir/vk_initializers.cpp.obj	e2dbff82d1c3ba0d
-12	1379	7101053002408436	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-1379	1595	7101053003792744	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-9	947	7101061569586022	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
-4	1203	7101061572146360	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
-15	697	7101062177889014	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
-10	905	7101062179985669	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
-19	930	7101062180232226	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
-23	1479	7101062185678497	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-1479	1667	7101062186843170	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-4	1562	7101063007902346	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-1563	1793	7101063009357869	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-12	1438	7101063203639556	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-1439	1642	7101063204872836	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-12	1293	7101063541931709	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-1293	1485	7101063543131099	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-20	383	7101131425879773	coral_renderer/CMakeFiles/coral_renderer.dir/vk_initializers.cpp.obj	e2dbff82d1c3ba0d
-8	952	7101131431560818	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
-4	1199	7101131434017667	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
-12	1228	7101131434324805	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
-17	1815	7101131440161744	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
-1815	2070	7101131441889449	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-6	805	7101132283528428	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
-806	992	7101132284614039	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
-12	902	7101133893372813	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
-902	1151	7101133894664193	coral_renderer/coral_renderer.exe	20dbc57cca0c9133
+54	916	7101797253873148	third_party/GLFW/src/CMakeFiles/glfw.dir/vulkan.c.obj	aa414f7e617935ab
+898	1546	7101797260609318	coral_renderer/CMakeFiles/coral_renderer.dir/vk_initializers.cpp.obj	e2dbff82d1c3ba0d
+89	918	7101797253903152	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_window.c.obj	a8e8a800f8bba3b2
+8	204	7101797247160227	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.frag.spv	fe5845b8ffa9c1e4
+1948	2000	7101797265153588	third_party/tinyobjloader.lib	c2812261322ebfda
+13	198	7101797247098422	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.vert.spv	c8f5e229bc7280d6
+39	883	7101797253853157	third_party/GLFW/src/CMakeFiles/glfw.dir/init.c.obj	4c5b5a61c74a0503
+75	890	7101797253893155	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_monitor.c.obj	f3bcdc54fc50d40e
+50	918	7101797253953169	third_party/GLFW/src/CMakeFiles/glfw.dir/monitor.c.obj	9c133f055c1c47
+222	1910	7101797264265387	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
+84	915	7101797253953169	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_thread.c.obj	ac4ae588ab2b3867
+80	866	7101797253748007	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_time.c.obj	694a8d84a0a6a42f
+65	898	7101797253903152	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_init.c.obj	f9e962456dc8d656
+204	916	7101797254053199	third_party/GLFW/src/CMakeFiles/glfw.dir/egl_context.c.obj	336c5a07a7e8f201
+70	909	7101797253953169	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_joystick.c.obj	360eb123f11402ca
+34	903	7101797253883159	third_party/GLFW/src/CMakeFiles/glfw.dir/context.c.obj	40de073679fe6a2e
+198	914	7101797254073198	third_party/GLFW/src/CMakeFiles/glfw.dir/wgl_context.c.obj	e21c7032fbb2c637
+918	988	7101797255003457	third_party/GLFW/src/glfw3.lib	90fe5d3bf3988c3
+44	874	7101797253798021	third_party/GLFW/src/CMakeFiles/glfw.dir/input.c.obj	956df7c8cf242b34
+60	914	7101797253913164	third_party/GLFW/src/CMakeFiles/glfw.dir/window.c.obj	b364e0375cf5f3ae
+1022	1209	7101813627819240	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+217	917	7101797254053199	third_party/GLFW/src/CMakeFiles/glfw.dir/osmesa_context.c.obj	e9ed1005530706e4
+875	2144	7101797266526618	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
+30	1948	7101797264615494	third_party/CMakeFiles/tinyobjloader.dir/tinyobjloader/tiny_obj_loader.cc.obj	1e9e954b98b13f50
+26	2160	7101797266733733	third_party/CMakeFiles/vkbootstrap.dir/vkbootstrap/VkBootstrap.cpp.obj	64385be2816b800a
+883	2300	7101797268130843	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
+9	24	0	clean	21a4d0550fd2b6b1
+867	1545	7101797260577747	coral_renderer/CMakeFiles/coral_renderer.dir/coral_window.cpp.obj	bedfd30a6102baa8
+2160	2204	7101797267202309	third_party/vkbootstrap.lib	b339a5cc36d209fb
+11	1313	7101809551655538	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
+17	217	7101797247304796	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.frag.spv	abf5977eb3a7ad06
+903	2166	7101797266765707	coral_renderer/CMakeFiles/coral_renderer.dir/coral_swapchain.cpp.obj	1e16c3634dad8b40
+21	221	7101797247327643	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv	668e2527d551a6cf
+11	1021	7101813626754078	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+14	1022	7101813921068553	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+1023	1210	7101813922195478	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+17	1060	7101814667900638	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
+28	1076	7101814668060763	coral_renderer/CMakeFiles/coral_renderer.dir/coral_swapchain.cpp.obj	1e16c3634dad8b40
+12	1162	7101814668923719	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
+21	1219	7101814669485321	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
+32	1247	7101814669778136	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+24	1553	7101814672825950	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
+1553	1757	7101814674079170	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+17	1104	7101815094116056	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
+29	1155	7101815094629939	coral_renderer/CMakeFiles/coral_renderer.dir/coral_swapchain.cpp.obj	1e16c3634dad8b40
+12	1253	7101815095619887	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
+20	1288	7101815095940613	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
+33	1336	7101815096438615	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+25	1633	7101815099389606	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
+1633	1904	7101815101218050	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+11	997	7101816146989106	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+998	1176	7101816148013515	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+13	1018	7101817030390874	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+1018	1202	7101817031458740	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+12	1069	7101817353959200	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+1070	1282	7101817355082332	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+16	1367	7101820695463999	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	2fa3f3bbdc72680a
+11	1369	7101820695494010	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	f207d5295f665d92
+29	1390	7101820695680997	coral_renderer/CMakeFiles/coral_renderer.dir/coral_swapchain.cpp.obj	1e16c3634dad8b40
+20	1403	7101820695836190	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
+32	1482	7101820696630201	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+25	1792	7101820699737117	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	f65feb738e17e8d7
+1792	2006	7101820701049026	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+20	1413	7101828304875727	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	429a0363ba93b7c7
+1414	1685	7101828306644427	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9
+12	1305	7101828747172493	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	ab6486da48f5e166
+1306	1512	7101828748416247	coral_renderer/coral_renderer.exe	a2f5951cf56c54b9

+ 2 - 2
out/build/x64-Debug/Testing/Temporary/LastTest.log

@@ -1,3 +1,3 @@
-Start testing: Jul 03 18:34 Romance Daylight Time
+Start testing: Jul 04 15:14 Romance Daylight Time
 ----------------------------------------------------------
-End testing: Jul 03 18:34 Romance Daylight Time
+End testing: Jul 04 15:14 Romance Daylight Time

+ 37 - 3
out/build/x64-Debug/build.ninja

@@ -155,6 +155,22 @@ build coral_renderer\CMakeFiles\coral_renderer.dir\vk_initializers.cpp.obj: CXX_
   TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
   TARGET_PDB = coral_renderer\coral_renderer.pdb
 
+build coral_renderer\CMakeFiles\coral_renderer.dir\coral_swapchain.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Debug C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\coral_swapchain.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -std:c++latest -MDd /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
+build coral_renderer\CMakeFiles\coral_renderer.dir\coral_mesh.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Debug C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\coral_mesh.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -std:c++latest -MDd /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
 
 # =============================================================================
 # Link build statements for EXECUTABLE target coral_renderer
@@ -163,7 +179,7 @@ build coral_renderer\CMakeFiles\coral_renderer.dir\vk_initializers.cpp.obj: CXX_
 #############################################
 # Link the executable coral_renderer\coral_renderer.exe
 
-build coral_renderer\coral_renderer.exe: CXX_EXECUTABLE_LINKER__coral_renderer_Debug coral_renderer\CMakeFiles\coral_renderer.dir\main.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_window.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\first_app.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_pipeline.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_device.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\vk_initializers.cpp.obj | C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib third_party\GLFW\src\glfw3.lib third_party\vkbootstrap.lib third_party\tinyobjloader.lib C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib || coral_renderer\Shaders third_party\GLFW\src\glfw3.lib third_party\tinyobjloader.lib third_party\vkbootstrap.lib
+build coral_renderer\coral_renderer.exe: CXX_EXECUTABLE_LINKER__coral_renderer_Debug coral_renderer\CMakeFiles\coral_renderer.dir\main.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_window.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\first_app.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_pipeline.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_device.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\vk_initializers.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_swapchain.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_mesh.cpp.obj | C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib third_party\GLFW\src\glfw3.lib third_party\vkbootstrap.lib third_party\tinyobjloader.lib C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib || coral_renderer\Shaders third_party\GLFW\src\glfw3.lib third_party\tinyobjloader.lib third_party\vkbootstrap.lib
   FLAGS = /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd
   LINK_FLAGS = /machine:x64 /debug /INCREMENTAL /subsystem:console
   LINK_LIBRARIES = C:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib  third_party\GLFW\src\glfw3.lib  third_party\vkbootstrap.lib  third_party\tinyobjloader.lib  C:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
@@ -179,7 +195,7 @@ build coral_renderer\coral_renderer.exe: CXX_EXECUTABLE_LINKER__coral_renderer_D
 #############################################
 # Utility command for Shaders
 
-build coral_renderer\Shaders: phony coral_renderer\CMakeFiles\Shaders C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv
+build coral_renderer\Shaders: phony coral_renderer\CMakeFiles\Shaders C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv
 
 
 #############################################
@@ -238,7 +254,7 @@ build coral_renderer\install\local: phony coral_renderer\CMakeFiles\install\loca
 #############################################
 # Phony custom command for coral_renderer\CMakeFiles\Shaders
 
-build coral_renderer\CMakeFiles\Shaders | ${cmake_ninja_workdir}coral_renderer\CMakeFiles\Shaders: phony C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv
+build coral_renderer\CMakeFiles\Shaders | ${cmake_ninja_workdir}coral_renderer\CMakeFiles\Shaders: phony C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv
 
 
 #############################################
@@ -258,6 +274,24 @@ build C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\P
   DESC = Generating C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.vert.spv
   restat = 1
 
+
+#############################################
+# Custom command for C:\Game Development\Visual Studio Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv
+
+build C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv: CUSTOM_COMMAND C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\simple_shader.frag
+  COMMAND = cmd.exe /C "cd /D "C:\Game Development\Visual Studio Solutions\Coral3D\out\build\x64-Debug\coral_renderer" && "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/" && C:\VulkanSDK\1.3.250.0\Bin\glslangValidator.exe -V "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/simple_shader.frag" -o "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.frag.spv""
+  DESC = Generating C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.frag.spv
+  restat = 1
+
+
+#############################################
+# Custom command for C:\Game Development\Visual Studio Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv
+
+build C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv: CUSTOM_COMMAND C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\simple_shader.vert
+  COMMAND = cmd.exe /C "cd /D "C:\Game Development\Visual Studio Solutions\Coral3D\out\build\x64-Debug\coral_renderer" && "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/" && C:\VulkanSDK\1.3.250.0\Bin\glslangValidator.exe -V "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/simple_shader.vert" -o "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv""
+  DESC = Generating C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv
+  restat = 1
+
 # =============================================================================
 # Write statements declared in CMakeLists.txt:
 # C:/Game Development/Visual Studio Solutions/Coral3D/CMakeLists.txt

BIN
out/build/x64-Debug/coral_renderer/CMakeFiles/coral_renderer.dir/vc140.pdb


BIN
out/build/x64-Debug/coral_renderer/coral_renderer.ilk


BIN
out/build/x64-Debug/coral_renderer/coral_renderer.pdb


BIN
out/build/x64-Debug/coral_renderer/shaders/simple_shader.frag.spv


BIN
out/build/x64-Debug/coral_renderer/shaders/simple_shader.vert.spv


BIN
out/build/x64-Debug/third_party/CMakeFiles/tinyobjloader.dir/tinyobjloader.pdb


BIN
out/build/x64-Debug/third_party/CMakeFiles/vkbootstrap.dir/vkbootstrap.pdb


BIN
out/build/x64-Debug/third_party/GLFW/src/CMakeFiles/glfw.dir/glfw.pdb


+ 2 - 2
out/build/x64-Release/.cmake/api/v1/reply/codemodel-v2-f73569e23392736257a9.json → out/build/x64-Release/.cmake/api/v1/reply/codemodel-v2-ac648e5c53f91b8134f2.json

@@ -139,14 +139,14 @@
 				{
 					"directoryIndex" : 1,
 					"id" : "Shaders::@189d46817749ee15bd40",
-					"jsonFile" : "target-Shaders-Release-77bb2b952049524fbd31.json",
+					"jsonFile" : "target-Shaders-Release-65cec1358e0fb2f582be.json",
 					"name" : "Shaders",
 					"projectIndex" : 0
 				},
 				{
 					"directoryIndex" : 1,
 					"id" : "coral_renderer::@189d46817749ee15bd40",
-					"jsonFile" : "target-coral_renderer-Release-b751ccf4422d8983155e.json",
+					"jsonFile" : "target-coral_renderer-Release-dca39ccbb87791bcfff6.json",
 					"name" : "coral_renderer",
 					"projectIndex" : 0
 				},

+ 2 - 2
out/build/x64-Release/.cmake/api/v1/reply/index-2023-07-03T11-52-01-0461.json → out/build/x64-Release/.cmake/api/v1/reply/index-2023-07-04T12-29-44-0246.json

@@ -26,7 +26,7 @@
 	"objects" : 
 	[
 		{
-			"jsonFile" : "codemodel-v2-f73569e23392736257a9.json",
+			"jsonFile" : "codemodel-v2-ac648e5c53f91b8134f2.json",
 			"kind" : "codemodel",
 			"version" : 
 			{
@@ -108,7 +108,7 @@
 						}
 					},
 					{
-						"jsonFile" : "codemodel-v2-f73569e23392736257a9.json",
+						"jsonFile" : "codemodel-v2-ac648e5c53f91b8134f2.json",
 						"kind" : "codemodel",
 						"version" : 
 						{

+ 16 - 2
out/build/x64-Release/.cmake/api/v1/reply/target-Shaders-Release-77bb2b952049524fbd31.json → out/build/x64-Release/.cmake/api/v1/reply/target-Shaders-Release-65cec1358e0fb2f582be.json

@@ -18,7 +18,7 @@
 			{
 				"command" : 0,
 				"file" : 0,
-				"line" : 46,
+				"line" : 57,
 				"parent" : 0
 			}
 		]
@@ -45,7 +45,9 @@
 			[
 				1,
 				2,
-				3
+				3,
+				4,
+				5
 			]
 		}
 	],
@@ -74,6 +76,18 @@
 			"isGenerated" : true,
 			"path" : "shaders/compiled/PosNormCol.vert.spv.rule",
 			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 0,
+			"isGenerated" : true,
+			"path" : "shaders/compiled/simple_shader.frag.spv.rule",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 0,
+			"isGenerated" : true,
+			"path" : "shaders/compiled/simple_shader.vert.spv.rule",
+			"sourceGroupIndex" : 1
 		}
 	],
 	"type" : "UTILITY"

+ 80 - 4
out/build/x64-Release/.cmake/api/v1/reply/target-coral_renderer-Release-b751ccf4422d8983155e.json → out/build/x64-Release/.cmake/api/v1/reply/target-coral_renderer-Release-dca39ccbb87791bcfff6.json

@@ -46,7 +46,7 @@
 			{
 				"command" : 2,
 				"file" : 0,
-				"line" : 9,
+				"line" : 20,
 				"parent" : 0
 			},
 			{
@@ -123,7 +123,12 @@
 			[
 				0,
 				2,
-				4
+				4,
+				6,
+				8,
+				10,
+				13,
+				15
 			]
 		}
 	],
@@ -206,7 +211,12 @@
 			[
 				0,
 				2,
-				4
+				4,
+				6,
+				8,
+				10,
+				13,
+				15
 			]
 		},
 		{
@@ -214,7 +224,13 @@
 			"sourceIndexes" : 
 			[
 				1,
-				3
+				3,
+				5,
+				7,
+				9,
+				11,
+				12,
+				14
 			]
 		}
 	],
@@ -247,6 +263,66 @@
 			"compileGroupIndex" : 0,
 			"path" : "coral_renderer/first_app.cpp",
 			"sourceGroupIndex" : 0
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/coral_pipeline.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/coral_pipeline.cpp",
+			"sourceGroupIndex" : 0
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/coral_device.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/coral_device.cpp",
+			"sourceGroupIndex" : 0
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/vk_initializers.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/vk_initializers.cpp",
+			"sourceGroupIndex" : 0
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/vk_types.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/coral_swapchain.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/coral_swapchain.cpp",
+			"sourceGroupIndex" : 0
+		},
+		{
+			"backtrace" : 1,
+			"path" : "coral_renderer/coral_mesh.h",
+			"sourceGroupIndex" : 1
+		},
+		{
+			"backtrace" : 1,
+			"compileGroupIndex" : 0,
+			"path" : "coral_renderer/coral_mesh.cpp",
+			"sourceGroupIndex" : 0
 		}
 	],
 	"type" : "EXECUTABLE"

BIN
out/build/x64-Release/.ninja_deps


+ 24 - 17
out/build/x64-Release/.ninja_log

@@ -6,8 +6,8 @@
 48	533	7100855575363947	third_party/GLFW/src/CMakeFiles/glfw.dir/vulkan.c.obj	50112318efae01fe
 52	556	7100855575942714	third_party/GLFW/src/CMakeFiles/glfw.dir/window.c.obj	b267b6f52b0557e
 216	674	7100855577256160	third_party/GLFW/src/CMakeFiles/glfw.dir/osmesa_context.c.obj	2663e4857ff8180d
-2305	2550	7100855595549284	coral_renderer/coral_renderer.exe	ccfd0e35dba99ec9
-241	1289	7100855583386832	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
+1017	1323	7101756922529644	coral_renderer/coral_renderer.exe	a6395eeb94f36c43
+154	1219	7101751385543458	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
 73	503	7100855575293922	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_thread.c.obj	6c2cec83621ddafc
 57	578	7100855576238736	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_init.c.obj	68f7b915a77efee8
 69	507	7100855575379068	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_time.c.obj	884400c2fc506c25
@@ -20,28 +20,35 @@
 674	715	7100855577635956	third_party/GLFW/src/glfw3.lib	90fe5d3bf3988c3
 18	258	7100852038349954	vk_renderer/CMakeFiles/vulkan_renderer.dir/vk_initializers.cpp.obj	1a23cbea97f95bc8
 77	616	7100855576629194	third_party/GLFW/src/CMakeFiles/glfw.dir/win32_window.c.obj	527eb72162ba2c60
-10	215	7100855572447129	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.frag.spv	448936cb354b7e2
+12	153	7101751374871499	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.frag.spv	448936cb354b7e2
+175	871	7101751382025806	coral_renderer/CMakeFiles/coral_renderer.dir/vk_initializers.cpp.obj	aa9d2c8a14870cfd
 20	1886	7100855589315037	third_party/CMakeFiles/vkbootstrap.dir/vkbootstrap/VkBootstrap.cpp.obj	862a6e5bff7e48ac
 1886	1925	7100855589753305	third_party/vkbootstrap.lib	b339a5cc36d209fb
 24	2270	7100855593137340	third_party/CMakeFiles/tinyobjloader.dir/tinyobjloader/tiny_obj_loader.cc.obj	7e86ec27a38d2d6c
 2270	2305	7100855593551870	third_party/tinyobjloader.lib	c2812261322ebfda
 16	241	7100855572697851	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.vert.spv	565da56699a6ae9f
 6	20	0	clean	21a4d0550fd2b6b1
+167	1218	7101751385543458	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	547825035d4ce491
 22	1341	7100852049212694	vk_renderer/CMakeFiles/vulkan_renderer.dir/vk_pipeline.cpp.obj	f2ccefde0539b7f9
 26	1697	7100852052759820	vk_renderer/CMakeFiles/vulkan_renderer.dir/vk_mesh.cpp.obj	19e27ee69060c408
 14	4028	7100852076065734	vk_renderer/CMakeFiles/vulkan_renderer.dir/vk_engine.cpp.obj	2c2e8f4c68659d3e
 4028	4204	7100852077869201	vk_renderer/vulkan_renderer.exe	4a4de8c4dd150dc4
-16	431	7100883227198099	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
-8	631	7100883229193345	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
-18	426	7100883456482019	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
-11	608	7100883458285043	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
-19	422	7100883721539116	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
-11	604	7100883723332169	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
-19	374	7100884215580013	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
-15	395	7100884215800054	coral_renderer/CMakeFiles/coral_renderer.dir/coral_window.cpp.obj	8f70bdc66a8c898
-11	605	7100884217890634	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
-606	861	7100884219977107	coral_renderer/coral_renderer.exe	468e142b22d91fbf
-12	509	7100885537069055	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
-8	526	7100885537229128	coral_renderer/CMakeFiles/coral_renderer.dir/coral_window.cpp.obj	8f70bdc66a8c898
-4	759	7100885539562039	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
-759	1045	7100885541911992	coral_renderer/coral_renderer.exe	468e142b22d91fbf
+163	1061	7101751383959997	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
+158	892	7101751382273133	coral_renderer/CMakeFiles/coral_renderer.dir/coral_window.cpp.obj	8f70bdc66a8c898
+23	147	7101751374786118	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv	8117d59f521bfb38
+17	154	7101751374871499	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.frag.spv	c6f90537dba2deae
+11	1016	7101756919953863	coral_renderer/CMakeFiles/coral_renderer.dir/coral_swapchain.cpp.obj	73d0ad4b7fd6b8be
+171	2252	7101751395848258	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	54ea3dd64d178489
+13	1241	7101796482428884	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
+18	1297	7101796483005446	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
+23	1317	7101796483196618	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	547825035d4ce491
+13	1106	7101796697760818	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	c9cebafec58901df
+1106	1464	7101796700787466	coral_renderer/coral_renderer.exe	46b48affdb39d636
+21	134	7101828950014594	C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv	8117d59f521bfb38
+134	1435	7101828962610616	coral_renderer/CMakeFiles/coral_renderer.dir/main.cpp.obj	b04a92f83a26ca98
+138	1484	7101828963429522	coral_renderer/CMakeFiles/coral_renderer.dir/first_app.cpp.obj	f6aa697f38bcc8c1
+151	1510	7101828963709605	coral_renderer/CMakeFiles/coral_renderer.dir/coral_swapchain.cpp.obj	73d0ad4b7fd6b8be
+143	1543	7101828964050193	coral_renderer/CMakeFiles/coral_renderer.dir/coral_pipeline.cpp.obj	547825035d4ce491
+155	1641	7101828965056591	coral_renderer/CMakeFiles/coral_renderer.dir/coral_mesh.cpp.obj	c9cebafec58901df
+147	2319	7101828971832944	coral_renderer/CMakeFiles/coral_renderer.dir/coral_device.cpp.obj	54ea3dd64d178489
+2319	2618	7101828974349382	coral_renderer/coral_renderer.exe	46b48affdb39d636

+ 2 - 2
out/build/x64-Release/Testing/Temporary/LastTest.log

@@ -1,3 +1,3 @@
-Start testing: Jul 03 13:52 Romance Daylight Time
+Start testing: Jul 04 14:29 Romance Daylight Time
 ----------------------------------------------------------
-End testing: Jul 03 13:52 Romance Daylight Time
+End testing: Jul 04 14:29 Romance Daylight Time

+ 61 - 3
out/build/x64-Release/build.ninja

@@ -131,6 +131,46 @@ build coral_renderer\CMakeFiles\coral_renderer.dir\first_app.cpp.obj: CXX_COMPIL
   TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
   TARGET_PDB = coral_renderer\coral_renderer.pdb
 
+build coral_renderer\CMakeFiles\coral_renderer.dir\coral_pipeline.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Release C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\coral_pipeline.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++latest -MD /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
+build coral_renderer\CMakeFiles\coral_renderer.dir\coral_device.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Release C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\coral_device.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++latest -MD /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
+build coral_renderer\CMakeFiles\coral_renderer.dir\vk_initializers.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Release C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\vk_initializers.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++latest -MD /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
+build coral_renderer\CMakeFiles\coral_renderer.dir\coral_swapchain.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Release C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\coral_swapchain.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++latest -MD /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
+build coral_renderer\CMakeFiles\coral_renderer.dir\coral_mesh.cpp.obj: CXX_COMPILER__coral_renderer_unscanned_Release C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\coral_renderer\coral_mesh.cpp || cmake_object_order_depends_target_coral_renderer
+  FLAGS = /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -std:c++latest -MD /W4 /WX /w
+  INCLUDES = -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\GLFW\include" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\glm" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vkbootstrap" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\tinyobjloader" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\vma" -I"C:\Game Development\Visual Studio Solutions\Coral3D\third_party\stb_image" -external:IC:\VulkanSDK\1.3.250.0\Include -external:W0
+  OBJECT_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  OBJECT_FILE_DIR = coral_renderer\CMakeFiles\coral_renderer.dir
+  TARGET_COMPILE_PDB = coral_renderer\CMakeFiles\coral_renderer.dir\
+  TARGET_PDB = coral_renderer\coral_renderer.pdb
+
 
 # =============================================================================
 # Link build statements for EXECUTABLE target coral_renderer
@@ -139,7 +179,7 @@ build coral_renderer\CMakeFiles\coral_renderer.dir\first_app.cpp.obj: CXX_COMPIL
 #############################################
 # Link the executable coral_renderer\coral_renderer.exe
 
-build coral_renderer\coral_renderer.exe: CXX_EXECUTABLE_LINKER__coral_renderer_Release coral_renderer\CMakeFiles\coral_renderer.dir\main.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_window.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\first_app.cpp.obj | C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib third_party\GLFW\src\glfw3.lib third_party\vkbootstrap.lib third_party\tinyobjloader.lib C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib || coral_renderer\Shaders third_party\GLFW\src\glfw3.lib third_party\tinyobjloader.lib third_party\vkbootstrap.lib
+build coral_renderer\coral_renderer.exe: CXX_EXECUTABLE_LINKER__coral_renderer_Release coral_renderer\CMakeFiles\coral_renderer.dir\main.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_window.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\first_app.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_pipeline.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_device.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\vk_initializers.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_swapchain.cpp.obj coral_renderer\CMakeFiles\coral_renderer.dir\coral_mesh.cpp.obj | C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib third_party\GLFW\src\glfw3.lib third_party\vkbootstrap.lib third_party\tinyobjloader.lib C$:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib || coral_renderer\Shaders third_party\GLFW\src\glfw3.lib third_party\tinyobjloader.lib third_party\vkbootstrap.lib
   FLAGS = /DWIN32 /D_WINDOWS /EHsc /O2 /Ob2 /DNDEBUG -MD
   LINK_FLAGS = /machine:x64 /INCREMENTAL:NO /subsystem:console
   LINK_LIBRARIES = C:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib  third_party\GLFW\src\glfw3.lib  third_party\vkbootstrap.lib  third_party\tinyobjloader.lib  C:\VulkanSDK\1.3.250.0\Lib\vulkan-1.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
@@ -155,7 +195,7 @@ build coral_renderer\coral_renderer.exe: CXX_EXECUTABLE_LINKER__coral_renderer_R
 #############################################
 # Utility command for Shaders
 
-build coral_renderer\Shaders: phony coral_renderer\CMakeFiles\Shaders C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv
+build coral_renderer\Shaders: phony coral_renderer\CMakeFiles\Shaders C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv
 
 
 #############################################
@@ -214,7 +254,7 @@ build coral_renderer\install\local: phony coral_renderer\CMakeFiles\install\loca
 #############################################
 # Phony custom command for coral_renderer\CMakeFiles\Shaders
 
-build coral_renderer\CMakeFiles\Shaders | ${cmake_ninja_workdir}coral_renderer\CMakeFiles\Shaders: phony C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv
+build coral_renderer\CMakeFiles\Shaders | ${cmake_ninja_workdir}coral_renderer\CMakeFiles\Shaders: phony C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\PosNormCol.vert.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv
 
 
 #############################################
@@ -234,6 +274,24 @@ build C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\P
   DESC = Generating C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/PosNormCol.vert.spv
   restat = 1
 
+
+#############################################
+# Custom command for C:\Game Development\Visual Studio Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv
+
+build C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.frag.spv: CUSTOM_COMMAND C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\simple_shader.frag
+  COMMAND = cmd.exe /C "cd /D "C:\Game Development\Visual Studio Solutions\Coral3D\out\build\x64-Release\coral_renderer" && "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/" && C:\VulkanSDK\1.3.250.0\Bin\glslangValidator.exe -V "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/simple_shader.frag" -o "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.frag.spv""
+  DESC = Generating C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.frag.spv
+  restat = 1
+
+
+#############################################
+# Custom command for C:\Game Development\Visual Studio Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv
+
+build C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\compiled\simple_shader.vert.spv: CUSTOM_COMMAND C$:\Game$ Development\Visual$ Studio$ Solutions\Coral3D\shaders\simple_shader.vert
+  COMMAND = cmd.exe /C "cd /D "C:\Game Development\Visual Studio Solutions\Coral3D\out\build\x64-Release\coral_renderer" && "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E make_directory "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/" && C:\VulkanSDK\1.3.250.0\Bin\glslangValidator.exe -V "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/simple_shader.vert" -o "C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv""
+  DESC = Generating C:/Game Development/Visual Studio Solutions/Coral3D/shaders/compiled/simple_shader.vert.spv
+  restat = 1
+
 # =============================================================================
 # Write statements declared in CMakeLists.txt:
 # C:/Game Development/Visual Studio Solutions/Coral3D/CMakeLists.txt

BIN
out/build/x64-Release/coral_renderer/shaders/simple_shader.frag.spv


BIN
out/build/x64-Release/coral_renderer/shaders/simple_shader.vert.spv


BIN
shaders/compiled/simple_shader.frag.spv


BIN
shaders/compiled/simple_shader.vert.spv


+ 7 - 0
shaders/simple_shader.frag

@@ -0,0 +1,7 @@
+#version 450
+
+layout (location = 0) out vec4 outColor;
+
+void main() {
+  outColor = vec4(1.0, 1.0, 0.0, 1.0);
+}

+ 7 - 0
shaders/simple_shader.vert

@@ -0,0 +1,7 @@
+#version 450
+
+layout(location = 0) in vec2 position;
+
+void main() {
+  gl_Position = vec4(position, 0.0, 1.0);
+}