   Locking up of Win98 if use D3DUSAGE_WRITEONLY for vertex buffer
  PC with Win98 and ATI Radeon 9600XT totally locks up after several seconds ofour game, if I create CreateVertexBuffer with flags D3DUSAGE_DYNAMIC andD3DUSAGE_WRITEONLY.I show colored triangles (3 verticies). Windowed screen mode.Of course, I Lock vertex buffer with DISCARD flag!If I remove D3DUSAGE_WRITEONLY flag (but keep D3DUSAGE_DYNAMIC) all worksfine.Is there any explanation of this problem?Because exactly this PC, but under WinXP works fine (the problem only underWin98)   
  As far as I know the flags should be used exclusively and not combined. After all, a dynamic resource allows reading and writing so it already covers the functionality of a write-only resource. It could be that the wrong use of the flags is a problem in Win98 while not in XP. How about DX versions on both OSs by the way?Anyway, you should lock with either one of the flags, depending on what you want. If you want to be able to read and write, use D3DUSAGE_DYNAMIC. If you don't care about reading but want to write, use D3DUSAGE_WRITEONLY.Illco   ;  The flags are not mutually-exclusive. In fact, using only of them is bad practice. D3DUSAGE_DYNAMIC means that the vertex buffer changes often, i.e. often gets written to. Only default pool buffers can be dynamic, and default-pool resources are typically very expensive to read from - so you need D3DUSAGE_WRITEONLY to say that the resource is only used for writing.Quote:Documentation page for D3DUSAGEBuffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY might suffer a severe performance penalty.Regarding the original question: That's either a driver or a runtime bug. Contact ATi about this first, and see what they come back with.   ;  I was not right. All variants, DEFAULT_POOL + DYNAMIC, DEFAULT_POOL + DYNAMIC | WRITEONLY. Or MANAGED - all these variant produces locking ups.Our game (DX 8.1 headers) shows textured quads and color semi-transparent triangles.I just noticed if I temporally remove drawing of colored triangles - NO LOCK UPS anymore! It seems to be a bug of ATI drivers under Windows 98.Here is a code which draws colored semi-transparent (with alpha) triangles (in Pascal):-----------Lock<...>UnlockDevice.SetStreamSource(0, fQuadVert, SizeOf(TCUSTOMVERTEX))SetVertexShader(D3DFVF_COLORVERTEX)SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD);SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);SetRenderState(D3DRS_LIGHTING,Cardinal(LongBool(False)));SetRenderState(D3DRS_ALPHABLENDENABLE, Cardinal(True));DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1);  + Any chance you're leaking memory in some way? this could explain the length of time it takes before it locks up, though it is quite a stretch since it only happens with more than 1 flag. + Are you only creating the buffer once? + From what I read from your code, you're locking every frame. Any chance you're not deallocating memory?+ I'm not sure what language you're programming in, but can you enable debug output?   ;  Thanks for your responses.We carefully checked up with MemProof and in profiler - no memory leaks at all.We create Vertex buffer one time when application starts.Yes, we set new coordinates every frame for every triangle. Our task requires it.   ;  If you lock without Discard, does that make a difference?   ;  No difference. With or witout DISCARD (DYNAMIC + DEFAUL_POOL) and MANAGED without DISCARD, all variants locks up Win98.By the way, you can see that we call SetStreamSource for drawing of every triangle. Maybe we need to set it to NULL?But we have one time created vertex buffer.   ;  I just downloaded newest December CTP DirectX SDK and tried to run my application in Direct3D DEBUG mode.Now I see that this code where I draw those colored triangles doesn't work:D3DERR_INVALIDCALL в DrawPrimitive(D3DPT_TRIANGLELIST, 0, 1)I temporarily disabled this line and now it works in debug mode DirectX too.What it means?  I know that this place in our program reason of the problem with ATI radeon on Win98 and debug DirectX says about this place.It seems that I found reason of the problem.I have two FVF for textured quads and for colored quads:  D3DFVF_CUSTOMVERTEX = D3DFVF_XYZ or D3DFVF_DIFFUSE or D3DFVF_TEX1;  D3DFVF_COLORVERTEX  = D3DFVF_XYZ or D3DFVF_DIFFUSE;If I will use D3DFVF_CUSTOMVERTEX for both types of quads - no problem anymore!So I suspect that I have some texture stage parameters for textured quads, and then I try to draw colored quads with FVF D3DFVF_COLORVERTEX I have the problem.[Edited by - Malder1 on December 13, 2005 4:57:50 PM];  The problem is solved!I have verticies with two various FVF - D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 - D3DFVF_XYZ or D3DFVF_DIFFUSEAnd ONE vertex buffer created for D3DFVF_XYZ or D3DFVF_DIFFUSE or D3DFVF_TEX1So when I tried to switch vertex buffer to another FVF I have a problem!Stupid mistake.   