• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
dario_ramos

Present fails randomly on C++ Direct3D9 app

5 posts in this topic

I have a mixed .NET application (managed and unmanaged code bridged by C++/CLI wrappers) which uses unmanaged Direct3D9 9.0c to do rendering inside a control which is wrapped inside a C++/CLI class which extends System.WIndows.Forns.UserControl.

Everything has been working fine for years now, but I recently put another instance of this Direct3D9 control inside a new Windows Form. That is, I have two concurrent instances of the control. I had done that before and it worked, but now I have issues. Perhaps the problem was always there, but because it's related to a race condition, it started happening now...

Ok, the details: When I try to render an image over a texture on the new instance of the control, sometimes it works, sometimes it doesn't. And when it doesn't, nothing is rendered, and from that point onwards, all Present calls fail (I log those failures). If I close the form and open it again, it might work or not. Nasty.

If I use DXGetErrorString and DXGetErrorDescription, all I get is something like:

EFAILED Undetermined error

Not really helpful... To make matters worse, I can't reproduce the issue in my development environment; I only see it in a production box.

As far as I know, the main reason Present fails like this is a Lost Device. But I implemented the usual scheme to handle that (I can post the code if necessary), and it seems like the device is not being lost... What else can I try?
0

Share this post


Link to post
Share on other sites
[b]Hi![/b]

Often applications fail randomly on bad pointers. I think you know it...
Maybe you would reinvestigate your code.

The other idea, not enough resources, VideoRAM. etc.
Please consider checking the debug console, also.
0

Share this post


Link to post
Share on other sites
It sounds possible that it's a hardware / driver issue. I'd try updating the driver on the machine that's failing first. If possible try replacing the graphics card too.

Out of curiosity which card / driver version is causing the problems?
1

Share this post


Link to post
Share on other sites
[quote name='kubera' timestamp='1335466667' post='4935168']
Often applications fail randomly on bad pointers. I think you know it...
Maybe you would reinvestigate your code.
[/quote]

If that were the case, the app would most surely crash. But it doesn't. Sometimes it renders, sometimes it doesn't. It never crashes. Based on that, I ruled out access violations, undefined behavior, and the like.


[quote name='kubera' timestamp='1335466667' post='4935168']
The other idea, not enough resources, VideoRAM. etc.
Please consider checking the debug console, also.
[/quote]

Same consideration. If resources were running out, the app wouldn't recover, or would stop rendering completely. As for checking the debug output of the runtime, that would be great, but the error only happens in a client's machine where only the Direct3D redistributable is installed. Since we operate it remotely and it's in another country, installing software is a hassle. If there is a way to capture Direct3D debug output without installing anything, I'm all eyes. Anyway, as a last resort, we could install the SDK and PIX... When we get desperate enough :P


[quote name='Adam_42' timestamp='1335469573' post='4935192']
It sounds possible that it's a hardware / driver issue. I'd try updating the driver on the machine that's failing first. If possible try replacing the graphics card too.
[/quote]

Good idea. It'll be quite a hassle, since we'll have to log remotely to the client machine, and maybe ask the operator over there to try changing the card. But I'll give it a shot and post back.

[quote name='Adam_42' timestamp='1335469573' post='4935192']
Out of curiosity which card / driver version is causing the problems?
[/quote]

I'll post this info tomorrow when I log remotely.
0

Share this post


Link to post
Share on other sites
[quote name='dario_ramos' timestamp='1335473692' post='4935215']
If resources were running out, the app wouldn't recover, or would stop rendering completely.
[/quote]
I am no sure.
I remember an issue on the Intel GPU.
I could not render all textures. The surface become white. After closing a few instances, others started working properly.
(I think that it was done without devices recreation)
The test was made on many instances of the same Direct3D9c app. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

P. S.
I think you are right. Everything should be checked.
Good luck.
1

Share this post


Link to post
Share on other sites
@[url="http://www.gamedev.net/user/105081-adam_42/"]Adam_42[/url]: It's an [color=#000000][font=arial, sans-serif][size=3]Nvidia quadro NVS 290, drivers version: [/size][/font][/color][color=#000000][font=arial, sans-serif][size=3]6.14.12.7533[/size][/font][/color]
[color=#000000][font=arial, sans-serif][size=3]@Everyone: We made a little change and the error seems to have disappeared. When getting the viewport dimensions, we were using ::GetWindowRect instead of ::GetClientRect. Now that we're using the second function, the error seems to not happen anymore. We came up with this idea when we compared the differences between the client's software version and ours. If the error happens again, I'll try your suggestions, that is, updating graphic drivers first, checking debgu spew later.[/size][/font][/color]
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0