Skip to content

Commit

Permalink
Fixing compilation on MacOS. Fixing samples for vs2019.
Browse files Browse the repository at this point in the history
  • Loading branch information
bombomby committed Aug 5, 2020
1 parent 20ba9f2 commit 7f92356
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion samples/WindowsD3D12/D3D12Multithreading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ void D3D12Multithreading::OnUpdate()
{
for (int i = 0; i < NumLights; i++)
{
float direction = frameChange * pow(-1.0f, i);
float direction = frameChange * powf(-1.0f, (float)i);
XMStoreFloat4(&m_lights[i].position, XMVector4Transform(XMLoadFloat4(&m_lights[i].position), XMMatrixRotationY(direction)));

XMVECTOR eye = XMLoadFloat4(&m_lights[i].position);
Expand Down
1 change: 1 addition & 0 deletions samples/WindowsD3D12/DXSampleHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
// for the GPU lifetime of resources to avoid destroying objects that may still be
// referenced by the GPU.
using Microsoft::WRL::ComPtr;
#include <stdexcept>

inline std::string HrToString(HRESULT hr)
{
Expand Down
2 changes: 1 addition & 1 deletion samples/WindowsVulkan/base/benchmark.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace vks
// Warm up phase to get more stable frame rates
{
double tMeasured = 0.0;
while (tMeasured < (warmup * 1000)) {
while (tMeasured < (warmup * 1000.0)) {
auto tStart = std::chrono::high_resolution_clock::now();
renderFunc();
auto tDiff = std::chrono::duration<double, std::milli>(std::chrono::high_resolution_clock::now() - tStart).count();
Expand Down
4 changes: 2 additions & 2 deletions samples/WindowsVulkan/base/vulkanexamplebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
break;
}

if (camera.firstperson)
if (camera.type == Camera::firstperson)
{
switch (wParam)
{
Expand All @@ -1188,7 +1188,7 @@ void VulkanExampleBase::handleMessages(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
keyPressed((uint32_t)wParam);
break;
case WM_KEYUP:
if (camera.firstperson)
if (camera.type == Camera::firstperson)
{
switch (wParam)
{
Expand Down
4 changes: 4 additions & 0 deletions src/optick_capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@

#include "optick_core.h"

#if defined(__MACH__)
#include <stdlib.h>
#else
#include <malloc.h>
#endif
#include <string.h>

OPTICK_API void OptickAPI_RegisterThread(const char* inThreadName, uint16_t inThreadNameLength)
Expand Down
24 changes: 12 additions & 12 deletions tools/Publish_Main.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

cd ..

rem call tools/GenerateProjects_gpu.bat
rem call tools/GenerateProjects.bat


MsBuild build/vs2017/Optick.sln /t:OptickCore:Rebuild /p:Configuration=Debug /p:Platform=x64
MsBuild build/vs2017/Optick.sln /t:Samples\ConsoleApp:Rebuild /p:Configuration=Release /p:Platform=x64
MsBuild gui/OptickApp_vs2017.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64
MsBuild build/vs2019/Optick.sln /t:OptickCore:Rebuild /p:Configuration=Debug /p:Platform=x64
MsBuild build/vs2019/Optick.sln /t:Samples\ConsoleApp:Rebuild /p:Configuration=Release /p:Platform=x64
MsBuild gui/OptickApp_vs2019.sln /t:Rebuild /p:Configuration=Release /p:Platform=x64

for /f %%i in ('powershell "(Get-Item -path gui\Bin\Release\x64\Optick.exe).VersionInfo.ProductVersion"') do set VERSION=%%i

Expand All @@ -17,19 +17,19 @@ rem GUI
xcopy /Y gui\Bin\Release\x64\Optick.exe publish\Optick_%VERSION_NAME%\*

rem Samples
xcopy /Y Bin\vs2017\x64\Release\ConsoleApp.exe publish\Optick_%VERSION_NAME%\samples\*
xcopy /Y Bin\vs2017\x64\Release\OptickCore.dll publish\Optick_%VERSION_NAME%\samples\*
xcopy /Y Bin\vs2019\x64\Release\ConsoleApp.exe publish\Optick_%VERSION_NAME%\samples\*
xcopy /Y Bin\vs2019\x64\Release\OptickCore.dll publish\Optick_%VERSION_NAME%\samples\*

rem Include
xcopy /Y src\optick.* publish\Optick_%VERSION_NAME%\include\*

rem Lib
xcopy /Y Bin\vs2017\x64\Debug\OptickCore.dll publish\Optick_%VERSION_NAME%\lib\x64\debug\*
xcopy /Y Bin\vs2017\x64\Debug\OptickCore.lib publish\Optick_%VERSION_NAME%\lib\x64\debug\*
xcopy /Y Bin\vs2017\x64\Debug\OptickCore.pdb publish\Optick_%VERSION_NAME%\lib\x64\debug\*
xcopy /Y Bin\vs2017\x64\Release\OptickCore.dll publish\Optick_%VERSION_NAME%\lib\x64\release\*
xcopy /Y Bin\vs2017\x64\Release\OptickCore.lib publish\Optick_%VERSION_NAME%\lib\x64\release\*
xcopy /Y Bin\vs2017\x64\Release\OptickCore.pdb publish\Optick_%VERSION_NAME%\lib\x64\release\*
xcopy /Y Bin\vs2019\x64\Debug\OptickCore.dll publish\Optick_%VERSION_NAME%\lib\x64\debug\*
xcopy /Y Bin\vs2019\x64\Debug\OptickCore.lib publish\Optick_%VERSION_NAME%\lib\x64\debug\*
xcopy /Y Bin\vs2019\x64\Debug\OptickCore.pdb publish\Optick_%VERSION_NAME%\lib\x64\debug\*
xcopy /Y Bin\vs2019\x64\Release\OptickCore.dll publish\Optick_%VERSION_NAME%\lib\x64\release\*
xcopy /Y Bin\vs2019\x64\Release\OptickCore.lib publish\Optick_%VERSION_NAME%\lib\x64\release\*
xcopy /Y Bin\vs2019\x64\Release\OptickCore.pdb publish\Optick_%VERSION_NAME%\lib\x64\release\*

rem Src
xcopy /Y src\*.* publish\Optick_%VERSION_NAME%\src\*
Expand Down

0 comments on commit 7f92356

Please sign in to comment.