From 9318a508f7208b65f2883033c8044e07f891e150 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Tue, 28 Jul 2026 13:12:28 -0400 Subject: [PATCH] [TEST] Fallback on TICEntry out of bounds --- src/video_core/shader_environment.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/video_core/shader_environment.cpp b/src/video_core/shader_environment.cpp index 3ce8bb6247..be3e711cb1 100644 --- a/src/video_core/shader_environment.cpp +++ b/src/video_core/shader_environment.cpp @@ -291,8 +291,17 @@ Tegra::Texture::TICEntry GenericEnvironment::ReadTextureInfo(GPUVAddr tic_addr, "start_address=0x{:x}", raw, handle.first, handle.second, tic_limit, tic_addr, via_header_index, static_cast(stage), program_base, start_address); + ASSERT(handle.first <= tic_limit); + Tegra::Texture::TICEntry fallback{}; + fallback.format.Assign(Tegra::Texture::TextureFormat::A8B8G8R8); + fallback.r_type.Assign(Tegra::Texture::ComponentType::UNORM); + fallback.g_type.Assign(Tegra::Texture::ComponentType::UNORM); + fallback.b_type.Assign(Tegra::Texture::ComponentType::UNORM); + fallback.a_type.Assign(Tegra::Texture::ComponentType::UNORM); + fallback.texture_type.Assign(Tegra::Texture::TextureType::Texture2D); + fallback.normalized_coords.Assign(1); + return fallback; } - ASSERT(handle.first <= tic_limit); const GPUVAddr descriptor_addr{tic_addr + handle.first * sizeof(Tegra::Texture::TICEntry)}; Tegra::Texture::TICEntry entry; gpu_memory->ReadBlock(descriptor_addr, &entry, sizeof(entry));