<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Brian,<div class=""><br class=""></div><div class="">I'm testing with shaders from <a href="http://shadertoy.com" class="">Shadertoy.com</a>, which may be pretty heavy (ray casting/marching and stuff).</div><div class=""><br class=""></div><div class="">This is used in an open source VFX/compositing software (Natron), so image resolution may be 4K and up.</div><div class=""><br class=""></div><div class="">Thanks for the tiled rendering tip, I'll do that.</div><div class=""><br class=""></div><div class="">We could even get rid of the glScissor stuff if OSMesaMakeCurrent had a "rowstride" parameter (pass the lower-left pixel address, tile width/height, and buffer rowstride).</div><div class="">This wouldn't penalize rendering speed, since the buffer is copied in the end anyway.</div><div class=""><div class=""><br class="webkit-block-placeholder"></div><div class="">fred</div><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">Frédéric Devernay, Research Scientist, INRIA</div><div class=""><a href="mailto:frederic.devernay@inria.fr" class="">frederic.devernay@inria.fr</a></div><div class=""><br class=""></div></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">Le 13 mai 2016 à 22:55, Brian Paul <<a href="mailto:brianp@vmware.com" class="">brianp@vmware.com</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class="">On 05/10/2016 05:13 AM, Frédéric Devernay wrote:<br class=""><blockquote type="cite" class="">Hi,<br class=""><br class="">I am using OSMesa to render large shaders, and would like to be able to<br class="">interrupt the OSMesa render before it is finished, e.g. when there is<br class="">user interaction.<br class=""><br class="">The OpenGL way to do this is to use glFenceSync/glClientWaitSync but<br class="">glFenceSync blocks until llvmpipe is flushed and glClientWaitSync always<br class="">returns GL_ALREADY_SIGNALED on OSMesa, without executing anything.<br class=""><br class="">Besides, many commands in OSMesa are blocking and cause an immediate<br class="">render, such as glUseProgram(0) or glPopAttrib().<br class=""></blockquote><br class="">The amount of work that's done when a state-change command is hit depends on the driver. With llvmpipe we try to queue up as much rendering as possible, effectively building a command list per screen tile. Some state-change commands trigger rendering while others don't.<br class=""><br class="">With softpipe/swrast, almost any state change after a drawing command will cause the queued drawing command(s) to be executed.<br class=""><br class=""><br class=""><blockquote type="cite" class="">Is there any way to do what I want to achieve, i.e. pipe all my commands<br class="">and then wait for the render to finish with a timeout?<br class=""></blockquote><br class="">We don't have a way to do that now. Are your images pretty large? Maybe one approach would to render the scene in tiled chunks. For example, divide the window into an NxM grid of tiles, then render the scene into each tile with glScissor. After rendering each tile, check if there's user input and abort drawing the grid if needed.<br class=""><br class="">Ideally the tile size should be a multiple of llvmpipe's tile size which is 64x64. llvmpipe employs multiple threads to process tiles in parallel so your tiles should probably be 128x128 for 4 cores, 256x128 for 8 cores, etc.<br class=""><br class="">Or maybe your rendering and UI code could be in separate threads.<br class=""><br class="">-Brian<br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>