mirror of
https://github.com/rt64/rt64.git
synced 2025-02-16 03:40:21 +00:00
MSAA Workaround for Decals on a non-NoN game (See #24).
This commit is contained in:
parent
051af43bd8
commit
627571e5e6
@ -53,7 +53,7 @@ namespace RT64 {
|
|||||||
const void *PSBlob = nullptr;
|
const void *PSBlob = nullptr;
|
||||||
uint32_t VSBlobSize = 0;
|
uint32_t VSBlobSize = 0;
|
||||||
uint32_t PSBlobSize = 0;
|
uint32_t PSBlobSize = 0;
|
||||||
const bool outputDepth = desc.outputDepth();
|
const bool outputDepth = desc.outputDepth(useMSAA);
|
||||||
if (desc.flags.smoothShade) {
|
if (desc.flags.smoothShade) {
|
||||||
VSBlob = RasterVSSpecConstantBlobSPIRV;
|
VSBlob = RasterVSSpecConstantBlobSPIRV;
|
||||||
VSBlobSize = uint32_t(std::size(RasterVSSpecConstantBlobSPIRV));
|
VSBlobSize = uint32_t(std::size(RasterVSSpecConstantBlobSPIRV));
|
||||||
@ -214,11 +214,11 @@ namespace RT64 {
|
|||||||
", [[vk::location(0)]] [[vk::index(0)]] out float4 resultColor : SV_TARGET0"
|
", [[vk::location(0)]] [[vk::index(0)]] out float4 resultColor : SV_TARGET0"
|
||||||
", [[vk::location(0)]] [[vk::index(1)]] out float4 resultAlpha : SV_TARGET1";
|
", [[vk::location(0)]] [[vk::index(1)]] out float4 resultAlpha : SV_TARGET1";
|
||||||
|
|
||||||
if (desc.outputDepth()) {
|
if (desc.outputDepth(multisampling)) {
|
||||||
pss << ", out float resultDepth : SV_DEPTH";
|
pss << ", out float resultDepth : SV_DEPTH";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desc.outputDepth()) {
|
if (desc.outputDepth(multisampling)) {
|
||||||
pss << ") { bool outputDepth = true;";
|
pss << ") { bool outputDepth = true;";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -32,11 +32,14 @@ namespace RT64 {
|
|||||||
return ss.str();
|
return ss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShaderDescription::outputDepth() const {
|
bool ShaderDescription::outputDepth(bool useMSAA) const {
|
||||||
bool copyMode = (otherMode.cycleType() == G_CYC_COPY);
|
bool copyMode = (otherMode.cycleType() == G_CYC_COPY);
|
||||||
bool depthClampNear = flags.NoN;
|
bool depthClampNear = flags.NoN;
|
||||||
bool depthDecal = (otherMode.zMode() == ZMODE_DEC);
|
bool depthDecal = (otherMode.zMode() == ZMODE_DEC);
|
||||||
bool zSourcePrim = (otherMode.zSource() == G_ZS_PRIM);
|
bool zSourcePrim = (otherMode.zSource() == G_ZS_PRIM);
|
||||||
return !copyMode && (depthClampNear || depthDecal || zSourcePrim);
|
|
||||||
|
// FIXME: Depth output is forced when using multisampling to avoid problems from interactions when sampling the depth buffer directly on decals.
|
||||||
|
// The true case of this issue is still pending investigation (https://github.com/rt64/rt64/issues/24).
|
||||||
|
return !copyMode && (depthClampNear || depthDecal || zSourcePrim || useMSAA);
|
||||||
}
|
}
|
||||||
};
|
};
|
@ -25,7 +25,7 @@ namespace RT64 {
|
|||||||
void maskUnusedParameters();
|
void maskUnusedParameters();
|
||||||
uint64_t hash() const;
|
uint64_t hash() const;
|
||||||
std::string toShader() const;
|
std::string toShader() const;
|
||||||
bool outputDepth() const;
|
bool outputDepth(bool useMSAA) const;
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
};
|
};
|
Loading…
x
Reference in New Issue
Block a user