mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +02:00
Better sampler handling
This commit is contained in:
parent
fe5c511eeb
commit
0d89b3a922
2 changed files with 2 additions and 14 deletions
|
@ -171,14 +171,8 @@ void GL45Texture::syncSampler() const {
|
|||
glTextureParameteri(_id, GL_TEXTURE_WRAP_R, WRAP_MODES[sampler.getWrapModeW()]);
|
||||
glTextureParameterf(_id, GL_TEXTURE_MAX_ANISOTROPY_EXT, sampler.getMaxAnisotropy());
|
||||
glTextureParameterfv(_id, GL_TEXTURE_BORDER_COLOR, (const float*)&sampler.getBorderColor());
|
||||
|
||||
#if 0
|
||||
// FIXME account for mip offsets here
|
||||
auto baseMip = std::max<uint16_t>(sampler.getMipOffset(), _minMip);
|
||||
glTextureParameteri(_id, GL_TEXTURE_BASE_LEVEL, baseMip);
|
||||
glTextureParameterf(_id, GL_TEXTURE_MIN_LOD, (float)sampler.getMinMip());
|
||||
glTextureParameterf(_id, GL_TEXTURE_MAX_LOD, (sampler.getMaxMip() == Sampler::MAX_MIP_LEVEL ? 1000.f : sampler.getMaxMip() - _mipOffset));
|
||||
#endif
|
||||
glTextureParameterf(_id, GL_TEXTURE_MIN_LOD, sampler.getMinMip());
|
||||
glTextureParameterf(_id, GL_TEXTURE_MAX_LOD, (sampler.getMaxMip() == Sampler::MAX_MIP_LEVEL ? 1000.f : sampler.getMaxMip()));
|
||||
}
|
||||
|
||||
using GL45FixedAllocationTexture = GL45Backend::GL45FixedAllocationTexture;
|
||||
|
|
|
@ -370,13 +370,7 @@ void GL45ResourceTexture::copyMipsFromTexture() {
|
|||
|
||||
void GL45ResourceTexture::syncSampler() const {
|
||||
Parent::syncSampler();
|
||||
const Sampler& sampler = _gpuObject.getSampler();
|
||||
uint16_t maxMip = _gpuObject.evalNumMips() - _allocatedMip;
|
||||
auto minMip = std::max<uint16_t>(sampler.getMipOffset(), sampler.getMinMip());
|
||||
minMip = std::min<uint16_t>(minMip, maxMip);
|
||||
glTextureParameteri(_id, GL_TEXTURE_BASE_LEVEL, _populatedMip - _allocatedMip);
|
||||
glTextureParameterf(_id, GL_TEXTURE_MIN_LOD, (float)minMip);
|
||||
glTextureParameterf(_id, GL_TEXTURE_MAX_LOD, (float)maxMip);
|
||||
}
|
||||
|
||||
void GL45ResourceTexture::promote() {
|
||||
|
|
Loading…
Reference in a new issue