Skip to content

Commit

Permalink
GPU: Cleanup unused CheckAlpha() funcs.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Sep 24, 2022
1 parent 1e9b386 commit befa4d8
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 46 deletions.
2 changes: 1 addition & 1 deletion GPU/Common/TextureCacheCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2797,7 +2797,7 @@ CheckAlphaResult TextureCacheCommon::CheckCLUTAlpha(const uint8_t *pixelData, GE
// Never has any alpha.
return CHECKALPHA_FULL;
default:
return CheckAlpha32((const u32 *)pixelData, w, 0xFF000000); // note, the normal order here, unlike the 16-bit formats
return CheckAlpha32((const u32 *)pixelData, w, 0xFF000000);
}
}

Expand Down
14 changes: 0 additions & 14 deletions GPU/D3D11/TextureCacheD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,20 +453,6 @@ DXGI_FORMAT TextureCacheD3D11::GetDestFormat(GETextureFormat format, GEPaletteFo
}
}

CheckAlphaResult TextureCacheD3D11::CheckAlpha(const u32 *pixelData, u32 dstFmt, int w) {
switch (dstFmt) {
case DXGI_FORMAT_B4G4R4A4_UNORM:
return CheckAlpha16((const u16 *)pixelData, w, 0xF000);
case DXGI_FORMAT_B5G5R5A1_UNORM:
return CheckAlpha16((const u16 *)pixelData, w, 0x8000);
case DXGI_FORMAT_B5G6R5_UNORM:
// Never has any alpha.
return CHECKALPHA_FULL;
default:
return CheckAlpha32((const u32 *)pixelData, w, 0xFF000000);
}
}

bool TextureCacheD3D11::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) {
SetTexture();
if (!nextTexture_) {
Expand Down
1 change: 0 additions & 1 deletion GPU/D3D11/TextureCacheD3D11.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ class TextureCacheD3D11 : public TextureCacheCommon {

private:
DXGI_FORMAT GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const;
static CheckAlphaResult CheckAlpha(const u32 *pixelData, u32 dstFmt, int w);
void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override;

void BuildTexture(TexCacheEntry *const entry) override;
Expand Down
14 changes: 0 additions & 14 deletions GPU/Directx9/TextureCacheDX9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,20 +358,6 @@ D3DFORMAT TextureCacheDX9::GetDestFormat(GETextureFormat format, GEPaletteFormat
}
}

CheckAlphaResult TextureCacheDX9::CheckAlpha(const u32 *pixelData, u32 dstFmt, int w) {
switch (dstFmt) {
case D3DFMT_A4R4G4B4:
return CheckAlpha16((const u16 *)pixelData, w, 0xF000);
case D3DFMT_A1R5G5B5:
return CheckAlpha16((const u16 *)pixelData, w, 0x8000);
case D3DFMT_R5G6B5:
// Never has any alpha.
return CHECKALPHA_FULL;
default:
return CheckAlpha32(pixelData, w, 0xFF000000);
}
}

bool TextureCacheDX9::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) {
SetTexture();
ApplyTexture();
Expand Down
1 change: 0 additions & 1 deletion GPU/Directx9/TextureCacheDX9.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class TextureCacheDX9 : public TextureCacheCommon {
void ApplySamplingParams(const SamplerCacheKey &key) override;

D3DFORMAT GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const;
static CheckAlphaResult CheckAlpha(const u32 *pixelData, u32 dstFmt, int w);
void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override;

void BuildTexture(TexCacheEntry *const entry) override;
Expand Down
14 changes: 0 additions & 14 deletions GPU/Vulkan/TextureCacheVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -709,20 +709,6 @@ VkFormat TextureCacheVulkan::GetDestFormat(GETextureFormat format, GEPaletteForm
}
}

CheckAlphaResult TextureCacheVulkan::CheckAlpha(const u32 *pixelData, VkFormat dstFmt, int w) {
switch (dstFmt) {
case VULKAN_4444_FORMAT:
return CheckAlpha16((const u16 *)pixelData, w, 0xF000);
case VULKAN_1555_FORMAT:
return CheckAlpha16((const u16 *)pixelData, w, 0x8000);
case VULKAN_565_FORMAT:
// Never has any alpha.
return CHECKALPHA_FULL;
default:
return CheckAlpha32(pixelData, w, 0xFF000000);
}
}

void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePtr, int rowPitch, int level, int scaleFactor, VkFormat dstFmt) {
int w = gstate.getTextureWidth(level);
int h = gstate.getTextureHeight(level);
Expand Down
1 change: 0 additions & 1 deletion GPU/Vulkan/TextureCacheVulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class TextureCacheVulkan : public TextureCacheCommon {
private:
void LoadTextureLevel(TexCacheEntry &entry, uint8_t *writePtr, int rowPitch, int level, int scaleFactor, VkFormat dstFmt);
VkFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const;
static CheckAlphaResult CheckAlpha(const u32 *pixelData, VkFormat dstFmt, int w);
void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override;

void BuildTexture(TexCacheEntry *const entry) override;
Expand Down

0 comments on commit befa4d8

Please sign in to comment.