Initial RHI implementation

This commit is contained in:
2026-07-06 00:07:01 +01:00
parent cb3ef2be1c
commit 49aba1eb3c
13 changed files with 9349 additions and 81 deletions
+15 -1
View File
@@ -25,12 +25,17 @@
#include "pr_rhi_types.h"
#ifdef __cplusplus
extern "C" {
#endif
// ======================================================================
// Instance
// ======================================================================
PrRhiInstance *prRhiCreateInstance(PrRhiInstanceDesc desc, WpAllocator *alloc);
void prRhiDestroyInstance(PrRhiInstance *inst, WpAllocator *alloc);
void *prRhiGetNativeInstanceHandle(PrRhiInstance *inst);
// ======================================================================
// Physical device enumeration
@@ -39,6 +44,8 @@ void prRhiDestroyInstance(PrRhiInstance *inst, WpAllocator *alloc);
PrRhiPhysicalDeviceArray prRhiGetPhysicalDevices(PrRhiInstance *inst, const WpAllocator *scratch);
void prRhiGetPhysicalDeviceName(PrRhiPhysicalDevice *pdev, WpStr8 *out);
void prRhiGetPhysicalDeviceDriverInfo(PrRhiPhysicalDevice *pdev, WpStr8 *out);
void prRhiGetPhysicalDeviceProperties(PrRhiPhysicalDevice *pdev,
PrRhiPhysicalDeviceProperties *out);
// ======================================================================
// Surface (platform-specific)
@@ -57,6 +64,7 @@ PrRhiDevice *prRhiCreateDevice(PrRhiPhysicalDevice *pdev, PrRhiSurface *surface,
PrRhiDeviceDesc desc, WpAllocator *alloc);
void prRhiDestroyDevice(PrRhiDevice *device, WpAllocator *alloc);
void prRhiDeviceWaitIdle(PrRhiDevice *device);
u32 prRhiGetQueueFamilyIndex(PrRhiDevice *device);
// ======================================================================
// Swapchain
@@ -78,6 +86,7 @@ void prRhiRecreateSwapchain(PrRhiDevice *device, PrRhiSwapchain
PrRhiTexture *prRhiGetSwapchainTexture(PrRhiSwapchain *swapchain, u32 image_index);
PrRhiTexture *prRhiGetSwapchainDepthTexture(PrRhiSwapchain *swapchain);
PrRhiFormat prRhiGetSwapchainFormat(PrRhiSwapchain *swapchain);
// ======================================================================
// Buffers
@@ -258,7 +267,8 @@ void prRhiCmdDrawIndexed(PrRhiCommandBuffer *cb, u32 index_count, u32 instance_c
// --- Copy ---
void prRhiCmdCopyBufferToImage(PrRhiCommandBuffer *cb, PrRhiBuffer *src, PrRhiTexture *dst);
void prRhiCmdCopyBufferToImage(PrRhiCommandBuffer *cb, PrRhiBuffer *src, PrRhiTexture *dst,
PrRhiBufferImageCopyArray copies);
// ======================================================================
// Queue submission
@@ -282,5 +292,9 @@ void prRhiQueueSubmit(PrRhiDevice *device, PrRhiCommandBuffer *cb,
# error "Define one of: PR_RHI_VULKAN, PR_RHI_D3D12, PR_RHI_METAL"
#endif
#ifdef __cplusplus
}
#endif
#endif