Add new GPU Query API that is lightweight and supports occlusion queries

This commit is contained in:
Wojtek Figat
2026-01-16 10:40:30 +01:00
parent d2d7a871ce
commit 9ac231c403
31 changed files with 829 additions and 254 deletions

View File

@@ -160,6 +160,15 @@ public:
{
}
uint64 BeginQuery(GPUQueryType type) override
{
return 0;
}
void EndQuery(uint64 queryID) override
{
}
void SetViewport(const Viewport& viewport) override
{
}

View File

@@ -144,6 +144,11 @@ void GPUDeviceNull::WaitForGPU()
{
}
bool GPUDeviceNull::GetQueryResult(uint64 queryID, uint64& result, bool wait)
{
return false;
}
GPUTexture* GPUDeviceNull::CreateTexture(const StringView& name)
{
PROFILE_MEM(GraphicsTextures);

View File

@@ -20,18 +20,15 @@ class GPUDeviceNull : public GPUDevice
friend GPUSwapChainNull;
private:
GPUContextNull* _mainContext;
GPUAdapterNull* _adapter;
public:
static GPUDevice* Create();
GPUDeviceNull();
~GPUDeviceNull();
public:
// [GPUDevice]
GPUContext* GetMainContext() override;
GPUAdapter* GetAdapter() const override;
@@ -41,6 +38,7 @@ public:
void Draw() override;
void Dispose() override;
void WaitForGPU() override;
bool GetQueryResult(uint64 queryID, uint64& result, bool wait = false) override;
GPUTexture* CreateTexture(const StringView& name) override;
GPUShader* CreateShader(const StringView& name) override;
GPUPipelineState* CreatePipelineState() override;