summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2021-07-06 02:09:23 +0200
committerGitHub <noreply@github.com>2021-07-06 02:09:23 +0200
commitbf50345d4c13e34e69af0070632400b3472a1a11 (patch)
tree1af5586d2d416c1a347ea0bfabed30a3a56d51e0 /src/video_core
parentMerge pull request #6556 from Morph1984/default-mii (diff)
parentCMakeLists: Disable all warnings for external headers (diff)
downloadyuzu-bf50345d4c13e34e69af0070632400b3472a1a11.tar
yuzu-bf50345d4c13e34e69af0070632400b3472a1a11.tar.gz
yuzu-bf50345d4c13e34e69af0070632400b3472a1a11.tar.bz2
yuzu-bf50345d4c13e34e69af0070632400b3472a1a11.tar.lz
yuzu-bf50345d4c13e34e69af0070632400b3472a1a11.tar.xz
yuzu-bf50345d4c13e34e69af0070632400b3472a1a11.tar.zst
yuzu-bf50345d4c13e34e69af0070632400b3472a1a11.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/CMakeLists.txt5
-rw-r--r--src/video_core/command_classes/codecs/codec.h8
-rw-r--r--src/video_core/command_classes/vic.cpp7
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp3
-rw-r--r--src/video_core/texture_cache/image_base.cpp2
-rw-r--r--src/video_core/texture_cache/util.cpp2
-rw-r--r--src/video_core/textures/astc.cpp4
7 files changed, 8 insertions, 23 deletions
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index e31eb30c0..e4de55f4d 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -292,13 +292,12 @@ endif()
if (MSVC)
target_compile_options(video_core PRIVATE
- /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
- /we4244 # 'var' : conversion from integer to 'type', possible loss of data
+ /we4242 # 'identifier': conversion from 'type1' to 'type2', possible loss of data
+ /we4244 # 'conversion': conversion from 'type1' to 'type2', possible loss of data
/we4456 # Declaration of 'identifier' hides previous local declaration
/we4457 # Declaration of 'identifier' hides function parameter
/we4458 # Declaration of 'identifier' hides class member
/we4459 # Declaration of 'identifier' hides global declaration
- /we4715 # 'function' : not all control paths return a value
)
else()
target_compile_options(video_core PRIVATE
diff --git a/src/video_core/command_classes/codecs/codec.h b/src/video_core/command_classes/codecs/codec.h
index f2aef1699..96c823c76 100644
--- a/src/video_core/command_classes/codecs/codec.h
+++ b/src/video_core/command_classes/codecs/codec.h
@@ -14,18 +14,10 @@ extern "C" {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4242) // conversion from 'type' to 'type', possible loss of data
-#pragma warning(disable : 4244) // conversion from 'type' to 'type', possible loss of data
-#endif
#include <libavcodec/avcodec.h>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
}
namespace Tegra {
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp
index 5faf8c0f1..ff3db0aee 100644
--- a/src/video_core/command_classes/vic.cpp
+++ b/src/video_core/command_classes/vic.cpp
@@ -9,17 +9,10 @@ extern "C" {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
-#ifdef _MSC_VER
-#pragma warning(disable : 4244) // conversion from 'type' to 'type', possible loss of data
-#pragma warning(push)
-#endif
#include <libswscale/swscale.h>
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
}
#include "common/assert.h"
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index a2c1599f7..ff0f03e99 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -327,7 +327,8 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4
if (format_info.is_compressed) {
return false;
}
- if (std::ranges::find(ACCELERATED_FORMATS, internal_format) == ACCELERATED_FORMATS.end()) {
+ if (std::ranges::find(ACCELERATED_FORMATS, static_cast<int>(internal_format)) ==
+ ACCELERATED_FORMATS.end()) {
return false;
}
if (format_info.compatibility_by_size) {
diff --git a/src/video_core/texture_cache/image_base.cpp b/src/video_core/texture_cache/image_base.cpp
index ad69d32d1..f22358c90 100644
--- a/src/video_core/texture_cache/image_base.cpp
+++ b/src/video_core/texture_cache/image_base.cpp
@@ -82,7 +82,7 @@ std::optional<SubresourceBase> ImageBase::TryFindBase(GPUVAddr other_addr) const
if (info.type != ImageType::e3D) {
const auto [layer, mip_offset] = LayerMipOffset(diff, info.layer_stride);
const auto end = mip_level_offsets.begin() + info.resources.levels;
- const auto it = std::find(mip_level_offsets.begin(), end, mip_offset);
+ const auto it = std::find(mip_level_offsets.begin(), end, static_cast<u32>(mip_offset));
if (layer > info.resources.layers || it == end) {
return std::nullopt;
}
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp
index 4efe042b6..20794fa32 100644
--- a/src/video_core/texture_cache/util.cpp
+++ b/src/video_core/texture_cache/util.cpp
@@ -394,7 +394,7 @@ template <u32 GOB_EXTENT>
const s32 mip_offset = diff % layer_stride;
const std::array offsets = CalculateMipLevelOffsets(new_info);
const auto end = offsets.begin() + new_info.resources.levels;
- const auto it = std::find(offsets.begin(), end, mip_offset);
+ const auto it = std::find(offsets.begin(), end, static_cast<u32>(mip_offset));
if (it == end) {
// Mipmap is not aligned to any valid size
return std::nullopt;
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp
index 7b756ba41..3ab500760 100644
--- a/src/video_core/textures/astc.cpp
+++ b/src/video_core/textures/astc.cpp
@@ -1365,8 +1365,8 @@ static void DecompressBlock(std::span<const u8, 16> inBuf, const u32 blockWidth,
// each partition.
// Determine partitions, partition index, and color endpoint modes
- s32 planeIdx = -1;
- u32 partitionIndex;
+ u32 planeIdx{UINT32_MAX};
+ u32 partitionIndex{};
u32 colorEndpointMode[4] = {0, 0, 0, 0};
// Define color data.