The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.
The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.
However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.
This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software ...
This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
87 lines
2.1 KiB
C++
87 lines
2.1 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2022 Blender Foundation */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "gpu_backend.hh"
|
|
|
|
#ifdef WITH_RENDERDOC
|
|
# include "renderdoc_api.hh"
|
|
#endif
|
|
|
|
#include "vk_common.hh"
|
|
|
|
#include "shaderc/shaderc.hpp"
|
|
|
|
namespace blender::gpu {
|
|
|
|
class VKContext;
|
|
|
|
class VKBackend : public GPUBackend {
|
|
private:
|
|
shaderc::Compiler shaderc_compiler_;
|
|
#ifdef WITH_RENDERDOC
|
|
renderdoc::api::Renderdoc renderdoc_api_;
|
|
#endif
|
|
|
|
public:
|
|
VKBackend()
|
|
{
|
|
VKBackend::init_platform();
|
|
}
|
|
|
|
virtual ~VKBackend()
|
|
{
|
|
VKBackend::platform_exit();
|
|
}
|
|
|
|
void delete_resources() override;
|
|
|
|
void samplers_update() override;
|
|
void compute_dispatch(int groups_x_len, int groups_y_len, int groups_z_len) override;
|
|
void compute_dispatch_indirect(StorageBuf *indirect_buf) override;
|
|
|
|
Context *context_alloc(void *ghost_window, void *ghost_context) override;
|
|
|
|
Batch *batch_alloc() override;
|
|
DrawList *drawlist_alloc(int list_length) override;
|
|
Fence *fence_alloc() override;
|
|
FrameBuffer *framebuffer_alloc(const char *name) override;
|
|
IndexBuf *indexbuf_alloc() override;
|
|
PixelBuffer *pixelbuf_alloc(uint size) override;
|
|
QueryPool *querypool_alloc() override;
|
|
Shader *shader_alloc(const char *name) override;
|
|
Texture *texture_alloc(const char *name) override;
|
|
UniformBuf *uniformbuf_alloc(int size, const char *name) override;
|
|
StorageBuf *storagebuf_alloc(int size, GPUUsageType usage, const char *name) override;
|
|
VertBuf *vertbuf_alloc() override;
|
|
|
|
/* Render Frame Coordination --
|
|
* Used for performing per-frame actions globally */
|
|
void render_begin() override;
|
|
void render_end() override;
|
|
void render_step() override;
|
|
|
|
bool debug_capture_begin(VkInstance vk_instance);
|
|
void debug_capture_end(VkInstance vk_instance);
|
|
|
|
shaderc::Compiler &get_shaderc_compiler();
|
|
|
|
static void capabilities_init(VKContext &context);
|
|
|
|
static VKBackend &get()
|
|
{
|
|
return *static_cast<VKBackend *>(GPUBackend::get());
|
|
}
|
|
|
|
private:
|
|
static void init_platform();
|
|
static void platform_exit();
|
|
};
|
|
|
|
} // namespace blender::gpu
|