25 : m_device(device), m_staging(staging) {}
29 void Begin(uint32_t stagingEntry)
31 m_stagingEntry = stagingEntry;
38 uint32_t primitiveCount, uint32_t firstPrimitive,
PrimitiveShape shape,
39 std::span<const std::byte> primitives)
override;
40 void UploadTransientBuffers(std::span<const RHI::UploadRequest> requests, std::span<DeviceAddress> addresses)
override;
42 std::span<DeviceAddress> addresses)
override;
49 void Replay(SDL_GPUCommandBuffer* commands, SDL_GPURenderPass* pass)
const;
57 uint32_t bufferEntry = 0;
58 uint32_t imageCount = 0;
59 std::array<uint32_t, ImageBatcher::kMaxImages> images {};
63 SDLGPUGraphicsContext::Impl& m_device;
64 std::vector<std::byte>& m_staging;
65 uint32_t m_stagingEntry = 0;
66 std::vector<Draw> m_draws;
67 std::vector<ImageBatcher::Batch> m_batches;
68 uint32_t m_mostQuads = 0;
One frame's recording surface for one window.
Definition gui_rhi.h:62
RHI::ResidentState ResidentBufferState(RHI::ResidentBufferId id) const override
void ReleaseResidentBuffer(RHI::ResidentBufferId id) override
Frees the buffer once no frame in flight reads it; an unknown id does nothing.
RHI::ResidentBufferId UploadResidentBuffers(std::span< const RHI::UploadRequest > requests, std::span< DeviceAddress > addresses) override
void Begin(uint32_t stagingEntry)
A new frame: the last one's draws gone.
Definition sdlgpu_rhi.h:29
void Replay(SDL_GPUCommandBuffer *commands, SDL_GPURenderPass *pass) const
Records the kept draws into the render pass.
void UploadTransientBuffers(std::span< const RHI::UploadRequest > requests, std::span< DeviceAddress > addresses) override
uint32_t MostQuads() const
The most quads one draw has: the quads' index buffer must hold them.
Definition sdlgpu_rhi.h:47
void DrawPrimitives(const RHI::GpuPipeline &pipeline, const GPUDrawPushConstants &pushConstants, uint32_t primitiveCount, uint32_t firstPrimitive, PrimitiveShape shape, std::span< const std::byte > primitives) override
Cut where a run would read more than the 16 images a draw binds, and kept for Replay.
SDLGPUCommandList(SDLGPUGraphicsContext::Impl &device, std::vector< std::byte > &staging)
staging takes each frame's transient data.
Definition sdlgpu_rhi.h:24
uint64_t ResidentBufferId
GPU storage kept across frames (UploadResidentBuffers); 0 is none.
Definition gui_rhi.h:36
ResidentState
Where a resident buffer is.
Definition gui_rhi.h:40
PrimitiveShape
The vertices a primitive's vertex shader is run for; gl_VertexIndex divided by their count is the pri...
Definition gui_render_primitives.h:225
@ Quad
4 corners of its rectangle, drawn as two indexed triangles (0,1,3, 0,3,2)
Definition gui_render_primitives.h:226
Definition sdlgpu_device.h:37
bool CreatePipelines(SDLGPUGraphicsContext::Impl &device)
A pipeline per primitive kind from the built-in SDL GPU shaders, in the format the device takes.
void ReleasePipelines(SDLGPUGraphicsContext::Impl &device)
Definition gui_render_primitives.h:257
Definition sdlgpu_device.h:93