惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Register - Security
The Register - Security
T
Troy Hunt's Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
G
GRAHAM CLULEY
S
Schneier on Security
S
Secure Thoughts
Know Your Adversary
Know Your Adversary
Forbes - Security
Forbes - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Hacker News
The Hacker News
Y
Y Combinator Blog
L
LINUX DO - 最新话题
D
Docker
S
Security @ Cisco Blogs
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
博客园_首页
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V2EX - 技术
V2EX - 技术
NISL@THU
NISL@THU
MongoDB | Blog
MongoDB | Blog
阮一峰的网络日志
阮一峰的网络日志
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
AWS News Blog
AWS News Blog
博客园 - 司徒正美
Martin Fowler
Martin Fowler
W
WeLiveSecurity
月光博客
月光博客
博客园 - 聂微东
N
News and Events Feed by Topic
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
T
Tenable Blog
IT之家
IT之家
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
Vercel News
Vercel News

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Learning DirectX 12 - Part 2 Initialization Theory
NoticeableSm · 2026-05-25 · via DEV Community

WTF is Direct3D ?
Direct3D is essentially just a middleman between our code to a GPU. Its an interface in which to interact with the GPUs. Each GPU as I'm sure you know is different, so each GPU has its own way of doing things. This is where Directx comes in and essentially acts as an universal translator from our code (in Directx12 c++) to machine code for the GPU to execute. This ofcourse means that Nvidia, intel and AMD (manufacturers of GPUs) work hand in hand with Microsoft (who make DirectX) in order for these things to work the way they should and to have somewhat of an universal workings of things.

Component Object Model:
This Component Object Model often shortened to COM is what allows DirectX to be programming language independent. The COM interface is hidden to use when we write code, we usally don't interact or change stuff in it directly. We manipulate COM through pointers and references to the object. We DONT create new COM objects via the c++ new keywords. If you have ever taken a C++ programming course this is pretty basic stuff as your teacher might have said (as mine did) "Don't touch code unless you have to" but with a strong eastern european accent. We access COM objects via references and in order to free the memory that take up the space from this we call a Release method (Important to note that all COM interfaces inherit from an univeral IUnknown COM interface, which provides this release method). When a COM object isn't referenced anywhere their memory is freed up (Although this is done manually)

Thankfully we have Windows Runtime Library (WRL) to help with this pointer to the COM class, as this essentially works as a smart pointer (Thank god) so that the memory gets released automatically when the reference goes out of scope (Oh how I love you smart pointer).

Small note:
I won't cover code right now in this part I will do that in a later part so right now I'm just trying to get you (and me) familiar with these concepts enough so that when we introduce the code, we will have an overall understanding of it. I should mention that I will repeat things like crazy in this series, such is just the consequence of writing this devlog because how the fuck am I supposed to keep track, so if you don't get a concept or don't understand it, That's probably because I don't really understand it and haven't explained it well, So we will return to that later!

Texture Formats
2D image mapped onto a 3D object to give a texture, you know you can have a cube but in order to make a wooden box we gotta give a wood texture. Think of a grass block in minecraft

each side has a 2d image projected on its square face. Now you can do loads of fun and more technical stuff with textures but we will cover that later!

The Swap Chain
When rendering its best to draw the future first and then present the image, the current image is whatever last was drawn. Think of it this way, we have a front and back buffer. The front buffer is whats currently on the screen, you have your minecraft pig beautifully drawn on that front buffer and you see it. On the back buffer we have drawn a Minecraft Creeper, boo! Now when we swap these two frames, the back buffer for the front buffer. The back buffer becomes the front buffer and the front buffer becomes the back buffer, but now what we see is the Minecraft creeper! And the next frame we want to draw a Minecraft cow so we now render that cow onto the back buffer and swap it with the front buffer to display the cow!

This is called double buffering when you have a front and back but triple buffering exists aswell but yknow just cuz it exists doesn't mean I have to cover it, but I think you can figure it out.

Depth Buffering:
Depth Buffering is a fairly fun concept in DirectX12, essentially every pixel on our screen has a value between 0.0f and 1.0f. 0 denotes the closest an object can be and 1 denotes the farthest away an object can be. Why is this relevant? Because we have to keep track of what to draw in front of what. Lets say we have a box in front of another box, the pixels that are of the box infront of the other box are the ones that should get prioritzed to get drawn, not the backbox, those shouldn't get drawn. So depth buffering is a way to essentially understand what pixel should be drawn depending on an pixels depth. Important to note that thanks to this it does not matter what order we choose to draw stuff in DirectX12 aslong as we have properly working Depth Buffering. A depth buffer is texture, important to note so it must be created with certain data formats in DirectX12.

Resources and Descriptors:
If you read my LearningOpenGL series I covered what a StateMachine is. Essentilly what it is, is that you have to be very explicit with the API. Imagine youre trying to describe a painting to someone and your goal is to get that person to paint the painting you have in mind. So you say like, Pick up the pencil -> make that pencil red ->paint on the paper from here to here. As you can see these instructions are essentially different states that the person finds themselves in. Directx12 is very similar to this, you have to tell it explicitly and methodically each step everytime you want to do something. Oh so you want to paint with a blue pencil now? Well time to go through each one of these steps again. I overexagerate but at the same time I don't. These specifications and heavy way of handholding you have to do is what makes DirectX12 so performance optimizable, absolute control.

