little fixes

This commit is contained in:
aap 2021-08-17 13:14:37 +02:00
parent 4c4b199057
commit dfe8d1f115
2 changed files with 8 additions and 3 deletions

View File

@ -526,7 +526,7 @@ setFilterMode(uint32 stage, int32 filter, int32 maxAniso = 1)
setActiveTexture(stage); setActiveTexture(stage);
if(natras->autogenMipmap || natras->numLevels > 1){ if(natras->autogenMipmap || natras->numLevels > 1){
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_MIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
}else{ }else{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
@ -627,7 +627,7 @@ setRasterStage(uint32 stage, Raster *raster)
if(natras->filterMode != filter){ if(natras->filterMode != filter){
if(natras->autogenMipmap || natras->numLevels > 1){ if(natras->autogenMipmap || natras->numLevels > 1){
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_MIP[filter]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_MIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);
}else{ }else{
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterConvMap_NoMIP[filter]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterConvMap_NoMIP[filter]);

View File

@ -45,7 +45,12 @@ registerUniform(const char *name, UniformType type, int32 num)
{ {
int i; int i;
i = findUniform(name); i = findUniform(name);
if(i >= 0) return i; if(i >= 0){
Uniform *u = &uniformRegistry.uniforms[i];
assert(u->type == type);
assert(u->num == num);
return i;
}
// TODO: print error // TODO: print error
if(uniformRegistry.numUniforms+1 >= MAX_UNIFORMS){ if(uniformRegistry.numUniforms+1 >= MAX_UNIFORMS){
assert(0 && "no space for uniform"); assert(0 && "no space for uniform");