Skip to content

Commit aae5c5d

Browse files
committed
Misc: Implementing RenderPass cache.
1 parent 355a8fc commit aae5c5d

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

src/gpu/webgpu/SDL_gpu_webgpu.c

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
// File: /webgpu/SDL_gpu_webgpu.c
2525
// Author: Kyle Lukaszek
2626
// Email: kylelukaszek [at] gmail [dot] com
27-
// License: Zlib
2827
// Description: WebGPU driver for SDL_gpu using the emscripten WebGPU implementation
2928
// Note: Compiling SDL GPU programs using emscripten will require -sUSE_WEBGPU=1 -sASYNCIFY=1
3029

@@ -437,6 +436,37 @@ typedef struct CommandPoolHashTableKey
437436
SDL_ThreadID threadID;
438437
} CommandPoolHashTableKey;
439438

439+
typedef struct RenderPassColorTargetDescription
440+
{
441+
WGPUTextureFormat format;
442+
SDL_GPULoadOp loadOp;
443+
SDL_GPUStoreOp storeOp;
444+
} RenderPassColorTargetDescription;
445+
446+
typedef struct RenderPassDepthStencilTargetDescription
447+
{
448+
WGPUTextureFormat format;
449+
SDL_GPULoadOp loadOp;
450+
SDL_GPUStoreOp storeOp;
451+
SDL_GPULoadOp stencilLoadOp;
452+
SDL_GPUStoreOp stencilStoreOp;
453+
} RenderPassDepthStencilTargetDescription;
454+
455+
typedef struct RenderPassHashTableKey
456+
{
457+
RenderPassColorTargetDescription colorTargetDescriptions[MAX_COLOR_TARGET_BINDINGS];
458+
Uint32 numColorTargets;
459+
WGPUTextureFormat resolveTargetFormats[MAX_COLOR_TARGET_BINDINGS];
460+
Uint32 numResolveTargets;
461+
RenderPassDepthStencilTargetDescription depthStencilTargetDescription;
462+
Uint32 sampleCount;
463+
} RenderPassHashTableKey;
464+
465+
typedef struct WebGPURenderPassHashTableValue
466+
{
467+
WebGPUCommandBuffer handle;
468+
} WebGPURenderPassHashTableValue;
469+
440470
typedef struct WebGPURenderer
441471
{
442472
bool debug;
@@ -5159,7 +5189,7 @@ static SDL_GPUDevice *WebGPU_CreateDevice(bool debug, bool preferLowPower, SDL_P
51595189
}
51605190

51615191
SDL_Log("SDL_GPU Driver: WebGPU");
5162-
SDL_Log("WebGPU Device: %s",
5192+
SDL_Log("WebGPU Device: %s (Only for debugging purposes, not feature detection)",
51635193
renderer->adapterInfo.description);
51645194

51655195
// Keep track of the minimum uniform buffer alignment

0 commit comments

Comments
 (0)