render/gles2: Simplify dmabuf texture management
Currently we attach the texture to the buffer as an addon and returning the
same texture reference next time someone tries to import the buffer. But, we
already have something very similar that does the same thing: wlr_gles2_buffer
.
In fact, we are creating the same EGLImageKHR
for both buffers and textures meaning
we might be importing the buffer twice if that buffer is used for texturing and also
as a render target. By moving important texture state to gles2_buffer, we can remove
this potential double import and also simplify the whole refcount dance that we have
with textures.
Necessary for !4211 (merged) (so that we can share fbos)
I want to do something similar for vulkan, but that's much more difficult and it doesn't block !4211 (merged) so it's not as important.