Files
test2/source/blender/gpu/dummy/dummy_context.hh
Miguel Pozo a5ed5dc4bf GPU: Support deferred compilation in ShaderCompilerGeneric
Update the `ShaderCompilerGeneric` to support deferred compilation
using the batch compilation API, so we can get rid of
`drw_manager_shader`.
This approach also allows supporting non-blocking compilation
for static shaders.

This shouldn't cause any behavior changes at the moment, since batch
compilation is not yet used when parallel compilation is disabled.

This adds a `GPUWorker` and a `GPUSecondaryContext` as an easy to use
wrapper for managing secondary GPU contexts.

(Part of #133674)
Pull Request: https://projects.blender.org/blender/blender/pulls/136518
2025-04-07 15:26:25 +02:00

64 lines
1.3 KiB
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "gpu_context_private.hh"
#include "dummy_framebuffer.hh"
namespace blender::gpu {
class DummyContext : public Context {
public:
DummyContext()
{
back_left = active_fb = new DummyFrameBuffer("DummyFramebuffer");
}
~DummyContext() override
{
free_resources();
}
void activate() override {}
void deactivate() override {}
void begin_frame() override {}
void end_frame() override {}
void flush() override {}
void finish() override {}
ShaderCompiler *get_compiler() override
{
return nullptr;
}
void memory_statistics_get(int * /*r_total_mem*/, int * /*r_free_mem*/) override {}
void debug_group_begin(const char * /*unused*/, int /*unused*/) override {}
void debug_group_end() override {}
bool debug_capture_begin(const char * /*title*/) override
{
return false;
}
void debug_capture_end() override {}
void *debug_capture_scope_create(const char * /*name*/) override
{
return nullptr;
}
bool debug_capture_scope_begin(void * /*scope*/) override
{
return false;
}
void debug_capture_scope_end(void * /*scope*/) override {}
void debug_unbind_all_ubo() override {}
void debug_unbind_all_ssbo() override {}
};
} // namespace blender::gpu