mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 11:26:56 +02:00
Approximate explicit-LOD texture gathers at mip zero
Credits: YuhiAida (@YuhiAida): https://github.com/KytyPS5/KytyPS5/pull/588 https://github.com/KytyPS5/KytyPS5/pull/589 https://github.com/KytyPS5/KytyPS5/pull/655 frans (@francoisatt): https://github.com/KytyPS5/KytyPS5/pull/590 BlackCAT (@psnwd): https://github.com/KytyPS5/KytyPS5/pull/613 shadowbeat070 (@shadowbeat070): https://github.com/KytyPS5/KytyPS5/pull/654 Pouare514 (@Pouare514): https://github.com/KytyPS5/KytyPS5/pull/29 https://github.com/KytyPS5/KytyPS5/pull/32
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
#include "graphics/shader/recompiler/frontend/decode/ImageOps.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <atomic>
|
||||
#include <bit>
|
||||
#include <cstdio>
|
||||
|
||||
namespace Libs::Graphics::ShaderRecompiler::Spirv::Emitter {
|
||||
namespace {
|
||||
@@ -646,6 +648,13 @@ void EmitImage(ValueEmitContext& ctx, const IR::Inst& inst) {
|
||||
const auto coord =
|
||||
CoordF32(ctx, mem, *address, layout.coord, dimension_info.coordinate_components);
|
||||
if (op == IR::ValueOpcode::ImageGatherRaw) {
|
||||
if (HasFlag(mem, Decoder::ImageSampleFlagLod)) {
|
||||
static std::atomic_flag warned = ATOMIC_FLAG_INIT;
|
||||
if (!warned.test_and_set(std::memory_order_relaxed)) {
|
||||
std::fputs("Warning: approximating IMAGE_GATHER4_L at mip level 0; explicit LOD is ignored.\n",
|
||||
stderr);
|
||||
}
|
||||
}
|
||||
if (dimension == ImageDimension::Dim1D) {
|
||||
if (dref || !HasFlag(mem, Decoder::ImageSampleFlagLevelZero) ||
|
||||
HasFlag(mem, Decoder::ImageSampleFlagOffset) ||
|
||||
|
||||
Reference in New Issue
Block a user