forked from MoonsideGames/Refresh
Revise swapchain management + remove external
parent
42f5f84524
commit
829356d927
|
@ -701,18 +701,6 @@ REFRESHAPI Refresh_Device* Refresh_CreateDevice(
|
||||||
uint8_t debugMode
|
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. */
|
/* Destroys a rendering context previously returned by Refresh_CreateDevice. */
|
||||||
REFRESHAPI void Refresh_DestroyDevice(Refresh_Device *device);
|
REFRESHAPI void Refresh_DestroyDevice(Refresh_Device *device);
|
||||||
|
|
||||||
|
@ -1293,7 +1281,7 @@ REFRESHAPI Refresh_CommandBuffer* Refresh_AcquireCommandBuffer(
|
||||||
uint8_t fixed
|
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.
|
* The image will be presented upon the next Refresh_Submit call.
|
||||||
*
|
*
|
||||||
* NOTE:
|
* NOTE:
|
||||||
|
@ -1302,13 +1290,15 @@ REFRESHAPI Refresh_CommandBuffer* Refresh_AcquireCommandBuffer(
|
||||||
* textureSlice: The texture slice to present.
|
* textureSlice: The texture slice to present.
|
||||||
* destinationRectangle: The region of the window to update. Can be NULL.
|
* destinationRectangle: The region of the window to update. Can be NULL.
|
||||||
* filter: The filter to use if scaling is required.
|
* filter: The filter to use if scaling is required.
|
||||||
|
* windowHandle: The window to present to.
|
||||||
*/
|
*/
|
||||||
REFRESHAPI void Refresh_QueuePresent(
|
REFRESHAPI void Refresh_QueuePresent(
|
||||||
Refresh_Device *device,
|
Refresh_Device *device,
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
Refresh_TextureSlice *textureSlice,
|
Refresh_TextureSlice *textureSlice,
|
||||||
Refresh_Rect *destinationRectangle,
|
Refresh_Rect *destinationRectangle,
|
||||||
Refresh_Filter filter
|
Refresh_Filter filter,
|
||||||
|
void *windowHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
/* Submits all of the enqueued commands. */
|
/* Submits all of the enqueued commands. */
|
||||||
|
@ -1323,13 +1313,6 @@ REFRESHAPI void Refresh_Wait(
|
||||||
Refresh_Device *device
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
|
@ -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)
|
void Refresh_DestroyDevice(Refresh_Device *device)
|
||||||
{
|
{
|
||||||
NULL_RETURN(device);
|
NULL_RETURN(device);
|
||||||
|
@ -797,7 +777,8 @@ void Refresh_QueuePresent(
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
Refresh_TextureSlice* textureSlice,
|
Refresh_TextureSlice* textureSlice,
|
||||||
Refresh_Rect *destinationRectangle,
|
Refresh_Rect *destinationRectangle,
|
||||||
Refresh_Filter filter
|
Refresh_Filter filter,
|
||||||
|
void *windowHandle
|
||||||
) {
|
) {
|
||||||
NULL_RETURN(device);
|
NULL_RETURN(device);
|
||||||
device->QueuePresent(
|
device->QueuePresent(
|
||||||
|
@ -805,7 +786,8 @@ void Refresh_QueuePresent(
|
||||||
commandBuffer,
|
commandBuffer,
|
||||||
textureSlice,
|
textureSlice,
|
||||||
destinationRectangle,
|
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: */
|
/* vim: set noexpandtab shiftwidth=8 tabstop=8: */
|
||||||
|
|
|
@ -473,7 +473,8 @@ struct Refresh_Device
|
||||||
Refresh_CommandBuffer *commandBuffer,
|
Refresh_CommandBuffer *commandBuffer,
|
||||||
Refresh_TextureSlice *textureSlice,
|
Refresh_TextureSlice *textureSlice,
|
||||||
Refresh_Rect *destinationRectangle,
|
Refresh_Rect *destinationRectangle,
|
||||||
Refresh_Filter filter
|
Refresh_Filter filter,
|
||||||
|
void *windowHandle
|
||||||
);
|
);
|
||||||
|
|
||||||
void(*Submit)(
|
void(*Submit)(
|
||||||
|
@ -486,12 +487,6 @@ struct Refresh_Device
|
||||||
Refresh_Renderer *driverData
|
Refresh_Renderer *driverData
|
||||||
);
|
);
|
||||||
|
|
||||||
void(*GetTextureHandles)(
|
|
||||||
Refresh_Renderer *driverData,
|
|
||||||
Refresh_Texture *texture,
|
|
||||||
Refresh_TextureHandles *handles
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Opaque pointer for the Driver */
|
/* Opaque pointer for the Driver */
|
||||||
Refresh_Renderer *driverData;
|
Refresh_Renderer *driverData;
|
||||||
};
|
};
|
||||||
|
@ -545,8 +540,7 @@ struct Refresh_Device
|
||||||
ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \
|
ASSIGN_DRIVER_FUNC(AcquireCommandBuffer, name) \
|
||||||
ASSIGN_DRIVER_FUNC(QueuePresent, name) \
|
ASSIGN_DRIVER_FUNC(QueuePresent, name) \
|
||||||
ASSIGN_DRIVER_FUNC(Submit, name) \
|
ASSIGN_DRIVER_FUNC(Submit, name) \
|
||||||
ASSIGN_DRIVER_FUNC(Wait, name) \
|
ASSIGN_DRIVER_FUNC(Wait, name)
|
||||||
ASSIGN_DRIVER_FUNC(GetTextureHandles, name)
|
|
||||||
|
|
||||||
typedef struct Refresh_Driver
|
typedef struct Refresh_Driver
|
||||||
{
|
{
|
||||||
|
@ -555,10 +549,6 @@ typedef struct Refresh_Driver
|
||||||
Refresh_PresentationParameters *presentationParameters,
|
Refresh_PresentationParameters *presentationParameters,
|
||||||
uint8_t debugMode
|
uint8_t debugMode
|
||||||
);
|
);
|
||||||
Refresh_Device* (*CreateDeviceUsingExternal)(
|
|
||||||
Refresh_SysRenderer *sysRenderer,
|
|
||||||
uint8_t debugMode
|
|
||||||
);
|
|
||||||
} Refresh_Driver;
|
} Refresh_Driver;
|
||||||
|
|
||||||
extern Refresh_Driver VulkanDriver;
|
extern Refresh_Driver VulkanDriver;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue