Skip to content

Commit 42bd256

Browse files
committed
acquireSwapchainTexture pure passthrough
1 parent e0e05ba commit 42bd256

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

Sources/ObjectivelyGPU/CommandBuffer.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,14 @@
3737
* @memberof CommandBuffer
3838
*/
3939
static bool acquireSwapchainTexture(const CommandBuffer *self, SDL_Window *window, SwapchainTexture *swapchain) {
40+
4041
assert(swapchain);
4142

42-
Uint32 w = 0, h = 0;
43-
const bool ok = SDL_AcquireGPUSwapchainTexture(self->cmd, window, &swapchain->texture, &w, &h);
44-
swapchain->size = MakeSize(w, h);
45-
return ok && swapchain->texture;
43+
return SDL_AcquireGPUSwapchainTexture(self->cmd,
44+
window,
45+
&swapchain->texture,
46+
(Uint32 *) &swapchain->size.w,
47+
(Uint32 *) &swapchain->size.h);
4648
}
4749

4850
/**
@@ -203,14 +205,14 @@ static SDL_GPUFence *submitAndFence(const CommandBuffer *self) {
203205
* @memberof CommandBuffer
204206
*/
205207
static bool waitAndAcquireSwapchainTexture(const CommandBuffer *self, SDL_Window *window, SwapchainTexture *swapchain) {
206-
assert(swapchain);
207208

208-
Uint32 w = 0, h = 0;
209-
const bool ok = SDL_WaitAndAcquireGPUSwapchainTexture(self->cmd, window, &swapchain->texture, &w, &h);
210-
GPU_Assert(ok, "SDL_WaitAndAcquireGPUSwapchainTexture");
209+
assert(swapchain);
211210

212-
swapchain->size = MakeSize(w, h);
213-
return ok;
211+
return SDL_WaitAndAcquireGPUSwapchainTexture(self->cmd,
212+
window,
213+
&swapchain->texture,
214+
(Uint32 *) &swapchain->size.w,
215+
(Uint32 *) &swapchain->size.h);
214216
}
215217

216218
#pragma mark - Class lifecycle

0 commit comments

Comments
 (0)