Files
test/source/blender/gpu/dummy/dummy_framebuffer.hh
Clément Foucault 4a4b1482cd GL: Add subpass input emulation
This adds basic emulation of the subpass input feature
of vulkan and to a lower extend Raster Order Group on Metal.

This help test paths that might use this feature in the future
(like shadow rendering) on all platform and or simplify higher
level code for supporting older hardware.

This add clear description to the load/store ops and to the
new `GPUAttachementState`.

The OpenGL backend will correctly mask un-writable
attachments and will bind as texture readable attachments.

Even if possible by the vulkan standard, the GPU API prohibit
the read and write to the same attachment inside the same
subpass.

In the GL backend, this is implemented using `glTextureBarrier`
and `texelFetch` as it is described in the ARB_texture_barrier
extension.
https://registry.khronos.org/OpenGL/extensions/ARB/ARB_texture_barrier.txt

Pull Request: https://projects.blender.org/blender/blender/pulls/112051
2023-10-01 15:27:21 +02:00

61 lines
1.6 KiB
C++

/* SPDX-FileCopyrightText: 2023 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup gpu
*/
#pragma once
#include "gpu_framebuffer_private.hh"
namespace blender::gpu {
class DummyFrameBuffer : public FrameBuffer {
public:
DummyFrameBuffer(const char *name) : FrameBuffer(name) {}
void bind(bool /*enabled_srgb*/) override {}
bool check(char /*err_out*/[256]) override
{
return true;
}
void clear(eGPUFrameBufferBits /*buffers*/,
const float /*clear_color*/[4],
float /*clear_depth*/,
uint /*clear_stencil*/) override
{
}
void clear_multi(const float (*/*clear_color*/)[4]) override {}
void clear_attachment(GPUAttachmentType /*type*/,
eGPUDataFormat /*data_format*/,
const void * /*clear_value*/) override
{
}
void attachment_set_loadstore_op(GPUAttachmentType /*type*/, GPULoadStore /*ls*/) override {}
void subpass_transition(const GPUAttachmentState /*depth_attachment_state*/,
Span<GPUAttachmentState> /*color_attachment_states*/) override{};
void read(eGPUFrameBufferBits /*planes*/,
eGPUDataFormat /*format*/,
const int /*area*/[4],
int /*channel_len*/,
int /*slot*/,
void * /*r_data*/) override
{
}
void blit_to(eGPUFrameBufferBits /*planes*/,
int /*src_slot*/,
FrameBuffer * /*dst*/,
int /*dst_slot*/,
int /*dst_offset_x*/,
int /*dst_offset_y*/) override
{
}
};
} // namespace blender::gpu