Renderer: Add pipeline and texture sampler info validation
This commit is contained in:
@@ -598,7 +598,7 @@ namespace Nz
|
||||
&deviceFeatures
|
||||
};
|
||||
|
||||
std::shared_ptr<VulkanDevice> device = std::make_shared<VulkanDevice>(s_instance, BuildRenderDeviceInfo(deviceInfo));
|
||||
std::shared_ptr<VulkanDevice> device = std::make_shared<VulkanDevice>(s_instance, enabledFeatures, BuildRenderDeviceInfo(deviceInfo));
|
||||
if (!device->Create(deviceInfo, createInfo))
|
||||
{
|
||||
NazaraError("Failed to create Vulkan Device: " + TranslateVulkanError(device->GetLastErrorCode()));
|
||||
|
||||
@@ -22,6 +22,11 @@ namespace Nz
|
||||
return m_renderDeviceInfo;
|
||||
}
|
||||
|
||||
const RenderDeviceFeatures& VulkanDevice::GetEnabledFeatures() const
|
||||
{
|
||||
return m_enabledFeatures;
|
||||
}
|
||||
|
||||
std::shared_ptr<AbstractBuffer> VulkanDevice::InstantiateBuffer(BufferType type)
|
||||
{
|
||||
return std::make_shared<VulkanBuffer>(*this, type);
|
||||
|
||||
@@ -13,10 +13,12 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
VulkanRenderPipeline::VulkanRenderPipeline(Vk::Device& device, RenderPipelineInfo pipelineInfo) :
|
||||
VulkanRenderPipeline::VulkanRenderPipeline(VulkanDevice& device, RenderPipelineInfo pipelineInfo) :
|
||||
m_device(&device),
|
||||
m_pipelineInfo(std::move(pipelineInfo))
|
||||
{
|
||||
ValidatePipelineInfo(device, m_pipelineInfo);
|
||||
|
||||
m_pipelineCreateInfo = BuildCreateInfo(m_pipelineInfo);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,13 +3,16 @@
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/VulkanRenderer/VulkanTextureSampler.hpp>
|
||||
#include <Nazara/VulkanRenderer/VulkanDevice.hpp>
|
||||
#include <stdexcept>
|
||||
#include <Nazara/VulkanRenderer/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
VulkanTextureSampler::VulkanTextureSampler(Vk::Device& device, TextureSamplerInfo samplerInfo)
|
||||
VulkanTextureSampler::VulkanTextureSampler(VulkanDevice& device, TextureSamplerInfo samplerInfo)
|
||||
{
|
||||
ValidateSamplerInfo(device, samplerInfo);
|
||||
|
||||
VkSamplerCreateInfo createInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO };
|
||||
createInfo.magFilter = ToVulkan(samplerInfo.magFilter);
|
||||
createInfo.minFilter = ToVulkan(samplerInfo.minFilter);
|
||||
|
||||
Reference in New Issue
Block a user