1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-26 12:42:41 +01:00

Add fallthrough attribute

This commit is contained in:
scribam 2018-09-06 13:28:12 +02:00 committed by Ivan
parent 4d8bfe328b
commit f37adc4188
15 changed files with 23 additions and 9 deletions

View File

@ -851,6 +851,7 @@ error_code cellVdecGetPicture(u32 handle, vm::cptr<CellVdecPicFormat> format, vm
{ {
case AV_PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUVJ420P:
cellVdec.error("cellVdecGetPicture(): experimental AVPixelFormat (%d). This may cause suboptimal video quality.", frame->format); cellVdec.error("cellVdecGetPicture(): experimental AVPixelFormat (%d). This may cause suboptimal video quality.", frame->format);
[[fallthrough]];
case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
in_f = alpha_plane ? AV_PIX_FMT_YUVA420P : static_cast<AVPixelFormat>(frame->format); in_f = alpha_plane ? AV_PIX_FMT_YUVA420P : static_cast<AVPixelFormat>(frame->format);
break; break;

View File

@ -2130,7 +2130,7 @@ bool spu_thread::process_mfc_cmd()
break; break;
} }
// Fallthrough [[fallthrough]];
} }
case MFC_PUT_CMD: case MFC_PUT_CMD:
case MFC_PUTB_CMD: case MFC_PUTB_CMD:

View File

@ -85,6 +85,7 @@ void FragmentProgramDecompiler::SetDst(std::string code, u32 flags)
// NOTE: Sometimes varying inputs from VS are out of range so do not exempt any input types, unless fp16 (Naruto UNS) // NOTE: Sometimes varying inputs from VS are out of range so do not exempt any input types, unless fp16 (Naruto UNS)
if (dst.fp16 && src0.fp16 && src0.reg_type == RSX_FP_REGISTER_TYPE_TEMP) if (dst.fp16 && src0.fp16 && src0.reg_type == RSX_FP_REGISTER_TYPE_TEMP)
break; break;
[[fallthrough]];
default: default:
{ {
// fp16 precsion flag on f32 register; ignore // fp16 precsion flag on f32 register; ignore
@ -942,6 +943,7 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
//Untested, should be x2d followed by TEX //Untested, should be x2d followed by TEX
AddX2d(); AddX2d();
AddCode(Format("x2d = $0.xyxy + $1.xxxx * $2.xzxz + $1.yyyy * $2.ywyw;", true)); AddCode(Format("x2d = $0.xyxy + $1.xxxx * $2.xzxz + $1.yyyy * $2.ywyw;", true));
[[fallthrough]];
case RSX_FP_OPCODE_TEX: case RSX_FP_OPCODE_TEX:
AddTex(); AddTex();
switch (m_prog.get_texture_dimension(dst.tex_num)) switch (m_prog.get_texture_dimension(dst.tex_num))
@ -974,6 +976,7 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode)
//Untested, should be x2d followed by TXP //Untested, should be x2d followed by TXP
AddX2d(); AddX2d();
AddCode(Format("x2d = $0.xyxy + $1.xxxx * $2.xzxz + $1.yyyy * $2.ywyw;", true)); AddCode(Format("x2d = $0.xyxy + $1.xxxx * $2.xzxz + $1.yyyy * $2.ywyw;", true));
[[fallthrough]];
case RSX_FP_OPCODE_TXP: case RSX_FP_OPCODE_TXP:
AddTex(); AddTex();
switch (m_prog.get_texture_dimension(dst.tex_num)) switch (m_prog.get_texture_dimension(dst.tex_num))

View File

@ -104,12 +104,12 @@ vertex_program_utils::vertex_program_metadata vertex_program_utils::analyse_vert
{ {
d0.HEX = instruction._u32[0]; d0.HEX = instruction._u32[0];
static_jump = (d0.cond == 0x7); static_jump = (d0.cond == 0x7);
// Fall through [[fallthrough]];
} }
case RSX_SCA_OPCODE_BRB: case RSX_SCA_OPCODE_BRB:
{ {
function_call = false; function_call = false;
// Fall through [[fallthrough]];
} }
case RSX_SCA_OPCODE_CAL: case RSX_SCA_OPCODE_CAL:
case RSX_SCA_OPCODE_CLI: case RSX_SCA_OPCODE_CLI:

View File

@ -1821,7 +1821,7 @@ namespace rsx
case rsx::texture_upload_context::shader_read: case rsx::texture_upload_context::shader_read:
if (!result.image_handle) if (!result.image_handle)
break; break;
// Conditional fallthrough [[fallthrough]];
default: default:
return result; return result;
} }

