0
\$\begingroup\$

I have heard that in OGL and in DX9 D3DPOOL_MANAGED mipmap layers are pulled to the GPU memory on demand. As in If I pull from layer 4 of a mipmap, that layer and all smaller layers are pulled into the GPU memory, but larger mipmap layers are not.

I have tried to test this by creating a scene which requires more textures than the GPU has room for, but never getting close enough to any object such that it's larger mipmaps are required.
In OGL I don't hit a performance cliff, and as best I can tell with gDebugger I don't fill the GPU memory.
In D3DPOOL_DEFAULT I actually get a DX9 error cause I run out of GPU memory space.

At such a high level of abstraction I can't conclusively say what's happening. But I was hoping someone here could confirm or deny the partial mipmap rumor I've heard, as that would make my tests make sense.

\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

If you want on-demand loading of "mipmap layers" there is actually a new hardware feature in DX 11.2 class hardware for this exact purpose. AMD introduced it first to OpenGL as sparse textures, it virtualizes the memory used by textures and allows individual LODs to be demand-paged the first time they are actually referenced in a fragment/pixel shader. D3D 11.2 standardizes this feature and calls it "tiled resources." This is honestly the only time you will ever (portably) have fine-grained knowledge of how the driver is managing your texture's memory at the LOD level.

Using this hardware-level feature, you can even tell inside your shader, whether an LOD is resident or not. This is very handy because demand-loading any resource introduces quite a bit of latency, and you want to be able to fallback to a lower LOD while you load the LOD into memory rather than suddenly increasing the time taken to render 1 frame by a factor of 10.

\$\endgroup\$
3
  • \$\begingroup\$ So, the DX11.2 feature you're speaking of is really just clipmapping with improved frustum and view space culling such that tiles of your original mipmap that won't be drawn aren't loaded. This is great for terrain texturing, but my question is: With a texture memory requirement that exceeds my available VRAM why does OGL not take a performance hit, and not even appear to store the textures off device? I specifically want to know if there is some driver magic involved that is paging in and out mipmap layers as needed. \$\endgroup\$ Commented Jan 8, 2014 at 12:52
  • \$\begingroup\$ So I had disregarded your comment on AMD's sparse textures it looks like that's exactly what I'm talking about (+1). The DX11.2 texture thing requires a view matrix so that's not the same thing, unless you're aware of something in DX11.2 that I'm not. \$\endgroup\$ Commented Jan 8, 2014 at 14:36
  • \$\begingroup\$ @JonathanMee: I have no idea where you are getting that idea from. Tiled Resources are the same thing as Sparse Textures, the one major difference is the classification of tiers. Tier 1 is inferior to AMD's Sparse Texture extension and Tier 2 is pretty much the same. \$\endgroup\$ Commented Jan 16, 2014 at 1:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .