if(changes&PipelineState::VERTEX_SETUP)
self.vertex_setup->refresh();
+ if(changes&PipelineState::SHPROG)
+ {
+ push_const_compat = hash<32>(self.shprog->stage_flags);
+ push_const_compat = hash_update<32>(push_const_compat, self.shprog->get_push_constants_size());
+ }
+
constexpr unsigned pipeline_mask = PipelineState::SHPROG|PipelineState::VERTEX_SETUP|PipelineState::FACE_CULL|
PipelineState::DEPTH_TEST|PipelineState::STENCIL_TEST|PipelineState::BLEND|PipelineState::PRIMITIVE_TYPE;
if(changes&pipeline_mask)
if(handle!=last->handle)
{
unapplied |= PipelineState::SHPROG;
- if(self.shprog->stage_flags!=last_ps.shprog->stage_flags)
+ if(self.push_const_compat!=last_ps.push_const_compat)
{
unapplied |= PipelineState::UNIFORMS;
first_changed_desc_set = 0;
mutable VkPipeline handle = 0;
mutable std::vector<unsigned> descriptor_set_slots;
mutable unsigned first_changed_desc_set = 0;
+ mutable std::uint32_t push_const_compat = 0;
VulkanPipelineState();
VulkanPipelineState(VulkanPipelineState &&);
reflect_data.uniform_blocks.emplace_back();
ReflectData::UniformBlockInfo &info = reflect_data.uniform_blocks.back();
info.name = v.struct_type->name;
+ info.data_size = v.struct_type->size;
if(v.storage==SpirVModule::PUSH_CONSTANT)
+ {
info.bind_point = ReflectData::PUSH_CONSTANT;
+ reflect_data.push_constants_size = info.data_size;
+ }
else
{
if(v.binding>=0)
info.bind_point = ReflectData::DEFAULT_BLOCK;
n_descriptor_sets = max(n_descriptor_sets, v.descriptor_set+1);
}
- info.data_size = v.struct_type->size;
string prefix;
if(!v.name.empty())
public:
ReflectData::LayoutHash get_uniform_layout_hash() const { return reflect_data.layout_hash; }
unsigned get_n_descriptor_sets() const { return reflect_data.n_descriptor_sets; }
+ unsigned get_push_constants_size() const { return reflect_data.push_constants_size; }
const std::vector<ReflectData::UniformBlockInfo> &get_uniform_blocks() const { return reflect_data.uniform_blocks; }
const ReflectData::UniformBlockInfo &get_uniform_block_info(const std::string &) const;
const std::vector<ReflectData::UniformInfo> &get_uniforms() const { return reflect_data.uniforms; }
std::vector<AttributeInfo> attributes;
unsigned n_clip_distances = 0;
unsigned n_descriptor_sets = 0;
+ unsigned push_constants_size = 0;
std::vector<int> used_bindings;
void update_layout_hash();