flip the viewport in vulkan so that top is on the top
This commit is contained in:
@@ -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
|
||||
};
|
||||
|
@@ -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);
|
||||
}
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user