DX11 - Sending Textures

Started by
2 comments, last by MJP 10 years, 7 months ago

Hi guys! laugh.png

So, this has always bugged me, and I never actually found out the final answer, about sending textures in directx 11, using c++.

Question: Do you only send the texture one time per runtime, or once per frame (I do the last) ?

Ba dum tss! That's it!

Thank You

FastCall22: "I want to make the distinction that my laptop is a whore-box that connects to different network"

Blog about... stuff (GDNet, WordPress): www.gamedev.net/blog/1882-the-cuboid-zone/, cuboidzone.wordpress.com/

Advertisement

You probably LOAD the texture once on the gpu. and probably BIND it to some slot once per frame.

I've read somewhere in this forum that constantly binding the texture every frame even if it doesn't change takes some performance hit i think.

In Jason Zink's graphics engine, his graphics pipeline layer has a state monitoring system that defers the actual binding of GPU resources until the time that's actually needed. The graphics pipeline layer allows the cpu code to bind and change as many resources as it wants in the current frame through caching the resources to be bound then evaluating it when its time to draw the mesh. Once the cpu calls DrawIndexed, the state monitoring system checks the cpu bounded resource and the actual resource that is currently bound in the gpu; It only binds the resource to the GPU if the state monitor detects different cached and GPU bound resources and binds those cached resources.

You probably LOAD the texture once on the gpu. and probably BIND it to some slot once per frame.

This. When you create the texture and provide the texture data, that data is normally stored directly in GPU memory and will stay there until you release it. Binding textures to a shader stage is just a mechanism for letting shaders know which textures to use.

This topic is closed to new replies.

Advertisement