Skip to content

Commit

Permalink
glR_Backend_Runtime: Enable geometry shaders.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Nov 25, 2015
1 parent 009378b commit 3e48415
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Layers/xrRender/R_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class ECORE_API CBackend
SState* state;
GLuint ps;
GLuint vs;
GLuint gs;
#else
ID3DState* state;
ID3DPixelShader* ps;
Expand All @@ -141,7 +142,7 @@ class ECORE_API CBackend
#ifdef DEBUG
LPCSTR ps_name;
LPCSTR vs_name;
#if defined(USE_DX10) || defined(USE_DX11)
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
LPCSTR gs_name;
# ifdef USE_DX11
LPCSTR hs_name;
Expand Down
17 changes: 17 additions & 0 deletions src/Layers/xrRenderGL/glR_Backend_Runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ ICF void CBackend::set_PS(GLuint _ps, LPCSTR _n)
}
}

ICF void CBackend::set_GS(GLuint _gs, LPCSTR _n)
{
if (gs != _gs)
{
string_path name;
PGO(glGetObjectLabel(GL_PROGRAM, _ps, sizeof(name), nullptr, name));
PGO(Msg("PGO:Gshader:%d,%s", _ps, _n ? _n : name));
// TODO: OGL: Get statistics for G Shader change
//stat.gs ++;
gs = _gs;
CHK_GL(glUseProgramStages(HW.pPP, GL_GEOMETRY_SHADER_BIT, gs));
#ifdef DEBUG
gs_name = _n;
#endif
}
}

ICF void CBackend::set_VS(GLuint _vs, LPCSTR _n)
{
if (vs != _vs)
Expand Down

0 comments on commit 3e48415

Please sign in to comment.