From 92252f70d249effc1230c9ad88cb550fe561f587 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Tue, 20 Feb 2024 20:51:01 +0100 Subject: [PATCH] Drop low-level shader constant setters These don't work on the modern drivers and are unused anyway. --- include/IMaterialRendererServices.h | 22 ------------------- source/Irrlicht/COGLES2Driver.cpp | 12 ---------- source/Irrlicht/COGLES2Driver.h | 6 ----- source/Irrlicht/COGLES2MaterialRenderer.cpp | 10 --------- source/Irrlicht/COGLES2MaterialRenderer.h | 2 -- source/Irrlicht/COGLESDriver.cpp | 19 ---------------- source/Irrlicht/COGLESDriver.h | 6 ----- source/Irrlicht/COpenGLDriver.cpp | 14 ------------ source/Irrlicht/COpenGLDriver.h | 6 ----- source/Irrlicht/COpenGLSLMaterialRenderer.cpp | 10 --------- source/Irrlicht/COpenGLSLMaterialRenderer.h | 2 -- source/Irrlicht/OpenGL/Driver.cpp | 12 ---------- source/Irrlicht/OpenGL/Driver.h | 6 ----- source/Irrlicht/OpenGL/MaterialRenderer.cpp | 10 --------- source/Irrlicht/OpenGL/MaterialRenderer.h | 2 -- 15 files changed, 139 deletions(-) diff --git a/include/IMaterialRendererServices.h b/include/IMaterialRendererServices.h index cbc1818..94251f0 100644 --- a/include/IMaterialRendererServices.h +++ b/include/IMaterialRendererServices.h @@ -53,19 +53,8 @@ public: virtual bool setVertexShaderConstant(s32 index, const s32* ints, int count) = 0; //! Uint interface for the above. - /* NOTE: UINT only works with GLSL, not supported for other shaders. - Also GLES drivers in Irrlicht do not support it as this needs at least GLES 3.0. - */ virtual bool setVertexShaderConstant(s32 index, const u32* ints, int count) = 0; - //! Sets a vertex shader constant. - /** Can be used if you created a shader using pixel/vertex shader - assembler or ARB_fragment_program or ARB_vertex_program. - \param data: Data to be set in the constants - \param startRegister: First register to be set - \param constantAmount: Amount of registers to be set. One register consists of 4 floats. */ - virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0; - //! Return an index constant for the pixel shader for the given uniform variable name virtual s32 getPixelShaderConstantID(const c8* name) = 0; @@ -83,19 +72,8 @@ public: virtual bool setPixelShaderConstant(s32 index, const s32* ints, int count) = 0; //! Uint interface for the above. - /* NOTE: UINT only works with GLSL, not supported for other shaders. - Also GLES drivers in Irrlicht do not support it as this needs at least GLES 3.0. - */ virtual bool setPixelShaderConstant(s32 index, const u32* ints, int count) = 0; - //! Sets a pixel shader constant. - /** Can be used if you created a shader using pixel/vertex shader - assembler or ARB_fragment_program or ARB_vertex_program. - \param data Data to be set in the constants - \param startRegister First register to be set. - \param constantAmount Amount of registers to be set. One register consists of 4 floats. */ - virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0; - //! Get pointer to the IVideoDriver interface /** \return Pointer to the IVideoDriver interface */ virtual IVideoDriver* getVideoDriver() = 0; diff --git a/source/Irrlicht/COGLES2Driver.cpp b/source/Irrlicht/COGLES2Driver.cpp index 9ee7c6b..1ff8734 100644 --- a/source/Irrlicht/COGLES2Driver.cpp +++ b/source/Irrlicht/COGLES2Driver.cpp @@ -2062,18 +2062,6 @@ COGLES2Driver::~COGLES2Driver() return -1; } - //! Sets a vertex shader constant. - void COGLES2Driver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) - { - os::Printer::log("Error: Please call services->setVertexShaderConstant(), not VideoDriver->setPixelShaderConstant()."); - } - - //! Sets a pixel shader constant. - void COGLES2Driver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) - { - os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant()."); - } - //! Sets a constant for the vertex shader based on an index. bool COGLES2Driver::setVertexShaderConstant(s32 index, const f32* floats, int count) { diff --git a/source/Irrlicht/COGLES2Driver.h b/source/Irrlicht/COGLES2Driver.h index 40cb9a1..c32dbe4 100644 --- a/source/Irrlicht/COGLES2Driver.h +++ b/source/Irrlicht/COGLES2Driver.h @@ -187,12 +187,6 @@ namespace video //! Get a pixel shader constant index. s32 getPixelShaderConstantID(const c8* name) override; - //! Sets a vertex shader constant. - void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) override; - - //! Sets a pixel shader constant. - void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) override; - //! Sets a constant for the vertex shader based on an index. bool setVertexShaderConstant(s32 index, const f32* floats, int count) override; diff --git a/source/Irrlicht/COGLES2MaterialRenderer.cpp b/source/Irrlicht/COGLES2MaterialRenderer.cpp index 7da38a1..fa956b2 100644 --- a/source/Irrlicht/COGLES2MaterialRenderer.cpp +++ b/source/Irrlicht/COGLES2MaterialRenderer.cpp @@ -345,16 +345,6 @@ s32 COGLES2MaterialRenderer::getPixelShaderConstantID(const c8* name) return -1; } -void COGLES2MaterialRenderer::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - os::Printer::log("Cannot set constant, please use high level shader call instead.", ELL_WARNING); -} - -void COGLES2MaterialRenderer::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - os::Printer::log("Cannot set constant, use high level shader call.", ELL_WARNING); -} - bool COGLES2MaterialRenderer::setVertexShaderConstant(s32 index, const f32* floats, int count) { return setPixelShaderConstant(index, floats, count); diff --git a/source/Irrlicht/COGLES2MaterialRenderer.h b/source/Irrlicht/COGLES2MaterialRenderer.h index 6a049cb..d0f2cfd 100644 --- a/source/Irrlicht/COGLES2MaterialRenderer.h +++ b/source/Irrlicht/COGLES2MaterialRenderer.h @@ -54,8 +54,6 @@ public: s32 getVertexShaderConstantID(const c8* name) override; s32 getPixelShaderConstantID(const c8* name) override; - void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override; - void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override; bool setVertexShaderConstant(s32 index, const f32* floats, int count) override; bool setVertexShaderConstant(s32 index, const s32* ints, int count) override; bool setVertexShaderConstant(s32 index, const u32* ints, int count) override; diff --git a/source/Irrlicht/COGLESDriver.cpp b/source/Irrlicht/COGLESDriver.cpp index e52fdbb..4ba33b9 100644 --- a/source/Irrlicht/COGLESDriver.cpp +++ b/source/Irrlicht/COGLESDriver.cpp @@ -2374,25 +2374,6 @@ bool COGLES1Driver::setPixelShaderConstant(s32 index, const u32* ints, int count return false; } -//! Sets a vertex shader constant. -void COGLES1Driver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ -#ifdef GL_vertex_program - for (s32 i=0; isetVertexShaderConstant(), not VideoDriver->setPixelShaderConstant()."); - } - - //! Sets a pixel shader constant. - void COpenGL3DriverBase::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) - { - os::Printer::log("Error: Please call services->setPixelShaderConstant(), not VideoDriver->setPixelShaderConstant()."); - } - //! Sets a constant for the vertex shader based on an index. bool COpenGL3DriverBase::setVertexShaderConstant(s32 index, const f32* floats, int count) { diff --git a/source/Irrlicht/OpenGL/Driver.h b/source/Irrlicht/OpenGL/Driver.h index b15890d..1d0fe60 100644 --- a/source/Irrlicht/OpenGL/Driver.h +++ b/source/Irrlicht/OpenGL/Driver.h @@ -168,12 +168,6 @@ namespace video //! Get a pixel shader constant index. s32 getPixelShaderConstantID(const c8* name) override; - //! Sets a vertex shader constant. - void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) override; - - //! Sets a pixel shader constant. - void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount = 1) override; - //! Sets a constant for the vertex shader based on an index. bool setVertexShaderConstant(s32 index, const f32* floats, int count) override; diff --git a/source/Irrlicht/OpenGL/MaterialRenderer.cpp b/source/Irrlicht/OpenGL/MaterialRenderer.cpp index a2a114b..3eec62f 100644 --- a/source/Irrlicht/OpenGL/MaterialRenderer.cpp +++ b/source/Irrlicht/OpenGL/MaterialRenderer.cpp @@ -343,16 +343,6 @@ s32 COpenGL3MaterialRenderer::getPixelShaderConstantID(const c8* name) return -1; } -void COpenGL3MaterialRenderer::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - os::Printer::log("Cannot set constant, please use high level shader call instead.", ELL_WARNING); -} - -void COpenGL3MaterialRenderer::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount) -{ - os::Printer::log("Cannot set constant, use high level shader call.", ELL_WARNING); -} - bool COpenGL3MaterialRenderer::setVertexShaderConstant(s32 index, const f32* floats, int count) { return setPixelShaderConstant(index, floats, count); diff --git a/source/Irrlicht/OpenGL/MaterialRenderer.h b/source/Irrlicht/OpenGL/MaterialRenderer.h index 5690ae6..0d4b550 100644 --- a/source/Irrlicht/OpenGL/MaterialRenderer.h +++ b/source/Irrlicht/OpenGL/MaterialRenderer.h @@ -52,8 +52,6 @@ public: s32 getVertexShaderConstantID(const c8* name) override; s32 getPixelShaderConstantID(const c8* name) override; - void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override; - void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) override; bool setVertexShaderConstant(s32 index, const f32* floats, int count) override; bool setVertexShaderConstant(s32 index, const s32* ints, int count) override; bool setVertexShaderConstant(s32 index, const u32* ints, int count) override;