Sign in to follow this  
Quat

Compute Shader

Recommended Posts

Quat    568
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
MJP    19786
[quote name='Quat' timestamp='1305904559' post='4813492']
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?
[/quote]

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this