hack to fix sub buffer index issue

pull/8/head
cosmonaut 2020-12-22 21:53:39 -08:00
parent 14993a4f22
commit 87920c0048
2 changed files with 9 additions and 10 deletions

View File

@ -286,8 +286,7 @@ typedef enum REFRESH_ColorComponentFlagBits
REFRESH_COLORCOMPONENT_R_BIT = 0x00000001, REFRESH_COLORCOMPONENT_R_BIT = 0x00000001,
REFRESH_COLORCOMPONENT_G_BIT = 0x00000002, REFRESH_COLORCOMPONENT_G_BIT = 0x00000002,
REFRESH_COLORCOMPONENT_B_BIT = 0x00000004, REFRESH_COLORCOMPONENT_B_BIT = 0x00000004,
REFRESH_COLORCOMPONENT_A_BIT = 0x00000008, REFRESH_COLORCOMPONENT_A_BIT = 0x00000008
REFRESH_COLORCOMPONENT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} REFRESH_ColorComponentFlagBits; } REFRESH_ColorComponentFlagBits;
typedef uint32_t REFRESH_ColorComponentFlags; typedef uint32_t REFRESH_ColorComponentFlags;
@ -430,7 +429,7 @@ typedef struct REFRESH_StencilOpState
REFRESH_StencilOp failOp; REFRESH_StencilOp failOp;
REFRESH_StencilOp passOp; REFRESH_StencilOp passOp;
REFRESH_StencilOp depthFailOp; REFRESH_StencilOp depthFailOp;
REFRESH_StencilOp compareOp; REFRESH_CompareOp compareOp;
uint32_t compareMask; uint32_t compareMask;
uint32_t writeMask; uint32_t writeMask;
uint32_t reference; uint32_t reference;

View File

@ -4251,10 +4251,10 @@ static void VULKAN_INTERNAL_SetBufferData(
uint8_t* mapPointer; uint8_t* mapPointer;
VkResult vulkanResult; VkResult vulkanResult;
#define SUBBUF vulkanBuffer->subBuffers[renderer->frameIndex] #define SUBBUF vulkanBuffer->subBuffers[0] // FIXME: testing
/* Buffer already bound, time to die */ /* 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."); REFRESH_LogError("Buffer already bound. It is an error to write data to a buffer after binding before calling Present.");
return; return;
@ -4643,10 +4643,10 @@ static void VULKAN_BeginRenderPass(
for (i = 0; i < colorClearCount; i += 1) for (i = 0; i < colorClearCount; i += 1)
{ {
clearValues[i].color.float32[0] = pColorClearValues[i].r / 256.0f; clearValues[i].color.float32[0] = pColorClearValues[i].r / 255.0f;
clearValues[i].color.float32[1] = pColorClearValues[i].g / 256.0f; clearValues[i].color.float32[1] = pColorClearValues[i].g / 255.0f;
clearValues[i].color.float32[2] = pColorClearValues[i].b / 256.0f; clearValues[i].color.float32[2] = pColorClearValues[i].b / 255.0f;
clearValues[i].color.float32[3] = pColorClearValues[i].a / 256.0f; clearValues[i].color.float32[3] = pColorClearValues[i].a / 255.0f;
} }
if (depthStencilClearValue != NULL) if (depthStencilClearValue != NULL)
@ -4753,7 +4753,7 @@ static void VULKAN_BindVertexBuffers(
for (i = 0; i < bindingCount; i += 1) for (i = 0; i < bindingCount; i += 1)
{ {
currentBuffer = (VulkanBuffer*) pBuffers[i]; currentBuffer = (VulkanBuffer*) pBuffers[i];
buffers[i] = currentBuffer->subBuffers[renderer->frameIndex]->buffer; buffers[i] = currentBuffer->subBuffers[0]->buffer; // FIXME: testing
VULKAN_INTERNAL_MarkAsBound(renderer, currentBuffer); VULKAN_INTERNAL_MarkAsBound(renderer, currentBuffer);
} }