diff --git a/src/xenia/gpu/spirv_shader_translator_rb.cc b/src/xenia/gpu/spirv_shader_translator_rb.cc index 829b3f576..82a58dfec 100644 --- a/src/xenia/gpu/spirv_shader_translator_rb.cc +++ b/src/xenia/gpu/spirv_shader_translator_rb.cc @@ -296,7 +296,7 @@ spv::Id SpirvShaderTranslator::PreClampedDepthTo20e4( // normal_biased_f32 = f32 - (112 << 23) spv::Id normal_biased_f32 = builder.createBinOp( spv::OpISub, type_uint, f32_scalar, - builder.makeUintConstant((UINT32_C(112) + remap_bias) << 23)); + builder.makeUintConstant((UINT32_C(112) - remap_bias) << 23)); // Select the needed conversion depending on whether the number is too small // to be represented as normalized 20e4. diff --git a/src/xenia/gpu/vulkan/vulkan_command_processor.cc b/src/xenia/gpu/vulkan/vulkan_command_processor.cc index 0a89bb122..c9e3cb76a 100644 --- a/src/xenia/gpu/vulkan/vulkan_command_processor.cc +++ b/src/xenia/gpu/vulkan/vulkan_command_processor.cc @@ -2397,6 +2397,9 @@ bool VulkanCommandProcessor::IssueDraw(xenos::PrimitiveType prim_type, const VkPhysicalDeviceLimits& device_limits = provider.device_properties().limits; + bool host_render_targets_used = render_target_cache_->GetPath() == + RenderTargetCache::Path::kHostRenderTargets; + // Get dynamic rasterizer state. draw_util::ViewportInfo viewport_info; // Just handling maxViewportDimensions is enough - viewportBoundsRange[1] must @@ -2418,7 +2421,8 @@ bool VulkanCommandProcessor::IssueDraw(xenos::PrimitiveType prim_type, draw_util::GetHostViewportInfo( regs, 1, 1, false, device_limits.maxViewportDimensions[0], device_limits.maxViewportDimensions[1], true, normalized_depth_control, - false, false, false, viewport_info); + false, host_render_targets_used, + pixel_shader && pixel_shader->writes_depth(), viewport_info); // Update dynamic graphics pipeline state. UpdateDynamicState(viewport_info, primitive_polygonal,