Skip to content

Commit

Permalink
rgl: Reset line counter in every shader include.
Browse files Browse the repository at this point in the history
This directive should be expanded to also identify the string index.
  • Loading branch information
CrossVR committed Nov 29, 2015
1 parent 055ffa5 commit acd4c37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_GL/rgl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ static inline bool match_shader_id ( LPCSTR const debug_shader_id, LPCSTR const

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

// Add next source, skip quotation
str++;
// TODO: OGL: Include string index in line directive
source.push_back("#line 2\n");
source.push_back(str);
}
}
Expand Down

0 comments on commit acd4c37

Please sign in to comment.