mirror of
https://github.com/hedge-dev/XenosRecomp.git
synced 2025-12-17 21:42:29 +00:00
Implement reverse Z negation.
This commit is contained in:
parent
fce786210a
commit
b7c0372246
1 changed files with 9 additions and 0 deletions
|
|
@ -245,11 +245,14 @@ void ShaderRecompiler::recompile(const TextureFetchInstruction& instr, bool bicu
|
|||
|
||||
std::string constName;
|
||||
const char* constNamePtr = nullptr;
|
||||
bool subtractFromOne = false;
|
||||
|
||||
auto findResult = samplers.find(instr.constIndex);
|
||||
if (findResult != samplers.end())
|
||||
{
|
||||
constNamePtr = findResult->second;
|
||||
subtractFromOne = strcmp(constNamePtr, "sampZBuffer") == 0 ||
|
||||
strcmp(constNamePtr, "g_DepthSampler") == 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -273,12 +276,18 @@ void ShaderRecompiler::recompile(const TextureFetchInstruction& instr, bool bicu
|
|||
switch (instr.opcode)
|
||||
{
|
||||
case FetchOpcode::TextureFetch:
|
||||
{
|
||||
if (subtractFromOne)
|
||||
out += "1.0 - ";
|
||||
out += "tfetch";
|
||||
break;
|
||||
}
|
||||
case FetchOpcode::GetTextureWeights:
|
||||
{
|
||||
out += "getWeights";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string_view dimension;
|
||||
uint32_t componentCount = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue