wddm & dx11

本文详细介绍了Direct3D11如何设计以支持从DirectX9到11的各种硬件,包括新引入的featurelevels概念,以及资源管理、类型、视图、缓冲区和纹理的使用,如1D/2D/3D纹理和块压缩技术的扩展。
摘要由CSDN通过智能技术生成

编程指导:

Device设备

Device= device object + device-context obj

device object 创建resource

device-conetxt obj 负责渲染 perform rending

This section discusses how Direct3D 11 is designed to support both new and existing
hardware, from DirectX 9 to DirectX 11.
This diagram shows how Direct3D 11 supports new and existing hardware.

With Direct3D 11, a new paradigm is introduced called feature levels. A feature level is a
well defined set of GPU functionality. Using a feature level, you can target a Direct3D
application to run on a downlevel version of Direct3D hardware 

Formats of version numbers

There are three formats for Direct3D versions, shader models, and feature levels.
Direct3D versions use a period; for example, Direct3D 12.0.
Shader models use a period; for example, shader model 5.1.
Feature levels use an underscore; for example, feature level 12_0.

...

资源Resources

Resources provide data to the pipeline and define what is rendered during your scene.
Resources can be loaded from your game media or created dynamically at run time.
T ypically, resources include texture data, vertex data, and shader data. Most Direct3D
applications create and destroy resources extensively throughout their lifespan. This
section describes aspects of Direct3D 11 resources.

You can create resources that are strongly typed or typeless; you can control whether
resources have both read and write access; you can make resources accessible to only
the CPU, GPU, or both. Up to 128 resources can be active for each pipeline stage.

Direct3D guarantees to return zero for any resource that is accessed out of bounds.

Strong vs Weak Typing

There are two ways to fully specify the layout (or memory footprint) of a resource:
Typed - fully specify the type when the resource is created.
Typeless - fully specify the type when the resource is bound to the pipeline.

Resource Views

Resources can be stored in general purpose memory formats so that they can be shared
by multiple pipeline stages. A pipeline stage interprets resource data using a view. A
resource view is conceptually similar to casting the resource data so that it can be used
in a particular context.

Raw Views of Buffers

Y ou can think of a raw buffer, which can also be called a byte address buffer, as a bag of
bits to which you want raw access, that is, a buffer that you can conveniently access
through chunks of one to four 32-bit typeless address values. Y ou indicate that you want
raw access to a buffer (or, a raw view of a buffer) when you call one of the following
methods to create a view to the buffer:

To create a shader resource view (SRV) to the buffer, call
ID3D11Device::CreateShaderResourceViewwith the flag
D3D11_BUFFEREX_SRV_FLAG_RAW. Y ou specify this flag in the Flagsmember of
the D3D11_BUFFEREX_SRVstructure. Y ou set D3D11_BUFFEREX_SRVin the
BufferExmember of the D3D11_SHADER_RESOURCE_VIEW_DESCstructure to
which the pDescparameter of ID3D11Device::CreateShaderResourceViewpoints.
Y ou also set the D3D11_SRV_DIMENSION_BUFFEREXvalue in the ViewDimension
member of D3D11_SHADER_RESOURCE_VIEW_DESCto indicate that the SRV is a
raw view.

Types of Resources

Direct3D 11 supports several new resource types including:
read-write buffers and textures
structured buffers
byte-address buffers
append and consume buffers
unordered access buffer or texture

Resource limits for feature level 11 hardware

 Subresources

Direct3D can reference an entire resource or it can reference subsets of a resource. The
term subresource refers to a subset of a resource.

Buffers

Buffers contain data that is used for describing geometry, indexing geometry
information, and shader constants. This section describes buffers that are used in
Direct3D 11 and links to task-based documentation for common scenarios.

Buffer Types

The following are the buffer resource types supported by Direct3D 11. All buffer types
are encapsulated by the ID3D11Bufferinterface.
V ertex Buffer
Index Buffer
Constant Buffer

Textures

A texture stores texel information. 

A texture resource is a structured collection of data designed to store texels. A texel
represents the smallest unit of a texture that can be read or written to by the pipeline.
Unlike buffers, textures can be filtered by texture samplers as they are read by shader
units. The type of texture impacts how the texture is filtered. Each texel contains 1 to 4
components, arranged in one of the DXGI formats defined by the DXGI_FORMA T
enumeration.
T extures are created as a structured resource with a known size. However, each texture
may be typed or typeless when the resource is created as long as the type is fully
specified using a view when the texture is bound to the pipeline.

Texture Types

There are several types of textures: 1D, 2D, 3D, each of which can be created with or
without mipmaps. Direct3D 11 also supports texture arrays and multisampled textures.
1D T extures
1D T exture Arrays
2D T extures and 2D T exture Arrays
3D T extures

Texture Block Compression in Direct3D11

Block Compression (BC) support for textures has been extended in Direct3D 11 to
include the BC6H and BC7 algorithms. BC6H supports high-dynamic range color source
data, and BC7 provides better-than-average quality compression with less artifacts for
standard RGB source data.

## tutrial & ref


Direct3D 11 Graphics - Win32 apps | Microsoft Learn 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值