Drop low-level shader constant setters

These don't work on the modern drivers and are unused anyway.
This commit is contained in:
sfan5 2024-02-20 20:51:01 +01:00
parent 4e9d0db4be
commit 92252f70d2
15 changed files with 0 additions and 139 deletions

View File

@ -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;

View File

@ -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)
{

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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; i<constantAmount; ++i)
extGlProgramLocalParameter4fv(GL_VERTEX_PROGRAM, startRegister+i, &data[i*4]);
#endif
}
//! Sets a pixel shader constant.
void COGLES1Driver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)
{
#ifdef GL_fragment_program
for (s32 i=0; i<constantAmount; ++i)
extGlProgramLocalParameter4fv(GL_FRAGMENT_PROGRAM, startRegister+i, &data[i*4]);
#endif
}
//! Adds a new material renderer to the VideoDriver, using pixel and/or
//! vertex shaders to render geometry.
s32 COGLES1Driver::addShaderMaterial(const c8* vertexShaderProgram,

View File

@ -201,12 +201,6 @@ namespace video
//! Uint interface for the above.
bool setPixelShaderConstant(s32 index, const u32* ints, int count) 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;
//! Adds a new material renderer to the VideoDriver
virtual s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram,
IShaderConstantSetCallBack* callback, E_MATERIAL_TYPE baseMaterial, s32 userData) override;

View File

@ -3384,20 +3384,6 @@ s32 COpenGLDriver::getPixelShaderConstantID(const c8* name)
return -1;
}
//! Sets a vertex shader constant.
void COpenGLDriver::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)
{
for (s32 i=0; i<constantAmount; ++i)
extGlProgramLocalParameter4fv(GL_VERTEX_PROGRAM_ARB, startRegister+i, &data[i*4]);
}
//! Sets a pixel shader constant.
void COpenGLDriver::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)
{
for (s32 i=0; i<constantAmount; ++i)
extGlProgramLocalParameter4fv(GL_FRAGMENT_PROGRAM_ARB, startRegister+i, &data[i*4]);
}
//! Sets a constant for the vertex shader based on an index.
bool COpenGLDriver::setVertexShaderConstant(s32 index, const f32* floats, int count)
{

View File

@ -259,12 +259,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;

View File

@ -571,16 +571,6 @@ s32 COpenGLSLMaterialRenderer::getPixelShaderConstantID(const c8* name)
return -1;
}
void COpenGLSLMaterialRenderer::setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)
{
os::Printer::log("Cannot set constant, please use high level shader call instead.", ELL_WARNING);
}
void COpenGLSLMaterialRenderer::setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount)
{
os::Printer::log("Cannot set constant, use high level shader call.", ELL_WARNING);
}
bool COpenGLSLMaterialRenderer::setVertexShaderConstant(s32 index, const f32* floats, int count)
{
return setPixelShaderConstant(index, floats, count);

View File

@ -72,8 +72,6 @@ public:
void setBasicRenderStates(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates) override;
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;

View File

@ -1699,18 +1699,6 @@ COpenGL3DriverBase::~COpenGL3DriverBase()
return -1;
}
//! Sets a vertex shader constant.
void COpenGL3DriverBase::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 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)
{

View File

@ -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;

View File

@ -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);

View File

@ -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;