Skip to content

Commit

Permalink
xrRender/SH_Atomic.h: pixel shader rename (ps -> sh)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed May 28, 2018
1 parent d4548cd commit f55f7ff
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Layers/xrRender/R_Backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ class ECORE_API CBackend
#else
ICF void set_PS(ID3DPixelShader* _ps, LPCSTR _n = nullptr);
#endif // USE_OGL
ICF void set_PS(ref_ps& _ps) { set_PS(_ps->ps, _ps->cName.c_str()); }
ICF void set_PS(ref_ps& _ps) { set_PS(_ps->sh, _ps->cName.c_str()); }

#if defined(USE_DX10) || defined(USE_DX11) || defined(USE_OGL)
#ifdef USE_OGL
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR name)
m_ps.insert(std::make_pair(_ps->set_name(name), _ps));
if (0 == xr_stricmp(name, "null"))
{
_ps->ps = nullptr;
_ps->sh = nullptr;
return _ps;
}

Expand Down
7 changes: 4 additions & 3 deletions src/Layers/xrRender/SH_Atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ SVS::~SVS()
SPS::~SPS()
{
#ifdef USE_OGL
CHK_GL(glDeleteProgram(ps));
CHK_GL(glDeleteProgram(sh));
#else
_RELEASE(ps);
#endif // USE_OGL
_RELEASE(sh);
#endif

RImplementation.Resources->_DeletePS(this);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRender/SH_Atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ typedef resptr_core<SVS, resptr_base<SVS>> ref_vs;
struct ECORE_API SPS : public xr_resource_named
{
#ifdef USE_OGL
GLuint ps;
GLuint sh;
#else
ID3DPixelShader* ps;
ID3DPixelShader* sh;
#endif
R_constant_table constants;
~SPS();
Expand Down
12 changes: 6 additions & 6 deletions src/Layers/xrRender/r__dsgraph_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,14 @@ void D3DXRenderBase::r_dsgraph_insert_dynamic(dxRender_Visual* pVisual, Fvector&
#ifdef USE_OGL
auto &Nvs = map[pass.vs->vs];
auto &Ngs = Nvs[pass.gs->sh];
auto &Nps = Ngs[pass.ps->ps];
auto &Nps = Ngs[pass.ps->sh];
#elif defined(USE_DX10) || defined(USE_DX11)
auto &Nvs = map[&*pass.vs];
auto &Ngs = Nvs[pass.gs->sh];
auto &Nps = Ngs[pass.ps->ps];
auto &Nps = Ngs[pass.ps->sh];
#else
auto &Nvs = map[pass.vs->vs];
auto &Nps = Nvs[pass.ps->ps];
auto &Nps = Nvs[pass.ps->sh];
#endif

#ifdef USE_DX11
Expand Down Expand Up @@ -275,14 +275,14 @@ void D3DXRenderBase::r_dsgraph_insert_static(dxRender_Visual* pVisual)
#ifdef USE_OGL
auto &Nvs = map[pass.vs->vs];
auto &Ngs = Nvs[pass.gs->sh];
auto &Nps = Ngs[pass.ps->ps];
auto &Nps = Ngs[pass.ps->sh];
#elif defined(USE_DX10) || defined(USE_DX11)
auto &Nvs = map[&*pass.vs];
auto &Ngs = Nvs[pass.gs->sh];
auto &Nps = Ngs[pass.ps->ps];
auto &Nps = Ngs[pass.ps->sh];
#else
auto &Nvs = map[pass.vs->vs];
auto &Nps = Nvs[pass.ps->ps];
auto &Nps = Nvs[pass.ps->sh];
#endif

#ifdef USE_DX11
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)
m_ps.insert(std::make_pair(_ps->set_name(name), _ps));
if (0 == xr_stricmp(_name, "null"))
{
_ps->ps = NULL;
_ps->sh = NULL;
return _ps;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_GL/glResourceManager_Resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ SPS* CResourceManager::_CreatePS(LPCSTR _name)
FS.r_close(file);

// Select target
_ps->ps = glCreateShader(GL_FRAGMENT_SHADER);
void* _result = &_ps->ps;
_ps->sh = glCreateShader(GL_FRAGMENT_SHADER);
void* _result = &_ps->sh;
HRESULT const _hr = GEnv.Render->shader_compile(name, (DWORD const*)data, size, nullptr, nullptr, NULL, _result);

VERIFY(SUCCEEDED(_hr));
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/FStaticRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
if (pTarget[0] == 'p')
{
SPS* sps_result = (SPS*)result;
_result = HW.pDevice->CreatePixelShader(buffer, &sps_result->ps);
_result = HW.pDevice->CreatePixelShader(buffer, &sps_result->sh);
if (!SUCCEEDED(_result))
{
Log("! PS: ", file_name);
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R2/r2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
if (pTarget[0] == 'p')
{
SPS* sps_result = (SPS*)result;
_result = HW.pDevice->CreatePixelShader(buffer, &sps_result->ps);
_result = HW.pDevice->CreatePixelShader(buffer, &sps_result->sh);
if (!SUCCEEDED(_result))
{
Log("! PS: ", file_name);
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R3/r3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,9 +798,9 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
{
SPS* sps_result = (SPS*)result;
#ifdef USE_DX11
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, 0, &sps_result->ps);
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, 0, &sps_result->sh);
#else // #ifdef USE_DX11
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, &sps_result->ps);
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, &sps_result->sh);
#endif // #ifdef USE_DX11
if (!SUCCEEDED(_result))
{
Expand Down
4 changes: 2 additions & 2 deletions src/Layers/xrRenderPC_R4/r4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,9 @@ static HRESULT create_shader(LPCSTR const pTarget, DWORD const* buffer, u32 cons
{
SPS* sps_result = (SPS*)result;
#ifdef USE_DX11
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, 0, &sps_result->ps);
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, 0, &sps_result->sh);
#else // #ifdef USE_DX11
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, &sps_result->ps);
_result = HW.pDevice->CreatePixelShader(buffer, buffer_size, &sps_result->sh);
#endif // #ifdef USE_DX11
if (!SUCCEEDED(_result))
{
Expand Down

0 comments on commit f55f7ff

Please sign in to comment.