From b109fc7a3e0b45df81fa0478c0968cc3e8788596 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sat, 14 May 2022 10:51:19 +0200 Subject: [PATCH] idRenderBackend::DBG_ShowDebugLines works correctly --- neo/renderer/ImmediateMode.h | 18 ------------------ neo/renderer/NVRHI/RenderDebug_NVRHI.cpp | 8 ++++++++ 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/neo/renderer/ImmediateMode.h b/neo/renderer/ImmediateMode.h index 0326a607..b18400eb 100644 --- a/neo/renderer/ImmediateMode.h +++ b/neo/renderer/ImmediateMode.h @@ -30,24 +30,6 @@ If you have questions concerning this license or the applicable additional terms class idDrawVert; -/* -struct fhSimpleVert -{ - idVec3 xyz; - idVec2 st; - byte color[4]; - - void SetColor( const idVec3& v ); - void SetColor( const idVec4& v ); - - static const int xyzOffset = 0; - static const int texcoordOffset = 12; - static const int colorOffset = 20; -}; - -static_assert( sizeof( fhSimpleVert ) == 24, "unexpected size of simple vertex, due to padding?" ); -*/ - enum GFXenum { GFX_INVALID_ENUM = 0x0500, diff --git a/neo/renderer/NVRHI/RenderDebug_NVRHI.cpp b/neo/renderer/NVRHI/RenderDebug_NVRHI.cpp index bd6deaae..b2310ff2 100644 --- a/neo/renderer/NVRHI/RenderDebug_NVRHI.cpp +++ b/neo/renderer/NVRHI/RenderDebug_NVRHI.cpp @@ -2019,8 +2019,10 @@ void idRenderBackend::DBG_ShowDebugLines() if( !line->depthTest ) { im.Color3fv( line->rgb.ToFloatPtr() ); + im.Vertex3fv( line->start.ToFloatPtr() ); im.Vertex3fv( line->end.ToFloatPtr() ); + im.Vertex3fv( line->end.ToFloatPtr() ); } } im.End(); @@ -2037,8 +2039,14 @@ void idRenderBackend::DBG_ShowDebugLines() if( line->depthTest ) { im.Color4fv( line->rgb.ToFloatPtr() ); + im.Vertex3fv( line->start.ToFloatPtr() ); im.Vertex3fv( line->end.ToFloatPtr() ); + + // RB: could use nvrhi::PrimitiveType::LineList + // but we rather to keep the number of pipelines low so just make a triangle of this + im.Vertex3fv( line->end.ToFloatPtr() ); + } }