View File

@ -43,12 +43,14 @@ namespace gl
// Note : maybe add is signed on gl // Note : maybe add is signed on gl
case rsx::blend_equation::add_signed: case rsx::blend_equation::add_signed:
rsx_log.trace("blend equation add_signed used. Emulating using FUNC_ADD"); rsx_log.trace("blend equation add_signed used. Emulating using FUNC_ADD");
[[fallthrough]];
case rsx::blend_equation::add: return GL_FUNC_ADD; case rsx::blend_equation::add: return GL_FUNC_ADD;
case rsx::blend_equation::min: return GL_MIN; case rsx::blend_equation::min: return GL_MIN;
case rsx::blend_equation::max: return GL_MAX; case rsx::blend_equation::max: return GL_MAX;
case rsx::blend_equation::substract: return GL_FUNC_SUBTRACT; case rsx::blend_equation::substract: return GL_FUNC_SUBTRACT;
case rsx::blend_equation::reverse_substract_signed: case rsx::blend_equation::reverse_substract_signed:
rsx_log.trace("blend equation reverse_subtract_signed used. Emulating using FUNC_REVERSE_SUBTRACT"); rsx_log.trace("blend equation reverse_subtract_signed used. Emulating using FUNC_REVERSE_SUBTRACT");
[[fallthrough]];
case rsx::blend_equation::reverse_substract: return GL_FUNC_REVERSE_SUBTRACT; case rsx::blend_equation::reverse_substract: return GL_FUNC_REVERSE_SUBTRACT;
case rsx::blend_equation::reverse_add_signed: case rsx::blend_equation::reverse_add_signed:
default: default:

View File

