Fixed rendering of the main menu with Vulkan

This commit is contained in:
Robert Beckebans 2022-09-23 09:39:48 +02:00
parent c55467ef33
commit 4c85798e67
8 changed files with 51 additions and 29 deletions

View file

@ -33,6 +33,11 @@ If you have questions concerning this license or the applicable additional terms
#include "Common_local.h"
#include "../imgui/BFGimgui.h"
#if defined( USE_NVRHI )
#include <sys/DeviceManager.h>
extern DeviceManager* deviceManager;
#endif
#define CON_TEXTSIZE 0x30000
#define NUM_CON_TIMES 4
#define CONSOLE_FIRSTREPEAT 200
@ -346,7 +351,17 @@ float idConsoleLocal::DrawFPS( float y )
ImGui::Begin( "Performance Stats" );
#if defined( USE_NVRHI )
const char* API = "DX12";
static const int gfxNumValues = 3;
static const char* gfxValues[gfxNumValues] =
{
"DX11",
"DX12",
"Vulkan",
};
const char* API = gfxValues[ int( deviceManager->GetGraphicsAPI() ) ];
#elif defined( USE_VULKAN )
const char* API = "Vulkan";
#else

View file

@ -40,6 +40,7 @@ If you have questions concerning this license or the applicable additional terms
#include "nvrhi/utils.h"
#include <sys/DeviceManager.h>
extern DeviceManager* deviceManager;
idCVar r_drawFlickerBox( "r_drawFlickerBox", "0", CVAR_RENDERER | CVAR_BOOL, "visual test for dropping frames" );
idCVar stereoRender_warp( "stereoRender_warp", "0", CVAR_RENDERER | CVAR_ARCHIVE | CVAR_BOOL, "use the optical warping renderprog instead of stereoDeGhost" );
@ -70,8 +71,6 @@ public:
static NvrhiContext context;
extern DeviceManager* deviceManager;
/*

View file

@ -30,9 +30,12 @@ If you have questions concerning this license or the applicable additional terms
#include <global_inc.hlsl>
// *INDENT-OFF*
struct VS_IN {
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
struct VS_IN
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 color : COLOR0;
float4 color2 : COLOR1;
};

View file

@ -35,8 +35,10 @@ StructuredBuffer<float4> matrices : register(t11);
struct VS_IN
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 color : COLOR0;
float4 color2 : COLOR1;
};

View file

@ -30,11 +30,11 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D t_Y : register( t0 );
Texture2D t_Cr : register( t1 );
Texture2D t_Cb : register( t2 );
Texture2D t_Y : register( t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_Cr : register( t1 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_Cb : register( t2 VK_DESCRIPTOR_SET( 1 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {

View file

@ -30,12 +30,14 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
struct VS_IN {
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 color : COLOR0;
struct VS_IN
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 color : COLOR0;
float4 color2 : COLOR1;
};
struct VS_OUT {

View file

@ -30,11 +30,11 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D t_Y : register( t0 );
Texture2D t_Cr : register( t1 );
Texture2D t_Cb : register( t2 );
Texture2D t_Y : register( t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_Cr : register( t1 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_Cb : register( t2 VK_DESCRIPTOR_SET( 1 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_Position;

View file

@ -31,13 +31,14 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
struct VS_IN {
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 color : COLOR0;
float4 color2 : COLOR1;
struct VS_IN
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
float4 normal : NORMAL;
float4 tangent : TANGENT;
float4 color : COLOR0;
float4 color2 : COLOR1;
};
struct VS_OUT {