Skip to content

Commit

Permalink
Vulkan: Rename r_gpuIndex -> r_gpu
Browse files Browse the repository at this point in the history
  • Loading branch information
kennyalive committed Nov 30, 2024
1 parent 08a7ddf commit 556c5b1
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/engine/renderer/tr_init.c
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ Dx_World dx_world;
static void GfxInfo_f( void );

cvar_t *r_renderAPI;
cvar_t* r_gpuIndex;
cvar_t* r_gpu;
cvar_t* r_vsync;
cvar_t *r_shaderGamma;
cvar_t* r_twinMode;
@@ -912,7 +912,7 @@ R_Register
void R_Register( void )
{
r_renderAPI = ri.Cvar_Get( "r_renderAPI", "0", CVAR_ARCHIVE | CVAR_LATCH ) ;
r_gpuIndex = ri.Cvar_Get( "r_gpuIndex", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_gpu = ri.Cvar_Get( "r_gpu", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_vsync = ri.Cvar_Get( "r_vsync", "0", CVAR_ARCHIVE | CVAR_LATCH );
r_shaderGamma = ri.Cvar_Get("r_shaderGamma", "0", CVAR_ARCHIVE);
r_twinMode = ri.Cvar_Get( "r_twinMode", "0", CVAR_LATCH );
10 changes: 5 additions & 5 deletions src/engine/renderer/tr_local.h
Original file line number Diff line number Diff line change
@@ -956,11 +956,11 @@ RenderApi get_render_api();
//
// cvars
//
extern cvar_t *r_renderAPI; // 3D API to use: 0 - OpenGL, 1 - Vulkan, 2 - DX12
extern cvar_t *r_gpuIndex; // GPU to use. By default the first GPU (0) is selected. Can be used only with Vulkan.
extern cvar_t *r_vsync; // Select Vulkan presentation mode that enables vsync (com_maxFPS can be set to 0)
extern cvar_t *r_shaderGamma; // Use compute shader to apply gamma (only in Vulkan) instead HW gamma API.
extern cvar_t *r_twinMode; // Debug feature to compare rendering output between OpenGL/Vulkan/DX12 APIs
extern cvar_t *r_renderAPI; // 3D API to use: 0 - OpenGL, 1 - Vulkan
extern cvar_t *r_gpu; // Select GPU in multi-GPU system (zero-based index, only in Vulkan). By default, GPU 0 is selected.
extern cvar_t *r_vsync; // Enable vsync in Vulkan (com_maxFPS may be set to 0)
extern cvar_t *r_shaderGamma; // Use compute shader to apply gamma (only in Vulkan) instead of legacy HW gamma API.
extern cvar_t *r_twinMode; // Debug feature to compare rendering output between OpenGL/Vulkan APIs

extern cvar_t *r_railWidth;
extern cvar_t *r_railCoreWidth;
4 changes: 2 additions & 2 deletions src/engine/renderer/vk.cpp
Original file line number Diff line number Diff line change
@@ -535,9 +535,9 @@ static void create_device() {
}
std::vector<VkPhysicalDevice> physical_devices(count);
VK_CHECK(vkEnumeratePhysicalDevices(vk.instance, &count, physical_devices.data()));
int gpu_index = r_gpuIndex->integer;
int gpu_index = r_gpu->integer;
if (gpu_index >= count) {
ri.Printf(PRINT_WARNING, "r_gpuIndex %d is too large. Maximum value is %u. Vulkan backend will use GPU 0\n", gpu_index, count - 1);
ri.Printf(PRINT_WARNING, "r_gpu %d is too large. Maximum value is %u. Vulkan backend will use GPU 0\n", gpu_index, count - 1);
gpu_index = 0;
}
vk.physical_device = physical_devices[gpu_index];

0 comments on commit 556c5b1

Please sign in to comment.