Skip to content

Commit

Permalink
1.4
Browse files Browse the repository at this point in the history
* Add capture output folder to settings.ini to store information for next launch.

* Add in-use API to overlay.

* Only load either 32 or 64 bit vulkan layer.

* Update Vulkan API version in layer descriptions.

* Add known issue about gathering of system spec information.

* Check if open sub registry key returns valid key for implicit layers.

* Fix Win7 issue.

* Intermediate builds increase 3rd component of version number instead of 4th.

* Add 95th-percentile and 99.9-percentile frame time to performance summary output.

* Add Application recovery for inactivating implicit Vulkan layers in case of OCAT crash.

* Use ComPtr to temporary store context state when using immediate context for DX11 overlay.

* Add missing comma to perf_summary.csv

* Send capture time to overlay, so capture red dot disappears and capture end message appears on overlay when capture stops due to time out.

* Add colored bar to overlay, changing colors each frame.

* Change color sequence.

* Add frame times graph to overlay.

* Update frame time graph data also if graph is not displayed.

* Fix FPS drop on certain games when overlay is enabled.

* Change keyboard hook mechanism to send WM_HOTKEY to the message queue. Hotkey now exclusively owns the key.

* Fix FPS drop on DX12. Skip presents on DX11 that are discarded.

* Show error message when F12 is chosen as hotkey - F12 is a reserved key and cannot be used as hotkey anymore.

* Skip discarded presents entirely, since it could cause FPS drop.

* Update known issues section: RotTR flickering overlay issue.

* Add audio cue at start and end of capture.

* Fix sound copy cmd after building for 32bit

* Fix linker issue.

* Add scale indicator to frame graph.

* Fix formatting issue with frame graph. Hide frame graph and colored bar when hook is disabled.

* 1.4

* Update the changelog with 1.4 release notes

* Drop Version.Revision from the printed UI version
  • Loading branch information
Rys Sommefeldt committed Mar 15, 2019
1 parent c9a69ca commit 843556d
Show file tree
Hide file tree
Showing 42 changed files with 1,094 additions and 697 deletions.
6 changes: 3 additions & 3 deletions Commons/Config/Config.cpp
Expand Up @@ -39,10 +39,10 @@ bool Config::Load(const std::wstring& path)
const auto fileName = (path + g_iniFile);

