acctually enable vsync
This commit is contained in:
parent
3277640f55
commit
4de2ebf954
1 changed files with 9 additions and 1 deletions
|
@ -191,7 +191,7 @@ impl DirectXRenderer {
|
||||||
self.devices
|
self.devices
|
||||||
.device_context
|
.device_context
|
||||||
.OMSetRenderTargets(Some(&self.resources.render_target_view), None);
|
.OMSetRenderTargets(Some(&self.resources.render_target_view), None);
|
||||||
let result = self.resources.swap_chain.Present(0, DXGI_PRESENT(0));
|
let result = self.resources.swap_chain.Present(1, DXGI_PRESENT(0));
|
||||||
// Presenting the swap chain can fail if the DirectX device was removed or reset.
|
// Presenting the swap chain can fail if the DirectX device was removed or reset.
|
||||||
if result == DXGI_ERROR_DEVICE_REMOVED || result == DXGI_ERROR_DEVICE_RESET {
|
if result == DXGI_ERROR_DEVICE_REMOVED || result == DXGI_ERROR_DEVICE_RESET {
|
||||||
let reason = self.devices.device.GetDeviceRemovedReason();
|
let reason = self.devices.device.GetDeviceRemovedReason();
|
||||||
|
@ -506,6 +506,14 @@ impl DirectXRenderer {
|
||||||
.context("Failed to get gpu driver info")
|
.context("Failed to get gpu driver info")
|
||||||
.log_err()
|
.log_err()
|
||||||
.unwrap_or("Unknown Driver".to_string());
|
.unwrap_or("Unknown Driver".to_string());
|
||||||
|
match unsafe {
|
||||||
|
self.devices
|
||||||
|
.device
|
||||||
|
.CheckMultisampleQualityLevels(RENDER_TARGET_FORMAT, MULTISAMPLE_COUNT)
|
||||||
|
} {
|
||||||
|
Ok(level) => println!("=> Multisample quality levels: {}", level),
|
||||||
|
Err(err) => println!("Failed to check multisample quality levels: {:?}", err),
|
||||||
|
}
|
||||||
Ok(GpuSpecs {
|
Ok(GpuSpecs {
|
||||||
is_software_emulated,
|
is_software_emulated,
|
||||||
device_name,
|
device_name,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue