mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-25 21:27:45 +00:00
Fix rendering on Windows
At least on my machine, the AMD Windows Vulkan driver is way more strict compared to Linux. * The correct device features are now enabled. * Image usage flags for offscreen textures are corrected.
This commit is contained in:
parent
21e7313efd
commit
a0e3e41303
3 changed files with 6 additions and 5 deletions
|
@ -1054,19 +1054,19 @@ void GameRenderer::createImageResources()
|
||||||
m_normalGBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
m_normalGBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
||||||
m_device.swapChain->extent.height,
|
m_device.swapChain->extent.height,
|
||||||
VK_FORMAT_R8G8B8A8_UNORM,
|
VK_FORMAT_R8G8B8A8_UNORM,
|
||||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
|
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
|
||||||
m_viewPositionBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
m_viewPositionBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
||||||
m_device.swapChain->extent.height,
|
m_device.swapChain->extent.height,
|
||||||
VK_FORMAT_R8G8B8A8_UNORM,
|
VK_FORMAT_R8G8B8A8_UNORM,
|
||||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
|
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
|
||||||
m_compositeBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
m_compositeBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
||||||
m_device.swapChain->extent.height,
|
m_device.swapChain->extent.height,
|
||||||
VK_FORMAT_R8G8B8A8_UNORM,
|
VK_FORMAT_R8G8B8A8_UNORM,
|
||||||
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
|
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
|
||||||
m_depthBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
m_depthBuffer = m_device.createTexture(m_device.swapChain->extent.width,
|
||||||
m_device.swapChain->extent.height,
|
m_device.swapChain->extent.height,
|
||||||
VK_FORMAT_D32_SFLOAT,
|
VK_FORMAT_D32_SFLOAT,
|
||||||
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
|
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
|
||||||
|
|
||||||
CommonParameter commonParam{};
|
CommonParameter commonParam{};
|
||||||
commonParam.m_RenderTarget = {1.0f / m_device.swapChain->extent.width,
|
commonParam.m_RenderTarget = {1.0f / m_device.swapChain->extent.width,
|
||||||
|
|
|
@ -196,6 +196,7 @@ RenderManager::RenderManager(GameData *data)
|
||||||
VkPhysicalDeviceFeatures enabledFeatures{};
|
VkPhysicalDeviceFeatures enabledFeatures{};
|
||||||
enabledFeatures.shaderClipDistance = VK_TRUE;
|
enabledFeatures.shaderClipDistance = VK_TRUE;
|
||||||
enabledFeatures.shaderCullDistance = VK_TRUE;
|
enabledFeatures.shaderCullDistance = VK_TRUE;
|
||||||
|
enabledFeatures.fillModeNonSolid = VK_TRUE;
|
||||||
|
|
||||||
VkPhysicalDeviceVulkan11Features enabled11Features{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES};
|
VkPhysicalDeviceVulkan11Features enabled11Features{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES};
|
||||||
enabled11Features.shaderDrawParameters = VK_TRUE;
|
enabled11Features.shaderDrawParameters = VK_TRUE;
|
||||||
|
|
|
@ -430,7 +430,7 @@ void SimpleRenderer::initDescriptors()
|
||||||
|
|
||||||
void SimpleRenderer::initTextures(int width, int height)
|
void SimpleRenderer::initTextures(int width, int height)
|
||||||
{
|
{
|
||||||
m_compositeTexture = m_device.createTexture(width, height, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT);
|
m_compositeTexture = m_device.createTexture(width, height, VK_FORMAT_R8G8B8A8_UNORM, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT);
|
||||||
m_depthTexture = m_device.createTexture(width, height, VK_FORMAT_D32_SFLOAT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
|
m_depthTexture = m_device.createTexture(width, height, VK_FORMAT_D32_SFLOAT, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue