File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ void cg::renderer::dx12_renderer::update()
48
48
{
49
49
auto now = std::chrono::high_resolution_clock::now ();
50
50
std::chrono::duration<float > duration = now - current_time;
51
- frame_duration = duration.count ();
52
51
current_time = now;
52
+ frame_duration = duration.count ();
53
53
54
54
cb.mwpMatrix = camera->get_dxm_mvp_matrix ();
55
55
memcpy (constant_buffer_data_begin, &cb, sizeof (cb));
@@ -72,7 +72,7 @@ ComPtr<IDXGIFactory4> cg::renderer::dx12_renderer::get_dxgi_factory()
72
72
UINT dxgi_factory_flags = 0 ;
73
73
#ifdef _DEBUG
74
74
ComPtr<ID3D12Debug> debug_controller;
75
- if (SUCCEEDED (IID_PPV_ARGS (&debug_controller)))
75
+ if (SUCCEEDED (D3D12GetDebugInterface ( IID_PPV_ARGS (&debug_controller) )))
76
76
{
77
77
debug_controller->EnableDebugLayer ();
78
78
dxgi_factory_flags |= DXGI_CREATE_FACTORY_DEBUG;
Original file line number Diff line number Diff line change @@ -78,13 +78,10 @@ const float4x4 cg::world::camera::get_view_matrix() const
78
78
#ifdef DX12
79
79
const DirectX::XMMATRIX cg::world::camera::get_dxm_view_matrix () const
80
80
{
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);
88
85
}
89
86
90
87
const DirectX::XMMATRIX cg::world::camera::get_dxm_projection_matrix () const
You can’t perform that action at this time.
0 commit comments