• Advertisement

Archived

This topic is now archived and is closed to further replies.

D3DERR_CONFLICTINGRENDERSTATE/ValidateDevice

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

I am using DirectX8.1 with VC++.NET on Windows XP. I tried using ValidateDevice, and I got the error code D3DERR_CONFLICTINGRENDERSTATE. Of course, nothing tells me which states are conflicting. How can I find which render states are conflicting? If you have any idea please tell me. ---------------- Blaster Computer game programmer and part time human being Strategy First - http://www.strategyfirst.com BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Blaster
Of course, nothing tells me which states are conflicting.



Are you sure you''re running the debug runtime?

Share this post


Link to post
Share on other sites
Yes, I am running the debug runtime, with debug output at max level. All it says is that ValidateDevice failed.

If I ignore the ValidateDevice, the visual result is flawless (or the result of the conflict has always been there) and the program runs without any problem.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
Also, the worse thing is that the documentation doesn''t mention D3DERR_CONFLICTINGRENDERSTATE being a valid return value for ValidateDevice.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
What states do you have set ?

One of the states (renderstate or texture stage state) isn''t working - so although the visual result ''looks'' the same, one of the states (it could be anything - say filtering set to anisotropic) isn''t actually having an affect on the output.

ValidateDevice() checks *everything* currently set on the device.

As for the undefined return code - you probably have a DX7 level graphics card driver which is returning a DX7 error code.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
I have a GeForce2 MX 400 on an Asus board, with the (almost?) latest reference drivers from nvidia.

Is the anisotropic thing just an example? Because I am using this filter (and also checking the corresponding caps).

I wrote a piece of code last time to keep a list of all the render states I set before the ValidateDevice. Back at home I''ll send the list.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
Yep, the anisotropic thing is just an example . However its one of those states which sometimes comes with tradeoffs.

Some features supported by modern chips have restrictions attached - often in terms of performance, but also often in terms of permutations of states possible.

Some common examples of some of things which have tradeoffs are user clip planes, W buffering, anisotropic filtering, spotlights vs point lights etc.

Since theres potentially millions of state combinations, it wouldn''t be sensible to have a cap for each - thus ValidateDevice()...



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
I am using W buffering, but I heard it's going to be removed from DirectX 9... anyway, it's irrelevant.

I tried using user clip planes, but the caps say the HW T&L doesn't support any.

I have a splot light, but it's disabled.

I will try deactivating W buffering and the anisotropic filtering. We'll see.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

[edited by - Blaster on June 3, 2002 10:48:26 AM]

Share this post


Link to post
Share on other sites
quote:
I am using W buffering, but I heard it''s going to be removed from DirectX 9... anyway, it''s irrelevant.


Its still there...though I think (IIRC) some IHVs have discussed not exposing W in their caps.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Do you think D3DERR_CONFLICTINGRENDERSTATE could mean that a TextureStageState could be conflicting also?


----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
quote:
Original post by Blaster
Do you think D3DERR_CONFLICTINGRENDERSTATE could mean that a TextureStageState could be conflicting also?


----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com



Yes. Though there are more detailed error codes to describe problems with those.



--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
Found it!
It''s a D3DTSS_TEXTURETRANSFORMFLAGS.

I set it to D3DTTFF_COUNT2 and the texture transform matrix to a translation.

What could be wrong?

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
Like I said before, the result is correct. The texture scrolls.
Should I put D3DTTFF_PROJECTED or something?

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites
Not sure what it could be - unless the FVF for the primitive conflicts with something such as the COUNT2. You shouldn''t need to use the project flag - that just does a W divide so you can do projections.

A couple of general hints for D3D coding I''ve picked up over the years which might help:

1. When your program starts up initialise *EVERY* state to a *known* value - NEVER trust the defaults. For example you may have never set D3DRS_DITHERENABLE in your code, although the docs tell you its default is FALSE, the driver could be old or bugged and may set it to TRUE, or worse may just leave it at what the previous app set it to. So a state you *haven''t* set could be causing conflicts!


2. Always disable the alpha pipe at the *same* stage as the colour pipe - i.e. DON''T do the following:

stage 0, colorarg1 = blah
stage 0, colorop = blah
stage 0, colorarg1 = blah

stage 0, alphaarg1 = blah
stage 0, alphaop = blah
stage 0, alphaarg1 = blah

stage 1, colorarg1 = blah
stage 1, colorop = blah
stage 1, colorarg1 = blah

stage 1, alphaop = disable

stage 2, colorop = disable


Instead, keep the alpha pipe alive until the the colour ops have finished. You can do something like SelectArg1 to do that.


My personal hunch after FVF flags, buffer creation flags etc for your validate failure is #1 above - states set to undefined values causing problems.

Failing that:

1. Try this on the Reference Rasterizer.

2. If it works on RefRast, have a word with the developer relations people of the graphics chip manufacturer - it could be a driver bug or a subtle restriction. Getting them an .exe where this is reproducable will help them confirm any problems (I usually modify one of the SDK samples when I need to send a repro to them).

3. If it fails on RefRast, there is still an issue with the states you''re setting.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
The FVF is pretty basic; position, normal, tex coord.
And yes, I try to set all the states I use to my own default value at start.

So I am 100% positive, the problem is with D3DTSS_TEXTURETRANSFORMFLAGS. I use an identity matrix, and D3DTTFF_COUNT2.
It works, but it makes ValidateDevice return and error.

Somewhere else I use D3DTSS_TEXTURETRANSFORMFLAGS with D3DTTFF_COUNT3 and D3DTTFF_PROJECTED, with some other D3DTTS_TCI_* stuff to generate tex coord for a reflection map.
I works, and doesn''t do anything to ValidateDevice.

I find this very odd.

Oh yes, I tried with the RefRast; ValidateDevice works ok.
I also tried with the HW TnL disabled, but it doesn''t change anything.

----------------
Blaster
Computer game programmer and part time human being
Strategy First - http://www.strategyfirst.com
BlasterSoft - http://www.blastersoft.com

Share this post


Link to post
Share on other sites

  • Advertisement