Skip to content

Commit b076f45

Browse files
committed
Rename RenderDevice::commandBuffer -> RenderDevice::commands
1 parent d4efab5 commit b076f45

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

Sources/ObjectivelyGPU/RenderDevice.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,19 @@ static CommandBuffer *acquireCommandBuffer(const RenderDevice *self) {
9898
static CommandBuffer *beginFrame(RenderDevice *self) {
9999

100100
GPU_Assert(self->framebuffer, "no framebuffer set; call setFramebuffer first");
101-
GPU_Assert(self->commandBuffer == NULL, "beginFrame called with a frame already in flight");
101+
GPU_Assert(self->commands == NULL, "beginFrame called with a frame already in flight");
102102

103-
self->commandBuffer = $(self, acquireCommandBuffer);
103+
self->commands = $(self, acquireCommandBuffer);
104104

105-
const bool ok = $(self->commandBuffer, waitAndAcquireSwapchainTexture, &self->swapchain);
105+
const bool ok = $(self->commands, waitAndAcquireSwapchainTexture, &self->swapchain);
106106
if (ok) {
107107
$(self->framebuffer, resize, &self->swapchain.size);
108108
} else {
109-
$(self->commandBuffer, cancel);
110-
self->commandBuffer = release(self->commandBuffer);
109+
$(self->commands, cancel);
110+
self->commands = release(self->commands);
111111
}
112112

113-
return self->commandBuffer;
113+
return self->commands;
114114
}
115115

116116
/**
@@ -119,12 +119,12 @@ static CommandBuffer *beginFrame(RenderDevice *self) {
119119
*/
120120
static void endFrame(RenderDevice *self) {
121121

122-
GPU_Assert(self->commandBuffer, "endFrame called without a frame in flight");
122+
GPU_Assert(self->commands, "endFrame called without a frame in flight");
123123

124124
Texture *color = $(self->framebuffer, resolvedColorTexture, 0);
125125
GPU_Assert(color, "framebuffer has no color attachment to present");
126126

127-
$(self->commandBuffer, blitTexture, &(SDL_GPUBlitInfo) {
127+
$(self->commands, blitTexture, &(SDL_GPUBlitInfo) {
128128
.source = {
129129
.texture = color->texture,
130130
.w = (Uint32) self->swapchain.size.w,
@@ -139,9 +139,9 @@ static void endFrame(RenderDevice *self) {
139139
.filter = SDL_GPU_FILTER_NEAREST,
140140
});
141141

142-
$(self->commandBuffer, submit);
142+
$(self->commands, submit);
143143

144-
self->commandBuffer = release(self->commandBuffer);
144+
self->commands = release(self->commands);
145145

146146
self->swapchain = (SwapchainTexture) { 0 };
147147
}

Sources/ObjectivelyGPU/RenderDevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ struct RenderDevice {
9393
* borrowed view of it and `endFrame` submits and releases it.
9494
* @private
9595
*/
96-
CommandBuffer *commandBuffer;
96+
CommandBuffer *commands;
9797

9898
/**
9999
* @brief The swapchain texture acquired for the current frame.

0 commit comments

Comments
 (0)