Fixed several Vulkan errors

This commit is contained in:
Robert Beckebans 2022-09-22 20:08:07 +02:00
parent 1d456a9026
commit c55467ef33
3 changed files with 23 additions and 11 deletions

View file

@ -39,6 +39,8 @@ If you have questions concerning this license or the applicable additional terms
#include <sys/DeviceManager.h>
#include <nvrhi/utils.h>
extern DeviceManager* deviceManager;
#elif defined(USE_VULKAN)
extern idUniformBuffer emptyUBO;
@ -100,10 +102,20 @@ void idRenderProgManager::Init( nvrhi::IDevice* device )
uniforms.SetNum( RENDERPARM_TOTAL, vec4_zero );
uniformsChanged = false;
constantBuffer = device->createBuffer(
nvrhi::utils::CreateVolatileConstantBufferDesc( uniforms.Allocated(),
"RenderParams",
c_MaxRenderPassConstantBufferVersions ) );
if( deviceManager->GetGraphicsAPI() == nvrhi::GraphicsAPI::VULKAN )
{
// RB: FIXME this is ugly - DOUBLECHECK this
constantBuffer = device->createBuffer(
nvrhi::utils::CreateVolatileConstantBufferDesc( uniforms.Allocated(),
"RenderParams", 128 ) );
}
else
{
constantBuffer = device->createBuffer(
nvrhi::utils::CreateVolatileConstantBufferDesc( uniforms.Allocated(),
"RenderParams",
c_MaxRenderPassConstantBufferVersions ) );
}
// === Main draw vertex layout ===
vertexLayoutDescs.SetNum( NUM_VERTEX_LAYOUTS, {} );

View file

@ -29,8 +29,8 @@ If you have questions concerning this license or the applicable additional terms
#include "global_inc.hlsl"
// *INDENT-OFF*
Texture2D texGui : register( t0 VK_DESCRIPTOR_SET( 0 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D texGui : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_POSITION;

View file

@ -263,23 +263,23 @@ private:
if( flags & VK_DEBUG_REPORT_ERROR_BIT_EXT )
{
idLib::Printf( "[Vulkan] ERROR location=0x%zx code=%d, layerPrefix='%s'] %s", location, code, layerPrefix, msg );
idLib::Printf( "[Vulkan] ERROR location=0x%zx code=%d, layerPrefix='%s'] %s\n", location, code, layerPrefix, msg );
}
else if( flags & VK_DEBUG_REPORT_WARNING_BIT_EXT )
{
idLib::Printf( "[Vulkan] WARNING location=0x%zx code=%d, layerPrefix='%s'] %s", location, code, layerPrefix, msg );
idLib::Printf( "[Vulkan] WARNING location=0x%zx code=%d, layerPrefix='%s'] %s\n", location, code, layerPrefix, msg );
}
else if( flags & VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT )
{
idLib::Printf( "[Vulkan] PERFORMANCE WARNING location=0x%zx code=%d, layerPrefix='%s'] %s", location, code, layerPrefix, msg );
idLib::Printf( "[Vulkan] PERFORMANCE WARNING location=0x%zx code=%d, layerPrefix='%s'] %s\n", location, code, layerPrefix, msg );
}
else if( flags & VK_DEBUG_REPORT_INFORMATION_BIT_EXT )
{
idLib::Printf( "[Vulkan] INFO location=0x%zx code=%d, layerPrefix='%s'] %s", location, code, layerPrefix, msg );
idLib::Printf( "[Vulkan] INFO location=0x%zx code=%d, layerPrefix='%s'] %s\n", location, code, layerPrefix, msg );
}
else if( flags & VK_DEBUG_REPORT_DEBUG_BIT_EXT )
{
idLib::Printf( "[Vulkan] DEBUG location=0x%zx code=%d, layerPrefix='%s'] %s", location, code, layerPrefix, msg );
idLib::Printf( "[Vulkan] DEBUG location=0x%zx code=%d, layerPrefix='%s'] %s\n", location, code, layerPrefix, msg );
}
return VK_FALSE;