if (FileExists(fileName)) {
hotkey_ = GetPrivateProfileInt(L"Recording", L"hotkey", hotkey_, fileName.c_str());
hotkey_ = GetPrivateProfileInt(L"Recording", L"toggleCaptureHotkey", hotkey_, fileName.c_str());
toggleOverlayHotKey_ = GetPrivateProfileInt(L"Recording", L"toggleOverlayHotkey", toggleOverlayHotKey_, fileName.c_str());
recordingTime_ = GetPrivateProfileInt(L"Recording", L"recordTime", recordingTime_, fileName.c_str());
recordAllProcesses_ = ReadBoolFromIni(L"Recording", L"recordAllProcesses", recordAllProcesses_, fileName.c_str());
recordingTime_ = GetPrivateProfileInt(L"Recording", L"captureTime", recordingTime_, fileName.c_str());
recordAllProcesses_ = ReadBoolFromIni(L"Recording", L"captureAllProcesses", recordAllProcesses_, fileName.c_str());
overlayPosition_ = GetPrivateProfileInt(L"Recording", L"overlayPosition", overlayPosition_, fileName.c_str());

g_messageLog.LogInfo("Config", "file loaded");
Expand Down
6 changes: 4 additions & 2 deletions Commons/Config/Config.h
Expand Up @@ -32,8 +32,10 @@ enum class Verbosity {
};

struct Config {
unsigned int hotkey_ = 0x7A;
unsigned int toggleOverlayHotKey_ = 0x50; // P
unsigned int hotkey_ = 0x79; // F10
unsigned int toggleOverlayHotKey_ = 0x78; // F9
unsigned int toggleGraphOverlayHotKey_ = 0x76; // F7
unsigned int toggleBarOverlayHotKey_ = 0x77; // F8
unsigned int recordingTime_ = 0;
bool recordAllProcesses_ = true;
unsigned int overlayPosition_ = 2;
Expand Down
12 changes: 10 additions & 2 deletions Commons/Overlay/OverlayMessage.h
Expand Up @@ -22,7 +22,7 @@

#pragma once

#include <windows.h>
#include <Windows.h>

// Keep in sync with OverlayMessageType in Frontend.
enum class OverlayMessageType
Expand All @@ -38,11 +38,19 @@ enum class OverlayMessageType
// Visibility of the overlay while active
ShowOverlay,
HideOverlay,
// Visibility of the bar overlay while active
ShowGraphOverlay,
HideGraphOverlay,
// Visibility of the bar overlay while active
ShowBarOverlay,
HideBarOverlay,
// Position of the overlay while active
UpperLeft,
UpperRight,
LowerLeft,
LowerRight
LowerRight,
// Capture time
CaptureTime
};

class OverlayMessage
Expand Down
9 changes: 7 additions & 2 deletions Commons/Overlay/VK_Environment.cpp
Expand Up @@ -28,7 +28,8 @@
namespace {
const wchar_t g_vkEnvPath[] = L"VK_LAYER_PATH";
const wchar_t g_vkEnvLayers[] = L"VK_INSTANCE_LAYERS";
const wchar_t g_vkLayerValue[] = L"VK_LAYER_OCAT_overlay32;VK_LAYER_OCAT_overlay64";
const wchar_t g_vkLayerValue32[] = L"VK_LAYER_OCAT_overlay32";
const wchar_t g_vkLayerValue64[] = L"VK_LAYER_OCAT_overlay64";
const wchar_t g_vkEnvOcat[] = L"OCAT_VULKAN_LAYER_ENABLED";
const wchar_t g_vkEnvOcatEnabled[] = L"1";
}
Expand All @@ -37,7 +38,11 @@ void VK_Environment::SetVKEnvironment(const std::wstring& dllDirectory)
{
const auto dir = dllDirectory.substr(0, dllDirectory.find_last_of('\\'));
originalEnvironment_.path = WriteEnvironmentVariable(g_vkEnvPath, dir, true);
originalEnvironment_.layers = WriteEnvironmentVariable(g_vkEnvLayers, g_vkLayerValue, true);
#if _WIN64
originalEnvironment_.layers = WriteEnvironmentVariable(g_vkEnvLayers, g_vkLayerValue64, true);
#else
originalEnvironment_.layers = WriteEnvironmentVariable(g_vkEnvLayers, g_vkLayerValue32, true);
#endif
originalEnvironment_.ocatVulkan = WriteEnvironmentVariable(g_vkEnvOcat, g_vkEnvOcatEnabled, true);
changed_ = true;
}
Expand Down
19 changes: 18 additions & 1 deletion Commons/Recording/OverlayThread.cpp
Expand Up @@ -32,7 +32,7 @@ namespace GameOverlay {
HWND g_windowHandle = NULL;

OverlayThread::~OverlayThread()
{
{
Stop();
}

Expand Down Expand Up @@ -91,6 +91,18 @@ void OverlayThread::ThreadProc()
case OverlayMessageType::HideOverlay:
RecordingState::GetInstance().HideOverlay();
break;
case OverlayMessageType::ShowGraphOverlay:
RecordingState::GetInstance().ShowGraphOverlay();
break;
case OverlayMessageType::HideGraphOverlay:
RecordingState::GetInstance().HideGraphOverlay();
break;
case OverlayMessageType::ShowBarOverlay:
RecordingState::GetInstance().ShowBarOverlay();
break;
case OverlayMessageType::HideBarOverlay:
RecordingState::GetInstance().HideBarOverlay();
break;
case OverlayMessageType::UpperLeft:
case OverlayMessageType::UpperRight:
case OverlayMessageType::LowerLeft:
Expand All @@ -100,6 +112,9 @@ void OverlayThread::ThreadProc()
RecordingState::GetInstance().SetOverlayPosition(overlayPosition);
break;
}
case OverlayMessageType::CaptureTime:
RecordingState::GetInstance().UpdateRecordingTime();
break;
default:
break;
}
Expand All @@ -125,6 +140,8 @@ void OverlayThread::DisableOverlay()
return;
}
RecordingState::GetInstance().HideOverlay();
RecordingState::GetInstance().HideGraphOverlay();
RecordingState::GetInstance().HideBarOverlay();
FreeLibraryAndExitThread(dll, 0);
}

