shader

Started by
4 comments, last by luasitdown 18 years, 4 months ago
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?
Advertisement
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 :).
Sirob Yes.» - status: Work-O-Rama.
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.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

thanks.
4.I found vertex stream is just input register. Use multistream is just use multi-register for a vertex structure. Is that true?

This topic is closed to new replies.

Advertisement