Sign in to follow this  

shader

This topic is 4376 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

1.I think GPU matrix multiply is fater then cpu.So is it possible to use GPU to do the job other than D3DXMatrixMultiply? 2.I heard of constant register can be access by CPU other than GPU.Is that true?

Share this post


Link to post
Share on other sites
Hi, :)

Quote:
Original post by luasitdown
1.I think GPU matrix multiply is fater then cpu.So is it possible to use GPU to do the job other than D3DXMatrixMultiply?

Yes, the GPU probably does calculate matrix multiplications faster than the CPU. However, you are quite limited in "saving" results of those multiplies on the GPU, since you can only write to textures.

At any rate, a matrix multiply isn't a very expensive operation, and with SSE, it really isn't a problem unless you're doing a LOT of them. If you are, you can use the D3DX???Array functions in most cases, which take a batch of arguments and run them all in one quicker go.

Quote:
Original post by luasitdown
2.I heard of constant register can be access by CPU other than GPU.Is that true?

The CPU writes to constant registers in GPU memory. This is a relatively slow operation, since it's done through the slower AGP bus. The GPU then reads the registers. Note, the GPU cannot write to constant registers.

Hope this helps :).

Share this post


Link to post
Share on other sites
thanks.
3. what is different between software vertex shader and way set by D3DCREATE_SOFTWARE_VERTEXPROCESSING?

It seem to D3DCREATE_SOFTWARE_VERTEXPROCESSING is very slow.and software vertex shader is not slow.

Share this post


Link to post
Share on other sites
If you're interested in offloading general mathematics to the GPU then it'd be well worth checking out http://www.gpgpu.org/. The GPU is fast becoming a viable "co-processor" for such things, so theres a lot of work in the field.

However, bare in mind that there are still lots of "grey areas" with precision that can make a GPU/D3D unsuitable for work where a high degree of accuracy is required.

Another thing to consider if you're thinking about offloading basic matrix maths is that it'll be done ONCE per vertex on the GPU as opposed to ONCE per batch on the CPU. Subtle but important difference [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by luasitdown
thanks.
3. what is different between software vertex shader and way set by D3DCREATE_SOFTWARE_VERTEXPROCESSING?

It seem to D3DCREATE_SOFTWARE_VERTEXPROCESSING is very slow.and software vertex shader is not slow.

D3DCREATE_SOFTWARE_VERTEXPROCESSING will force the vertex processing to run on the CPU and not your video card. Thus if you have some shiny new turbo-charged GeForce/Radeon, it won't use it for vertex processing [smile]

Generally speaking, a general purpose CPU is not as fast as a customized and dedicated GPU when doing this sort of work.

hth
Jack

Share this post


Link to post
Share on other sites

This topic is 4376 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.

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