Fixed sRGB and screen size problems with the DX12 device manager

This commit is contained in:
Robert Beckebans 2022-03-11 11:44:07 +01:00
parent fc0e8e7c07
commit 67a0768560
6 changed files with 42 additions and 6 deletions

View file

@ -895,6 +895,16 @@ idImage::Reload
*/
void idImage::Reload( bool force, nvrhi::ICommandList* commandList )
{
#if defined( USE_NVRHI )
// always regenerate functional images
if( generatorFunction )
{
//common->DPrintf( "regenerating %s.\n", GetName() );
generatorFunction( this, commandList );
return;
}
#else
// don't break render targets that have this image attached
if( opts.isRenderTarget )
{
@ -911,6 +921,7 @@ void idImage::Reload( bool force, nvrhi::ICommandList* commandList )
}
return;
}
#endif
// check file times
if( !force )

View file

@ -310,7 +310,7 @@ void main( PS_IN fragment, out PS_OUT result )
shadow *= stepSize;
#elif 0
#elif 1
#if 0

View file

@ -43,7 +43,7 @@ struct DeviceCreationParameters
uint32_t backBufferHeight = 720;
uint32_t refreshRate = 0;
uint32_t swapChainBufferCount = 3;
nvrhi::Format swapChainFormat = nvrhi::Format::SRGBA8_UNORM;
nvrhi::Format swapChainFormat = nvrhi::Format::RGBA8_UNORM; // RB: don't do the sRGB gamma ramp with the swapchain
uint32_t swapChainSampleCount = 1;
uint32_t swapChainSampleQuality = 0;
uint32_t maxFramesInFlight = 2;

View file

@ -1,3 +1,25 @@
/*
* Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include "precompiled.h"
#include "renderer/RenderCommon.h"

View file

@ -1069,10 +1069,10 @@ static bool GLW_GetWindowDimensions( const glimpParms_t parms, int& x, int& y, i
bool DeviceManager::CreateWindowDeviceAndSwapChain( const glimpParms_t& parms, const char* windowTitle )
{
int x, y, w, h;
x = 0;
y = 0;
w = parms.width;
h = parms.height;
if( !GLW_GetWindowDimensions( parms, x, y, w, h ) )
{
return false;
}
int stylebits;
int exstyle;

View file

@ -179,6 +179,8 @@ LONG WINAPI MainWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
switch( uMsg )
{
case WM_WINDOWPOSCHANGED:
// RB: FIXME this messes with with the window size in a really bad way
#if 0
if( renderSystem->IsInitialized() )//&& win32.hDC != NULL )
{
RECT rect;
@ -207,6 +209,7 @@ LONG WINAPI MainWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
}
}
}
#endif
break;
case WM_MOVE:
{