summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2009-07-18 11:26:58 +0000
committerhrydgard <hrydgard@gmail.com>2009-07-18 11:26:58 +0000
commit3ad0db68306e1aeb7c1f7750beab95e6b0039a44 (patch)
tree249d258341c410ff0f9b9cf466dd1f0821d79b15 /Source/Core/VideoCommon/Src/PixelShaderManager.cpp
parent3a14b31b8100c3510617f26b35848f58433aac27 (diff)
GL: Delete code for GL_TEXTURE_RECTANGLE_ARB in case of non-pow2 textures - all modern GFX cards that can run Dolphin should support non-pow2 textures anyway. This removes some complexity and reduces the numbers of pixel shaders that need to be generated in some situations. Also fixes some texture mirroring problems. Let me know if this breaks things on ATI for some reason.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3833 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp')
-rw-r--r--Source/Core/VideoCommon/Src/PixelShaderManager.cpp54
1 files changed, 8 insertions, 46 deletions
diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
index cb5362bfef..c487a4024b 100644
--- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
+++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp
@@ -40,11 +40,6 @@ static u32 lastAlpha = 0;
static u32 lastTexDims[8]={0}; // width | height << 16 | wrap_s << 28 | wrap_t << 30
static u32 lastZBias = 0;
-// lower byte describes if a texture is nonpow2 or pow2
-// next byte describes whether the repeat wrap mode is enabled for the s channel
-// next byte is for t channel
-static u32 s_texturemask = 0;
-
void PixelShaderManager::Init()
{
s_nColorsChanged[0] = s_nColorsChanged[1] = 0;
@@ -208,26 +203,15 @@ void PixelShaderManager::SetConstants()
void PixelShaderManager::SetPSTextureDims(int texid)
{
- // non pow 2 textures - texdims.xy are the real texture dimensions used for wrapping
- // pow 2 textures - texdims.xy are reciprocals of the real texture dimensions
- // both - texdims.zw are the scaled dimensions
+ // texdims.xy are reciprocals of the real texture dimensions
+ // texdims.zw are the scaled dimensions
float fdims[4];
- if (s_texturemask & (1 << texid))
- {
- TCoordInfo& tc = bpmem.texcoords[texid];
- fdims[0] = (float)(lastTexDims[texid] & 0xffff);
- fdims[1] = (float)((lastTexDims[texid] >> 16) & 0xfff);
- fdims[2] = (float)(tc.s.scale_minus_1 + 1)*lastCustomTexScale[texid][0];
- fdims[3] = (float)(tc.t.scale_minus_1 + 1)*lastCustomTexScale[texid][1];
- }
- else
- {
- TCoordInfo& tc = bpmem.texcoords[texid];
- fdims[0] = 1.0f / (float)(lastTexDims[texid] & 0xffff);
- fdims[1] = 1.0f / (float)((lastTexDims[texid] >> 16) & 0xfff);
- fdims[2] = (float)(tc.s.scale_minus_1 + 1) * lastCustomTexScale[texid][0];
- fdims[3] = (float)(tc.t.scale_minus_1 + 1) * lastCustomTexScale[texid][1];
- }
+
+ TCoordInfo& tc = bpmem.texcoords[texid];
+ fdims[0] = 1.0f / (float)(lastTexDims[texid] & 0xffff);
+ fdims[1] = 1.0f / (float)((lastTexDims[texid] >> 16) & 0xfff);
+ fdims[2] = (float)(tc.s.scale_minus_1 + 1) * lastCustomTexScale[texid][0];
+ fdims[3] = (float)(tc.t.scale_minus_1 + 1) * lastCustomTexScale[texid][1];
PRIM_LOG("texdims%d: %f %f %f %f\n", texid, fdims[0], fdims[1], fdims[2], fdims[3]);
SetPSConstant4fv(C_TEXDIMS + texid, fdims);
@@ -328,23 +312,6 @@ void PixelShaderManager::SetZTextureTypeChanged()
s_bZTextureTypeChanged = true;
}
-void PixelShaderManager::SetTexturesUsed(u32 nonpow2tex)
-{
- if (s_texturemask != nonpow2tex)
- {
- for (int i = 0; i < 8; ++i)
- {
- if (nonpow2tex & (0x10101 << i))
- {
- // this check was previously implicit, but should it be here?
- if (s_nTexDimsChanged )
- s_nTexDimsChanged |= 1 << i;
- }
- }
- s_texturemask = nonpow2tex;
- }
-}
-
void PixelShaderManager::SetTexCoordChanged(u8 texmapid)
{
s_nTexDimsChanged |= 1 << texmapid;
@@ -368,8 +335,3 @@ void PixelShaderManager::SetColorMatrix(const float* pmatrix, const float* pfCon
SetPSConstant4fv(C_COLORMATRIX+3, pmatrix+12);
SetPSConstant4fv(C_COLORMATRIX+4, pfConstAdd);
}
-
-u32 PixelShaderManager::GetTextureMask()
-{
- return s_texturemask;
-}