From 3055deeba6de432d6b4f7cda160b5143d83d33a0 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 19 Aug 2020 21:18:44 -0700 Subject: [PATCH] GPU: Fix some case warnings. Better to avoid the warnings. --- GPU/Common/FramebufferManagerCommon.cpp | 1 + GPU/Common/GPUStateUtils.cpp | 1 + GPU/GLES/StencilBufferGLES.cpp | 4 +++- GPU/Software/Rasterizer.cpp | 3 +++ GPU/Vulkan/StencilBufferVulkan.cpp | 4 +++- 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 8f1e56b3b2..4ebc279948 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -754,6 +754,7 @@ Draw::Texture *FramebufferManagerCommon::MakePixelTexture(const u8 *srcPixels, G break; case GE_FORMAT_INVALID: + case GE_FORMAT_DEPTH16: _dbg_assert_msg_(false, "Invalid pixelFormat passed to DrawPixels()."); break; } diff --git a/GPU/Common/GPUStateUtils.cpp b/GPU/Common/GPUStateUtils.cpp index 2f629b1b89..62cd71757a 100644 --- a/GPU/Common/GPUStateUtils.cpp +++ b/GPU/Common/GPUStateUtils.cpp @@ -226,6 +226,7 @@ StencilValueType ReplaceAlphaWithStencilType() { case GE_FORMAT_4444: case GE_FORMAT_8888: case GE_FORMAT_INVALID: + case GE_FORMAT_DEPTH16: switch (gstate.getStencilOpZPass()) { case GE_STENCILOP_REPLACE: // TODO: Could detect zero here and force ZERO - less uniform updates? diff --git a/GPU/GLES/StencilBufferGLES.cpp b/GPU/GLES/StencilBufferGLES.cpp index ab843c5059..8ca12e5c09 100644 --- a/GPU/GLES/StencilBufferGLES.cpp +++ b/GPU/GLES/StencilBufferGLES.cpp @@ -109,7 +109,9 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, StencilUplo values = 256; break; case GE_FORMAT_INVALID: - // Impossible. + case GE_FORMAT_DEPTH16: + // Inconceivable. + _assert_(false); break; } diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index f7897008f2..9933fac43e 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -268,6 +268,7 @@ static inline u32 GetPixelColor(int x, int y) return fb.Get32(x, y, gstate.FrameBufStride()); case GE_FORMAT_INVALID: + case GE_FORMAT_DEPTH16: _dbg_assert_msg_(false, "Software: invalid framebuf format."); } return 0; @@ -293,6 +294,7 @@ static inline void SetPixelColor(int x, int y, u32 value) break; case GE_FORMAT_INVALID: + case GE_FORMAT_DEPTH16: _dbg_assert_msg_(false, "Software: invalid framebuf format."); } } @@ -1498,6 +1500,7 @@ void ClearRectangle(const VertexData &v0, const VertexData &v1) break; case GE_FORMAT_INVALID: + case GE_FORMAT_DEPTH16: _dbg_assert_msg_(false, "Software: invalid framebuf format."); break; } diff --git a/GPU/Vulkan/StencilBufferVulkan.cpp b/GPU/Vulkan/StencilBufferVulkan.cpp index e655780476..5862ece18f 100644 --- a/GPU/Vulkan/StencilBufferVulkan.cpp +++ b/GPU/Vulkan/StencilBufferVulkan.cpp @@ -140,7 +140,9 @@ bool FramebufferManagerVulkan::NotifyStencilUpload(u32 addr, int size, StencilUp values = 256; break; case GE_FORMAT_INVALID: - // Impossible. + case GE_FORMAT_DEPTH16: + // Inconceivable. + _assert_(false); break; }