From d4106091cd117ecb9a6c001c0b3692b72825c6fa Mon Sep 17 00:00:00 2001 From: bailwillharr Date: Wed, 9 Nov 2022 15:37:16 +0000 Subject: [PATCH] Remove old TODO; begin texture impl. --- src/gfx_device_vulkan.cpp | 11 +++++++++-- src/input.cpp | 3 +-- test/CMakeLists.txt | 3 --- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gfx_device_vulkan.cpp b/src/gfx_device_vulkan.cpp index f90bcb7..baf4c2e 100644 --- a/src/gfx_device_vulkan.cpp +++ b/src/gfx_device_vulkan.cpp @@ -65,6 +65,12 @@ namespace engine { VkImageView view; }; + struct Texture { + VkImage image; + VmaAllocation allocation; + // TODO + }; + struct Swapchain { VkSwapchainKHR swapchain = VK_NULL_HANDLE; @@ -1394,11 +1400,12 @@ namespace engine { bufferInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; VmaAllocationCreateInfo allocInfo{}; - allocInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; // prefer CPU memory for uniforms + allocInfo.usage = VMA_MEMORY_USAGE_AUTO; allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; - res = vmaCreateBuffer(pimpl->allocator, &bufferInfo, &allocInfo, &buf->buffer, &buf->allocation, nullptr); + VmaAllocationInfo resultingAlloc; + res = vmaCreateBuffer(pimpl->allocator, &bufferInfo, &allocInfo, &buf->buffer, &buf->allocation, &resultingAlloc); assert(res == VK_SUCCESS); pipeline->uniformBuffers[i] = buf; diff --git a/src/input.cpp b/src/input.cpp index c65598e..be1b9fa 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -130,7 +130,6 @@ namespace engine { addInputButtonAsAxis(name, InputDevice::MOUSE, static_cast(high), static_cast(low)); } - // Add a keyboard input (TODO: add KeyboardButton enum class) void Input::addInputButton(const std::string& name, inputs::Key button) { addInputButton(name, InputDevice::KEYBOARD, static_cast(button)); @@ -234,4 +233,4 @@ namespace engine { return isReleased; } -} \ No newline at end of file +} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ed7d8e2..133cbdb 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -23,9 +23,6 @@ set(GAME_SOURCES if (WIN32) add_executable(${PROJECT_NAME} WIN32 ${GAME_SOURCES} "game.rc") - - file(GLOB_RECURSE RES_FILES "${PROJECT_SOURCE_DIR}/res/*") - source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/res" PREFIX "Resources" FILES ${RES_FILES}) else() add_executable(${PROJECT_NAME} ${GAME_SOURCES}) endif()