mirror of
				https://github.com/Ryujinx/SDL.git
				synced 2025-11-04 12:44:56 +00:00 
			
		
		
		
	direct3d11: Set the swapchain target immediately after creating it.
Fixes #4782
This commit is contained in:
		
							parent
							
								
									cb81630816
								
							
						
					
					
						commit
						ba0ba9ef16
					
				| 
						 | 
					@ -998,6 +998,16 @@ D3D11_CreateWindowSizeDependentResources(SDL_Renderer * renderer)
 | 
				
			||||||
        goto done;
 | 
					        goto done;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /* Set the swap chain target immediately, so that a target is always set
 | 
				
			||||||
 | 
					     * even before we get to SetDrawState. Without this it's possible to hit
 | 
				
			||||||
 | 
					     * null references in places like ReadPixels!
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    ID3D11DeviceContext_OMSetRenderTargets(data->d3dContext,
 | 
				
			||||||
 | 
					        1,
 | 
				
			||||||
 | 
					        &data->mainRenderTargetView,
 | 
				
			||||||
 | 
					        NULL
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    data->viewportDirty = SDL_TRUE;
 | 
					    data->viewportDirty = SDL_TRUE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
done:
 | 
					done:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue