Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/graphicsdriver/directx: crash at the end of the frame #2447

Closed
1 of 10 tasks
hajimehoshi opened this issue Nov 11, 2022 · 1 comment
Closed
1 of 10 tasks

internal/graphicsdriver/directx: crash at the end of the frame #2447

hajimehoshi opened this issue Nov 11, 2022 · 1 comment

Comments

@hajimehoshi
Copy link
Owner

hajimehoshi commented Nov 11, 2022

Ebitengine Version

v2.5.0-alpha.5

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • Xbox
  • Web Browsers

Go Version (go version)

Go 1.19.3

What steps will reproduce the problem?

Just launching a game (@wasedaigo's application here)

What is the expected result?

No crash

What happens instead?

Exception 0xc0000005 0x0 0x80 0x7ffe4cfec9a8                                                                                                                                                                                                                                      
PC=0x7ffe4cfec9a8                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                      
runtime.cgocall(0xb17f40, 0x17a6b20)                                                                                                                                                                                                                                                  
        runtime/cgocall.go:158 +0x4a fp=0xc0005298d0 sp=0xc000529898 pc=0xab48ea                                                                                                                                                                                                      
syscall.SyscallN(0x7ffeaa665270?, {0xc000529968?, 0x3?, 0xc000066000?})                                                                                                                                                                                                               
        runtime/syscall_windows.go:557 +0x109 fp=0xc000529948 sp=0xc0005298d0 pc=0xb13169                                                                                                                                                                                             
syscall.Syscall(0xc0005299d8?, 0x40bdb969096bb98d?, 0x11?, 0x0?, 0x170a732e840?)                                                                                                                                                                                                      
        runtime/syscall_windows.go:495 +0x3b fp=0xc000529990 sp=0xc000529948 pc=0xb12d7b                                                                                                                                                                                              
github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/directx.(*_IDXGISwapChain4).Present(0xc000529a28?, 0xb12d7b?, 0x0?)                                                                                                                                                          
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/graphicsdriver/directx/api_windows.go:2722 +0x38 fp=0xc0005299e0 sp=0xc000529990 pc=0xd40818                                                                                                                         
github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/directx.(*Graphics).presentDesktop(0xc0002a1680)                                                                                                                                                                             
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/graphicsdriver/directx/graphics_windows.go:823 +0x76 fp=0xc000529a38 sp=0xc0005299e0 pc=0xd43936                                                                                                                     
github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/directx.(*Graphics).End(0xc0002a1680, 0x1)                                                                                                                                                                                   
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/graphicsdriver/directx/graphics_windows.go:778 +0x225 fp=0xc000529ac0 sp=0xc000529a38 pc=0xd43785                                                                                                                    
github.com/hajimehoshi/ebiten/v2/internal/graphicscommand.(*commandQueue).flush.func1()                                                                                                                                                                                               
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/graphicscommand/command.go:195 +0x3c fp=0xc000529b40 sp=0xc000529ac0 pc=0xcc163c                                                                                                                                     
github.com/hajimehoshi/ebiten/v2/internal/graphicscommand.(*commandQueue).flush(0x17a5e60, {0x12a3018?, 0xc0002a1680?}, 0x1)                                                                                                                                                          
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/graphicscommand/command.go:256 +0x492 fp=0xc000529d40 sp=0xc000529b40 pc=0xcc1052                                                                                                                                    
github.com/hajimehoshi/ebiten/v2/internal/graphicscommand.(*commandQueue).Flush.func1()                                                                                                                                                                                               
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/graphicscommand/command.go:169 +0x32 fp=0xc000529d78 sp=0xc000529d40 pc=0xcc0b72                                                                                                                                     
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop.func1(0xc000529de8?, 0xc000529dd8?)                                                                                                                                                                                 
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/thread/thread.go:54 +0x53 fp=0xc000529da8 sp=0xc000529d78 pc=0xd330b3                                                                                                                                                
github.com/hajimehoshi/ebiten/v2/internal/thread.(*OSThread).Loop(0xc000375560)                                                                                                                                                                                                       
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/thread/thread.go:55 +0x2e fp=0xc000529e18 sp=0xc000529da8 pc=0xd32fce                                                                                                                                                
github.com/hajimehoshi/ebiten/v2/internal/ui.(*userInterfaceImpl).Run(0x17a6420, {0x12a07f0?, 0xc0002ac000})                                                                                                                                                                          
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/internal/ui/run_notsinglethread.go:52 +0x231 fp=0xc000529e78 sp=0xc000529e18 pc=0xd661d1                                                                                                                                      
github.com/hajimehoshi/ebiten/v2.RunGame({0x129d430, 0xc000375260})                                                                                                                                                                                                                   
        github.com/hajimehoshi/ebiten/v2@v2.5.0-alpha.5/run.go:223 +0x9d fp=0xc000529ee8 sp=0xc000529e78 pc=0xd7ac1d                                                                                                                                                                  
main.main()                                                                                                                                                                                                                                                                           
        github.com/wasedaigo/rpgsnack-runtime/main.go:119 +0x305 fp=0xc000529f80 sp=0xc000529ee8 pc=0x1045985                                                                                                                                                                         
runtime.main()                                                                                                                                                                                                                                                                        
        runtime/proc.go:250 +0x1fe fp=0xc000529fe0 sp=0xc000529f80 pc=0xaeb41e                                                                                                                                                                                                        
runtime.goexit()                                                                                                                                                                                                                                                                      
        runtime/asm_amd64.s:1594 +0x1 fp=0xc000529fe8 sp=0xc000529fe0 pc=0xb16661 

Anything else you feel useful to add?

The user's machine:

  • Intel HD Graphics 4000
  • GeForce GTX 675M
@hajimehoshi hajimehoshi added this to the v2.5.0 milestone Nov 11, 2022
@hajimehoshi
Copy link
Owner Author

@hajimehoshi hajimehoshi modified the milestones: v2.5.0, v2.4.13 Nov 16, 2022
hajimehoshi added a commit that referenced this issue Nov 16, 2022
The DirectX initialization passed but crashed later on some old machines
supporting the feature level 11 but not 12.

This change fixes the issue by changing the required feature level from
11 to 12 so that the initialization fails and OpenGL is used as the
fallback.

Closes #2447
hajimehoshi added a commit that referenced this issue Nov 20, 2022
A fix for #2447 was a breaking-change as the DirectX driver was no longer
available for some old graphics card.

To support such old cards, provide a new environment variable
EBITENGINE_DIRECTX_FEATURE_LEVEL to specify a feature level.
The possible values are 11_0, 11_1, 12_0, 12_1, and 12_2. The default
value is 12_0.

Closes #2466
hajimehoshi added a commit that referenced this issue Nov 20, 2022
A fix for #2447 was a breaking-change as the DirectX driver was no longer
available for some old graphics card.

To support such old cards, provide a new environment variable
EBITENGINE_DIRECTX_FEATURE_LEVEL to specify a feature level.
The possible values are 11_0, 11_1, 12_0, 12_1, and 12_2. The default
value is 12_0.

Closes #2466
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant