diff --git a/ext/native/thin3d/VulkanQueueRunner.cpp b/ext/native/thin3d/VulkanQueueRunner.cpp index b237ead379..7b27217cc7 100644 --- a/ext/native/thin3d/VulkanQueueRunner.cpp +++ b/ext/native/thin3d/VulkanQueueRunner.cpp @@ -1011,11 +1011,8 @@ void VulkanQueueRunner::PerformRenderPass(const VKRStep &step, VkCommandBuffer c final_vp.y = rc.y; final_vp.width = rc.w; final_vp.height = rc.h; - // We can't allow values outside this range unless we use VK_EXT_depth_range_unrestricted. - // Sometimes state mapping produces 65536/65535 which is slightly outside. - // TODO: This should be fixed at the source. - final_vp.maxDepth = clamp_value(vp.maxDepth, 0.0f, 1.0f); - final_vp.minDepth = clamp_value(vp.minDepth, 0.0f, 1.0f); + final_vp.maxDepth = vp.maxDepth; + final_vp.minDepth = vp.minDepth; vkCmdSetViewport(cmd, 0, 1, &final_vp); } break; diff --git a/ext/native/thin3d/VulkanRenderManager.h b/ext/native/thin3d/VulkanRenderManager.h index 429c7c146d..8df0288422 100644 --- a/ext/native/thin3d/VulkanRenderManager.h +++ b/ext/native/thin3d/VulkanRenderManager.h @@ -122,7 +122,15 @@ public: _dbg_assert_(G3D, (int)vp.width >= 0); _dbg_assert_(G3D, (int)vp.height >= 0); VkRenderData data{ VKRRenderCommand::VIEWPORT }; - data.viewport.vp = vp; + data.viewport.vp.x = vp.x; + data.viewport.vp.y = vp.y; + data.viewport.vp.width = vp.width; + data.viewport.vp.height = vp.height; + // We can't allow values outside this range unless we use VK_EXT_depth_range_unrestricted. + // Sometimes state mapping produces 65536/65535 which is slightly outside. + // TODO: This should be fixed at the source. + data.viewport.vp.minDepth = clamp_value(vp.minDepth, 0.0f, 1.0f); + data.viewport.vp.maxDepth = clamp_value(vp.maxDepth, 0.0f, 1.0f); curRenderStep_->commands.push_back(data); }