Skip to content

Commit 7bf20ba

Browse files
committed
Merge branch 'danylo_system' of github.com:Devsh-Graphics-Programming/Nabla into danylo_system
2 parents 21d503d + 63acf63 commit 7bf20ba

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

include/nbl/system/CSystemWin32.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef _NBL_SYSTEM_CSYSTEMWIN32_H_INCLUDED_
22
#define _NBL_SYSTEM_CSYSTEMWIN32_H_INCLUDED_
33
#ifdef _NBL_PLATFORM_WINDOWS_
4+
#include <windows.h>
5+
#include <powerbase.h>
46
#include "ISystem.h"
57
#include "CFileWin32.h"
68

@@ -22,7 +24,28 @@ class CSystemCallerWin32 final : public ISystemCaller
2224

2325
class CSystemWin32 : public ISystem
2426
{
27+
//LOL the struct definition wasn't added to winapi headers do they ask to declare them yourself
28+
typedef struct _PROCESSOR_POWER_INFORMATION {
29+
ULONG Number;
30+
ULONG MaxMhz;
31+
ULONG CurrentMhz;
32+
ULONG MhzLimit;
33+
ULONG MaxIdleState;
34+
ULONG CurrentIdleState;
35+
} PROCESSOR_POWER_INFORMATION, * PPROCESSOR_POWER_INFORMATION;
2536

37+
SystemInfo getSystemInfo() const override
38+
{
39+
SystemInfo info;
40+
PROCESSOR_POWER_INFORMATION cpuInfo;
41+
CallNtPowerInformation(ProcessorInformation, nullptr, 0, &cpuInfo, sizeof(cpuInfo));
42+
info.cpuFrequency = cpuInfo.MaxMhz;
43+
44+
info.desktopResX = GetSystemMetrics(SM_CXSCREEN);
45+
info.desktopResY = GetSystemMetrics(SM_CYSCREEN);
46+
47+
return info;
48+
}
2649
};
2750

2851
}

include/nbl/system/ISystem.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,17 @@ class ISystem : public core::IReferenceCounted
521521

522522
return systemMemory;
523523
}
524+
525+
struct SystemInfo
526+
{
527+
uint64_t cpuFrequency;
528+
//TODO others
529+
530+
uint32_t desktopResX;
531+
uint32_t desktopResY;
532+
std::string OSFullName;
533+
};
534+
virtual SystemInfo getSystemInfo() const = 0;
524535
};
525536

526537
template<typename T>

src/nbl/asset/utils/ISPIRVOptimizer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ nbl::core::smart_refctd_ptr<ICPUBuffer> ISPIRVOptimizer::optimize(const uint32_t
3030
&spvtools::CreateSimplificationPass,
3131
&spvtools::CreateVectorDCEPass,
3232
&spvtools::CreateDeadInsertElimPass,
33-
&spvtools::CreateAggressiveDCEPass,
33+
//&spvtools::CreateAggressiveDCEPass,
3434
&spvtools::CreateDeadBranchElimPass,
3535
&spvtools::CreateBlockMergePass,
3636
&spvtools::CreateLocalMultiStoreElimPass,
3737
&spvtools::CreateRedundancyEliminationPass,
3838
&spvtools::CreateLoopInvariantCodeMotionPass,
3939
&spvtools::CreateCCPPass,
40-
&spvtools::CreateReduceLoadSizePass,
40+
//&spvtools::CreateReduceLoadSizePass,
4141
&spvtools::CreateStrengthReductionPass,
4242
&spvtools::CreateIfConversionPass
4343
};

src/nbl/system/CSystemWin32.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)