ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
Loading...
Searching...
No Matches
QueryPool Struct Reference

An SDL_GPUQueryPool and its metadata. More...

#include <QueryPool.h>

Inheritance diagram for QueryPool:

Public Member Functions

QueryPoolinitWithDevice (QueryPool *self, RenderDevice *device, const SDL_GPUQueryPoolCreateInfo *info)
 Initializes this QueryPool, creating its SDL_GPUQueryPool.
 
Class * _QueryPool (void)
 The QueryPool archetype.
 

Data Fields

Object object
 The superclass.
 
SDL_GPUQueryPoolpool
 The underlying SDL query pool, or NULL if occlusion queries are unsupported by the linked SDL3 (see QueryPool.h).
 
SDL_GPUQueryType type
 The type of query this pool was created for.
 
Uint32 queryCount
 The maximum number of queries in this pool.
 
ident data
 User data.
 

Protected Attributes

QueryPoolInterface * interface
 The interface.
 

Detailed Description

An SDL_GPUQueryPool and its metadata.

QueryPool owns its underlying SDL_GPUQueryPool and releases it in dealloc, so a QueryPool is freed with release like any other Objectively object. Begin and end queries against it via RenderPass::beginQuery / RenderPass::endQuery, and retrieve results via CopyPass::downloadQueryResults:

QueryPool *queries = $(renderDevice, createQueryPool,
$(pass, beginQuery, queries, 0);
$(pass, drawPrimitives, ...);
$(pass, endQuery, queries, 0);
$(copyPass, downloadQueryResults, queries, 0, 1, &destination);
release(queries);
static void downloadQueryResults(const CopyPass *self, QueryPool *pool, Uint32 firstQuery, Uint32 count, const SDL_GPUTransferBufferLocation *dst)
Definition CopyPass.c:91
@ SDL_GPU_QUERY_BINARY_OCCLUSION
Definition QueryPool.h:57
static QueryPool * createQueryPool(RenderDevice *self, const SDL_GPUQueryPoolCreateInfo *info)
Definition RenderDevice.c:273
static void drawPrimitives(const RenderPass *self, Uint32 numVertices, Uint32 numInstances, Uint32 firstVertex, Uint32 firstInstance)
Definition RenderPass.c:179
static void beginQuery(const RenderPass *self, QueryPool *pool, Uint32 index)
Definition RenderPass.c:135
static void endQuery(const RenderPass *self, QueryPool *pool, Uint32 index)
Definition RenderPass.c:148
An SDL_GPUQueryPool and its metadata.
Definition QueryPool.h:96
SDL_GPUQueryType type
The type of query this pool was created for.
Definition QueryPool.h:118
Definition QueryPool.h:61

Member Function Documentation

◆ _QueryPool()

Class * _QueryPool ( void  )

The QueryPool archetype.

Returns
The QueryPool Class.

◆ initWithDevice()

QueryPool * initWithDevice ( QueryPool self,
RenderDevice device,
const SDL_GPUQueryPoolCreateInfo info 
)

Initializes this QueryPool, creating its SDL_GPUQueryPool.

This is the designated initializer. Always succeeds, even when occlusion queries are unsupported by the linked SDL3 – self->pool is NULL in that case, and the pool behaves as an inert no-op.

Parameters
selfThe QueryPool.
deviceThe RenderDevice used to create and release the query pool. Retained.
infoQuery pool creation parameters (query type, query count).
Returns
The initialized QueryPool, or NULL on failure.

Field Documentation

◆ data

ident QueryPool::data

User data.

◆ interface

QueryPoolInterface* QueryPool::interface
protected

The interface.

◆ object

Object QueryPool::object

The superclass.

◆ pool

SDL_GPUQueryPool* QueryPool::pool

The underlying SDL query pool, or NULL if occlusion queries are unsupported by the linked SDL3 (see QueryPool.h).

◆ queryCount

Uint32 QueryPool::queryCount

The maximum number of queries in this pool.

◆ type

SDL_GPUQueryType QueryPool::type

The type of query this pool was created for.


The documentation for this struct was generated from the following files: