↓ on → | CPU | OpenGL | OpenGLES | D3D9 | D3D11 | D3D12 | Vulkan | Metal |
---|---|---|---|---|---|---|---|---|
OpenGL | [llvmpipe][] | - | [gl4es][] | [TitaniumGL][] [wined3d][] | [wined3d][] | [d3d12][] | [zink][] | |
OpenGLES | [llvmpipe][] [SwiftShader (legacy)][] | [ANGLE][] | - | [ANGLE][] | [ANGLE][] | [ANGLE][] | [ANGLE][] | [ANGLE][] [MoltenGL] |
D3D9 | [SwiftShader (legacy)][] | - | [D3D9on12][] | [DXVK][] | ||||
D3D11 | [WARP][] | - | [D3D11on12][] | [DXVK][] | [D3DMetal][] [dx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Maximum selectable profile sources: 12. | |
Id Name Interval Min Max | |
-------------------------------------------------------------- | |
0 Timer 10000 1221 1000000 | |
2 TotalIssues 65536 4096 2147483647 | |
4 LoadInstructions 65536 4096 2147483647 | |
6 BranchInstructions 65536 4096 2147483647 | |
8 DcacheMisses 65536 4096 2147483647 | |
9 IcacheMisses 65536 4096 2147483647 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <dbghelp.h> | |
#include <tlhelp32.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#pragma comment (lib, "dbghelp") | |
#pragma comment (lib, "advapi32") | |
int main(int argc, char* argv[]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// | |
// Magic Ring Buffer | |
// https://gist.github.com/mmozeiko/3b09a340f3c53e5eaed699a1aea95250 | |
// | |
// Sets up memory mapping so the same memory block follows itself in virtual address space: | |
// | |
// [abcd...xyz][abc...xyz] | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#define COBJMACROS | |
#include <windows.h> | |
#include <d3d11.h> | |
// | |
// interface | |
// |
Example of how to capture CPU counters with ETW on Windows, perf on Linux or kperf on Apple.
Using ETW needs somewhat recently updated Windows 10 or 11. Not sure about exact version.
Currently tested on:
- etw on Qualcomm Snapdragon X Elite, Windows 11, arm64
- etw on AMD Zen 3, Windows 11 (with virtualization enabled in BIOS)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#if defined(__linux__) | |
# define _GNU_SOURCE | |
# include <sched.h> | |
# include <unistd.h> | |
# include <sys/syscall.h> | |
# include <linux/perf_event.h> | |
#elif defined(_WIN32) | |
# include <intrin.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example of using Windows Preview Handler | |
// https://learn.microsoft.com/en-us/windows/win32/shell/preview-handlers | |
#define COBJMACROS | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <shlwapi.h> | |
#include <shellapi.h> | |
#include <shobjidl.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example how to set up WebGPU rendering on Windows in C | |
// uses Dawn implementation of WebGPU: https://dawn.googlesource.com/dawn/ | |
// download pre-built Dawn webgpu.h/dll/lib files from https://github.com/mmozeiko/build-dawn/releases/latest | |
#include "webgpu.h" | |
#define _CRT_SECURE_NO_DEPRECATE | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
// uncompressed png writer & reader | |
// supports only 8-bit and 16-bit formats | |
// Performance comparison for 8192x8192 BGRA8 image (256MB) | |
// Compiled with "clang -O2", AVX2 requires extra "-mavx2" or "/arch:AVX2" argument | |
// | |
// For libpng (compressed) uses default libpng/zlib compression settings | |
// For libpng (uncompressed) case following two functions are used: |
NewerOlder