Code style fixes #1

This commit is contained in:
DHrpcs3 2016-01-20 16:23:25 +03:00
parent 685d5d3ea3
commit 7972cb5bdc
21 changed files with 583 additions and 581 deletions

View file

@ -15,40 +15,40 @@
namespace
{
u32 get_max_depth_value(Surface_depth_format format)
u32 get_max_depth_value(surface_depth_format format)
{
switch (format)
{
case Surface_depth_format::z16: return 0xFFFF;
case Surface_depth_format::z24s8: return 0xFFFFFF;
case surface_depth_format::z16: return 0xFFFF;
case surface_depth_format::z24s8: return 0xFFFFFF;
}
throw EXCEPTION("Unknow depth format");
}
UINT get_num_rtt(Surface_target color_target)
UINT get_num_rtt(surface_target color_target)
{
switch (color_target)
{
case Surface_target::none: return 0;
case Surface_target::surface_a:
case Surface_target::surface_b: return 1;
case Surface_target::surfaces_a_b: return 2;
case Surface_target::surfaces_a_b_c: return 3;
case Surface_target::surfaces_a_b_c_d: return 4;
case surface_target::none: return 0;
case surface_target::surface_a:
case surface_target::surface_b: return 1;
case surface_target::surfaces_a_b: return 2;
case surface_target::surfaces_a_b_c: return 3;
case surface_target::surfaces_a_b_c_d: return 4;
}
throw EXCEPTION("Wrong color_target (%d)", color_target);
}
std::vector<u8> get_rtt_indexes(Surface_target color_target)
std::vector<u8> get_rtt_indexes(surface_target color_target)
{
switch (color_target)
{
case Surface_target::none: return{};
case Surface_target::surface_a: return{ 0 };
case Surface_target::surface_b: return{ 1 };
case Surface_target::surfaces_a_b: return{ 0, 1 };
case Surface_target::surfaces_a_b_c: return{ 0, 1, 2 };
case Surface_target::surfaces_a_b_c_d: return{ 0, 1, 2, 3 };
case surface_target::none: return{};
case surface_target::surface_a: return{ 0 };
case surface_target::surface_b: return{ 1 };
case surface_target::surfaces_a_b: return{ 0, 1 };
case surface_target::surfaces_a_b_c: return{ 0, 1, 2 };
case surface_target::surfaces_a_b_c_d: return{ 0, 1, 2, 3 };
}
throw EXCEPTION("Wrong color_target (%d)", color_target);
}
@ -73,46 +73,46 @@ namespace
return register_value & 0xff;
}
size_t get_aligned_pitch(Surface_color_format format, u32 width)
size_t get_aligned_pitch(surface_color_format format, u32 width)
{
switch (format)
{
case Surface_color_format::b8: return align(width, 256);
case Surface_color_format::g8b8:
case Surface_color_format::x1r5g5b5_o1r5g5b5:
case Surface_color_format::x1r5g5b5_z1r5g5b5:
case Surface_color_format::r5g6b5: return align(width * 2, 256);
case Surface_color_format::a8b8g8r8:
case Surface_color_format::x8b8g8r8_o8b8g8r8:
case Surface_color_format::x8b8g8r8_z8b8g8r8:
case Surface_color_format::x8r8g8b8_o8r8g8b8:
case Surface_color_format::x8r8g8b8_z8r8g8b8:
case Surface_color_format::x32:
case Surface_color_format::a8r8g8b8: return align(width * 4, 256);
case Surface_color_format::w16z16y16x16: return align(width * 8, 256);
case Surface_color_format::w32z32y32x32: return align(width * 16, 256);
case surface_color_format::b8: return align(width, 256);
case surface_color_format::g8b8:
case surface_color_format::x1r5g5b5_o1r5g5b5:
case surface_color_format::x1r5g5b5_z1r5g5b5:
case surface_color_format::r5g6b5: return align(width * 2, 256);
case surface_color_format::a8b8g8r8:
case surface_color_format::x8b8g8r8_o8b8g8r8:
case surface_color_format::x8b8g8r8_z8b8g8r8:
case surface_color_format::x8r8g8b8_o8r8g8b8:
case surface_color_format::x8r8g8b8_z8r8g8b8:
case surface_color_format::x32:
case surface_color_format::a8r8g8b8: return align(width * 4, 256);
case surface_color_format::w16z16y16x16: return align(width * 8, 256);
case surface_color_format::w32z32y32x32: return align(width * 16, 256);
}
throw EXCEPTION("Unknow color surface format");
}
size_t get_packed_pitch(Surface_color_format format, u32 width)
size_t get_packed_pitch(surface_color_format format, u32 width)
{
switch (format)
{
case Surface_color_format::b8: return width;
case Surface_color_format::g8b8:
case Surface_color_format::x1r5g5b5_o1r5g5b5:
case Surface_color_format::x1r5g5b5_z1r5g5b5:
case Surface_color_format::r5g6b5: return width * 2;
case Surface_color_format::a8b8g8r8:
case Surface_color_format::x8b8g8r8_o8b8g8r8:
case Surface_color_format::x8b8g8r8_z8b8g8r8:
case Surface_color_format::x8r8g8b8_o8r8g8b8:
case Surface_color_format::x8r8g8b8_z8r8g8b8:
case Surface_color_format::x32:
case Surface_color_format::a8r8g8b8: return width * 4;
case Surface_color_format::w16z16y16x16: return width * 8;
case Surface_color_format::w32z32y32x32: return width * 16;
case surface_color_format::b8: return width;
case surface_color_format::g8b8:
case surface_color_format::x1r5g5b5_o1r5g5b5:
case surface_color_format::x1r5g5b5_z1r5g5b5:
case surface_color_format::r5g6b5: return width * 2;
case surface_color_format::a8b8g8r8:
case surface_color_format::x8b8g8r8_o8b8g8r8:
case surface_color_format::x8b8g8r8_z8b8g8r8:
case surface_color_format::x8r8g8b8_o8r8g8b8:
case surface_color_format::x8r8g8b8_z8r8g8b8:
case surface_color_format::x32:
case surface_color_format::a8r8g8b8: return width * 4;
case surface_color_format::w16z16y16x16: return width * 8;
case surface_color_format::w32z32y32x32: return width * 16;
}
throw EXCEPTION("Unknow color surface format");
}
@ -242,7 +242,7 @@ namespace
ID3D12GraphicsCommandList * command_list,
data_heap &readback_heap,
ID3D12Resource * color_surface,
Surface_color_format color_surface_format
surface_color_format color_surface_format
)
{
int clip_w = rsx::method_registers[NV4097_SET_SURFACE_CLIP_HORIZONTAL] >> 16;