The Definitive Vulkan(TM) Developer's Guide and Reference: Master the Next-Generation Specification for Cross-Platform Graphics The next generation of the OpenGL specification, Vulkan, has been redesigned from the ground up, giving applications direct control over GPU acceleration for unprecedented performance and predictability.
Vulkan(TM) Programming Guide
is the essential, authoritative reference to this new standard for experienced graphics programmers in all Vulkan environments. Vulkan API lead Graham Sellers (with contributions from language lead John Kessenich) presents example-rich introductions to the portable Vulkan API and the new SPIR-V shading language. The author introduces Vulkan, its goals, and the key concepts framing its API, and presents a complex rendering system that demonstrates both Vulkan's uniqueness and its exceptional power. You'll find authoritative coverage of topics ranging from drawing to memory, and threading to compute shaders. The author especially shows how to handle tasks such as synchronization, scheduling, and memory management that are now the developer's responsibility.
Vulkan(TM) Programming Guide
introduces powerful 3D development techniques for fields ranging from video games to medical imaging, and state-of-the-art approaches to solving challenging scientific compute problems. Whether you're upgrading from OpenGL or moving to open-standard graphics APIs for the first time, this guide will help you get the results and performance you're looking for. Coverage includes Extensively tested code examples to demonstrate Vulkan's capabilities and show how it differs from OpenGL Expert guidance on getting started and working with Vulkan's new memory system Thorough discussion of queues, commands, moving data, and presentation Full explanations of the SPIR-V binary shading language and compute/graphics pipelines Detailed discussions of drawing commands, geometry and fragment processing, synchronization primitives, and reading Vulkan data into applications A complete case study application: deferred rendering using complex multi-pass architecture and multiple processing queues Appendixes presenting Vulkan functions and SPIR-V opcodes, as well as a complete Vulkan glossary Normal 0 false false false EN-US X-NONE X-NONE
Author(s): John M. Kessenich; Graham Sellers
Publisher: Addison-Wesley Professional
Year: 2016
Language: English
Pages: 480
About This E-Book
Vulkan™ Programming Guide
Contents
Figures
Tables
Listings
About This Book
About the Sample Code
Errata
Acknowledgments
About the Author
Chapter 1. Overview of Vulkan
Introduction
Instances, Devices, and Queues
The Vulkan Instance
Vulkan Physical Devices
Physical Device Memory
Device Queues
Creating a Logical Device
Object Types and Function Conventions
Managing Memory
Multithreading in Vulkan
Mathematical Concepts
Vectors and Matrices
Coordinate Systems
Enhancing Vulkan
Layers
Extensions
Shutting Down Cleanly
Summary
Chapter 2. Memory and Resources
Host Memory Management
Resources
Buffers
Formats and Support
Images
Linear Images
Nonlinear Encoding
Compressed Image Formats
Resource Views
Buffer Views
Image Views
Image Arrays
Destroying Resources
Device Memory Management
Allocating Device Memory
Host Access to Device Memory
Binding Memory to Resources
Sparse Resources
Summary
Chapter 3. Queues and Commands
Device Queues
Creating Command Buffers
Recording Commands
Recycling Command Buffers
Submission of Commands
Summary
Chapter 4. Moving Data
Managing Resource State
Pipeline Barriers
Global Memory Barriers
Buffer Memory Barriers
Image Memory Barriers
Clearing and Filling Buffers
Clearing and Filling Images
Copying Image Data
Copying Compressed Image Data
Stretching Images
Summary
Chapter 5. Presentation
Presentation Extension
Presentation Surfaces
Presentation on Microsoft Windows
Presentation on Xlib-Based Platforms
Presentation with Xcb
Swap Chains
Full-Screen Surfaces
Performing Presentation
Cleaning Up
Summary
Chapter 6. Shaders and Pipelines
An Overview of GLSL
An Overview of SPIR-V
Representation of SPIR-V
Handing SPIR-V to Vulkan
Pipelines
Compute Pipelines
Creating Pipelines
Specialization Constants
Accelerating Pipeline Creation
Binding Pipelines
Executing Work
Resource Access in Shaders
Descriptor Sets
Binding Resources to Descriptor Sets
Binding Descriptor Sets
Uniform, Texel, and Storage Buffers
Unform and Shader Storage Blocks
Texel Buffers
Push Constants
Sampled Images
Image Filtering
Mipmapping
Summary
Chapter 7. Graphics Pipelines
The Logical Graphics Pipeline
Renderpasses
The Framebuffer
Creating a Simple Graphics Pipeline
Graphics Shader Stages
Vertex Input State
Input Assembly
Tessellation State
Viewport State
Rasterization State
Multisample State
Depth and Stencil State
Color Blend State
Dynamic State
Summary
Chapter 8. Drawing
Getting Ready to Draw
Vertex Data
Indexed Draws
Index-Only Rendering
Reset Indices
Instancing
Indirect Draws
Summary
Chapter 9. Geometry Processing
Tessellation
Tessellation Configuration
Tessellation Modes
Controlling Subdivision
Tessellation Variables
Patch Variables
Tessellation Evaluation Shaders
Tessellation Example: Displacement Mapping
Geometry Shaders
Cutting Primitives
Geometry Shader Instancing
Programmable Point Size
Line Width and Rasterization
User Clipping and Culling
The Viewport Transformation
Summary
Chapter 10. Fragment Processing
Scissor Testing
Depth and Stencil Operations
Depth Testing
Depth-Bounds Testing
Depth Bias
Stencil Testing
Early Fragment Tests
Multisample Rendering
Sample Rate Shading
Multisample Resolves
Logic Operations
Fragment Shader Outputs
Color Blending
Summary
Chapter 11. Synchronization
Fences
Events
Semaphores
Summary
Chapter 12. Getting Data Back
Queries
Executing Queries
Occlusion Queries
Pipeline Statistics Queries
Timing Queries
Reading Data with the Host
Summary
Chapter 13. Multipass Rendering
Input Attachments
Attachment Contents
Attachment Initialization
Render Areas
Preserving Attachment Content
Secondary Command Buffers
Summary
Appendix. Vulkan Functions
Glossary
Index
Code Snippets