1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Implement more rendering options as specialization constants

* Shadow quality settings now specialization constant.
* Decal and light projector filters can be set.
* Changing those settings forces re-creation of the pipelines.

These changes should help improve performance related to shadow mapping, and allows improving performance by sacrificing decal and light projector quality.
This commit is contained in:
reduz
2021-07-19 16:41:55 -03:00
parent 855c7c7414
commit 9293bc3935
27 changed files with 574 additions and 142 deletions

View File

@@ -68,6 +68,9 @@ RID PipelineCacheRD::_generate_version(RD::VertexFormatID p_vertex_format_id, RD
}
void PipelineCacheRD::_clear() {
#ifndef _MSC_VER
#warning Clear should probably recompile all the variants already compiled instead to avoid stalls? needs discussion
#endif
if (versions) {
for (uint32_t i = 0; i < version_count; i++) {
//shader may be gone, so this may not be valid
@@ -94,6 +97,10 @@ void PipelineCacheRD::setup(RID p_shader, RD::RenderPrimitive p_primitive, const
dynamic_state_flags = p_dynamic_state_flags;
base_specialization_constants = p_base_specialization_constants;
}
void PipelineCacheRD::update_specialization_constants(const Vector<RD::PipelineSpecializationConstant> &p_base_specialization_constants) {
base_specialization_constants = p_base_specialization_constants;
_clear();
}
void PipelineCacheRD::update_shader(RID p_shader) {
ERR_FAIL_COND(p_shader.is_null());