Skip to content

Commit 3e48415

Browse files
committed
glR_Backend_Runtime: Enable geometry shaders.
1 parent 009378b commit 3e48415

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Layers/xrRender/R_Backend.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ class ECORE_API CBackend
124124
SState* state;
125125
GLuint ps;
126126
GLuint vs;
127+
GLuint gs;
127128
#else
128129
ID3DState* state;
129130
ID3DPixelShader* ps;
@@ -141,7 +142,7 @@ class ECORE_API CBackend
141142
#ifdef DEBUG
142143
LPCSTR ps_name;
143144
LPCSTR vs_name;
144-
#if defined(USE_DX10) || defined(USE_DX11)
145+
#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
145146
LPCSTR gs_name;
146147
# ifdef USE_DX11
147148
LPCSTR hs_name;

src/Layers/xrRenderGL/glR_Backend_Runtime.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,23 @@ ICF void CBackend::set_PS(GLuint _ps, LPCSTR _n)
6565
}
6666
}
6767

68+
ICF void CBackend::set_GS(GLuint _gs, LPCSTR _n)
69+
{
70+
if (gs != _gs)
71+
{
72+
string_path name;
73+
PGO(glGetObjectLabel(GL_PROGRAM, _ps, sizeof(name), nullptr, name));
74+
PGO(Msg("PGO:Gshader:%d,%s", _ps, _n ? _n : name));
75+
// TODO: OGL: Get statistics for G Shader change
76+
//stat.gs ++;
77+
gs = _gs;
78+
CHK_GL(glUseProgramStages(HW.pPP, GL_GEOMETRY_SHADER_BIT, gs));
79+
#ifdef DEBUG
80+
gs_name = _n;
81+
#endif
82+
}
83+
}
84+
6885
ICF void CBackend::set_VS(GLuint _vs, LPCSTR _n)
6986
{
7087
if (vs != _vs)

0 commit comments

Comments
 (0)