Merging r6073 through r6074 from trunk to ogl-es branch.

The support for UINT shader constants added in this is just returning warnings in GLES drivers as this would need ES 3.0


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6115 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2020-06-11 20:27:29 +00:00
parent cb62c685de
commit 084e0e669a
19 changed files with 276 additions and 37 deletions

View File

@ -608,9 +608,13 @@ bool COpenGLSLMaterialRenderer::setVertexShaderConstant(s32 index, const s32* in
return setPixelShaderConstant(index, ints, count);
}
bool COpenGLSLMaterialRenderer::setVertexShaderConstant(s32 index, const u32* ints, int count)
{
return setPixelShaderConstant(index, ints, count);
}
bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const f32* floats, int count)
{
#ifdef GL_ARB_shader_objects
if(index < 0 || UniformInfo[index].location < 0)
return false;
@ -678,14 +682,10 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const f32* flo
break;
}
return status;
#else
return false;
#endif
}
bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const s32* ints, int count)
{
#ifdef GL_ARB_shader_objects
if(index < 0 || UniformInfo[index].location < 0)
return false;
@ -722,9 +722,34 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const s32* int
break;
}
return status;
#else
return false;
#endif
}
bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const u32* ints, int count)
{
if(index < 0 || UniformInfo[index].location < 0)
return false;
bool status = true;
switch (UniformInfo[index].type)
{
case GL_UNSIGNED_INT:
Driver->extGlUniform1uiv(UniformInfo[index].location, count, reinterpret_cast<const GLuint*>(ints));
break;
case GL_UNSIGNED_INT_VEC2:
Driver->extGlUniform2uiv(UniformInfo[index].location, count/2, reinterpret_cast<const GLuint*>(ints));
break;
case GL_UNSIGNED_INT_VEC3:
Driver->extGlUniform3uiv(UniformInfo[index].location, count/3, reinterpret_cast<const GLuint*>(ints));
break;
case GL_UNSIGNED_INT_VEC4:
Driver->extGlUniform4uiv(UniformInfo[index].location, count/4, reinterpret_cast<const GLuint*>(ints));
break;
default:
status = false;
break;
}
return status;
}
IVideoDriver* COpenGLSLMaterialRenderer::getVideoDriver()