You are previewing Vulkan™ Programming Guide.
O'Reilly logo
Vulkan™ Programming Guide

Book Description

The Definitive Vulkan™ 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™ 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™ 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

  • Table of Contents

    1. About This E-Book
    2. Title Page
    3. Copyright Page
    4. Dedication Page
    5. Contents
    6. Figures
    7. Tables
    8. Listings
    9. About This Book
      1. About the Sample Code
      2. Errata
    10. Acknowledgments
    11. About the Author
    12. Chapter 1. Overview of Vulkan
      1. Introduction
      2. Instances, Devices, and Queues
        1. The Vulkan Instance
        2. Vulkan Physical Devices
        3. Physical Device Memory
        4. Device Queues
        5. Creating a Logical Device
      3. Object Types and Function Conventions
      4. Managing Memory
      5. Multithreading in Vulkan
      6. Mathematical Concepts
        1. Vectors and Matrices
        2. Coordinate Systems
      7. Enhancing Vulkan
        1. Layers
        2. Extensions
      8. Shutting Down Cleanly
      9. Summary
    13. Chapter 2. Memory and Resources
      1. Host Memory Management
      2. Resources
        1. Buffers
        2. Formats and Support
        3. Images
        4. Resource Views
        5. Destroying Resources
      3. Device Memory Management
        1. Allocating Device Memory
        2. Host Access to Device Memory
        3. Binding Memory to Resources
        4. Sparse Resources
      4. Summary
    14. Chapter 3. Queues and Commands
      1. Device Queues
      2. Creating Command Buffers
      3. Recording Commands
      4. Recycling Command Buffers
      5. Submission of Commands
      6. Summary
    15. Chapter 4. Moving Data
      1. Managing Resource State
        1. Pipeline Barriers
        2. Global Memory Barriers
        3. Buffer Memory Barriers
        4. Image Memory Barriers
      2. Clearing and Filling Buffers
      3. Clearing and Filling Images
      4. Copying Image Data
      5. Copying Compressed Image Data
      6. Stretching Images
      7. Summary
    16. Chapter 5. Presentation
      1. Presentation Extension
      2. Presentation Surfaces
        1. Presentation on Microsoft Windows
        2. Presentation on Xlib-Based Platforms
        3. Presentation with Xcb
      3. Swap Chains
      4. Full-Screen Surfaces
      5. Performing Presentation
      6. Cleaning Up
      7. Summary
    17. Chapter 6. Shaders and Pipelines
      1. An Overview of GLSL
      2. An Overview of SPIR-V
        1. Representation of SPIR-V
        2. Handing SPIR-V to Vulkan
      3. Pipelines
        1. Compute Pipelines
        2. Creating Pipelines
        3. Specialization Constants
        4. Accelerating Pipeline Creation
        5. Binding Pipelines
      4. Executing Work
      5. Resource Access in Shaders
        1. Descriptor Sets
        2. Binding Resources to Descriptor Sets
        3. Binding Descriptor Sets
        4. Uniform, Texel, and Storage Buffers
        5. Push Constants
        6. Sampled Images
      6. Summary
    18. Chapter 7. Graphics Pipelines
      1. The Logical Graphics Pipeline
      2. Renderpasses
      3. The Framebuffer
      4. Creating a Simple Graphics Pipeline
        1. Graphics Shader Stages
        2. Vertex Input State
        3. Input Assembly
        4. Tessellation State
        5. Viewport State
        6. Rasterization State
        7. Multisample State
        8. Depth and Stencil State
        9. Color Blend State
      5. Dynamic State
      6. Summary
    19. Chapter 8. Drawing
      1. Getting Ready to Draw
      2. Vertex Data
      3. Indexed Draws
        1. Index-Only Rendering
        2. Reset Indices
      4. Instancing
      5. Indirect Draws
      6. Summary
    20. Chapter 9. Geometry Processing
      1. Tessellation
        1. Tessellation Configuration
        2. Tessellation Variables
        3. Tessellation Example: Displacement Mapping
      2. Geometry Shaders
        1. Cutting Primitives
        2. Geometry Shader Instancing
      3. Programmable Point Size
      4. Line Width and Rasterization
      5. User Clipping and Culling
      6. The Viewport Transformation
      7. Summary
    21. Chapter 10. Fragment Processing
      1. Scissor Testing
      2. Depth and Stencil Operations
        1. Depth Testing
        2. Stencil Testing
        3. Early Fragment Tests
      3. Multisample Rendering
        1. Sample Rate Shading
        2. Multisample Resolves
      4. Logic Operations
      5. Fragment Shader Outputs
      6. Color Blending
      7. Summary
    22. Chapter 11. Synchronization
      1. Fences
      2. Events
      3. Semaphores
      4. Summary
    23. Chapter 12. Getting Data Back
      1. Queries
        1. Executing Queries
        2. Timing Queries
      2. Reading Data with the Host
      3. Summary
    24. Chapter 13. Multipass Rendering
      1. Input Attachments
      2. Attachment Contents
        1. Attachment Initialization
        2. Render Areas
        3. Preserving Attachment Content
      3. Secondary Command Buffers
      4. Summary
    25. Appendix. Vulkan Functions
    26. Glossary
    27. Index
    28. Code Snippets