From 87920c0048384a0982cba0a4c5b0187f74372ad4 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 22 Dec 2020 21:53:39 -0800 Subject: [PATCH] hack to fix sub buffer index issue --- include/Refresh.h | 5 ++--- src/Refresh_Driver_Vulkan.c | 14 +++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/Refresh.h b/include/Refresh.h index 5729084..b5d9238 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -286,8 +286,7 @@ typedef enum REFRESH_ColorComponentFlagBits REFRESH_COLORCOMPONENT_R_BIT = 0x00000001, REFRESH_COLORCOMPONENT_G_BIT = 0x00000002, REFRESH_COLORCOMPONENT_B_BIT = 0x00000004, - REFRESH_COLORCOMPONENT_A_BIT = 0x00000008, - REFRESH_COLORCOMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF + REFRESH_COLORCOMPONENT_A_BIT = 0x00000008 } REFRESH_ColorComponentFlagBits; typedef uint32_t REFRESH_ColorComponentFlags; @@ -430,7 +429,7 @@ typedef struct REFRESH_StencilOpState REFRESH_StencilOp failOp; REFRESH_StencilOp passOp; REFRESH_StencilOp depthFailOp; - REFRESH_StencilOp compareOp; + REFRESH_CompareOp compareOp; uint32_t compareMask; uint32_t writeMask; uint32_t reference; diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index c5f8ea7..5c175ae 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -4251,10 +4251,10 @@ static void VULKAN_INTERNAL_SetBufferData( uint8_t* mapPointer; VkResult vulkanResult; - #define SUBBUF vulkanBuffer->subBuffers[renderer->frameIndex] + #define SUBBUF vulkanBuffer->subBuffers[0] // FIXME: testing /* Buffer already bound, time to die */ - if (vulkanBuffer->subBuffers[renderer->frameIndex]->bound) + if (SUBBUF->bound) { REFRESH_LogError("Buffer already bound. It is an error to write data to a buffer after binding before calling Present."); return; @@ -4643,10 +4643,10 @@ static void VULKAN_BeginRenderPass( for (i = 0; i < colorClearCount; i += 1) { - clearValues[i].color.float32[0] = pColorClearValues[i].r / 256.0f; - clearValues[i].color.float32[1] = pColorClearValues[i].g / 256.0f; - clearValues[i].color.float32[2] = pColorClearValues[i].b / 256.0f; - clearValues[i].color.float32[3] = pColorClearValues[i].a / 256.0f; + clearValues[i].color.float32[0] = pColorClearValues[i].r / 255.0f; + clearValues[i].color.float32[1] = pColorClearValues[i].g / 255.0f; + clearValues[i].color.float32[2] = pColorClearValues[i].b / 255.0f; + clearValues[i].color.float32[3] = pColorClearValues[i].a / 255.0f; } if (depthStencilClearValue != NULL) @@ -4753,7 +4753,7 @@ static void VULKAN_BindVertexBuffers( for (i = 0; i < bindingCount; i += 1) { currentBuffer = (VulkanBuffer*) pBuffers[i]; - buffers[i] = currentBuffer->subBuffers[renderer->frameIndex]->buffer; + buffers[i] = currentBuffer->subBuffers[0]->buffer; // FIXME: testing VULKAN_INTERNAL_MarkAsBound(renderer, currentBuffer); }