mirror of
https://github.com/hedge-dev/XenosRecomp.git
synced 2025-12-19 06:22:18 +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;
|
std::string constName;
|
||||||
const char* constNamePtr = nullptr;
|
const char* constNamePtr = nullptr;
|
||||||
|
bool subtractFromOne = false;
|
||||||
|
|
||||||
auto findResult = samplers.find(instr.constIndex);
|
auto findResult = samplers.find(instr.constIndex);
|
||||||
if (findResult != samplers.end())
|
if (findResult != samplers.end())
|
||||||
{
|
{
|
||||||
constNamePtr = findResult->second;
|
constNamePtr = findResult->second;
|
||||||
|
subtractFromOne = strcmp(constNamePtr, "sampZBuffer") == 0 ||
|
||||||
|
strcmp(constNamePtr, "g_DepthSampler") == 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -273,12 +276,18 @@ void ShaderRecompiler::recompile(const TextureFetchInstruction& instr, bool bicu
|
||||||
switch (instr.opcode)
|
switch (instr.opcode)
|
||||||
{
|
{
|
||||||
case FetchOpcode::TextureFetch:
|
case FetchOpcode::TextureFetch:
|
||||||
|
{
|
||||||
|
if (subtractFromOne)
|
||||||
|
out += "1.0 - ";
|
||||||
out += "tfetch";
|
out += "tfetch";
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case FetchOpcode::GetTextureWeights:
|
case FetchOpcode::GetTextureWeights:
|
||||||
|
{
|
||||||
out += "getWeights";
|
out += "getWeights";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string_view dimension;
|
std::string_view dimension;
|
||||||
uint32_t componentCount = 0;
|
uint32_t componentCount = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue