10#include "evan/EvanPlatform.hpp"
12#include <utility/graphic/material.hpp>
14#include <utility/logging/loggable.hpp>
15#include <utility/logging/default_logger.hpp>
17#include "evan/ADeviceBackend.hpp"
18#include "evan/DeviceContext.hpp"
19#include "evan/RenderSettings.hpp"
21#include "GPUTexture.hpp"
43 protected utility::logging::Loggable<GPUMaterial,
44 utility::logging::DefaultLogger>
81 const utility::graphic::Material &material,
132 void update(std::shared_ptr<DeviceContext> deviceContext,
134 const utility::graphic::Material &material,
235 VkDescriptorSetLayout descriptorSetLayout,
236 VkDescriptorPool descriptorPool,
237 const std::vector<VkBuffer> &uniformBuffers);
276 utility::graphic::AlphaMode::Opaque;
Represents a material in the rendering engine, encapsulating texture data, image views,...
void createDescriptorSets(VkDevice logicalDevice, VkDescriptorSetLayout descriptorSetLayout, VkDescriptorPool descriptorPool, const std::vector< VkBuffer > &uniformBuffers)
Creates Vulkan descriptor sets for the material, allowing shaders to access the material's texture da...
BlendMode getBlendMode() const
Retrieves the blend mode this material has to be drawn with.
const std::vector< VkDescriptorSet > & getDescriptorSets() const
Retrieves the Vulkan descriptor sets associated with this material.
void freeDescriptorSets(VkDevice device)
Frees the descriptor sets allocated for this material and clears the container.
uint32_t getUploadedVersion() const
Retrieves the version number of the uploaded material.
uint32_t getShaderID() const
Retrieves the unique shader ID associated with this material.
void update(std::shared_ptr< DeviceContext > deviceContext, const Renderer &renderer, const utility::graphic::Material &material, uint32_t shaderID)
Updates the GPUMaterial with new texture data and resources.
void cleanup()
Releases every Vulkan resource owned by this material.
std::vector< VkDescriptorSet > _descriptorSets
GPUMaterial(std::shared_ptr< DeviceContext > deviceContext, const Renderer &renderer, const utility::graphic::Material &material, uint32_t shaderID)
Constructs a GPUMaterial instance using the provided device context, renderer, and texture path.
utility::graphic::AlphaMode _alphaMode
void destroy(VkDevice device)
Destroys the Vulkan resources associated with the material.
std::vector< std::shared_ptr< GPUTexture > > _textures
uint32_t _uploadedVersion
VkDescriptorPool _descriptorPool
std::shared_ptr< DeviceContext > _deviceContext
TextureType
Enum class representing different types of textures that can be associated with a material,...
The Renderer class is responsible for managing the graphics pipeline, descriptor sets,...