Remove old TODO; begin texture impl.

This commit is contained in:
bailwillharr 2022-11-09 15:37:16 +00:00
parent 52009da6fa
commit d4106091cd
3 changed files with 10 additions and 7 deletions

View File

@ -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;

View File

@ -130,7 +130,6 @@ namespace engine {
addInputButtonAsAxis(name, InputDevice::MOUSE, static_cast<int>(high), static_cast<int>(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<int>(button));

View File

@ -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()