mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Quick attempt at fixing the Macross glitch
This commit is contained in:
parent
d7aa3ee486
commit
176b460d76
@ -162,6 +162,7 @@ SamplerCacheKey TextureCacheCommon::GetSamplingParams(int maxLevel, const TexCac
|
||||
key.sClamp = gstate.isTexCoordClampedS();
|
||||
key.tClamp = gstate.isTexCoordClampedT();
|
||||
key.aniso = false;
|
||||
key.texture3d = gstate_c.curTextureIs3D;
|
||||
|
||||
GETexLevelMode mipMode = gstate.getTexLevelMode();
|
||||
bool autoMip = mipMode == GE_TEXLEVEL_MODE_AUTO;
|
||||
|
@ -71,6 +71,7 @@ struct SamplerCacheKey {
|
||||
bool sClamp : 1;
|
||||
bool tClamp : 1;
|
||||
bool aniso : 1;
|
||||
bool texture3d : 1;
|
||||
};
|
||||
};
|
||||
bool operator < (const SamplerCacheKey &other) const {
|
||||
|
@ -119,7 +119,8 @@ VkSampler SamplerCache::GetOrCreateSampler(const SamplerCacheKey &key) {
|
||||
VkSamplerCreateInfo samp = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO };
|
||||
samp.addressModeU = key.sClamp ? VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE : VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samp.addressModeV = key.tClamp ? VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE : VK_SAMPLER_ADDRESS_MODE_REPEAT;
|
||||
samp.addressModeW = samp.addressModeU; // irrelevant, but Mali recommends that all clamp modes are the same if possible.
|
||||
// W addressing is irrelevant for 2d textures, but Mali recommends that all clamp modes are the same if possible so just copy from U.
|
||||
samp.addressModeW = key.texture3d ? VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE : samp.addressModeU;
|
||||
samp.compareOp = VK_COMPARE_OP_ALWAYS;
|
||||
samp.flags = 0;
|
||||
samp.magFilter = key.magFilt ? VK_FILTER_LINEAR : VK_FILTER_NEAREST;
|
||||
|
Loading…
Reference in New Issue
Block a user