diff --git a/Source/Core/VideoBackends/D3D12/Render.cpp b/Source/Core/VideoBackends/D3D12/Render.cpp index 6e6e6a8f3c..09e7356259 100644 --- a/Source/Core/VideoBackends/D3D12/Render.cpp +++ b/Source/Core/VideoBackends/D3D12/Render.cpp @@ -482,10 +482,7 @@ void Renderer::SetViewport() width = (x + width <= GetTargetWidth()) ? width : (GetTargetWidth() - x); height = (y + height <= GetTargetHeight()) ? height : (GetTargetHeight() - y); - D3D12_VIEWPORT vp = { - x, y, width, height, - D3D12_MIN_DEPTH, - 16777215.0f / 16777216.0f }; + D3D12_VIEWPORT vp = {x, y, width, height, D3D12_MIN_DEPTH, 16777215.0f / 16777216.0f}; D3D::current_command_list->RSSetViewports(1, &vp); } diff --git a/Source/Core/VideoBackends/OGL/Render.cpp b/Source/Core/VideoBackends/OGL/Render.cpp index 77e3356255..a47f0c1e40 100644 --- a/Source/Core/VideoBackends/OGL/Render.cpp +++ b/Source/Core/VideoBackends/OGL/Render.cpp @@ -482,8 +482,9 @@ Renderer::Renderer() GLExtensions::Supports("GL_ARB_shading_language_420pack"); // Clip distance support is useless without a method to clamp the depth range - g_Config.backend_info.bSupportsDepthClamp = GLExtensions::Supports("GL_ARB_depth_clamp") && - !DriverDetails::HasBug(DriverDetails::BUG_BROKENCLIPDISTANCE); + g_Config.backend_info.bSupportsDepthClamp = + GLExtensions::Supports("GL_ARB_depth_clamp") && + !DriverDetails::HasBug(DriverDetails::BUG_BROKENCLIPDISTANCE); g_ogl_config.bSupportsGLSLCache = GLExtensions::Supports("GL_ARB_get_program_binary"); g_ogl_config.bSupportsGLPinnedMemory = GLExtensions::Supports("GL_AMD_pinned_memory"); @@ -524,7 +525,8 @@ Renderer::Renderer() g_ogl_config.bSupportsGLSLCache = true; g_ogl_config.bSupportsGLSync = true; - // TODO: Implement support for GL_EXT_clip_cull_distance when there is an extension for depth clamping. + // TODO: Implement support for GL_EXT_clip_cull_distance when there is an extension for + // depth clamping. g_Config.backend_info.bSupportsDepthClamp = false; if (strstr(g_ogl_config.glsl_version, "3.0")) diff --git a/Source/Core/VideoCommon/VertexShaderGen.cpp b/Source/Core/VideoCommon/VertexShaderGen.cpp index 42bd9da319..4603e22d7e 100644 --- a/Source/Core/VideoCommon/VertexShaderGen.cpp +++ b/Source/Core/VideoCommon/VertexShaderGen.cpp @@ -406,13 +406,14 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const vertex_shader_uid_da out.Write("o.clipDist0 = o.pos.z + o.pos.w;\n"); // Near: z < -w out.Write("o.clipDist1 = -o.pos.z;\n"); // Far: z > 0 - // We have to handle the depth range in the vertex shader, because some games will use a depth range beyond - // the normal depth range of 0..1. - out.Write("o.pos.z = o.pos.w * " I_PIXELCENTERCORRECTION".w - o.pos.z * " I_PIXELCENTERCORRECTION".z;\n"); + // We have to handle the depth range in the vertex shader, because some games will use a depth + // range beyond the normal depth range of 0..1. + out.Write("o.pos.z = o.pos.w * " I_PIXELCENTERCORRECTION ".w - " + "o.pos.z * " I_PIXELCENTERCORRECTION ".z;\n"); } else { - // User-defined clipping is not supported, thus we rely on the API to handle the depth range for us. + // User-defined clipping is not supported, thus we rely on the API to handle the depth range. // We still need to take care of the reversed depth, so we do that here. out.Write("o.pos.z = -o.pos.z;\n"); } diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index c95706db53..3a1f984e87 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -171,7 +171,7 @@ struct VideoConfig final bool bSupportsPaletteConversion; bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon bool bSupportsSSAA; - bool bSupportsDepthClamp; // Needed by VertexShaderGen, so must stay in VideoCommon + bool bSupportsDepthClamp; // Needed by VertexShaderGen, so must stay in VideoCommon } backend_info; // Utility