From 8aa71d6676e6be90a14499da7bb87d77f3c042b2 Mon Sep 17 00:00:00 2001 From: PixieCore <41352111+IcePixelx@users.noreply.github.com> Date: Wed, 20 Jul 2022 14:54:59 +0200 Subject: [PATCH] RTech::CreateDXTexture cleanup. --- r5dev/rtech/rtech_utils.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/r5dev/rtech/rtech_utils.cpp b/r5dev/rtech/rtech_utils.cpp index 76e6a5b1..29f54091 100644 --- a/r5dev/rtech/rtech_utils.cpp +++ b/r5dev/rtech/rtech_utils.cpp @@ -504,8 +504,9 @@ std::uint8_t __fastcall RTech::DecompressPakFile(RPakDecompState_t* state, std:: #if not defined DEDICATED && defined (GAMEDLL_S3) #pragma warning( push ) -#pragma warning( disable : 6262 ) // Disable stack warning, tells us to move more data to the heap instead. Not really possible with 'initialData' here. Since its parallel processed. - +// Disable stack warning, tells us to move more data to the heap instead. Not really possible with 'initialData' here. Since its parallel processed. +// Also disable 6378, complains that there is no control path where it would use 'nullptr', if that happens 'Error' will be called though. +#pragma warning( disable : 6262 6387) //---------------------------------------------------------------------------------- // Purpose: creates 2D texture and shader resource from textureHeader and imageData. //---------------------------------------------------------------------------------- @@ -570,7 +571,7 @@ void RTech::CreateDXTexture(RTechTextureInfo_t* textureHeader, int64_t imageData textureDesc.Format = dxgiFormat; textureDesc.SampleDesc.Count = 1; textureDesc.SampleDesc.Quality = 0; - textureDesc.Usage = (D3D11_USAGE)(textureHeader->m_nCPUAccessFlag != 2); + textureDesc.Usage = textureHeader->m_nCPUAccessFlag != 2 ? D3D11_USAGE_IMMUTABLE : D3D11_USAGE_DEFAULT; textureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; textureDesc.MiscFlags = 0;