Merge pull request #3263 from Themaister/master

Vulkan: Fix various bugs with slang implementation.
This commit is contained in:
Twinaphex 2016-07-23 23:58:54 +02:00 committed by GitHub
commit 29314d476f

View File

@ -233,6 +233,7 @@ struct CommonResources
vector<Texture> original_history;
vector<Texture> framebuffer_feedback;
vector<Texture> pass_outputs;
unordered_map<string, slang_texture_semantic_map> texture_semantic_map;
unordered_map<string, slang_texture_semantic_map> texture_semantic_uniform_map;
@ -746,6 +747,8 @@ bool vulkan_filter_chain::init_alias()
if (name.empty())
continue;
unsigned i = &pass - passes.data();
if (!set_unique_map(common.texture_semantic_map, name,
slang_texture_semantic_map{ SLANG_TEXTURE_SEMANTIC_PASS_OUTPUT, i }))
return false;
@ -761,8 +764,6 @@ bool vulkan_filter_chain::init_alias()
if (!set_unique_map(common.texture_semantic_uniform_map, name + "FeedbackSize",
slang_texture_semantic_map{ SLANG_TEXTURE_SEMANTIC_PASS_FEEDBACK, i }))
return false;
i++;
}
return true;
}
@ -825,7 +826,7 @@ bool vulkan_filter_chain::init()
return false;
if (!init_feedback())
return false;
common.pass_outputs.resize(passes.size());
return true;
}
@ -874,6 +875,8 @@ void vulkan_filter_chain::build_offscreen_passes(VkCommandBuffer cmd,
source.texture.width = fb.get_size().width;
source.texture.height = fb.get_size().height;
source.filter = passes[i + 1]->get_source_filter();
common.pass_outputs[i] = source;
}
}
@ -1612,6 +1615,16 @@ void Pass::build_semantics(VkDescriptorSet set, uint8_t *buffer,
i++;
}
// Previous passes.
i = 0;
for (auto &texture : common->pass_outputs)
{
build_semantic_texture_array(set, buffer,
SLANG_TEXTURE_SEMANTIC_PASS_OUTPUT, i,
texture);
i++;
}
// Feedback FBOs.
i = 0;
for (auto &texture : common->framebuffer_feedback)