ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
Loading...
Searching...
No Matches
CopyPass.h
Go to the documentation of this file.
1/*
2 * ObjectivelyGPU: Object oriented graphics framework for SDL3 and C.
3 * Copyright (C) 2026 Jay Dolan <jay@jaydolan.com>
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source distribution.
22 */
23
24#pragma once
25
26#include <Objectively/Object.h>
27
29
36typedef struct CopyPass CopyPass;
37typedef struct CopyPassInterface CopyPassInterface;
38typedef struct QueryPool QueryPool;
39
55struct CopyPass {
56
60 Object object;
61
66 CopyPassInterface *interface;
67
72 CommandBuffer *commands;
73
79 SDL_GPUCopyPass *pass;
80
84 ident data;
85};
86
90struct CopyPassInterface {
91
95 ObjectInterface objectInterface;
96
102 void (*copyBufferToBuffer)(const CopyPass *self, const SDL_GPUBufferLocation *src, const SDL_GPUBufferLocation *dst, Uint32 size, bool cycle);
103
109 void (*copyTextureToTexture)(const CopyPass *self, const SDL_GPUTextureLocation *src, const SDL_GPUTextureLocation *dst, Uint32 w, Uint32 h, Uint32 d, bool cycle);
110
116 void (*downloadBuffer)(const CopyPass *self, const SDL_GPUBufferRegion *src, const SDL_GPUTransferBufferLocation *dst);
117
123 void (*downloadTexture)(const CopyPass *self, const SDL_GPUTextureRegion *src, const SDL_GPUTextureTransferInfo *dst);
124
134 void (*downloadQueryResults)(const CopyPass *self, QueryPool *pool, Uint32 firstQuery, Uint32 count, const SDL_GPUTransferBufferLocation *dst);
135
145 CopyPass *(*init)(CopyPass *self, CommandBuffer *commands, SDL_GPUCopyPass *pass);
146
156 void (*uploadBuffer)(const CopyPass *self, const SDL_GPUTransferBufferLocation *src, const SDL_GPUBufferRegion *dst, bool cycle);
157
173 void (*uploadData)(const CopyPass *self, SDL_GPUBuffer *dst, const void *data, Uint32 size, Uint32 offset, bool cycle);
174
184 void (*uploadTexture)(const CopyPass *self, const SDL_GPUTextureTransferInfo *src, const SDL_GPUTextureRegion *dst, bool cycle);
185};
186
OBJECTIVELYGPU_EXPORT Class * _CopyPass(void)
Definition CopyPass.c:202
#define OBJECTIVELYGPU_EXPORT
Definition Types.h:35
A recorded sequence of GPU commands for a single frame.
Definition CommandBuffer.h:80
A scoped copy pass for uploading CPU data and copying GPU resources.
Definition CopyPass.h:55
Object object
The superclass.
Definition CopyPass.h:60
CopyPassInterface * interface
The interface.
Definition CopyPass.h:66
ident data
User data.
Definition CopyPass.h:84
An SDL_GPUQueryPool and its metadata.
Definition QueryPool.h:96