Fixed GLES

This commit is contained in:
Elderme 2016-08-04 14:36:35 +02:00
parent a3c78a7245
commit 6f78f5b9b9
3 changed files with 770 additions and 746 deletions

View File

@ -200,6 +200,7 @@ void GL3DrawPolicy::drawReflectiveShadowMap(const DrawCalls& draw_calls,
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void IndirectDrawPolicy::drawSolidFirstPass(const DrawCalls& draw_calls) const void IndirectDrawPolicy::drawSolidFirstPass(const DrawCalls& draw_calls) const
{ {
#if !defined(USE_GLES2)
//TODO: find a way to add TextureMarix in instanced shaders, //TODO: find a way to add TextureMarix in instanced shaders,
//and remove these four lines //and remove these four lines
renderMeshes1stPass<DefaultMaterial, 2, 1>(); renderMeshes1stPass<DefaultMaterial, 2, 1>();
@ -208,6 +209,7 @@ void IndirectDrawPolicy::drawSolidFirstPass(const DrawCalls& draw_calls) const
renderMeshes1stPass<AlphaRef, 3, 2, 1>(); renderMeshes1stPass<AlphaRef, 3, 2, 1>();
draw_calls.drawIndirectSolidFirstPass(); draw_calls.drawIndirectSolidFirstPass();
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -215,6 +217,7 @@ void IndirectDrawPolicy::drawSolidSecondPass (const DrawCalls& draw_calls,
const std::vector<uint64_t>& handles, const std::vector<uint64_t>& handles,
const std::vector<GLuint>& prefilled_tex) const const std::vector<GLuint>& prefilled_tex) const
{ {
#if !defined(USE_GLES2)
//TODO: find a way to add TextureMatrix in instanced shaders, //TODO: find a way to add TextureMatrix in instanced shaders,
//and remove these four lines //and remove these four lines
renderMeshes2ndPass<DefaultMaterial, 3, 1> (handles, prefilled_tex); renderMeshes2ndPass<DefaultMaterial, 3, 1> (handles, prefilled_tex);
@ -223,12 +226,15 @@ void IndirectDrawPolicy::drawSolidSecondPass (const DrawCalls& draw_calls,
renderMeshes2ndPass<SplattingMat, 1 > (handles, prefilled_tex); renderMeshes2ndPass<SplattingMat, 1 > (handles, prefilled_tex);
draw_calls.drawIndirectSolidSecondPass(prefilled_tex); draw_calls.drawIndirectSolidSecondPass(prefilled_tex);
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void IndirectDrawPolicy::drawNormals(const DrawCalls& draw_calls) const void IndirectDrawPolicy::drawNormals(const DrawCalls& draw_calls) const
{ {
#if !defined(USE_GLES2)
draw_calls.drawIndirectNormals(); draw_calls.drawIndirectNormals();
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -248,21 +254,26 @@ void IndirectDrawPolicy::drawGlow(const DrawCalls& draw_calls,
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void IndirectDrawPolicy::drawShadows(const DrawCalls& draw_calls, unsigned cascade) const void IndirectDrawPolicy::drawShadows(const DrawCalls& draw_calls, unsigned cascade) const
{ {
#if !defined(USE_GLES2)
draw_calls.drawIndirectShadows(cascade); draw_calls.drawIndirectShadows(cascade);
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void IndirectDrawPolicy::drawReflectiveShadowMap(const DrawCalls& draw_calls, void IndirectDrawPolicy::drawReflectiveShadowMap(const DrawCalls& draw_calls,
const core::matrix4 &rsm_matrix) const const core::matrix4 &rsm_matrix) const
{ {
#if !defined(USE_GLES2)
drawRSM<SplattingMat, 1>(rsm_matrix); //TODO: write instanced splatting RSM shader and remove this line drawRSM<SplattingMat, 1>(rsm_matrix); //TODO: write instanced splatting RSM shader and remove this line
draw_calls.drawIndirectReflectiveShadowMaps(rsm_matrix); draw_calls.drawIndirectReflectiveShadowMaps(rsm_matrix);
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void MultidrawPolicy::drawSolidFirstPass(const DrawCalls& draw_calls) const void MultidrawPolicy::drawSolidFirstPass(const DrawCalls& draw_calls) const
{ {
#if !defined(USE_GLES2)
//TODO: find a way to add TextureMarix in instanced shaders, //TODO: find a way to add TextureMarix in instanced shaders,
//and remove these four lines //and remove these four lines
renderMeshes1stPass<DefaultMaterial, 2, 1>(); renderMeshes1stPass<DefaultMaterial, 2, 1>();
@ -271,6 +282,7 @@ void MultidrawPolicy::drawSolidFirstPass(const DrawCalls& draw_calls) const
renderMeshes1stPass<AlphaRef, 3, 2, 1>(); renderMeshes1stPass<AlphaRef, 3, 2, 1>();
draw_calls.multidrawSolidFirstPass(); draw_calls.multidrawSolidFirstPass();
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -278,6 +290,7 @@ void MultidrawPolicy::drawSolidSecondPass (const DrawCalls& draw_calls,
const std::vector<uint64_t>& handles, const std::vector<uint64_t>& handles,
const std::vector<GLuint>& prefilled_tex) const const std::vector<GLuint>& prefilled_tex) const
{ {
#if !defined(USE_GLES2)
//TODO: find a way to add TextureMarix in instanced shaders, //TODO: find a way to add TextureMarix in instanced shaders,
//and remove these four lines //and remove these four lines
renderMeshes2ndPass<DefaultMaterial, 3, 1> (handles, prefilled_tex); renderMeshes2ndPass<DefaultMaterial, 3, 1> (handles, prefilled_tex);
@ -286,6 +299,7 @@ void MultidrawPolicy::drawSolidSecondPass (const DrawCalls& draw_calls,
renderMeshes2ndPass<SplattingMat, 1 > (handles, prefilled_tex); renderMeshes2ndPass<SplattingMat, 1 > (handles, prefilled_tex);
draw_calls.multidrawSolidSecondPass(handles); draw_calls.multidrawSolidSecondPass(handles);
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -294,25 +308,31 @@ void MultidrawPolicy::drawGlow(const DrawCalls& draw_calls,
{ {
#if !defined(USE_GLES2) #if !defined(USE_GLES2)
draw_calls.multidrawGlow(); draw_calls.multidrawGlow();
#endif #endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void MultidrawPolicy::drawNormals(const DrawCalls& draw_calls) const void MultidrawPolicy::drawNormals(const DrawCalls& draw_calls) const
{ {
#if !defined(USE_GLES2)
draw_calls.multidrawNormals(); draw_calls.multidrawNormals();
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void MultidrawPolicy::drawShadows(const DrawCalls& draw_calls, unsigned cascade) const void MultidrawPolicy::drawShadows(const DrawCalls& draw_calls, unsigned cascade) const
{ {
#if !defined(USE_GLES2)
draw_calls.multidrawShadows(cascade); draw_calls.multidrawShadows(cascade);
#endif //!defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void MultidrawPolicy::drawReflectiveShadowMap(const DrawCalls& draw_calls, void MultidrawPolicy::drawReflectiveShadowMap(const DrawCalls& draw_calls,
const core::matrix4 &rsm_matrix) const const core::matrix4 &rsm_matrix) const
{ {
#if !defined(USE_GLES2)
drawRSM<SplattingMat, 1>(rsm_matrix); //TODO: add instanced splatting RSM shader drawRSM<SplattingMat, 1>(rsm_matrix); //TODO: add instanced splatting RSM shader
draw_calls.multidrawReflectiveShadowMaps(rsm_matrix); draw_calls.multidrawReflectiveShadowMaps(rsm_matrix);
#endif //!defined(USE_GLES2)
} }

View File

@ -185,6 +185,7 @@ void AbstractGeometryPasses::setFirstPassRenderTargets(const std::vector<GLuint>
{ {
m_prefilled_textures = prefilled_textures; m_prefilled_textures = prefilled_textures;
#if !defined(USE_GLES2)
if (CVS->isAZDOEnabled()) if (CVS->isAZDOEnabled())
{ {
m_textures_handles.clear(); m_textures_handles.clear();
@ -198,6 +199,7 @@ void AbstractGeometryPasses::setFirstPassRenderTargets(const std::vector<GLuint>
m_textures_handles.push_back(handle); m_textures_handles.push_back(handle);
} }
} }
#endif // !defined(USE_GLES2)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------

View File

@ -554,6 +554,7 @@ void LightingPasses::renderGlobalIllumination( const ShadowMatrices& shadow_mat
GLuint depth_stencil_texture) GLuint depth_stencil_texture)
{ {
//Radiance hints //Radiance hints
#if !defined(USE_GLES2)
ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_RH)); ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_RH));
glDisable(GL_BLEND); glDisable(GL_BLEND);
radiance_hint_framebuffer.bind(); radiance_hint_framebuffer.bind();
@ -592,6 +593,7 @@ void LightingPasses::renderGlobalIllumination( const ShadowMatrices& shadow_mat
irr_driver->getSunColor()); irr_driver->getSunColor());
glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, 32); glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, 32);
} }
#endif //!defined(USE_GLES2)
//Global illumination //Global illumination
{ {