From 3d0e237dbfef534d4ecda634521e1e419eb3fce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 3 Mar 2019 15:40:52 +0100 Subject: [PATCH] DebugTools: texelFetch() doesn't work w/o min filter on SwiftShader. WTF. I have no explanation for this. --- src/Magnum/DebugTools/Test/TextureImageGLTest.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp index 85861a504..87bb9bf3c 100644 --- a/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp +++ b/src/Magnum/DebugTools/Test/TextureImageGLTest.cpp @@ -224,7 +224,10 @@ constexpr Float Data2DFloat[] = { 1.0f, void TextureImageGLTest::subImage2DFloat() { GL::Texture2D texture; - texture.setStorage(1, GL::TextureFormat::R32F, Vector2i{2}) + texture + /* if I don't set this, SwiftShader will return all zeros */ + .setMinificationFilter(GL::SamplerFilter::Nearest) + .setStorage(1, GL::TextureFormat::R32F, Vector2i{2}) .setSubImage(0, {}, ImageView2D{GL::PixelFormat::Red, GL::PixelType::Float, Vector2i{2}, Data2DFloat}); Image2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {GL::PixelFormat::Red, GL::PixelType::Float}); @@ -240,7 +243,10 @@ void TextureImageGLTest::subImage2DFloat() { void TextureImageGLTest::subImage2DFloatGeneric() { GL::Texture2D texture; - texture.setStorage(1, GL::TextureFormat::R32F, Vector2i{2}) + texture + /* if I don't set this, SwiftShader will return all zeros */ + .setMinificationFilter(GL::SamplerFilter::Nearest) + .setStorage(1, GL::TextureFormat::R32F, Vector2i{2}) .setSubImage(0, {}, ImageView2D{GL::PixelFormat::Red, GL::PixelType::Float, Vector2i{2}, Data2DFloat}); Image2D image = textureSubImage(texture, 0, {{}, Vector2i{2}}, {PixelFormat::R32F});