Renderer: Fix BuildMipmaps
This commit is contained in:
committed by
Jérôme Leclercq
parent
4db5b59ec9
commit
dee47c6f15
@@ -38,7 +38,7 @@ namespace Nz
|
||||
|
||||
void BlitTexture(const Texture& fromTexture, const Boxui& fromBox, TextureLayout fromLayout, const Texture& toTexture, const Boxui& toBox, TextureLayout toLayout, SamplerFilter filter) override;
|
||||
|
||||
void BuildMipmaps(Texture& texture, UInt8 baseLevel, UInt8 maxLevel) override;
|
||||
void BuildMipmaps(Texture& texture, UInt8 baseLevel, UInt8 levelCount, PipelineStageFlags srcStageMask, PipelineStageFlags dstStageMask, MemoryAccessFlags srcAccessMask, MemoryAccessFlags dstAccessMask, TextureLayout oldLayout, TextureLayout newLayout) override;
|
||||
|
||||
void CopyBuffer(const RenderBufferView& source, const RenderBufferView& target, UInt64 size, UInt64 sourceOffset = 0, UInt64 targetOffset = 0) override;
|
||||
void CopyBuffer(const UploadPool::Allocation& allocation, const RenderBufferView& target, UInt64 size, UInt64 sourceOffset = 0, UInt64 targetOffset = 0) override;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Nz
|
||||
{
|
||||
inline void OpenGLTexture::GenerateMipmaps(UInt8 baseLevel, UInt8 levelCount)
|
||||
{
|
||||
NazaraAssert(baseLevel + levelCount < m_textureInfo.levelCount, "out of bounds");
|
||||
NazaraAssert(baseLevel + levelCount <= m_textureInfo.levelCount, "out of bounds");
|
||||
|
||||
GL::Texture* targetTexture;
|
||||
if (RequiresTextureViewEmulation())
|
||||
@@ -26,7 +26,7 @@ namespace Nz
|
||||
targetTexture->SetParameteri(GL_TEXTURE_BASE_LEVEL, baseLevel);
|
||||
|
||||
if (levelCount != m_textureInfo.levelCount)
|
||||
targetTexture->SetParameteri(GL_TEXTURE_MAX_LEVEL, levelCount);
|
||||
targetTexture->SetParameteri(GL_TEXTURE_MAX_LEVEL, levelCount - 1);
|
||||
|
||||
targetTexture->GenerateMipmap();
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Nz
|
||||
targetTexture->SetParameteri(GL_TEXTURE_BASE_LEVEL, 0);
|
||||
|
||||
if (levelCount != m_textureInfo.levelCount)
|
||||
targetTexture->SetParameteri(GL_TEXTURE_MAX_LEVEL, m_textureInfo.levelCount);
|
||||
targetTexture->SetParameteri(GL_TEXTURE_MAX_LEVEL, m_textureInfo.levelCount - 1);
|
||||
}
|
||||
|
||||
inline PixelFormat OpenGLTexture::GetFormat() const
|
||||
|
||||
Reference in New Issue
Block a user