Revise swapchain management + remove external
continuous-integration/drone/push Build is passing Details

pull/12/head
cosmonaut 2022-02-08 17:16:11 -08:00
parent 42f5f84524
commit 829356d927
4 changed files with 594 additions and 546 deletions

View File

@ -701,18 +701,6 @@ REFRESHAPI Refresh_Device* Refresh_CreateDevice(
uint8_t debugMode
);
/* Create a rendering context by taking an externally-initialized VkDevice.
* Only valid with Vulkan backend.
* Useful for piggybacking on a separate graphics library like FNA3D.
*
* sysRenderer: Externally-initialized device info.
* debugMode: Enable debug mode properties.
*/
REFRESHAPI Refresh_Device* Refresh_CreateDeviceUsingExternal(
Refresh_SysRenderer *sysRenderer,
uint8_t debugMode
);
/* Destroys a rendering context previously returned by Refresh_CreateDevice. */
REFRESHAPI void Refresh_DestroyDevice(Refresh_Device *device);
@ -1293,7 +1281,7 @@ REFRESHAPI Refresh_CommandBuffer* Refresh_AcquireCommandBuffer(
uint8_t fixed
);
/* Queues an image to be presented to the screen.
/* Queues an image to be presented to a window.
* The image will be presented upon the next Refresh_Submit call.
*
* NOTE:
@ -1302,13 +1290,15 @@ REFRESHAPI Refresh_CommandBuffer* Refresh_AcquireCommandBuffer(
* textureSlice: The texture slice to present.
* destinationRectangle: The region of the window to update. Can be NULL.
* filter: The filter to use if scaling is required.
* windowHandle: The window to present to.
*/
REFRESHAPI void Refresh_QueuePresent(
Refresh_Device *device,
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice,
Refresh_Rect *destinationRectangle,
Refresh_Filter filter
Refresh_Filter filter,
void *windowHandle
);
/* Submits all of the enqueued commands. */
@ -1323,13 +1313,6 @@ REFRESHAPI void Refresh_Wait(
Refresh_Device *device
);
/* Export handles to be consumed by another API */
REFRESHAPI void Refresh_GetTextureHandles(
Refresh_Device* device,
Refresh_Texture* texture,
Refresh_TextureHandles* handles
);
#ifdef __cplusplus
}
#endif /* __cplusplus */

View File

@ -141,26 +141,6 @@ Refresh_Device* Refresh_CreateDevice(
);
}
Refresh_Device* Refresh_CreateDeviceUsingExternal(
Refresh_SysRenderer *sysRenderer,
uint8_t debugMode
) {
if (selectedDriver < 0)
{
return NULL;
}
if (sysRenderer == NULL)
{
return NULL;
}
return drivers[selectedDriver]->CreateDeviceUsingExternal(
sysRenderer,
debugMode
);
}
void Refresh_DestroyDevice(Refresh_Device *device)
{
NULL_RETURN(device);
@ -797,7 +777,8 @@ void Refresh_QueuePresent(
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice* textureSlice,
Refresh_Rect *destinationRectangle,
Refresh_Filter filter
Refresh_Filter filter,
void *windowHandle
) {
NULL_RETURN(device);
device->QueuePresent(
@ -805,7 +786,8 @@ void Refresh_QueuePresent(
commandBuffer,
textureSlice,
destinationRectangle,
filter
filter,
windowHandle
);
}
@ -831,17 +813,4 @@ void Refresh_Wait(
);
}
void Refresh_GetTextureHandles(
Refresh_Device* device,
Refresh_Texture* texture,
Refresh_TextureHandles *handles
) {
NULL_RETURN(device);
device->GetTextureHandles(
device->driverData,
texture,
handles
);
}
/* vim: set noexpandtab shiftwidth=8 tabstop=8: */

View File

@ -473,7 +473,8 @@ struct Refresh_Device
Refresh_CommandBuffer *commandBuffer,
Refresh_TextureSlice *textureSlice,
Refresh_Rect *destinationRectangle,
Refresh_Filter filter
Refresh_Filter filter,
void *windowHandle
);
void(*Submit)(
@ -486,12 +487,6 @@ struct Refresh_Device
Refresh_Renderer *driverData
);
void(*GetTextureHandles)(
Refresh_Renderer *driverData,
Refresh_Texture *texture,
Refresh_TextureHandles *handles
);
/* Opaque pointer for the Driver */
Refresh_Renderer *driverData;
};
@ -545,8 +540,7 @@ struct Refresh_Device
ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \
ASSIGN_DRIVER_FUNC(QueuePresent, name) \
ASSIGN_DRIVER_FUNC(Submit, name) \
ASSIGN_DRIVER_FUNC(Wait, name) \
ASSIGN_DRIVER_FUNC(GetTextureHandles, name)
ASSIGN_DRIVER_FUNC(Wait, name)
typedef struct Refresh_Driver
{
@ -555,10 +549,6 @@ typedef struct Refresh_Driver
Refresh_PresentationParameters *presentationParameters,
uint8_t debugMode
);
Refresh_Device* (*CreateDeviceUsingExternal)(
Refresh_SysRenderer *sysRenderer,
uint8_t debugMode
);
} Refresh_Driver;
extern Refresh_Driver VulkanDriver;

File diff suppressed because it is too large Load Diff