This patch adds a placeholder for the vulkan backend. When activated (`WITH_VULKAN_BACKEND=On` and `--gpu-backend vulkan`) it might open a blender screen, but nothing should be visible as none of the functions are implemented or otherwise crash on a nullptr. This is expected as this is just a placeholder. The goal is to add shader compilation +validation to this backend as one of the next steps so we can validate changes to existing shaders on OpenGL, Metal and Vulkan at the same time. Reviewed By: fclem Differential Revision: https://developer.blender.org/D16338
47 lines
1.8 KiB
C++
47 lines
1.8 KiB
C++
/* SPDX-License-Identifier: GPL-2.0-or-later
|
|
* Copyright 2022 Blender Foundation. All rights reserved. */
|
|
|
|
/** \file
|
|
* \ingroup gpu
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "gpu_shader_private.hh"
|
|
|
|
namespace blender::gpu {
|
|
|
|
class VKShader : public Shader {
|
|
public:
|
|
VKShader(const char *name) : Shader(name)
|
|
{
|
|
}
|
|
|
|
void vertex_shader_from_glsl(MutableSpan<const char *> sources)override;
|
|
void geometry_shader_from_glsl(MutableSpan<const char *> sources)override;
|
|
void fragment_shader_from_glsl(MutableSpan<const char *> sources)override;
|
|
void compute_shader_from_glsl(MutableSpan<const char *> sources)override;
|
|
bool finalize(const shader::ShaderCreateInfo *info = nullptr)override;
|
|
|
|
void transform_feedback_names_set(Span<const char *> name_list, eGPUShaderTFBType geom_type)override;
|
|
bool transform_feedback_enable(GPUVertBuf *)override;
|
|
void transform_feedback_disable()override;
|
|
|
|
void bind()override;
|
|
void unbind()override;
|
|
|
|
void uniform_float(int location, int comp_len, int array_size, const float *data)override;
|
|
void uniform_int(int location, int comp_len, int array_size, const int *data)override;
|
|
|
|
std::string resources_declare(const shader::ShaderCreateInfo &info) const override;
|
|
std::string vertex_interface_declare(const shader::ShaderCreateInfo &info) const override;
|
|
std::string fragment_interface_declare(const shader::ShaderCreateInfo &info) const override;
|
|
std::string geometry_interface_declare(const shader::ShaderCreateInfo &info) const override;
|
|
std::string geometry_layout_declare(const shader::ShaderCreateInfo &info) const override;
|
|
std::string compute_layout_declare(const shader::ShaderCreateInfo &info) const override;
|
|
|
|
/* DEPRECATED: Kept only because of BGL API. */
|
|
int program_handle_get() const override;
|
|
};
|
|
|
|
} // namespace blender::gpu
|