diff --git a/shared/source/command_container/command_encoder_from_xe3_and_later.inl b/shared/source/command_container/command_encoder_from_xe3_and_later.inl index 73fabc2cc4..ce7066b21a 100644 --- a/shared/source/command_container/command_encoder_from_xe3_and_later.inl +++ b/shared/source/command_container/command_encoder_from_xe3_and_later.inl @@ -34,7 +34,7 @@ void EncodeEnableRayTracing::append3dStateBtd(void *ptr3dStateBtd) { cmd->setDispatchTimeoutCounter(value); } - cmd->setRtMemStructures64bModeEnable(!is48bResourceNeededForRayTracing()); + cmd->setRtMemStructures64BModeEnable(!is48bResourceNeededForRayTracing()); } template diff --git a/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl b/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl index 4bf1f98488..6d64419c9f 100644 --- a/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl +++ b/shared/source/generated/xe3_core/hw_cmds_generated_xe3_core.inl @@ -4923,20 +4923,24 @@ typedef struct tag_3DSTATE_BTD { uint32_t CommandType : BITFIELD_RANGE(29, 31); // DWORD 1 uint32_t DispatchTimeoutCounter : BITFIELD_RANGE(0, 2); - uint32_t Reserved_3 : BITFIELD_RANGE(3, 6); + uint32_t Reserved_35 : BITFIELD_RANGE(3, 6); uint32_t ControlsTheMaximumNumberOfOutstandingRayqueriesPerSs : BITFIELD_RANGE(7, 8); - uint32_t Reserved_9 : BITFIELD_RANGE(9, 29); - uint32_t RtMemStructures64bModeEnable : BITFIELD_RANGE(30, 30); + uint32_t DynamicStackManagementMechanismMissPenalty : BITFIELD_RANGE(9, 11); + uint32_t DynamicStackManagementMechanismHitReward : BITFIELD_RANGE(12, 14); + uint32_t DynamicStackManagementMechanismScalingFactor : BITFIELD_RANGE(15, 17); + uint32_t DynamicStackManagementMechanismReductionCap : BITFIELD_RANGE(18, 20); + uint32_t Reserved_53 : BITFIELD_RANGE(21, 29); + uint32_t RtMemStructures64BModeEnable : BITFIELD_RANGE(30, 30); uint32_t BtdMidThreadPreemption : BITFIELD_RANGE(31, 31); // DWORD 2 uint64_t PerDssMemoryBackedBufferSize : BITFIELD_RANGE(0, 2); - uint64_t Reserved_35 : BITFIELD_RANGE(3, 9); + uint64_t Reserved_67 : BITFIELD_RANGE(3, 9); uint64_t MemoryBackedBufferBasePointer : BITFIELD_RANGE(10, 63); - // DWORD 3 - uint64_t Reserved_96 : BITFIELD_RANGE(0, 9); - uint64_t ScratchSpaceBuffer : BITFIELD_RANGE(10, 31); // DWORD 4 - uint64_t Reserved_128 : BITFIELD_RANGE(32, 63); + uint64_t Reserved_128 : BITFIELD_RANGE(0, 9); + uint64_t ScratchSpaceBuffer : BITFIELD_RANGE(10, 31); + // DWORD 5 + uint64_t Reserved_160 : BITFIELD_RANGE(32, 63); } Common; uint32_t RawData[6]; } TheStructure; @@ -4971,6 +4975,46 @@ typedef struct tag_3DSTATE_BTD { CONTROLS_THE_MAXIMUM_NUMBER_OF_OUTSTANDING_RAYQUERIES_PER_SS_512 = 0x2, CONTROLS_THE_MAXIMUM_NUMBER_OF_OUTSTANDING_RAYQUERIES_PER_SS_1024 = 0x3, } CONTROLS_THE_MAXIMUM_NUMBER_OF_OUTSTANDING_RAYQUERIES_PER_SS; + typedef enum tagDYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY { // patched + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_1 = 0x0, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_2 = 0x1, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_4 = 0x2, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_8 = 0x3, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_16 = 0x4, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_32 = 0x5, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_64 = 0x6, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_128 = 0x7, + } DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY; + typedef enum tagDYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD { // patched + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_1 = 0x0, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_2 = 0x1, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_4 = 0x2, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_8 = 0x3, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_16 = 0x4, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_32 = 0x5, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_64 = 0x6, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_128 = 0x7, + } DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD; + typedef enum tagDYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR { // patched + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_1 = 0x0, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_2 = 0x1, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_4 = 0x2, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_8 = 0x3, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_16 = 0x4, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_32 = 0x5, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_64 = 0x6, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_128 = 0x7, + } DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR; + typedef enum tagDYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP { // patched + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_128 = 0x0, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_256 = 0x1, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_384 = 0x2, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_512 = 0x3, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_640 = 0x4, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_768 = 0x5, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_896 = 0x6, + DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_1024 = 0x7, + } DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP; typedef enum tagPER_DSS_MEMORY_BACKED_BUFFER_SIZE { PER_DSS_MEMORY_BACKED_BUFFER_SIZE_2KB = 0x0, PER_DSS_MEMORY_BACKED_BUFFER_SIZE_4KB = 0x1, @@ -4989,7 +5033,11 @@ typedef struct tag_3DSTATE_BTD { TheStructure.Common.CommandType = COMMAND_TYPE_GFXPIPE; TheStructure.Common.DispatchTimeoutCounter = DISPATCH_TIMEOUT_COUNTER_64; TheStructure.Common.ControlsTheMaximumNumberOfOutstandingRayqueriesPerSs = CONTROLS_THE_MAXIMUM_NUMBER_OF_OUTSTANDING_RAYQUERIES_PER_SS_128; - TheStructure.Common.PerDssMemoryBackedBufferSize = PER_DSS_MEMORY_BACKED_BUFFER_SIZE_2KB; + TheStructure.Common.DynamicStackManagementMechanismMissPenalty = DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY_16; // patched + TheStructure.Common.DynamicStackManagementMechanismHitReward = DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD_1; // patched + TheStructure.Common.DynamicStackManagementMechanismScalingFactor = DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR_16; // patched + TheStructure.Common.DynamicStackManagementMechanismReductionCap = DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP_256; // patched + TheStructure.Common.PerDssMemoryBackedBufferSize = PER_DSS_MEMORY_BACKED_BUFFER_SIZE_128KB; } static tag_3DSTATE_BTD sInit() { _3DSTATE_BTD state; @@ -5012,18 +5060,42 @@ typedef struct tag_3DSTATE_BTD { inline CONTROLS_THE_MAXIMUM_NUMBER_OF_OUTSTANDING_RAYQUERIES_PER_SS getControlsTheMaximumNumberOfOutstandingRayqueriesPerSs() const { return static_cast(TheStructure.Common.ControlsTheMaximumNumberOfOutstandingRayqueriesPerSs); } + inline void setDynamicStackManagementMechanismMissPenalty(const DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY value) { // patched + TheStructure.Common.DynamicStackManagementMechanismMissPenalty = value; + } + inline DYNAMIC_STACK_MANAGEMENT_MECHANISM_MISS_PENALTY getDynamicStackManagementMechanismMissPenalty() const { // patched + return static_cast(TheStructure.Common.DynamicStackManagementMechanismMissPenalty); + } + inline void setDynamicStackManagementMechanismHitReward(const DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD value) { // patched + TheStructure.Common.DynamicStackManagementMechanismHitReward = value; + } + inline DYNAMIC_STACK_MANAGEMENT_MECHANISM_HIT_REWARD getDynamicStackManagementMechanismHitReward() const { // patched + return static_cast(TheStructure.Common.DynamicStackManagementMechanismHitReward); + } + inline void setDynamicStackManagementMechanismScalingFactor(const DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR value) { // patched + TheStructure.Common.DynamicStackManagementMechanismScalingFactor = value; + } + inline DYNAMIC_STACK_MANAGEMENT_MECHANISM_SCALING_FACTOR getDynamicStackManagementMechanismScalingFactor() const { // patched + return static_cast(TheStructure.Common.DynamicStackManagementMechanismScalingFactor); + } + inline void setDynamicStackManagementMechanismReductionCap(const DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP value) { // patched + TheStructure.Common.DynamicStackManagementMechanismReductionCap = value; + } + inline DYNAMIC_STACK_MANAGEMENT_MECHANISM_REDUCTION_CAP getDynamicStackManagementMechanismReductionCap() const { // patched + return static_cast(TheStructure.Common.DynamicStackManagementMechanismReductionCap); + } + inline void setRtMemStructures64BModeEnable(const bool value) { + TheStructure.Common.RtMemStructures64BModeEnable = value; + } + inline bool getRtMemStructures64BModeEnable() const { + return TheStructure.Common.RtMemStructures64BModeEnable; + } inline void setBtdMidThreadPreemption(const bool value) { TheStructure.Common.BtdMidThreadPreemption = value; } inline bool getBtdMidThreadPreemption() const { return TheStructure.Common.BtdMidThreadPreemption; } - inline void setRtMemStructures64bModeEnable(const bool value) { - TheStructure.Common.RtMemStructures64bModeEnable = value; - } - inline bool getRtMemStructures64bModeEnable() const { - return TheStructure.Common.RtMemStructures64bModeEnable; - } inline void setPerDssMemoryBackedBufferSize(const PER_DSS_MEMORY_BACKED_BUFFER_SIZE value) { TheStructure.Common.PerDssMemoryBackedBufferSize = value; } @@ -5045,6 +5117,7 @@ typedef struct tag_3DSTATE_BTD { SCRATCHSPACEBUFFER_ALIGN_SIZE = 0x40, } SCRATCHSPACEBUFFER; inline void setScratchSpaceBuffer(const uint64_t value) { + UNRECOVERABLE_IF(value > 0xfffffff); TheStructure.Common.ScratchSpaceBuffer = static_cast(value) >> SCRATCHSPACEBUFFER_BIT_SHIFT; } inline uint64_t getScratchSpaceBuffer() const { diff --git a/shared/test/unit_test/xe3_core/test_encode_3dstate_btd_xe3_core.cpp b/shared/test/unit_test/xe3_core/test_encode_3dstate_btd_xe3_core.cpp index 9188ff4075..01363eabab 100644 --- a/shared/test/unit_test/xe3_core/test_encode_3dstate_btd_xe3_core.cpp +++ b/shared/test/unit_test/xe3_core/test_encode_3dstate_btd_xe3_core.cpp @@ -108,7 +108,7 @@ HWTEST2_P(CommandEncodeEnableRayTracingAndEnable64bAddressingForRayTracing, give ASSERT_NE(iterator3dStateBtd, commands.end()); auto cmd3dStateBtd = genCmdCast<_3DSTATE_BTD *>(*iterator3dStateBtd); - EXPECT_EQ(static_cast(cmd3dStateBtd->getRtMemStructures64bModeEnable()), enable64bAddressingForRayTracing == -1 ? true : static_cast(enable64bAddressingForRayTracing)); + EXPECT_EQ(static_cast(cmd3dStateBtd->getRtMemStructures64BModeEnable()), enable64bAddressingForRayTracing == -1 ? true : static_cast(enable64bAddressingForRayTracing)); } INSTANTIATE_TEST_SUITE_P(