for(const SpirVModule::Variable &v: mod.get_variables())
{
- if(v.storage==SpirVModule::UNIFORM && v.struct_type)
+ if((v.storage==SpirVModule::UNIFORM || v.storage==SpirVModule::PUSH_CONSTANT) && v.struct_type)
{
reflect_data.uniform_blocks.push_back(ReflectData::UniformBlockInfo());
ReflectData::UniformBlockInfo &info = reflect_data.uniform_blocks.back();
info.name = v.struct_type->name;
- info.bind_point = v.binding;
- info.descriptor_set = v.descriptor_set;
+ if(v.storage==SpirVModule::PUSH_CONSTANT)
+ info.bind_point = ReflectData::PUSH_CONSTANT;
+ else
+ {
+ info.bind_point = v.binding;
+ info.descriptor_set = v.descriptor_set;
+ }
info.data_size = v.struct_type->size;
string prefix;
*/
struct ReflectData
{
+ enum
+ {
+ DEFAULT_BLOCK = -1,
+ PUSH_CONSTANT = -2
+ };
+
typedef unsigned LayoutHash;
struct UniformBlockInfo;
std::string name;
unsigned data_size = 0;
int descriptor_set = 0;
- int bind_point = -1;
+ int bind_point = DEFAULT_BLOCK;
std::vector<const UniformInfo *> uniforms;
LayoutHash layout_hash = 0;