SoftRasterizer: Fix bug where the texture wrap mode would be applied inconsistently under multithreaded rendering.
(Regression from 032622e.)
This commit is contained in:
parent
e767018e2a
commit
7711f8288b
|
@ -332,6 +332,7 @@ protected:
|
||||||
SoftRasterizerTexture *currentTexture;
|
SoftRasterizerTexture *currentTexture;
|
||||||
VERT* verts[MAX_CLIPPED_VERTS];
|
VERT* verts[MAX_CLIPPED_VERTS];
|
||||||
int polynum;
|
int polynum;
|
||||||
|
u8 _textureWrapMode;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool _debug_thisPoly;
|
bool _debug_thisPoly;
|
||||||
|
@ -353,7 +354,8 @@ public:
|
||||||
return RENDER3DERROR_NOERR;
|
return RENDER3DERROR_NOERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
theTexture->SetRenderWrapMode(thePoly.texParam);
|
this->_textureWrapMode = (thePoly.texParam >> 16) & 0x0F;
|
||||||
|
|
||||||
theTexture->ResetCacheAge();
|
theTexture->ResetCacheAge();
|
||||||
theTexture->IncreaseCacheUsageCount(1);
|
theTexture->IncreaseCacheUsageCount(1);
|
||||||
|
|
||||||
|
@ -379,7 +381,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
const u32 *textureData = this->currentTexture->GetRenderData();
|
const u32 *textureData = this->currentTexture->GetRenderData();
|
||||||
this->currentTexture->GetRenderSamplerCoordinates(iu, iv);
|
this->currentTexture->GetRenderSamplerCoordinates(this->_textureWrapMode, iu, iv);
|
||||||
|
|
||||||
FragmentColor color;
|
FragmentColor color;
|
||||||
color.color = textureData[( iv << this->currentTexture->GetRenderWidthShift() ) + iu];
|
color.color = textureData[( iv << this->currentTexture->GetRenderWidthShift() ) + iu];
|
||||||
|
@ -1218,19 +1220,9 @@ u32 SoftRasterizerTexture::GetRenderWidthShift() const
|
||||||
return this->_renderWidthShift;
|
return this->_renderWidthShift;
|
||||||
}
|
}
|
||||||
|
|
||||||
u8 SoftRasterizerTexture::GetRenderWrapMode() const
|
FORCEINLINE void SoftRasterizerTexture::GetRenderSamplerCoordinates(const u8 wrapMode, s32 &iu, s32 &iv) const
|
||||||
{
|
{
|
||||||
return this->_renderWrapMode;
|
switch (wrapMode)
|
||||||
}
|
|
||||||
|
|
||||||
void SoftRasterizerTexture::SetRenderWrapMode(u32 texParam)
|
|
||||||
{
|
|
||||||
this->_renderWrapMode = (texParam >> 16) & 0x0F;
|
|
||||||
}
|
|
||||||
|
|
||||||
FORCEINLINE void SoftRasterizerTexture::GetRenderSamplerCoordinates(s32 &iu, s32 &iv) const
|
|
||||||
{
|
|
||||||
switch (this->_renderWrapMode)
|
|
||||||
{
|
{
|
||||||
//flip none
|
//flip none
|
||||||
case 0x0: _hclamp(iu); _vclamp(iv); break;
|
case 0x0: _hclamp(iu); _vclamp(iv); break;
|
||||||
|
|
|
@ -77,10 +77,8 @@ public:
|
||||||
s32 GetRenderWidthMask() const;
|
s32 GetRenderWidthMask() const;
|
||||||
s32 GetRenderHeightMask() const;
|
s32 GetRenderHeightMask() const;
|
||||||
u32 GetRenderWidthShift() const;
|
u32 GetRenderWidthShift() const;
|
||||||
u8 GetRenderWrapMode() const;
|
|
||||||
void SetRenderWrapMode(u32 texParam);
|
|
||||||
|
|
||||||
void GetRenderSamplerCoordinates(s32 &iu, s32 &iv) const;
|
void GetRenderSamplerCoordinates(const u8 wrapMode, s32 &iu, s32 &iv) const;
|
||||||
|
|
||||||
void SetUseDeposterize(bool willDeposterize);
|
void SetUseDeposterize(bool willDeposterize);
|
||||||
void SetScalingFactor(size_t scalingFactor);
|
void SetScalingFactor(size_t scalingFactor);
|
||||||
|
|
Loading…
Reference in New Issue