Hi! Sorry for top-posting. Webmail...
Ideally this flushing would've been done in the various map operations within the pipe driver as you say, but unfortunately these map operations are screen operations, so the pipe driver doesn't know which context to flush in a multi-threaded environment. Usually drivers wait for fence in a map operation but there is no fence if the draw commands affecting the buffer have not been flushed => Rendering errors. Also the semantics for this will vary for different state-trackers. For OpenGL it's sufficient to flush the current context of the thread doing the map operation, since there can only be one context with unflushed data per thread. Other threads are required to synchronize in the application to avoid clashes. For other state trackers the situation will be different, although I'm no expert in this field we have a couple of them in-house. So to summarize: 1) We need to know what context to flush before mapping. Only the state-tracker knows that. 2) Different state-trackers have different requirements. I'm attaching a program "flush_teximage", which will expose the problem. Run with flush_teximage -subimage and you'll probably see the rendering error without this fix. Thanks, /Thomas ________________________________________ From: Younes Manton [[email protected]] Sent: Friday, April 17, 2009 17:34 To: Thomas Hellstrom; [email protected] Subject: gallium: Make sure we flush before some texture / buffer operations. && gallium: Create OGL state tracker wrappers for various CPU access operations. Hi Thomas, I don't understand why this code is necessary in the state tracker. My understanding is you want to flush and synchronize as necessary for read/write before mapping buffers, but isn't that something the pipe driver should already be doing to insure correctness? We do this in nouveau in order to sync CPU access to memory, and then there are the DONTBLOCK and DISCARD flags to fine tune the behaviour. Does this change do more that I've missed or Is there a need to expose this kind of thing to state trackers? ------------------------------------------------------------------------------ Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p _______________________________________________ Mesa3d-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mesa3d-dev
