parent
							
								
									d589afb3bb
								
							
						
					
					
						commit
						1a69774a71
					
				| 
						 | 
					@ -660,7 +660,7 @@ void VulkanExample::getEnabledFeatures()
 | 
				
			||||||
		VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
 | 
							VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		VkClearValue clearValues[2];
 | 
							VkClearValue clearValues[2];
 | 
				
			||||||
		clearValues[0].color = defaultClearColor;
 | 
							
 | 
				
			||||||
		clearValues[0].color = { { 0.25f, 0.25f, 0.25f, 1.0f } };;
 | 
							clearValues[0].color = { { 0.25f, 0.25f, 0.25f, 1.0f } };;
 | 
				
			||||||
		clearValues[1].depthStencil = { 1.0f, 0 };
 | 
							clearValues[1].depthStencil = { 1.0f, 0 };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -837,16 +837,13 @@ void VulkanExample::getEnabledFeatures()
 | 
				
			||||||
		VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo(poolSizes, maxSetCount);
 | 
							VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo(poolSizes, maxSetCount);
 | 
				
			||||||
		VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
 | 
							VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		std::vector<VkDescriptorSetLayoutBinding> setLayoutBindings =
 | 
							// Descriptor set layouts
 | 
				
			||||||
		{
 | 
							
 | 
				
			||||||
			vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0),
 | 
							VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCI = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBinding);
 | 
				
			||||||
			vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 0),
 | 
					 | 
				
			||||||
			vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0),
 | 
					 | 
				
			||||||
		};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Descriptor set layout for passing matrices
 | 
							// Descriptor set layout for passing matrices
 | 
				
			||||||
		VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCI = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
 | 
					
 | 
				
			||||||
 | 
							setLayoutBinding = vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0);
 | 
				
			||||||
		VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCI, nullptr, &descriptorSetLayouts.matrices));
 | 
							VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCI, nullptr, &descriptorSetLayouts.matrices));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Descriptor set layout for passing material textures
 | 
							// Descriptor set layout for passing material textures
 | 
				
			||||||
| 
						 | 
					@ -856,7 +853,7 @@ void VulkanExample::getEnabledFeatures()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Descriptor set layout for passing skin joint matrices
 | 
							// Descriptor set layout for passing skin joint matrices
 | 
				
			||||||
		
 | 
							setLayoutBinding = vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0);
 | 
				
			||||||
		VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCI, nullptr, &descriptorSetLayouts.jointMatrices));
 | 
							VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCI, nullptr, &descriptorSetLayouts.jointMatrices));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// The pipeline layout uses three sets:
 | 
							// The pipeline layout uses three sets:
 | 
				
			||||||
| 
						 | 
					@ -972,7 +969,7 @@ void VulkanExample::getEnabledFeatures()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Map persistent
 | 
							// Map persistent
 | 
				
			||||||
		VK_CHECK_RESULT(shaderData.buffer.map());
 | 
							VK_CHECK_RESULT(shaderData.buffer.map());
 | 
				
			||||||
	
 | 
					
 | 
				
			||||||
		updateUniformBuffers();
 | 
							updateUniformBuffers();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1003,7 +1000,7 @@ void VulkanExample::getEnabledFeatures()
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (!paused)
 | 
							if (!paused)
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			glTFModel.updateAnimation(frameTimer,shaderData.buffer);
 | 
								glTFModel.updateAnimation(frameTimer,shaderData.skinSSBO);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -223,14 +223,12 @@ public:
 | 
				
			||||||
		VkDescriptorSetLayout matrices;
 | 
							VkDescriptorSetLayout matrices;
 | 
				
			||||||
		VkDescriptorSetLayout textures;
 | 
							VkDescriptorSetLayout textures;
 | 
				
			||||||
		VkDescriptorSetLayout jointMatrices;
 | 
							VkDescriptorSetLayout jointMatrices;
 | 
				
			||||||
		VkDescriptorSetLayout ssbo;
 | 
					 | 
				
			||||||
	} descriptorSetLayouts;
 | 
						} descriptorSetLayouts;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	VkDescriptorSet descriptorSet;
 | 
						VkDescriptorSet descriptorSet;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	VulkanExample();
 | 
						VulkanExample();
 | 
				
			||||||
	~VulkanExample();
 | 
						~VulkanExample();
 | 
				
			||||||
	
 | 
					 | 
				
			||||||
	void         loadglTFFile(std::string filename);
 | 
						void         loadglTFFile(std::string filename);
 | 
				
			||||||
	virtual void getEnabledFeatures();
 | 
						virtual void getEnabledFeatures();
 | 
				
			||||||
	void         buildCommandBuffers();
 | 
						void         buildCommandBuffers();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue