logo资料库

Vulkan programming guide: The Official Guide to Learning Vulkan.pdf

第1页 / 共792页
第2页 / 共792页
第3页 / 共792页
第4页 / 共792页
第5页 / 共792页
第6页 / 共792页
第7页 / 共792页
第8页 / 共792页
资料共792页,剩余部分请下载后查看
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
About This E-Book EPUB is an open, industry-standard format for e-books. However, support for EPUB and its many features varies across reading devices and applications. Use your device or app settings to customize the presentation to your liking. Settings that you can customize often include font, font size, single or double column, landscape or portrait mode, and figures that you can click or tap to enlarge. For additional information about the settings and features on your reading device or app, visit the device manufacturer’s Web site. Many titles include programming code or configuration examples. To optimize the presentation of these elements, view the e-book in single-column, landscape mode and adjust the font size to the smallest setting. In addition to presenting code and configurations in the reflowable text format, we have included images of the code that mimic the presentation found in the print book; therefore, where the reflowable format may compromise the presentation of the code listing, you will see a “Click here to view code image” link. Click the link to view the print-fidelity code image. To return to the previous page viewed, click the Back button on your device or app.
Vulkan™ Programming Guide The Official Guide to Learning Vulkan Graham Sellers With contributions from John Kessenich Boston • Columbus • Indianapolis • New York • San Francisco • Amsterdam • Cape Town Dubai • London • Madrid • Milan • Munich • Paris • Montreal • Toronto • Delhi • Mexico City São Paulo • Sydney • Hong Kong • Seoul • Singapore • Taipei • Tokyo
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsalespearsoned.com or (800) 382-3419. For government sales inquiries, please contact governmentsales@pearsoned.com. For questions about sales outside the U.S., please contact intlcs@pearson.com. Visit us on the Web: informit.com/aw Library of Congress Control Number: 2016948832 Copyright © 2017 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit www.pearsoned.com/permissions/. Vulkan and the Vulkan logo are trademarks of the Khronos Group Inc. ISBN-13: 978-0-13-446454-1 ISBN-10: 0-13-446454-0 Text printed in the United States. 1 16
For you, the reader. —Graham Sellers
Contents Figures Tables Listings About This Book About the Sample Code Errata Acknowledgments About the Author 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 2 Memory and Resources Host Memory Management Resources Buffers Formats and Support Images Resource Views Destroying Resources Device Memory Management Allocating Device Memory Host Access to Device Memory
Binding Memory to Resources Sparse Resources Summary 3 Queues and Commands Device Queues Creating Command Buffers Recording Commands Recycling Command Buffers Submission of Commands Summary 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 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 6 Shaders and Pipelines An Overview of GLSL An Overview of SPIR-V Pipelines Representation of SPIR-V Handing SPIR-V to Vulkan Compute Pipelines Creating Pipelines Specialization Constants Accelerating Pipeline Creation
分享到:
收藏