mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
D3D: Fix some texture wrapping issues by setting the texture state for every texture used at draw time. Hopefully there will not be a noticable slowdown, thanks to the state caching. Also some minor cleanup. Should fix issues like repeated shadows. TODO: In theory it should have worked without this, so I should investigate why this change was needed.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4815 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -140,10 +140,9 @@ u8 *GetPointer(const u32 &address)
|
||||
return g_VideoInitialize.pGetMemoryPointer(address);
|
||||
}
|
||||
|
||||
void SetSamplerState(const BPCmd &bp)
|
||||
void SetTextureMode(const BPCmd &bp)
|
||||
{
|
||||
int stage = (bp.address & 3);//(addr>>4)&2;
|
||||
Renderer::SetSamplerState(stage,(bp.address & 0xE0) == 0xA0);
|
||||
Renderer::SetSamplerState(bp.address & 3, (bp.address & 0xE0) == 0xA0);
|
||||
}
|
||||
|
||||
void SetInterlacingMode(const BPCmd &bp)
|
||||
|
@ -1059,7 +1059,7 @@ void Renderer::SetLineWidth()
|
||||
D3D::SetRenderState(D3DRS_POINTSIZE, *((DWORD*)&psize));
|
||||
}
|
||||
|
||||
void Renderer::SetSamplerState(int stage,int texindex)
|
||||
void Renderer::SetSamplerState(int stage, int texindex)
|
||||
{
|
||||
const FourTexUnits &tex = bpmem.tex[texindex];
|
||||
const TexMode0 &tm0 = tex.texMode0[stage];
|
||||
|
@ -243,10 +243,11 @@ void Flush()
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
if (usedtextures & (1 << i)) {
|
||||
Renderer::SetSamplerState(i & 3, i >> 2);
|
||||
FourTexUnits &tex = bpmem.tex[i >> 2];
|
||||
TextureCache::TCacheEntry* tentry = TextureCache::Load(i,
|
||||
(tex.texImage3[i&3].image_base/* & 0x1FFFFF*/) << 5,
|
||||
tex.texImage0[i&3].width+1, tex.texImage0[i&3].height+1,
|
||||
tex.texImage0[i&3].width + 1, tex.texImage0[i&3].height + 1,
|
||||
tex.texImage0[i&3].format, tex.texTlut[i&3].tmem_offset<<9,
|
||||
tex.texTlut[i&3].tlut_format);
|
||||
|
||||
|
Reference in New Issue
Block a user