change renderArea to a pointer

submit_rewrite
cosmonaut 2021-01-26 20:27:42 -08:00
parent 316e662f44
commit 68d9a74ff4
4 changed files with 18 additions and 16 deletions

View File

@ -1182,7 +1182,7 @@ REFRESHAPI void Refresh_BeginRenderPass(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_RenderPass *renderPass, Refresh_RenderPass *renderPass,
Refresh_Framebuffer *framebuffer, Refresh_Framebuffer *framebuffer,
Refresh_Rect renderArea, Refresh_Rect *renderArea,
Refresh_Color *pColorClearValues, Refresh_Color *pColorClearValues,
uint32_t colorClearCount, uint32_t colorClearCount,
Refresh_DepthStencilValue *depthStencilClearValue Refresh_DepthStencilValue *depthStencilClearValue

View File

@ -347,7 +347,7 @@ Refresh_Texture* Refresh_CreateTexture(
); );
} }
Refresh_RenderTarget* Refresh_CreateColorTarget( Refresh_RenderTarget* Refresh_CreateRenderTarget(
Refresh_Device *device, Refresh_Device *device,
Refresh_TextureSlice *textureSlice, Refresh_TextureSlice *textureSlice,
Refresh_SampleCount multisampleCount Refresh_SampleCount multisampleCount
@ -587,7 +587,7 @@ void Refresh_QueueDestroyBuffer(
); );
} }
void Refresh_QueueDestroyColorTarget( void Refresh_QueueDestroyRenderTarget(
Refresh_Device *device, Refresh_Device *device,
Refresh_RenderTarget *renderTarget Refresh_RenderTarget *renderTarget
) { ) {
@ -658,7 +658,7 @@ void Refresh_BeginRenderPass(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_RenderPass *renderPass, Refresh_RenderPass *renderPass,
Refresh_Framebuffer *framebuffer, Refresh_Framebuffer *framebuffer,
Refresh_Rect renderArea, Refresh_Rect *renderArea,
Refresh_Color *pColorClearValues, Refresh_Color *pColorClearValues,
uint32_t colorClearCount, uint32_t colorClearCount,
Refresh_DepthStencilValue *depthStencilClearValue Refresh_DepthStencilValue *depthStencilClearValue

View File

@ -408,7 +408,7 @@ struct Refresh_Device
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_RenderPass *renderPass, Refresh_RenderPass *renderPass,
Refresh_Framebuffer *framebuffer, Refresh_Framebuffer *framebuffer,
Refresh_Rect renderArea, Refresh_Rect *renderArea,
Refresh_Color *pColorClearValues, Refresh_Color *pColorClearValues,
uint32_t colorClearCount, uint32_t colorClearCount,
Refresh_DepthStencilValue *depthStencilClearValue Refresh_DepthStencilValue *depthStencilClearValue

View File

@ -2217,27 +2217,27 @@ static void VULKAN_INTERNAL_DestroyTexture(
static void VULKAN_INTERNAL_DestroyRenderTarget( static void VULKAN_INTERNAL_DestroyRenderTarget(
VulkanRenderer *renderer, VulkanRenderer *renderer,
VulkanRenderTarget *colorTarget VulkanRenderTarget *renderTargetTarget
) { ) {
renderer->vkDestroyImageView( renderer->vkDestroyImageView(
renderer->logicalDevice, renderer->logicalDevice,
colorTarget->view, renderTargetTarget->view,
NULL NULL
); );
/* The texture is not owned by the ColorTarget /* The texture is not owned by the RenderTarget
* so we don't free it here * so we don't free it here
* But the multisampleTexture is! * But the multisampleTexture is!
*/ */
if (colorTarget->multisampleTexture != NULL) if (renderTargetTarget->multisampleTexture != NULL)
{ {
VULKAN_INTERNAL_DestroyTexture( VULKAN_INTERNAL_DestroyTexture(
renderer, renderer,
colorTarget->multisampleTexture renderTargetTarget->multisampleTexture
); );
} }
SDL_free(colorTarget); SDL_free(renderTargetTarget);
} }
static void VULKAN_INTERNAL_DestroyBuffer( static void VULKAN_INTERNAL_DestroyBuffer(
@ -7105,7 +7105,7 @@ static void VULKAN_BeginRenderPass(
Refresh_CommandBuffer *commandBuffer, Refresh_CommandBuffer *commandBuffer,
Refresh_RenderPass *renderPass, Refresh_RenderPass *renderPass,
Refresh_Framebuffer *framebuffer, Refresh_Framebuffer *framebuffer,
Refresh_Rect renderArea, Refresh_Rect *renderArea,
Refresh_Color *pColorClearValues, Refresh_Color *pColorClearValues,
uint32_t colorClearCount, uint32_t colorClearCount,
Refresh_DepthStencilValue *depthStencilClearValue Refresh_DepthStencilValue *depthStencilClearValue
@ -7189,10 +7189,10 @@ static void VULKAN_BeginRenderPass(
renderPassBeginInfo.pNext = NULL; renderPassBeginInfo.pNext = NULL;
renderPassBeginInfo.renderPass = (VkRenderPass) renderPass; renderPassBeginInfo.renderPass = (VkRenderPass) renderPass;
renderPassBeginInfo.framebuffer = vulkanFramebuffer->framebuffer; renderPassBeginInfo.framebuffer = vulkanFramebuffer->framebuffer;
renderPassBeginInfo.renderArea.extent.width = renderArea.w; renderPassBeginInfo.renderArea.extent.width = renderArea->w;
renderPassBeginInfo.renderArea.extent.height = renderArea.h; renderPassBeginInfo.renderArea.extent.height = renderArea->h;
renderPassBeginInfo.renderArea.offset.x = renderArea.x; renderPassBeginInfo.renderArea.offset.x = renderArea->x;
renderPassBeginInfo.renderArea.offset.y = renderArea.y; renderPassBeginInfo.renderArea.offset.y = renderArea->y;
renderPassBeginInfo.pClearValues = clearValues; renderPassBeginInfo.pClearValues = clearValues;
renderPassBeginInfo.clearValueCount = clearCount; renderPassBeginInfo.clearValueCount = clearCount;
@ -9471,6 +9471,8 @@ static Refresh_Device* VULKAN_INTERNAL_CreateDevice(
renderer->submittedRenderPassesToDestroyCapacity renderer->submittedRenderPassesToDestroyCapacity
); );
renderer->frameIndex = 0;
return result; return result;
} }