works in REF but not HAL

Started by
7 comments, last by Muhammad Haggag 18 years, 9 months ago
Hi, After wasting some frustrating hours, I tried my program in REF and it worked. Basically, I have a struct and I set it with SetValue. Note that the C++ struct matches the HLSL struct exactly and all components are 4D vectors. But a value, I know I set to 0, if not zero in the shader! (It is when using REF though.) I am using an nvidia 6800 GT. I just tried the latest drivers, but still no luck. As I write this, I think I recall something about nvidia cards using 16-bit float's internally? Could it be then that using SetValue isn't working correctly because its trying to copy my 32-bit floats over to 16-bit floats, so there is not enough room? Also who do I contact when it works in REF but not HAL?
-----Quat
Advertisement
Well, the GF6 cards use 32bit precision internally, not 16, so that shouldn't be a problem.

Only thing I can think of, is if you forget to set the value properly (or have messed it up when setting it in the shader somehow), its value might be undefined. Then it's possible that REF would initialize it to zero, while HAL would just use whatever garbage value is at that memory location.

Otherwise, it's a driver bug, but I doubt that.
More Info:

It works with software vertex processing (with HAL). Would that kill this idea:

Quote:
Then it's possible that REF would initialize it to zero, while HAL would just use whatever garbage value is at that memory location.


?
-----Quat
If it works on REF, but not on HAL, then it's likely a hardware driver bug, or possibly a resource capacity problem (if you're using more than the guaranteed minimums).

Not that it helps you getting it to actually work, of course. I've heard about a struct binding bug before: One work-around is to make each value a separate variable, rather than binding structs.
enum Bool { True, False, FileNotFound };
Are your shader versions supported by the hardware? The REF renderer supports all shader versions, but your hardware may not. Maybe that is the problem.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
nvidia 6800 GT :)

I'm targetting 2.0, but the above supports even 3.0. Besides, I'm not doing anything fancy.
-----Quat
Quote:Original post by Quat
More Info:

It works with software vertex processing (with HAL). Would that kill this idea:

Quote:
Then it's possible that REF would initialize it to zero, while HAL would just use whatever garbage value is at that memory location.


?


No clue, I was just guessing. :)
I'm just assuming that it's more likely to be an obscure bug in your code than in the driver. Of course, the latter is far from impossible, but generally it pays to look for the bug in your own code first.
When it comes to things that might be a driver/hardware bug rather than your own source code, you really need to run it on some different hardware/driver combinations.

For example, try it on different NVidia drivers, maybe on some ATI hardware as well? If your code runs okay with REFRAST and other hardware I'd say you've got a good case for it being a driver bug. Also, if it doesn't work on any other hardware (in the same way that it doesn't on your 6800) then you've probably confirmed that it *isn't* a driver bug [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 Quat
Hi,

After wasting some frustrating hours, I tried my program in REF and it
worked. Basically, I have a struct and I set it with SetValue. Note that
the C++ struct matches the HLSL struct exactly and all components are 4D
vectors. But a value, I know I set to 0, if not zero in the shader! (It is
when using REF though.) I am using an nvidia 6800 GT. I just tried the
latest drivers, but still no luck.

As I write this, I think I recall something about nvidia cards using 16-bit
float's internally? Could it be then that using SetValue isn't working
correctly because its trying to copy my 32-bit floats over to 16-bit floats,
so there is not enough room?

Also who do I contact when it works in REF but not HAL?

Can you check the struct member value with the shader debugger?


This topic is closed to new replies.

Advertisement