//! Int interface for the above.\r
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) = 0;\r
\r
+ //! Uint interface for the above.\r
+ /* NOTE: UINT only works with GLSL, not supported for other shaders.\r
+ Also GLES drivers in Irrlicht do not support it as this needs at least GLES 3.0.\r
+ */\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) = 0;\r
+\r
//! Sets a vertex shader constant.\r
/** Can be used if you created a shader using pixel/vertex shader\r
assembler or ARB_fragment_program or ARB_vertex_program.\r
//! Int interface for the above.\r
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) = 0;\r
\r
+ //! Uint interface for the above.\r
+ /* NOTE: UINT only works with GLSL, not supported for other shaders.\r
+ Also GLES drivers in Irrlicht do not support it as this needs at least GLES 3.0.\r
+ */\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) = 0;\r
+\r
//! Sets a pixel shader constant.\r
/** Can be used if you created a shader using pixel/vertex shader\r
assembler or ARB_fragment_program or ARB_vertex_program.\r
}\r
\r
\r
+//! Uint interface for the above.\r
+bool CD3D9Driver::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size())\r
+ {\r
+ CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer;\r
+ return r->setVariable(true, index, ints, count);\r
+ }\r
+\r
+ return false;\r
+}\r
+\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
bool CD3D9Driver::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
{\r
}\r
\r
\r
+//! Uint interface for the above.\r
+bool CD3D9Driver::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ if (Material.MaterialType >= 0 && Material.MaterialType < (s32)MaterialRenderers.size())\r
+ {\r
+ CD3D9MaterialRenderer* r = (CD3D9MaterialRenderer*)MaterialRenderers[Material.MaterialType].Renderer;\r
+ return r->setVariable(false, index, ints, count);\r
+ }\r
+\r
+ return false;\r
+}\r
+\r
+\r
+\r
//! Adds a new material renderer to the VideoDriver, using pixel and/or\r
//! vertex shaders to render geometry.\r
s32 CD3D9Driver::addShaderMaterial(const c8* vertexShaderProgram,\r
//! Int interface for the above.\r
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
\r
//! Int interface for the above.\r
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Returns a pointer to the IVideoDriver interface. (Implementation for\r
//! IMaterialRendererServices)\r
virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_;\r
}\r
\r
\r
+bool CD3D9HLSLMaterialRenderer::setVariable(bool vertexShader, s32 index,\r
+ const u32* ints, int count)\r
+{\r
+ os::Printer::log("Error DirectX 9 does not support unsigned integer constants in shaders.", ELL_ERROR);\r
+ return false;\r
+}\r
+\r
+\r
bool CD3D9HLSLMaterialRenderer::OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype)\r
{\r
if (VSConstantsTable)\r
//! Int interface for the above.\r
virtual bool setVariable(bool vertexShader, s32 index, const s32* ints, int count);\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setVariable(bool vertexShader, s32 index, const u32* ints, int count);\r
+\r
bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) _IRR_OVERRIDE_;\r
\r
protected:\r
return false;\r
}\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setVariable(bool vertexShader, s32 index, const u32* ints, int count)\r
+ {\r
+ os::Printer::log("Invalid material to set variable in.");\r
+ return false;\r
+ }\r
+\r
protected:\r
\r
IDirect3DDevice9* pID3DDevice;\r
//! Sets a constant for the vertex shader based on an index.\r
bool COGLES2Driver::setVertexShaderConstant(s32 index, const f32* floats, int count)\r
{\r
- //pass this along, as in GLSL the same routine is used for both vertex and fragment shaders\r
- return setPixelShaderConstant(index, floats, count);\r
+ os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setVertexShaderConstant().");\r
+ return false;\r
}\r
\r
//! Int interface for the above.\r
bool COGLES2Driver::setVertexShaderConstant(s32 index, const s32* ints, int count)\r
{\r
- return setPixelShaderConstant(index, ints, count);\r
+ os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setVertexShaderConstant().");\r
+ return false;\r
+ }\r
+\r
+ bool COGLES2Driver::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+ {\r
+ os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setVertexShaderConstant().");\r
+ return false;\r
}\r
\r
//! Sets a constant for the pixel shader based on an index.\r
return false;\r
}\r
\r
+ bool COGLES2Driver::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+ {\r
+ os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
+ return false;\r
+ }\r
\r
//! Adds a new material renderer to the VideoDriver, using pixel and/or\r
//! vertex shaders to render geometry.\r
//! Int interface for the above.\r
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
\r
//! Int interface for the above.\r
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Adds a new material renderer to the VideoDriver\r
virtual s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram,\r
IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) _IRR_OVERRIDE_;\r
return setPixelShaderConstant(index, ints, count);\r
}\r
\r
+bool COGLES2MaterialRenderer::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ return setPixelShaderConstant(index, ints, count);\r
+}\r
+\r
bool COGLES2MaterialRenderer::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
{\r
if(index < 0 || UniformInfo[index].location < 0)\r
return status;\r
}\r
\r
+bool COGLES2MaterialRenderer::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ os::Printer::log("Unsigned int support needs at least GLES 3.0", ELL_WARNING);\r
+ return false;\r
+}\r
+\r
IVideoDriver* COGLES2MaterialRenderer::getVideoDriver()\r
{\r
return Driver;\r
\r
namespace irr\r
{\r
-namespace video \r
+namespace video\r
{\r
\r
class COGLES2Driver;\r
public:\r
\r
COGLES2MaterialRenderer(\r
- COGLES2Driver* driver, \r
- s32& outMaterialTypeNr, \r
+ COGLES2Driver* driver,\r
+ s32& outMaterialTypeNr,\r
const c8* vertexShaderProgram = 0,\r
const c8* pixelShaderProgram = 0,\r
IShaderConstantSetCallBack* callback = 0,\r
\r
virtual s32 getRenderCapability() const;\r
\r
- virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates);\r
- \r
- virtual s32 getVertexShaderConstantID(const c8* name);\r
- virtual s32 getPixelShaderConstantID(const c8* name);\r
- virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1);\r
- virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1);\r
- virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count);\r
- virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count);\r
- virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count);\r
- virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count);\r
+ virtual void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) _IRR_OVERRIDE_;\r
\r
- virtual IVideoDriver* getVideoDriver();\r
+ virtual s32 getVertexShaderConstantID(const c8* name) _IRR_OVERRIDE_;\r
+ virtual s32 getPixelShaderConstantID(const c8* name) _IRR_OVERRIDE_;\r
+ virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_;\r
+ virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_;\r
+ virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
+ virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+ virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
+ virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
+ virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_;\r
\r
protected:\r
\r
\r
bool createShader(GLenum shaderType, const char* shader);\r
bool linkProgram();\r
- \r
+\r
COGLES2Driver* Driver;\r
IShaderConstantSetCallBack* CallBack;\r
\r
return setPixelShaderConstant(index, ints, count);\r
}\r
\r
+bool COGLES1Driver::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ return setPixelShaderConstant(index, ints, count);\r
+}\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
bool COGLES1Driver::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
{\r
return false;\r
}\r
\r
+bool COGLES1Driver::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ os::Printer::log("Error: Please use IMaterialRendererServices from IShaderConstantSetCallBack::OnSetConstants not VideoDriver->setPixelShaderConstant().");\r
+ return false;\r
+}\r
+\r
//! Sets a vertex shader constant.\r
void COGLES1Driver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
{\r
//! Int interface for the above.\r
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
\r
//! Int interface for the above.\r
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Sets a vertex shader constant.\r
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_;\r
\r
//! Sets a vertex shader constant.\r
void COpenGLDriver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
{\r
-#ifdef GL_ARB_vertex_program\r
for (s32 i=0; i<constantAmount; ++i)\r
extGlProgramLocalParameter4fv(GL_VERTEX_PROGRAM_ARB, startRegister+i, &data[i*4]);\r
-#endif\r
}\r
\r
//! Sets a pixel shader constant.\r
void COpenGLDriver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)\r
{\r
-#ifdef GL_ARB_fragment_program\r
for (s32 i=0; i<constantAmount; ++i)\r
extGlProgramLocalParameter4fv(GL_FRAGMENT_PROGRAM_ARB, startRegister+i, &data[i*4]);\r
-#endif\r
}\r
\r
//! Sets a constant for the vertex shader based on an index.\r
return setPixelShaderConstant(index, ints, count);\r
}\r
\r
+//! Uint interface for the above.\r
+bool COpenGLDriver::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ return setPixelShaderConstant(index, ints, count);\r
+}\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
bool COpenGLDriver::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
{\r
return false;\r
}\r
\r
+bool COpenGLDriver::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant().");\r
+ return false;\r
+}\r
+\r
\r
//! Adds a new material renderer to the VideoDriver, using pixel and/or\r
//! vertex shaders to render geometry.\r
//! Int interface for the above.\r
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! Sets a constant for the pixel shader based on an index.\r
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
\r
//! Int interface for the above.\r
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
\r
+ //! Uint interface for the above.\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
+\r
//! disables all textures beginning with the optional fromStage parameter. Otherwise all texture stages are disabled.\r
//! Returns whether disabling was successful or not.\r
bool disableTextures(u32 fromStage=0);\r
pGlGetUniformLocationARB(0), pGlGetUniformLocation(0),\r
pGlUniform1fvARB(0), pGlUniform2fvARB(0), pGlUniform3fvARB(0), pGlUniform4fvARB(0),\r
pGlUniform1ivARB(0), pGlUniform2ivARB(0), pGlUniform3ivARB(0), pGlUniform4ivARB(0),\r
+ pGlUniform1uiv(0), pGlUniform2uiv(0), pGlUniform3uiv(0), pGlUniform4uiv(0),\r
pGlUniformMatrix2fvARB(0), pGlUniformMatrix2x3fv(0), pGlUniformMatrix2x4fv(0),\r
pGlUniformMatrix3x2fv(0), pGlUniformMatrix3fvARB(0), pGlUniformMatrix3x4fv(0),\r
pGlUniformMatrix4x2fv(0), pGlUniformMatrix4x3fv(0), pGlUniformMatrix4fvARB(0),\r
pGlBlendEquationIndexedAMD(0), pGlBlendEquationiARB(0), pGlBlendEquationSeparateIndexedAMD(0), pGlBlendEquationSeparateiARB(0),\r
// DSA\r
pGlTextureStorage2D(0), pGlTextureStorage3D(0), pGlTextureSubImage2D(0), pGlGetTextureImage(0), pGlNamedFramebufferTexture(0),\r
- pGlTextureParameteri(0), pGlCreateTextures(0), pGlCreateFramebuffers(0), pGlBindTextures(0), pGlGenerateTextureMipmap(0),\r
+ pGlTextureParameteri(0), pGlTextureParameterf(0), pGlTextureParameteriv(0), pGlTextureParameterfv(0),\r
+ pGlCreateTextures(0), pGlCreateFramebuffers(0), pGlBindTextures(0), pGlGenerateTextureMipmap(0),\r
// DSA with EXT or functions to simulate it\r
pGlTextureStorage2DEXT(0), pGlTexStorage2D(0), pGlTextureStorage3DEXT(0), pGlTexStorage3D(0), pGlTextureSubImage2DEXT(0), pGlGetTextureImageEXT(0),\r
pGlNamedFramebufferTextureEXT(0), pGlFramebufferTexture(0), pGlGenerateTextureMipmapEXT(0)\r
pGlUniform2ivARB = (PFNGLUNIFORM2IVARBPROC) IRR_OGL_LOAD_EXTENSION("glUniform2ivARB");\r
pGlUniform3ivARB = (PFNGLUNIFORM3IVARBPROC) IRR_OGL_LOAD_EXTENSION("glUniform3ivARB");\r
pGlUniform4ivARB = (PFNGLUNIFORM4IVARBPROC) IRR_OGL_LOAD_EXTENSION("glUniform4ivARB");\r
+ pGlUniform1uiv = (PFNGLUNIFORM1UIVPROC) IRR_OGL_LOAD_EXTENSION("glUniform1uiv");\r
+ pGlUniform2uiv = (PFNGLUNIFORM2UIVPROC) IRR_OGL_LOAD_EXTENSION("glUniform2uiv");\r
+ pGlUniform3uiv = (PFNGLUNIFORM3UIVPROC) IRR_OGL_LOAD_EXTENSION("glUniform3uiv");\r
+ pGlUniform4uiv = (PFNGLUNIFORM4UIVPROC) IRR_OGL_LOAD_EXTENSION("glUniform4uiv");\r
pGlUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC) IRR_OGL_LOAD_EXTENSION("glUniformMatrix2fvARB");\r
pGlUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC) IRR_OGL_LOAD_EXTENSION("glUniformMatrix2x3fv");\r
pGlUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)IRR_OGL_LOAD_EXTENSION("glUniformMatrix2x4fv");\r
pGlGetTextureImage = (PFNGLGETTEXTUREIMAGEPROC)IRR_OGL_LOAD_EXTENSION("glGetTextureImage");\r
pGlNamedFramebufferTexture = (PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) IRR_OGL_LOAD_EXTENSION("glNamedFramebufferTexture");\r
pGlTextureParameteri = (PFNGLTEXTUREPARAMETERIPROC) IRR_OGL_LOAD_EXTENSION("glTextureParameteri");\r
+ pGlTextureParameterf = (PFNGLTEXTUREPARAMETERFPROC)IRR_OGL_LOAD_EXTENSION("glTextureParameterf");\r
+ pGlTextureParameteriv = (PFNGLTEXTUREPARAMETERIVPROC)IRR_OGL_LOAD_EXTENSION("glTextureParameteriv");\r
+ pGlTextureParameterfv = (PFNGLTEXTUREPARAMETERFVPROC)IRR_OGL_LOAD_EXTENSION("glTextureParameterfv");\r
+\r
pGlCreateTextures = (PFNGLCREATETEXTURESPROC) IRR_OGL_LOAD_EXTENSION("glCreateTextures");\r
pGlCreateFramebuffers = (PFNGLCREATEFRAMEBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glCreateFramebuffers");\r
pGlBindTextures = (PFNGLBINDTEXTURESPROC) IRR_OGL_LOAD_EXTENSION("glBindTextures");\r
void extGlUniform2iv(GLint loc, GLsizei count, const GLint *v);\r
void extGlUniform3iv(GLint loc, GLsizei count, const GLint *v);\r
void extGlUniform4iv(GLint loc, GLsizei count, const GLint *v);\r
+ void extGlUniform1uiv(GLint loc, GLsizei count, const GLuint *v);\r
+ void extGlUniform2uiv(GLint loc, GLsizei count, const GLuint *v);\r
+ void extGlUniform3uiv(GLint loc, GLsizei count, const GLuint *v);\r
+ void extGlUniform4uiv(GLint loc, GLsizei count, const GLuint *v);\r
void extGlUniformMatrix2fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v);\r
void extGlUniformMatrix2x3fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v);\r
void extGlUniformMatrix2x4fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v);\r
void extGlGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels);\r
void extGlNamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);\r
void extGlTextureParameteri(GLuint texture, GLenum pname, GLint param);\r
+ void extGlTextureParameterf(GLuint texture, GLenum pname, GLfloat param);\r
+ void extGlTextureParameteriv(GLuint texture, GLenum pname, const GLint* params);\r
+ void extGlTextureParameterfv(GLuint texture, GLenum pname, const GLfloat* params);\r
void extGlCreateTextures(GLenum target, GLsizei n, GLuint* textures);\r
void extGlCreateFramebuffers(GLsizei n, GLuint* framebuffers);\r
void extGlBindTextures(GLuint first, GLsizei count, const GLuint *textures, const GLenum* targets);\r
PFNGLUNIFORM2IVARBPROC pGlUniform2ivARB;\r
PFNGLUNIFORM3IVARBPROC pGlUniform3ivARB;\r
PFNGLUNIFORM4IVARBPROC pGlUniform4ivARB;\r
+ PFNGLUNIFORM1UIVPROC pGlUniform1uiv;\r
+ PFNGLUNIFORM2UIVPROC pGlUniform2uiv;\r
+ PFNGLUNIFORM3UIVPROC pGlUniform3uiv;\r
+ PFNGLUNIFORM4UIVPROC pGlUniform4uiv;\r
PFNGLUNIFORMMATRIX2FVARBPROC pGlUniformMatrix2fvARB;\r
PFNGLUNIFORMMATRIX2X3FVPROC pGlUniformMatrix2x3fv;\r
PFNGLUNIFORMMATRIX2X4FVPROC pGlUniformMatrix2x4fv;\r
PFNGLGETTEXTUREIMAGEPROC pGlGetTextureImage;\r
PFNGLNAMEDFRAMEBUFFERTEXTUREPROC pGlNamedFramebufferTexture;\r
PFNGLTEXTUREPARAMETERIPROC pGlTextureParameteri;\r
+ PFNGLTEXTUREPARAMETERFPROC pGlTextureParameterf;\r
+ PFNGLTEXTUREPARAMETERIVPROC pGlTextureParameteriv;\r
+ PFNGLTEXTUREPARAMETERFVPROC pGlTextureParameterfv;\r
+\r
PFNGLCREATETEXTURESPROC pGlCreateTextures;\r
PFNGLCREATEFRAMEBUFFERSPROC pGlCreateFramebuffers;\r
PFNGLBINDTEXTURESPROC pGlBindTextures;\r
#endif\r
}\r
\r
+inline void COpenGLExtensionHandler::extGlUniform1uiv(GLint loc, GLsizei count, const GLuint *v)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlUniform1uiv)\r
+ pGlUniform1uiv(loc, count, v);\r
+#else\r
+ glUniform1uiv(loc, count, v);\r
+#endif\r
+}\r
+\r
+inline void COpenGLExtensionHandler::extGlUniform2uiv(GLint loc, GLsizei count, const GLuint *v)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlUniform2uiv)\r
+ pGlUniform2uiv(loc, count, v);\r
+#else\r
+ glUniform2uiv(loc, count, v);\r
+#endif\r
+}\r
+\r
+inline void COpenGLExtensionHandler::extGlUniform3uiv(GLint loc, GLsizei count, const GLuint *v)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlUniform3uiv)\r
+ pGlUniform3uiv(loc, count, v);\r
+#else\r
+ glUniform3uiv(loc, count, v);\r
+#endif\r
+}\r
+\r
+inline void COpenGLExtensionHandler::extGlUniform4uiv(GLint loc, GLsizei count, const GLuint *v)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlUniform4uiv)\r
+ pGlUniform4uiv(loc, count, v);\r
+#else\r
+ glUniform4uiv(loc, count, v);\r
+#endif\r
+}\r
+\r
inline void COpenGLExtensionHandler::extGlUniform1iv(GLint loc, GLsizei count, const GLint *v)\r
{\r
#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
if (pGlTextureParameteri)\r
pGlTextureParameteri(texture, pname, param);\r
-#else\r
- // TODO\r
+#endif//_IRR_OPENGL_USE_EXTPOINTER_\r
+}\r
+\r
+inline void COpenGLExtensionHandler::extGlTextureParameterf(GLuint texture, GLenum pname, GLfloat param)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlTextureParameterf)\r
+ pGlTextureParameterf(texture, pname, param);\r
+#endif//_IRR_OPENGL_USE_EXTPOINTER_\r
+}\r
+\r
+inline void COpenGLExtensionHandler::extGlTextureParameteriv(GLuint texture, GLenum pname, const GLint* params)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlTextureParameteriv)\r
+ pGlTextureParameteriv(texture, pname, params);\r
+#endif//_IRR_OPENGL_USE_EXTPOINTER_\r
+}\r
+\r
+inline void COpenGLExtensionHandler::extGlTextureParameterfv(GLuint texture, GLenum pname, const GLfloat* params)\r
+{\r
+#ifdef _IRR_OPENGL_USE_EXTPOINTER_\r
+ if (pGlTextureParameterfv)\r
+ pGlTextureParameterfv(texture, pname, params);\r
#endif//_IRR_OPENGL_USE_EXTPOINTER_\r
}\r
\r
return setPixelShaderConstant(index, ints, count);\r
}\r
\r
+bool COpenGLSLMaterialRenderer::setVertexShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ return setPixelShaderConstant(index, ints, count);\r
+}\r
+\r
bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const f32* floats, int count)\r
{\r
-#ifdef GL_ARB_shader_objects\r
if(index < 0 || UniformInfo[index].location < 0)\r
return false;\r
\r
break;\r
}\r
return status;\r
-#else\r
- return false;\r
-#endif\r
}\r
\r
bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const s32* ints, int count)\r
{\r
-#ifdef GL_ARB_shader_objects\r
if(index < 0 || UniformInfo[index].location < 0)\r
return false;\r
\r
break;\r
}\r
return status;\r
-#else\r
- return false;\r
-#endif\r
+}\r
+\r
+bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const u32* ints, int count)\r
+{\r
+ if(index < 0 || UniformInfo[index].location < 0)\r
+ return false;\r
+\r
+ bool status = true;\r
+\r
+ switch (UniformInfo[index].type)\r
+ {\r
+ case GL_UNSIGNED_INT:\r
+ Driver->extGlUniform1uiv(UniformInfo[index].location, count, reinterpret_cast<const GLuint*>(ints));\r
+ break;\r
+ case GL_UNSIGNED_INT_VEC2:\r
+ Driver->extGlUniform2uiv(UniformInfo[index].location, count/2, reinterpret_cast<const GLuint*>(ints));\r
+ break;\r
+ case GL_UNSIGNED_INT_VEC3:\r
+ Driver->extGlUniform3uiv(UniformInfo[index].location, count/3, reinterpret_cast<const GLuint*>(ints));\r
+ break;\r
+ case GL_UNSIGNED_INT_VEC4:\r
+ Driver->extGlUniform4uiv(UniformInfo[index].location, count/4, reinterpret_cast<const GLuint*>(ints));\r
+ break;\r
+ default:\r
+ status = false;\r
+ break;\r
+ }\r
+ return status;\r
}\r
\r
IVideoDriver* COpenGLSLMaterialRenderer::getVideoDriver()\r
virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) _IRR_OVERRIDE_;\r
virtual bool setVertexShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
+ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
virtual bool setPixelShaderConstant(s32 index, const f32* floats, int count) _IRR_OVERRIDE_;\r
virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) _IRR_OVERRIDE_;\r
+ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) _IRR_OVERRIDE_;\r
virtual IVideoDriver* getVideoDriver() _IRR_OVERRIDE_;\r
\r
protected:\r
-Tests finished. 72 tests of 72 passed.
-Compiled as DEBUG
-Test suite pass at GMT Fri Jan 3 17:05:41 2020
-
+Tests finished. 72 tests of 72 passed.\r
+Compiled as DEBUG\r
+Test suite pass at GMT Mon Feb 10 14:59:56 2020\r
+\r