summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2019-04-28 22:24:58 -0400
committerGravatar GitHub2019-04-28 22:24:58 -0400
commitc52233ec8b26d5dc8cdca746fc181191c99fb33b (patch)
tree9d56a04c21f541570426042e74c7befe6b279317 /src
parentMerge pull request #2423 from FernandoS27/half-correct (diff)
parentvideo_core: Silent -Wswitch warnings (diff)
downloadyuzu-c52233ec8b26d5dc8cdca746fc181191c99fb33b.tar.gz
yuzu-c52233ec8b26d5dc8cdca746fc181191c99fb33b.tar.xz
yuzu-c52233ec8b26d5dc8cdca746fc181191c99fb33b.zip
Merge pull request #2322 from ReinUsesLisp/wswitch
video_core: Silent -Wswitch warnings
Diffstat (limited to 'src')
-rw-r--r--src/video_core/dma_pusher.cpp2
-rw-r--r--src/video_core/engines/maxwell_3d.h5
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp2
-rw-r--r--src/video_core/renderer_opengl/maxwell_to_gl.h53
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp10
-rw-r--r--src/video_core/shader/decode.cpp4
-rw-r--r--src/video_core/shader/decode/conversion.cpp7
-rw-r--r--src/video_core/shader/decode/xmad.cpp5
-rw-r--r--src/video_core/shader/shader_ir.cpp9
-rw-r--r--src/video_core/surface.cpp86
10 files changed, 106 insertions, 77 deletions
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp
index 6674d9405..036e66f05 100644
--- a/src/video_core/dma_pusher.cpp
+++ b/src/video_core/dma_pusher.cpp
@@ -105,6 +105,8 @@ bool DmaPusher::Step() {
105 dma_state.non_incrementing = false; 105 dma_state.non_incrementing = false;
106 dma_increment_once = true; 106 dma_increment_once = true;
107 break; 107 break;
108 default:
109 break;
108 } 110 }
109 } 111 }
110 } 112 }
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index cc2424d38..85d309d9b 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -243,9 +243,10 @@ public:
243 return "10_10_10_2"; 243 return "10_10_10_2";
244 case Size::Size_11_11_10: 244 case Size::Size_11_11_10:
245 return "11_11_10"; 245 return "11_11_10";
246 default:
247 UNREACHABLE();
248 return {};
246 } 249 }
247 UNREACHABLE();
248 return {};
249 } 250 }
250 251
251 std::string TypeString() const { 252 std::string TypeString() const {
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index 9a088a503..db73e746c 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -305,6 +305,8 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) {
305 case Maxwell::ShaderProgram::Geometry: 305 case Maxwell::ShaderProgram::Geometry:
306 shader_program_manager->UseTrivialGeometryShader(); 306 shader_program_manager->UseTrivialGeometryShader();
307 break; 307 break;
308 default:
309 break;
308 } 310 }
309 continue; 311 continue;
310 } 312 }
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h
index a8833c06e..95b773135 100644
--- a/src/video_core/renderer_opengl/maxwell_to_gl.h
+++ b/src/video_core/renderer_opengl/maxwell_to_gl.h
@@ -27,8 +27,7 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs;
27inline GLenum VertexType(Maxwell::VertexAttribute attrib) { 27inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
28 switch (attrib.type) { 28 switch (attrib.type) {
29 case Maxwell::VertexAttribute::Type::UnsignedInt: 29 case Maxwell::VertexAttribute::Type::UnsignedInt:
30 case Maxwell::VertexAttribute::Type::UnsignedNorm: { 30 case Maxwell::VertexAttribute::Type::UnsignedNorm:
31
32 switch (attrib.size) { 31 switch (attrib.size) {
33 case Maxwell::VertexAttribute::Size::Size_8: 32 case Maxwell::VertexAttribute::Size::Size_8:
34 case Maxwell::VertexAttribute::Size::Size_8_8: 33 case Maxwell::VertexAttribute::Size::Size_8_8:
@@ -47,16 +46,13 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
47 return GL_UNSIGNED_INT; 46 return GL_UNSIGNED_INT;
48 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 47 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
49 return GL_UNSIGNED_INT_2_10_10_10_REV; 48 return GL_UNSIGNED_INT_2_10_10_10_REV;
49 default:
50 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
51 UNREACHABLE();
52 return {};
50 } 53 }
51
52 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
53 UNREACHABLE();
54 return {};
55 }
56
57 case Maxwell::VertexAttribute::Type::SignedInt: 54 case Maxwell::VertexAttribute::Type::SignedInt:
58 case Maxwell::VertexAttribute::Type::SignedNorm: { 55 case Maxwell::VertexAttribute::Type::SignedNorm:
59
60 switch (attrib.size) { 56 switch (attrib.size) {
61 case Maxwell::VertexAttribute::Size::Size_8: 57 case Maxwell::VertexAttribute::Size::Size_8:
62 case Maxwell::VertexAttribute::Size::Size_8_8: 58 case Maxwell::VertexAttribute::Size::Size_8_8:
@@ -75,14 +71,12 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
75 return GL_INT; 71 return GL_INT;
76 case Maxwell::VertexAttribute::Size::Size_10_10_10_2: 72 case Maxwell::VertexAttribute::Size::Size_10_10_10_2:
77 return GL_INT_2_10_10_10_REV; 73 return GL_INT_2_10_10_10_REV;
74 default:
75 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
76 UNREACHABLE();
77 return {};
78 } 78 }
79 79 case Maxwell::VertexAttribute::Type::Float:
80 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
81 UNREACHABLE();
82 return {};
83 }
84
85 case Maxwell::VertexAttribute::Type::Float: {
86 switch (attrib.size) { 80 switch (attrib.size) {
87 case Maxwell::VertexAttribute::Size::Size_16: 81 case Maxwell::VertexAttribute::Size::Size_16:
88 case Maxwell::VertexAttribute::Size::Size_16_16: 82 case Maxwell::VertexAttribute::Size::Size_16_16:
@@ -94,13 +88,16 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
94 case Maxwell::VertexAttribute::Size::Size_32_32_32: 88 case Maxwell::VertexAttribute::Size::Size_32_32_32:
95 case Maxwell::VertexAttribute::Size::Size_32_32_32_32: 89 case Maxwell::VertexAttribute::Size::Size_32_32_32_32:
96 return GL_FLOAT; 90 return GL_FLOAT;
91 default:
92 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex size={}", attrib.SizeString());
93 UNREACHABLE();
94 return {};
97 } 95 }
96 default:
97 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type={}", attrib.TypeString());
98 UNREACHABLE();
99 return {};
98 } 100 }
99 }
100
101 LOG_CRITICAL(Render_OpenGL, "Unimplemented vertex type={}", attrib.TypeString());
102 UNREACHABLE();
103 return {};
104} 101}
105 102
106inline GLenum IndexFormat(Maxwell::IndexFormat index_format) { 103inline GLenum IndexFormat(Maxwell::IndexFormat index_format) {
@@ -129,10 +126,11 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
129 return GL_TRIANGLES; 126 return GL_TRIANGLES;
130 case Maxwell::PrimitiveTopology::TriangleStrip: 127 case Maxwell::PrimitiveTopology::TriangleStrip:
131 return GL_TRIANGLE_STRIP; 128 return GL_TRIANGLE_STRIP;
129 default:
130 LOG_CRITICAL(Render_OpenGL, "Unimplemented topology={}", static_cast<u32>(topology));
131 UNREACHABLE();
132 return {};
132 } 133 }
133 LOG_CRITICAL(Render_OpenGL, "Unimplemented topology={}", static_cast<u32>(topology));
134 UNREACHABLE();
135 return {};
136} 134}
137 135
138inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode, 136inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode,
@@ -186,9 +184,10 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
186 } else { 184 } else {
187 return GL_MIRROR_CLAMP_TO_EDGE; 185 return GL_MIRROR_CLAMP_TO_EDGE;
188 } 186 }
187 default:
188 LOG_ERROR(Render_OpenGL, "Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode));
189 return GL_REPEAT;
189 } 190 }
190 LOG_ERROR(Render_OpenGL, "Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode));
191 return GL_REPEAT;
192} 191}
193 192
194inline GLenum DepthCompareFunc(Tegra::Texture::DepthCompareFunc func) { 193inline GLenum DepthCompareFunc(Tegra::Texture::DepthCompareFunc func) {
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index 34bf26ff2..9fe1e3280 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -62,9 +62,10 @@ vk::SamplerAddressMode WrapMode(Tegra::Texture::WrapMode wrap_mode) {
62 case Tegra::Texture::WrapMode::MirrorOnceBorder: 62 case Tegra::Texture::WrapMode::MirrorOnceBorder:
63 UNIMPLEMENTED(); 63 UNIMPLEMENTED();
64 return vk::SamplerAddressMode::eMirrorClampToEdge; 64 return vk::SamplerAddressMode::eMirrorClampToEdge;
65 default:
66 UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", static_cast<u32>(wrap_mode));
67 return {};
65 } 68 }
66 UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", static_cast<u32>(wrap_mode));
67 return {};
68} 69}
69 70
70vk::CompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func) { 71vk::CompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_func) {
@@ -225,9 +226,10 @@ vk::PrimitiveTopology PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
225 return vk::PrimitiveTopology::eTriangleList; 226 return vk::PrimitiveTopology::eTriangleList;
226 case Maxwell::PrimitiveTopology::TriangleStrip: 227 case Maxwell::PrimitiveTopology::TriangleStrip:
227 return vk::PrimitiveTopology::eTriangleStrip; 228 return vk::PrimitiveTopology::eTriangleStrip;
229 default:
230 UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology));
231 return {};
228 } 232 }
229 UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology));
230 return {};
231} 233}
232 234
233vk::Format VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size) { 235vk::Format VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size) {
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp
index e4c438792..2da595c0d 100644
--- a/src/video_core/shader/decode.cpp
+++ b/src/video_core/shader/decode.cpp
@@ -116,6 +116,8 @@ ExitMethod ShaderIR::Scan(u32 begin, u32 end, std::set<u32>& labels) {
116 // Continue scanning for an exit method. 116 // Continue scanning for an exit method.
117 break; 117 break;
118 } 118 }
119 default:
120 break;
119 } 121 }
120 } 122 }
121 return exit_method = ExitMethod::AlwaysReturn; 123 return exit_method = ExitMethod::AlwaysReturn;
@@ -206,4 +208,4 @@ u32 ShaderIR::DecodeInstr(NodeBlock& bb, u32 pc) {
206 return pc + 1; 208 return pc + 1;
207} 209}
208 210
209} // namespace VideoCommon::Shader \ No newline at end of file 211} // namespace VideoCommon::Shader
diff --git a/src/video_core/shader/decode/conversion.cpp b/src/video_core/shader/decode/conversion.cpp
index ba15b1115..b5ec9a6f5 100644
--- a/src/video_core/shader/decode/conversion.cpp
+++ b/src/video_core/shader/decode/conversion.cpp
@@ -120,10 +120,11 @@ u32 ShaderIR::DecodeConversion(NodeBlock& bb, u32 pc) {
120 return Operation(OperationCode::FCeil, PRECISE, value); 120 return Operation(OperationCode::FCeil, PRECISE, value);
121 case Tegra::Shader::F2fRoundingOp::Trunc: 121 case Tegra::Shader::F2fRoundingOp::Trunc:
122 return Operation(OperationCode::FTrunc, PRECISE, value); 122 return Operation(OperationCode::FTrunc, PRECISE, value);
123 default:
124 UNIMPLEMENTED_MSG("Unimplemented F2F rounding mode {}",
125 static_cast<u32>(instr.conversion.f2f.rounding.Value()));
126 return Immediate(0);
123 } 127 }
124 UNIMPLEMENTED_MSG("Unimplemented F2F rounding mode {}",
125 static_cast<u32>(instr.conversion.f2f.rounding.Value()));
126 return Immediate(0);
127 }(); 128 }();
128 value = GetSaturatedFloat(value, instr.alu.saturate_d); 129 value = GetSaturatedFloat(value, instr.alu.saturate_d);
129 130
diff --git a/src/video_core/shader/decode/xmad.cpp b/src/video_core/shader/decode/xmad.cpp
index db15c0718..04a776398 100644
--- a/src/video_core/shader/decode/xmad.cpp
+++ b/src/video_core/shader/decode/xmad.cpp
@@ -56,9 +56,10 @@ u32 ShaderIR::DecodeXmad(NodeBlock& bb, u32 pc) {
56 instr.xmad.mode, 56 instr.xmad.mode,
57 Immediate(static_cast<u32>(instr.xmad.imm20_16)), 57 Immediate(static_cast<u32>(instr.xmad.imm20_16)),
58 GetRegister(instr.gpr39)}; 58 GetRegister(instr.gpr39)};
59 default:
60 UNIMPLEMENTED_MSG("Unhandled XMAD instruction: {}", opcode->get().GetName());
61 return {false, false, false, Tegra::Shader::XmadMode::None, Immediate(0), Immediate(0)};
59 } 62 }
60 UNIMPLEMENTED_MSG("Unhandled XMAD instruction: {}", opcode->get().GetName());
61 return {false, false, false, Tegra::Shader::XmadMode::None, Immediate(0), Immediate(0)};
62 }(); 63 }();
63 64
64 op_a = BitfieldExtract(op_a, instr.xmad.high_a ? 16 : 0, 16); 65 op_a = BitfieldExtract(op_a, instr.xmad.high_a ? 16 : 0, 16);
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp
index 17f2f711c..e4eb0dfd9 100644
--- a/src/video_core/shader/shader_ir.cpp
+++ b/src/video_core/shader/shader_ir.cpp
@@ -439,11 +439,14 @@ Node ShaderIR::BitfieldExtract(Node value, u32 offset, u32 bits) {
439 return OperationCode::LogicalUGreaterEqual; 439 return OperationCode::LogicalUGreaterEqual;
440 case OperationCode::INegate: 440 case OperationCode::INegate:
441 UNREACHABLE_MSG("Can't negate an unsigned integer"); 441 UNREACHABLE_MSG("Can't negate an unsigned integer");
442 return {};
442 case OperationCode::IAbsolute: 443 case OperationCode::IAbsolute:
443 UNREACHABLE_MSG("Can't apply absolute to an unsigned integer"); 444 UNREACHABLE_MSG("Can't apply absolute to an unsigned integer");
445 return {};
446 default:
447 UNREACHABLE_MSG("Unknown signed operation with code={}", static_cast<u32>(operation_code));
448 return {};
444 } 449 }
445 UNREACHABLE_MSG("Unknown signed operation with code={}", static_cast<u32>(operation_code));
446 return {};
447} 450}
448 451
449} // namespace VideoCommon::Shader \ No newline at end of file 452} // namespace VideoCommon::Shader
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 3b022a456..6384fa8d2 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -178,39 +178,44 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
178 return PixelFormat::ABGR8S; 178 return PixelFormat::ABGR8S;
179 case Tegra::Texture::ComponentType::UINT: 179 case Tegra::Texture::ComponentType::UINT:
180 return PixelFormat::ABGR8UI; 180 return PixelFormat::ABGR8UI;
181 default:
182 break;
181 } 183 }
182 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 184 break;
183 UNREACHABLE();
184 case Tegra::Texture::TextureFormat::B5G6R5: 185 case Tegra::Texture::TextureFormat::B5G6R5:
185 switch (component_type) { 186 switch (component_type) {
186 case Tegra::Texture::ComponentType::UNORM: 187 case Tegra::Texture::ComponentType::UNORM:
187 return PixelFormat::B5G6R5U; 188 return PixelFormat::B5G6R5U;
189 default:
190 break;
188 } 191 }
189 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 192 break;
190 UNREACHABLE();
191 case Tegra::Texture::TextureFormat::A2B10G10R10: 193 case Tegra::Texture::TextureFormat::A2B10G10R10:
192 switch (component_type) { 194 switch (component_type) {
193 case Tegra::Texture::ComponentType::UNORM: 195 case Tegra::Texture::ComponentType::UNORM:
194 return PixelFormat::A2B10G10R10U; 196 return PixelFormat::A2B10G10R10U;
197 default:
198 break;
195 } 199 }
196 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 200 break;
197 UNREACHABLE();
198 case Tegra::Texture::TextureFormat::A1B5G5R5: 201 case Tegra::Texture::TextureFormat::A1B5G5R5:
199 switch (component_type) { 202 switch (component_type) {
200 case Tegra::Texture::ComponentType::UNORM: 203 case Tegra::Texture::ComponentType::UNORM:
201 return PixelFormat::A1B5G5R5U; 204 return PixelFormat::A1B5G5R5U;
205 default:
206 break;
202 } 207 }
203 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 208 break;
204 UNREACHABLE();
205 case Tegra::Texture::TextureFormat::R8: 209 case Tegra::Texture::TextureFormat::R8:
206 switch (component_type) { 210 switch (component_type) {
207 case Tegra::Texture::ComponentType::UNORM: 211 case Tegra::Texture::ComponentType::UNORM:
208 return PixelFormat::R8U; 212 return PixelFormat::R8U;
209 case Tegra::Texture::ComponentType::UINT: 213 case Tegra::Texture::ComponentType::UINT:
210 return PixelFormat::R8UI; 214 return PixelFormat::R8UI;
215 default:
216 break;
211 } 217 }
212 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 218 break;
213 UNREACHABLE();
214 case Tegra::Texture::TextureFormat::G8R8: 219 case Tegra::Texture::TextureFormat::G8R8:
215 // TextureFormat::G8R8 is actually ordered red then green, as such we can use 220 // TextureFormat::G8R8 is actually ordered red then green, as such we can use
216 // PixelFormat::RG8U and PixelFormat::RG8S. This was tested with The Legend of Zelda: Breath 221 // PixelFormat::RG8U and PixelFormat::RG8S. This was tested with The Legend of Zelda: Breath
@@ -220,50 +225,55 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
220 return PixelFormat::RG8U; 225 return PixelFormat::RG8U;
221 case Tegra::Texture::ComponentType::SNORM: 226 case Tegra::Texture::ComponentType::SNORM:
222 return PixelFormat::RG8S; 227 return PixelFormat::RG8S;
228 default:
229 break;
223 } 230 }
224 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 231 break;
225 UNREACHABLE();
226 case Tegra::Texture::TextureFormat::R16_G16_B16_A16: 232 case Tegra::Texture::TextureFormat::R16_G16_B16_A16:
227 switch (component_type) { 233 switch (component_type) {
228 case Tegra::Texture::ComponentType::UNORM: 234 case Tegra::Texture::ComponentType::UNORM:
229 return PixelFormat::RGBA16U; 235 return PixelFormat::RGBA16U;
230 case Tegra::Texture::ComponentType::FLOAT: 236 case Tegra::Texture::ComponentType::FLOAT:
231 return PixelFormat::RGBA16F; 237 return PixelFormat::RGBA16F;
238 default:
239 break;
232 } 240 }
233 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 241 break;
234 UNREACHABLE();
235 case Tegra::Texture::TextureFormat::BF10GF11RF11: 242 case Tegra::Texture::TextureFormat::BF10GF11RF11:
236 switch (component_type) { 243 switch (component_type) {
237 case Tegra::Texture::ComponentType::FLOAT: 244 case Tegra::Texture::ComponentType::FLOAT:
238 return PixelFormat::R11FG11FB10F; 245 return PixelFormat::R11FG11FB10F;
246 default:
247 break;
239 } 248 }
240 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type));
241 UNREACHABLE();
242 case Tegra::Texture::TextureFormat::R32_G32_B32_A32: 249 case Tegra::Texture::TextureFormat::R32_G32_B32_A32:
243 switch (component_type) { 250 switch (component_type) {
244 case Tegra::Texture::ComponentType::FLOAT: 251 case Tegra::Texture::ComponentType::FLOAT:
245 return PixelFormat::RGBA32F; 252 return PixelFormat::RGBA32F;
246 case Tegra::Texture::ComponentType::UINT: 253 case Tegra::Texture::ComponentType::UINT:
247 return PixelFormat::RGBA32UI; 254 return PixelFormat::RGBA32UI;
255 default:
256 break;
248 } 257 }
249 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 258 break;
250 UNREACHABLE();
251 case Tegra::Texture::TextureFormat::R32_G32: 259 case Tegra::Texture::TextureFormat::R32_G32:
252 switch (component_type) { 260 switch (component_type) {
253 case Tegra::Texture::ComponentType::FLOAT: 261 case Tegra::Texture::ComponentType::FLOAT:
254 return PixelFormat::RG32F; 262 return PixelFormat::RG32F;
255 case Tegra::Texture::ComponentType::UINT: 263 case Tegra::Texture::ComponentType::UINT:
256 return PixelFormat::RG32UI; 264 return PixelFormat::RG32UI;
265 default:
266 break;
257 } 267 }
258 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 268 break;
259 UNREACHABLE();
260 case Tegra::Texture::TextureFormat::R32_G32_B32: 269 case Tegra::Texture::TextureFormat::R32_G32_B32:
261 switch (component_type) { 270 switch (component_type) {
262 case Tegra::Texture::ComponentType::FLOAT: 271 case Tegra::Texture::ComponentType::FLOAT:
263 return PixelFormat::RGB32F; 272 return PixelFormat::RGB32F;
273 default:
274 break;
264 } 275 }
265 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 276 break;
266 UNREACHABLE();
267 case Tegra::Texture::TextureFormat::R16: 277 case Tegra::Texture::TextureFormat::R16:
268 switch (component_type) { 278 switch (component_type) {
269 case Tegra::Texture::ComponentType::FLOAT: 279 case Tegra::Texture::ComponentType::FLOAT:
@@ -276,18 +286,20 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
276 return PixelFormat::R16UI; 286 return PixelFormat::R16UI;
277 case Tegra::Texture::ComponentType::SINT: 287 case Tegra::Texture::ComponentType::SINT:
278 return PixelFormat::R16I; 288 return PixelFormat::R16I;
289 default:
290 break;
279 } 291 }
280 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 292 break;
281 UNREACHABLE();
282 case Tegra::Texture::TextureFormat::R32: 293 case Tegra::Texture::TextureFormat::R32:
283 switch (component_type) { 294 switch (component_type) {
284 case Tegra::Texture::ComponentType::FLOAT: 295 case Tegra::Texture::ComponentType::FLOAT:
285 return PixelFormat::R32F; 296 return PixelFormat::R32F;
286 case Tegra::Texture::ComponentType::UINT: 297 case Tegra::Texture::ComponentType::UINT:
287 return PixelFormat::R32UI; 298 return PixelFormat::R32UI;
299 default:
300 break;
288 } 301 }
289 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 302 break;
290 UNREACHABLE();
291 case Tegra::Texture::TextureFormat::ZF32: 303 case Tegra::Texture::TextureFormat::ZF32:
292 return PixelFormat::Z32F; 304 return PixelFormat::Z32F;
293 case Tegra::Texture::TextureFormat::Z16: 305 case Tegra::Texture::TextureFormat::Z16:
@@ -310,9 +322,10 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
310 return PixelFormat::DXN2UNORM; 322 return PixelFormat::DXN2UNORM;
311 case Tegra::Texture::ComponentType::SNORM: 323 case Tegra::Texture::ComponentType::SNORM:
312 return PixelFormat::DXN2SNORM; 324 return PixelFormat::DXN2SNORM;
325 default:
326 break;
313 } 327 }
314 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 328 break;
315 UNREACHABLE();
316 case Tegra::Texture::TextureFormat::BC7U: 329 case Tegra::Texture::TextureFormat::BC7U:
317 return is_srgb ? PixelFormat::BC7U_SRGB : PixelFormat::BC7U; 330 return is_srgb ? PixelFormat::BC7U_SRGB : PixelFormat::BC7U;
318 case Tegra::Texture::TextureFormat::BC6H_UF16: 331 case Tegra::Texture::TextureFormat::BC6H_UF16:
@@ -343,15 +356,17 @@ PixelFormat PixelFormatFromTextureFormat(Tegra::Texture::TextureFormat format,
343 return PixelFormat::RG16UI; 356 return PixelFormat::RG16UI;
344 case Tegra::Texture::ComponentType::SINT: 357 case Tegra::Texture::ComponentType::SINT:
345 return PixelFormat::RG16I; 358 return PixelFormat::RG16I;
359 default:
360 break;
346 } 361 }
347 LOG_CRITICAL(HW_GPU, "Unimplemented component_type={}", static_cast<u32>(component_type)); 362 break;
348 UNREACHABLE();
349 default: 363 default:
350 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", static_cast<u32>(format), 364 break;
351 static_cast<u32>(component_type));
352 UNREACHABLE();
353 return PixelFormat::ABGR8U;
354 } 365 }
366 LOG_CRITICAL(HW_GPU, "Unimplemented format={}, component_type={}", static_cast<u32>(format),
367 static_cast<u32>(component_type));
368 UNREACHABLE();
369 return PixelFormat::ABGR8U;
355} 370}
356 371
357ComponentType ComponentTypeFromTexture(Tegra::Texture::ComponentType type) { 372ComponentType ComponentTypeFromTexture(Tegra::Texture::ComponentType type) {
@@ -513,8 +528,9 @@ bool IsFormatBCn(PixelFormat format) {
513 case PixelFormat::DXT45_SRGB: 528 case PixelFormat::DXT45_SRGB:
514 case PixelFormat::BC7U_SRGB: 529 case PixelFormat::BC7U_SRGB:
515 return true; 530 return true;
531 default:
532 return false;
516 } 533 }
517 return false;
518} 534}
519 535
520} // namespace VideoCore::Surface 536} // namespace VideoCore::Surface