initial commit-moved from vulkan_guide
This commit is contained in:
42
src/render/vk_materials.h
Normal file
42
src/render/vk_materials.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include <core/vk_types.h>
|
||||
#include <core/vk_descriptors.h>
|
||||
|
||||
class VulkanEngine;
|
||||
|
||||
struct GLTFMetallic_Roughness
|
||||
{
|
||||
MaterialPipeline opaquePipeline;
|
||||
MaterialPipeline transparentPipeline;
|
||||
MaterialPipeline gBufferPipeline;
|
||||
|
||||
VkDescriptorSetLayout materialLayout;
|
||||
|
||||
struct MaterialConstants
|
||||
{
|
||||
glm::vec4 colorFactors;
|
||||
glm::vec4 metal_rough_factors;
|
||||
|
||||
glm::vec4 extra[14];
|
||||
};
|
||||
|
||||
struct MaterialResources
|
||||
{
|
||||
AllocatedImage colorImage;
|
||||
VkSampler colorSampler;
|
||||
AllocatedImage metalRoughImage;
|
||||
VkSampler metalRoughSampler;
|
||||
VkBuffer dataBuffer;
|
||||
uint32_t dataBufferOffset;
|
||||
};
|
||||
|
||||
DescriptorWriter writer;
|
||||
|
||||
void build_pipelines(VulkanEngine *engine);
|
||||
|
||||
void clear_resources(VkDevice device) const;
|
||||
|
||||
MaterialInstance write_material(VkDevice device, MaterialPass pass, const MaterialResources &resources,
|
||||
DescriptorAllocatorGrowable &descriptorAllocator);
|
||||
};
|
||||
Reference in New Issue
Block a user