anholt / mesa

this repo is dead. See https://gitlab.freedesktop.org/mesa/mesa master branch for latest usable vc4 and v3d, and https://gitlab.freedesktop.org/anholt/mesa for old vc4/v3d WIP branches
120 stars 40 forks source link

vc4: Add support for glInvalidateFramebuffer() #20

Open anholt opened 8 years ago

anholt commented 8 years ago

This would let apps tell us that we can avoid storing the depth/stencil contents, saving memory bandwidth.

loganmc10 commented 8 years ago

I'm having issues using glDiscardFramebufferEXT (GLES2), would this be the same issue?

If I try to #define GL_GLEXT_PROTOTYPES it tells me it can't find the symbol, and if I try to declare the function using the symbol (PFNGLDISCARDFRAMEBUFFEREXTPROC) it segfaults.

anholt commented 8 years ago

No, it's that you can't directly use extensions in GL on Linux. You need to use glXGetProcAddress() / eglGetProcAddress() to get the function pointer. I'd recommend using libepoxy to avoid having to deal with that.

loganmc10 commented 8 years ago

Ok thanks, i guess the closed source driver works differently than most, using that driver i could just include gl2ext.h and then use glDiscardFramebufferEXT directly

anholt commented 8 years ago

Yeah, lots of implementations accidentally expose their functions like this. It's a shame that Khronos has standards saying that GL on Linux shouldn't expose functions like a normal library.