@ -549,7 +549,7 @@ void GLGSRender::clear_surface(u32 arg)
case rsx::surface_color_format::g8b8: case rsx::surface_color_format::g8b8:
{ {
colormask = rsx::get_g8b8_r8g8_colormask(colormask); colormask = rsx::get_g8b8_r8g8_colormask(colormask);
// Fall through [[fallthrough]];
} }
default: default:
{ {

View File

@ -366,6 +366,7 @@ namespace gl
{ {
default: default:
rsx_log.error("gl::fence sync returned unknown error 0x%X", err); rsx_log.error("gl::fence sync returned unknown error 0x%X", err);
[[fallthrough]];
case GL_ALREADY_SIGNALED: case GL_ALREADY_SIGNALED:
case GL_CONDITION_SATISFIED: case GL_CONDITION_SATISFIED:
done = true; done = true;

View File

@ -586,6 +586,7 @@ namespace gl
{ {
default: default:
rsx_log.error("Unknown remap function 0x%X", remap_lookup[channel]); rsx_log.error("Unknown remap function 0x%X", remap_lookup[channel]);
[[fallthrough]];
case CELL_GCM_TEXTURE_REMAP_REMAP: case CELL_GCM_TEXTURE_REMAP_REMAP:
remap_values[channel] = swizzle_remap[remap_inputs[channel]]; remap_values[channel] = swizzle_remap[remap_inputs[channel]];
break; break;

View File

@ -450,7 +450,7 @@ namespace rsx
total_threads = CPUStats::get_thread_count(); total_threads = CPUStats::get_thread_count();
// fallthrough [[fallthrough]];
} }
case detail_level::medium: case detail_level::medium:
{ {
@ -473,14 +473,14 @@ namespace rsx
spu_usage = std::clamp(cpu_usage * spu_cycles / total_cycles, 0.f, 100.f); spu_usage = std::clamp(cpu_usage * spu_cycles / total_cycles, 0.f, 100.f);
rsx_usage = std::clamp(cpu_usage * rsx_cycles / total_cycles, 0.f, 100.f); rsx_usage = std::clamp(cpu_usage * rsx_cycles / total_cycles, 0.f, 100.f);
// fallthrough [[fallthrough]];
} }
case detail_level::low: case detail_level::low:
{ {
if (cpu_usage < 0.) if (cpu_usage < 0.)
cpu_usage = static_cast<f32>(m_cpu_stats.get_usage()); cpu_usage = static_cast<f32>(m_cpu_stats.get_usage());
// fallthrough [[fallthrough]];
} }
case detail_level::minimal: case detail_level::minimal:
{ {

View File

@ -120,7 +120,7 @@ namespace rsx
if (m_no_saves) if (m_no_saves)
break; break;
return_code = m_list->get_selected_index(); return_code = m_list->get_selected_index();
// Fall through [[fallthrough]];
case pad_button::circle: case pad_button::circle:
close(true, true); close(true, true);
break; break;

View File

@ -703,6 +703,7 @@ namespace rsx
{ {
default: default:
rsx_log.error("bad clip plane control (0x%x)", static_cast<u8>(clip_plane_control[index])); rsx_log.error("bad clip plane control (0x%x)", static_cast<u8>(clip_plane_control[index]));
[[fallthrough]];
case rsx::user_clip_plane_op::disable: case rsx::user_clip_plane_op::disable:
clip_enabled_flags[index] = 0; clip_enabled_flags[index] = 0;

View File

@ -162,11 +162,13 @@ namespace vk
{ {
case rsx::blend_equation::add_signed: case rsx::blend_equation::add_signed:
rsx_log.trace("blend equation add_signed used. Emulating using FUNC_ADD"); rsx_log.trace("blend equation add_signed used. Emulating using FUNC_ADD");
[[fallthrough]];
case rsx::blend_equation::add: case rsx::blend_equation::add:
return VK_BLEND_OP_ADD; return VK_BLEND_OP_ADD;
case rsx::blend_equation::substract: return VK_BLEND_OP_SUBTRACT; case rsx::blend_equation::substract: return VK_BLEND_OP_SUBTRACT;
case rsx::blend_equation::reverse_substract_signed: case rsx::blend_equation::reverse_substract_signed:
rsx_log.trace("blend equation reverse_subtract_signed used. Emulating using FUNC_REVERSE_SUBTRACT"); rsx_log.trace("blend equation reverse_subtract_signed used. Emulating using FUNC_REVERSE_SUBTRACT");
[[fallthrough]];
case rsx::blend_equation::reverse_substract: return VK_BLEND_OP_REVERSE_SUBTRACT; case rsx::blend_equation::reverse_substract: return VK_BLEND_OP_REVERSE_SUBTRACT;
case rsx::blend_equation::min: return VK_BLEND_OP_MIN; case rsx::blend_equation::min: return VK_BLEND_OP_MIN;
case rsx::blend_equation::max: return VK_BLEND_OP_MAX; case rsx::blend_equation::max: return VK_BLEND_OP_MAX;

View File

@ -157,6 +157,7 @@ namespace rsx
{ {
default: default:
rsx_log.error("Invalid AV format 0x%x", format); rsx_log.error("Invalid AV format 0x%x", format);
[[fallthrough]];
case 0: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8R8G8B8: case 0: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8R8G8B8:
case 1: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8B8G8R8: case 1: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8B8G8R8:
return CELL_GCM_TEXTURE_A8R8G8B8; return CELL_GCM_TEXTURE_A8R8G8B8;
@ -171,6 +172,7 @@ namespace rsx
{ {
default: default:
rsx_log.error("Invalid AV format 0x%x", format); rsx_log.error("Invalid AV format 0x%x", format);
[[fallthrough]];
case 0: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8R8G8B8: case 0: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8R8G8B8:
case 1: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8B8G8R8: case 1: // CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8B8G8R8:
return 4; return 4;

View File

@ -809,6 +809,7 @@ const char* rsx_debugger::ParseGCMEnum(u32 value, u32 type)
case a + m * 14: \ case a + m * 14: \
case a + m * 15: \ case a + m * 15: \
index = (cmd - a) / m; \ index = (cmd - a) / m; \
[[fallthrough]]; \
case a \ case a \
QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 ioAddr) QString rsx_debugger::DisAsmCommand(u32 cmd, u32 count, u32 ioAddr)