Sign in to follow this  
Alundra

Image class still needed ?

Recommended Posts

Alundra    2316

Hi,

With the advance of technology now you can read and write directly on the texture and more fast than on CPU.

A lot of engine or application have an image class who is used to work on image data.

Do you think it's still needed or compute shader is enough for all ?

Edited by Alundra

Share this post


Link to post
Share on other sites
metsfan    679

It really depends on what you need to do.  For instance, let's say that I want to apply an alpha mask to an image.  If the mask changes often, or if I want to maintain the original image without the extra memory overhead of creating a copy, then applying the mask on the GPU makes sense.  However, if the mask never changes, it only needs to be applied once, and it isn't necessary to maintain the original image, then it makes sense to do it on the CPU, and save my GPU clock cycles for things that actually do need to be computed every frame.  It's a matter of what your needs are.   Really this is the question you should be asking yourself:  "Does this NEED to be updated every frame, or is this something that can be computed once, cached, and reused?"  

Share this post


Link to post
Share on other sites
Alundra    2316

It can be applied once using a compute shader, just send the texture as a read-write and no one lock/unlock used.

CPU<->GPU = 1GB/s

GPU<->VRAM = 100GB/s

Edited by Alundra

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