Hi all, I am working on eglBindTexImage for egl_softpipe.so. It is based on ARB_render_texture, just like EXT_texture_from_pixmap does. I found there is a function called st_set_teximage in mesa state tracker, and it looked like what I should base on. I made some changes to it. Right now, I am able to use eglBindTexImage for render-to-texture, but I also have some questions about how to do this right in mesa.
Since st_set_teximage changes a texture object, I want to mark the texture object incomplete, and mark the core mesa context with _NEW_TEXTURE. I grepped the st source code, and no other functions change the state of the core mesa context. Am I allowed to modify the state of core mesa context directly or is there a better way? Another question is about the spec itself and how to implement it. For eglBindTexImage or glXBindTexImageEXT, the spec says (EGL spec 3.6.1) Note that any existing images associated with the different mipmap levels of the texture object are freed (it is as if glTexImage was called with an image of zero width) (texture_from_pixmap) It is not an error to call TexImage2D, TexImage1D, CopyTexImage1D, or CopyTexImage2D to replace an image of a texture object that has a color buffer bound to it. However, these calls will cause the color buffer to be released and new memory to be allocated for the texture. Note that the color buffer is released even if the image that is being defined is a mipmap level that was not defined by the color buffer. For eglReleaseTexImage and glXReleaseTexImageEXT, it says (EGL spec 3.6.2) After a color buffer is released from a texture (either explicitly by calling eglReleaseTexImage or implicitly by calling a routine such as glTexImage2D), all texture images that were defined by the color buffer become NULL (it is as if glTexImage was called with an image of zero width). (texture_from_pixmap) When a color buffer is released (e.g., by calling glXReleaseTexImageEXT or implicitly by calling a routine such as TexImage2D), all textures that were defined by the color buffer become NULL. My understanding to these paragraphs is that, a texture object may allocate private buffers or use the backing buffers of the bound pbuffers for the texels. But they can not be mixed! A BindTexImage causes the private buffers to be freed, and a TexImage* causes the bound pbuffers to be released. And both functions should mark _NEW_TEXTURE and require the textre object in question to be tested for completeness. Is my understanding correct? If that's correct, I should make a texture object incomplete when a bound pixmap/pbuffer is released. Currently, I set the texture image to have zero width and height so that it is tested incomplete when validated. Is this the suggested way? This mail is kinda lengthy. Thanks for your patient :) -- Regards, olv ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
