idRenderBackend::DBG_ShowDebugLines works correctly

This commit is contained in:
Robert Beckebans 2022-05-14 10:51:19 +02:00
parent cc11531f8d
commit b109fc7a3e
2 changed files with 8 additions and 18 deletions

View file

@ -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,

View file

@ -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() );
}
}