Skip to content

Commit

Permalink
Merge pull request #118 from microsoft/user/tvandewalle/mergeUpdates
Browse files Browse the repository at this point in the history
Looks like some of the specs have gotten a bit stale, made an effort to get them back in sync.
  • Loading branch information
vdwtanner authored Feb 3, 2023
2 parents 81c8d3f + 51f036f commit a322b72
Show file tree
Hide file tree
Showing 7 changed files with 710 additions and 260 deletions.
3 changes: 2 additions & 1 deletion d3d/ConservativeRasterization.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ RenderTarget with sample count \> 1 (see section 3.5.5), although in the
case of Conservative Rasterization, it is the depth value going into the
fixed function depth test that can be extrapolated.

Early Depth culling behavior with Depth Extrapolation is undefined. This
Use of early depth culling behavior in combination with conservative rasterization is undefined.
This includes early depth culling where depth extrapolation occurs. This
is because some Early Depth culling hardware cannot properly support
extrapolated depth values. However, Early Depth culling behavior in the
presence of Depth Extrapolation is problematic even with hardware that
Expand Down
530 changes: 363 additions & 167 deletions d3d/D3D12EnhancedBarriers.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion d3d/D3D12VideoEncoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -4176,4 +4176,4 @@ A host might follow the steps outlined below to use the low level D3D12 API in a

6. Finish up the final compressed bitstream output with the remaining codec headers (eg. PPS).

