D3DERR_CONFLICTINGRENDERSTATE/ValidateDevice

Started by
13 comments, last by Blaster 21 years, 10 months ago
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

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Advertisement
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
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
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

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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

This topic is closed to new replies.

Advertisement