diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2021-07-24 15:58:55 -0700 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2021-11-17 20:04:34 -0800 |
| commit | 9ef228503abe24820985e431ef942c6ebb312442 (patch) | |
| tree | 2c8385d24e0c684fffa21d5f5abd54acd875827c /Source/Core/VideoCommon/PixelShaderManager.cpp | |
| parent | a273b655661bfc09e5c6a81a681aab3f130699cc (diff) | |
VideoCommon: Provide raw texdims to shaders
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderManager.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderManager.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index 436db9dd50..3a232903af 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -273,16 +273,13 @@ void PixelShaderManager::SetDestAlphaChanged() void PixelShaderManager::SetTexDims(int texmapid, u32 width, u32 height) { - float rwidth = 1.0f / (width * 128.0f); - float rheight = 1.0f / (height * 128.0f); - // TODO: move this check out to callee. There we could just call this function on texture changes // or better, use textureSize() in glsl - if (constants.texdims[texmapid][0] != rwidth || constants.texdims[texmapid][1] != rheight) + if (constants.texdims[texmapid][0] != width || constants.texdims[texmapid][1] != height) dirty = true; - constants.texdims[texmapid][0] = rwidth; - constants.texdims[texmapid][1] = rheight; + constants.texdims[texmapid][0] = width; + constants.texdims[texmapid][1] = height; } void PixelShaderManager::SetZTextureBias() @@ -382,8 +379,8 @@ void PixelShaderManager::SetZTextureOpChanged() void PixelShaderManager::SetTexCoordChanged(u8 texmapid) { TCoordInfo& tc = bpmem.texcoords[texmapid]; - constants.texdims[texmapid][2] = (float)(tc.s.scale_minus_1 + 1) * 128.0f; - constants.texdims[texmapid][3] = (float)(tc.t.scale_minus_1 + 1) * 128.0f; + constants.texdims[texmapid][2] = tc.s.scale_minus_1 + 1; + constants.texdims[texmapid][3] = tc.t.scale_minus_1 + 1; dirty = true; } |
