From 81f05daff2919650d70649f36938c0b25f1b876e Mon Sep 17 00:00:00 2001 From: Zangetsu38 Date: Sun, 29 Nov 2015 17:31:02 +0100 Subject: [PATCH] d3d12: Add more log callback for support dev --- rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp | 92 +++++++++++++--------------- 1 file changed, 44 insertions(+), 48 deletions(-) diff --git a/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp b/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp index 6b2bf3bb05..97300be2c9 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12Formats.cpp @@ -18,9 +18,9 @@ D3D12_BLEND_OP get_blend_op(u16 op) noexcept case CELL_GCM_FUNC_ADD_SIGNED: case CELL_GCM_FUNC_REVERSE_ADD_SIGNED: case CELL_GCM_FUNC_REVERSE_SUBTRACT_SIGNED: - unreachable("Unsupported blend op"); + unreachable("Unsupported blend op used %x, please report this to a developer.", op); } - unreachable("Wrong blend op"); + unreachable("Unimplemented blend op used %x, please report this to a developer.", op); } D3D12_BLEND get_blend_factor(u16 factor) noexcept @@ -42,9 +42,9 @@ D3D12_BLEND get_blend_factor(u16 factor) noexcept case CELL_GCM_ONE_MINUS_CONSTANT_COLOR: case CELL_GCM_CONSTANT_ALPHA: case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: - unreachable("Unsupported blend color factor"); + unreachable("Unsupported blend color factor used %x, please report this to a developer.", factor); } - unreachable("Wrong blend color factor"); + unreachable("Unimplemented blend color factor used %x, please report this to a developer.", factor); } D3D12_BLEND get_blend_factor_alpha(u16 factor) noexcept @@ -66,9 +66,9 @@ D3D12_BLEND get_blend_factor_alpha(u16 factor) noexcept case CELL_GCM_ONE_MINUS_CONSTANT_COLOR: case CELL_GCM_CONSTANT_ALPHA: case CELL_GCM_ONE_MINUS_CONSTANT_ALPHA: - unreachable("Unsupported blend alpha factor"); + unreachable("Unsupported blend alpha factor used %x, please report this to a developer.", factor); } - unreachable("Wrong blend alpha factor"); + unreachable("Unimplemented blend alpha factor used %x, please report this to a developer.", factor); } /** @@ -94,7 +94,7 @@ D3D12_LOGIC_OP get_logic_op(u32 op) noexcept case CELL_GCM_OR_INVERTED: return D3D12_LOGIC_OP_OR_INVERTED; case CELL_GCM_NAND: return D3D12_LOGIC_OP_NAND; } - unreachable("Wrong logic op"); + unreachable("Unimplemented logic op used %x, please report this to a developer.", op); } /** @@ -113,15 +113,13 @@ D3D12_STENCIL_OP get_stencil_op(u32 op) noexcept case CELL_GCM_INCR_WRAP: return D3D12_STENCIL_OP_INCR; case CELL_GCM_DECR_WRAP: return D3D12_STENCIL_OP_DECR; } - LOG_ERROR(RSX, "Unknow stencil op used %x, please report this to a developer.", op); - unreachable("Wrong Stencil op"); + unreachable("Unimplemented stencil op used %x, please report this to a developer.", op); } D3D12_COMPARISON_FUNC get_compare_func(u32 op) noexcept { switch (op) { - case CELL_GCM_ZERO: case CELL_GCM_NEVER: return D3D12_COMPARISON_FUNC_NEVER; case CELL_GCM_LESS: return D3D12_COMPARISON_FUNC_LESS; case CELL_GCM_EQUAL: return D3D12_COMPARISON_FUNC_EQUAL; @@ -130,8 +128,10 @@ D3D12_COMPARISON_FUNC get_compare_func(u32 op) noexcept case CELL_GCM_NOTEQUAL: return D3D12_COMPARISON_FUNC_NOT_EQUAL; case CELL_GCM_GEQUAL: return D3D12_COMPARISON_FUNC_GREATER_EQUAL; case CELL_GCM_ALWAYS: return D3D12_COMPARISON_FUNC_ALWAYS; + case CELL_GCM_ZERO: + unreachable("Unsupported compare function used %x, please report this to a developer.", op); } - unreachable("Wrong compare function"); + unreachable("Unimplemented compare function used %x, please report this to a developer.", op); } DXGI_FORMAT get_texture_format(int format) noexcept @@ -157,7 +157,7 @@ DXGI_FORMAT get_texture_format(int format) noexcept case CELL_GCM_TEXTURE_G8B8: return DXGI_FORMAT_G8R8_G8B8_UNORM; case CELL_GCM_TEXTURE_R6G5B5: - // Not native + /*Not native*/ return DXGI_FORMAT_R8G8B8A8_UNORM; case CELL_GCM_TEXTURE_DEPTH24_D8: return DXGI_FORMAT_R32_UINT; @@ -192,9 +192,9 @@ DXGI_FORMAT get_texture_format(int format) noexcept case CELL_GCM_TEXTURE_COMPRESSED_HILO_S8: case ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN) & CELL_GCM_TEXTURE_COMPRESSED_B8R8_G8R8: case ~(CELL_GCM_TEXTURE_LN | CELL_GCM_TEXTURE_UN) & CELL_GCM_TEXTURE_COMPRESSED_R8B8_R8G8: - unreachable( "Unimplemented Texture format"); + unreachable("Unsupported texture format used %x, please report this to a developer.", format); } - unreachable("Wrong Texture format"); + unreachable("Unimplemented texture format used %x, please report this to a developer.", format); } UINT get_texture_max_aniso(u8 aniso) noexcept @@ -210,7 +210,7 @@ UINT get_texture_max_aniso(u8 aniso) noexcept case CELL_GCM_TEXTURE_MAX_ANISO_12: return 12; case CELL_GCM_TEXTURE_MAX_ANISO_16: return 16; } - unreachable("Wrong Texture max aniso"); + unreachable("Unimplemented texture max aniso used %x, please report this to a developer.", aniso); } D3D12_TEXTURE_ADDRESS_MODE get_texture_wrap_mode(u8 wrap) noexcept @@ -226,7 +226,7 @@ D3D12_TEXTURE_ADDRESS_MODE get_texture_wrap_mode(u8 wrap) noexcept case CELL_GCM_TEXTURE_MIRROR_ONCE_BORDER: return D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE; case CELL_GCM_TEXTURE_MIRROR_ONCE_CLAMP: return D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE; } - unreachable("Wrong texture wrap mode"); + unreachable("Unimplemented texture wrap mode used %x, please report this to a developer.", wrap); } namespace @@ -260,12 +260,11 @@ namespace mip = D3D12_FILTER_TYPE_LINEAR; return; case CELL_GCM_TEXTURE_CONVOLUTION_MIN: - LOG_WARNING(RSX, "CELL_GCM_TEXTURE_CONVOLUTION_MIN not supported, fallback to bilinear filtering"); min = D3D12_FILTER_TYPE_LINEAR; mip = D3D12_FILTER_TYPE_POINT; return; } - unreachable("Wrong min filter"); + unreachable("Unimplemented min filter used %x, please report this to a developer.", min_filter); } D3D12_FILTER_TYPE get_mag_filter(u8 mag_filter) noexcept @@ -275,9 +274,7 @@ namespace case CELL_GCM_TEXTURE_NEAREST: return D3D12_FILTER_TYPE_POINT; case CELL_GCM_TEXTURE_LINEAR: return D3D12_FILTER_TYPE_LINEAR; } - // Catherine uses this - LOG_WARNING(RSX, "Unknow mag filter used %x, fallback to bilinear filtering", mag_filter); - return D3D12_FILTER_TYPE_LINEAR; + unreachable("Unimplemented mag filter used %x, please report this to a developer.", mag_filter); } } @@ -299,33 +296,32 @@ D3D12_PRIMITIVE_TOPOLOGY get_primitive_topology(u8 draw_mode) noexcept case CELL_GCM_PRIMITIVE_LINE_STRIP: return D3D_PRIMITIVE_TOPOLOGY_LINESTRIP; case CELL_GCM_PRIMITIVE_TRIANGLES: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; case CELL_GCM_PRIMITIVE_TRIANGLE_STRIP: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP; - // Emulated + case CELL_GCM_PRIMITIVE_QUAD_STRIP: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + case CELL_GCM_PRIMITIVE_POLYGON: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; case CELL_GCM_PRIMITIVE_TRIANGLE_FAN: case CELL_GCM_PRIMITIVE_QUADS: - case CELL_GCM_PRIMITIVE_POLYGON: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; - - case CELL_GCM_PRIMITIVE_QUAD_STRIP: return D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + unreachable("Unsupported draw mode used %x, please report this to a developer.", draw_mode); } - unreachable("Wrong draw mode"); + unreachable("Unimplemented draw mode used %x, please report this to a developer.", draw_mode); } + D3D12_PRIMITIVE_TOPOLOGY_TYPE get_primitive_topology_type(u8 draw_mode) noexcept { switch (draw_mode) { case CELL_GCM_PRIMITIVE_POINTS: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT; + case CELL_GCM_PRIMITIVE_LINE_STRIP: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE; + case CELL_GCM_PRIMITIVE_TRIANGLES: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + case CELL_GCM_PRIMITIVE_QUADS: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + case CELL_GCM_PRIMITIVE_QUAD_STRIP: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; case CELL_GCM_PRIMITIVE_LINES: case CELL_GCM_PRIMITIVE_LINE_LOOP: - case CELL_GCM_PRIMITIVE_LINE_STRIP: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE; - case CELL_GCM_PRIMITIVE_TRIANGLES: case CELL_GCM_PRIMITIVE_TRIANGLE_STRIP: case CELL_GCM_PRIMITIVE_TRIANGLE_FAN: case CELL_GCM_PRIMITIVE_POLYGON: - case CELL_GCM_PRIMITIVE_QUADS: return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; - // unsupported - case CELL_GCM_PRIMITIVE_QUAD_STRIP: - return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + unreachable("Unsupported draw mode used %x, please report this to a developer.", draw_mode); } - unreachable("Wrong draw mode"); + unreachable("Unimplemented draw mode used %x, please report this to a developer.", draw_mode); } DXGI_FORMAT get_color_surface_format(u8 format) noexcept @@ -337,7 +333,7 @@ DXGI_FORMAT get_color_surface_format(u8 format) noexcept case CELL_GCM_SURFACE_F_W16Z16Y16X16: return DXGI_FORMAT_R16G16B16A16_FLOAT; case CELL_GCM_SURFACE_F_X32: return DXGI_FORMAT_R32_FLOAT; } - unreachable("Wrong color surface format"); + unreachable("Unimplemented color surface format used %x, please report this to a developer.", format); } DXGI_FORMAT get_depth_stencil_surface_format(u8 format) noexcept @@ -347,7 +343,7 @@ DXGI_FORMAT get_depth_stencil_surface_format(u8 format) noexcept case CELL_GCM_SURFACE_Z16: return DXGI_FORMAT_D16_UNORM; case CELL_GCM_SURFACE_Z24S8: return DXGI_FORMAT_D24_UNORM_S8_UINT; } - unreachable("Wrong depth stencil surface format"); + unreachable("Unimplemented depth stencil surface format used %x, please report this to a developer.", format); } DXGI_FORMAT get_depth_stencil_surface_clear_format(u8 format) noexcept @@ -357,7 +353,7 @@ DXGI_FORMAT get_depth_stencil_surface_clear_format(u8 format) noexcept case CELL_GCM_SURFACE_Z16: return DXGI_FORMAT_D16_UNORM; case CELL_GCM_SURFACE_Z24S8: return DXGI_FORMAT_D24_UNORM_S8_UINT; } - unreachable("Wrong depth stencil surface format"); + unreachable("Unimplemented depth stencil surface format used %x, please report this to a developer.", format); } DXGI_FORMAT get_depth_stencil_typeless_surface_format(u8 format) noexcept @@ -367,7 +363,7 @@ DXGI_FORMAT get_depth_stencil_typeless_surface_format(u8 format) noexcept case CELL_GCM_SURFACE_Z16: return DXGI_FORMAT_R16_TYPELESS; case CELL_GCM_SURFACE_Z24S8: return DXGI_FORMAT_R24G8_TYPELESS; } - unreachable("Wrong depth stencil surface format"); + unreachable("Unimplemented depth stencil surface format used %x, please report this to a developer.", format); } DXGI_FORMAT get_depth_samplable_surface_format(u8 format) noexcept @@ -377,7 +373,7 @@ DXGI_FORMAT get_depth_samplable_surface_format(u8 format) noexcept case CELL_GCM_SURFACE_Z16: return DXGI_FORMAT_R16_FLOAT; case CELL_GCM_SURFACE_Z24S8: return DXGI_FORMAT_R24_UNORM_X8_TYPELESS; } - unreachable("Wrong depth stencil surface format"); + unreachable("Unimplemented depth stencil surface format used %x, please report this to a developer.", format); } BOOL get_front_face_ccw(u32 set_front_face_value) noexcept @@ -388,7 +384,7 @@ BOOL get_front_face_ccw(u32 set_front_face_value) noexcept case CELL_GCM_CW: return FALSE; case CELL_GCM_CCW: return TRUE; } - unreachable("Wrong front face value"); + unreachable("Unimplemented front face value used %x, please report this to a developer.", set_front_face_value); } DXGI_FORMAT get_index_type(u8 index_type) noexcept @@ -398,7 +394,7 @@ DXGI_FORMAT get_index_type(u8 index_type) noexcept case CELL_GCM_DRAW_INDEX_ARRAY_TYPE_16: return DXGI_FORMAT_R16_UINT; case CELL_GCM_DRAW_INDEX_ARRAY_TYPE_32: return DXGI_FORMAT_R32_UINT; } - unreachable("Wrong index type"); + unreachable("Unimplemented index type used %x, please report this to a developer.", index_type); } DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept @@ -414,7 +410,7 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R16G16B16A16_SNORM; // No 3 channel type case 4: return DXGI_FORMAT_R16G16B16A16_SNORM; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } case CELL_GCM_VERTEX_F: { @@ -425,7 +421,7 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R32G32B32_FLOAT; case 4: return DXGI_FORMAT_R32G32B32A32_FLOAT; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } case CELL_GCM_VERTEX_SF: { @@ -436,7 +432,7 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R16G16B16A16_FLOAT; // No 3 channel type case 4: return DXGI_FORMAT_R16G16B16A16_FLOAT; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } case CELL_GCM_VERTEX_UB: { @@ -447,7 +443,7 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R8G8B8A8_UNORM; // No 3 channel type case 4: return DXGI_FORMAT_R8G8B8A8_UNORM; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } case CELL_GCM_VERTEX_S32K: { @@ -458,7 +454,7 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R16G16B16A16_SINT; // No 3 channel type case 4: return DXGI_FORMAT_R16G16B16A16_SINT; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } case CELL_GCM_VERTEX_CMP: { @@ -469,7 +465,7 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R32G32B32_FLOAT; case 4: return DXGI_FORMAT_R32G32B32A32_FLOAT; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } case CELL_GCM_VERTEX_UB256: { @@ -480,10 +476,10 @@ DXGI_FORMAT get_vertex_attribute_format(u8 type, u8 size) noexcept case 3: return DXGI_FORMAT_R8G8B8A8_UINT; // No 3 channel type case 4: return DXGI_FORMAT_R8G8B8A8_UINT; } - unreachable("Wrong type size"); + unreachable("Unimplemented type size used %x, please report this to a developer.", size); } } - unreachable("Wrong type"); + unreachable("Unimplemented type used %x, please report this to a developer.", size); } D3D12_RECT get_scissor(u32 horizontal, u32 vertical) noexcept