forked from MoonsideGames/Refresh
rename to QueuePresent + make textureslice input a pointer
parent
8752ed4391
commit
a795e1f825
|
@ -797,7 +797,7 @@ REFRESHAPI REFRESH_Texture* REFRESH_CreateTextureCube(
|
|||
REFRESHAPI REFRESH_ColorTarget* REFRESH_CreateColorTarget(
|
||||
REFRESH_Device *device,
|
||||
REFRESH_SampleCount multisampleCount,
|
||||
REFRESH_TextureSlice textureSlice
|
||||
REFRESH_TextureSlice *textureSlice
|
||||
);
|
||||
|
||||
/* Creates a depth/stencil target.
|
||||
|
@ -1273,19 +1273,19 @@ REFRESHAPI void REFRESH_BindIndexBuffer(
|
|||
|
||||
/* Submission/Presentation */
|
||||
|
||||
/* Prepares for an image to be presented to the screen.
|
||||
/* Queues an image to be presented to the screen.
|
||||
* The image will be presented upon the next REFRESH_Submit call.
|
||||
*
|
||||
* NOTE:
|
||||
* It is an error to call this function in headless mode.
|
||||
*
|
||||
* texture: The image to present.
|
||||
* textureSlice: The texture slice to present.
|
||||
* sourceRectangle: The region of the image to present (or NULL).
|
||||
* destinationRectangle: The region of the window to update (or NULL).
|
||||
*/
|
||||
REFRESHAPI void REFRESH_PreparePresent(
|
||||
REFRESHAPI void REFRESH_QueuePresent(
|
||||
REFRESH_Device *device,
|
||||
REFRESH_Texture* texture,
|
||||
REFRESH_TextureSlice *textureSlice,
|
||||
REFRESH_Rect *sourceRectangle,
|
||||
REFRESH_Rect *destinationRectangle
|
||||
);
|
||||
|
|
|
@ -347,7 +347,7 @@ REFRESH_Texture* REFRESH_CreateTextureCube(
|
|||
REFRESH_ColorTarget* REFRESH_CreateColorTarget(
|
||||
REFRESH_Device *device,
|
||||
REFRESH_SampleCount multisampleCount,
|
||||
REFRESH_TextureSlice textureSlice
|
||||
REFRESH_TextureSlice *textureSlice
|
||||
) {
|
||||
NULL_RETURN_NULL(device);
|
||||
return device->CreateColorTarget(
|
||||
|
@ -835,16 +835,16 @@ void REFRESH_BindIndexBuffer(
|
|||
);
|
||||
}
|
||||
|
||||
void REFRESH_PreparePresent(
|
||||
void REFRESH_QueuePresent(
|
||||
REFRESH_Device *device,
|
||||
REFRESH_Texture *texture,
|
||||
REFRESH_TextureSlice* textureSlice,
|
||||
REFRESH_Rect *sourceRectangle,
|
||||
REFRESH_Rect *destinationRectangle
|
||||
) {
|
||||
NULL_RETURN(device);
|
||||
device->PreparePresent(
|
||||
device->QueuePresent(
|
||||
device->driverData,
|
||||
texture,
|
||||
textureSlice,
|
||||
sourceRectangle,
|
||||
destinationRectangle
|
||||
);
|
||||
|
|
|
@ -269,7 +269,7 @@ struct REFRESH_Device
|
|||
REFRESH_ColorTarget* (*CreateColorTarget)(
|
||||
REFRESH_Renderer *driverData,
|
||||
REFRESH_SampleCount multisampleCount,
|
||||
REFRESH_TextureSlice textureSlice
|
||||
REFRESH_TextureSlice *textureSlice
|
||||
);
|
||||
|
||||
REFRESH_DepthStencilTarget* (*CreateDepthStencilTarget)(
|
||||
|
@ -505,9 +505,9 @@ struct REFRESH_Device
|
|||
REFRESH_IndexElementSize indexElementSize
|
||||
);
|
||||
|
||||
void(*PreparePresent)(
|
||||
void(*QueuePresent)(
|
||||
REFRESH_Renderer *driverData,
|
||||
REFRESH_Texture *texture,
|
||||
REFRESH_TextureSlice *textureSlice,
|
||||
REFRESH_Rect *sourceRectangle,
|
||||
REFRESH_Rect *destinationRectangle
|
||||
);
|
||||
|
@ -567,7 +567,7 @@ struct REFRESH_Device
|
|||
ASSIGN_DRIVER_FUNC(BindGraphicsPipeline, name) \
|
||||
ASSIGN_DRIVER_FUNC(BindVertexBuffers, name) \
|
||||
ASSIGN_DRIVER_FUNC(BindIndexBuffer, name) \
|
||||
ASSIGN_DRIVER_FUNC(PreparePresent, name) \
|
||||
ASSIGN_DRIVER_FUNC(QueuePresent, name) \
|
||||
ASSIGN_DRIVER_FUNC(Submit, name)
|
||||
|
||||
typedef struct REFRESH_Driver
|
||||
|
|
|
@ -3620,7 +3620,7 @@ static REFRESH_Texture* VULKAN_CreateTextureCube(
|
|||
static REFRESH_ColorTarget* VULKAN_CreateColorTarget(
|
||||
REFRESH_Renderer *driverData,
|
||||
REFRESH_SampleCount multisampleCount,
|
||||
REFRESH_TextureSlice textureSlice
|
||||
REFRESH_TextureSlice *textureSlice
|
||||
) {
|
||||
VkResult vulkanResult;
|
||||
VulkanRenderer *renderer = (VulkanRenderer*) driverData;
|
||||
|
@ -3628,7 +3628,7 @@ static REFRESH_ColorTarget* VULKAN_CreateColorTarget(
|
|||
VkImageViewCreateInfo imageViewCreateInfo;
|
||||
VkComponentMapping swizzle = IDENTITY_SWIZZLE;
|
||||
|
||||
colorTarget->texture = (VulkanTexture*) textureSlice.texture;
|
||||
colorTarget->texture = (VulkanTexture*) textureSlice->texture;
|
||||
colorTarget->multisampleTexture = NULL;
|
||||
colorTarget->multisampleCount = 1;
|
||||
|
||||
|
@ -3679,7 +3679,7 @@ static REFRESH_ColorTarget* VULKAN_CreateColorTarget(
|
|||
imageViewCreateInfo.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
imageViewCreateInfo.subresourceRange.baseMipLevel = 0;
|
||||
imageViewCreateInfo.subresourceRange.levelCount = 1;
|
||||
imageViewCreateInfo.subresourceRange.baseArrayLayer = textureSlice.layer;
|
||||
imageViewCreateInfo.subresourceRange.baseArrayLayer = textureSlice->layer;
|
||||
imageViewCreateInfo.subresourceRange.layerCount = 1;
|
||||
imageViewCreateInfo.viewType = VK_IMAGE_VIEW_TYPE_2D;
|
||||
|
||||
|
@ -4756,9 +4756,9 @@ static void VULKAN_BindIndexBuffer(
|
|||
));
|
||||
}
|
||||
|
||||
static void VULKAN_PreparePresent(
|
||||
static void VULKAN_QueuePresent(
|
||||
REFRESH_Renderer* driverData,
|
||||
REFRESH_Texture* texture,
|
||||
REFRESH_TextureSlice* textureSlice,
|
||||
REFRESH_Rect* sourceRectangle,
|
||||
REFRESH_Rect* destinationRectangle
|
||||
) {
|
||||
|
@ -4769,12 +4769,12 @@ static void VULKAN_PreparePresent(
|
|||
REFRESH_Rect dstRect;
|
||||
VkImageBlit blit;
|
||||
|
||||
VulkanRenderer* renderer = (VulkanRenderer*)driverData;
|
||||
VulkanTexture* vulkanTexture = (VulkanTexture*)texture;
|
||||
VulkanRenderer* renderer = (VulkanRenderer*) driverData;
|
||||
VulkanTexture* vulkanTexture = (VulkanTexture*) textureSlice->texture;
|
||||
|
||||
if (renderer->headless)
|
||||
{
|
||||
REFRESH_LogError("Cannot call PreparePresent in headless mode!");
|
||||
REFRESH_LogError("Cannot call QueuePresent in headless mode!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4870,7 +4870,7 @@ static void VULKAN_PreparePresent(
|
|||
blit.dstOffsets[1].z = 1;
|
||||
|
||||
blit.dstSubresource.mipLevel = 0;
|
||||
blit.dstSubresource.baseArrayLayer = 0;
|
||||
blit.dstSubresource.baseArrayLayer = textureSlice->layer;
|
||||
blit.dstSubresource.layerCount = 1;
|
||||
blit.dstSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
|
||||
|
||||
|
|
Loading…
Reference in New Issue