feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -8,11 +8,11 @@ thirdparty_dir = "#thirdparty/vulkan"
|
|||
thirdparty_volk_dir = "#thirdparty/volk"
|
||||
|
||||
# Use bundled Vulkan headers
|
||||
env.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include"])
|
||||
env.Prepend(CPPEXTPATH=[thirdparty_dir, thirdparty_dir + "/include"])
|
||||
|
||||
if env["use_volk"]:
|
||||
env.AppendUnique(CPPDEFINES=["USE_VOLK"])
|
||||
env.Prepend(CPPPATH=[thirdparty_volk_dir])
|
||||
env.Prepend(CPPEXTPATH=[thirdparty_volk_dir])
|
||||
|
||||
if env["platform"] == "android":
|
||||
env.AppendUnique(CPPDEFINES=["VK_USE_PLATFORM_ANDROID_KHR"])
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef GODOT_VULKAN_H
|
||||
#define GODOT_VULKAN_H
|
||||
#pragma once
|
||||
|
||||
#ifdef USE_VOLK
|
||||
#include <volk.h>
|
||||
|
|
@ -38,5 +37,3 @@
|
|||
#define VK_NO_STDINT_H
|
||||
#include <vulkan/vulkan.h>
|
||||
#endif
|
||||
|
||||
#endif // GODOT_VULKAN_H
|
||||
|
|
|
|||
|
|
@ -686,8 +686,8 @@ Error RenderingContextDriverVulkan::_initialize_instance() {
|
|||
VkApplicationInfo app_info = {};
|
||||
app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
|
||||
app_info.pApplicationName = cs.get_data();
|
||||
app_info.pEngineName = VERSION_NAME;
|
||||
app_info.engineVersion = VK_MAKE_VERSION(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
|
||||
app_info.pEngineName = GODOT_VERSION_NAME;
|
||||
app_info.engineVersion = VK_MAKE_VERSION(GODOT_VERSION_MAJOR, GODOT_VERSION_MINOR, GODOT_VERSION_PATCH);
|
||||
app_info.apiVersion = application_api_version;
|
||||
|
||||
TightLocalVector<const char *> enabled_layer_names;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef RENDERING_CONTEXT_DRIVER_VULKAN_H
|
||||
#define RENDERING_CONTEXT_DRIVER_VULKAN_H
|
||||
#pragma once
|
||||
|
||||
#ifdef VULKAN_ENABLED
|
||||
|
||||
|
|
@ -206,5 +205,3 @@ public:
|
|||
};
|
||||
|
||||
#endif // VULKAN_ENABLED
|
||||
|
||||
#endif // RENDERING_CONTEXT_DRIVER_VULKAN_H
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef RENDERING_DEVICE_DRIVER_VULKAN_H
|
||||
#define RENDERING_DEVICE_DRIVER_VULKAN_H
|
||||
#pragma once
|
||||
|
||||
#include "core/templates/hash_map.h"
|
||||
#include "core/templates/paged_allocator.h"
|
||||
|
|
@ -54,6 +53,9 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
|
|||
|
||||
struct CommandQueue;
|
||||
struct SwapChain;
|
||||
struct CommandBufferInfo;
|
||||
struct RenderPassInfo;
|
||||
struct Framebuffer;
|
||||
|
||||
struct Queue {
|
||||
VkQueue queue = VK_NULL_HANDLE;
|
||||
|
|
@ -76,18 +78,6 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
|
|||
String supported_operations_desc() const;
|
||||
};
|
||||
|
||||
struct VRSCapabilities {
|
||||
bool pipeline_vrs_supported = false; // We can specify our fragment rate on a pipeline level.
|
||||
bool primitive_vrs_supported = false; // We can specify our fragment rate on each drawcall.
|
||||
bool attachment_vrs_supported = false; // We can provide a density map attachment on our framebuffer.
|
||||
|
||||
Size2i min_texel_size;
|
||||
Size2i max_texel_size;
|
||||
Size2i max_fragment_size;
|
||||
|
||||
Size2i texel_size; // The texel size we'll use
|
||||
};
|
||||
|
||||
struct ShaderCapabilities {
|
||||
bool shader_float16_is_supported = false;
|
||||
bool shader_int8_is_supported = false;
|
||||
|
|
@ -107,6 +97,7 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
|
|||
PFN_vkAcquireNextImageKHR AcquireNextImageKHR = nullptr;
|
||||
PFN_vkQueuePresentKHR QueuePresentKHR = nullptr;
|
||||
PFN_vkCreateRenderPass2KHR CreateRenderPass2KHR = nullptr;
|
||||
PFN_vkCmdEndRenderPass2KHR EndRenderPass2KHR = nullptr;
|
||||
|
||||
// Debug marker extensions.
|
||||
PFN_vkCmdDebugMarkerBeginEXT CmdDebugMarkerBeginEXT = nullptr;
|
||||
|
|
@ -135,7 +126,8 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
|
|||
RDD::Capabilities device_capabilities;
|
||||
SubgroupCapabilities subgroup_capabilities;
|
||||
MultiviewCapabilities multiview_capabilities;
|
||||
VRSCapabilities vrs_capabilities;
|
||||
FragmentShadingRateCapabilities fsr_capabilities;
|
||||
FragmentDensityMapCapabilities fdm_capabilities;
|
||||
ShaderCapabilities shader_capabilities;
|
||||
StorageBufferCapabilities storage_buffer_capabilities;
|
||||
bool buffer_device_address_support = false;
|
||||
|
|
@ -155,6 +147,7 @@ class RenderingDeviceDriverVulkan : public RenderingDeviceDriver {
|
|||
Error _initialize_device_extensions();
|
||||
Error _check_device_features();
|
||||
Error _check_device_capabilities();
|
||||
void _choose_vrs_capabilities();
|
||||
Error _add_queue_create_info(LocalVector<VkDeviceQueueCreateInfo> &r_queue_create_info);
|
||||
Error _initialize_device(const LocalVector<VkDeviceQueueCreateInfo> &p_queue_create_info);
|
||||
Error _initialize_allocator();
|
||||
|
|
@ -332,6 +325,7 @@ private:
|
|||
struct CommandPool {
|
||||
VkCommandPool vk_command_pool = VK_NULL_HANDLE;
|
||||
CommandBufferType buffer_type = COMMAND_BUFFER_TYPE_PRIMARY;
|
||||
LocalVector<CommandBufferInfo *> command_buffers_created;
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
@ -339,8 +333,16 @@ public:
|
|||
virtual bool command_pool_reset(CommandPoolID p_cmd_pool) override final;
|
||||
virtual void command_pool_free(CommandPoolID p_cmd_pool) override final;
|
||||
|
||||
private:
|
||||
// ----- BUFFER -----
|
||||
|
||||
struct CommandBufferInfo {
|
||||
VkCommandBuffer vk_command_buffer = VK_NULL_HANDLE;
|
||||
Framebuffer *active_framebuffer = nullptr;
|
||||
RenderPassInfo *active_render_pass = nullptr;
|
||||
};
|
||||
|
||||
public:
|
||||
virtual CommandBufferID command_buffer_create(CommandPoolID p_cmd_pool) override final;
|
||||
virtual bool command_buffer_begin(CommandBufferID p_cmd_buffer) override final;
|
||||
virtual bool command_buffer_begin_secondary(CommandBufferID p_cmd_buffer, RenderPassID p_render_pass, uint32_t p_subpass, FramebufferID p_framebuffer) override final;
|
||||
|
|
@ -382,6 +384,7 @@ public:
|
|||
virtual void swap_chain_set_max_fps(SwapChainID p_swap_chain, int p_max_fps) override final;
|
||||
virtual void swap_chain_free(SwapChainID p_swap_chain) override final;
|
||||
|
||||
private:
|
||||
/*********************/
|
||||
/**** FRAMEBUFFER ****/
|
||||
/*********************/
|
||||
|
|
@ -389,12 +392,16 @@ public:
|
|||
struct Framebuffer {
|
||||
VkFramebuffer vk_framebuffer = VK_NULL_HANDLE;
|
||||
|
||||
// Only filled in if the framebuffer uses a fragment density map with offsets. Unused otherwise.
|
||||
uint32_t fragment_density_map_offsets_layers = 0;
|
||||
|
||||
// Only filled in by a framebuffer created by a swap chain. Unused otherwise.
|
||||
VkImage swap_chain_image = VK_NULL_HANDLE;
|
||||
VkImageSubresourceRange swap_chain_image_subresource_range = {};
|
||||
bool swap_chain_acquired = false;
|
||||
};
|
||||
|
||||
public:
|
||||
virtual FramebufferID framebuffer_create(RenderPassID p_render_pass, VectorView<TextureID> p_attachments, uint32_t p_width, uint32_t p_height) override final;
|
||||
virtual void framebuffer_free(FramebufferID p_framebuffer) override final;
|
||||
|
||||
|
|
@ -572,9 +579,16 @@ public:
|
|||
/**** RENDERING ****/
|
||||
/*******************/
|
||||
|
||||
private:
|
||||
// ----- SUBPASS -----
|
||||
|
||||
virtual RenderPassID render_pass_create(VectorView<Attachment> p_attachments, VectorView<Subpass> p_subpasses, VectorView<SubpassDependency> p_subpass_dependencies, uint32_t p_view_count) override final;
|
||||
struct RenderPassInfo {
|
||||
VkRenderPass vk_render_pass = VK_NULL_HANDLE;
|
||||
bool uses_fragment_density_map_offsets = false;
|
||||
};
|
||||
|
||||
public:
|
||||
virtual RenderPassID render_pass_create(VectorView<Attachment> p_attachments, VectorView<Subpass> p_subpasses, VectorView<SubpassDependency> p_subpass_dependencies, uint32_t p_view_count, AttachmentReference p_fragment_density_map_attachment) override final;
|
||||
virtual void render_pass_free(RenderPassID p_render_pass) override final;
|
||||
|
||||
// ----- COMMANDS -----
|
||||
|
|
@ -692,6 +706,8 @@ public:
|
|||
virtual uint64_t api_trait_get(ApiTrait p_trait) override final;
|
||||
virtual bool has_feature(Features p_feature) override final;
|
||||
virtual const MultiviewCapabilities &get_multiview_capabilities() override final;
|
||||
virtual const FragmentShadingRateCapabilities &get_fragment_shading_rate_capabilities() override final;
|
||||
virtual const FragmentDensityMapCapabilities &get_fragment_density_map_capabilities() override final;
|
||||
virtual String get_api_name() const override final;
|
||||
virtual String get_api_version() const override final;
|
||||
virtual String get_pipeline_cache_uuid() const override final;
|
||||
|
|
@ -709,7 +725,9 @@ private:
|
|||
TextureInfo,
|
||||
VertexFormatInfo,
|
||||
ShaderInfo,
|
||||
UniformSetInfo>;
|
||||
UniformSetInfo,
|
||||
RenderPassInfo,
|
||||
CommandBufferInfo>;
|
||||
PagedAllocator<VersatileResource, true> resources_allocator;
|
||||
|
||||
/******************/
|
||||
|
|
@ -720,5 +738,3 @@ public:
|
|||
};
|
||||
|
||||
using VKC = RenderingContextDriverVulkan;
|
||||
|
||||
#endif // RENDERING_DEVICE_DRIVER_VULKAN_H
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef VULKAN_HOOKS_H
|
||||
#define VULKAN_HOOKS_H
|
||||
#pragma once
|
||||
|
||||
#include "drivers/vulkan/godot_vulkan.h"
|
||||
|
||||
|
|
@ -46,5 +45,3 @@ public:
|
|||
virtual void set_direct_queue_family_and_index(uint32_t p_queue_family_index, uint32_t p_queue_index) = 0;
|
||||
static VulkanHooks *get_singleton() { return singleton; }
|
||||
};
|
||||
|
||||
#endif // VULKAN_HOOKS_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue