Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug in the D3D11 backend where glSamplerParameteri(..., GL_TEXTURE_MIN_FILTER, ...) was not respected to determine if there are mipmaps #23

Closed
wants to merge 2 commits into from

Conversation

tillrathmann
Copy link
Contributor

@tillrathmann tillrathmann commented Aug 15, 2018

When using a sampler the texture was created as if it has mipmaps, regardless what you specified in GL_TEXTURE_MIN_FILTER via glSamplerParameteri() -- mistakenly the default value GL_NEAREST_MIPMAP_LINEAR or the value set by glTexParameteri(..., GL_TEXTURE_MIN_FILTER, ...) was evaluated.
If you didn't provide mipmaps and didn't let the driver generate them this led to not sampling your texture data when minification happened.

Ticket: https://bugs.chromium.org/p/angleproject/issues/detail?id=2772

…XTURE_MIN_FILTER, ...) was not respected to determine if there are mipmaps

When using a sampler the texture was created as if it has mipmaps,
regardless what you specified in GL_TEXTURE_MIN_FILTER via
glSamplerParameteri() -- mistakenly the default value
GL_NEAREST_MIPMAP_LINEAR or the value set by
glTexParameteri(..., GL_TEXTURE_MIN_FILTER, ...) was evaluated.
If you didn't provide mipmaps and didn't let the driver generate them
this led to not sampling your texture data when minification happened.
Additionally added me to AUTHORS and CONTRIBUTORS as proposed in doc/ContributingCode.md
@vonture
Copy link
Contributor

vonture commented Aug 15, 2018

Hey, this is a good fixed but we only accept patches on our code review site.

Please follow the directions here: https://github.com/google/angle/blob/master/doc/ContributingCode.md

@vonture vonture closed this Aug 15, 2018
@tillrathmann
Copy link
Contributor Author

OK, I created a review there now:
https://chromium-review.googlesource.com/c/angle/angle/+/1175910

annestrand pushed a commit to annestrand/angle that referenced this pull request Sep 25, 2023
ASSERT happened in the Instagram application.
- record REEL using camera;
- press "Next" button;
- return to the previous screen;
- ASSERT happens.

Crash details:
    pid: 31451, tid: 2938, name: mediacompositio  >>> com.instagram.android <<<
    signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    Abort message: 'FATAL: entry_points_egl_autogen.cpp:437 (EGL_GetError):      ! Assert failed in EGL_GetError (../../src/libGLESv2/entry_points_egl_autogen.cpp:437):
    backtrace:
          ...
          google#7 pc 0000000000627740  /vendor/lib64/egl/libGLESv2_samsung.so (gl::LogMessage::~LogMessage()+140) (BuildId: acced3587e668343)
          google#8 pc 000000000027e79c  /vendor/lib64/egl/libGLESv2_samsung.so (EGL_GetError+360) (BuildId: acced3587e668343)
          google#9 pc 000000000007c14c  /system/lib64/libEGL.so (android::eglGetErrorImpl()+28) (BuildId: 5b32b014e5c062afdd3d1abd3ba13dd2)
          google#10 pc 0000000000079464  /system/lib64/libEGL.so (eglDestroyImageKHR+20) (BuildId: 5b32b014e5c062afdd3d1abd3ba13dd2)
          google#11 pc 000000000000e540  /system/lib64/libnativedisplay.so (android::EGLConsumer::EglImage::~EglImage()+44) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd)
          google#12 pc 000000000000e598  /system/lib64/libnativedisplay.so (android::EGLConsumer::EglImage::~EglImage()+16) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd)
          google#13 pc 000000000000e434  /system/lib64/libnativedisplay.so (android::EGLConsumer::onFreeBufferLocked(int)+156) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd)
          google#14 pc 000000000000bda0  /system/lib64/libnativedisplay.so (android::SurfaceTexture::freeBufferLocked(int)+48) (BuildId: 3b0b03d2c8ab7eb49d16eb7be29eb3fd)
          google#15 pc 00000000000bc294  /system/lib64/libgui.so (android::ConsumerBase::onBuffersReleased()+172) (BuildId: f219f4196018eeed01e28ec428c73c99)
          google#16 pc 000000000008d9d4  /system/lib64/libgui.so (android::BufferQueue::ProxyConsumerListener::onBuffersReleased()+92) (BuildId: f219f4196018eeed01e28ec428c73c99)
          google#17 pc 0000000000099608  /system/lib64/libgui.so (android::BufferQueueProducer::disconnect(int, android::IGraphicBufferProducer::DisconnectMode)+184) (BuildId: f219f4196018eeed01e28ec428c73c99)
          google#18 pc 00000000000eb3ec  /system/lib64/libgui.so (android::Surface::disconnect(int, android::IGraphicBufferProducer::DisconnectMode)+268) (BuildId: f219f4196018eeed01e28ec428c73c99)
          google#19 pc 00000000000eaf04  /system/lib64/libgui.so (android::Surface::hook_perform(ANativeWindow*, int, ...)+264) (BuildId: f219f4196018eeed01e28ec428c73c99)
          google#20 pc 0000000000031214  /system/lib64/libvulkan.so (vulkan::driver::DestroySurfaceKHR(VkInstance_T*, VkSurfaceKHR_T*, VkAllocationCallbacks const*)+56) (BuildId: 44c563855311012ead3ce5e7afdb9792)
          google#21 pc 000000000039bb40  /vendor/lib64/egl/libGLESv2_samsung.so (void std::__Cr::__function::__policy_invoker<void (void*)>::__call_impl<std::__Cr::__function::__default_alloc_func<rx::WindowSurfaceVk::destroy(egl::Display const*)::$_0, void (void*)> >(std::__Cr::__function::__policy_storage const*, void*)+140) (BuildId: acced3587e668343)
          google#22 pc 0000000000522114  /vendor/lib64/egl/libGLESv2_samsung.so (angle::UnlockedTailCall::runImpl(void*)+56) (BuildId: acced3587e668343)
          google#23 pc 000000000027dcec  /vendor/lib64/egl/libGLESv2_samsung.so (EGL_DestroySurface+260) (BuildId: acced3587e668343)

This CL will fix the ASSERT as well as remove possibility of calling
same callback twice.

Bug: angleproject:8127
Change-Id: I8e56981d0db2ef5723afedc22d5286421237444b
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4874040
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants