I'm trying to implement different image processing algorithms like grayscaling, filtering, quantizing etc. on Android smartphones. I've got the camera preview rendered to a quadas an external texture, it works fine with grayscaling in fragment shader. But when I try to do the same in OpenGL ES 3.1 with compute shaders, I get invalid operation error,when calling glBindImageTexture(...) before dispatch compute. According to https://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external_essl3.txt
if I bind an external texture like GL_TEXTURE_EXTERNAL_OES and bind it with glBindImageTexture, I should be able to access the image via image2D sampler in GLSL.What am I doing wrong?
Hi, I'm encountering a similar issue.I have an OpenGL texture backed by an external EGL image.I'm trying to bind it to a compute shader using glBindImageTexture, but it return INVALID_OPERATION.
Platform: Android O.
Device: Mate 10 Pro.
GPU: Mali G72.
First I create an OpenGL texture backed by EGL image:
EGLImageKHR sourceImage = eglCreateImageKHR(...)glGenTextures(1, &texture);glBindTexture(GL_TEXTURE_2D, texture);glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, sourceImage);
Then I try to bind it as a GL compute image:
glBindImageTexture(...) -> return INVALID_OPERATION
The texture memory has already been allocated externally by the system, and should be pre-populated with the data you need from the external media device.