summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/service/ns/pl_u.cpp6
-rw-r--r--src/core/loader/nso.cpp23
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp14
3 files changed, 15 insertions, 28 deletions
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index d4e0f615a..691b1d106 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -132,9 +132,9 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) {
font_sizes.push_back(SHARED_FONT_REGIONS[i].size);
}
- ctx.WriteBuffer(font_codes.data(), font_codes.size() * sizeof(u32), 0);
- ctx.WriteBuffer(font_offsets.data(), font_offsets.size() * sizeof(u32), 1);
- ctx.WriteBuffer(font_sizes.data(), font_sizes.size() * sizeof(u32), 2);
+ ctx.WriteBuffer(font_codes, 0);
+ ctx.WriteBuffer(font_offsets, 1);
+ ctx.WriteBuffer(font_sizes, 2);
rb.Push(RESULT_SUCCESS);
rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded
diff --git a/src/core/loader/nso.cpp b/src/core/loader/nso.cpp
index c66561bf4..06b1b33f4 100644
--- a/src/core/loader/nso.cpp
+++ b/src/core/loader/nso.cpp
@@ -69,29 +69,18 @@ FileType AppLoader_NSO::IdentifyType(const FileSys::VirtualFile& file) {
static std::vector<u8> DecompressSegment(const std::vector<u8>& compressed_data,
const NsoSegmentHeader& header) {
std::vector<u8> uncompressed_data(header.size);
- const int bytes_uncompressed = LZ4_decompress_safe(
- reinterpret_cast<const char*>(compressed_data.data()),
- reinterpret_cast<char*>(uncompressed_data.data()), compressed_data.size(), header.size);
+ const int bytes_uncompressed =
+ LZ4_decompress_safe(reinterpret_cast<const char*>(compressed_data.data()),
+ reinterpret_cast<char*>(uncompressed_data.data()),
+ static_cast<int>(compressed_data.size()), header.size);
- ASSERT_MSG(bytes_uncompressed == header.size && bytes_uncompressed == uncompressed_data.size(),
+ ASSERT_MSG(bytes_uncompressed == static_cast<int>(header.size) &&
+ bytes_uncompressed == static_cast<int>(uncompressed_data.size()),
"{} != {} != {}", bytes_uncompressed, header.size, uncompressed_data.size());
return uncompressed_data;
}
-static std::vector<u8> ReadSegment(FileUtil::IOFile& file, const NsoSegmentHeader& header,
- size_t compressed_size) {
- std::vector<u8> compressed_data(compressed_size);
-
- file.Seek(header.offset, SEEK_SET);
- if (compressed_size != file.ReadBytes(compressed_data.data(), compressed_size)) {
- LOG_CRITICAL(Loader, "Failed to read {} NSO LZ4 compressed bytes", compressed_size);
- return {};
- }
-
- return DecompressSegment(compressed_data, header);
-}
-
static constexpr u32 PageAlignSize(u32 size) {
return (size + Memory::PAGE_MASK) & ~Memory::PAGE_MASK;
}
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 5fae95788..a1ac18a71 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -216,7 +216,7 @@ public:
}
/// Returns a GLSL string representing the current state of the register
- const std::string GetActiveString() {
+ std::string GetActiveString() {
declr_type.insert(active_type);
return GetPrefixString(active_type) + std::to_string(index) + '_' + suffix;
}
@@ -518,7 +518,7 @@ public:
private:
/// Build GLSL conversion function, e.g. floatBitsToInt, intBitsToFloat, etc.
- const std::string GetGLSLConversionFunc(GLSLRegister::Type src, GLSLRegister::Type dest) const {
+ std::string GetGLSLConversionFunc(GLSLRegister::Type src, GLSLRegister::Type dest) const {
const std::string src_type = GLSLRegister::GetTypeString(src);
std::string dest_type = GLSLRegister::GetTypeString(dest);
dest_type[0] = toupper(dest_type[0]);
@@ -1405,7 +1405,7 @@ private:
// TEXS has two destination registers. RG goes into gpr0+0 and gpr0+1, and BA
// goes into gpr28+0 and gpr28+1
- size_t offset{};
+ size_t texs_offset{};
for (const auto& dest : {instr.gpr0.Value(), instr.gpr28.Value()}) {
for (unsigned elem = 0; elem < 2; ++elem) {
@@ -1413,7 +1413,8 @@ private:
// Skip disabled components
continue;
}
- regs.SetRegisterToFloat(dest, elem + offset, texture, 1, 4, false, elem);
+ regs.SetRegisterToFloat(dest, elem + texs_offset, texture, 1, 4, false,
+ elem);
}
if (!instr.texs.HasTwoDestinations()) {
@@ -1421,7 +1422,7 @@ private:
break;
}
- offset += 2;
+ texs_offset += 2;
}
--shader.scope;
shader.AddLine("}");
@@ -1463,7 +1464,6 @@ private:
op_b = "abs(" + op_b + ')';
}
- using Tegra::Shader::Pred;
// We can't use the constant predicate as destination.
ASSERT(instr.fsetp.pred3 != static_cast<u64>(Pred::UnusedIndex));
@@ -1500,7 +1500,6 @@ private:
}
}
- using Tegra::Shader::Pred;
// We can't use the constant predicate as destination.
ASSERT(instr.isetp.pred3 != static_cast<u64>(Pred::UnusedIndex));
@@ -1528,7 +1527,6 @@ private:
std::string op_b =
GetPredicateCondition(instr.psetp.pred29, instr.psetp.neg_pred29 != 0);
- using Tegra::Shader::Pred;
// We can't use the constant predicate as destination.
ASSERT(instr.psetp.pred3 != static_cast<u64>(Pred::UnusedIndex));