Bulk update nvpro-samples 11/20/23

5c72ddfc0522eb6604828e74886cf39be646ba78
This commit is contained in:
Mathias Heyer 2023-11-20 13:54:44 -08:00
parent debd0d5e33
commit 0c73e8ec1b
96 changed files with 927 additions and 922 deletions

View file

@ -42,7 +42,7 @@ public:
void setup(const VkInstance& instance, const VkDevice& device, const VkPhysicalDevice& physicalDevice, uint32_t queueFamily) override;
void createDescriptorSetLayout();
void createGraphicsPipeline();
void loadModel(const std::string& filename, nvmath::mat4f transform = nvmath::mat4f(1));
void loadModel(const std::string& filename, glm::mat4 transform = glm::mat4(1));
void updateDescriptorSet();
void createUniformBuffer();
void createObjDescriptionBuffer();
@ -66,18 +66,18 @@ public:
// Instance of the OBJ
struct ObjInstance
{
nvmath::mat4f transform; // Matrix of the instance
uint32_t objIndex{0}; // Model index reference
glm::mat4 transform; // Matrix of the instance
uint32_t objIndex{0}; // Model index reference
};
// Information pushed at each draw call
PushConstantRaster m_pcRaster{
{1}, // Identity matrix
{9.5f, 5.5f, -6.5f}, // light position
0, // instance Id
100.f, // light intensity
0 // light type
{1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}, // Identity matrix
{9.5f, 5.5f, -6.5f}, // light position
0, // instance Id
100.f, // light intensity
0 // light type
};
// Array of objects and instances in the scene
@ -133,17 +133,17 @@ public:
void updateRtDescriptorSet();
void createRtPipeline();
void createRtShaderBindingTable();
void raytrace(const VkCommandBuffer& cmdBuf, const nvmath::vec4f& clearColor);
void raytrace(const VkCommandBuffer& cmdBuf, const glm::vec4& clearColor);
void updateFrame();
void resetFrame();
VkPhysicalDeviceRayTracingPipelinePropertiesKHR m_rtProperties{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_PIPELINE_PROPERTIES_KHR};
nvvk::RaytracingBuilderKHR m_rtBuilder;
nvvk::DescriptorSetBindings m_rtDescSetLayoutBind;
VkDescriptorPool m_rtDescPool;
VkDescriptorSetLayout m_rtDescSetLayout;
VkDescriptorSet m_rtDescSet;
nvvk::RaytracingBuilderKHR m_rtBuilder;
nvvk::DescriptorSetBindings m_rtDescSetLayoutBind;
VkDescriptorPool m_rtDescPool;
VkDescriptorSetLayout m_rtDescSetLayout;
VkDescriptorSet m_rtDescSet;
std::vector<VkRayTracingShaderGroupCreateInfoKHR> m_rtShaderGroups;
VkPipelineLayout m_rtPipelineLayout;
VkPipeline m_rtPipeline;