Expand Down
1 change: 1 addition & 0 deletions Commons/Recording/PerformanceCounter.cpp
Expand Up @@ -48,6 +48,7 @@ const PerformanceCounter::FrameInfo& PerformanceCounter::NextFrame()
const MilliSeconds frameDelta = currFrame - lastFrame_;
deltaTime_ += frameDelta;
frameTimes_.push_back(static_cast<float>(frameDelta.count()));
currentFrameInfo_.frameTime = static_cast<float>(frameDelta.count());

currentFrameCount_++;
totalFrameCount_++;
Expand Down
1 change: 1 addition & 0 deletions Commons/Recording/PerformanceCounter.hpp
Expand Up @@ -32,6 +32,7 @@ class PerformanceCounter {
struct FrameInfo {
std::int32_t fps = 0;
float ms = 0.0f;
float frameTime = 0.0f;
};

struct CaptureResults {
Expand Down
50 changes: 45 additions & 5 deletions Commons/Recording/RecordingState.cpp
Expand Up @@ -23,6 +23,9 @@
#include "RecordingState.h"
#include "../Logging/MessageLog.h"

#include "../Config/Config.h"
#include "../Utility/FileDirectory.h"

using Clock = std::chrono::high_resolution_clock;
using fSeconds = std::chrono::duration<float>;

Expand All @@ -33,7 +36,7 @@ RecordingState& RecordingState::GetInstance()
}

RecordingState::RecordingState()
{
{
currentStateStart_ = Clock::now();
}

Expand All @@ -56,10 +59,20 @@ bool RecordingState::Stopped()
}

bool RecordingState::IsOverlayShowing()
{
{
return showOverlay_;
}

bool RecordingState::IsGraphOverlayShowing()
{
return showGraphOverlay_;
}

bool RecordingState::IsBarOverlayShowing()
{
return showBarOverlay_;
}

TextureState RecordingState::Update()
{
const fSeconds duration = Clock::now() - currentStateStart_;
Expand Down Expand Up @@ -90,20 +103,47 @@ void RecordingState::SetDisplayTimes(float start, float end)
}

void RecordingState::SetRecordingTime(float time)
{
{
recordingTime_ = time;
}

void RecordingState::UpdateRecordingTime()
{
Config config;
config.Load(g_fileDirectory.GetDirectory(DirectoryType::Config));
SetRecordingTime(static_cast<float>(config.recordingTime_));
}

void RecordingState::ShowOverlay()
{
{
showOverlay_ = true;
}

void RecordingState::HideOverlay()
{
{
showOverlay_ = false;
}

void RecordingState::ShowGraphOverlay()
{
showGraphOverlay_ = true;
}

void RecordingState::HideGraphOverlay()
{
showGraphOverlay_ = false;
}

void RecordingState::ShowBarOverlay()
{
showBarOverlay_ = true;
}

void RecordingState::HideBarOverlay()
{
showBarOverlay_ = false;
}

OverlayPosition RecordingState::GetOverlayPosition()
{
return overlayPosition_;
Expand Down
12 changes: 11 additions & 1 deletion Commons/Recording/RecordingState.h
Expand Up @@ -26,7 +26,7 @@
#include "../Overlay/OverlayPosition.h"

enum class TextureState
{
{
Default,
Start,
Stop
Expand All @@ -41,6 +41,8 @@ class RecordingState final {
bool Started();
bool Stopped();
bool IsOverlayShowing();
bool IsGraphOverlayShowing();
bool IsBarOverlayShowing();
void Start();
void Stop();

Expand All @@ -49,16 +51,24 @@ class RecordingState final {
void SetRecordingTime(float time);
void HideOverlay();
void ShowOverlay();
void HideGraphOverlay();
void ShowGraphOverlay();
void HideBarOverlay();
void ShowBarOverlay();

void SetOverlayPosition(OverlayPosition overlayPosition);
OverlayPosition GetOverlayPosition();

void UpdateRecordingTime();

private:
RecordingState();

bool recording_ = false;
bool stateChanged_ = false;
bool showOverlay_ = true;
bool showGraphOverlay_ = true;
bool showBarOverlay_ = false;
float startDisplayTime_ = 1.0f;
float endDisplayTime_ = 1.0f;
float recordingTime_ = 0.0f;
Expand Down

0 comments on commit 843556d

Please sign in to comment.