Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / d3d9.dll crash (shaders?)

Author
Message
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 6th Mar 2014 15:36
I have the exact same problem: http://forum.thegamecreators.com/?m=forum_view&t=196036&b=1#post

I used one .fx file, but disablng that did not solve anything. The weird thing is that I have Windows 7 on my laptop and it works fine. Two other Win7 machines crash, one a bit quicker than the other.

Any suggestions?

Dutch
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 7th Mar 2014 11:31
I'm fairly confident a crash emanating from d3d9.dll doesn't necessarily have to be due to a shader issue.
Try putting debug logging into your code to narrow down the place at which the crash happens and go from there, it will make things quite easier most of the time.


"Why do programmers get Halloween and Christmas mixed up?"
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Mar 2014 12:32
If it's to do with shaders then it could be because some of the shaders you're using use PS1 or VS1. Some modern machines and DX9 versions might require VS2 and PS2 or above. I'd check the shaders before doing anything else.

But I don't really see why a broken shader should cause a crash - usually you just get strange visuals.

I don't have problems using early versions of shaders on my W7 laptop - but some software does such as the latest version of Dark Shader which now requires VS2/PS2 at least.



Powered by Free Banners
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 10th Mar 2014 12:07
This is the culprit on a portrait mode screen:

center text screen width()/2,screen height()-50,"Blabla "

Deleted this and it worked as it should...

Dutch
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Mar 2014 15:34
Weird.

What happens if you type that line back in again?



Powered by Free Banners
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Mar 2014 16:05
The strange things is that somewhere else in the code I use it and it works. But not in the loop before that. So it isn't the fact that it is a portrait mode screen...

Also, it works perfectly on my laptop, another pc, but not on two other ones, with the same DirectX...

I hate these bugs... So hard to find and they make no sense at all...

Dutch
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Mar 2014 16:21
It also crashed with no message on loading 10 large bitmaps (7000 x 2000) when using them as 10 seperate textures for 3D models. Loading these images and using 10 smaller textures (25%) for the objects works fine, so its not memory related.

I've seem to reached the limits of DBPro with my app, constantly building work arounds and alternative ways... Thankfully most of the big issues are solved.

Dutch
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Mar 2014 16:59
Quote: "10 large bitmaps (7000 x 2000) "

Doesn't work..
Quote: "10 smaller textures (25%)"

Works..


Are you sure it's not memory related? 53Mb per image is quite large, especially since there is other assets the graphics card needs to store, not forgetting the screen surface itself...

marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 11th Mar 2014 17:28
Not memory related I think, as the 10 big and 10 small ones all load and it works. If I put all 10 on the screen as a textured flat object, the program crashes. Might be due to the fact that when loading they just go into main memory, but when used as a texture they are entered into graphics memory. Just a wild guess...

Dutch
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 10:42 Edited at: 12th Mar 2014 11:21
Quote: "and it works"


I'm confused now. What is this "it" that works.

Quote: "If I put all 10 on the screen as a textured flat object"


What exactly do you mean by that? Could you give us some short simple code which shows the problem so we can test it (we can supply our own images I guess).

Certainly 7000x2000 pixel images will each consume a lot of memory - especially if mipmaps are used as well. Perhaps a different image format might help? What format are you using?

With mipmaps included, each texture will use roughly 112MB of memory so 10 of these will consume over 1GB if simultaneously sent to the GFX card. Why do you think memory isn't the issue?

Edit Sorry. Lost count of my toes this morning . Each image in the default ARGB format will use about 73MB with mipmaps so 10 of those will consume about 730MB without anything else on screen. The question still stands though: why do you think memory isn't an issue?



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 12:24
Just done some testing on my laptop. If I try to load about 18 or 19 7000x2000 *.png images the program fails to load them. If I convert the images to a compressed DDS format (such as DXT5) then I can load many more (I tested up to 30). I couldn't get the program to crash except at the loading stage - but then you haven't told us how you are using your images. We really do need to see short complete runnable code which exhibits the problem.

If you're wanting to get 10 7000x2000 images on the screen simultaneously I strongly suggest you consider using a compressed DDS format. But, in any case, why do you need such a high resolution if you're going to have 10 such images on the screen simultaneously? Aren't you losing a lot of that resolution anyway?



Powered by Free Banners
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 12th Mar 2014 13:17
I wanted to see if I could do just with the hires textures, instead of having to load another set with lower res. Loading images of that size takes a lot of time, so I need them all in memory.

Here's my (old crashing) loading code:



Dutch
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Mar 2014 13:21


Try running this on all your systems...

also try pulling your max pixel shader versions and max vertex shader versions

On my Surface Pro 2 I get 8192 for both width and height with an Intel 4200U HD 4400 Graphics

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 15:05
Quote: "Here's my (old crashing) loading code:"


What is the value of the variable paintings?

Try using compressed DDS files instead of jpg files. DDS image files load far faster as well since they are the native DirectX format.

Why do you need both sets of images? Since you seem to be using shaders anyway, why not force a lower mipmap level when you use the image in the shader? Mipmaps are simply lower resolution versions of the main image - and you have a choice of resolutions to use. Your 7000x200 image would be loaded with 13 mipmaps available. Why not use them?



Powered by Free Banners
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 15:07
@MrValentine

I get 8192 on my laptop too - but that isn't the issue.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Mar 2014 15:13
Ouch GG, just trying to help...



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 15:26
We all have our moments - as illustrated here:

counting problem





Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 12th Mar 2014 15:30
LOL

marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 12th Mar 2014 16:08
Holy crap Gandalf! I just converted the hires to DDS (DXT5 or something) and my loading time just got pulverized!
Awesome tip!

Just to be clear, I'm sort of a beginner at DirectX and this is my first real project in DBpro. You help is appreciated beyond belief

Dutch
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 16:12
You're welcome.



Powered by Free Banners
marvin944
12
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 12th Mar 2014 16:25
I need both set of textures as I move from a 3D environment into a 2D. In 3D the lores is fine, but has a slightly different image than the 2D hires version. So I need to switch between those two. The 3D image flies into the camera and then changes to hires 2D.

Sorry if I don't make sense, I can't really show much of the code or screenshots as this is sort of a 'secret' project. What I do know is that the first user will be a king (I kid you not), with a lot of press coverage alongside, so f*cking up is not an option and I need to get the most out of DBpro as I don't have the budget to go Unity.

So far it's coming along real fine and DBpro is growing on me. I'm glad this is an active forum with lots of tips. I'm sorry if I cannot answer all of your questions, but I will keep you informed on how things are coming along.

Dutch
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 12th Mar 2014 20:05
Fine.

If it's important to keep the main code under wraps (which we all understand) then you can usually construct a simpler different demo to highlight the problem you're wrestling with. Doesn't always work I know.

Good luck with this - and let us all know how you get on. You've got our attention now.



Powered by Free Banners

Login to post a reply

Server time is: 2026-07-06 05:24:35
Your offset time is: 2026-07-06 05:24:35