Skip to content

Commit f21391d

Browse files
committed
hotfix
1 parent 2b1475d commit f21391d

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/renderer/dx12/dx12_renderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ void cg::renderer::dx12_renderer::update()
4848
{
4949
auto now = std::chrono::high_resolution_clock::now();
5050
std::chrono::duration<float> duration = now - current_time;
51-
frame_duration = duration.count();
5251
current_time = now;
52+
frame_duration = duration.count();
5353

5454
cb.mwpMatrix = camera->get_dxm_mvp_matrix();
5555
memcpy(constant_buffer_data_begin, &cb, sizeof(cb));
@@ -72,7 +72,7 @@ ComPtr<IDXGIFactory4> cg::renderer::dx12_renderer::get_dxgi_factory()
7272
UINT dxgi_factory_flags = 0;
7373
#ifdef _DEBUG
7474
ComPtr<ID3D12Debug> debug_controller;
75-
if (SUCCEEDED(IID_PPV_ARGS(&debug_controller)))
75+
if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS(&debug_controller))))
7676
{
7777
debug_controller->EnableDebugLayer();
7878
dxgi_factory_flags |= DXGI_CREATE_FACTORY_DEBUG;

src/world/camera.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,10 @@ const float4x4 cg::world::camera::get_view_matrix() const
7878
#ifdef DX12
7979
const DirectX::XMMATRIX cg::world::camera::get_dxm_view_matrix() const
8080
{
81-
DirectX::XMFLOAT3 eye_position{position.x, position.y, position.z};
82-
DirectX::XMFLOAT3 eye_direction{get_direction().x, get_direction().y, get_direction().z};
83-
DirectX::XMFLOAT3 up_direction{get_up().x, get_up().y, get_up().z};
84-
return DirectX::XMMatrixLookToRH(
85-
DirectX::XMLoadFloat3(&eye_position),
86-
DirectX::XMLoadFloat3(&eye_direction),
87-
DirectX::XMLoadFloat3(&up_direction));
81+
DirectX::FXMVECTOR eye_position{position.x, position.y, position.z};
82+
DirectX::FXMVECTOR eye_direction{get_direction().x, get_direction().y, get_direction().z};
83+
DirectX::FXMVECTOR up_direction{get_up().x, get_up().y, get_up().z};
84+
return DirectX::XMMatrixLookToRH(eye_position,eye_direction,up_direction);
8885
}
8986

9087
const DirectX::XMMATRIX cg::world::camera::get_dxm_projection_matrix() const

0 commit comments

Comments
 (0)