I need to do two things, possible with GLSL, but not precompiled ARB asm shaders:
-
bindable uniforms:
glUniformBufferEXT is only for GLSL, is there an alternative for ARB? -
uploading a range of program-local uniform data
Right now, what I have is this laggy implementation:
inline void __setUniforms(int target, int start, int numFloats,const float* data){
while(numFloats>=4){
glProgramLocalParameter4fvARB(target,start,data);
start++;
data+=4;
numFloats-=4;
}
if(numFloats<=0)return;
float tmp[4]={0,0,0,0};
float* p=&tmp;
while(numFloats--)*p++ = *data++;
glProgramLocalParameter4fvARB(target,start,tmp);
}
void ilSetUniformsPS(int start,int numBytes,float* data){
__setUniforms(GL_FRAGMENT_PROGRAM_ARB,start,numBytes/4,data);
}
glProgramParametersXXX is marked as global, and is said in the specs to work only with GL_VERTEX_PROGRAM_NV