<div class="gmail_extra"><br><br><div class="gmail_quote">On 25 April 2012 11:13, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am <a href="tel:24.04.2012%2021" value="+12404201221">24.04.2012 21</a>:23, schrieb Paul Berry:<br>
<div class="im">> When rendering to a miplevel other than 0 within a color, depth,<br>
> stencil, or HiZ buffer, we need to tell the GPU to render to an offset<br>
> within the buffer, so that the data is written into the correct<br>
> miplevel. We do this using a coarse offset (in pages), and a fine<br>
> adjustment (the so-called "tile_x" and "tile_y" values, which are<br>
> measured in pixels).<br>
<br>
</div>Just wondering, can't you get the gpu to do these offset calculations<br>
for you?</blockquote><div><br>In theory yes, but my understanding is that there are enough limitations that we've elected not to. The limitations I'm aware of are:<br><br>1. Gen6 HiZ buffers (and possibly also separate stencil buffers?) don't respect the miplevel setting, so if we do this we'll have to do extra work to get HiZ and separate stencil to work properly.<br>
2. The LOD we're rendering to must match for depth, stencil, and all color buffers. AFAICT, GL doesn't require this (though it's possible we might be able to work around it by reporting GL_FRAMEBUFFER_UNSUPPORTED, I'm not sure).<br>
<br>The decision was made a long time before I joined the project, so I don't know the full history. I would like to do some experiments to try getting the gpu to do the offset calculations, but I'm not sure when I'll have time to do that :)<br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> After all dx10 allows you to have multiple mip levels bound as<br>
a render target at once, where the actual mip level being rendered to is<br>
determined by a system value (GL 3.3 (?) can do the same with the<br>
gl_Layer output of geometry shader). How do you handle that if you have<br>
to adjust the offset manually?<br></blockquote><div><br>I'm not familiar with dx10, but the GL 3.3 feature you're talking about is for rendering to multiple layers of 3D textures and texture arrays, and multiple faces of cubemaps. It doesn't have anything to do with miplevels. We implement gl_Layer yet (since we don't support geometry shaders) but I just did a quick scan of the docs and it looks like we'll be able to support it without a problem, since the offsets to get into a different layer and the offsets to get into a different miplevel are additive.<br>
</div></div></div>