1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-15 07:29:17 +01:00

[dxvk] Static analysis nits and fixes

This commit is contained in:
WinterSnowfall 2025-03-08 18:38:45 +02:00
parent 45a41183dd
commit 6ce33187f9
No known key found for this signature in database
8 changed files with 30 additions and 33 deletions

View File

@ -2,8 +2,8 @@
namespace dxvk { namespace dxvk {
DxvkObjectTracker::DxvkObjectTracker() { DxvkObjectTracker::DxvkObjectTracker()
m_head = std::make_unique<List>(); : m_head ( std::make_unique<List>() ) {
m_next = m_head.get(); m_next = m_head.get();
} }

View File

@ -1659,8 +1659,8 @@ namespace dxvk {
void uploadImageHw( void uploadImageHw(
const Rc<DxvkImage>& image, const Rc<DxvkImage>& image,
const Rc<DxvkBuffer>& source, const Rc<DxvkBuffer>& source,
VkDeviceSize subresourceAlignment, VkDeviceSize sourceOffset,
VkDeviceSize sourceOffset); VkDeviceSize subresourceAlignment);
void performClear( void performClear(
const Rc<DxvkImageView>& imageView, const Rc<DxvkImageView>& imageView,

View File

@ -318,7 +318,7 @@ namespace dxvk {
DxvkCsChunkFlags m_flags; DxvkCsChunkFlags m_flags;
alignas(64) alignas(64)
char m_data[DxvkCsChunkSize]; char m_data[DxvkCsChunkSize] = { };
template<typename T> template<typename T>
void* alloc(size_t extra) { void* alloc(size_t extra) {

View File

@ -5,9 +5,8 @@ namespace dxvk {
DxvkDeviceFilter::DxvkDeviceFilter( DxvkDeviceFilter::DxvkDeviceFilter(
DxvkDeviceFilterFlags flags, DxvkDeviceFilterFlags flags,
const DxvkOptions& options) const DxvkOptions& options)
: m_flags(flags) { : m_flags(flags)
m_matchDeviceName = env::getEnvVar("DXVK_FILTER_DEVICE_NAME"); , m_matchDeviceName ( env::getEnvVar("DXVK_FILTER_DEVICE_NAME") ) {
if (m_matchDeviceName.empty()) if (m_matchDeviceName.empty())
m_matchDeviceName = options.deviceFilter; m_matchDeviceName = options.deviceFilter;

View File

@ -2,24 +2,23 @@
namespace dxvk { namespace dxvk {
DxvkOptions::DxvkOptions(const Config& config) { DxvkOptions::DxvkOptions(const Config& config)
enableDebugUtils = config.getOption<bool> ("dxvk.enableDebugUtils", false); : enableDebugUtils ( config.getOption<bool> ("dxvk.enableDebugUtils", false) )
enableStateCache = config.getOption<bool> ("dxvk.enableStateCache", true); , enableStateCache ( config.getOption<bool> ("dxvk.enableStateCache", true) )
enableMemoryDefrag = config.getOption<Tristate>("dxvk.enableMemoryDefrag", Tristate::Auto); , enableMemoryDefrag ( config.getOption<Tristate> ("dxvk.enableMemoryDefrag", Tristate::Auto) )
numCompilerThreads = config.getOption<int32_t> ("dxvk.numCompilerThreads", 0); , numCompilerThreads ( config.getOption<int32_t> ("dxvk.numCompilerThreads", 0) )
enableGraphicsPipelineLibrary = config.getOption<Tristate>("dxvk.enableGraphicsPipelineLibrary", Tristate::Auto); , enableGraphicsPipelineLibrary ( config.getOption<Tristate> ("dxvk.enableGraphicsPipelineLibrary", Tristate::Auto) )
trackPipelineLifetime = config.getOption<Tristate>("dxvk.trackPipelineLifetime", Tristate::Auto); , trackPipelineLifetime ( config.getOption<Tristate> ("dxvk.trackPipelineLifetime", Tristate::Auto) )
useRawSsbo = config.getOption<Tristate>("dxvk.useRawSsbo", Tristate::Auto); , useRawSsbo ( config.getOption<Tristate> ("dxvk.useRawSsbo", Tristate::Auto) )
hud = config.getOption<std::string>("dxvk.hud", ""); , hud ( config.getOption<std::string>("dxvk.hud", "") )
tearFree = config.getOption<Tristate>("dxvk.tearFree", Tristate::Auto); , tearFree ( config.getOption<Tristate> ("dxvk.tearFree", Tristate::Auto) )
latencySleep = config.getOption<Tristate>("dxvk.latencySleep", Tristate::Auto); , latencySleep ( config.getOption<Tristate> ("dxvk.latencySleep", Tristate::Auto) )
latencyTolerance = config.getOption<int32_t> ("dxvk.latencyTolerance", 1000); , latencyTolerance ( config.getOption<int32_t> ("dxvk.latencyTolerance", 1000) )
disableNvLowLatency2 = config.getOption<Tristate>("dxvk.disableNvLowLatency2", Tristate::Auto); , disableNvLowLatency2 ( config.getOption<Tristate> ("dxvk.disableNvLowLatency2", Tristate::Auto) )
hideIntegratedGraphics = config.getOption<bool> ("dxvk.hideIntegratedGraphics", false); , hideIntegratedGraphics ( config.getOption<bool> ("dxvk.hideIntegratedGraphics", false) )
zeroMappedMemory = config.getOption<bool> ("dxvk.zeroMappedMemory", false); , zeroMappedMemory ( config.getOption<bool> ("dxvk.zeroMappedMemory", false) )
allowFse = config.getOption<bool> ("dxvk.allowFse", false); , allowFse ( config.getOption<bool> ("dxvk.allowFse", false) )
deviceFilter = config.getOption<std::string>("dxvk.deviceFilter", ""); , tilerMode ( config.getOption<Tristate> ("dxvk.tilerMode", Tristate::Auto) )
tilerMode = config.getOption<Tristate>("dxvk.tilerMode", Tristate::Auto); , deviceFilter ( config.getOption<std::string>("dxvk.deviceFilter", "") ) { }
}
} }

View File

@ -793,7 +793,7 @@ namespace dxvk {
// Only consider variables that have a desired location // Only consider variables that have a desired location
if (candidates.find(varId) != candidates.end()) { if (candidates.find(varId) != candidates.end()) {
VarInfo varInfo; VarInfo varInfo = { };
varInfo.varId = varId; varInfo.varId = varId;
varInfo.decorationOffset = 0; varInfo.decorationOffset = 0;
@ -1080,7 +1080,7 @@ namespace dxvk {
default:; default:;
} }
iter++; ++iter;
} }
// Insert new null variables // Insert new null variables

View File

@ -197,7 +197,7 @@ namespace dxvk {
size_t m_size = 0; size_t m_size = 0;
size_t m_read = 0; size_t m_read = 0;
char m_data[MaxSize]; char m_data[MaxSize] = { };
template<typename T> template<typename T>
bool read(T& data) { bool read(T& data) {

View File

@ -45,9 +45,8 @@ namespace dxvk::vk {
std::tie(m_library, m_getInstanceProcAddr) = loadVulkanLibrary(); std::tie(m_library, m_getInstanceProcAddr) = loadVulkanLibrary();
} }
LibraryLoader::LibraryLoader(PFN_vkGetInstanceProcAddr loaderProc) { LibraryLoader::LibraryLoader(PFN_vkGetInstanceProcAddr loaderProc)
m_getInstanceProcAddr = loaderProc; : m_getInstanceProcAddr ( loaderProc ) { }
}
LibraryLoader::~LibraryLoader() { LibraryLoader::~LibraryLoader() {
if (m_library) if (m_library)