diff options
Diffstat (limited to 'servers/rendering/rendering_device.h')
-rw-r--r-- | servers/rendering/rendering_device.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/servers/rendering/rendering_device.h b/servers/rendering/rendering_device.h index 0973e29974..03aa6f7644 100644 --- a/servers/rendering/rendering_device.h +++ b/servers/rendering/rendering_device.h @@ -123,19 +123,10 @@ public: DeviceFamily device_family = DEVICE_UNKNOWN; uint32_t version_major = 1.0; uint32_t version_minor = 0.0; - - // subgroup capabilities - uint32_t subgroup_size = 0; - uint32_t subgroup_in_shaders = 0; // Set flags using SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_FRAGMENT_BIT, etc. - uint32_t subgroup_operations = 0; // Set flags, using SubgroupOperations - - // features - bool supports_multiview = false; // If true this device supports multiview options - bool supports_fsr_half_float = false; // If true this device supports FSR scaling 3D in half float mode, otherwise use the fallback mode }; - typedef String (*ShaderSPIRVGetCacheKeyFunction)(const Capabilities *p_capabilities); - typedef Vector<uint8_t> (*ShaderCompileToSPIRVFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, const Capabilities *p_capabilities); + typedef String (*ShaderSPIRVGetCacheKeyFunction)(const RenderingDevice *p_render_device); + typedef Vector<uint8_t> (*ShaderCompileToSPIRVFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language, String *r_error, const RenderingDevice *p_render_device); typedef Vector<uint8_t> (*ShaderCacheFunction)(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language); private: @@ -444,6 +435,7 @@ public: TEXTURE_USAGE_CAN_COPY_FROM_BIT = (1 << 7), TEXTURE_USAGE_CAN_COPY_TO_BIT = (1 << 8), TEXTURE_USAGE_INPUT_ATTACHMENT_BIT = (1 << 9), + TEXTURE_USAGE_VRS_ATTACHMENT_BIT = (1 << 10), }; enum TextureSwizzle { @@ -552,6 +544,7 @@ public: Vector<int32_t> resolve_attachments; Vector<int32_t> preserve_attachments; int32_t depth_attachment = ATTACHMENT_UNUSED; + int32_t vrs_attachment = ATTACHMENT_UNUSED; // density map for VRS, only used if supported }; virtual FramebufferFormatID framebuffer_format_create_multipass(const Vector<AttachmentFormat> &p_attachments, Vector<FramebufferPass> &p_passes, uint32_t p_view_count = 1) = 0; @@ -675,6 +668,13 @@ public: const Capabilities *get_device_capabilities() const { return &device_capabilities; }; + enum Features { + SUPPORTS_MULTIVIEW, + SUPPORTS_FSR_HALF_FLOAT, + SUPPORTS_ATTACHMENT_VRS, + }; + virtual bool has_feature(const Features p_feature) const = 0; + virtual Vector<uint8_t> shader_compile_spirv_from_source(ShaderStage p_stage, const String &p_source_code, ShaderLanguage p_language = SHADER_LANGUAGE_GLSL, String *r_error = nullptr, bool p_allow_cache = true); virtual String shader_get_spirv_cache_key() const; @@ -1221,9 +1221,12 @@ public: LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_X, LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Y, LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z, + LIMIT_SUBGROUP_SIZE, + LIMIT_SUBGROUP_IN_SHADERS, // Set flags using SHADER_STAGE_VERTEX_BIT, SHADER_STAGE_FRAGMENT_BIT, etc. + LIMIT_SUBGROUP_OPERATIONS, }; - virtual uint64_t limit_get(Limit p_limit) = 0; + virtual uint64_t limit_get(Limit p_limit) const = 0; //methods below not exposed, used by RenderingDeviceRD virtual void prepare_screen_for_drawing() = 0; @@ -1324,6 +1327,7 @@ VARIANT_ENUM_CAST(RenderingDevice::InitialAction) VARIANT_ENUM_CAST(RenderingDevice::FinalAction) VARIANT_ENUM_CAST(RenderingDevice::Limit) VARIANT_ENUM_CAST(RenderingDevice::MemoryType) +VARIANT_ENUM_CAST(RenderingDevice::Features) typedef RenderingDevice RD; |