Skip to content

Commit acd4c37

Browse files
committed
rgl: Reset line counter in every shader include.
This directive should be expanded to also identify the string index.
1 parent 055ffa5 commit acd4c37

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Layers/xrRenderPC_GL/rgl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,7 @@ static inline bool match_shader_id ( LPCSTR const debug_shader_id, LPCSTR const
627627

628628
static inline void load_includes(LPCSTR pSrcData, UINT SrcDataLen, xr_vector<char*>& source, xr_vector<char*>& includes)
629629
{
630+
// Copy source file data into a null-terminated buffer
630631
char* srcData = xr_alloc<char>(SrcDataLen + 2);
631632
memcpy(srcData, pSrcData, SrcDataLen);
632633
srcData[SrcDataLen] = '\n';
@@ -658,6 +659,8 @@ static inline void load_includes(LPCSTR pSrcData, UINT SrcDataLen, xr_vector<cha
658659

659660
// Add next source, skip quotation
660661
str++;
662+
// TODO: OGL: Include string index in line directive
663+
source.push_back("#line 2\n");
661664
source.push_back(str);
662665
}
663666
}

0 commit comments

Comments
 (0)