7. Flush and release all the D3D12 and system resources used for the encoding session.
7. Flush and release all the D3D12 and system resources used for the encoding session.
15 changes: 12 additions & 3 deletions d3d/HLSL_SM_6_7_Advanced_Texture_Ops.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Where `Flags` is the enum:
enum D3D12_SAMPLER_FLAGS {
D3D12_SAMPLER_FLAG_NONE = 0
D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1
}
```

Setting the `D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR` bit
Expand Down Expand Up @@ -115,6 +116,13 @@ Static samplers used with unsigned integer formats must use
either `D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT` for black borders
or `D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT` for white borders.

Support for non-normalized coordinate samplers added
`D3D12_STATIC_SAMPLER_DESC1` with a `D3D12_SAMPLER_FLAGS` member. In
the context of static samplers, `D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR`
is shadowed by the static border color, and not applicable. However, root
signature creation will fail if this flag is used with a floating-point
border color; with a uint border color it is redundant, but not an error.

## Raw Gather

To enable access to four appropriately-sized elements
Expand All @@ -140,9 +148,9 @@ Additionally, same-size and same-channel aliasing can be performed

In order to be able to create an single-channel integer resource view,
a resource must be created using the
[CreateCommittedResource3](D3D12EnhancedBarriers.md#id3d12device10createcommittedresource3),
[CreatePlacedResource2](D3D12EnhancedBarriers.md#id3d12device10createplacedresource2),
or [CreateReservedResource2](D3D12EnhancedBarriers.md#id3d12device10createreservedresource2)
[CreateCommittedResource3](D3D12EnhancedBarriers.md#id3d12device10-createcommittedresource3),
[CreatePlacedResource2](D3D12EnhancedBarriers.md#id3d12device10-createplacedresource2),
or [CreateReservedResource2](D3D12EnhancedBarriers.md#id3d12device10-createreservedresource2)
using the new API fields, `NumCastableFormats` and `pCastableFormats`
to specify the list of acceptable casts.

Expand Down Expand Up @@ -339,6 +347,7 @@ but it is being considered a prerequisite for enabling `AdvancedTextureOpsSuppor
## Change Log
Version|Date|Description
-|-|-
1.01|30 Sep 2022|Add note about D3D12_STATIC_SAMPLER_DESC1 having sampler flags and interaction with border colors
1.00|01 Aug 2022|Minor edits for publication
0.10|08 Mar 2022|Rename integer sampler identifiers
0.9|07 Mar 2022|Clarify pre-requisite for advanced texture ops, Update integer aliasing in keeping with other specs. Correct type, function, and struct details.
Expand Down
86 changes: 86 additions & 0 deletions d3d/MeshShader.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,92 @@ The following enums are also revised to support the new pipeline statistics stru
`D3D12DDI_QUERY_TYPE_PIPELINE_STATISTICS1` is added to the enum `D3D12DDI_QUERY_TYPE`.
## MSPrimitives and view instancing
The interaction between the MSPrimitives pipeline statistic and [view instancing](ViewInstancing.md#pipeline-statistics) depends on the view instancing tier (D3D12_VIEW_INSTANCING_TIER) of the device.
On D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED devices, view instancing doesn't affect MSPrimitives.
On D3D12_VIEW_INSTANCING_TIER_1 devices, view instances increment MSPrimitives.
On D3D12_VIEW_INSTANCING_TIER_2 devices,
* If SV_ViewID is referenced from MS, view instances increment MSPrimitives.
* If SV_ViewID is referenced from a later stage like PS, view instances might or might not increment MSPrimitives.
On D3D12_VIEW_INSTANCING_TIER_3 devices,
* If SV_ViewID is referenced from MS, view instances increment MSPrimitives.
* If SV_ViewID is referenced from a later stage like PS, then view instances don't increment MSPrimitives.
## Culled primitives' effect on MSPrimitives
Culled primitives might or might not be included in MSPrimitives, depending on the GPU implementation.
Applications can find out whether the GPU implementation includes culled primitives in the MSPrimitives count, using a queriable capability called MSPrimitivesPipelineStatisticIncludesCulledPrimitives.
The capability is queried using
```
D3D12_FEATURE_DATA_D3D12_OPTIONS12 featureData12 = {};
VERIFY_SUCCEEDED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &featureData12, sizeof(featureData12)));

bool includeCulledPrimitives = featureData12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives == D3D12_TRI_STATE_TRUE;
```
In the API, the capability appears as
```
typedef
enum D3D12_FEATURE
{
...
D3D12_FEATURE_D3D12_OPTIONS12 = 41
} D3D12_FEATURE;


typedef
enum D3D12_TRI_STATE
{
D3D12_TRI_STATE_UNKNOWN = -1,
D3D12_TRI_STATE_FALSE = 0,
D3D12_TRI_STATE_TRUE = 1
} D3D12_TRI_STATE;

typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS12
{
_Out_ D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives;
} D3D12_FEATURE_DATA_D3D12_OPTIONS12;
```
If the capability value is FALSE, then culled primitives are not included in the MSPrimitives count.
If the capability value is TRUE, then called primitives are included in the MSPrimitives count.
If the capability value is UNKNOWN, then the culled primitives might or might not be included in the count.
> ### Remark
>
> At the DDI level, drivers do not return UNKNOWN. At the application level, a capability value of UNKNOWN
> may be returned if the capability can not be queried from the driver. This could be relevant when, for example,
> using a driver which supports the mesh shader feature but has not been updated to support the 0086 DDI
> version.
At the DDI level, the capability is communicated through UMD DDI revision 0086:
```
#define D3D12DDI_INTERFACE_VERSION_R8 ((D3D12DDI_MAJOR_VERSION << 16) | D3D12DDI_MINOR_VERSION_R8)

#define D3D12DDI_BUILD_VERSION_0086 6
#define D3D12DDI_SUPPORTED_0086 ((((UINT64)D3D12DDI_INTERFACE_VERSION_R8) << 32) | (((UINT64)D3D12DDI_BUILD_VERSION_0086) << 16))
```
With revision 0086, there exists a revised OPTIONS structure:
```
// D3D12DDICAPS_TYPE_D3D12_OPTIONS
typedef struct D3D12DDI_D3D12_OPTIONS_DATA_0086
{
...
BOOL MSPrimitivesPipelineStatisticIncludesCulledPrimitives;
}
```
SV_RenderTargetArrayIndex limitations based on queryable capability
===================================================================
Expand Down
Loading

0 comments on commit a322b72

Please sign in to comment.