Dx9 Max 2d Driver V0.5

BlitzMax Forums/BlitzMax Programming/Dx9 Max 2d Driver V0.5

DStastny(Posted 2007) [#1]
Its been a while since 1.24 came out and I had a chance to upgrade the Dx9 driver to make it compatible with changes to Max2d. I finally have had time to sit down and run through some testing.

http://smokenmirrors.com/Downloads/Dx9Max2d(05).zip

This version includes a CapsReport.exe which will allow anyone having problems to retrive there cards caps to assist in fixing issues.

Also the base graphics driver was completely rewritten with some insperation for Marks rewrite of the Dx7 graphics. It now utilizes multiple swap chains for render targets when using Max GUI.

There is no performance differences between previous versions as no changes to rendering have been done. Only internal setup and management of the dx9 device has changed, to make compatible with the base Max2d implementation.

Only cards with known problems are older Intel intgrated chipsets.

As usual feel free to leave any feedback or comments. And let me know if you have any isuses.

Doug Stastny


skidracer(Posted 2007) [#2]
Working fine here, extraneous print command in dx9graphics.bmx[609].


degac(Posted 2007) [#3]
Link broken?
[edit: ] Now it works perfectly. Thanks


xlsior(Posted 2007) [#4]
Worked for me. (Btw: thanks, budman)


Gavin Beard(Posted 2007) [#5]
worked like a gem, your a scholar amongst gentlemen :-)


anawiki(Posted 2007) [#6]
This version is very unstable on WinMe with DX 9.0c. I don't have caps results with me, but I'll post them later. Basically, my game works like a charm in DX7, but with DX9 driver it crashes randomly after few seconds.

best
Roman


xlsior(Posted 2007) [#7]
This version is very unstable on WinMe


In my experience, even WinME is unstable on WinME.


anawiki(Posted 2007) [#8]
@xlsior: maybe - but my game with DX7 driver is very stable, so I wouldn't blame DX9 that much.


DStastny(Posted 2007) [#9]
@Anawiki

Couple of questions?
1. What kind of Crash are you getting?
2. Is there any rendering problems, before the crash?
3. Do you have BMAX installed on the machine and get a debug trace point that might indicate cause of the crash?
4. Does the demo application I wrote crash?

I suspect a DX resource leak in my implemation, and that might be caused by what your rendering loop is doing. If you could post the results of the CAPs tool that would be helpful too.

As for the stablity of WinME well I wont go there but if the cards caps are supported and it renders fine until the crash then its a bug in my implmentation. Getting MAX installed and running in Debug mode should give me the line of the crash and I can be of more help.

Thanks
D. Stastny


anawiki(Posted 2007) [#10]
Here are my WinMe caps:
Adapater Info
----------------------------------------------------------------
	Driver                                           TRID9910.DLL
	Description                                      Trident CyberBlade XP (69)
	DeviceName                                       \\.\Display1\Unit0
	DriverVersion                                    0x0004000C-000108F9
	VendorId                                         0x00001023
	DeviceId                                         0x00009910
	SubSysId                                         0x0018103C
	Revision                                         99
	WHQLLevel                                        0

Device Caps
----------------------------------------------------------------
	DeviceType                                       1
	AdapterOrdinal                                   0
	Caps
		D3DCAPS_READ_SCANLINE                            Yes
	Caps2
		D3DCAPS2_FULLSCREENGAMMA                         Yes
	Caps3
	PresentationIntervals
		D3DPRESENT_INTERVAL_ONE                          Yes
		D3DPRESENT_INTERVAL_IMMEDIATE                    Yes
	CursorCaps
		D3DCURSORCAPS_LOWRES                             Yes
	DevCaps
		D3DDEVCAPS_EXECUTESYSTEMMEMORY                   Yes
		D3DDEVCAPS_TLVERTEXSYSTEMMEMORY                  Yes
		D3DDEVCAPS_TEXTUREVIDEOMEMORY                    Yes
		D3DDEVCAPS_DRAWPRIMTLVERTEX                      Yes
		D3DDEVCAPS_CANRENDERAFTERFLIP                    Yes
		D3DDEVCAPS_TEXTURENONLOCALVIDMEM                 Yes
		D3DDEVCAPS_DRAWPRIMITIVES2                       Yes
		D3DDEVCAPS_DRAWPRIMITIVES2EX                     Yes
		D3DDEVCAPS_CANBLTSYSTONONLOCAL                   Yes
		D3DDEVCAPS_HWRASTERIZATION                       Yes
	PrimitiveMiscCaps
		D3DPMISCCAPS_MASKZ                               Yes
		D3DPMISCCAPS_CULLNONE                            Yes
		D3DPMISCCAPS_CULLCW                              Yes
		D3DPMISCCAPS_CULLCCW                             Yes
		D3DPMISCCAPS_COLORWRITEENABLE                    Yes
	RasterCaps
		D3DPRASTERCAPS_DITHER                            Yes
		D3DPRASTERCAPS_ZTEST                             Yes
		D3DPRASTERCAPS_FOGVERTEX                         Yes
		D3DPRASTERCAPS_FOGTABLE                          Yes
		D3DPRASTERCAPS_MIPMAPLODBIAS                     Yes
		D3DPRASTERCAPS_ANISOTROPY                        Yes
		D3DPRASTERCAPS_WBUFFER                           Yes
		D3DPRASTERCAPS_WFOG                              Yes
	ZCmpCaps
		D3DPCMPCAPS_NEVER                                Yes
		D3DPCMPCAPS_LESS                                 Yes
		D3DPCMPCAPS_EQUAL                                Yes
		D3DPCMPCAPS_LESSEQUAL                            Yes
		D3DPCMPCAPS_GREATER                              Yes
		D3DPCMPCAPS_NOTEQUAL                             Yes
		D3DPCMPCAPS_GREATEREQUAL                         Yes
		D3DPCMPCAPS_ALWAYS                               Yes
	SrcBlendCaps
		D3DPBLENDCAPS_ZERO                               Yes
		D3DPBLENDCAPS_ONE                                Yes
		D3DPBLENDCAPS_SRCCOLOR                           Yes
		D3DPBLENDCAPS_INVSRCCOLOR                        Yes
		D3DPBLENDCAPS_SRCALPHA                           Yes
		D3DPBLENDCAPS_INVSRCALPHA                        Yes
		D3DPBLENDCAPS_DESTALPHA                          Yes
		D3DPBLENDCAPS_INVDESTALPHA                       Yes
		D3DPBLENDCAPS_DESTCOLOR                          Yes
		D3DPBLENDCAPS_INVDESTCOLOR                       Yes
		D3DPBLENDCAPS_SRCALPHASAT                        Yes
		D3DPBLENDCAPS_BOTHSRCALPHA                       Yes
		D3DPBLENDCAPS_BOTHINVSRCALPHA                    Yes
	DestBlendCaps
		D3DPBLENDCAPS_ZERO                               Yes
		D3DPBLENDCAPS_ONE                                Yes
		D3DPBLENDCAPS_SRCCOLOR                           Yes
		D3DPBLENDCAPS_INVSRCCOLOR                        Yes
		D3DPBLENDCAPS_SRCALPHA                           Yes
		D3DPBLENDCAPS_INVSRCALPHA                        Yes
		D3DPBLENDCAPS_DESTALPHA                          Yes
		D3DPBLENDCAPS_INVDESTALPHA                       Yes
		D3DPBLENDCAPS_DESTCOLOR                          Yes
		D3DPBLENDCAPS_INVDESTCOLOR                       Yes
		D3DPBLENDCAPS_SRCALPHASAT                        Yes
		D3DPBLENDCAPS_BOTHSRCALPHA                       Yes
		D3DPBLENDCAPS_BOTHINVSRCALPHA                    Yes
	AlphaCmpCaps
		D3DPCMPCAPS_NEVER                                Yes
		D3DPCMPCAPS_LESS                                 Yes
		D3DPCMPCAPS_EQUAL                                Yes
		D3DPCMPCAPS_LESSEQUAL                            Yes
		D3DPCMPCAPS_GREATER                              Yes
		D3DPCMPCAPS_NOTEQUAL                             Yes
		D3DPCMPCAPS_GREATEREQUAL                         Yes
		D3DPCMPCAPS_ALWAYS                               Yes
	ShadeCaps
		D3DPSHADECAPS_COLORGOURAUDRGB                    Yes
		D3DPSHADECAPS_SPECULARGOURAUDRGB                 Yes
		D3DPSHADECAPS_ALPHAGOURAUDBLEND                  Yes
		D3DPSHADECAPS_FOGGOURAUD                         Yes
	TextureCaps
		D3DPTEXTURECAPS_PERSPECTIVE                      Yes
		D3DPTEXTURECAPS_POW2                             Yes
		D3DPTEXTURECAPS_ALPHA                            Yes
		D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE         Yes
		D3DPTEXTURECAPS_ALPHAPALETTE                     Yes
		D3DPTEXTURECAPS_CUBEMAP                          Yes
		D3DPTEXTURECAPS_MIPMAP                           Yes
	TextureFilterCaps
		D3DPTFILTERCAPS_MINFPOINT                        Yes
		D3DPTFILTERCAPS_MINFLINEAR                       Yes
		D3DPTFILTERCAPS_MINFANISOTROPIC                  Yes
		D3DPTFILTERCAPS_MIPFPOINT                        Yes
		D3DPTFILTERCAPS_MIPFLINEAR                       Yes
		D3DPTFILTERCAPS_MAGFPOINT                        Yes
		D3DPTFILTERCAPS_MAGFLINEAR                       Yes
	CubeTextureFilterCaps
		D3DPTFILTERCAPS_MINFPOINT                        Yes
		D3DPTFILTERCAPS_MINFLINEAR                       Yes
		D3DPTFILTERCAPS_MIPFPOINT                        Yes
		D3DPTFILTERCAPS_MIPFLINEAR                       Yes
		D3DPTFILTERCAPS_MAGFPOINT                        Yes
		D3DPTFILTERCAPS_MAGFLINEAR                       Yes
	VolumeTextureFilterCaps
	TextureAddressCaps
		D3DPTADDRESSCAPS_WRAP                            Yes
		D3DPTADDRESSCAPS_MIRROR                          Yes
		D3DPTADDRESSCAPS_CLAMP                           Yes
		D3DPTADDRESSCAPS_INDEPENDENTUV                   Yes
	VolumeTextureAddressCaps
	LineCaps
		D3DLINECAPS_TEXTURE                              Yes
		D3DLINECAPS_ZTEST                                Yes
		D3DLINECAPS_BLEND                                Yes
		D3DLINECAPS_ALPHACMP                             Yes
		D3DLINECAPS_FOG                                  Yes
	MaxTextureWidth                                  2048
	MaxTextureHeight                                 2048
	MaxVolumeExtent                                  0
	MaxTextureRepeat                                 2048
	MaxTextureAspectRatio                            2048
	MaxAnisotropy                                    2
	MaxVertexW                                       0.000000000
	GuardBandLeft                                    -2048.00000
	GuardBandTop                                     -2048.00000
	GuardBandRight                                   2047.00000
	GuardBandBottom                                  2047.00000
	ExtentsAdjust                                    0.000000000
	StencilCaps
		D3DSTENCILCAPS_KEEP                              Yes
		D3DSTENCILCAPS_ZERO                              Yes
		D3DSTENCILCAPS_REPLACE                           Yes
		D3DSTENCILCAPS_INCRSAT                           Yes
		D3DSTENCILCAPS_DECRSAT                           Yes
		D3DSTENCILCAPS_INVERT                            Yes
		D3DSTENCILCAPS_INCR                              Yes
		D3DSTENCILCAPS_DECR                              Yes
	FVFCaps
		D3DFVFCAPS_TEXCOORDCOUNTMASK                     Yes
		D3DFVFCAPS_PSIZE                                 Yes
	TextureOpCaps
		D3DTEXOPCAPS_DISABLE                             Yes
		D3DTEXOPCAPS_SELECTARG1                          Yes
		D3DTEXOPCAPS_SELECTARG2                          Yes
		D3DTEXOPCAPS_MODULATE                            Yes
		D3DTEXOPCAPS_MODULATE2X                          Yes
		D3DTEXOPCAPS_MODULATE4X                          Yes
		D3DTEXOPCAPS_ADD                                 Yes
		D3DTEXOPCAPS_ADDSIGNED                           Yes
		D3DTEXOPCAPS_ADDSIGNED2X                         Yes
		D3DTEXOPCAPS_SUBTRACT                            Yes
		D3DTEXOPCAPS_ADDSMOOTH                           Yes
		D3DTEXOPCAPS_BLENDDIFFUSEALPHA                   Yes
		D3DTEXOPCAPS_BLENDTEXTUREALPHA                   Yes
		D3DTEXOPCAPS_BLENDFACTORALPHA                    Yes
		D3DTEXOPCAPS_BLENDTEXTUREALPHAPM                 Yes
		D3DTEXOPCAPS_BLENDCURRENTALPHA                   Yes
		D3DTEXOPCAPS_PREMODULATE                         Yes
		D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR              Yes
		D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA              Yes
		D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR           Yes
		D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA           Yes
		D3DTEXOPCAPS_BUMPENVMAP                          Yes
		D3DTEXOPCAPS_BUMPENVMAPLUMINANCE                 Yes
		D3DTEXOPCAPS_DOTPRODUCT3                         Yes
	MaxTextureBlendStages                            3
	MaxSimultaneousTextures                          3
	VertexProcessingCaps
	MaxActiveLights                                  -1
	MaxUserClipPlanes                                6
	MaxVertexBlendMatrices                           0
	MaxVertexBlendMatrixIndex                        0
	MaxPointSize                                     64.0000000
	MaxPrimitiveCount                                1048575
	MaxVertexIndex                                   1048575
	MaxStreams                                       1
	MaxStreamStride                                  256
	VertexShaderVersion                              0.0
	MaxVertexShaderConst                             0
	PixelShaderVersion                               0.0
	PixelShader1xMaxValue                            1.00000000
	DevCaps2
	MaxNpatchTessellationLevel                       0.000000000
	Reserved5                                        0
	MasterAdapterOrdinal                             0
	AdapterOrdinalInGroup                            0
	NumberOfAdaptersInGroup                          1
	DeclTypes
	NumSimultaneousRTs                               1
	StretchRectFilterCaps
	VertexTextureFilterCaps                          0
	MaxVShaderInstructionsExecuted                   0
	MaxPShaderInstructionsExecuted                   0
	MaxVertexShader30InstructionSlots                0
	MaxPixelShader30InstructionSlots                 0




Derron(Posted 2007) [#11]
Is there an update yet?

My users complain about missing textphrases or rects (things which are displayed with a setalpha of <1.0 - to fade out for example)...

It doesn't occour on all graphiccards but especially on older cards (Geforce2, my old sis651 ... dx7 cards) which benefit on speedups using dx9 but have garbage grabbed and faded parts disappearing.


bye
MB