Skip to main content
gamedev.net
🔒 Locked

CommitChanges() functionality for DX10

Started by feal87 2 replies 900+ views
Original Post
feal87
feal87
There is something that make me wonder... I'll explain my problem : I have to draw 1-10-100-1000 quads with different textures/color/worldmatrix, but the same vertex shader, vertex buffer, index buffer, pixel shader...i need an EFFICIENT way to change only the first parameters... In DX9 we had the CommitChanges that send the changes of the constants into the shader...(in Pix i see that execute just 1 operation for each change and change only the constants) In DX10 lots of people tell to use Pass.Apply() to do the same, but Pass.Apply() actually (as i see in Pix) set again the vertex shader/pixel shader etcetera slowing down the whole system. (making them into number, over 4 quads i recover 0,43 ms each frame by avoiding resetting each time everything. It is quite a bit IMHO) Any idea about HOW i can do something like CommitChanges in DirectX10?
sirob
sirob
You can use a constant buffer that contains only the values that change every frame. When you want to change the value, call UpdateSubresource, then draw.
Sirob Yes.» - status: Work-O-Rama.
feal87
feal87
Quote:
Original post by sirob
You can use a constant buffer that contains only the values that change every frame. When you want to change the value, call UpdateSubresource, then draw.


Omg, i haven't thought about this way. Thanks a lot, i'll try as soon as i can and see what happen. :)
feal87
feal87
Another little question, what about textures?
There is a way to change the texture applied to the shader directly? :( (without having to use Pass.Apply())

[Edited by - feal87 on May 23, 2009 2:22:36 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.