Merge pull request #111183 from stuartcarnie/matias-uma-pc-pr

Add Persistent Buffers utilizing UMA
This commit is contained in:
Thaddeus Crews 2025-10-24 11:23:11 -05:00
commit edbfb7a6ec
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
38 changed files with 2848 additions and 1466 deletions

View file

@ -413,6 +413,7 @@ void ShaderBakerExportPlugin::_customize_shader_version(ShaderRD *p_shader, RID
work_item.cache_path = group_items[group].cache_path;
work_item.shader_name = p_shader->get_name();
work_item.stage_sources = p_shader->version_build_variant_stage_sources(p_version, i);
work_item.dynamic_buffers = p_shader->get_dynamic_buffers();
work_item.variant = i;
WorkerThreadPool::TaskID task_id = WorkerThreadPool::get_singleton()->add_template_task(this, &ShaderBakerExportPlugin::_process_work_item, work_item);
@ -428,7 +429,7 @@ void ShaderBakerExportPlugin::_customize_shader_version(ShaderRD *p_shader, RID
void ShaderBakerExportPlugin::_process_work_item(WorkItem p_work_item) {
if (!tasks_cancelled) {
// Only process the item if the tasks haven't been cancelled by the user yet.
Vector<RD::ShaderStageSPIRVData> spirv_data = ShaderRD::compile_stages(p_work_item.stage_sources);
Vector<RD::ShaderStageSPIRVData> spirv_data = ShaderRD::compile_stages(p_work_item.stage_sources, p_work_item.dynamic_buffers);
ERR_FAIL_COND_MSG(spirv_data.is_empty(), "Unable to retrieve SPIR-V data for shader");
Ref<RenderingShaderContainer> shader_container = shader_container_format->create_container();

View file

@ -52,6 +52,7 @@ protected:
String cache_path;
String shader_name;
Vector<String> stage_sources;
Vector<uint64_t> dynamic_buffers;
int64_t variant = 0;
};