Class VulkanMaterial¶
Defined in File vulkan_material.h
Nested Relationships¶
Nested Types¶
Inheritance Relationships¶
Base Type¶
public portal::renderer::Material(Class Material)
Class Documentation¶
-
class VulkanMaterial : public portal::renderer::Material¶
Vulkan material with descriptor set management and uniform storage.
Manages shader parameter binding through descriptor sets and uniform buffers. Automatically maps shader uniforms to CPU storage and GPU descriptors.
Public Functions
-
VulkanMaterial(const MaterialProperties &properties, const VulkanContext &context)¶
Constructs Vulkan material.
-
~VulkanMaterial() override¶
-
void set_pipeline(const Reference<VulkanPipeline> &new_pipeline)¶
Sets rendering pipeline.
- Parameters:
new_pipeline – Vulkan pipeline
-
Reference<VulkanPipeline> get_pipeline() const¶
Gets rendering pipeline.
-
virtual void set(StringId bind_point, const ResourceReference<Texture> &texture) override¶
Binds texture (resource reference)
-
virtual void set(StringId bind_point, const Reference<ImageView> &image) override¶
Binds image view.
-
virtual Reference<ShaderVariant> get_shader() override¶
Gets material shader.
-
vk::DescriptorSet get_descriptor_set(size_t index) const¶
Gets descriptor set at index.
- Parameters:
index – Descriptor set index
- Returns:
Vulkan descriptor set
-
bool operator==(const VulkanMaterial &other) const¶
Equality comparison.
-
template<typename T>
inline void set(const StringId bind_point, const T &t)¶ Binds scalar uniform (int, float, etc.)
- Template Parameters:
T – Scalar type
- Parameters:
bind_point – Uniform name
t – Value to bind
-
template<reflection::IsVec T>
inline void set(const StringId bind_point, const T &t)¶ Binds vector uniform (vec2, vec3, vec4)
- Template Parameters:
T – Vector type
- Parameters:
bind_point – Uniform name
t – Value to bind
-
template<reflection::IsMatrix T>
inline void set(const StringId bind_point, const T &t)¶ Binds matrix uniform (mat2, mat3, mat4)
- Template Parameters:
T – Matrix type
- Parameters:
bind_point – Uniform name
t – Value to bind
-
virtual void set(StringId bind_point, const ResourceReference<Texture> &texture) = 0
Binds texture (resource reference)
-
template<typename T>
inline T &get(const StringId bind_point)¶ Gets scalar uniform value.
- Template Parameters:
T – Scalar type
- Parameters:
bind_point – Uniform name
- Returns:
Reference to uniform value
Protected Functions
-
struct UniformPointer
Maps bind point to shader uniform location.
-
VulkanMaterial(const MaterialProperties &properties, const VulkanContext &context)¶