flip the viewport in vulkan so that top is on the top

This commit is contained in:
Greg Wells
2025-05-30 13:41:11 -04:00
parent 7ebb109c44
commit eb244447cc
7 changed files with 14 additions and 9 deletions

View File

@@ -22,10 +22,10 @@ void gnCommandBeginRenderPassFn(struct gnCommandBuffer_t* buffer, struct gnRende
.framebuffer = passInfo.framebuffer->framebuffer->framebuffer,
.renderArea = {
.extent = { passInfo.size.x, passInfo.size.y },
.offset = { passInfo.offset.x, passInfo.offset.x }
.offset = { passInfo.offset.x, passInfo.offset.y }
},
.clearValueCount = passInfo.clearValueCount,
.pClearValues = values
.pClearValues = values,
};
vkCmdBeginRenderPass(buffer->commandBuffer->buffer, &renderPassInfo, VK_SUBPASS_CONTENTS_INLINE);
@@ -39,9 +39,9 @@ void gnCommandBindGraphicsPipelineFn(struct gnCommandBuffer_t* buffer, struct gn
void gnCommandSetViewportFn(struct gnCommandBuffer_t* buffer, struct gnViewport_t viewport) {
VkViewport vkViewport = {
.x = viewport.position.x,
.y = viewport.position.y,
.y = viewport.size.y,
.width = viewport.size.x,
.height = viewport.size.y,
.height = -viewport.size.y,
.minDepth = viewport.minDepth,
.maxDepth = viewport.maxDepth
};

View File

@@ -65,10 +65,10 @@ gnReturnCode gnCreateOutputDeviceFn(gnOutputDevice* outputDevice, gnInstance* in
}
void gnWaitForDeviceFn(const gnOutputDevice* device) {
// vkDeviceWaitIdle(device->outputDevice->device);
vkDeviceWaitIdle(device->outputDevice->device);
}
void gnDestroyOutputDeviceFn(gnOutputDevice* device) {
// vkDestroyCommandPool(device.outputDevice->device, device.outputDevice->commandPool, nullptr);
vkDestroyDevice(device->outputDevice->device, NULL);
free(device->outputDevice);
}

View File

@@ -113,7 +113,7 @@ gnReturnCode gnCreateGraphicsPipelineFn(struct gnGraphicsPipeline_t* graphicsPip
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
.polygonMode = vkGryphnPolygonMode(info.fillMode),
.lineWidth = 1.0f,
.frontFace = ( info.cullMode.direction == GN_DIRECTION_CLOCK_WISE ) ? VK_FRONT_FACE_CLOCKWISE : VK_FRONT_FACE_COUNTER_CLOCKWISE,
.frontFace = ( info.cullMode.direction == GN_DIRECTION_CLOCK_WISE ) ? VK_FRONT_FACE_COUNTER_CLOCKWISE : VK_FRONT_FACE_CLOCKWISE,
.cullMode = vkGryphnCullMode(info.cullMode.face),
.depthBiasEnable = VK_FALSE,
.depthBiasConstantFactor = 0.0f,