Skip to content

Commit

Permalink
v1.148:
Browse files Browse the repository at this point in the history
HIGHLIGHTS:
- Core: clarified & simplified creation of descriptor ranges with "partially bound", "array" and "variable-sized array" functionality
- Core: reduced entropy and added order to "DeviceDesc", exposed more "tiers" (if it's better than a set of individual features)
- Core: reduced entropy around programmable sample positions (PSL) names
- Core: added "shaderModel" to "DeviceDesc" (best guess for VK, but still useful)
- MeshShader: added support for optional "countBuffer" in "CmdDrawMeshTasksIndirect"
- improved docs

BREAKING CHANGES (simple and straightforward):
- PSL: all names are based on "locations" without "programmable"
- "DescriptorRangeDesc::isDescriptorNumVariable" (and "VARIABLE_DESCRIPTOR_NUM") => "DescriptorRangeBits::VARIABLE_SIZED_ARRAY"
- "DescriptorRangeDesc::isArray" (and "DESCRIPTOR_ARRAY") => "DescriptorRangeBits::ARRAY"
- "DescriptorSetDesc::partiallyBound" (and "PARTIALLY_BOUND") => "DescriptorRangeBits::PARTIALLY_BOUND" (moved to descriptor range)
- "DeviceDesc" tweaks

DETAILS:
- Core: added "rayTracingTier" to "DeviceDesc"
- Core: added "isAdditionalShadingRatesSupported" to "DeviceDesc" to highlight 2x4, 4x2 and 4x4 rates support
- Core: shading rate features replaced with "shadingRateTier" in "DeviceDesc"
- Core: explained all old and new "tiers" in "DeviceDesc"
- Core: removed "isDrawMeshTasksIndirectSupported" from "DeviceDesc" (always supported if mesh shaders are supported)
- Core: removed "isDispatchRaysIndirectSupported" from "DeviceDesc" (use "rayTracingTier")
- Core: added "DescriptorRangeBits" expanding and simplifying functionality around previously used "partiallyBound", "isArray" and "isDescriptorNumVariable"
- MeshShader: added support for optional "countBuffer" in "CmdDrawMeshTasksIndirect"
- improved comments in the main headers
  • Loading branch information
dzhdanNV committed Sep 10, 2024
1 parent 839981e commit 87597b3
Show file tree
Hide file tree
Showing 34 changed files with 264 additions and 215 deletions.
2 changes: 1 addition & 1 deletion Include/Extensions/NRIMeshShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NriStruct(DrawMeshTasksDesc) {
NriStruct(MeshShaderInterface) {
// Draw
void (NRI_CALL *CmdDrawMeshTasks)(NriRef(CommandBuffer) commandBuffer, const NriRef(DrawMeshTasksDesc) drawMeshTasksDesc);
void (NRI_CALL *CmdDrawMeshTasksIndirect)(NriRef(CommandBuffer) commandBuffer, const NriRef(Buffer) buffer, uint64_t offset, uint32_t drawNum, uint32_t stride); // buffer contains "DrawMeshTasksDesc" commands
void (NRI_CALL *CmdDrawMeshTasksIndirect)(NriRef(CommandBuffer) commandBuffer, const NriRef(Buffer) buffer, uint64_t offset, uint32_t drawNum, uint32_t stride, const NriPtr(Buffer) countBuffer, uint64_t countBufferOffset); // buffer contains "DrawMeshTasksDesc" commands
};

NriNamespaceEnd
8 changes: 4 additions & 4 deletions Include/NRI.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Non-goals:
#pragma once

#define NRI_VERSION_MAJOR 1
#define NRI_VERSION_MINOR 147
#define NRI_VERSION_DATE "2 September 2024"
#define NRI_VERSION_MINOR 148
#define NRI_VERSION_DATE "10 September 2024"

#include "NRIDescs.h"

Expand Down Expand Up @@ -118,8 +118,8 @@ NriStruct(CoreInterface) {
void (NRI_CALL *CmdSetStencilReference)(NriRef(CommandBuffer) commandBuffer, uint8_t frontRef, uint8_t backRef); // "backRef" requires "isIndependentFrontAndBackStencilReferenceAndMasksSupported"
void (NRI_CALL *CmdSetDepthBounds)(NriRef(CommandBuffer) commandBuffer, float boundsMin, float boundsMax);
void (NRI_CALL *CmdSetBlendConstants)(NriRef(CommandBuffer) commandBuffer, const NriRef(Color32f) color);
void (NRI_CALL *CmdSetSamplePositions)(NriRef(CommandBuffer) commandBuffer, const NriPtr(SamplePosition) positions, Nri(Sample_t) positionNum, Nri(Sample_t) sampleNum); // requires "isProgrammableSampleLocationsSupported"
void (NRI_CALL *CmdSetShadingRate)(NriRef(CommandBuffer) commandBuffer, const NriRef(ShadingRateDesc) shadingRateDesc); // requires "is*ShadingRateSupported"
void (NRI_CALL *CmdSetSampleLocations)(NriRef(CommandBuffer) commandBuffer, const NriPtr(SampleLocation) locations, Nri(Sample_t) locationNum, Nri(Sample_t) sampleNum); // requires "sampleLocationsTier != 0"
void (NRI_CALL *CmdSetShadingRate)(NriRef(CommandBuffer) commandBuffer, const NriRef(ShadingRateDesc) shadingRateDesc); // requires "shadingRateTier != 0"

// State override, if enabled in the pipeline
void (NRI_CALL *CmdSetDepthBias)(NriRef(CommandBuffer) commandBuffer, const NriRef(DepthBiasDesc) depthBiasDesc); // requires "isDynamicDepthBiasSupported"
Expand Down
76 changes: 47 additions & 29 deletions Include/NRIDescs.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,15 @@ NriForwardStruct(CommandAllocator);
// Types
typedef uint8_t Nri(Mip_t);
typedef uint8_t Nri(Sample_t);
typedef uint32_t Nri(MemoryType);
typedef uint16_t Nri(Dim_t);
typedef uint32_t Nri(MemoryType);

// Aliases
static const bool NriConstant(PARTIALLY_BOUND) = true; // helper for "DescriptorSetDesc::partiallyBound"
static const bool NriConstant(DESCRIPTOR_ARRAY) = true; // helper for "DescriptorRangeDesc::isArray"
static const bool NriConstant(VARIABLE_DESCRIPTOR_NUM) = true; // helper for "DescriptorRangeDesc::isDescriptorNumVariable"
static const uint32_t NriConstant(ALL_SAMPLES) = 0; // only for "sampleMask"
static const uint32_t NriConstant(ONE_VIEWPORT) = 0; // only for "viewportNum"
static const Nri(Dim_t) NriConstant(WHOLE_SIZE) = 0; // only for "Dim_t" and "size"
static const Nri(Mip_t) NriConstant(REMAINING_MIPS) = 0; // only for "mipNum"
static const Nri(Dim_t) NriConstant(REMAINING_LAYERS) = 0; // only for "layerNum"
static const uint32_t NriConstant(ALL_SAMPLES) = 0; // only for "sampleMask"
static const uint32_t NriConstant(ONE_VIEWPORT) = 0; // only for "viewportNum"
static const Nri(Dim_t) NriConstant(WHOLE_SIZE) = 0; // only for "Dim_t" and "size"
static const Nri(Mip_t) NriConstant(REMAINING_MIPS) = 0; // only for "mipNum"
static const Nri(Dim_t) NriConstant(REMAINING_LAYERS) = 0; // only for "layerNum"

// Readability
#define NriOptional // i.e. can be 0 (keep an eye on comments)
Expand Down Expand Up @@ -324,7 +321,7 @@ NriUnion(Color) {
Nri(Color32i) i;
};

NriStruct(SamplePosition) {
NriStruct(SampleLocation) {
int8_t x, y; // [-8; 7]
};

Expand Down Expand Up @@ -505,6 +502,13 @@ NriStruct(DescriptorPoolDesc) {
#pragma region [ Pipeline layout ]
//===============================================================================================================================

NriBits(DescriptorRangeBits, uint8_t,
NONE = 0,
PARTIALLY_BOUND = NriBit(0), // descriptors in range may not contain valid descriptors at the time the descriptors are consumed (but referenced descriptors must be valid)
ARRAY = NriBit(1), // descriptors in range are organized into an array
VARIABLE_SIZED_ARRAY = NriBit(2) // descriptors in range are organized into a variable-sized array, whose size is specified via "variableDescriptorNum" argument of "AllocateDescriptorSets" function
);

NriStruct(PushConstantDesc) {
uint32_t registerIndex;
uint32_t size;
Expand All @@ -513,11 +517,10 @@ NriStruct(PushConstantDesc) {

NriStruct(DescriptorRangeDesc) {
uint32_t baseRegisterIndex;
uint32_t descriptorNum;
uint32_t descriptorNum; // treated as max size if "VARIABLE_SIZED_ARRAY" flag is set
Nri(DescriptorType) descriptorType;
Nri(StageBits) shaderStages;
bool isDescriptorNumVariable;
bool isArray;
Nri(DescriptorRangeBits) flags;
};

NriStruct(DynamicConstantBufferDesc) {
Expand All @@ -531,7 +534,6 @@ NriStruct(DescriptorSetDesc) {
uint32_t rangeNum;
const NriPtr(DynamicConstantBufferDesc) dynamicConstantBuffers; // a dynamic constant buffer allows to dynamically specify an offset in the buffer via "CmdSetDescriptorSet" call
uint32_t dynamicConstantBufferNum;
bool partiallyBound;
};

NriStruct(PipelineLayoutDesc) {
Expand Down Expand Up @@ -637,6 +639,8 @@ NriEnum(ShadingRate, uint8_t,
FRAGMENT_SIZE_1X2,
FRAGMENT_SIZE_2X1,
FRAGMENT_SIZE_2X2,

// Require "isAdditionalShadingRatesSupported"
FRAGMENT_SIZE_2X4,
FRAGMENT_SIZE_4X2,
FRAGMENT_SIZE_4X4
Expand Down Expand Up @@ -676,15 +680,15 @@ NriStruct(RasterizationDesc) {
bool frontCounterClockwise;
bool depthClamp;
bool lineSmoothing; // requires "isLineSmoothingSupported"
bool conservativeRaster; // requires "conservativeRasterTier"
bool shadingRate; // requires "is*ShadingRateSupported", expects "CmdSetShadingRate" and optionally "AttachmentsDesc::shadingRate"
bool conservativeRaster; // requires "conservativeRasterTier != 0"
bool shadingRate; // requires "shadingRateTier != 0", expects "CmdSetShadingRate" and optionally "AttachmentsDesc::shadingRate"
};

NriStruct(MultisampleDesc) {
uint32_t sampleMask;
Nri(Sample_t) sampleNum;
bool alphaToCoverage;
bool programmableSampleLocations; // requires "isProgrammableSampleLocationsSupported", expects "CmdSetSamplePositions"
bool sampleLocations; // requires "sampleLocationsTier != 0", expects "CmdSetSampleLocations"
};

NriStruct(ShadingRateDesc) {
Expand Down Expand Up @@ -855,7 +859,7 @@ NriStruct(OutputMergerDesc) {

NriStruct(AttachmentsDesc) {
NriOptional const NriPtr(Descriptor) depthStencil;
NriOptional const NriPtr(Descriptor) shadingRate; // requires "isAttachmentShadingRateSupported"
NriOptional const NriPtr(Descriptor) shadingRate; // requires "shadingRateTier >= 2"
const NriPtr(Descriptor) const* colors;
uint32_t colorNum;
};
Expand Down Expand Up @@ -1238,7 +1242,6 @@ NriStruct(DeviceDesc) {

// Viewports
uint32_t viewportMaxNum;
uint32_t viewportSubPixelBits;
int32_t viewportBoundsRange[2];

// Attachments
Expand Down Expand Up @@ -1349,11 +1352,14 @@ NriStruct(DeviceDesc) {
uint32_t meshEvaluationSharedMemoryMaxSize;
uint32_t meshEvaluationWorkGroupInvocationMaxNum;

// Other
uint64_t timestampFrequencyHz;
// Precision bits
uint32_t viewportPrecisionBits;
uint32_t subPixelPrecisionBits;
uint32_t subTexelPrecisionBits;
uint32_t mipmapPrecisionBits;

// Other
uint64_t timestampFrequencyHz;
uint32_t drawIndirectMaxNum;
float samplerLodBiasMin;
float samplerLodBiasMax;
Expand All @@ -1365,9 +1371,26 @@ NriStruct(DeviceDesc) {
uint32_t clipDistanceMaxNum;
uint32_t cullDistanceMaxNum;
uint32_t combinedClipAndCullDistanceMaxNum;
uint8_t conservativeRasterTier;
uint8_t programmableSampleLocationsTier;
uint8_t shadingRateAttachmentTileSize;
uint8_t shaderModel; // major * 10 + minor

// Tiers (0 - unsupported)
// 1 - 1/2 pixel uncertainty region and does not support post-snap degenerates
// 2 - reduces the maximum uncertainty region to 1/256 and requires post-snap degenerates not be culled
// 3 - maintains a maximum 1/256 uncertainty region and adds support for inner input coverage, aka "SV_InnerCoverage"
uint8_t conservativeRasterTier;

// 1 - a single sample pattern can be specified to repeat for every pixel ("locationNum / sampleNum" must be 1 in "CmdSetSampleLocations")
// 2 - four separate sample patterns can be specified for each pixel in a 2x2 grid ("locationNum / sampleNum" can be up to 4 in "CmdSetSampleLocations")
uint8_t sampleLocationsTier;

// 1 - DXR 1.0: full raytracing functionality, except features below
// 2 - DXR 1.1: adds - ray query, "CmdDispatchRaysIndirect", "GeometryIndex()" intrinsic, additional ray flags & vertex formats
uint8_t rayTracingTier;

// 1 - shading rate can be specified only per draw
// 2 - adds: per primitive shading rate, per "shadingRateAttachmentTileSize" shading rate, combiners, "SV_ShadingRate" support
uint8_t shadingRateTier;

// Features
uint32_t isComputeQueueSupported : 1;
Expand All @@ -1379,15 +1402,11 @@ NriStruct(DeviceDesc) {
uint32_t isIndependentFrontAndBackStencilReferenceAndMasksSupported : 1;
uint32_t isLineSmoothingSupported : 1;
uint32_t isCopyQueueTimestampSupported : 1;
uint32_t isDispatchRaysIndirectSupported : 1;
uint32_t isDrawMeshTasksIndirectSupported : 1;
uint32_t isMeshShaderPipelineStatsSupported : 1;
uint32_t isEnchancedBarrierSupported : 1; // aka - can "Layout" be ignored?
uint32_t isMemoryTier2Supported : 1; // a memory object can support resources from all 3 categories (buffers, attachments, all other textures)
uint32_t isPipelineShadingRateSupported : 1;
uint32_t isPrimitiveShadingRateSupported : 1;
uint32_t isAttachmentShadingRateSupported : 1;
uint32_t isDynamicDepthBiasSupported : 1;
uint32_t isAdditionalShadingRatesSupported : 1;

// Shader features
uint32_t isShaderNativeI16Supported : 1;
Expand All @@ -1396,7 +1415,6 @@ NriStruct(DeviceDesc) {
uint32_t isShaderNativeF32Supported : 1;
uint32_t isShaderNativeI64Supported : 1;
uint32_t isShaderNativeF64Supported : 1;

uint32_t isShaderAtomicsI16Supported : 1;
uint32_t isShaderAtomicsF16Supported : 1;
uint32_t isShaderAtomicsI32Supported : 1;
Expand Down
2 changes: 1 addition & 1 deletion Resources/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define STR(x) STR_HELPER(x)

#define VERSION_MAJOR 1
#define VERSION_MINOR 147
#define VERSION_MINOR 148
#define VERSION_BUILD 0
#define VERSION_REVISION 0

Expand Down
6 changes: 3 additions & 3 deletions Source/D3D11/CommandBufferD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ void CommandBufferD3D11::SetStencilReference(uint8_t frontRef, uint8_t backRef)
m_StencilRef = frontRef;
}

void CommandBufferD3D11::SetSamplePositions(const SamplePosition* positions, Sample_t positionNum, Sample_t sampleNum) {
void CommandBufferD3D11::SetSampleLocations(const SampleLocation* locations, Sample_t locationNum, Sample_t sampleNum) {
MaybeUnused(sampleNum); // already have this in "m_RasterizerDesc"

m_SamplePositionsState.Set(positions, positionNum);
m_SamplePositionsState.Set(locations, locationNum);

if (m_Pipeline)
m_Pipeline->ChangeSamplePositions(m_DeferredContext, m_SamplePositionsState);
Expand Down Expand Up @@ -251,7 +251,7 @@ void CommandBufferD3D11::BeginRendering(const AttachmentsDesc& attachmentsDesc)

// Shading rate
#if NRI_USE_EXT_LIBS
if (m_Device.GetExt()->HasNVAPI() && m_Device.GetDesc().isAttachmentShadingRateSupported) {
if (m_Device.GetExt()->HasNVAPI() && m_Device.GetDesc().shadingRateTier >= 2) {
ID3D11NvShadingRateResourceView* shadingRateImage = nullptr;
if (attachmentsDesc.shadingRate) {
const DescriptorD3D11& descriptor = *(DescriptorD3D11*)attachmentsDesc.shadingRate;
Expand Down
2 changes: 1 addition & 1 deletion Source/D3D11/CommandBufferD3D11.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct CommandBufferD3D11 final : public CommandBufferHelper {
void SetScissors(const Rect* rects, uint32_t rectNum);
void SetDepthBounds(float boundsMin, float boundsMax);
void SetStencilReference(uint8_t frontRef, uint8_t backRef);
void SetSamplePositions(const SamplePosition* positions, Sample_t positionNum, Sample_t sampleNum);
void SetSampleLocations(const SampleLocation* locations, Sample_t locationNum, Sample_t sampleNum);
void SetBlendConstants(const Color32f& color);
void ClearAttachments(const ClearDesc* clearDescs, uint32_t clearDescNum, const Rect* rects, uint32_t rectNum);
void ClearStorageBuffer(const ClearStorageBufferDesc& clearDesc);
Expand Down
4 changes: 2 additions & 2 deletions Source/D3D11/CommandBufferD3D11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static void NRI_CALL CmdSetStencilReference(CommandBuffer& commandBuffer, uint8_
((CommandBufferD3D11&)commandBuffer).SetStencilReference(frontRef, backRef);
}

static void NRI_CALL CmdSetSamplePositions(CommandBuffer& commandBuffer, const SamplePosition* positions, Sample_t positionNum, Sample_t sampleNum) {
((CommandBufferD3D11&)commandBuffer).SetSamplePositions(positions, positionNum, sampleNum);
static void NRI_CALL CmdSetSampleLocations(CommandBuffer& commandBuffer, const SampleLocation* locations, Sample_t locationNum, Sample_t sampleNum) {
((CommandBufferD3D11&)commandBuffer).SetSampleLocations(locations, locationNum, sampleNum);
}

static void NRI_CALL CmdSetBlendConstants(CommandBuffer& commandBuffer, const Color32f& color) {
Expand Down
14 changes: 7 additions & 7 deletions Source/D3D11/CommandBufferEmuD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ enum OpCode : uint32_t {
SET_SCISSORS,
SET_DEPTH_BOUNDS,
SET_STENCIL_REFERENCE,
SET_SAMPLE_POSITIONS,
SET_SAMPLE_LOCATIONS,
SET_BLEND_CONSTANTS,
CLEAR_ATTACHMENTS,
CLEAR_STORAGE_BUFFER,
Expand Down Expand Up @@ -162,14 +162,14 @@ void CommandBufferEmuD3D11::Submit() {

commandBuffer.SetStencilReference(frontRef, backRef);
} break;
case SET_SAMPLE_POSITIONS: {
SamplePosition* positions;
case SET_SAMPLE_LOCATIONS: {
SampleLocation* positions;
uint32_t positionNum;
Sample_t sampleNum;
Read(m_PushBuffer, i, positions, positionNum);
Read(m_PushBuffer, i, sampleNum);

commandBuffer.SetSamplePositions(positions, (Sample_t)positionNum, sampleNum);
commandBuffer.SetSampleLocations(positions, (Sample_t)positionNum, sampleNum);
} break;
case SET_BLEND_CONSTANTS: {
Color32f color;
Expand Down Expand Up @@ -509,9 +509,9 @@ inline void CommandBufferEmuD3D11::SetStencilReference(uint8_t frontRef, uint8_t
Push(m_PushBuffer, backRef);
}

inline void CommandBufferEmuD3D11::SetSamplePositions(const SamplePosition* positions, Sample_t positionNum, Sample_t sampleNum) {
Push(m_PushBuffer, SET_SAMPLE_POSITIONS);
Push(m_PushBuffer, positions, (uint32_t)positionNum);
inline void CommandBufferEmuD3D11::SetSampleLocations(const SampleLocation* locations, Sample_t locationNum, Sample_t sampleNum) {
Push(m_PushBuffer, SET_SAMPLE_LOCATIONS);
Push(m_PushBuffer, locations, (uint32_t)locationNum);
Push(m_PushBuffer, sampleNum);
}

Expand Down
2 changes: 1 addition & 1 deletion Source/D3D11/CommandBufferEmuD3D11.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct CommandBufferEmuD3D11 final : public CommandBufferHelper {
void SetScissors(const Rect* rects, uint32_t rectNum);
void SetDepthBounds(float boundsMin, float boundsMax);
void SetStencilReference(uint8_t frontRef, uint8_t backRef);
void SetSamplePositions(const SamplePosition* positions, Sample_t positionNum, Sample_t sampleNum);
void SetSampleLocations(const SampleLocation* locations, Sample_t locationNum, Sample_t sampleNum);
void SetBlendConstants(const Color32f& color);
void ClearAttachments(const ClearDesc* clearDescs, uint32_t clearDescNum, const Rect* rects, uint32_t rectNum);
void ClearStorageBuffer(const ClearStorageBufferDesc& clearDesc);
Expand Down
6 changes: 3 additions & 3 deletions Source/D3D11/CommandBufferEmuD3D11.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ static void NRI_CALL CmdSetStencilReference(CommandBuffer& commandBuffer, uint8_
((CommandBufferEmuD3D11&)commandBuffer).SetStencilReference(frontRef, backRef);
}

static void NRI_CALL CmdSetSamplePositions(CommandBuffer& commandBuffer, const SamplePosition* positions, Sample_t positionNum, Sample_t sampleNum) {
((CommandBufferEmuD3D11&)commandBuffer).SetSamplePositions(positions, positionNum, sampleNum);
static void NRI_CALL CmdSetSampleLocations(CommandBuffer& commandBuffer, const SampleLocation* locations, Sample_t locationNum, Sample_t sampleNum) {
((CommandBufferEmuD3D11&)commandBuffer).SetSampleLocations(locations, locationNum, sampleNum);
}

static void NRI_CALL CmdSetBlendConstants(CommandBuffer& commandBuffer, const Color32f& color) {
Expand Down Expand Up @@ -186,7 +186,7 @@ void Core_CommandBufferEmu_PartiallyFillFunctionTable(CoreInterface& table) {
table.CmdSetScissors = ::CmdSetScissors;
table.CmdSetDepthBounds = ::CmdSetDepthBounds;
table.CmdSetStencilReference = ::CmdSetStencilReference;
table.CmdSetSamplePositions = ::CmdSetSamplePositions;
table.CmdSetSampleLocations = ::CmdSetSampleLocations;
table.CmdSetBlendConstants = ::CmdSetBlendConstants;
table.CmdSetShadingRate = ::CmdSetShadingRate;
table.CmdSetDepthBias = ::CmdSetDepthBias;
Expand Down
13 changes: 7 additions & 6 deletions Source/D3D11/DeviceD3D11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ void DeviceD3D11::FillDesc() {
}

m_Desc.viewportMaxNum = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE;
m_Desc.viewportSubPixelBits = D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT;
m_Desc.viewportBoundsRange[0] = D3D11_VIEWPORT_BOUNDS_MIN;
m_Desc.viewportBoundsRange[1] = D3D11_VIEWPORT_BOUNDS_MAX;

Expand Down Expand Up @@ -389,10 +388,12 @@ void DeviceD3D11::FillDesc() {
m_Desc.computeShaderWorkGroupMaxDim[1] = D3D11_CS_THREAD_GROUP_MAX_Y;
m_Desc.computeShaderWorkGroupMaxDim[2] = D3D11_CS_THREAD_GROUP_MAX_Z;

m_Desc.timestampFrequencyHz = timestampFrequency;
m_Desc.viewportPrecisionBits = D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT;
m_Desc.subPixelPrecisionBits = D3D11_SUBPIXEL_FRACTIONAL_BIT_COUNT;
m_Desc.subTexelPrecisionBits = D3D11_SUBTEXEL_FRACTIONAL_BIT_COUNT;
m_Desc.mipmapPrecisionBits = D3D11_MIP_LOD_FRACTIONAL_BIT_COUNT;

m_Desc.timestampFrequencyHz = timestampFrequency;
m_Desc.drawIndirectMaxNum = (1ull << D3D11_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP) - 1;
m_Desc.samplerLodBiasMin = D3D11_MIP_LOD_BIAS_MIN;
m_Desc.samplerLodBiasMax = D3D11_MIP_LOD_BIAS_MAX;
Expand All @@ -404,6 +405,8 @@ void DeviceD3D11::FillDesc() {
m_Desc.clipDistanceMaxNum = D3D11_CLIP_OR_CULL_DISTANCE_COUNT;
m_Desc.cullDistanceMaxNum = D3D11_CLIP_OR_CULL_DISTANCE_COUNT;
m_Desc.combinedClipAndCullDistanceMaxNum = D3D11_CLIP_OR_CULL_DISTANCE_COUNT;
m_Desc.shaderModel = 51;

m_Desc.conservativeRasterTier = (uint8_t)options2.ConservativeRasterizationTier;

bool isShaderAtomicsF16Supported = false;
Expand All @@ -419,11 +422,9 @@ void DeviceD3D11::FillDesc() {
REPORT_ERROR_ON_BAD_STATUS(this, NvAPI_D3D1x_GetGraphicsCapabilities(m_Device, NV_D3D1x_GRAPHICS_CAPS_VER, &caps));
}

m_Desc.programmableSampleLocationsTier = rasterizerFeatures.ProgrammableSamplePositions ? 2 : 0;
m_Desc.sampleLocationsTier = rasterizerFeatures.ProgrammableSamplePositions ? 2 : 0;

m_Desc.isPipelineShadingRateSupported = false;
m_Desc.isPrimitiveShadingRateSupported = false;
m_Desc.isAttachmentShadingRateSupported = caps.bVariablePixelRateShadingSupported;
m_Desc.shadingRateTier = caps.bVariablePixelRateShadingSupported ? 2 : 0;
m_Desc.shadingRateAttachmentTileSize = NV_VARIABLE_PIXEL_SHADING_TILE_WIDTH;
#endif

Expand Down
Loading

0 comments on commit 87597b3

Please sign in to comment.