• Advertisement
Sign in to follow this  

Compute Shader

This topic is 2470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I have seen samples where we access a buffer or texture in a compute shader using bracket operator []. However, I also see some people using Load/Store methods. Is there a difference?

Share this post


Link to post
Share on other sites
Advertisement

Hi,

I have seen samples where we access a buffer or texture in a compute shader using bracket operator []. However, I also see some people using Load/Store methods. Is there a difference?


Using Load and the [] operator are equivalent, there's no difference. Most of the buffer and texture types don't have a "Store" method...it is only supported by RWByteAddressBuffer, which doesn't support the [] operator (because of the special way in which it loads and stores data). So for RWTexture2D/RWBuffer/RWStructuredBuffer the [] operator is the only way to write to it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement