tech(resources.get<GL::Technique>("rain.tech")),
mesh((GL::VERTEX3, GL::TEXCOORD1))
{
+ mesh.set_debug_name("Rain mesh");
+
std::minstd_rand rng;
std::uniform_real_distribution<float> dist(0.0f, 1.0f);
GL::MeshBuilder bld(mesh);
}
bld.end();
+ shdata.set_debug_name("Rain params");
shdata.uniform("time", 0.0f);
}
sim_shdata.uniform("max_flow_fraction", 0.9999f);
sim_shdata.uniform("residual_depth", 0.01f);
+ shdata.set_debug_name("Water params");
shdata.uniform("Region.scale", 1.0f/(region.right-region.left), 1.0f/(region.top-region.bottom));
shdata.uniform("Region.offset", -region.left/(region.right-region.left), -region.bottom/(region.top-region.bottom));
shdata.uniform("Region.amplitude", 0.01f);
void VulkanFramebuffer::set_vulkan_object_name() const
{
#ifdef DEBUG
+ const Framebuffer &self = *static_cast<const Framebuffer *>(this);
const VulkanFunctions &vk = device.get_functions();
VkDebugUtilsObjectNameInfoEXT name_info = { };
name_info.objectHandle = reinterpret_cast<uint64_t>(handle);
name_info.pObjectName = debug_name.c_str();
vk.SetDebugUtilsObjectName(name_info);
+
+ name_info.objectType = VK_OBJECT_TYPE_IMAGE_VIEW;
+ unsigned i=0;
+ for(FrameAttachment a: self.format)
+ {
+ if(view_handles[i])
+ {
+ string view_name;
+ if(get_attach_point(a)==get_attach_point(DEPTH_ATTACHMENT))
+ view_name = debug_name+": depth.view";
+ else if(get_attach_point(a)==get_attach_point(STENCIL_ATTACHMENT))
+ view_name = debug_name+": stencil.view";
+ else
+ view_name = format("%s: color%d.view", debug_name, i);
+ name_info.objectHandle = reinterpret_cast<uint64_t>(view_handles[i]);
+ name_info.pObjectName = view_name.c_str();
+ vk.SetDebugUtilsObjectName(name_info);
+ }
+
+ ++i;
+ }
#endif
}
float get_alpha_cutoff() const { return alpha_cutoff; }
float get_alpha_feather() const { return alpha_feather; }
- void set_debug_name(const std::string &);
+ virtual void set_debug_name(const std::string &);
template<typename T>
static void register_type(const std::string &);
shdata.uniform(format("splat_materials[%d].%s_layer", index, name), sub.layer);
}
+void SplatMaterial::set_debug_name(const string &name)
+{
+ Material::set_debug_name(name);
+#ifdef DEBUG
+ debug_name = name;
+ set_array_debug_names();
+#endif
+}
+
+void SplatMaterial::set_array_debug_names()
+{
+#ifdef DEBUG
+ if(base_color_array.texture)
+ base_color_array.texture->set_debug_name(debug_name+": base_color.tex");
+ if(normal_array.texture)
+ normal_array.texture->set_debug_name(debug_name+": normal.tex");
+ if(metalness_array.texture)
+ metalness_array.texture->set_debug_name(debug_name+": metalness.tex");
+ if(roughness_array.texture)
+ roughness_array.texture->set_debug_name(debug_name+": roughness.tex");
+ if(occlusion_array.texture)
+ occlusion_array.texture->set_debug_name(debug_name+": occlusion.tex");
+ if(emission_array.texture)
+ emission_array.texture->set_debug_name(debug_name+": emission.tex");
+#endif
+}
+
void SplatMaterial::MapArray::create()
{
obj.roughness_array.create();
obj.occlusion_array.create();
obj.emission_array.create();
+#ifdef DEBUG
+ if(!obj.debug_name.empty())
+ obj.set_array_debug_names();
+#endif
DataFile::Collection &c = get_collection();
for(unsigned i=0; i<obj.sub_materials.size(); ++i)
MapArray emission_array;
const Texture2D &fresnel_lookup;
const Sampler &fresnel_sampler;
+ std::string debug_name;
static const Tag texture_tags[];
void set_sub_uniforms(unsigned);
void upload_sub(DataFile::Collection &, unsigned);
void upload_sub_map(DataFile::Collection &, unsigned, SubMap SubMaterial::*, MapArray &, const char *);
+
+public:
+ virtual void set_debug_name(const std::string &);
+private:
+ void set_array_debug_names();
};
} // namespace GL