Jump to content
  • Advertisement
Sign in to follow this  
Quat

works in REF but not HAL

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

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.


?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
nvidia 6800 GT :)

I'm targetting 2.0, but the above supports even 3.0. Besides, I'm not doing anything fancy.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!