diff options
| author | Duck912 <350528965+Duck912@users.noreply.github.com> | 2026-11-02 18:56:59 -0500 |
|---|---|---|
| committer | Duck912 <350528965+Duck912@users.noreply.github.com> | 2026-11-02 18:56:59 -0500 |
| commit | 9acd36eb9a291e0631346f5b17d69d0e8eb26cc5 (patch) | |
| tree | 5142f9867928a2e7f07a6b6b79ca00fa5f900425 /src/video_core/shader_environment.cpp | |
| parent | 11cebf56014a5015db28179a8acc81cad0caf641 (diff) | |
| parent | 2d81fd5072c060737c18ed4cfc46a04fb8cbb94c (diff) | |
Merge remote-tracking branch 'origin/nx2' into fe-fsr31
# Conflicts:
# src/video_core/renderer_vulkan/blit_image.cpp
# src/video_core/renderer_vulkan/blit_image.h
Diffstat (limited to 'src/video_core/shader_environment.cpp')
| -rw-r--r-- | src/video_core/shader_environment.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp index 22e661c849..0c7d8a0d42 100644 --- a/src/video_core/shader_environment.cpp +++ b/src/video_core/shader_environment.cpp @@ -316,7 +316,8 @@ std::optional<u64> GenericEnvironment::TryFindSize() { Tegra::Texture::TICEntry GenericEnvironment::ReadTextureInfo(GPUVAddr tic_addr, u32 tic_limit, bool via_header_index, u32 raw) { const auto handle{Tegra::Texture::TexturePair(raw, via_header_index)}; - const u32 index{Tegra::Texture::TextureHeaderIndex(handle.first, tic_limit)}; + const u32 index{Tegra::Texture::TextureHeaderIndex(handle.first, tic_limit, + gpu_memory->UsesNativeTiling())}; ASSERT(index <= tic_limit); const GPUVAddr descriptor_addr{tic_addr + index * sizeof(Tegra::Texture::TICEntry)}; Tegra::Texture::TICEntry entry; @@ -327,9 +328,9 @@ Tegra::Texture::TICEntry GenericEnvironment::ReadTextureInfo(GPUVAddr tic_addr, namespace { // Reads a native program a 4 KiB page at a time instead of one 16-byte instruction at a time. -// The reads do not flush the GPU caches first (ReadBlockUnsafe): the previous per-instruction -// ReadBlock did, once per instruction. An instruction that is not inside a fully mapped page is -// left to the caller. +// Each page is read with ReadBlock, so GPU-written code is flushed first, once per page instead +// of once per instruction. An instruction that is not inside a fully mapped page is left to the +// caller. class NativeInstructionReader { public: using Instruction = Shader::Ampere::Instruction; @@ -364,7 +365,7 @@ private: page_begin = address; page_end = address; if (length >= sizeof(Instruction) && gpu_memory.IsFullyMappedRange(address, length)) { - gpu_memory.ReadBlockUnsafe(address, page.data(), length); + gpu_memory.ReadBlock(address, page.data(), length); page_end = next_page; } } @@ -414,7 +415,7 @@ std::shared_ptr<const LoweredNativeCode> GenericEnvironment::LowerNativeCode(u32 if (!native.empty()) break; throw Shader::RuntimeError("Unmapped native shader instruction at {:#x}", address); } - gpu_memory->ReadBlockUnsafe(address, &instruction, sizeof(instruction)); + gpu_memory->ReadBlock(address, &instruction, sizeof(instruction)); } native.push_back(instruction); const auto status = capture.Observe(instruction, index); |
