mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-25 02:10:53 +00:00
Some fixes
This commit is contained in:
parent
680f260803
commit
c9a2f9dbfc
7 changed files with 19 additions and 11 deletions
|
@ -1201,7 +1201,7 @@ public:
|
||||||
// Set feature parameters
|
// Set feature parameters
|
||||||
virtual bool setUniformDriver(TProgram program) = 0; // set all driver-specific features params (based on program->features->DriverFlags) (called automatically when rendering with cmaterial and using a user program)
|
virtual bool setUniformDriver(TProgram program) = 0; // set all driver-specific features params (based on program->features->DriverFlags) (called automatically when rendering with cmaterial and using a user program)
|
||||||
virtual bool setUniformMaterial(TProgram program, CMaterial &material) = 0; // set all material-specific feature params (based on program->features->MaterialFlags) (called automatically when rendering with cmaterial and using a user program)
|
virtual bool setUniformMaterial(TProgram program, CMaterial &material) = 0; // set all material-specific feature params (based on program->features->MaterialFlags) (called automatically when rendering with cmaterial and using a user program)
|
||||||
virtual void setUniformParams(TProgram program, const CGPUProgramParams ¶ms) = 0; // set all user-provided params from the storage
|
virtual void setUniformParams(TProgram program, CGPUProgramParams ¶ms) = 0; // set all user-provided params from the storage
|
||||||
// @}
|
// @}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
// The virtual dtor is important.
|
// The virtual dtor is important.
|
||||||
virtual ~IGPUProgramDrvInfos(void);
|
virtual ~IGPUProgramDrvInfos(void);
|
||||||
|
|
||||||
virtual uint getUniformIndex(char *name) const = 0;
|
virtual uint getUniformIndex(const char *name) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NL_GPU_PROGRAM_LIGHTS 8
|
#define NL_GPU_PROGRAM_LIGHTS 8
|
||||||
|
@ -261,7 +261,7 @@ public:
|
||||||
inline void removeSource(size_t i) { nlassert(!m_Source); m_Sources.erase(m_Sources.begin() + i); }
|
inline void removeSource(size_t i) { nlassert(!m_Source); m_Sources.erase(m_Sources.begin() + i); }
|
||||||
|
|
||||||
// Get the idx of a parameter (ogl: uniform, d3d: constant, etcetera) by name. Invalid name returns ~0
|
// Get the idx of a parameter (ogl: uniform, d3d: constant, etcetera) by name. Invalid name returns ~0
|
||||||
inline uint getUniformIndex(char *name) const { return m_DrvInfo->getUniformIndex(name); };
|
inline uint getUniformIndex(const char *name) const { return m_DrvInfo->getUniformIndex(name); };
|
||||||
|
|
||||||
// Get feature information of the current program
|
// Get feature information of the current program
|
||||||
inline CSource *source() const { return m_Source; };
|
inline CSource *source() const { return m_Source; };
|
||||||
|
|
|
@ -309,7 +309,7 @@ public:
|
||||||
CVertexProgamDrvInfosD3D(IDriver *drv, ItGPUPrgDrvInfoPtrList it);
|
CVertexProgamDrvInfosD3D(IDriver *drv, ItGPUPrgDrvInfoPtrList it);
|
||||||
~CVertexProgamDrvInfosD3D();
|
~CVertexProgamDrvInfosD3D();
|
||||||
|
|
||||||
virtual uint getUniformIndex(char *name) const
|
virtual uint getUniformIndex(const char *name) const
|
||||||
{
|
{
|
||||||
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
||||||
if (it != ParamIndices.end()) return it->second;
|
if (it != ParamIndices.end()) return it->second;
|
||||||
|
@ -331,7 +331,7 @@ public:
|
||||||
CPixelProgramDrvInfosD3D(IDriver *drv, ItGPUPrgDrvInfoPtrList it);
|
CPixelProgramDrvInfosD3D(IDriver *drv, ItGPUPrgDrvInfoPtrList it);
|
||||||
~CPixelProgramDrvInfosD3D();
|
~CPixelProgramDrvInfosD3D();
|
||||||
|
|
||||||
virtual uint getUniformIndex(char *name) const
|
virtual uint getUniformIndex(const char *name) const
|
||||||
{
|
{
|
||||||
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
||||||
if (it != ParamIndices.end()) return it->second;
|
if (it != ParamIndices.end()) return it->second;
|
||||||
|
@ -1210,7 +1210,7 @@ public:
|
||||||
// Set feature parameters
|
// Set feature parameters
|
||||||
virtual bool setUniformDriver(TProgram program); // set all driver-specific features params (based on program->features->DriverFlags)
|
virtual bool setUniformDriver(TProgram program); // set all driver-specific features params (based on program->features->DriverFlags)
|
||||||
virtual bool setUniformMaterial(TProgram program, CMaterial &material); // set all material-specific feature params (based on program->features->MaterialFlags)
|
virtual bool setUniformMaterial(TProgram program, CMaterial &material); // set all material-specific feature params (based on program->features->MaterialFlags)
|
||||||
virtual void setUniformParams(TProgram program, const CGPUProgramParams ¶ms); // set all user-provided params from the storage
|
virtual void setUniformParams(TProgram program, CGPUProgramParams ¶ms); // set all user-provided params from the storage
|
||||||
// @}
|
// @}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ bool CDriverD3D::setUniformMaterial(TProgram program, const CMaterial &material)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDriverD3D::setUniformParams(TProgram program, const CGPUProgramParams ¶ms)
|
void CDriverD3D::setUniformParams(TProgram program, CGPUProgramParams ¶ms)
|
||||||
{
|
{
|
||||||
// todo
|
// todo
|
||||||
}
|
}
|
||||||
|
|
|
@ -1417,7 +1417,7 @@ private:
|
||||||
virtual bool setUniformDriver(TProgram program); // set all driver-specific features params (based on program->features->DriverFlags)
|
virtual bool setUniformDriver(TProgram program); // set all driver-specific features params (based on program->features->DriverFlags)
|
||||||
virtual bool setUniformMaterial(TProgram program, CMaterial &material); // set all material-specific feature params (based on program->features->MaterialFlags)
|
virtual bool setUniformMaterial(TProgram program, CMaterial &material); // set all material-specific feature params (based on program->features->MaterialFlags)
|
||||||
bool setUniformMaterialInternal(TProgram program, CMaterial &material); // set all material-specific feature params (based on program->features->MaterialFlags)
|
bool setUniformMaterialInternal(TProgram program, CMaterial &material); // set all material-specific feature params (based on program->features->MaterialFlags)
|
||||||
virtual void setUniformParams(TProgram program, const CGPUProgramParams ¶ms); // set all user-provided params from the storage
|
virtual void setUniformParams(TProgram program, CGPUProgramParams ¶ms); // set all user-provided params from the storage
|
||||||
// @}
|
// @}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1650,7 +1650,7 @@ public:
|
||||||
// The gl id is auto created here.
|
// The gl id is auto created here.
|
||||||
CVertexProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it);
|
CVertexProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it);
|
||||||
|
|
||||||
virtual uint getUniformIndex(char *name) const
|
virtual uint getUniformIndex(const char *name) const
|
||||||
{
|
{
|
||||||
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
||||||
if (it != ParamIndices.end()) return it->second;
|
if (it != ParamIndices.end()) return it->second;
|
||||||
|
@ -1670,7 +1670,7 @@ public:
|
||||||
// The gl id is auto created here.
|
// The gl id is auto created here.
|
||||||
CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it);
|
CPixelProgamDrvInfosGL (CDriverGL *drv, ItGPUPrgDrvInfoPtrList it);
|
||||||
|
|
||||||
virtual uint getUniformIndex(char *name) const
|
virtual uint getUniformIndex(const char *name) const
|
||||||
{
|
{
|
||||||
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
std::map<std::string, uint>::const_iterator it = ParamIndices.find(name);
|
||||||
if (it != ParamIndices.end()) return it->second;
|
if (it != ParamIndices.end()) return it->second;
|
||||||
|
|
|
@ -387,7 +387,7 @@ bool CDriverGL::setUniformMaterialInternal(TProgram program, CMaterial &material
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDriverGL::setUniformParams(TProgram program, const CGPUProgramParams ¶ms)
|
void CDriverGL::setUniformParams(TProgram program, CGPUProgramParams ¶ms)
|
||||||
{
|
{
|
||||||
IGPUProgram *prog = NULL;
|
IGPUProgram *prog = NULL;
|
||||||
switch (program)
|
switch (program)
|
||||||
|
|
|
@ -533,6 +533,14 @@ size_t CGPUProgramParams::getOffset(uint index) const
|
||||||
return m_Map[index];
|
return m_Map[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t CGPUProgramParams::getOffset(const std::string &name) const
|
||||||
|
{
|
||||||
|
std::map<std::string, size_t>::const_iterator it = m_MapName.find(name);
|
||||||
|
if (it == m_MapName.end())
|
||||||
|
return s_End;
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
/// Remove by offset
|
/// Remove by offset
|
||||||
void CGPUProgramParams::freeOffset(size_t offset)
|
void CGPUProgramParams::freeOffset(size_t offset)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue