Skip to content

Commit

Permalink
Merge pull request #12883 from unknownbrackets/softgpu-postshader
Browse files Browse the repository at this point in the history
Refactor postshader handling to apply for softgpu / D3D9
  • Loading branch information
hrydgard committed May 14, 2020
2 parents d4b695c + 8b4821b commit cbb9b32
Show file tree
Hide file tree
Showing 52 changed files with 1,415 additions and 1,619 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Expand Up @@ -1359,6 +1359,8 @@ set(GPU_SOURCES
GPU/Common/GPUStateUtils.h
GPU/Common/DrawEngineCommon.cpp
GPU/Common/DrawEngineCommon.h
GPU/Common/PresentationCommon.cpp
GPU/Common/PresentationCommon.h
GPU/Common/ShaderId.cpp
GPU/Common/ShaderId.h
GPU/Common/ShaderUniforms.cpp
Expand Down
4 changes: 2 additions & 2 deletions Common/ColorConv.cpp
Expand Up @@ -278,7 +278,7 @@ void ConvertRGBA8888ToRGBA4444(u16 *dst, const u32 *src, u32 numPixels) {
}
}

void ConvertRGBA565ToRGBA8888(u32 *dst32, const u16 *src, u32 numPixels) {
void ConvertRGB565ToRGBA8888(u32 *dst32, const u16 *src, u32 numPixels) {
#ifdef _M_SSE
const __m128i mask5 = _mm_set1_epi16(0x001f);
const __m128i mask6 = _mm_set1_epi16(0x003f);
Expand Down Expand Up @@ -435,7 +435,7 @@ void ConvertRGBA4444ToRGBA8888(u32 *dst32, const u16 *src, u32 numPixels) {
}
}

void ConvertABGR565ToRGBA8888(u32 *dst32, const u16 *src, u32 numPixels) {
void ConvertBGR565ToRGBA8888(u32 *dst32, const u16 *src, u32 numPixels) {
u8 *dst = (u8 *)dst32;
for (u32 x = 0; x < numPixels; x++) {
u16 col = src[x];
Expand Down
4 changes: 2 additions & 2 deletions Common/ColorConv.h
Expand Up @@ -126,11 +126,11 @@ void ConvertBGRA8888ToRGBA5551(u16 *dst, const u32 *src, u32 numPixels);
void ConvertBGRA8888ToRGB565(u16 *dst, const u32 *src, u32 numPixels);
void ConvertBGRA8888ToRGBA4444(u16 *dst, const u32 *src, u32 numPixels);

void ConvertRGBA565ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);
void ConvertRGB565ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);
void ConvertRGBA5551ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);
void ConvertRGBA4444ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);

void ConvertABGR565ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);
void ConvertBGR565ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);
void ConvertABGR1555ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);
void ConvertABGR4444ToRGBA8888(u32 *dst, const u16 *src, u32 numPixels);

Expand Down
4 changes: 2 additions & 2 deletions Core/TextureReplacer.cpp
Expand Up @@ -466,7 +466,7 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl
saveBuf.resize((pitch * h) / sizeof(u16));
switch (replacedInfo.fmt) {
case ReplacedTextureFormat::F_5650:
ConvertRGBA565ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
ConvertRGB565ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
break;
case ReplacedTextureFormat::F_5551:
ConvertRGBA5551ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
Expand All @@ -475,7 +475,7 @@ void TextureReplacer::NotifyTextureDecoded(const ReplacedTextureDecodeInfo &repl
ConvertRGBA4444ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
break;
case ReplacedTextureFormat::F_0565_ABGR:
ConvertABGR565ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
ConvertBGR565ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
break;
case ReplacedTextureFormat::F_1555_ABGR:
ConvertABGR1555ToRGBA8888(saveBuf.data(), (const u16 *)data, (pitch * h) / sizeof(u16));
Expand Down

0 comments on commit cbb9b32

Please sign in to comment.