View Single Post
Old 09-26-02, 10:48 AM   #40
Registered User
DIMA's Avatar
Join Date: Jul 2002
Posts: 78
Send a message via ICQ to DIMA

Originally posted by Uttar

That's my understanding for VS too.

I know about condition codes, but it seems vastly inefficient. If programmers begin to use that, get ready for some REALLY fill rate bound games! That's AFAIK, anyway.

Well, I'll give you some quotes from Matt Craighead, nVidia's 3D Guru:

Right, the most obvious use for condition codes is to emulate branching. (Real branching _can_ be faster if it lets you skip a lot of instructions, and the branch is either almost always taken or almost always not taken.)
It can get annoying to write out all the code for using condition codes. Fortunately, the Cg compiler should be able to help you out here and compile your "if" statements with no trouble.

You can think of condition codes as being the rough equivalent to "CMOV" instructions in x86.

Predication, well, sort of. The important point is that you end up executing all the instructions on both sides of your "branch". Predication sometimes implies that this is not the case. (Less important when instructions are not capable of generating "faults".)
NV30 *does* support real (i.e. data-dependent) branching/looping/function calls in vertex programs. From the little I know of it, DX9 is quite a bit less general there. I also don't know if DX9 supports CC's.

Anyhow, CC's are quite a nice improvement over the whole "SGE/MUL/MAD" mess.

- Matt
P4 2ghz
512mb RDRAM
GF4 TI4600
DIMA is offline   Reply With Quote