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
.section __DATA,__data | |
phi_const: | |
.double 1.618033988749895 | |
root5_const: | |
.double 2.23606797749979 | |
msg: | |
.asciz "Hello, ARM64 macOS!\n" | |
.section __TEXT,__text | |
.global _hello |
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
// Inspired By: https://www.youtube.com/watch?v=E6TS1c8KWFA | |
CPU‐Bound Performance Issues | |
\ | |
\ **Draw Call Count** | |
\ \ | |
\ \ Too many state changes per frame | |
\ \ Small batches (lots of tiny draw calls) | |
\ | |
\ **Synchronization** | |
\ \ |
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
# MangoHud.conf | |
output_folder=/home/ | |
output_file=true | |
output_format=csv | |
output_pipe=false | |
# Logging control | |
log_duration=120 # Log for 2 minutes (120 seconds) | |
log_start=F4 # Trigger logging with F4 | |
log_performance=true # Enable logging |
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
@startuml | |
title mmap() System Call Flow | |
actor UserApp | |
participant KernelVFS as "Kernel VFS" | |
participant KernelMM as "Kernel Memory Manager" | |
participant Driver as "Device Driver (if any)" | |
participant ShmemFS as "Shared Memory Filesystem (shmem)" | |
participant KernelFS as "Kernel Filesystem" |
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 <iostream> | |
#include <utility> | |
void callback_test(void* userdata, void* path) { | |
std::cout << "Callback function called with path: " | |
<< static_cast<const char*>(path) | |
<< " and userdata: " | |
<< static_cast<const char*>(userdata) << std::endl; | |
} |
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
so usage will tell what are it's memory requirements, then we select the heap to allocate it from by comparing | |
the memory requirements for all available heaps in the physical device? | |
so vkGetBufferMemory erquirements takes in usage flags and returns which memoryType to use but not the Heap Index because that can be | |
implicitly inferered frmo memorytype? | |
so we check for compatible memortypes and return that index | |
vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) | |
This call returns a VkMemoryRequirements structure, which includes: |
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 <stdio.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <assert.h> | |
#define TEST_STRUCT_ENTRIES(struct_type, start_member, end_member, expected_count) \ | |
do { \ | |
size_t start_offset = offsetof(struct_type, start_member); \ | |
size_t end_offset = offsetof(struct_type, end_member); \ | |
size_t num_elements = (end_offset - start_offset) / sizeof(uint32_t); \ |
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 <iostream> | |
#include <vector> | |
#include <string> | |
#include <typeinfo> | |
//---------------------------------- | |
// Reflection System using typeid and decltype | |
struct MemberInfo | |
{ | |
std::string name; | |
std::string typeName; |
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
/** | |
* Dixy12 - DirectX12 learning sandbox | |
* Source: https://www.3dgep.com/learning-directx-12-1 | |
*/ | |
#include "common.h" | |
//---------------------------------------------------------------- | |
constexpr uint8_t g_NumFrames = 3; // The number of swap chain back buffers. 2 Back buffers + 1 presentation image = 3 | |
//---------------------------------------------------------------- | |
namespace AppGlobalSettings { |
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
# [Source] : https://blender.stackexchange.com/questions/46795/is-there-a-quick-way-to-copy-the-object-name-to-the-mesh-data-name | |
import bpy | |
objects = bpy.data.objects | |
for obj in objects: | |
if obj.data and obj.data.users == 1: | |
obj.data.name = obj.name |
NewerOlder