Skip to content

Instantly share code, notes, and snippets.

View Pikachuxxxx's full-sized avatar
🎩
lol

Phani Srikar Pikachuxxxx

🎩
lol
View GitHub Profile
Set-PSReadlineOption -HistorySavePath "$env:USERPROFILE\Documents\PowerShell_history.txt"
Set-PSReadlineOption -MaximumHistoryCount 10000
Set-PSReadlineOption -HistoryNoDuplicates
Set-PSReadLineOption -PredictionSource History
oh-my-posh init pwsh --config https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/slim.omp.json | Invoke-Expression
@Pikachuxxxx
Pikachuxxxx / whyIloveCJumptablesAndMacros.c
Last active August 19, 2025 18:49
Razix RHI C macro magic for clean Jumptables based API and support C++ style with profiling
// Why I love C and Jumptables:
#define rzRHI_DestroyDescriptorHeap g_RHI.DestroyDescriptorHeap
#define rzRHI_CreateDescriptorTable g_RHI.CreateDescriptorTable
#define rzRHI_DestroyDescriptorTable g_RHI.DestroyDescriptorTable
#if !RZ_PROFILER_ENABLED
#if defined(RAZIX_RHI_USE_RESOURCE_MANAGER_HANDLES) && defined(__cplusplus)
#define rzRHI_BeginCmdBuf(cb) g_RHI.BeginCmdBuf(RZResourceManager::Get().getCommandBufferResource(cb))
@Pikachuxxxx
Pikachuxxxx / depth_clamp_api_test.lua
Last active August 19, 2025 18:51
Love2D new setDepthClamp API tests
local love = require("love")
-- Test case for setDepthClamp function
local TestDepthClamp = {}
function love.conf(t)
t.renderers = {"opengl"}
end
function TestDepthClamp:load()
@Pikachuxxxx
Pikachuxxxx / vkquery.cpp
Created August 6, 2025 06:26
Vulkan test app to play with TimeQueries
#include <vulkan/vulkan.h>
#include <iostream>
#include <vector>
#include <stdexcept>
#include <chrono>
#include <cassert>
// Macro for VkQuery timing
#define VK_TIME_START(device, cmdBuffer, queryPool, queryIndex) \
vkCmdResetQueryPool(cmdBuffer, queryPool, queryIndex, 1); \
@Pikachuxxxx
Pikachuxxxx / fibo.asm
Last active June 1, 2025 07:08
ARM64 fibo asm
.section __DATA,__data
phi_const:
.double 1.618033988749895
root5_const:
.double 2.23606797749979
msg:
.asciz "Hello, ARM64 macOS!\n"
.section __TEXT,__text
.global _hello
@Pikachuxxxx
Pikachuxxxx / CPU-GPU Bound Debug.txt
Created May 31, 2025 18:59
Fishbone diagrams to help debug CPU/GPU bound issues based on Bruce Waggoner saving voyager 1 presentation
// 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**
\ \
@Pikachuxxxx
Pikachuxxxx / mangohud.conf
Created May 29, 2025 18:41
mangohud conf to collect game stats
# 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
@Pikachuxxxx
Pikachuxxxx / mmap.uml
Created May 26, 2025 02:12
deep dive into mmap for CPU and GPU mem alloc
@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"
@Pikachuxxxx
Pikachuxxxx / c_cpp_lambda_callback.cpp
Last active May 18, 2025 11:19
Based on an Insomniac's Engine programmer's blog, this is a trick I learned from him.
#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;
}
@Pikachuxxxx
Pikachuxxxx / VulkanMemoryThoughts.txt
Last active April 24, 2025 20:39
Some thoughts about Vulkan memory allocation and drivers stuff
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: