Re: [Mesa-dev] Mesa 7.11 and osmesa
Brain, I'm using osmesa with VTK and in this particular test I'm rendering just lines. The ratios stay the same for just triangles. Just for these simple primitives 7.11 seems to be about 4 times slower that 7.6.1. Can you give me some pointers on where to get started with a new gallium based osmesa interface? I'd certainly like to make a stab at developing this capability. This is something that would be quite valuable for my purposes as well. Regards, Paul On Thu, Oct 6, 2011 at 10:27 AM, Brian Paul bri...@vmware.com wrote: On 10/04/2011 01:22 PM, Paul Gotzel wrote: Hello, I've recently upgraded to mesa 7.11 and I've noticed significant performance degradation when using osmesa. Here's my results when comparing the versions: Version Time 7.6.1 4s 7.10.3 16s 7.11 23s This is the time to render a single frame (including the initial program overhead). Any thoughts? I don't have time to investigate this in any depth. One thing that comes to mind is the software texturing code. Most of the ubyte-based texture sampling code was replaced by floating point so if you're doing a lot of texture mapping, that could be a reason. To learn more, someone would have to do a bisection. What kind of rendering featurs are you using (plain shaded tris, texturing, shaders, etc)? I'm not using the gallium framework. Would enabling gallium help in some way? LLVMpipe would almost certainly be a lot faster. I've been meaning to write a new OSMesa interface for gallium but haven't found the time. That would be a valuable project for at least a few people. -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Mesa 7.11 and osmesa
Hello, I've recently upgraded to mesa 7.11 and I've noticed significant performance degradation when using osmesa. Here's my results when comparing the versions: Version Time 7.6.1 4s 7.10.3 16s 7.11 23s This is the time to render a single frame (including the initial program overhead). Any thoughts? I'm not using the gallium framework. Would enabling gallium help in some way? Any help appreciated! Regards, Paul Gotzel ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] is it possible to dynamic load OSMesa?
Hello, I've downloaded the latest 7.10.3 and I need to be able to dynamically load OSMesa. Is this possible? I've tried to use dlopen and dlsym to load the functions and all the OSMesa calls return success but when I make the gl calls I get: GL User Error: glGetIntegerv called without a rendering context GL User Error: glGetIntegerv called without a rendering context GL User Error: glGetIntegerv called without a rendering context Any help would be appreciated. Thanks, Paul My sample program is as follows. I compile it with the same flags as the rest of the demo programs without linking to OSMesa. static void * loadOSMesa() { return dlopen(libOSMesa.so, RTLD_DEEPBIND | RTLD_NOW | RTLD_GLOBAL); } static OSMesaContext dynOSMesaCreateContext() { typedef OSMesaContext (*CreateContextProto)( GLenum , GLint , GLint , GLint , OSMesaContext ); static void *createPfunc = NULL; CreateContextProto createContext; if (createPfunc == NULL) { void *handle = loadOSMesa(); if (handle) { createPfunc = dlsym(handle, OSMesaCreateContextExt); } } if (createPfunc) { createContext = (CreateContextProto)(createPfunc); return (*createContext)(GL_RGBA, 16, 0, 0, NULL); } return 0; } static GLboolean dynOSMesaMakeCurrent(OSMesaContext cid, void * win, GLenum type, GLsizei w, GLsizei h) { typedef GLboolean (*MakeCurrentProto)(OSMesaContext, void *, GLenum, GLsizei, GLsizei); static void *currentPfunc = NULL; MakeCurrentProto makeCurrent; if (currentPfunc == NULL) { void *handle = loadOSMesa(); if (handle) { currentPfunc = dlsym(handle, OSMesaMakeCurrent); } } if (currentPfunc) { makeCurrent = (MakeCurrentProto)(currentPfunc); return (*makeCurrent)(cid, win, type, w, h); } return GL_FALSE; } int main(int argc, char *argv[]) { OSMesaContext ctx; void *buffer; ctx = dynOSMesaCreateContext(); if (!ctx) { printf(OSMesaCreateContext failed!\n); return 0; } int Width = 100; int Height = 100; /* Allocate the image buffer */ buffer = malloc( Width * Height * 4 * sizeof(GLubyte) ); if (!buffer) { printf(Alloc image buffer failed!\n); return 0; } /* Bind the buffer to the context and make it current */ if (!dynOSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, Width, Height )) { printf(OSMesaMakeCurrent failed!\n); return 0; } { int z, s, a; glGetIntegerv(GL_DEPTH_BITS, z); glGetIntegerv(GL_STENCIL_BITS, s); glGetIntegerv(GL_ACCUM_RED_BITS, a); printf(Depth=%d Stencil=%d Accum=%d\n, z, s, a); } return 0; } ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] is it possible to dynamic load OSMesa?
Patrick, Good thought but it doesn't work. I don't understand why adding -lOSMesa to the following makes everything work. gcc -I../../include -g -O2 -Wall -Wmissing-prototypes -std=c99 -ffast-math -fvisibility=hidden -fno-strict-aliasing -g -fPIC -D_GNU_SOURCE -DPTHREADS -DDEBUG -DHAVE_POSIX_MEMALIGN -DUSE_XSHM osdemo.c -L../../lib -lGL -o osdemo There must be some other initialization I need to call to get things to work but I don't understand enough of the details of Mesa to know what is missing. I've stepped through the mesa context initialization and I cannot see what is different between the two runs. The odd thing is that everything seems to work but then I end up what I believe is an empty gl dispatch table. This is the first time I've looked this so I'm not really sure what to expect. Any ideas of where to look in the Mesa code? Thanks, Paul On Fri, Jul 15, 2011 at 3:45 PM, Patrick Baggett baggett.patr...@gmail.comwrote: If libOSMesa.so is separate library, then isn't libGL.so too? You're calling glGetIntegerv() from libGL.so but not from libOSMesa.so -- try doing dlsym(glGetIntegerv) and removing libGL.so from the link line. Patrick On Fri, Jul 15, 2011 at 2:41 PM, Paul Gotzel paul.got...@gmail.comwrote: Hello, I've downloaded the latest 7.10.3 and I need to be able to dynamically load OSMesa. Is this possible? I've tried to use dlopen and dlsym to load the functions and all the OSMesa calls return success but when I make the gl calls I get: GL User Error: glGetIntegerv called without a rendering context GL User Error: glGetIntegerv called without a rendering context GL User Error: glGetIntegerv called without a rendering context Any help would be appreciated. Thanks, Paul My sample program is as follows. I compile it with the same flags as the rest of the demo programs without linking to OSMesa. static void * loadOSMesa() { return dlopen(libOSMesa.so, RTLD_DEEPBIND | RTLD_NOW | RTLD_GLOBAL); } static OSMesaContext dynOSMesaCreateContext() { typedef OSMesaContext (*CreateContextProto)( GLenum , GLint , GLint , GLint , OSMesaContext ); static void *createPfunc = NULL; CreateContextProto createContext; if (createPfunc == NULL) { void *handle = loadOSMesa(); if (handle) { createPfunc = dlsym(handle, OSMesaCreateContextExt); } } if (createPfunc) { createContext = (CreateContextProto)(createPfunc); return (*createContext)(GL_RGBA, 16, 0, 0, NULL); } return 0; } static GLboolean dynOSMesaMakeCurrent(OSMesaContext cid, void * win, GLenum type, GLsizei w, GLsizei h) { typedef GLboolean (*MakeCurrentProto)(OSMesaContext, void *, GLenum, GLsizei, GLsizei); static void *currentPfunc = NULL; MakeCurrentProto makeCurrent; if (currentPfunc == NULL) { void *handle = loadOSMesa(); if (handle) { currentPfunc = dlsym(handle, OSMesaMakeCurrent); } } if (currentPfunc) { makeCurrent = (MakeCurrentProto)(currentPfunc); return (*makeCurrent)(cid, win, type, w, h); } return GL_FALSE; } int main(int argc, char *argv[]) { OSMesaContext ctx; void *buffer; ctx = dynOSMesaCreateContext(); if (!ctx) { printf(OSMesaCreateContext failed!\n); return 0; } int Width = 100; int Height = 100; /* Allocate the image buffer */ buffer = malloc( Width * Height * 4 * sizeof(GLubyte) ); if (!buffer) { printf(Alloc image buffer failed!\n); return 0; } /* Bind the buffer to the context and make it current */ if (!dynOSMesaMakeCurrent( ctx, buffer, GL_UNSIGNED_BYTE, Width, Height )) { printf(OSMesaMakeCurrent failed!\n); return 0; } { int z, s, a; glGetIntegerv(GL_DEPTH_BITS, z); glGetIntegerv(GL_STENCIL_BITS, s); glGetIntegerv(GL_ACCUM_RED_BITS, a); printf(Depth=%d Stencil=%d Accum=%d\n, z, s, a); } return 0; } ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev