Fixing debug display with depth test enabled
This commit is contained in:
@@ -6,7 +6,6 @@
|
|||||||
#include <Core/HAL/Mouse/Mouse.h>
|
#include <Core/HAL/Mouse/Mouse.h>
|
||||||
#include <Graphics/Camera.h>
|
#include <Graphics/Camera.h>
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -89,14 +88,8 @@ void UpdateDebugController(float dt)
|
|||||||
gYaw += mouseDelta.X * sensitivity;
|
gYaw += mouseDelta.X * sensitivity;
|
||||||
gPitch -= mouseDelta.Y * sensitivity;
|
gPitch -= mouseDelta.Y * sensitivity;
|
||||||
|
|
||||||
if (gPitch > 1.5f)
|
gPitch = std::min(gPitch, 1.5f);
|
||||||
{
|
gPitch = std::max(gPitch, -1.5f);
|
||||||
gPitch = 1.5f;
|
|
||||||
}
|
|
||||||
if (gPitch < -1.5f)
|
|
||||||
{
|
|
||||||
gPitch = -1.5f;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Juliet::IsKeyDown(Juliet::ScanCode::Q))
|
if (Juliet::IsKeyDown(Juliet::ScanCode::Q))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -300,6 +300,8 @@ namespace Juliet
|
|||||||
// Render depth-tested primitives (vertices at offset 0 in buffer)
|
// Render depth-tested primitives (vertices at offset 0 in buffer)
|
||||||
if (g_DebugState.DepthTestedVertexCount > 0 && g_DebugState.DepthTestedPipeline && g_DebugState.VertexBuffer)
|
if (g_DebugState.DepthTestedVertexCount > 0 && g_DebugState.DepthTestedPipeline && g_DebugState.VertexBuffer)
|
||||||
{
|
{
|
||||||
|
BindGraphicsPipeline(renderPass, g_DebugState.DepthTestedPipeline);
|
||||||
|
|
||||||
// Pack VP matrix + buffer index into push constants
|
// Pack VP matrix + buffer index into push constants
|
||||||
PushData pushData = {};
|
PushData pushData = {};
|
||||||
pushData.ViewProjection = Camera_GetViewProjectionMatrix(camera);
|
pushData.ViewProjection = Camera_GetViewProjectionMatrix(camera);
|
||||||
|
|||||||
Reference in New Issue
Block a user