Developing Games on Intel Graphics
If you are gaming on graphics integrated in your Intel Processor, this is the place for you! Find answers to your questions or post your issues with PC games
508 Discussions

Direct3D9 StretchRect and ID3DXFont issues

Steve_Browne
Beginner
1,179 Views
I'm having a problem with my application which displays several video streams from cameras at once. The problem so far has only been seen with Intel HD Graphics chipsets and I'm using the latest drivers (1/10/2012 - 8.15.10.2622)although its been seen with older drivers as well. I have not seen these problems with other Intel chipsets or NVIDIA or ATI cards in testing. This seems to be very specific to the Intel HD Graphics chipsets.

There are basically two problems. The first one is that IDirect3DSwapChain9::Present will sometimes fail with E_FAIL. This results in some things not getting displayed. Usually only noticable on paused video if the video needs to be redrawn. If this happens I can simply call Present again immediately after failing and everything is fine.

The other problem is that my ID3DXFont text gets garbled and/or disappears. See theattached screenshots for examples of this. Usually the garbled text will eventually correct itself, but then certain characters will be missing. So if you were to watch the time countup thenfor instance the numbers7, 8, and 9 may not display.I've done a lot of testing and both of these errors only appear if I'm doing a StretchRect to convert NV12, YV12, or I420 to RGB. If I remove the StretchRect call or simply use UYVY or YUY2 formats then neither problem happens. The other thing that I've found is if I do my present hack after StretchRect and then do another present after I've done all the DrawText calls then the text will not be garbled. However, because I'm doing 2 present calls in my render loop at that point it causes the text to occassionally flash.

I've also enabled debugging in Direct3D and the ONLY error or warning comes up in the Present call. Unfortunately I can't provide the full code, but if you need any snippets please let me know. Here's thefull debug output when this happens:

[1928] Direct3D9: :====> ENTER: DLLMAIN(64e6d9a0): Process Attach: 00000788, tid=00000aa0

[1928]

[1928] Direct3D9: :====> EXIT: DLLMAIN(64e6d9a0): Process Attach: 00000788

[1928]

[1928] Direct3D9: (INFO) :Direct3D9 Debug Runtime selected.

[1928]

[1928] 9:53:00 AM: Adapter 0, Monitor 0x00010001: Current Monitor = Yes, Position: (436, 69), Monitor Area = (0, 0) (1920, 1080), Work Area = (0, 0) (1920, 1040), Flags: 1

[1928] 9:53:00 AM: Direct3D Capabilities - Adapter Name: Intel HD Graphics Family

[1928] 9:53:00 AM: Direct3D Capabilities - Driver Version: igdumdx32.dll (8.15.10.2622)

[1928] 9:53:00 AM: Direct3D Capabilities - Max Texture Size: 8192x8192

[1928] 9:53:00 AM: Direct3D Capabilities - Non Power of 2 Supported: Yes

[1928] 9:53:00 AM: Direct3D Capabilities - Square Textures Only: No

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_NV12 (22) Supported: Yes

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_YV12 (23) Supported: Yes

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_YUV420P (0) Supported: Yes

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_YUV422 (1) Supported: Yes

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_UYV422 (21) Supported: Yes

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_BGR24 (3) Supported: No

[1928] 9:53:00 AM: Direct3D Capabilities - Format PIXEL_TYPE_RGBA32 (6) Supported: Yes

[1928] Direct3D9: (INFO) :======================= Hal HWVP device selected

[1928]

[1928] Direct3D9: (INFO) :HalDevice Driver Style b

[1928]

[1928] Direct3D9: :DoneExclusiveMode

[1928]

[1928] Direct3D9: (INFO) :Using FF to VS converter

[1928]

[1928] Direct3D9: (INFO) :Using FF to PS converter

[1928]

[1928] Direct3D9: (INFO) :Enabling multi-processor optimizations

[1928]

[1928] D3D9 Helper: Warning: Default value for D3DRS_POINTSIZE_MAX is 2.19902e+012f, not 8.79908e-316f. This is ok.

[1928] Direct3D9: :DoneExclusiveMode

[1928]

[1928] D3DX: Unicode support: 1

[1928]

[1928] Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present

[1928]

[1928] D3D9 Helper: IDirect3DSwapChain9::Present failed: E_FAIL

[1928] 9:53:00 AM: Direct3D Error - Direct3D failed to present.: An undetermined error occurred (0x80004005)

[1928] Direct3D9: (ERROR) :BitBlt or StretchBlt failed in Present

0 Kudos
1 Reply
Joel2
Beginner
1,178 Views
I have exactly the same problem converting YV12 to the RGB render target using StretchRect(). Subsequent call to Present() randomly fails with HRESULT 80004005 resulting in the window not being refreshed. This issue is still present in the latest published driver 9.17.10.2875. Attached the system report. Any update on this issue ?
0 Kudos
Reply