During rendering the GPU writes to resources, back buffer, front buffer and depth buffer for example. Reads from resources that store things such as textures, 3D positions etc. Whenever we draw something we might need to change the resource in which we draw from. Resources are not referenced directly, they are referenced from descriptor objects. The reason for this is so that the descriptor object can easily translate to the GPU for us what the actual fuck we are going to use this resource for. It is essentially an abstraction layer to make our lives easier (Thank god). This also means sometimes we don't have to bind the ENTIRE resource just a section of it so we do not waste computer power.

Descriptors have types, these are allegedly the types we will use.

  1. CBV/SRV/UAV describe constant buffers, shaders and stuff like that.
  2. Sampler descriptors used for textures I guess
  3. RTV descriptor describe render target resources, whatever that means
  4. DSV descriptor describe our depth and stencil resources (Hey I know that)

These 4 are what Frank D. Luna bring up in his book here, honestly I do not really understand this at this point exactly these different types but I am sure I will understand better as we delve deeper into the code in the future.

DirectX Graphics Infrastructure:
DirectX Graphics infrasctructure is essentially an API you use along Direct3D. It's purpose is to handle more universal aspects of rendering. In 2D rendering you also need a swap chain for example to get smooth animation etc. For our purposes its worth noting that DXGI is what handles display adapters (Graphics cards). A graphics card can have multiple display outputs, so in other words. This is all a way to assign a graphics card or so to what screen it should render to, we typically don't actually assign manually the displays (thank god) but DIrectX Graphics Infrastructure is useful for outputting what our hardware is. A system can also have a software display adapter that essentially works as an emulator for graphics functionality (In this way we can fake the rendering capabilities over to the CPU).

This output of our hardware that we have access for is useful so we can properly assign important values for example refresh rate and resolution. These have to perfectly fit, so why not use this universal stable way of gathering this output.

Residency:
Obviously its completely pointless to have resources loaded to the GPU that arent needed for the current scene. As the books example is, the GPU doesn't need the Cave resources if the player finds themself in a deep forest. Therefor its important to make memory resident and evict memory. This is typically done in cases of like level changes and or drastic huge landscape shifts (There is overhead to constantly change out resources like this so you only do it during select periods).

Heap vs Stack:
The heap is just a dedicated chunk of memory, in C++ things created on the heap are typically done with the new keyowrd for example. This variable that is created with this new keyword lives past when the variable goes out of scope. In other words if you create for example a player character like
Player* ptr_Player = new Player("Guyman"); Then that piece if memory will always be there, it will not get destroyed until we deliberately delete that player.

Creating things on the stack essentially means we are creating it and assigning it in memory and that memory gets freed up automatically when the variable for example goes out of scope.

Resources:
Buffers: Are arrays of data elements that are of a certain type. I like to think vertices here, a list of vertices that make up our beautiful shrek model we are loading.

Textures: Image data, storing a grid of image data is how Frank D Luna describes Textures right now.

Commited Resources:
A single API call creates the heap at the same time as you create a resource. In this way these both are bound together, simple right? Well this is quite expensive and ideally shouldn't be done whilly nilly. This is useful for things that need to be created during initialization and not per frame.

Placed Resources:
Create a large heap, then assign the resources into that heap. It is a way of seperating allocating memory and creating resources in memory. Placed resources are much faster to change directly per frame so this is great for things such as resource creating/destruction.
Think of it this way, it would be really annoying and time consuming to have to create a new flag everytime you want to wave it around so instead someone tells you the location of one flag you created previously. Now everytime you want to wave a flag, you just go and get your flag.

Reserved Resources:
Imagine you have a huge world map, it would be pretty stupid to have the entire world map loaded up in memory if the user is say zoomed into just Stockholm, Sweden. So just load the parts neccessary needed for the current operation. Reserved resources are essentially just chopped up big resources whose pieces are served depending on if they are needed or not.

CPU / GPU Interaction
Both the CPU and the GPU do a lot of work in graphics. They do different things however they work together to render our beautifully disguised triangles. The GPU has a command queue, the CPU enters commands to the queue through the Direct3D API, this command is added to a stack and or queue and it isn't until the GPU has finished commands before the command reaches the front, in which the command is executed. If the command queue is empty, The GPU will idle. This ofcourse is not ideal as we ideally want our GPU and CPU to always be working on something to get the most performance we can out of software.

CPU / GPU synchronization
Given that the CPU and GPU work together asynchronously then the GPU and CPU can't do stuff that would later be contridicted by the other. Therefore a way to solve this is to force the CPU to pause until the GPU has finished all its stuff. This is ccalled a fence point that you specify in code.

Resource Transitions:
Lets say the GPU is working on a resource, this resource is probably not safe to do a lot of operations on as things are being changed about it. Therefore marking the state of that resource to a sort of state as "being worked on" would help a lot in order to avoid resource hazards. This is essentially what Resource Transitions are for, a way to mark states for resources in order for the API to alleviate problems that would occur if something wants to poke at what the GPU is currently working on. Now this state isn't just a declaration of "being worked on or not" but more a descriptor of how the resource is being manipulated right now by the GPU.

Final Words:
We are getting dangerously close here to my brain exploding from all this information but thankfully, I think it's time to begin writing some code. In the next part we wil finally cover the code needed to initalize Direct3D (Finally!).