From 699e14ec9859c4ba1feda6618293297adaaa2f22 Mon Sep 17 00:00:00 2001 From: wangra-google <62302956+wangra-google@users.noreply.github.com> Date: Mon, 30 Oct 2023 17:19:12 -0400 Subject: [PATCH] Add more state tracking (#31) - add logicOp as per attatchment tracking - add more hw specific states tracking --- dive_core/data_core.cpp | 113 +- dive_core/event_state.cpp | 337 ++- dive_core/event_state.h | 3239 +++++++++-------------------- dive_core/event_state.json | 157 +- dive_core/event_state.natvis | 624 ++---- dive_core/generateAdrenoHeader.py | 9 +- dive_core/generateSOAs.py | 5 +- pydive/py_event_statecpp | 246 +-- ui/event_state_view.cpp | 474 ++--- 9 files changed, 1719 insertions(+), 3485 deletions(-) diff --git a/dive_core/data_core.cpp b/dive_core/data_core.cpp index b5e452125..9cacdfae4 100644 --- a/dive_core/data_core.cpp +++ b/dive_core/data_core.cpp @@ -631,42 +631,15 @@ void CaptureMetadataCreator::FillColorBlendState(EventStateInfo::Iterator event_ rb_mrt_blend_control.bitfields.ALPHA_BLEND_OPCODE); event_state_it->SetAttachment(rt_id, attach); + const bool logic_op_enabled = (rb_mrt_control.bitfields.ROP_ENABLE == 1); + // Be careful!!! Here we assume the enum `VkLogicOp` matches exactly `a3xx_rop_code` + const VkLogicOp op = static_cast(rb_mrt_control.bitfields.ROP_CODE); + event_state_it->SetLogicOpEnabled(rt_id, logic_op_enabled); + event_state_it->SetLogicOp(rt_id, op); + ++rt_id; } - // TODO(wangra): rop code should be set per MR - // if (m_state_tracker.IsContextStateSet(mmCB_COLOR_CONTROL)) - //{ - // CB_COLOR_CONTROL cb_color_control; - // cb_color_control.u32All = m_state_tracker.GetContextRegData(mmCB_COLOR_CONTROL); - - // VkLogicOp op = VK_LOGIC_OP_MAX_ENUM; - // switch (cb_color_control.bits.ROP3) - // { - // case 0x00: op = VK_LOGIC_OP_CLEAR; break; - // case 0x88: op = VK_LOGIC_OP_AND; break; - // case 0x44: op = VK_LOGIC_OP_AND_REVERSE; break; - // case 0xCC: op = VK_LOGIC_OP_COPY; break; - // case 0x22: op = VK_LOGIC_OP_AND_INVERTED; break; - // case 0xAA: op = VK_LOGIC_OP_NO_OP; break; - // case 0x66: op = VK_LOGIC_OP_XOR; break; - // case 0xEE: op = VK_LOGIC_OP_OR; break; - // case 0x11: op = VK_LOGIC_OP_NOR; break; - // case 0x99: op = VK_LOGIC_OP_EQUIVALENT; break; - // case 0x55: op = VK_LOGIC_OP_INVERT; break; - // case 0xDD: op = VK_LOGIC_OP_OR_REVERSE; break; - // case 0x33: op = VK_LOGIC_OP_COPY_INVERTED; break; - // case 0xBB: op = VK_LOGIC_OP_OR_INVERTED; break; - // case 0x77: op = VK_LOGIC_OP_NAND; break; - // case 0xFF: op = VK_LOGIC_OP_SET; break; - // }; - // event_state_it->SetLogicOp(op); - - // // Setting op to COPY is equivalent to disabling the logic-op, since it's the default - // // behavior. In fact, from PM4 perspective, the 2 are indistinguishable - // event_state_it->SetLogicOpEnabled(op != VK_LOGIC_OP_COPY); - //} - // Assumption: The ICD sets all of the color channels together. So it is enough // to check whether just 1 of them is set or not. It's all or nothing. uint32_t rb_blend_red_reg_offset = GetRegOffsetByName("RB_BLEND_RED_F32"); @@ -692,6 +665,78 @@ void CaptureMetadataCreator::FillColorBlendState(EventStateInfo::Iterator event_ } //-------------------------------------------------------------------------------------------------- -void CaptureMetadataCreator::FillHardwareSpecificStates(EventStateInfo::Iterator event_state_it) {} +void CaptureMetadataCreator::FillHardwareSpecificStates(EventStateInfo::Iterator event_state_it) +{ + // LRZ related + uint32_t gras_lrz_cntl_reg_offset = GetRegOffsetByName("GRAS_LRZ_CNTL"); + if (m_state_tracker.IsRegSet(gras_lrz_cntl_reg_offset)) + { + GRAS_LRZ_CNTL gras_lrz_cntl; + gras_lrz_cntl.u32All = m_state_tracker.GetRegValue(gras_lrz_cntl_reg_offset); + const auto bitfields = gras_lrz_cntl.bitfields; + const bool lrz_enabled = bitfields.ENABLE; + const bool lrz_write = bitfields.LRZ_WRITE; + const a6xx_lrz_dir_status lrz_dir_status = bitfields.DIR; + const bool lrz_dir_write = bitfields.DIR_WRITE; + + event_state_it->SetLRZEnabled(lrz_enabled); + if (lrz_enabled) + { + event_state_it->SetLRZWrite(lrz_write); + event_state_it->SetLRZDirStatus(lrz_dir_status); + event_state_it->SetLRZDirWrite(lrz_dir_write); + } + } + + uint32_t gras_su_depth_plane_cntl_reg_offset = GetRegOffsetByName("GRAS_SU_DEPTH_PLANE_CNTL"); + if (m_state_tracker.IsRegSet(gras_su_depth_plane_cntl_reg_offset)) + { + GRAS_SU_DEPTH_PLANE_CNTL gras_su_depth_plane_cntl; + gras_su_depth_plane_cntl.u32All = m_state_tracker.GetRegValue( + gras_su_depth_plane_cntl_reg_offset); + a6xx_ztest_mode ztest_mode = gras_su_depth_plane_cntl.bitfields.Z_MODE; + event_state_it->SetZTestMode(ztest_mode); + } + + // binning related + uint32_t gras_bin_cntl_reg_offset = GetRegOffsetByName("GRAS_BIN_CONTROL"); + if (m_state_tracker.IsRegSet(gras_bin_cntl_reg_offset)) + { + const RegInfo *reg_info = GetRegInfo(gras_bin_cntl_reg_offset); + const RegField *reg_field_w = GetRegFieldByName("BINW", reg_info); + DIVE_ASSERT(reg_field_w != nullptr); + const RegField *reg_field_h = GetRegFieldByName("BINH", reg_info); + DIVE_ASSERT(reg_field_h != nullptr); + GRAS_BIN_CONTROL gras_bin_cntl; + gras_bin_cntl.u32All = m_state_tracker.GetRegValue(gras_bin_cntl_reg_offset); + const auto bitfields = gras_bin_cntl.bitfields; + const uint32_t binw = bitfields.BINW << reg_field_w->m_shr; + const uint32_t binh = bitfields.BINH << reg_field_h->m_shr; + const a6xx_render_mode render_mode = bitfields.RENDER_MODE; + // TODO(wangra): this is only available on a6xx, should disable this on a7xx captures + const a6xx_buffers_location buffers_location = bitfields.BUFFERS_LOCATION; + + event_state_it->SetBinW(binw); + event_state_it->SetBinH(binh); + event_state_it->SetRenderMode(render_mode); + event_state_it->SetBuffersLocation(buffers_location); + } + + // helper lane related + uint32_t sp_fs_ctrl_reg_offset = GetRegOffsetByName("SP_FS_CTRL_REG0"); + if (m_state_tracker.IsRegSet(sp_fs_ctrl_reg_offset)) + { + SP_FS_CTRL_REG0 sp_fs_ctrl; + sp_fs_ctrl.u32All = m_state_tracker.GetRegValue(sp_fs_ctrl_reg_offset); + const auto bitfields = sp_fs_ctrl.bitfields; + const a6xx_threadsize thread_size = bitfields.THREADSIZE; + const bool enable_all_helper_lanes = bitfields.LODPIXMASK; + const bool enable_partial_helper_lanes = bitfields.PIXLODENABLE; + + event_state_it->SetThreadSize(thread_size); + event_state_it->SetEnableAllHelperLanes(enable_all_helper_lanes); + event_state_it->SetEnablePartialHelperLanes(enable_partial_helper_lanes); + } +} } // namespace Dive diff --git a/dive_core/event_state.cpp b/dive_core/event_state.cpp index 6eb53f50e..f2d039e53 100644 --- a/dive_core/event_state.cpp +++ b/dive_core/event_state.cpp @@ -86,22 +86,18 @@ typename EventStateInfo::Id::basic_type new_cap) auto old_logic_op_ptr = LogicOpPtr(); auto old_attachment_ptr = AttachmentPtr(); auto old_blend_constant_ptr = BlendConstantPtr(); - auto old_z_addr_ptr = ZAddrPtr(); - auto old_h_tile_addr_ptr = HTileAddrPtr(); - auto old_hi_z_enabled_ptr = HiZEnabledPtr(); - auto old_hi_s_enabled_ptr = HiSEnabledPtr(); - auto old_z_compress_enabled_ptr = ZCompressEnabledPtr(); - auto old_stencil_compress_enabled_ptr = StencilCompressEnabledPtr(); - auto old_compressed_z_fetch_enabled_ptr = CompressedZFetchEnabledPtr(); - auto old_z_format_ptr = ZFormatPtr(); - auto old_z_order_ptr = ZOrderPtr(); - auto old_vs_late_alloc_ptr = VSLateAllocPtr(); - auto old_dcc_enabled_ptr = DccEnabledPtr(); - auto old_color_format_ptr = ColorFormatPtr(); - auto old_mip0_height_ptr = Mip0HeightPtr(); - auto old_mip0_width_ptr = Mip0WidthPtr(); - auto old_vgpr_ptr = VgprPtr(); - auto old_sgpr_ptr = SgprPtr(); + auto old_lrz_enabled_ptr = LRZEnabledPtr(); + auto old_lrz_write_ptr = LRZWritePtr(); + auto old_lrz_dir_status_ptr = LRZDirStatusPtr(); + auto old_lrz_dir_write_ptr = LRZDirWritePtr(); + auto old_z_test_mode_ptr = ZTestModePtr(); + auto old_bin_w_ptr = BinWPtr(); + auto old_bin_h_ptr = BinHPtr(); + auto old_render_mode_ptr = RenderModePtr(); + auto old_buffers_location_ptr = BuffersLocationPtr(); + auto old_thread_size_ptr = ThreadSizePtr(); + auto old_enable_all_helper_lanes_ptr = EnableAllHelperLanesPtr(); + auto old_enable_partial_helper_lanes_ptr = EnablePartialHelperLanesPtr(); // `old_buffer` keeps the old buffer from being deallocated before we have // copied the data into the new buffer. The old buffer will be deallocated @@ -218,52 +214,41 @@ typename EventStateInfo::Id::basic_type new_cap) static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); memcpy(BlendConstantPtr(), old_blend_constant_ptr, kBlendConstantSize * m_size); - static_assert(std::is_trivially_copyable::value, - "Field type must be trivially copyable"); - memcpy(ZAddrPtr(), old_z_addr_ptr, kZAddrSize * m_size); - static_assert(std::is_trivially_copyable::value, - "Field type must be trivially copyable"); - memcpy(HTileAddrPtr(), old_h_tile_addr_ptr, kHTileAddrSize * m_size); - static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(HiZEnabledPtr(), old_hi_z_enabled_ptr, kHiZEnabledSize * m_size); - static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(HiSEnabledPtr(), old_hi_s_enabled_ptr, kHiSEnabledSize * m_size); - static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(ZCompressEnabledPtr(), old_z_compress_enabled_ptr, kZCompressEnabledSize * m_size); static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(StencilCompressEnabledPtr(), - old_stencil_compress_enabled_ptr, - kStencilCompressEnabledSize * m_size); + memcpy(LRZEnabledPtr(), old_lrz_enabled_ptr, kLRZEnabledSize * m_size); static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(CompressedZFetchEnabledPtr(), - old_compressed_z_fetch_enabled_ptr, - kCompressedZFetchEnabledSize * m_size); - static_assert(std::is_trivially_copyable::value, + memcpy(LRZWritePtr(), old_lrz_write_ptr, kLRZWriteSize * m_size); + static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(ZFormatPtr(), old_z_format_ptr, kZFormatSize * m_size); - static_assert(std::is_trivially_copyable::value, - "Field type must be trivially copyable"); - memcpy(ZOrderPtr(), old_z_order_ptr, kZOrderSize * m_size); - static_assert(std::is_trivially_copyable::value, - "Field type must be trivially copyable"); - memcpy(VSLateAllocPtr(), old_vs_late_alloc_ptr, kVSLateAllocSize * m_size); + memcpy(LRZDirStatusPtr(), old_lrz_dir_status_ptr, kLRZDirStatusSize * m_size); static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(DccEnabledPtr(), old_dcc_enabled_ptr, kDccEnabledSize * m_size); - static_assert(std::is_trivially_copyable::value, + memcpy(LRZDirWritePtr(), old_lrz_dir_write_ptr, kLRZDirWriteSize * m_size); + static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(ColorFormatPtr(), old_color_format_ptr, kColorFormatSize * m_size); + memcpy(ZTestModePtr(), old_z_test_mode_ptr, kZTestModeSize * m_size); static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(Mip0HeightPtr(), old_mip0_height_ptr, kMip0HeightSize * m_size); + memcpy(BinWPtr(), old_bin_w_ptr, kBinWSize * m_size); static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(Mip0WidthPtr(), old_mip0_width_ptr, kMip0WidthSize * m_size); - static_assert(std::is_trivially_copyable::value, + memcpy(BinHPtr(), old_bin_h_ptr, kBinHSize * m_size); + static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(VgprPtr(), old_vgpr_ptr, kVgprSize * m_size); - static_assert(std::is_trivially_copyable::value, + memcpy(RenderModePtr(), old_render_mode_ptr, kRenderModeSize * m_size); + static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); - memcpy(SgprPtr(), old_sgpr_ptr, kSgprSize * m_size); + memcpy(BuffersLocationPtr(), old_buffers_location_ptr, kBuffersLocationSize * m_size); + static_assert(std::is_trivially_copyable::value, + "Field type must be trivially copyable"); + memcpy(ThreadSizePtr(), old_thread_size_ptr, kThreadSizeSize * m_size); + static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); + memcpy(EnableAllHelperLanesPtr(), + old_enable_all_helper_lanes_ptr, + kEnableAllHelperLanesSize * m_size); + static_assert(std::is_trivially_copyable::value, "Field type must be trivially copyable"); + memcpy(EnablePartialHelperLanesPtr(), + old_enable_partial_helper_lanes_ptr, + kEnablePartialHelperLanesSize * m_size); // Update the debug-only ponters to the arrays #ifndef NDEBUG @@ -300,22 +285,18 @@ typename EventStateInfo::Id::basic_type new_cap) DBG_logic_op = LogicOpPtr(); DBG_attachment = AttachmentPtr(); DBG_blend_constant = BlendConstantPtr(); - DBG_z_addr = ZAddrPtr(); - DBG_h_tile_addr = HTileAddrPtr(); - DBG_hi_z_enabled = HiZEnabledPtr(); - DBG_hi_s_enabled = HiSEnabledPtr(); - DBG_z_compress_enabled = ZCompressEnabledPtr(); - DBG_stencil_compress_enabled = StencilCompressEnabledPtr(); - DBG_compressed_z_fetch_enabled = CompressedZFetchEnabledPtr(); - DBG_z_format = ZFormatPtr(); - DBG_z_order = ZOrderPtr(); - DBG_vs_late_alloc = VSLateAllocPtr(); - DBG_dcc_enabled = DccEnabledPtr(); - DBG_color_format = ColorFormatPtr(); - DBG_mip0_height = Mip0HeightPtr(); - DBG_mip0_width = Mip0WidthPtr(); - DBG_vgpr = VgprPtr(); - DBG_sgpr = SgprPtr(); + DBG_lrz_enabled = LRZEnabledPtr(); + DBG_lrz_write = LRZWritePtr(); + DBG_lrz_dir_status = LRZDirStatusPtr(); + DBG_lrz_dir_write = LRZDirWritePtr(); + DBG_z_test_mode = ZTestModePtr(); + DBG_bin_w = BinWPtr(); + DBG_bin_h = BinHPtr(); + DBG_render_mode = RenderModePtr(); + DBG_buffers_location = BuffersLocationPtr(); + DBG_thread_size = ThreadSizePtr(); + DBG_enable_all_helper_lanes = EnableAllHelperLanesPtr(); + DBG_enable_partial_helper_lanes = EnablePartialHelperLanesPtr(); #endif } @@ -371,50 +352,34 @@ template<> EventStateInfo::Iterator EventStateInfoT::Add( new (StencilOpStateBackPtr(Id(m_size))) VkStencilOpState(); new (MinDepthBoundsPtr(Id(m_size))) float(); new (MaxDepthBoundsPtr(Id(m_size))) float(); - new (LogicOpEnabledPtr(Id(m_size))) bool(); - new (LogicOpPtr(Id(m_size))) VkLogicOp(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - new (AttachmentPtr(Id(m_size), attachment)) VkPipelineColorBlendAttachmentState(); - } - for (uint32_t channel = 0; channel < 4; ++channel) - { - new (BlendConstantPtr(Id(m_size), channel)) float(); - } - new (ZAddrPtr(Id(m_size))) uint64_t(); - new (HTileAddrPtr(Id(m_size))) uint64_t(); - new (HiZEnabledPtr(Id(m_size))) bool(); - new (HiSEnabledPtr(Id(m_size))) bool(); - new (ZCompressEnabledPtr(Id(m_size))) bool(); - new (StencilCompressEnabledPtr(Id(m_size))) bool(); - new (CompressedZFetchEnabledPtr(Id(m_size))) bool(); - new (ZFormatPtr(Id(m_size))) Dive::Legacy::ZFormat(); - new (ZOrderPtr(Id(m_size))) Dive::Legacy::ZOrder(); - new (VSLateAllocPtr(Id(m_size))) uint16_t(); for (uint32_t attachment = 0; attachment < 8; ++attachment) { - new (DccEnabledPtr(Id(m_size), attachment)) bool(); + new (LogicOpEnabledPtr(Id(m_size), attachment)) bool(); } for (uint32_t attachment = 0; attachment < 8; ++attachment) { - new (ColorFormatPtr(Id(m_size), attachment)) Dive::Legacy::ColorFormat(); + new (LogicOpPtr(Id(m_size), attachment)) VkLogicOp(); } for (uint32_t attachment = 0; attachment < 8; ++attachment) { - new (Mip0HeightPtr(Id(m_size), attachment)) uint32_t(); - } - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - new (Mip0WidthPtr(Id(m_size), attachment)) uint32_t(); - } - for (uint32_t stage = 0; stage < Dive::kShaderStageCount; ++stage) - { - new (VgprPtr(Id(m_size), static_cast(stage))) uint16_t(); + new (AttachmentPtr(Id(m_size), attachment)) VkPipelineColorBlendAttachmentState(); } - for (uint32_t stage = 0; stage < Dive::kShaderStageCount; ++stage) + for (uint32_t channel = 0; channel < 4; ++channel) { - new (SgprPtr(Id(m_size), static_cast(stage))) uint16_t(); + new (BlendConstantPtr(Id(m_size), channel)) float(); } + new (LRZEnabledPtr(Id(m_size))) bool(); + new (LRZWritePtr(Id(m_size))) bool(); + new (LRZDirStatusPtr(Id(m_size))) a6xx_lrz_dir_status(); + new (LRZDirWritePtr(Id(m_size))) bool(); + new (ZTestModePtr(Id(m_size))) a6xx_ztest_mode(); + new (BinWPtr(Id(m_size))) uint32_t(); + new (BinHPtr(Id(m_size))) uint32_t(); + new (RenderModePtr(Id(m_size))) a6xx_render_mode(); + new (BuffersLocationPtr(Id(m_size))) a6xx_buffers_location(); + new (ThreadSizePtr(Id(m_size))) a6xx_threadsize(); + new (EnableAllHelperLanesPtr(Id(m_size))) bool(); + new (EnablePartialHelperLanesPtr(Id(m_size))) bool(); Id id(m_size); m_size += 1; @@ -461,38 +426,30 @@ EventStateInfoRefT::Id other_id) const SetStencilOpStateBack(other_obj.StencilOpStateBack(other_id)); SetMinDepthBounds(other_obj.MinDepthBounds(other_id)); SetMaxDepthBounds(other_obj.MaxDepthBounds(other_id)); - SetLogicOpEnabled(other_obj.LogicOpEnabled(other_id)); - SetLogicOp(other_obj.LogicOp(other_id)); + memcpy(m_obj_ptr->LogicOpEnabledPtr(m_id), + other_obj.LogicOpEnabledPtr(other_id), + EventStateInfo::kLogicOpEnabledSize); + memcpy(m_obj_ptr->LogicOpPtr(m_id), + other_obj.LogicOpPtr(other_id), + EventStateInfo::kLogicOpSize); memcpy(m_obj_ptr->AttachmentPtr(m_id), other_obj.AttachmentPtr(other_id), EventStateInfo::kAttachmentSize); memcpy(m_obj_ptr->BlendConstantPtr(m_id), other_obj.BlendConstantPtr(other_id), EventStateInfo::kBlendConstantSize); - SetZAddr(other_obj.ZAddr(other_id)); - SetHTileAddr(other_obj.HTileAddr(other_id)); - SetHiZEnabled(other_obj.HiZEnabled(other_id)); - SetHiSEnabled(other_obj.HiSEnabled(other_id)); - SetZCompressEnabled(other_obj.ZCompressEnabled(other_id)); - SetStencilCompressEnabled(other_obj.StencilCompressEnabled(other_id)); - SetCompressedZFetchEnabled(other_obj.CompressedZFetchEnabled(other_id)); - SetZFormat(other_obj.ZFormat(other_id)); - SetZOrder(other_obj.ZOrder(other_id)); - SetVSLateAlloc(other_obj.VSLateAlloc(other_id)); - memcpy(m_obj_ptr->DccEnabledPtr(m_id), - other_obj.DccEnabledPtr(other_id), - EventStateInfo::kDccEnabledSize); - memcpy(m_obj_ptr->ColorFormatPtr(m_id), - other_obj.ColorFormatPtr(other_id), - EventStateInfo::kColorFormatSize); - memcpy(m_obj_ptr->Mip0HeightPtr(m_id), - other_obj.Mip0HeightPtr(other_id), - EventStateInfo::kMip0HeightSize); - memcpy(m_obj_ptr->Mip0WidthPtr(m_id), - other_obj.Mip0WidthPtr(other_id), - EventStateInfo::kMip0WidthSize); - memcpy(m_obj_ptr->VgprPtr(m_id), other_obj.VgprPtr(other_id), EventStateInfo::kVgprSize); - memcpy(m_obj_ptr->SgprPtr(m_id), other_obj.SgprPtr(other_id), EventStateInfo::kSgprSize); + SetLRZEnabled(other_obj.LRZEnabled(other_id)); + SetLRZWrite(other_obj.LRZWrite(other_id)); + SetLRZDirStatus(other_obj.LRZDirStatus(other_id)); + SetLRZDirWrite(other_obj.LRZDirWrite(other_id)); + SetZTestMode(other_obj.ZTestMode(other_id)); + SetBinW(other_obj.BinW(other_id)); + SetBinH(other_obj.BinH(other_id)); + SetRenderMode(other_obj.RenderMode(other_id)); + SetBuffersLocation(other_obj.BuffersLocation(other_id)); + SetThreadSize(other_obj.ThreadSize(other_id)); + SetEnableAllHelperLanes(other_obj.EnableAllHelperLanes(other_id)); + SetEnablePartialHelperLanes(other_obj.EnablePartialHelperLanes(other_id)); } template<> @@ -654,14 +611,20 @@ void EventStateInfoRefT::swap(const EventStateInfoRef &ot other.SetMaxDepthBounds(val); } { - auto val = LogicOpEnabled(); - SetLogicOpEnabled(other.LogicOpEnabled()); - other.SetLogicOpEnabled(val); + bool val[EventStateInfo::kLogicOpEnabledArrayCount]; + auto *ptr = m_obj_ptr->LogicOpEnabledPtr(m_id); + auto *other_ptr = other.m_obj_ptr->LogicOpEnabledPtr(other.m_id); + memcpy(val, ptr, EventStateInfo::kLogicOpEnabledSize); + memcpy(ptr, other_ptr, EventStateInfo::kLogicOpEnabledSize); + memcpy(other_ptr, val, EventStateInfo::kLogicOpEnabledSize); } { - auto val = LogicOp(); - SetLogicOp(other.LogicOp()); - other.SetLogicOp(val); + VkLogicOp val[EventStateInfo::kLogicOpArrayCount]; + auto *ptr = m_obj_ptr->LogicOpPtr(m_id); + auto *other_ptr = other.m_obj_ptr->LogicOpPtr(other.m_id); + memcpy(val, ptr, EventStateInfo::kLogicOpSize); + memcpy(ptr, other_ptr, EventStateInfo::kLogicOpSize); + memcpy(other_ptr, val, EventStateInfo::kLogicOpSize); } { VkPipelineColorBlendAttachmentState val[EventStateInfo::kAttachmentArrayCount]; @@ -680,102 +643,64 @@ void EventStateInfoRefT::swap(const EventStateInfoRef &ot memcpy(other_ptr, val, EventStateInfo::kBlendConstantSize); } { - auto val = ZAddr(); - SetZAddr(other.ZAddr()); - other.SetZAddr(val); - } - { - auto val = HTileAddr(); - SetHTileAddr(other.HTileAddr()); - other.SetHTileAddr(val); - } - { - auto val = HiZEnabled(); - SetHiZEnabled(other.HiZEnabled()); - other.SetHiZEnabled(val); - } - { - auto val = HiSEnabled(); - SetHiSEnabled(other.HiSEnabled()); - other.SetHiSEnabled(val); - } - { - auto val = ZCompressEnabled(); - SetZCompressEnabled(other.ZCompressEnabled()); - other.SetZCompressEnabled(val); + auto val = LRZEnabled(); + SetLRZEnabled(other.LRZEnabled()); + other.SetLRZEnabled(val); } { - auto val = StencilCompressEnabled(); - SetStencilCompressEnabled(other.StencilCompressEnabled()); - other.SetStencilCompressEnabled(val); + auto val = LRZWrite(); + SetLRZWrite(other.LRZWrite()); + other.SetLRZWrite(val); } { - auto val = CompressedZFetchEnabled(); - SetCompressedZFetchEnabled(other.CompressedZFetchEnabled()); - other.SetCompressedZFetchEnabled(val); + auto val = LRZDirStatus(); + SetLRZDirStatus(other.LRZDirStatus()); + other.SetLRZDirStatus(val); } { - auto val = ZFormat(); - SetZFormat(other.ZFormat()); - other.SetZFormat(val); + auto val = LRZDirWrite(); + SetLRZDirWrite(other.LRZDirWrite()); + other.SetLRZDirWrite(val); } { - auto val = ZOrder(); - SetZOrder(other.ZOrder()); - other.SetZOrder(val); + auto val = ZTestMode(); + SetZTestMode(other.ZTestMode()); + other.SetZTestMode(val); } { - auto val = VSLateAlloc(); - SetVSLateAlloc(other.VSLateAlloc()); - other.SetVSLateAlloc(val); + auto val = BinW(); + SetBinW(other.BinW()); + other.SetBinW(val); } { - bool val[EventStateInfo::kDccEnabledArrayCount]; - auto *ptr = m_obj_ptr->DccEnabledPtr(m_id); - auto *other_ptr = other.m_obj_ptr->DccEnabledPtr(other.m_id); - memcpy(val, ptr, EventStateInfo::kDccEnabledSize); - memcpy(ptr, other_ptr, EventStateInfo::kDccEnabledSize); - memcpy(other_ptr, val, EventStateInfo::kDccEnabledSize); + auto val = BinH(); + SetBinH(other.BinH()); + other.SetBinH(val); } { - Dive::Legacy::ColorFormat val[EventStateInfo::kColorFormatArrayCount]; - auto *ptr = m_obj_ptr->ColorFormatPtr(m_id); - auto *other_ptr = other.m_obj_ptr->ColorFormatPtr(other.m_id); - memcpy(val, ptr, EventStateInfo::kColorFormatSize); - memcpy(ptr, other_ptr, EventStateInfo::kColorFormatSize); - memcpy(other_ptr, val, EventStateInfo::kColorFormatSize); + auto val = RenderMode(); + SetRenderMode(other.RenderMode()); + other.SetRenderMode(val); } { - uint32_t val[EventStateInfo::kMip0HeightArrayCount]; - auto *ptr = m_obj_ptr->Mip0HeightPtr(m_id); - auto *other_ptr = other.m_obj_ptr->Mip0HeightPtr(other.m_id); - memcpy(val, ptr, EventStateInfo::kMip0HeightSize); - memcpy(ptr, other_ptr, EventStateInfo::kMip0HeightSize); - memcpy(other_ptr, val, EventStateInfo::kMip0HeightSize); + auto val = BuffersLocation(); + SetBuffersLocation(other.BuffersLocation()); + other.SetBuffersLocation(val); } { - uint32_t val[EventStateInfo::kMip0WidthArrayCount]; - auto *ptr = m_obj_ptr->Mip0WidthPtr(m_id); - auto *other_ptr = other.m_obj_ptr->Mip0WidthPtr(other.m_id); - memcpy(val, ptr, EventStateInfo::kMip0WidthSize); - memcpy(ptr, other_ptr, EventStateInfo::kMip0WidthSize); - memcpy(other_ptr, val, EventStateInfo::kMip0WidthSize); + auto val = ThreadSize(); + SetThreadSize(other.ThreadSize()); + other.SetThreadSize(val); } { - uint16_t val[EventStateInfo::kVgprArrayCount]; - auto *ptr = m_obj_ptr->VgprPtr(m_id); - auto *other_ptr = other.m_obj_ptr->VgprPtr(other.m_id); - memcpy(val, ptr, EventStateInfo::kVgprSize); - memcpy(ptr, other_ptr, EventStateInfo::kVgprSize); - memcpy(other_ptr, val, EventStateInfo::kVgprSize); + auto val = EnableAllHelperLanes(); + SetEnableAllHelperLanes(other.EnableAllHelperLanes()); + other.SetEnableAllHelperLanes(val); } { - uint16_t val[EventStateInfo::kSgprArrayCount]; - auto *ptr = m_obj_ptr->SgprPtr(m_id); - auto *other_ptr = other.m_obj_ptr->SgprPtr(other.m_id); - memcpy(val, ptr, EventStateInfo::kSgprSize); - memcpy(ptr, other_ptr, EventStateInfo::kSgprSize); - memcpy(other_ptr, val, EventStateInfo::kSgprSize); + auto val = EnablePartialHelperLanes(); + SetEnablePartialHelperLanes(other.EnablePartialHelperLanes()); + other.SetEnablePartialHelperLanes(val); } } diff --git a/dive_core/event_state.h b/dive_core/event_state.h index fdb6fc8a8..eada55870 100644 --- a/dive_core/event_state.h +++ b/dive_core/event_state.h @@ -24,6 +24,7 @@ #pragma once +#include "adreno.h" #include "common.h" #include "dive_core/common/gpudefs.h" #include "info_id.h" @@ -288,397 +289,21 @@ template class EventStateInfoScissorConstArray Id m_id; }; -template class EventStateInfoAttachmentArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using AttachmentArray = typename CONFIG::AttachmentArray; - using AttachmentConstArray = typename CONFIG::AttachmentConstArray; - EventStateInfoAttachmentArray() = default; - EventStateInfoAttachmentArray(const EventStateInfoAttachmentArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoAttachmentArray(SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD Attachment: Per target attachment color blend states - - // `Get(uint32_t attachment)` returns the value of the Attachment field of the referenced object - inline VkPipelineColorBlendAttachmentState Get(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Attachment(m_id, attachment); - } - - // `Set(value)` sets the Attachment field of the referenced object - inline const AttachmentArray& Set(uint32_t attachment, - VkPipelineColorBlendAttachmentState value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetAttachment(m_id, attachment, value); - return static_cast(*this); - } - - inline bool IsAttachmentSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsAttachmentSet(m_id, attachment); - } - - inline const char* GetAttachmentName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetAttachmentName(); - } - - inline const char* GetAttachmentDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetAttachmentDescription(); - } - -protected: - SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoAttachmentConstArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using AttachmentArray = typename CONFIG::AttachmentArray; - using AttachmentConstArray = typename CONFIG::AttachmentConstArray; - EventStateInfoAttachmentConstArray() = default; - EventStateInfoAttachmentConstArray(const EventStateInfoAttachmentArray& other) : - m_obj_ptr(&other.obj()), - m_id(other.id()) - { - } - EventStateInfoAttachmentConstArray(const EventStateInfoAttachmentConstArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoAttachmentConstArray(const SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - const SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD Attachment: Per target attachment color blend states - - // `Get(uint32_t attachment)` returns the value of the Attachment field of the referenced object - inline VkPipelineColorBlendAttachmentState Get(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Attachment(m_id, attachment); - } - - inline bool IsAttachmentSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsAttachmentSet(m_id, attachment); - } - - inline const char* GetAttachmentName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetAttachmentName(); - } - - inline const char* GetAttachmentDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetAttachmentDescription(); - } - -protected: - const SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoBlendConstantArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using BlendConstantArray = typename CONFIG::BlendConstantArray; - using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; - EventStateInfoBlendConstantArray() = default; - EventStateInfoBlendConstantArray(const EventStateInfoBlendConstantArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoBlendConstantArray(SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD BlendConstant: A color constant used for blending - - // `Get(uint32_t channel)` returns the value of the BlendConstant field of the referenced object - inline float Get(uint32_t channel) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->BlendConstant(m_id, channel); - } - - // `Set(value)` sets the BlendConstant field of the referenced object - inline const BlendConstantArray& Set(uint32_t channel, float value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetBlendConstant(m_id, channel, value); - return static_cast(*this); - } - - inline bool IsBlendConstantSet(uint32_t channel) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsBlendConstantSet(m_id, channel); - } - - inline const char* GetBlendConstantName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetBlendConstantName(); - } - - inline const char* GetBlendConstantDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetBlendConstantDescription(); - } - -protected: - SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoBlendConstantConstArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using BlendConstantArray = typename CONFIG::BlendConstantArray; - using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; - EventStateInfoBlendConstantConstArray() = default; - EventStateInfoBlendConstantConstArray(const EventStateInfoBlendConstantArray& other) : - m_obj_ptr(&other.obj()), - m_id(other.id()) - { - } - EventStateInfoBlendConstantConstArray(const EventStateInfoBlendConstantConstArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoBlendConstantConstArray(const SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - const SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD BlendConstant: A color constant used for blending - - // `Get(uint32_t channel)` returns the value of the BlendConstant field of the referenced object - inline float Get(uint32_t channel) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->BlendConstant(m_id, channel); - } - - inline bool IsBlendConstantSet(uint32_t channel) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsBlendConstantSet(m_id, channel); - } - - inline const char* GetBlendConstantName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetBlendConstantName(); - } - - inline const char* GetBlendConstantDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetBlendConstantDescription(); - } - -protected: - const SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoDccEnabledArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using DccEnabledArray = typename CONFIG::DccEnabledArray; - using DccEnabledConstArray = typename CONFIG::DccEnabledConstArray; - EventStateInfoDccEnabledArray() = default; - EventStateInfoDccEnabledArray(const EventStateInfoDccEnabledArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoDccEnabledArray(SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD DccEnabled: Whether DCC-based bandwidth-saving color compression is enabled - - // `Get(uint32_t attachment)` returns the value of the DccEnabled field of the referenced object - inline bool Get(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->DccEnabled(m_id, attachment); - } - - // `Set(value)` sets the DccEnabled field of the referenced object - inline const DccEnabledArray& Set(uint32_t attachment, bool value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetDccEnabled(m_id, attachment, value); - return static_cast(*this); - } - - inline bool IsDccEnabledSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsDccEnabledSet(m_id, attachment); - } - - inline const char* GetDccEnabledName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledName(); - } - - inline const char* GetDccEnabledDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledDescription(); - } - -protected: - SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoDccEnabledConstArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using DccEnabledArray = typename CONFIG::DccEnabledArray; - using DccEnabledConstArray = typename CONFIG::DccEnabledConstArray; - EventStateInfoDccEnabledConstArray() = default; - EventStateInfoDccEnabledConstArray(const EventStateInfoDccEnabledArray& other) : - m_obj_ptr(&other.obj()), - m_id(other.id()) - { - } - EventStateInfoDccEnabledConstArray(const EventStateInfoDccEnabledConstArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoDccEnabledConstArray(const SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - const SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD DccEnabled: Whether DCC-based bandwidth-saving color compression is enabled - - // `Get(uint32_t attachment)` returns the value of the DccEnabled field of the referenced object - inline bool Get(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->DccEnabled(m_id, attachment); - } - - inline bool IsDccEnabledSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsDccEnabledSet(m_id, attachment); - } - - inline const char* GetDccEnabledName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledName(); - } - - inline const char* GetDccEnabledDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledDescription(); - } - -protected: - const SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoColorFormatArray +template class EventStateInfoLogicOpEnabledArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using ColorFormatArray = typename CONFIG::ColorFormatArray; - using ColorFormatConstArray = typename CONFIG::ColorFormatConstArray; - EventStateInfoColorFormatArray() = default; - EventStateInfoColorFormatArray(const EventStateInfoColorFormatArray& other) : + using LogicOpEnabledArray = typename CONFIG::LogicOpEnabledArray; + using LogicOpEnabledConstArray = typename CONFIG::LogicOpEnabledConstArray; + EventStateInfoLogicOpEnabledArray() = default; + EventStateInfoLogicOpEnabledArray(const EventStateInfoLogicOpEnabledArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoColorFormatArray(SOA* obj_ptr, Id id) : + EventStateInfoLogicOpEnabledArray(SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -688,40 +313,40 @@ template class EventStateInfoColorFormatArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD ColorFormat: Per target attachment hardware color format + // REF FIELD LogicOpEnabled: Whether to apply Logical Operations - // `Get(uint32_t attachment)` returns the value of the ColorFormat field of the referenced + // `Get(uint32_t attachment)` returns the value of the LogicOpEnabled field of the referenced // object - inline Dive::Legacy::ColorFormat Get(uint32_t attachment) const + inline bool Get(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ColorFormat(m_id, attachment); + return m_obj_ptr->LogicOpEnabled(m_id, attachment); } - // `Set(value)` sets the ColorFormat field of the referenced object - inline const ColorFormatArray& Set(uint32_t attachment, Dive::Legacy::ColorFormat value) const + // `Set(value)` sets the LogicOpEnabled field of the referenced object + inline const LogicOpEnabledArray& Set(uint32_t attachment, bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetColorFormat(m_id, attachment, value); + m_obj_ptr->SetLogicOpEnabled(m_id, attachment, value); return static_cast(*this); } - inline bool IsColorFormatSet(uint32_t attachment) const + inline bool IsLogicOpEnabledSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsColorFormatSet(m_id, attachment); + return m_obj_ptr->IsLogicOpEnabledSet(m_id, attachment); } - inline const char* GetColorFormatName() const + inline const char* GetLogicOpEnabledName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatName(); + return m_obj_ptr->GetLogicOpEnabledName(); } - inline const char* GetColorFormatDescription() const + inline const char* GetLogicOpEnabledDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatDescription(); + return m_obj_ptr->GetLogicOpEnabledDescription(); } protected: @@ -729,26 +354,26 @@ template class EventStateInfoColorFormatArray Id m_id; }; -template class EventStateInfoColorFormatConstArray +template class EventStateInfoLogicOpEnabledConstArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using ColorFormatArray = typename CONFIG::ColorFormatArray; - using ColorFormatConstArray = typename CONFIG::ColorFormatConstArray; - EventStateInfoColorFormatConstArray() = default; - EventStateInfoColorFormatConstArray(const EventStateInfoColorFormatArray& other) : + using LogicOpEnabledArray = typename CONFIG::LogicOpEnabledArray; + using LogicOpEnabledConstArray = typename CONFIG::LogicOpEnabledConstArray; + EventStateInfoLogicOpEnabledConstArray() = default; + EventStateInfoLogicOpEnabledConstArray(const EventStateInfoLogicOpEnabledArray& other) : m_obj_ptr(&other.obj()), m_id(other.id()) { } - EventStateInfoColorFormatConstArray(const EventStateInfoColorFormatConstArray& other) : + EventStateInfoLogicOpEnabledConstArray(const EventStateInfoLogicOpEnabledConstArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoColorFormatConstArray(const SOA* obj_ptr, Id id) : + EventStateInfoLogicOpEnabledConstArray(const SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -758,251 +383,32 @@ template class EventStateInfoColorFormatConstArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD ColorFormat: Per target attachment hardware color format + // REF FIELD LogicOpEnabled: Whether to apply Logical Operations - // `Get(uint32_t attachment)` returns the value of the ColorFormat field of the referenced + // `Get(uint32_t attachment)` returns the value of the LogicOpEnabled field of the referenced // object - inline Dive::Legacy::ColorFormat Get(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ColorFormat(m_id, attachment); - } - - inline bool IsColorFormatSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsColorFormatSet(m_id, attachment); - } - - inline const char* GetColorFormatName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatName(); - } - - inline const char* GetColorFormatDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatDescription(); - } - -protected: - const SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoMip0HeightArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using Mip0HeightArray = typename CONFIG::Mip0HeightArray; - using Mip0HeightConstArray = typename CONFIG::Mip0HeightConstArray; - EventStateInfoMip0HeightArray() = default; - EventStateInfoMip0HeightArray(const EventStateInfoMip0HeightArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoMip0HeightArray(SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD Mip0Height: Per target attachment mip0 height - - // `Get(uint32_t attachment)` returns the value of the Mip0Height field of the referenced object - inline uint32_t Get(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Height(m_id, attachment); - } - - // `Set(value)` sets the Mip0Height field of the referenced object - inline const Mip0HeightArray& Set(uint32_t attachment, uint32_t value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetMip0Height(m_id, attachment, value); - return static_cast(*this); - } - - inline bool IsMip0HeightSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0HeightSet(m_id, attachment); - } - - inline const char* GetMip0HeightName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightName(); - } - - inline const char* GetMip0HeightDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightDescription(); - } - - inline uint32_t Min() const - { - uint32_t res = std::numeric_limits::max(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = std::min(res, value); - } - - return res; - } - inline uint32_t Max() const - { - uint32_t res = std::numeric_limits::min(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = std::max(res, value); - } - - return res; - } - inline uint32_t Sum() const - { - uint32_t res = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = res + value; - } - - return res; - } - inline uint32_t Avg() const - { - uint32_t res = 0; - uint32_t count = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = res + value; - ++count; - } - - return res / count; - } - -protected: - SOA* m_obj_ptr = nullptr; - Id m_id; -}; - -template class EventStateInfoMip0HeightConstArray -{ -public: - using Id = typename CONFIG::Id; - using SOA = typename CONFIG::SOA; - using Ref = typename CONFIG::Ref; - using Mip0HeightArray = typename CONFIG::Mip0HeightArray; - using Mip0HeightConstArray = typename CONFIG::Mip0HeightConstArray; - EventStateInfoMip0HeightConstArray() = default; - EventStateInfoMip0HeightConstArray(const EventStateInfoMip0HeightArray& other) : - m_obj_ptr(&other.obj()), - m_id(other.id()) - { - } - EventStateInfoMip0HeightConstArray(const EventStateInfoMip0HeightConstArray& other) : - m_obj_ptr(other.m_obj_ptr), - m_id(other.m_id) - { - } - EventStateInfoMip0HeightConstArray(const SOA* obj_ptr, Id id) : - m_obj_ptr(obj_ptr), - m_id(id) - { - } - Id id() const { return m_id; } - const SOA& obj() const { return *m_obj_ptr; } - bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } - - //----------------------------------------------- - // REF FIELD Mip0Height: Per target attachment mip0 height - - // `Get(uint32_t attachment)` returns the value of the Mip0Height field of the referenced object - inline uint32_t Get(uint32_t attachment) const + inline bool Get(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Height(m_id, attachment); + return m_obj_ptr->LogicOpEnabled(m_id, attachment); } - inline bool IsMip0HeightSet(uint32_t attachment) const + inline bool IsLogicOpEnabledSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0HeightSet(m_id, attachment); + return m_obj_ptr->IsLogicOpEnabledSet(m_id, attachment); } - inline const char* GetMip0HeightName() const + inline const char* GetLogicOpEnabledName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightName(); + return m_obj_ptr->GetLogicOpEnabledName(); } - inline const char* GetMip0HeightDescription() const + inline const char* GetLogicOpEnabledDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightDescription(); - } - - inline uint32_t Min() const - { - uint32_t res = std::numeric_limits::max(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = std::min(res, value); - } - - return res; - } - inline uint32_t Max() const - { - uint32_t res = std::numeric_limits::min(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = std::max(res, value); - } - - return res; - } - inline uint32_t Sum() const - { - uint32_t res = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = res + value; - } - - return res; - } - inline uint32_t Avg() const - { - uint32_t res = 0; - uint32_t count = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Height(m_id, attachment); - res = res + value; - ++count; - } - - return res / count; + return m_obj_ptr->GetLogicOpEnabledDescription(); } protected: @@ -1010,21 +416,21 @@ template class EventStateInfoMip0HeightConstArray Id m_id; }; -template class EventStateInfoMip0WidthArray +template class EventStateInfoLogicOpArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using Mip0WidthArray = typename CONFIG::Mip0WidthArray; - using Mip0WidthConstArray = typename CONFIG::Mip0WidthConstArray; - EventStateInfoMip0WidthArray() = default; - EventStateInfoMip0WidthArray(const EventStateInfoMip0WidthArray& other) : + using LogicOpArray = typename CONFIG::LogicOpArray; + using LogicOpConstArray = typename CONFIG::LogicOpConstArray; + EventStateInfoLogicOpArray() = default; + EventStateInfoLogicOpArray(const EventStateInfoLogicOpArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoMip0WidthArray(SOA* obj_ptr, Id id) : + EventStateInfoLogicOpArray(SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -1034,86 +440,39 @@ template class EventStateInfoMip0WidthArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD Mip0Width: Per target attachment mip0 width + // REF FIELD LogicOp: Which logical operation to apply - // `Get(uint32_t attachment)` returns the value of the Mip0Width field of the referenced object - inline uint32_t Get(uint32_t attachment) const + // `Get(uint32_t attachment)` returns the value of the LogicOp field of the referenced object + inline VkLogicOp Get(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Width(m_id, attachment); + return m_obj_ptr->LogicOp(m_id, attachment); } - // `Set(value)` sets the Mip0Width field of the referenced object - inline const Mip0WidthArray& Set(uint32_t attachment, uint32_t value) const + // `Set(value)` sets the LogicOp field of the referenced object + inline const LogicOpArray& Set(uint32_t attachment, VkLogicOp value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetMip0Width(m_id, attachment, value); + m_obj_ptr->SetLogicOp(m_id, attachment, value); return static_cast(*this); } - inline bool IsMip0WidthSet(uint32_t attachment) const + inline bool IsLogicOpSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0WidthSet(m_id, attachment); + return m_obj_ptr->IsLogicOpSet(m_id, attachment); } - inline const char* GetMip0WidthName() const + inline const char* GetLogicOpName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthName(); + return m_obj_ptr->GetLogicOpName(); } - inline const char* GetMip0WidthDescription() const + inline const char* GetLogicOpDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthDescription(); - } - - inline uint32_t Min() const - { - uint32_t res = std::numeric_limits::max(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = std::min(res, value); - } - - return res; - } - inline uint32_t Max() const - { - uint32_t res = std::numeric_limits::min(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = std::max(res, value); - } - - return res; - } - inline uint32_t Sum() const - { - uint32_t res = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = res + value; - } - - return res; - } - inline uint32_t Avg() const - { - uint32_t res = 0; - uint32_t count = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = res + value; - ++count; - } - - return res / count; + return m_obj_ptr->GetLogicOpDescription(); } protected: @@ -1121,26 +480,26 @@ template class EventStateInfoMip0WidthArray Id m_id; }; -template class EventStateInfoMip0WidthConstArray +template class EventStateInfoLogicOpConstArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using Mip0WidthArray = typename CONFIG::Mip0WidthArray; - using Mip0WidthConstArray = typename CONFIG::Mip0WidthConstArray; - EventStateInfoMip0WidthConstArray() = default; - EventStateInfoMip0WidthConstArray(const EventStateInfoMip0WidthArray& other) : + using LogicOpArray = typename CONFIG::LogicOpArray; + using LogicOpConstArray = typename CONFIG::LogicOpConstArray; + EventStateInfoLogicOpConstArray() = default; + EventStateInfoLogicOpConstArray(const EventStateInfoLogicOpArray& other) : m_obj_ptr(&other.obj()), m_id(other.id()) { } - EventStateInfoMip0WidthConstArray(const EventStateInfoMip0WidthConstArray& other) : + EventStateInfoLogicOpConstArray(const EventStateInfoLogicOpConstArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoMip0WidthConstArray(const SOA* obj_ptr, Id id) : + EventStateInfoLogicOpConstArray(const SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -1150,78 +509,31 @@ template class EventStateInfoMip0WidthConstArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD Mip0Width: Per target attachment mip0 width + // REF FIELD LogicOp: Which logical operation to apply - // `Get(uint32_t attachment)` returns the value of the Mip0Width field of the referenced object - inline uint32_t Get(uint32_t attachment) const + // `Get(uint32_t attachment)` returns the value of the LogicOp field of the referenced object + inline VkLogicOp Get(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Width(m_id, attachment); + return m_obj_ptr->LogicOp(m_id, attachment); } - inline bool IsMip0WidthSet(uint32_t attachment) const + inline bool IsLogicOpSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0WidthSet(m_id, attachment); + return m_obj_ptr->IsLogicOpSet(m_id, attachment); } - inline const char* GetMip0WidthName() const + inline const char* GetLogicOpName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthName(); + return m_obj_ptr->GetLogicOpName(); } - inline const char* GetMip0WidthDescription() const + inline const char* GetLogicOpDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthDescription(); - } - - inline uint32_t Min() const - { - uint32_t res = std::numeric_limits::max(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = std::min(res, value); - } - - return res; - } - inline uint32_t Max() const - { - uint32_t res = std::numeric_limits::min(); - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = std::max(res, value); - } - - return res; - } - inline uint32_t Sum() const - { - uint32_t res = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = res + value; - } - - return res; - } - inline uint32_t Avg() const - { - uint32_t res = 0; - uint32_t count = 0; - for (uint32_t attachment = 0; attachment < 8; ++attachment) - { - auto value = m_obj_ptr->Mip0Width(m_id, attachment); - res = res + value; - ++count; - } - - return res / count; + return m_obj_ptr->GetLogicOpDescription(); } protected: @@ -1229,21 +541,21 @@ template class EventStateInfoMip0WidthConstArray Id m_id; }; -template class EventStateInfoVgprArray +template class EventStateInfoAttachmentArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using VgprArray = typename CONFIG::VgprArray; - using VgprConstArray = typename CONFIG::VgprConstArray; - EventStateInfoVgprArray() = default; - EventStateInfoVgprArray(const EventStateInfoVgprArray& other) : + using AttachmentArray = typename CONFIG::AttachmentArray; + using AttachmentConstArray = typename CONFIG::AttachmentConstArray; + EventStateInfoAttachmentArray() = default; + EventStateInfoAttachmentArray(const EventStateInfoAttachmentArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoVgprArray(SOA* obj_ptr, Id id) : + EventStateInfoAttachmentArray(SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -1253,40 +565,40 @@ template class EventStateInfoVgprArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD Vgpr: Per shader stage vector general purpose register count. Always rounded up to - // nearest multiple of 4. + // REF FIELD Attachment: Per target attachment color blend states - // `Get(Dive::ShaderStage stage)` returns the value of the Vgpr field of the referenced object - inline uint16_t Get(Dive::ShaderStage stage) const + // `Get(uint32_t attachment)` returns the value of the Attachment field of the referenced object + inline VkPipelineColorBlendAttachmentState Get(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Vgpr(m_id, stage); + return m_obj_ptr->Attachment(m_id, attachment); } - // `Set(value)` sets the Vgpr field of the referenced object - inline const VgprArray& Set(Dive::ShaderStage stage, uint16_t value) const + // `Set(value)` sets the Attachment field of the referenced object + inline const AttachmentArray& Set(uint32_t attachment, + VkPipelineColorBlendAttachmentState value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetVgpr(m_id, stage, value); + m_obj_ptr->SetAttachment(m_id, attachment, value); return static_cast(*this); } - inline bool IsVgprSet(Dive::ShaderStage stage) const + inline bool IsAttachmentSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsVgprSet(m_id, stage); + return m_obj_ptr->IsAttachmentSet(m_id, attachment); } - inline const char* GetVgprName() const + inline const char* GetAttachmentName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprName(); + return m_obj_ptr->GetAttachmentName(); } - inline const char* GetVgprDescription() const + inline const char* GetAttachmentDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprDescription(); + return m_obj_ptr->GetAttachmentDescription(); } protected: @@ -1294,26 +606,26 @@ template class EventStateInfoVgprArray Id m_id; }; -template class EventStateInfoVgprConstArray +template class EventStateInfoAttachmentConstArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using VgprArray = typename CONFIG::VgprArray; - using VgprConstArray = typename CONFIG::VgprConstArray; - EventStateInfoVgprConstArray() = default; - EventStateInfoVgprConstArray(const EventStateInfoVgprArray& other) : + using AttachmentArray = typename CONFIG::AttachmentArray; + using AttachmentConstArray = typename CONFIG::AttachmentConstArray; + EventStateInfoAttachmentConstArray() = default; + EventStateInfoAttachmentConstArray(const EventStateInfoAttachmentArray& other) : m_obj_ptr(&other.obj()), m_id(other.id()) { } - EventStateInfoVgprConstArray(const EventStateInfoVgprConstArray& other) : + EventStateInfoAttachmentConstArray(const EventStateInfoAttachmentConstArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoVgprConstArray(const SOA* obj_ptr, Id id) : + EventStateInfoAttachmentConstArray(const SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -1323,32 +635,31 @@ template class EventStateInfoVgprConstArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD Vgpr: Per shader stage vector general purpose register count. Always rounded up to - // nearest multiple of 4. + // REF FIELD Attachment: Per target attachment color blend states - // `Get(Dive::ShaderStage stage)` returns the value of the Vgpr field of the referenced object - inline uint16_t Get(Dive::ShaderStage stage) const + // `Get(uint32_t attachment)` returns the value of the Attachment field of the referenced object + inline VkPipelineColorBlendAttachmentState Get(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Vgpr(m_id, stage); + return m_obj_ptr->Attachment(m_id, attachment); } - inline bool IsVgprSet(Dive::ShaderStage stage) const + inline bool IsAttachmentSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsVgprSet(m_id, stage); + return m_obj_ptr->IsAttachmentSet(m_id, attachment); } - inline const char* GetVgprName() const + inline const char* GetAttachmentName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprName(); + return m_obj_ptr->GetAttachmentName(); } - inline const char* GetVgprDescription() const + inline const char* GetAttachmentDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprDescription(); + return m_obj_ptr->GetAttachmentDescription(); } protected: @@ -1356,21 +667,21 @@ template class EventStateInfoVgprConstArray Id m_id; }; -template class EventStateInfoSgprArray +template class EventStateInfoBlendConstantArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using SgprArray = typename CONFIG::SgprArray; - using SgprConstArray = typename CONFIG::SgprConstArray; - EventStateInfoSgprArray() = default; - EventStateInfoSgprArray(const EventStateInfoSgprArray& other) : + using BlendConstantArray = typename CONFIG::BlendConstantArray; + using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; + EventStateInfoBlendConstantArray() = default; + EventStateInfoBlendConstantArray(const EventStateInfoBlendConstantArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoSgprArray(SOA* obj_ptr, Id id) : + EventStateInfoBlendConstantArray(SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -1380,40 +691,39 @@ template class EventStateInfoSgprArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD Sgpr: Per shader stage scalar general purpose register count. Always rounded up to - // nearest multiple of 16 + // REF FIELD BlendConstant: A color constant used for blending - // `Get(Dive::ShaderStage stage)` returns the value of the Sgpr field of the referenced object - inline uint16_t Get(Dive::ShaderStage stage) const + // `Get(uint32_t channel)` returns the value of the BlendConstant field of the referenced object + inline float Get(uint32_t channel) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Sgpr(m_id, stage); + return m_obj_ptr->BlendConstant(m_id, channel); } - // `Set(value)` sets the Sgpr field of the referenced object - inline const SgprArray& Set(Dive::ShaderStage stage, uint16_t value) const + // `Set(value)` sets the BlendConstant field of the referenced object + inline const BlendConstantArray& Set(uint32_t channel, float value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetSgpr(m_id, stage, value); + m_obj_ptr->SetBlendConstant(m_id, channel, value); return static_cast(*this); } - inline bool IsSgprSet(Dive::ShaderStage stage) const + inline bool IsBlendConstantSet(uint32_t channel) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsSgprSet(m_id, stage); + return m_obj_ptr->IsBlendConstantSet(m_id, channel); } - inline const char* GetSgprName() const + inline const char* GetBlendConstantName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprName(); + return m_obj_ptr->GetBlendConstantName(); } - inline const char* GetSgprDescription() const + inline const char* GetBlendConstantDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprDescription(); + return m_obj_ptr->GetBlendConstantDescription(); } protected: @@ -1421,26 +731,26 @@ template class EventStateInfoSgprArray Id m_id; }; -template class EventStateInfoSgprConstArray +template class EventStateInfoBlendConstantConstArray { public: using Id = typename CONFIG::Id; using SOA = typename CONFIG::SOA; using Ref = typename CONFIG::Ref; - using SgprArray = typename CONFIG::SgprArray; - using SgprConstArray = typename CONFIG::SgprConstArray; - EventStateInfoSgprConstArray() = default; - EventStateInfoSgprConstArray(const EventStateInfoSgprArray& other) : + using BlendConstantArray = typename CONFIG::BlendConstantArray; + using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; + EventStateInfoBlendConstantConstArray() = default; + EventStateInfoBlendConstantConstArray(const EventStateInfoBlendConstantArray& other) : m_obj_ptr(&other.obj()), m_id(other.id()) { } - EventStateInfoSgprConstArray(const EventStateInfoSgprConstArray& other) : + EventStateInfoBlendConstantConstArray(const EventStateInfoBlendConstantConstArray& other) : m_obj_ptr(other.m_obj_ptr), m_id(other.m_id) { } - EventStateInfoSgprConstArray(const SOA* obj_ptr, Id id) : + EventStateInfoBlendConstantConstArray(const SOA* obj_ptr, Id id) : m_obj_ptr(obj_ptr), m_id(id) { @@ -1450,32 +760,31 @@ template class EventStateInfoSgprConstArray bool IsValid() const { return m_obj_ptr != nullptr && m_obj_ptr->IsValidId(m_id); } //----------------------------------------------- - // REF FIELD Sgpr: Per shader stage scalar general purpose register count. Always rounded up to - // nearest multiple of 16 + // REF FIELD BlendConstant: A color constant used for blending - // `Get(Dive::ShaderStage stage)` returns the value of the Sgpr field of the referenced object - inline uint16_t Get(Dive::ShaderStage stage) const + // `Get(uint32_t channel)` returns the value of the BlendConstant field of the referenced object + inline float Get(uint32_t channel) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Sgpr(m_id, stage); + return m_obj_ptr->BlendConstant(m_id, channel); } - inline bool IsSgprSet(Dive::ShaderStage stage) const + inline bool IsBlendConstantSet(uint32_t channel) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsSgprSet(m_id, stage); + return m_obj_ptr->IsBlendConstantSet(m_id, channel); } - inline const char* GetSgprName() const + inline const char* GetBlendConstantName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprName(); + return m_obj_ptr->GetBlendConstantName(); } - inline const char* GetSgprDescription() const + inline const char* GetBlendConstantDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprDescription(); + return m_obj_ptr->GetBlendConstantDescription(); } protected: @@ -1497,22 +806,14 @@ template class EventStateInfoRefT using ViewportConstArray = typename CONFIG::ViewportConstArray; using ScissorArray = typename CONFIG::ScissorArray; using ScissorConstArray = typename CONFIG::ScissorConstArray; + using LogicOpEnabledArray = typename CONFIG::LogicOpEnabledArray; + using LogicOpEnabledConstArray = typename CONFIG::LogicOpEnabledConstArray; + using LogicOpArray = typename CONFIG::LogicOpArray; + using LogicOpConstArray = typename CONFIG::LogicOpConstArray; using AttachmentArray = typename CONFIG::AttachmentArray; using AttachmentConstArray = typename CONFIG::AttachmentConstArray; using BlendConstantArray = typename CONFIG::BlendConstantArray; using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; - using DccEnabledArray = typename CONFIG::DccEnabledArray; - using DccEnabledConstArray = typename CONFIG::DccEnabledConstArray; - using ColorFormatArray = typename CONFIG::ColorFormatArray; - using ColorFormatConstArray = typename CONFIG::ColorFormatConstArray; - using Mip0HeightArray = typename CONFIG::Mip0HeightArray; - using Mip0HeightConstArray = typename CONFIG::Mip0HeightConstArray; - using Mip0WidthArray = typename CONFIG::Mip0WidthArray; - using Mip0WidthConstArray = typename CONFIG::Mip0WidthConstArray; - using VgprArray = typename CONFIG::VgprArray; - using VgprConstArray = typename CONFIG::VgprConstArray; - using SgprArray = typename CONFIG::SgprArray; - using SgprConstArray = typename CONFIG::SgprConstArray; EventStateInfoRefT() = default; EventStateInfoRefT(const EventStateInfoRefT& other) : m_obj_ptr(other.m_obj_ptr), @@ -2611,25 +1912,33 @@ template class EventStateInfoRefT //----------------------------------------------- // REF FIELD LogicOpEnabled: Whether to apply Logical Operations - // `LogicOpEnabled()` returns the value of the LogicOpEnabled field of the referenced object - inline bool LogicOpEnabled() const + // `LogicOpEnabled(uint32_t attachment)` returns the value of the LogicOpEnabled field of the + // referenced object + inline bool LogicOpEnabled(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->LogicOpEnabled(m_id); + return m_obj_ptr->LogicOpEnabled(m_id, attachment); + } + + // `LogicOpEnabled()` returns the array of values of the LogicOpEnabled field of the referenced + // object + inline LogicOpEnabledArray LogicOpEnabled() const + { + return LogicOpEnabledArray(m_obj_ptr, m_id); } // `SetLogicOpEnabled(value)` sets the LogicOpEnabled field of the referenced object - inline const Ref& SetLogicOpEnabled(bool value) const + inline const Ref& SetLogicOpEnabled(uint32_t attachment, bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetLogicOpEnabled(m_id, value); + m_obj_ptr->SetLogicOpEnabled(m_id, attachment, value); return static_cast(*this); } - inline bool IsLogicOpEnabledSet() const + inline bool IsLogicOpEnabledSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsLogicOpEnabledSet(m_id); + return m_obj_ptr->IsLogicOpEnabledSet(m_id, attachment); } inline const char* GetLogicOpEnabledName() const @@ -2647,25 +1956,29 @@ template class EventStateInfoRefT //----------------------------------------------- // REF FIELD LogicOp: Which logical operation to apply - // `LogicOp()` returns the value of the LogicOp field of the referenced object - inline VkLogicOp LogicOp() const + // `LogicOp(uint32_t attachment)` returns the value of the LogicOp field of the referenced + // object + inline VkLogicOp LogicOp(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->LogicOp(m_id); + return m_obj_ptr->LogicOp(m_id, attachment); } + // `LogicOp()` returns the array of values of the LogicOp field of the referenced object + inline LogicOpArray LogicOp() const { return LogicOpArray(m_obj_ptr, m_id); } + // `SetLogicOp(value)` sets the LogicOp field of the referenced object - inline const Ref& SetLogicOp(VkLogicOp value) const + inline const Ref& SetLogicOp(uint32_t attachment, VkLogicOp value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetLogicOp(m_id, value); + m_obj_ptr->SetLogicOp(m_id, attachment, value); return static_cast(*this); } - inline bool IsLogicOpSet() const + inline bool IsLogicOpSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsLogicOpSet(m_id); + return m_obj_ptr->IsLogicOpSet(m_id, attachment); } inline const char* GetLogicOpName() const @@ -2763,611 +2076,440 @@ template class EventStateInfoRefT } //----------------------------------------------- - // REF FIELD ZAddr: The read and write VA of depth buffer (assumed to be same) - - // `ZAddr()` returns the value of the ZAddr field of the referenced object - inline uint64_t ZAddr() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZAddr(m_id); - } - - // `SetZAddr(value)` sets the ZAddr field of the referenced object - inline const Ref& SetZAddr(uint64_t value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetZAddr(m_id, value); - return static_cast(*this); - } - - inline bool IsZAddrSet() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZAddrSet(m_id); - } - - inline const char* GetZAddrName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZAddrName(); - } - - inline const char* GetZAddrDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZAddrDescription(); - } - - //----------------------------------------------- - // REF FIELD HTileAddr: VA of DB's HTile buffer + // REF FIELD LRZEnabled: Whether LRZ is enabled for depth - // `HTileAddr()` returns the value of the HTileAddr field of the referenced object - inline uint64_t HTileAddr() const + // `LRZEnabled()` returns the value of the LRZEnabled field of the referenced object + inline bool LRZEnabled() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->HTileAddr(m_id); + return m_obj_ptr->LRZEnabled(m_id); } - // `SetHTileAddr(value)` sets the HTileAddr field of the referenced object - inline const Ref& SetHTileAddr(uint64_t value) const + // `SetLRZEnabled(value)` sets the LRZEnabled field of the referenced object + inline const Ref& SetLRZEnabled(bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetHTileAddr(m_id, value); + m_obj_ptr->SetLRZEnabled(m_id, value); return static_cast(*this); } - inline bool IsHTileAddrSet() const + inline bool IsLRZEnabledSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsHTileAddrSet(m_id); + return m_obj_ptr->IsLRZEnabledSet(m_id); } - inline const char* GetHTileAddrName() const + inline const char* GetLRZEnabledName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHTileAddrName(); + return m_obj_ptr->GetLRZEnabledName(); } - inline const char* GetHTileAddrDescription() const + inline const char* GetLRZEnabledDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHTileAddrDescription(); + return m_obj_ptr->GetLRZEnabledDescription(); } //----------------------------------------------- - // REF FIELD HiZEnabled: Whether Hi-Z is enabled for depth + // REF FIELD LRZWrite: Whether LRZ write is enabled - // `HiZEnabled()` returns the value of the HiZEnabled field of the referenced object - inline bool HiZEnabled() const + // `LRZWrite()` returns the value of the LRZWrite field of the referenced object + inline bool LRZWrite() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->HiZEnabled(m_id); + return m_obj_ptr->LRZWrite(m_id); } - // `SetHiZEnabled(value)` sets the HiZEnabled field of the referenced object - inline const Ref& SetHiZEnabled(bool value) const + // `SetLRZWrite(value)` sets the LRZWrite field of the referenced object + inline const Ref& SetLRZWrite(bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetHiZEnabled(m_id, value); + m_obj_ptr->SetLRZWrite(m_id, value); return static_cast(*this); } - inline bool IsHiZEnabledSet() const + inline bool IsLRZWriteSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsHiZEnabledSet(m_id); + return m_obj_ptr->IsLRZWriteSet(m_id); } - inline const char* GetHiZEnabledName() const + inline const char* GetLRZWriteName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiZEnabledName(); + return m_obj_ptr->GetLRZWriteName(); } - inline const char* GetHiZEnabledDescription() const + inline const char* GetLRZWriteDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiZEnabledDescription(); + return m_obj_ptr->GetLRZWriteDescription(); } //----------------------------------------------- - // REF FIELD HiSEnabled: Whether Hi-S is enabled for stencil + // REF FIELD LRZDirStatus: LRZ direction - // `HiSEnabled()` returns the value of the HiSEnabled field of the referenced object - inline bool HiSEnabled() const + // `LRZDirStatus()` returns the value of the LRZDirStatus field of the referenced object + inline a6xx_lrz_dir_status LRZDirStatus() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->HiSEnabled(m_id); + return m_obj_ptr->LRZDirStatus(m_id); } - // `SetHiSEnabled(value)` sets the HiSEnabled field of the referenced object - inline const Ref& SetHiSEnabled(bool value) const + // `SetLRZDirStatus(value)` sets the LRZDirStatus field of the referenced object + inline const Ref& SetLRZDirStatus(a6xx_lrz_dir_status value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetHiSEnabled(m_id, value); + m_obj_ptr->SetLRZDirStatus(m_id, value); return static_cast(*this); } - inline bool IsHiSEnabledSet() const + inline bool IsLRZDirStatusSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsHiSEnabledSet(m_id); + return m_obj_ptr->IsLRZDirStatusSet(m_id); } - inline const char* GetHiSEnabledName() const + inline const char* GetLRZDirStatusName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiSEnabledName(); + return m_obj_ptr->GetLRZDirStatusName(); } - inline const char* GetHiSEnabledDescription() const + inline const char* GetLRZDirStatusDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiSEnabledDescription(); + return m_obj_ptr->GetLRZDirStatusDescription(); } //----------------------------------------------- - // REF FIELD ZCompressEnabled: Whether plane compression is enabled for depth buffers. To reduce - // bandwidth impact + // REF FIELD LRZDirWrite: Whether LRZ direction write is enabled - // `ZCompressEnabled()` returns the value of the ZCompressEnabled field of the referenced object - inline bool ZCompressEnabled() const + // `LRZDirWrite()` returns the value of the LRZDirWrite field of the referenced object + inline bool LRZDirWrite() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZCompressEnabled(m_id); + return m_obj_ptr->LRZDirWrite(m_id); } - // `SetZCompressEnabled(value)` sets the ZCompressEnabled field of the referenced object - inline const Ref& SetZCompressEnabled(bool value) const + // `SetLRZDirWrite(value)` sets the LRZDirWrite field of the referenced object + inline const Ref& SetLRZDirWrite(bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetZCompressEnabled(m_id, value); + m_obj_ptr->SetLRZDirWrite(m_id, value); return static_cast(*this); } - inline bool IsZCompressEnabledSet() const + inline bool IsLRZDirWriteSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZCompressEnabledSet(m_id); + return m_obj_ptr->IsLRZDirWriteSet(m_id); } - inline const char* GetZCompressEnabledName() const + inline const char* GetLRZDirWriteName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZCompressEnabledName(); + return m_obj_ptr->GetLRZDirWriteName(); } - inline const char* GetZCompressEnabledDescription() const + inline const char* GetLRZDirWriteDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZCompressEnabledDescription(); + return m_obj_ptr->GetLRZDirWriteDescription(); } //----------------------------------------------- - // REF FIELD StencilCompressEnabled: Whether compression is enabled for stencil buffers. To - // reduce bandwidth impact + // REF FIELD ZTestMode: Depth test mode - // `StencilCompressEnabled()` returns the value of the StencilCompressEnabled field of the - // referenced object - inline bool StencilCompressEnabled() const + // `ZTestMode()` returns the value of the ZTestMode field of the referenced object + inline a6xx_ztest_mode ZTestMode() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->StencilCompressEnabled(m_id); + return m_obj_ptr->ZTestMode(m_id); } - // `SetStencilCompressEnabled(value)` sets the StencilCompressEnabled field of the referenced - // object - inline const Ref& SetStencilCompressEnabled(bool value) const + // `SetZTestMode(value)` sets the ZTestMode field of the referenced object + inline const Ref& SetZTestMode(a6xx_ztest_mode value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetStencilCompressEnabled(m_id, value); + m_obj_ptr->SetZTestMode(m_id, value); return static_cast(*this); } - inline bool IsStencilCompressEnabledSet() const + inline bool IsZTestModeSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsStencilCompressEnabledSet(m_id); + return m_obj_ptr->IsZTestModeSet(m_id); } - inline const char* GetStencilCompressEnabledName() const + inline const char* GetZTestModeName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetStencilCompressEnabledName(); + return m_obj_ptr->GetZTestModeName(); } - inline const char* GetStencilCompressEnabledDescription() const + inline const char* GetZTestModeDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetStencilCompressEnabledDescription(); + return m_obj_ptr->GetZTestModeDescription(); } //----------------------------------------------- - // REF FIELD CompressedZFetchEnabled: Whether shader fetch of compressed depth buffers is - // enabled + // REF FIELD BinW: Bin width - // `CompressedZFetchEnabled()` returns the value of the CompressedZFetchEnabled field of the - // referenced object - inline bool CompressedZFetchEnabled() const + // `BinW()` returns the value of the BinW field of the referenced object + inline uint32_t BinW() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->CompressedZFetchEnabled(m_id); + return m_obj_ptr->BinW(m_id); } - // `SetCompressedZFetchEnabled(value)` sets the CompressedZFetchEnabled field of the referenced - // object - inline const Ref& SetCompressedZFetchEnabled(bool value) const + // `SetBinW(value)` sets the BinW field of the referenced object + inline const Ref& SetBinW(uint32_t value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetCompressedZFetchEnabled(m_id, value); + m_obj_ptr->SetBinW(m_id, value); return static_cast(*this); } - inline bool IsCompressedZFetchEnabledSet() const + inline bool IsBinWSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsCompressedZFetchEnabledSet(m_id); + return m_obj_ptr->IsBinWSet(m_id); } - inline const char* GetCompressedZFetchEnabledName() const + inline const char* GetBinWName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetCompressedZFetchEnabledName(); + return m_obj_ptr->GetBinWName(); } - inline const char* GetCompressedZFetchEnabledDescription() const + inline const char* GetBinWDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetCompressedZFetchEnabledDescription(); + return m_obj_ptr->GetBinWDescription(); } //----------------------------------------------- - // REF FIELD ZFormat: Internal GPU format of the depth buffer + // REF FIELD BinH: Bin Height - // `ZFormat()` returns the value of the ZFormat field of the referenced object - inline Dive::Legacy::ZFormat ZFormat() const + // `BinH()` returns the value of the BinH field of the referenced object + inline uint32_t BinH() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZFormat(m_id); + return m_obj_ptr->BinH(m_id); } - // `SetZFormat(value)` sets the ZFormat field of the referenced object - inline const Ref& SetZFormat(Dive::Legacy::ZFormat value) const + // `SetBinH(value)` sets the BinH field of the referenced object + inline const Ref& SetBinH(uint32_t value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetZFormat(m_id, value); + m_obj_ptr->SetBinH(m_id, value); return static_cast(*this); } - inline bool IsZFormatSet() const + inline bool IsBinHSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZFormatSet(m_id); + return m_obj_ptr->IsBinHSet(m_id); } - inline const char* GetZFormatName() const + inline const char* GetBinHName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZFormatName(); + return m_obj_ptr->GetBinHName(); } - inline const char* GetZFormatDescription() const + inline const char* GetBinHDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZFormatDescription(); + return m_obj_ptr->GetBinHDescription(); } //----------------------------------------------- - // REF FIELD ZOrder: Indicates application preference for LateZ, EarlyZ, or ReZ + // REF FIELD RenderMode: Whether in binning pass or rendering pass - // `ZOrder()` returns the value of the ZOrder field of the referenced object - inline Dive::Legacy::ZOrder ZOrder() const + // `RenderMode()` returns the value of the RenderMode field of the referenced object + inline a6xx_render_mode RenderMode() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZOrder(m_id); + return m_obj_ptr->RenderMode(m_id); } - // `SetZOrder(value)` sets the ZOrder field of the referenced object - inline const Ref& SetZOrder(Dive::Legacy::ZOrder value) const + // `SetRenderMode(value)` sets the RenderMode field of the referenced object + inline const Ref& SetRenderMode(a6xx_render_mode value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetZOrder(m_id, value); + m_obj_ptr->SetRenderMode(m_id, value); return static_cast(*this); } - inline bool IsZOrderSet() const + inline bool IsRenderModeSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZOrderSet(m_id); + return m_obj_ptr->IsRenderModeSet(m_id); } - inline const char* GetZOrderName() const + inline const char* GetRenderModeName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZOrderName(); + return m_obj_ptr->GetRenderModeName(); } - inline const char* GetZOrderDescription() const + inline const char* GetRenderModeDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZOrderDescription(); + return m_obj_ptr->GetRenderModeDescription(); } //----------------------------------------------- - // REF FIELD VSLateAlloc: Late VS wavefront allocation count. Value is the number of wavefronts - // minus one, since at least one VS wave can always launch with late alloc enabled + // REF FIELD BuffersLocation: Whether the target buffer is in GMEM or SYSMEM - // `VSLateAlloc()` returns the value of the VSLateAlloc field of the referenced object - inline uint16_t VSLateAlloc() const + // `BuffersLocation()` returns the value of the BuffersLocation field of the referenced object + inline a6xx_buffers_location BuffersLocation() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->VSLateAlloc(m_id); + return m_obj_ptr->BuffersLocation(m_id); } - // `SetVSLateAlloc(value)` sets the VSLateAlloc field of the referenced object - inline const Ref& SetVSLateAlloc(uint16_t value) const + // `SetBuffersLocation(value)` sets the BuffersLocation field of the referenced object + inline const Ref& SetBuffersLocation(a6xx_buffers_location value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetVSLateAlloc(m_id, value); + m_obj_ptr->SetBuffersLocation(m_id, value); return static_cast(*this); } - inline bool IsVSLateAllocSet() const + inline bool IsBuffersLocationSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsVSLateAllocSet(m_id); + return m_obj_ptr->IsBuffersLocationSet(m_id); } - inline const char* GetVSLateAllocName() const + inline const char* GetBuffersLocationName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVSLateAllocName(); + return m_obj_ptr->GetBuffersLocationName(); } - inline const char* GetVSLateAllocDescription() const + inline const char* GetBuffersLocationDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVSLateAllocDescription(); + return m_obj_ptr->GetBuffersLocationDescription(); } //----------------------------------------------- - // REF FIELD DccEnabled: Whether DCC-based bandwidth-saving color compression is enabled + // REF FIELD ThreadSize: Whether the thread size is 64 or 128 - // `DccEnabled(uint32_t attachment)` returns the value of the DccEnabled field of the referenced - // object - inline bool DccEnabled(uint32_t attachment) const + // `ThreadSize()` returns the value of the ThreadSize field of the referenced object + inline a6xx_threadsize ThreadSize() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->DccEnabled(m_id, attachment); + return m_obj_ptr->ThreadSize(m_id); } - // `DccEnabled()` returns the array of values of the DccEnabled field of the referenced object - inline DccEnabledArray DccEnabled() const { return DccEnabledArray(m_obj_ptr, m_id); } - - // `SetDccEnabled(value)` sets the DccEnabled field of the referenced object - inline const Ref& SetDccEnabled(uint32_t attachment, bool value) const + // `SetThreadSize(value)` sets the ThreadSize field of the referenced object + inline const Ref& SetThreadSize(a6xx_threadsize value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetDccEnabled(m_id, attachment, value); + m_obj_ptr->SetThreadSize(m_id, value); return static_cast(*this); } - inline bool IsDccEnabledSet(uint32_t attachment) const + inline bool IsThreadSizeSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsDccEnabledSet(m_id, attachment); + return m_obj_ptr->IsThreadSizeSet(m_id); } - inline const char* GetDccEnabledName() const + inline const char* GetThreadSizeName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledName(); + return m_obj_ptr->GetThreadSizeName(); } - inline const char* GetDccEnabledDescription() const + inline const char* GetThreadSizeDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledDescription(); + return m_obj_ptr->GetThreadSizeDescription(); } //----------------------------------------------- - // REF FIELD ColorFormat: Per target attachment hardware color format + // REF FIELD EnableAllHelperLanes: Whether all helper lanes are enabled of the 2x2 quad for fine + // derivatives - // `ColorFormat(uint32_t attachment)` returns the value of the ColorFormat field of the + // `EnableAllHelperLanes()` returns the value of the EnableAllHelperLanes field of the // referenced object - inline Dive::Legacy::ColorFormat ColorFormat(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ColorFormat(m_id, attachment); - } - - // `ColorFormat()` returns the array of values of the ColorFormat field of the referenced object - inline ColorFormatArray ColorFormat() const { return ColorFormatArray(m_obj_ptr, m_id); } - - // `SetColorFormat(value)` sets the ColorFormat field of the referenced object - inline const Ref& SetColorFormat(uint32_t attachment, Dive::Legacy::ColorFormat value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetColorFormat(m_id, attachment, value); - return static_cast(*this); - } - - inline bool IsColorFormatSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsColorFormatSet(m_id, attachment); - } - - inline const char* GetColorFormatName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatName(); - } - - inline const char* GetColorFormatDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatDescription(); - } - - //----------------------------------------------- - // REF FIELD Mip0Height: Per target attachment mip0 height - - // `Mip0Height(uint32_t attachment)` returns the value of the Mip0Height field of the referenced - // object - inline uint32_t Mip0Height(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Height(m_id, attachment); - } - - // `Mip0Height()` returns the array of values of the Mip0Height field of the referenced object - inline Mip0HeightArray Mip0Height() const { return Mip0HeightArray(m_obj_ptr, m_id); } - - // `SetMip0Height(value)` sets the Mip0Height field of the referenced object - inline const Ref& SetMip0Height(uint32_t attachment, uint32_t value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetMip0Height(m_id, attachment, value); - return static_cast(*this); - } - - inline bool IsMip0HeightSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0HeightSet(m_id, attachment); - } - - inline const char* GetMip0HeightName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightName(); - } - - inline const char* GetMip0HeightDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightDescription(); - } - - //----------------------------------------------- - // REF FIELD Mip0Width: Per target attachment mip0 width - - // `Mip0Width(uint32_t attachment)` returns the value of the Mip0Width field of the referenced - // object - inline uint32_t Mip0Width(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Width(m_id, attachment); - } - - // `Mip0Width()` returns the array of values of the Mip0Width field of the referenced object - inline Mip0WidthArray Mip0Width() const { return Mip0WidthArray(m_obj_ptr, m_id); } - - // `SetMip0Width(value)` sets the Mip0Width field of the referenced object - inline const Ref& SetMip0Width(uint32_t attachment, uint32_t value) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetMip0Width(m_id, attachment, value); - return static_cast(*this); - } - - inline bool IsMip0WidthSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0WidthSet(m_id, attachment); - } - - inline const char* GetMip0WidthName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthName(); - } - - inline const char* GetMip0WidthDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthDescription(); - } - - //----------------------------------------------- - // REF FIELD Vgpr: Per shader stage vector general purpose register count. Always rounded up to - // nearest multiple of 4. - - // `Vgpr(Dive::ShaderStage stage)` returns the value of the Vgpr field of the referenced object - inline uint16_t Vgpr(Dive::ShaderStage stage) const + inline bool EnableAllHelperLanes() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Vgpr(m_id, stage); + return m_obj_ptr->EnableAllHelperLanes(m_id); } - // `Vgpr()` returns the array of values of the Vgpr field of the referenced object - inline VgprArray Vgpr() const { return VgprArray(m_obj_ptr, m_id); } - - // `SetVgpr(value)` sets the Vgpr field of the referenced object - inline const Ref& SetVgpr(Dive::ShaderStage stage, uint16_t value) const + // `SetEnableAllHelperLanes(value)` sets the EnableAllHelperLanes field of the referenced object + inline const Ref& SetEnableAllHelperLanes(bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetVgpr(m_id, stage, value); + m_obj_ptr->SetEnableAllHelperLanes(m_id, value); return static_cast(*this); } - inline bool IsVgprSet(Dive::ShaderStage stage) const + inline bool IsEnableAllHelperLanesSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsVgprSet(m_id, stage); + return m_obj_ptr->IsEnableAllHelperLanesSet(m_id); } - inline const char* GetVgprName() const + inline const char* GetEnableAllHelperLanesName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprName(); + return m_obj_ptr->GetEnableAllHelperLanesName(); } - inline const char* GetVgprDescription() const + inline const char* GetEnableAllHelperLanesDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprDescription(); + return m_obj_ptr->GetEnableAllHelperLanesDescription(); } //----------------------------------------------- - // REF FIELD Sgpr: Per shader stage scalar general purpose register count. Always rounded up to - // nearest multiple of 16 + // REF FIELD EnablePartialHelperLanes: Whether 3 out of 4 helper lanes are enabled of the 2x2 + // quad for coarse derivatives - // `Sgpr(Dive::ShaderStage stage)` returns the value of the Sgpr field of the referenced object - inline uint16_t Sgpr(Dive::ShaderStage stage) const + // `EnablePartialHelperLanes()` returns the value of the EnablePartialHelperLanes field of the + // referenced object + inline bool EnablePartialHelperLanes() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Sgpr(m_id, stage); + return m_obj_ptr->EnablePartialHelperLanes(m_id); } - // `Sgpr()` returns the array of values of the Sgpr field of the referenced object - inline SgprArray Sgpr() const { return SgprArray(m_obj_ptr, m_id); } - - // `SetSgpr(value)` sets the Sgpr field of the referenced object - inline const Ref& SetSgpr(Dive::ShaderStage stage, uint16_t value) const + // `SetEnablePartialHelperLanes(value)` sets the EnablePartialHelperLanes field of the + // referenced object + inline const Ref& SetEnablePartialHelperLanes(bool value) const { DIVE_ASSERT(m_obj_ptr != nullptr); - m_obj_ptr->SetSgpr(m_id, stage, value); + m_obj_ptr->SetEnablePartialHelperLanes(m_id, value); return static_cast(*this); } - inline bool IsSgprSet(Dive::ShaderStage stage) const + inline bool IsEnablePartialHelperLanesSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsSgprSet(m_id, stage); + return m_obj_ptr->IsEnablePartialHelperLanesSet(m_id); } - inline const char* GetSgprName() const + inline const char* GetEnablePartialHelperLanesName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprName(); + return m_obj_ptr->GetEnablePartialHelperLanesName(); } - inline const char* GetSgprDescription() const + inline const char* GetEnablePartialHelperLanesDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprDescription(); + return m_obj_ptr->GetEnablePartialHelperLanesDescription(); } EventStateInfoRefT& operator=(const EventStateInfoRefT& other) = delete; @@ -3396,22 +2538,14 @@ template class EventStateInfoConstRefT using ViewportConstArray = typename CONFIG::ViewportConstArray; using ScissorArray = typename CONFIG::ScissorArray; using ScissorConstArray = typename CONFIG::ScissorConstArray; + using LogicOpEnabledArray = typename CONFIG::LogicOpEnabledArray; + using LogicOpEnabledConstArray = typename CONFIG::LogicOpEnabledConstArray; + using LogicOpArray = typename CONFIG::LogicOpArray; + using LogicOpConstArray = typename CONFIG::LogicOpConstArray; using AttachmentArray = typename CONFIG::AttachmentArray; using AttachmentConstArray = typename CONFIG::AttachmentConstArray; using BlendConstantArray = typename CONFIG::BlendConstantArray; using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; - using DccEnabledArray = typename CONFIG::DccEnabledArray; - using DccEnabledConstArray = typename CONFIG::DccEnabledConstArray; - using ColorFormatArray = typename CONFIG::ColorFormatArray; - using ColorFormatConstArray = typename CONFIG::ColorFormatConstArray; - using Mip0HeightArray = typename CONFIG::Mip0HeightArray; - using Mip0HeightConstArray = typename CONFIG::Mip0HeightConstArray; - using Mip0WidthArray = typename CONFIG::Mip0WidthArray; - using Mip0WidthConstArray = typename CONFIG::Mip0WidthConstArray; - using VgprArray = typename CONFIG::VgprArray; - using VgprConstArray = typename CONFIG::VgprConstArray; - using SgprArray = typename CONFIG::SgprArray; - using SgprConstArray = typename CONFIG::SgprConstArray; EventStateInfoConstRefT() = default; EventStateInfoConstRefT(const Ref& other) : m_obj_ptr(&other.obj()), @@ -4279,17 +3413,25 @@ template class EventStateInfoConstRefT //----------------------------------------------- // REF FIELD LogicOpEnabled: Whether to apply Logical Operations - // `LogicOpEnabled()` returns the value of the LogicOpEnabled field of the referenced object - inline bool LogicOpEnabled() const + // `LogicOpEnabled(uint32_t attachment)` returns the value of the LogicOpEnabled field of the + // referenced object + inline bool LogicOpEnabled(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->LogicOpEnabled(m_id); + return m_obj_ptr->LogicOpEnabled(m_id, attachment); + } + + // `LogicOpEnabled()` returns the array of values of the LogicOpEnabled field of the referenced + // object + inline LogicOpEnabledConstArray LogicOpEnabled() const + { + return LogicOpEnabledConstArray(m_obj_ptr, m_id); } - inline bool IsLogicOpEnabledSet() const + inline bool IsLogicOpEnabledSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsLogicOpEnabledSet(m_id); + return m_obj_ptr->IsLogicOpEnabledSet(m_id, attachment); } inline const char* GetLogicOpEnabledName() const @@ -4307,17 +3449,21 @@ template class EventStateInfoConstRefT //----------------------------------------------- // REF FIELD LogicOp: Which logical operation to apply - // `LogicOp()` returns the value of the LogicOp field of the referenced object - inline VkLogicOp LogicOp() const + // `LogicOp(uint32_t attachment)` returns the value of the LogicOp field of the referenced + // object + inline VkLogicOp LogicOp(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->LogicOp(m_id); + return m_obj_ptr->LogicOp(m_id, attachment); } - inline bool IsLogicOpSet() const + // `LogicOp()` returns the array of values of the LogicOp field of the referenced object + inline LogicOpConstArray LogicOp() const { return LogicOpConstArray(m_obj_ptr, m_id); } + + inline bool IsLogicOpSet(uint32_t attachment) const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsLogicOpSet(m_id); + return m_obj_ptr->IsLogicOpSet(m_id, attachment); } inline const char* GetLogicOpName() const @@ -4401,484 +3547,343 @@ template class EventStateInfoConstRefT } //----------------------------------------------- - // REF FIELD ZAddr: The read and write VA of depth buffer (assumed to be same) - - // `ZAddr()` returns the value of the ZAddr field of the referenced object - inline uint64_t ZAddr() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZAddr(m_id); - } - - inline bool IsZAddrSet() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZAddrSet(m_id); - } - - inline const char* GetZAddrName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZAddrName(); - } - - inline const char* GetZAddrDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZAddrDescription(); - } - - //----------------------------------------------- - // REF FIELD HTileAddr: VA of DB's HTile buffer + // REF FIELD LRZEnabled: Whether LRZ is enabled for depth - // `HTileAddr()` returns the value of the HTileAddr field of the referenced object - inline uint64_t HTileAddr() const + // `LRZEnabled()` returns the value of the LRZEnabled field of the referenced object + inline bool LRZEnabled() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->HTileAddr(m_id); + return m_obj_ptr->LRZEnabled(m_id); } - inline bool IsHTileAddrSet() const + inline bool IsLRZEnabledSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsHTileAddrSet(m_id); + return m_obj_ptr->IsLRZEnabledSet(m_id); } - inline const char* GetHTileAddrName() const + inline const char* GetLRZEnabledName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHTileAddrName(); + return m_obj_ptr->GetLRZEnabledName(); } - inline const char* GetHTileAddrDescription() const + inline const char* GetLRZEnabledDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHTileAddrDescription(); + return m_obj_ptr->GetLRZEnabledDescription(); } //----------------------------------------------- - // REF FIELD HiZEnabled: Whether Hi-Z is enabled for depth + // REF FIELD LRZWrite: Whether LRZ write is enabled - // `HiZEnabled()` returns the value of the HiZEnabled field of the referenced object - inline bool HiZEnabled() const + // `LRZWrite()` returns the value of the LRZWrite field of the referenced object + inline bool LRZWrite() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->HiZEnabled(m_id); + return m_obj_ptr->LRZWrite(m_id); } - inline bool IsHiZEnabledSet() const + inline bool IsLRZWriteSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsHiZEnabledSet(m_id); + return m_obj_ptr->IsLRZWriteSet(m_id); } - inline const char* GetHiZEnabledName() const + inline const char* GetLRZWriteName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiZEnabledName(); + return m_obj_ptr->GetLRZWriteName(); } - inline const char* GetHiZEnabledDescription() const + inline const char* GetLRZWriteDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiZEnabledDescription(); + return m_obj_ptr->GetLRZWriteDescription(); } //----------------------------------------------- - // REF FIELD HiSEnabled: Whether Hi-S is enabled for stencil + // REF FIELD LRZDirStatus: LRZ direction - // `HiSEnabled()` returns the value of the HiSEnabled field of the referenced object - inline bool HiSEnabled() const + // `LRZDirStatus()` returns the value of the LRZDirStatus field of the referenced object + inline a6xx_lrz_dir_status LRZDirStatus() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->HiSEnabled(m_id); + return m_obj_ptr->LRZDirStatus(m_id); } - inline bool IsHiSEnabledSet() const + inline bool IsLRZDirStatusSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsHiSEnabledSet(m_id); + return m_obj_ptr->IsLRZDirStatusSet(m_id); } - inline const char* GetHiSEnabledName() const + inline const char* GetLRZDirStatusName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiSEnabledName(); + return m_obj_ptr->GetLRZDirStatusName(); } - inline const char* GetHiSEnabledDescription() const + inline const char* GetLRZDirStatusDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetHiSEnabledDescription(); + return m_obj_ptr->GetLRZDirStatusDescription(); } //----------------------------------------------- - // REF FIELD ZCompressEnabled: Whether plane compression is enabled for depth buffers. To reduce - // bandwidth impact + // REF FIELD LRZDirWrite: Whether LRZ direction write is enabled - // `ZCompressEnabled()` returns the value of the ZCompressEnabled field of the referenced object - inline bool ZCompressEnabled() const + // `LRZDirWrite()` returns the value of the LRZDirWrite field of the referenced object + inline bool LRZDirWrite() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZCompressEnabled(m_id); + return m_obj_ptr->LRZDirWrite(m_id); } - inline bool IsZCompressEnabledSet() const + inline bool IsLRZDirWriteSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZCompressEnabledSet(m_id); + return m_obj_ptr->IsLRZDirWriteSet(m_id); } - inline const char* GetZCompressEnabledName() const + inline const char* GetLRZDirWriteName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZCompressEnabledName(); + return m_obj_ptr->GetLRZDirWriteName(); } - inline const char* GetZCompressEnabledDescription() const + inline const char* GetLRZDirWriteDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZCompressEnabledDescription(); + return m_obj_ptr->GetLRZDirWriteDescription(); } //----------------------------------------------- - // REF FIELD StencilCompressEnabled: Whether compression is enabled for stencil buffers. To - // reduce bandwidth impact + // REF FIELD ZTestMode: Depth test mode - // `StencilCompressEnabled()` returns the value of the StencilCompressEnabled field of the - // referenced object - inline bool StencilCompressEnabled() const + // `ZTestMode()` returns the value of the ZTestMode field of the referenced object + inline a6xx_ztest_mode ZTestMode() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->StencilCompressEnabled(m_id); + return m_obj_ptr->ZTestMode(m_id); } - inline bool IsStencilCompressEnabledSet() const + inline bool IsZTestModeSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsStencilCompressEnabledSet(m_id); + return m_obj_ptr->IsZTestModeSet(m_id); } - inline const char* GetStencilCompressEnabledName() const + inline const char* GetZTestModeName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetStencilCompressEnabledName(); + return m_obj_ptr->GetZTestModeName(); } - inline const char* GetStencilCompressEnabledDescription() const + inline const char* GetZTestModeDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetStencilCompressEnabledDescription(); + return m_obj_ptr->GetZTestModeDescription(); } //----------------------------------------------- - // REF FIELD CompressedZFetchEnabled: Whether shader fetch of compressed depth buffers is - // enabled + // REF FIELD BinW: Bin width - // `CompressedZFetchEnabled()` returns the value of the CompressedZFetchEnabled field of the - // referenced object - inline bool CompressedZFetchEnabled() const + // `BinW()` returns the value of the BinW field of the referenced object + inline uint32_t BinW() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->CompressedZFetchEnabled(m_id); + return m_obj_ptr->BinW(m_id); } - inline bool IsCompressedZFetchEnabledSet() const + inline bool IsBinWSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsCompressedZFetchEnabledSet(m_id); + return m_obj_ptr->IsBinWSet(m_id); } - inline const char* GetCompressedZFetchEnabledName() const + inline const char* GetBinWName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetCompressedZFetchEnabledName(); + return m_obj_ptr->GetBinWName(); } - inline const char* GetCompressedZFetchEnabledDescription() const + inline const char* GetBinWDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetCompressedZFetchEnabledDescription(); + return m_obj_ptr->GetBinWDescription(); } //----------------------------------------------- - // REF FIELD ZFormat: Internal GPU format of the depth buffer + // REF FIELD BinH: Bin Height - // `ZFormat()` returns the value of the ZFormat field of the referenced object - inline Dive::Legacy::ZFormat ZFormat() const + // `BinH()` returns the value of the BinH field of the referenced object + inline uint32_t BinH() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZFormat(m_id); + return m_obj_ptr->BinH(m_id); } - inline bool IsZFormatSet() const + inline bool IsBinHSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZFormatSet(m_id); + return m_obj_ptr->IsBinHSet(m_id); } - inline const char* GetZFormatName() const + inline const char* GetBinHName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZFormatName(); + return m_obj_ptr->GetBinHName(); } - inline const char* GetZFormatDescription() const + inline const char* GetBinHDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZFormatDescription(); + return m_obj_ptr->GetBinHDescription(); } //----------------------------------------------- - // REF FIELD ZOrder: Indicates application preference for LateZ, EarlyZ, or ReZ + // REF FIELD RenderMode: Whether in binning pass or rendering pass - // `ZOrder()` returns the value of the ZOrder field of the referenced object - inline Dive::Legacy::ZOrder ZOrder() const + // `RenderMode()` returns the value of the RenderMode field of the referenced object + inline a6xx_render_mode RenderMode() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ZOrder(m_id); + return m_obj_ptr->RenderMode(m_id); } - inline bool IsZOrderSet() const + inline bool IsRenderModeSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsZOrderSet(m_id); + return m_obj_ptr->IsRenderModeSet(m_id); } - inline const char* GetZOrderName() const + inline const char* GetRenderModeName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZOrderName(); + return m_obj_ptr->GetRenderModeName(); } - inline const char* GetZOrderDescription() const + inline const char* GetRenderModeDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetZOrderDescription(); + return m_obj_ptr->GetRenderModeDescription(); } //----------------------------------------------- - // REF FIELD VSLateAlloc: Late VS wavefront allocation count. Value is the number of wavefronts - // minus one, since at least one VS wave can always launch with late alloc enabled + // REF FIELD BuffersLocation: Whether the target buffer is in GMEM or SYSMEM - // `VSLateAlloc()` returns the value of the VSLateAlloc field of the referenced object - inline uint16_t VSLateAlloc() const + // `BuffersLocation()` returns the value of the BuffersLocation field of the referenced object + inline a6xx_buffers_location BuffersLocation() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->VSLateAlloc(m_id); + return m_obj_ptr->BuffersLocation(m_id); } - inline bool IsVSLateAllocSet() const + inline bool IsBuffersLocationSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsVSLateAllocSet(m_id); + return m_obj_ptr->IsBuffersLocationSet(m_id); } - inline const char* GetVSLateAllocName() const + inline const char* GetBuffersLocationName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVSLateAllocName(); + return m_obj_ptr->GetBuffersLocationName(); } - inline const char* GetVSLateAllocDescription() const + inline const char* GetBuffersLocationDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVSLateAllocDescription(); + return m_obj_ptr->GetBuffersLocationDescription(); } //----------------------------------------------- - // REF FIELD DccEnabled: Whether DCC-based bandwidth-saving color compression is enabled + // REF FIELD ThreadSize: Whether the thread size is 64 or 128 - // `DccEnabled(uint32_t attachment)` returns the value of the DccEnabled field of the referenced - // object - inline bool DccEnabled(uint32_t attachment) const + // `ThreadSize()` returns the value of the ThreadSize field of the referenced object + inline a6xx_threadsize ThreadSize() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->DccEnabled(m_id, attachment); + return m_obj_ptr->ThreadSize(m_id); } - // `DccEnabled()` returns the array of values of the DccEnabled field of the referenced object - inline DccEnabledConstArray DccEnabled() const { return DccEnabledConstArray(m_obj_ptr, m_id); } - - inline bool IsDccEnabledSet(uint32_t attachment) const + inline bool IsThreadSizeSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsDccEnabledSet(m_id, attachment); + return m_obj_ptr->IsThreadSizeSet(m_id); } - inline const char* GetDccEnabledName() const + inline const char* GetThreadSizeName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledName(); + return m_obj_ptr->GetThreadSizeName(); } - inline const char* GetDccEnabledDescription() const + inline const char* GetThreadSizeDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetDccEnabledDescription(); + return m_obj_ptr->GetThreadSizeDescription(); } //----------------------------------------------- - // REF FIELD ColorFormat: Per target attachment hardware color format + // REF FIELD EnableAllHelperLanes: Whether all helper lanes are enabled of the 2x2 quad for fine + // derivatives - // `ColorFormat(uint32_t attachment)` returns the value of the ColorFormat field of the + // `EnableAllHelperLanes()` returns the value of the EnableAllHelperLanes field of the // referenced object - inline Dive::Legacy::ColorFormat ColorFormat(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->ColorFormat(m_id, attachment); - } - - // `ColorFormat()` returns the array of values of the ColorFormat field of the referenced object - inline ColorFormatConstArray ColorFormat() const - { - return ColorFormatConstArray(m_obj_ptr, m_id); - } - - inline bool IsColorFormatSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsColorFormatSet(m_id, attachment); - } - - inline const char* GetColorFormatName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatName(); - } - - inline const char* GetColorFormatDescription() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetColorFormatDescription(); - } - - //----------------------------------------------- - // REF FIELD Mip0Height: Per target attachment mip0 height - - // `Mip0Height(uint32_t attachment)` returns the value of the Mip0Height field of the referenced - // object - inline uint32_t Mip0Height(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Height(m_id, attachment); - } - - // `Mip0Height()` returns the array of values of the Mip0Height field of the referenced object - inline Mip0HeightConstArray Mip0Height() const { return Mip0HeightConstArray(m_obj_ptr, m_id); } - - inline bool IsMip0HeightSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0HeightSet(m_id, attachment); - } - - inline const char* GetMip0HeightName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightName(); - } - - inline const char* GetMip0HeightDescription() const + inline bool EnableAllHelperLanes() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0HeightDescription(); + return m_obj_ptr->EnableAllHelperLanes(m_id); } - //----------------------------------------------- - // REF FIELD Mip0Width: Per target attachment mip0 width - - // `Mip0Width(uint32_t attachment)` returns the value of the Mip0Width field of the referenced - // object - inline uint32_t Mip0Width(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Mip0Width(m_id, attachment); - } - - // `Mip0Width()` returns the array of values of the Mip0Width field of the referenced object - inline Mip0WidthConstArray Mip0Width() const { return Mip0WidthConstArray(m_obj_ptr, m_id); } - - inline bool IsMip0WidthSet(uint32_t attachment) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsMip0WidthSet(m_id, attachment); - } - - inline const char* GetMip0WidthName() const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthName(); - } - - inline const char* GetMip0WidthDescription() const + inline bool IsEnableAllHelperLanesSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetMip0WidthDescription(); + return m_obj_ptr->IsEnableAllHelperLanesSet(m_id); } - //----------------------------------------------- - // REF FIELD Vgpr: Per shader stage vector general purpose register count. Always rounded up to - // nearest multiple of 4. - - // `Vgpr(Dive::ShaderStage stage)` returns the value of the Vgpr field of the referenced object - inline uint16_t Vgpr(Dive::ShaderStage stage) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Vgpr(m_id, stage); - } - - // `Vgpr()` returns the array of values of the Vgpr field of the referenced object - inline VgprConstArray Vgpr() const { return VgprConstArray(m_obj_ptr, m_id); } - - inline bool IsVgprSet(Dive::ShaderStage stage) const - { - DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsVgprSet(m_id, stage); - } - - inline const char* GetVgprName() const + inline const char* GetEnableAllHelperLanesName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprName(); + return m_obj_ptr->GetEnableAllHelperLanesName(); } - inline const char* GetVgprDescription() const + inline const char* GetEnableAllHelperLanesDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetVgprDescription(); + return m_obj_ptr->GetEnableAllHelperLanesDescription(); } //----------------------------------------------- - // REF FIELD Sgpr: Per shader stage scalar general purpose register count. Always rounded up to - // nearest multiple of 16 + // REF FIELD EnablePartialHelperLanes: Whether 3 out of 4 helper lanes are enabled of the 2x2 + // quad for coarse derivatives - // `Sgpr(Dive::ShaderStage stage)` returns the value of the Sgpr field of the referenced object - inline uint16_t Sgpr(Dive::ShaderStage stage) const + // `EnablePartialHelperLanes()` returns the value of the EnablePartialHelperLanes field of the + // referenced object + inline bool EnablePartialHelperLanes() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->Sgpr(m_id, stage); + return m_obj_ptr->EnablePartialHelperLanes(m_id); } - // `Sgpr()` returns the array of values of the Sgpr field of the referenced object - inline SgprConstArray Sgpr() const { return SgprConstArray(m_obj_ptr, m_id); } - - inline bool IsSgprSet(Dive::ShaderStage stage) const + inline bool IsEnablePartialHelperLanesSet() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->IsSgprSet(m_id, stage); + return m_obj_ptr->IsEnablePartialHelperLanesSet(m_id); } - inline const char* GetSgprName() const + inline const char* GetEnablePartialHelperLanesName() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprName(); + return m_obj_ptr->GetEnablePartialHelperLanesName(); } - inline const char* GetSgprDescription() const + inline const char* GetEnablePartialHelperLanesDescription() const { DIVE_ASSERT(m_obj_ptr != nullptr); - return m_obj_ptr->GetSgprDescription(); + return m_obj_ptr->GetEnablePartialHelperLanesDescription(); } EventStateInfoConstRefT& operator=(const EventStateInfoConstRefT& other) = delete; @@ -4905,22 +3910,14 @@ template class EventStateInfoT using ViewportConstArray = typename CONFIG::ViewportConstArray; using ScissorArray = typename CONFIG::ScissorArray; using ScissorConstArray = typename CONFIG::ScissorConstArray; + using LogicOpEnabledArray = typename CONFIG::LogicOpEnabledArray; + using LogicOpEnabledConstArray = typename CONFIG::LogicOpEnabledConstArray; + using LogicOpArray = typename CONFIG::LogicOpArray; + using LogicOpConstArray = typename CONFIG::LogicOpConstArray; using AttachmentArray = typename CONFIG::AttachmentArray; using AttachmentConstArray = typename CONFIG::AttachmentConstArray; using BlendConstantArray = typename CONFIG::BlendConstantArray; using BlendConstantConstArray = typename CONFIG::BlendConstantConstArray; - using DccEnabledArray = typename CONFIG::DccEnabledArray; - using DccEnabledConstArray = typename CONFIG::DccEnabledConstArray; - using ColorFormatArray = typename CONFIG::ColorFormatArray; - using ColorFormatConstArray = typename CONFIG::ColorFormatConstArray; - using Mip0HeightArray = typename CONFIG::Mip0HeightArray; - using Mip0HeightConstArray = typename CONFIG::Mip0HeightConstArray; - using Mip0WidthArray = typename CONFIG::Mip0WidthArray; - using Mip0WidthConstArray = typename CONFIG::Mip0WidthConstArray; - using VgprArray = typename CONFIG::VgprArray; - using VgprConstArray = typename CONFIG::VgprConstArray; - using SgprArray = typename CONFIG::SgprArray; - using SgprConstArray = typename CONFIG::SgprConstArray; // `size()` returns the number of elements inline typename Id::basic_type size() const { return m_size; } @@ -6768,43 +5765,54 @@ template class EventStateInfoT kLogicOpEnabledOffset * m_cap); } // `LogicOpEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* LogicOpEnabledPtr(Id id) const + inline const bool* LogicOpEnabledPtr(Id id, uint32_t attachment = 0) const { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + kLogicOpEnabledOffset * m_cap) + - static_cast(id) + static_cast(id) * 8 + attachment ; } - inline bool* LogicOpEnabledPtr(Id id) + inline bool* LogicOpEnabledPtr(Id id, uint32_t attachment = 0) { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + kLogicOpEnabledOffset * m_cap) + - static_cast(id) + static_cast(id) * 8 + attachment ; } // `LogicOpEnabled(id)` retuns the `LogicOpEnabled` element of the object identified by `id` - inline bool LogicOpEnabled(Id id) const + inline bool LogicOpEnabled(Id id, uint32_t attachment) const { DIVE_ASSERT(IsValidId(id)); - return *LogicOpEnabledPtr(id); + return *LogicOpEnabledPtr(id, attachment); + } + + // `LogicOpEnabled(id)` returns the array of values of the LogicOpEnabled field of the object + // identified by `id` + inline LogicOpEnabledArray LogicOpEnabled(Id id) + { + return LogicOpEnabledArray(static_cast(this), id); + } + inline LogicOpEnabledConstArray LogicOpEnabled(Id id) const + { + return LogicOpEnabledConstArray(static_cast(this), id); } // `SetLogicOpEnabled(id,value)` sets the `LogicOpEnabled` element of the object identified by // `id` - inline SOA& SetLogicOpEnabled(Id id, bool value) + inline SOA& SetLogicOpEnabled(Id id, uint32_t attachment, bool value) { DIVE_ASSERT(IsValidId(id)); - *LogicOpEnabledPtr(id) = value; - MarkFieldSet(id, kLogicOpEnabledIndex); + *LogicOpEnabledPtr(id, attachment) = value; + MarkFieldSet(id, kLogicOpEnabledIndex + attachment); return static_cast(*this); } - inline bool IsLogicOpEnabledSet(Id id) const + inline bool IsLogicOpEnabledSet(Id id, uint32_t attachment) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kLogicOpEnabledIndex); + return IsFieldSet(id, kLogicOpEnabledIndex + attachment); } inline const char* GetLogicOpEnabledName() const { return "LogicOpEnabled"; } @@ -6829,42 +5837,50 @@ template class EventStateInfoT kLogicOpOffset * m_cap); } // `LogicOpPtr()` returns a shared pointer to an array of `size()` elements - inline const VkLogicOp* LogicOpPtr(Id id) const + inline const VkLogicOp* LogicOpPtr(Id id, uint32_t attachment = 0) const { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + kLogicOpOffset * m_cap) + - static_cast(id) + static_cast(id) * 8 + attachment ; } - inline VkLogicOp* LogicOpPtr(Id id) + inline VkLogicOp* LogicOpPtr(Id id, uint32_t attachment = 0) { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + kLogicOpOffset * m_cap) + - static_cast(id) + static_cast(id) * 8 + attachment ; } // `LogicOp(id)` retuns the `LogicOp` element of the object identified by `id` - inline VkLogicOp LogicOp(Id id) const + inline VkLogicOp LogicOp(Id id, uint32_t attachment) const { DIVE_ASSERT(IsValidId(id)); - return *LogicOpPtr(id); + return *LogicOpPtr(id, attachment); + } + + // `LogicOp(id)` returns the array of values of the LogicOp field of the object identified by + // `id` + inline LogicOpArray LogicOp(Id id) { return LogicOpArray(static_cast(this), id); } + inline LogicOpConstArray LogicOp(Id id) const + { + return LogicOpConstArray(static_cast(this), id); } // `SetLogicOp(id,value)` sets the `LogicOp` element of the object identified by `id` - inline SOA& SetLogicOp(Id id, VkLogicOp value) + inline SOA& SetLogicOp(Id id, uint32_t attachment, VkLogicOp value) { DIVE_ASSERT(IsValidId(id)); - *LogicOpPtr(id) = value; - MarkFieldSet(id, kLogicOpIndex); + *LogicOpPtr(id, attachment) = value; + MarkFieldSet(id, kLogicOpIndex + attachment); return static_cast(*this); } - inline bool IsLogicOpSet(Id id) const + inline bool IsLogicOpSet(Id id, uint32_t attachment) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kLogicOpIndex); + return IsFieldSet(id, kLogicOpIndex + attachment); } inline const char* GetLogicOpName() const { return "LogicOp"; } @@ -7016,1036 +6032,718 @@ template class EventStateInfoT } //----------------------------------------------- - // FIELD ZAddr: The read and write VA of depth buffer (assumed to be same) + // FIELD LRZEnabled: Whether LRZ is enabled for depth - // `ZAddrPtr()` returns a shared pointer to an array of `size()` elements - inline const uint64_t* ZAddrPtr() const + // `LRZEnabledPtr()` returns a shared pointer to an array of `size()` elements + inline const bool* LRZEnabledPtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZAddrOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZEnabledOffset * m_cap); } - inline uint64_t* ZAddrPtr() + inline bool* LRZEnabledPtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZAddrOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZEnabledOffset * m_cap); } - // `ZAddrPtr()` returns a shared pointer to an array of `size()` elements - inline const uint64_t* ZAddrPtr(Id id) const + // `LRZEnabledPtr()` returns a shared pointer to an array of `size()` elements + inline const bool* LRZEnabledPtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZAddrOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZEnabledOffset * m_cap) + static_cast(id) ; } - inline uint64_t* ZAddrPtr(Id id) + inline bool* LRZEnabledPtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZAddrOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZEnabledOffset * m_cap) + static_cast(id) ; } - // `ZAddr(id)` retuns the `ZAddr` element of the object identified by `id` - inline uint64_t ZAddr(Id id) const + // `LRZEnabled(id)` retuns the `LRZEnabled` element of the object identified by `id` + inline bool LRZEnabled(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *ZAddrPtr(id); + return *LRZEnabledPtr(id); } - // `SetZAddr(id,value)` sets the `ZAddr` element of the object identified by `id` - inline SOA& SetZAddr(Id id, uint64_t value) + // `SetLRZEnabled(id,value)` sets the `LRZEnabled` element of the object identified by `id` + inline SOA& SetLRZEnabled(Id id, bool value) { DIVE_ASSERT(IsValidId(id)); - *ZAddrPtr(id) = value; - MarkFieldSet(id, kZAddrIndex); + *LRZEnabledPtr(id) = value; + MarkFieldSet(id, kLRZEnabledIndex); return static_cast(*this); } - inline bool IsZAddrSet(Id id) const + inline bool IsLRZEnabledSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kZAddrIndex); + return IsFieldSet(id, kLRZEnabledIndex); } - inline const char* GetZAddrName() const { return "ZAddr"; } + inline const char* GetLRZEnabledName() const { return "LRZEnabled"; } - inline const char* GetZAddrDescription() const + inline const char* GetLRZEnabledDescription() const { - return "The read and write VA of depth buffer (assumed to be same)"; + return "Whether LRZ is enabled for depth"; } //----------------------------------------------- - // FIELD HTileAddr: VA of DB's HTile buffer + // FIELD LRZWrite: Whether LRZ write is enabled - // `HTileAddrPtr()` returns a shared pointer to an array of `size()` elements - inline const uint64_t* HTileAddrPtr() const + // `LRZWritePtr()` returns a shared pointer to an array of `size()` elements + inline const bool* LRZWritePtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHTileAddrOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZWriteOffset * m_cap); } - inline uint64_t* HTileAddrPtr() + inline bool* LRZWritePtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHTileAddrOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZWriteOffset * m_cap); } - // `HTileAddrPtr()` returns a shared pointer to an array of `size()` elements - inline const uint64_t* HTileAddrPtr(Id id) const + // `LRZWritePtr()` returns a shared pointer to an array of `size()` elements + inline const bool* LRZWritePtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHTileAddrOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZWriteOffset * m_cap) + static_cast(id) ; } - inline uint64_t* HTileAddrPtr(Id id) + inline bool* LRZWritePtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHTileAddrOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZWriteOffset * m_cap) + static_cast(id) ; } - // `HTileAddr(id)` retuns the `HTileAddr` element of the object identified by `id` - inline uint64_t HTileAddr(Id id) const + // `LRZWrite(id)` retuns the `LRZWrite` element of the object identified by `id` + inline bool LRZWrite(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *HTileAddrPtr(id); + return *LRZWritePtr(id); } - // `SetHTileAddr(id,value)` sets the `HTileAddr` element of the object identified by `id` - inline SOA& SetHTileAddr(Id id, uint64_t value) + // `SetLRZWrite(id,value)` sets the `LRZWrite` element of the object identified by `id` + inline SOA& SetLRZWrite(Id id, bool value) { DIVE_ASSERT(IsValidId(id)); - *HTileAddrPtr(id) = value; - MarkFieldSet(id, kHTileAddrIndex); + *LRZWritePtr(id) = value; + MarkFieldSet(id, kLRZWriteIndex); return static_cast(*this); } - inline bool IsHTileAddrSet(Id id) const + inline bool IsLRZWriteSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kHTileAddrIndex); + return IsFieldSet(id, kLRZWriteIndex); } - inline const char* GetHTileAddrName() const { return "HTileAddr"; } + inline const char* GetLRZWriteName() const { return "LRZWrite"; } - inline const char* GetHTileAddrDescription() const { return "VA of DB's HTile buffer"; } + inline const char* GetLRZWriteDescription() const { return "Whether LRZ write is enabled"; } //----------------------------------------------- - // FIELD HiZEnabled: Whether Hi-Z is enabled for depth + // FIELD LRZDirStatus: LRZ direction - // `HiZEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* HiZEnabledPtr() const + // `LRZDirStatusPtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_lrz_dir_status* LRZDirStatusPtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiZEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZDirStatusOffset * m_cap); } - inline bool* HiZEnabledPtr() + inline a6xx_lrz_dir_status* LRZDirStatusPtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiZEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZDirStatusOffset * m_cap); } - // `HiZEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* HiZEnabledPtr(Id id) const + // `LRZDirStatusPtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_lrz_dir_status* LRZDirStatusPtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiZEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZDirStatusOffset * m_cap) + static_cast(id) ; } - inline bool* HiZEnabledPtr(Id id) + inline a6xx_lrz_dir_status* LRZDirStatusPtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiZEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kLRZDirStatusOffset * m_cap) + static_cast(id) ; } - // `HiZEnabled(id)` retuns the `HiZEnabled` element of the object identified by `id` - inline bool HiZEnabled(Id id) const + // `LRZDirStatus(id)` retuns the `LRZDirStatus` element of the object identified by `id` + inline a6xx_lrz_dir_status LRZDirStatus(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *HiZEnabledPtr(id); + return *LRZDirStatusPtr(id); } - // `SetHiZEnabled(id,value)` sets the `HiZEnabled` element of the object identified by `id` - inline SOA& SetHiZEnabled(Id id, bool value) + // `SetLRZDirStatus(id,value)` sets the `LRZDirStatus` element of the object identified by `id` + inline SOA& SetLRZDirStatus(Id id, a6xx_lrz_dir_status value) { DIVE_ASSERT(IsValidId(id)); - *HiZEnabledPtr(id) = value; - MarkFieldSet(id, kHiZEnabledIndex); + *LRZDirStatusPtr(id) = value; + MarkFieldSet(id, kLRZDirStatusIndex); return static_cast(*this); } - inline bool IsHiZEnabledSet(Id id) const + inline bool IsLRZDirStatusSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kHiZEnabledIndex); + return IsFieldSet(id, kLRZDirStatusIndex); } - inline const char* GetHiZEnabledName() const { return "HiZEnabled"; } + inline const char* GetLRZDirStatusName() const { return "LRZDirStatus"; } - inline const char* GetHiZEnabledDescription() const - { - return "Whether Hi-Z is enabled for depth"; - } + inline const char* GetLRZDirStatusDescription() const { return "LRZ direction"; } //----------------------------------------------- - // FIELD HiSEnabled: Whether Hi-S is enabled for stencil + // FIELD LRZDirWrite: Whether LRZ direction write is enabled - // `HiSEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* HiSEnabledPtr() const + // `LRZDirWritePtr()` returns a shared pointer to an array of `size()` elements + inline const bool* LRZDirWritePtr() const { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiSEnabledOffset * m_cap); + kLRZDirWriteOffset * m_cap); } - inline bool* HiSEnabledPtr() + inline bool* LRZDirWritePtr() { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiSEnabledOffset * m_cap); + kLRZDirWriteOffset * m_cap); } - // `HiSEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* HiSEnabledPtr(Id id) const + // `LRZDirWritePtr()` returns a shared pointer to an array of `size()` elements + inline const bool* LRZDirWritePtr(Id id) const { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiSEnabledOffset * m_cap) + + kLRZDirWriteOffset * m_cap) + static_cast(id) ; } - inline bool* HiSEnabledPtr(Id id) + inline bool* LRZDirWritePtr(Id id) { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kHiSEnabledOffset * m_cap) + + kLRZDirWriteOffset * m_cap) + static_cast(id) ; } - // `HiSEnabled(id)` retuns the `HiSEnabled` element of the object identified by `id` - inline bool HiSEnabled(Id id) const + // `LRZDirWrite(id)` retuns the `LRZDirWrite` element of the object identified by `id` + inline bool LRZDirWrite(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *HiSEnabledPtr(id); + return *LRZDirWritePtr(id); } - // `SetHiSEnabled(id,value)` sets the `HiSEnabled` element of the object identified by `id` - inline SOA& SetHiSEnabled(Id id, bool value) + // `SetLRZDirWrite(id,value)` sets the `LRZDirWrite` element of the object identified by `id` + inline SOA& SetLRZDirWrite(Id id, bool value) { DIVE_ASSERT(IsValidId(id)); - *HiSEnabledPtr(id) = value; - MarkFieldSet(id, kHiSEnabledIndex); + *LRZDirWritePtr(id) = value; + MarkFieldSet(id, kLRZDirWriteIndex); return static_cast(*this); } - inline bool IsHiSEnabledSet(Id id) const + inline bool IsLRZDirWriteSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kHiSEnabledIndex); + return IsFieldSet(id, kLRZDirWriteIndex); } - inline const char* GetHiSEnabledName() const { return "HiSEnabled"; } + inline const char* GetLRZDirWriteName() const { return "LRZDirWrite"; } - inline const char* GetHiSEnabledDescription() const + inline const char* GetLRZDirWriteDescription() const { - return "Whether Hi-S is enabled for stencil"; + return "Whether LRZ direction write is enabled"; } //----------------------------------------------- - // FIELD ZCompressEnabled: Whether plane compression is enabled for depth buffers. To reduce - // bandwidth impact + // FIELD ZTestMode: Depth test mode - // `ZCompressEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* ZCompressEnabledPtr() const + // `ZTestModePtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_ztest_mode* ZTestModePtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZCompressEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kZTestModeOffset * m_cap); } - inline bool* ZCompressEnabledPtr() + inline a6xx_ztest_mode* ZTestModePtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZCompressEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kZTestModeOffset * m_cap); } - // `ZCompressEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* ZCompressEnabledPtr(Id id) const + // `ZTestModePtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_ztest_mode* ZTestModePtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZCompressEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kZTestModeOffset * m_cap) + static_cast(id) ; } - inline bool* ZCompressEnabledPtr(Id id) + inline a6xx_ztest_mode* ZTestModePtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZCompressEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kZTestModeOffset * m_cap) + static_cast(id) ; } - // `ZCompressEnabled(id)` retuns the `ZCompressEnabled` element of the object identified by `id` - inline bool ZCompressEnabled(Id id) const + // `ZTestMode(id)` retuns the `ZTestMode` element of the object identified by `id` + inline a6xx_ztest_mode ZTestMode(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *ZCompressEnabledPtr(id); + return *ZTestModePtr(id); } - // `SetZCompressEnabled(id,value)` sets the `ZCompressEnabled` element of the object identified - // by `id` - inline SOA& SetZCompressEnabled(Id id, bool value) + // `SetZTestMode(id,value)` sets the `ZTestMode` element of the object identified by `id` + inline SOA& SetZTestMode(Id id, a6xx_ztest_mode value) { DIVE_ASSERT(IsValidId(id)); - *ZCompressEnabledPtr(id) = value; - MarkFieldSet(id, kZCompressEnabledIndex); + *ZTestModePtr(id) = value; + MarkFieldSet(id, kZTestModeIndex); return static_cast(*this); } - inline bool IsZCompressEnabledSet(Id id) const + inline bool IsZTestModeSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kZCompressEnabledIndex); + return IsFieldSet(id, kZTestModeIndex); } - inline const char* GetZCompressEnabledName() const { return "ZCompressEnabled"; } + inline const char* GetZTestModeName() const { return "ZTestMode"; } - inline const char* GetZCompressEnabledDescription() const - { - return "Whether plane compression is enabled for depth buffers. To reduce bandwidth impact"; - } + inline const char* GetZTestModeDescription() const { return "Depth test mode"; } //----------------------------------------------- - // FIELD StencilCompressEnabled: Whether compression is enabled for stencil buffers. To reduce - // bandwidth impact + // FIELD BinW: Bin width - // `StencilCompressEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* StencilCompressEnabledPtr() const + // `BinWPtr()` returns a shared pointer to an array of `size()` elements + inline const uint32_t* BinWPtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kStencilCompressEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinWOffset * m_cap); } - inline bool* StencilCompressEnabledPtr() + inline uint32_t* BinWPtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kStencilCompressEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinWOffset * m_cap); } - // `StencilCompressEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* StencilCompressEnabledPtr(Id id) const + // `BinWPtr()` returns a shared pointer to an array of `size()` elements + inline const uint32_t* BinWPtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kStencilCompressEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinWOffset * m_cap) + static_cast(id) ; } - inline bool* StencilCompressEnabledPtr(Id id) + inline uint32_t* BinWPtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kStencilCompressEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinWOffset * m_cap) + static_cast(id) ; } - // `StencilCompressEnabled(id)` retuns the `StencilCompressEnabled` element of the object - // identified by `id` - inline bool StencilCompressEnabled(Id id) const + // `BinW(id)` retuns the `BinW` element of the object identified by `id` + inline uint32_t BinW(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *StencilCompressEnabledPtr(id); + return *BinWPtr(id); } - // `SetStencilCompressEnabled(id,value)` sets the `StencilCompressEnabled` element of the object - // identified by `id` - inline SOA& SetStencilCompressEnabled(Id id, bool value) + // `SetBinW(id,value)` sets the `BinW` element of the object identified by `id` + inline SOA& SetBinW(Id id, uint32_t value) { DIVE_ASSERT(IsValidId(id)); - *StencilCompressEnabledPtr(id) = value; - MarkFieldSet(id, kStencilCompressEnabledIndex); + *BinWPtr(id) = value; + MarkFieldSet(id, kBinWIndex); return static_cast(*this); } - inline bool IsStencilCompressEnabledSet(Id id) const + inline bool IsBinWSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kStencilCompressEnabledIndex); + return IsFieldSet(id, kBinWIndex); } - inline const char* GetStencilCompressEnabledName() const { return "StencilCompressEnabled"; } + inline const char* GetBinWName() const { return "BinW"; } - inline const char* GetStencilCompressEnabledDescription() const - { - return "Whether compression is enabled for stencil buffers. To reduce bandwidth impact"; - } + inline const char* GetBinWDescription() const { return "Bin width"; } //----------------------------------------------- - // FIELD CompressedZFetchEnabled: Whether shader fetch of compressed depth buffers is enabled + // FIELD BinH: Bin Height - // `CompressedZFetchEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* CompressedZFetchEnabledPtr() const + // `BinHPtr()` returns a shared pointer to an array of `size()` elements + inline const uint32_t* BinHPtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kCompressedZFetchEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinHOffset * m_cap); } - inline bool* CompressedZFetchEnabledPtr() + inline uint32_t* BinHPtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kCompressedZFetchEnabledOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinHOffset * m_cap); } - // `CompressedZFetchEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* CompressedZFetchEnabledPtr(Id id) const + // `BinHPtr()` returns a shared pointer to an array of `size()` elements + inline const uint32_t* BinHPtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kCompressedZFetchEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinHOffset * m_cap) + static_cast(id) ; } - inline bool* CompressedZFetchEnabledPtr(Id id) + inline uint32_t* BinHPtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kCompressedZFetchEnabledOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBinHOffset * m_cap) + static_cast(id) ; } - // `CompressedZFetchEnabled(id)` retuns the `CompressedZFetchEnabled` element of the object - // identified by `id` - inline bool CompressedZFetchEnabled(Id id) const + // `BinH(id)` retuns the `BinH` element of the object identified by `id` + inline uint32_t BinH(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *CompressedZFetchEnabledPtr(id); + return *BinHPtr(id); } - // `SetCompressedZFetchEnabled(id,value)` sets the `CompressedZFetchEnabled` element of the - // object identified by `id` - inline SOA& SetCompressedZFetchEnabled(Id id, bool value) + // `SetBinH(id,value)` sets the `BinH` element of the object identified by `id` + inline SOA& SetBinH(Id id, uint32_t value) { DIVE_ASSERT(IsValidId(id)); - *CompressedZFetchEnabledPtr(id) = value; - MarkFieldSet(id, kCompressedZFetchEnabledIndex); + *BinHPtr(id) = value; + MarkFieldSet(id, kBinHIndex); return static_cast(*this); } - inline bool IsCompressedZFetchEnabledSet(Id id) const + inline bool IsBinHSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kCompressedZFetchEnabledIndex); + return IsFieldSet(id, kBinHIndex); } - inline const char* GetCompressedZFetchEnabledName() const { return "CompressedZFetchEnabled"; } + inline const char* GetBinHName() const { return "BinH"; } - inline const char* GetCompressedZFetchEnabledDescription() const - { - return "Whether shader fetch of compressed depth buffers is enabled"; - } + inline const char* GetBinHDescription() const { return "Bin Height"; } //----------------------------------------------- - // FIELD ZFormat: Internal GPU format of the depth buffer + // FIELD RenderMode: Whether in binning pass or rendering pass - // `ZFormatPtr()` returns a shared pointer to an array of `size()` elements - inline const Dive::Legacy::ZFormat* ZFormatPtr() const + // `RenderModePtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_render_mode* RenderModePtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZFormatOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kRenderModeOffset * m_cap); } - inline Dive::Legacy::ZFormat* ZFormatPtr() + inline a6xx_render_mode* RenderModePtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZFormatOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kRenderModeOffset * m_cap); } - // `ZFormatPtr()` returns a shared pointer to an array of `size()` elements - inline const Dive::Legacy::ZFormat* ZFormatPtr(Id id) const + // `RenderModePtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_render_mode* RenderModePtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZFormatOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kRenderModeOffset * m_cap) + static_cast(id) ; } - inline Dive::Legacy::ZFormat* ZFormatPtr(Id id) + inline a6xx_render_mode* RenderModePtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZFormatOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kRenderModeOffset * m_cap) + static_cast(id) ; } - // `ZFormat(id)` retuns the `ZFormat` element of the object identified by `id` - inline Dive::Legacy::ZFormat ZFormat(Id id) const + // `RenderMode(id)` retuns the `RenderMode` element of the object identified by `id` + inline a6xx_render_mode RenderMode(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *ZFormatPtr(id); + return *RenderModePtr(id); } - // `SetZFormat(id,value)` sets the `ZFormat` element of the object identified by `id` - inline SOA& SetZFormat(Id id, Dive::Legacy::ZFormat value) + // `SetRenderMode(id,value)` sets the `RenderMode` element of the object identified by `id` + inline SOA& SetRenderMode(Id id, a6xx_render_mode value) { DIVE_ASSERT(IsValidId(id)); - *ZFormatPtr(id) = value; - MarkFieldSet(id, kZFormatIndex); + *RenderModePtr(id) = value; + MarkFieldSet(id, kRenderModeIndex); return static_cast(*this); } - inline bool IsZFormatSet(Id id) const + inline bool IsRenderModeSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kZFormatIndex); + return IsFieldSet(id, kRenderModeIndex); } - inline const char* GetZFormatName() const { return "ZFormat"; } + inline const char* GetRenderModeName() const { return "RenderMode"; } - inline const char* GetZFormatDescription() const + inline const char* GetRenderModeDescription() const { - return "Internal GPU format of the depth buffer"; + return "Whether in binning pass or rendering pass"; } //----------------------------------------------- - // FIELD ZOrder: Indicates application preference for LateZ, EarlyZ, or ReZ + // FIELD BuffersLocation: Whether the target buffer is in GMEM or SYSMEM - // `ZOrderPtr()` returns a shared pointer to an array of `size()` elements - inline const Dive::Legacy::ZOrder* ZOrderPtr() const + // `BuffersLocationPtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_buffers_location* BuffersLocationPtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZOrderOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBuffersLocationOffset * m_cap); } - inline Dive::Legacy::ZOrder* ZOrderPtr() + inline a6xx_buffers_location* BuffersLocationPtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZOrderOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBuffersLocationOffset * m_cap); } - // `ZOrderPtr()` returns a shared pointer to an array of `size()` elements - inline const Dive::Legacy::ZOrder* ZOrderPtr(Id id) const + // `BuffersLocationPtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_buffers_location* BuffersLocationPtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZOrderOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBuffersLocationOffset * m_cap) + static_cast(id) ; } - inline Dive::Legacy::ZOrder* ZOrderPtr(Id id) + inline a6xx_buffers_location* BuffersLocationPtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kZOrderOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kBuffersLocationOffset * m_cap) + static_cast(id) ; } - // `ZOrder(id)` retuns the `ZOrder` element of the object identified by `id` - inline Dive::Legacy::ZOrder ZOrder(Id id) const + // `BuffersLocation(id)` retuns the `BuffersLocation` element of the object identified by `id` + inline a6xx_buffers_location BuffersLocation(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *ZOrderPtr(id); + return *BuffersLocationPtr(id); } - // `SetZOrder(id,value)` sets the `ZOrder` element of the object identified by `id` - inline SOA& SetZOrder(Id id, Dive::Legacy::ZOrder value) + // `SetBuffersLocation(id,value)` sets the `BuffersLocation` element of the object identified by + // `id` + inline SOA& SetBuffersLocation(Id id, a6xx_buffers_location value) { DIVE_ASSERT(IsValidId(id)); - *ZOrderPtr(id) = value; - MarkFieldSet(id, kZOrderIndex); + *BuffersLocationPtr(id) = value; + MarkFieldSet(id, kBuffersLocationIndex); return static_cast(*this); } - inline bool IsZOrderSet(Id id) const + inline bool IsBuffersLocationSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kZOrderIndex); + return IsFieldSet(id, kBuffersLocationIndex); } - inline const char* GetZOrderName() const { return "ZOrder"; } + inline const char* GetBuffersLocationName() const { return "BuffersLocation"; } - inline const char* GetZOrderDescription() const + inline const char* GetBuffersLocationDescription() const { - return "Indicates application preference for LateZ, EarlyZ, or ReZ"; + return "Whether the target buffer is in GMEM or SYSMEM"; } //----------------------------------------------- - // FIELD VSLateAlloc: Late VS wavefront allocation count. Value is the number of wavefronts - // minus one, since at least one VS wave can always launch with late alloc enabled + // FIELD ThreadSize: Whether the thread size is 64 or 128 - // `VSLateAllocPtr()` returns a shared pointer to an array of `size()` elements - inline const uint16_t* VSLateAllocPtr() const + // `ThreadSizePtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_threadsize* ThreadSizePtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVSLateAllocOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kThreadSizeOffset * m_cap); } - inline uint16_t* VSLateAllocPtr() + inline a6xx_threadsize* ThreadSizePtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVSLateAllocOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kThreadSizeOffset * m_cap); } - // `VSLateAllocPtr()` returns a shared pointer to an array of `size()` elements - inline const uint16_t* VSLateAllocPtr(Id id) const + // `ThreadSizePtr()` returns a shared pointer to an array of `size()` elements + inline const a6xx_threadsize* ThreadSizePtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVSLateAllocOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kThreadSizeOffset * m_cap) + static_cast(id) ; } - inline uint16_t* VSLateAllocPtr(Id id) + inline a6xx_threadsize* ThreadSizePtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVSLateAllocOffset * m_cap) + + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kThreadSizeOffset * m_cap) + static_cast(id) ; } - // `VSLateAlloc(id)` retuns the `VSLateAlloc` element of the object identified by `id` - inline uint16_t VSLateAlloc(Id id) const + // `ThreadSize(id)` retuns the `ThreadSize` element of the object identified by `id` + inline a6xx_threadsize ThreadSize(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *VSLateAllocPtr(id); + return *ThreadSizePtr(id); } - // `SetVSLateAlloc(id,value)` sets the `VSLateAlloc` element of the object identified by `id` - inline SOA& SetVSLateAlloc(Id id, uint16_t value) + // `SetThreadSize(id,value)` sets the `ThreadSize` element of the object identified by `id` + inline SOA& SetThreadSize(Id id, a6xx_threadsize value) { DIVE_ASSERT(IsValidId(id)); - *VSLateAllocPtr(id) = value; - MarkFieldSet(id, kVSLateAllocIndex); + *ThreadSizePtr(id) = value; + MarkFieldSet(id, kThreadSizeIndex); return static_cast(*this); } - inline bool IsVSLateAllocSet(Id id) const + inline bool IsThreadSizeSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kVSLateAllocIndex); + return IsFieldSet(id, kThreadSizeIndex); } - inline const char* GetVSLateAllocName() const { return "VSLateAlloc"; } + inline const char* GetThreadSizeName() const { return "ThreadSize"; } - inline const char* GetVSLateAllocDescription() const + inline const char* GetThreadSizeDescription() const { - return "Late VS wavefront allocation count. Value is the number of wavefronts minus one, " - "since at least one VS wave can always launch with late alloc enabled"; + return "Whether the thread size is 64 or 128"; } //----------------------------------------------- - // FIELD DccEnabled: Whether DCC-based bandwidth-saving color compression is enabled + // FIELD EnableAllHelperLanes: Whether all helper lanes are enabled of the 2x2 quad for fine + // derivatives - // `DccEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* DccEnabledPtr() const + // `EnableAllHelperLanesPtr()` returns a shared pointer to an array of `size()` elements + inline const bool* EnableAllHelperLanesPtr() const { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kDccEnabledOffset * m_cap); + kEnableAllHelperLanesOffset * m_cap); } - inline bool* DccEnabledPtr() + inline bool* EnableAllHelperLanesPtr() { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kDccEnabledOffset * m_cap); + kEnableAllHelperLanesOffset * m_cap); } - // `DccEnabledPtr()` returns a shared pointer to an array of `size()` elements - inline const bool* DccEnabledPtr(Id id, uint32_t attachment = 0) const + // `EnableAllHelperLanesPtr()` returns a shared pointer to an array of `size()` elements + inline const bool* EnableAllHelperLanesPtr(Id id) const { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kDccEnabledOffset * m_cap) + - static_cast(id) * 8 + attachment + kEnableAllHelperLanesOffset * m_cap) + + static_cast(id) ; } - inline bool* DccEnabledPtr(Id id, uint32_t attachment = 0) + inline bool* EnableAllHelperLanesPtr(Id id) { return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kDccEnabledOffset * m_cap) + - static_cast(id) * 8 + attachment + kEnableAllHelperLanesOffset * m_cap) + + static_cast(id) ; } - // `DccEnabled(id)` retuns the `DccEnabled` element of the object identified by `id` - inline bool DccEnabled(Id id, uint32_t attachment) const - { - DIVE_ASSERT(IsValidId(id)); - return *DccEnabledPtr(id, attachment); - } - - // `DccEnabled(id)` returns the array of values of the DccEnabled field of the object identified + // `EnableAllHelperLanes(id)` retuns the `EnableAllHelperLanes` element of the object identified // by `id` - inline DccEnabledArray DccEnabled(Id id) - { - return DccEnabledArray(static_cast(this), id); - } - inline DccEnabledConstArray DccEnabled(Id id) const - { - return DccEnabledConstArray(static_cast(this), id); - } - - // `SetDccEnabled(id,value)` sets the `DccEnabled` element of the object identified by `id` - inline SOA& SetDccEnabled(Id id, uint32_t attachment, bool value) - { - DIVE_ASSERT(IsValidId(id)); - *DccEnabledPtr(id, attachment) = value; - MarkFieldSet(id, kDccEnabledIndex + attachment); - return static_cast(*this); - } - - inline bool IsDccEnabledSet(Id id, uint32_t attachment) const - { - DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kDccEnabledIndex + attachment); - } - - inline const char* GetDccEnabledName() const { return "DccEnabled"; } - - inline const char* GetDccEnabledDescription() const - { - return "Whether DCC-based bandwidth-saving color compression is enabled"; - } - - //----------------------------------------------- - // FIELD ColorFormat: Per target attachment hardware color format - - // `ColorFormatPtr()` returns a shared pointer to an array of `size()` elements - inline const Dive::Legacy::ColorFormat* ColorFormatPtr() const - { - return reinterpret_cast( - reinterpret_cast(m_buffer.get()) + kColorFormatOffset * m_cap); - } - inline Dive::Legacy::ColorFormat* ColorFormatPtr() - { - return reinterpret_cast( - reinterpret_cast(m_buffer.get()) + kColorFormatOffset * m_cap); - } - // `ColorFormatPtr()` returns a shared pointer to an array of `size()` elements - inline const Dive::Legacy::ColorFormat* ColorFormatPtr(Id id, uint32_t attachment = 0) const - { - return reinterpret_cast( - reinterpret_cast(m_buffer.get()) + kColorFormatOffset * m_cap) + - static_cast(id) * 8 + attachment - - ; - } - inline Dive::Legacy::ColorFormat* ColorFormatPtr(Id id, uint32_t attachment = 0) - { - return reinterpret_cast( - reinterpret_cast(m_buffer.get()) + kColorFormatOffset * m_cap) + - static_cast(id) * 8 + attachment - - ; - } - // `ColorFormat(id)` retuns the `ColorFormat` element of the object identified by `id` - inline Dive::Legacy::ColorFormat ColorFormat(Id id, uint32_t attachment) const + inline bool EnableAllHelperLanes(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *ColorFormatPtr(id, attachment); + return *EnableAllHelperLanesPtr(id); } - // `ColorFormat(id)` returns the array of values of the ColorFormat field of the object + // `SetEnableAllHelperLanes(id,value)` sets the `EnableAllHelperLanes` element of the object // identified by `id` - inline ColorFormatArray ColorFormat(Id id) - { - return ColorFormatArray(static_cast(this), id); - } - inline ColorFormatConstArray ColorFormat(Id id) const - { - return ColorFormatConstArray(static_cast(this), id); - } - - // `SetColorFormat(id,value)` sets the `ColorFormat` element of the object identified by `id` - inline SOA& SetColorFormat(Id id, uint32_t attachment, Dive::Legacy::ColorFormat value) - { - DIVE_ASSERT(IsValidId(id)); - *ColorFormatPtr(id, attachment) = value; - MarkFieldSet(id, kColorFormatIndex + attachment); - return static_cast(*this); - } - - inline bool IsColorFormatSet(Id id, uint32_t attachment) const - { - DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kColorFormatIndex + attachment); - } - - inline const char* GetColorFormatName() const { return "ColorFormat"; } - - inline const char* GetColorFormatDescription() const - { - return "Per target attachment hardware color format"; - } - - //----------------------------------------------- - // FIELD Mip0Height: Per target attachment mip0 height - - // `Mip0HeightPtr()` returns a shared pointer to an array of `size()` elements - inline const uint32_t* Mip0HeightPtr() const - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0HeightOffset * m_cap); - } - inline uint32_t* Mip0HeightPtr() - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0HeightOffset * m_cap); - } - // `Mip0HeightPtr()` returns a shared pointer to an array of `size()` elements - inline const uint32_t* Mip0HeightPtr(Id id, uint32_t attachment = 0) const - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0HeightOffset * m_cap) + - static_cast(id) * 8 + attachment - - ; - } - inline uint32_t* Mip0HeightPtr(Id id, uint32_t attachment = 0) - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0HeightOffset * m_cap) + - static_cast(id) * 8 + attachment - - ; - } - // `Mip0Height(id)` retuns the `Mip0Height` element of the object identified by `id` - inline uint32_t Mip0Height(Id id, uint32_t attachment) const - { - DIVE_ASSERT(IsValidId(id)); - return *Mip0HeightPtr(id, attachment); - } - - // `Mip0Height(id)` returns the array of values of the Mip0Height field of the object identified - // by `id` - inline Mip0HeightArray Mip0Height(Id id) - { - return Mip0HeightArray(static_cast(this), id); - } - inline Mip0HeightConstArray Mip0Height(Id id) const - { - return Mip0HeightConstArray(static_cast(this), id); - } - - // `SetMip0Height(id,value)` sets the `Mip0Height` element of the object identified by `id` - inline SOA& SetMip0Height(Id id, uint32_t attachment, uint32_t value) - { - DIVE_ASSERT(IsValidId(id)); - *Mip0HeightPtr(id, attachment) = value; - MarkFieldSet(id, kMip0HeightIndex + attachment); - return static_cast(*this); - } - - inline bool IsMip0HeightSet(Id id, uint32_t attachment) const - { - DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kMip0HeightIndex + attachment); - } - - inline const char* GetMip0HeightName() const { return "Mip0Height"; } - - inline const char* GetMip0HeightDescription() const - { - return "Per target attachment mip0 height"; - } - - //----------------------------------------------- - // FIELD Mip0Width: Per target attachment mip0 width - - // `Mip0WidthPtr()` returns a shared pointer to an array of `size()` elements - inline const uint32_t* Mip0WidthPtr() const - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0WidthOffset * m_cap); - } - inline uint32_t* Mip0WidthPtr() - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0WidthOffset * m_cap); - } - // `Mip0WidthPtr()` returns a shared pointer to an array of `size()` elements - inline const uint32_t* Mip0WidthPtr(Id id, uint32_t attachment = 0) const - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0WidthOffset * m_cap) + - static_cast(id) * 8 + attachment - - ; - } - inline uint32_t* Mip0WidthPtr(Id id, uint32_t attachment = 0) - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kMip0WidthOffset * m_cap) + - static_cast(id) * 8 + attachment - - ; - } - // `Mip0Width(id)` retuns the `Mip0Width` element of the object identified by `id` - inline uint32_t Mip0Width(Id id, uint32_t attachment) const - { - DIVE_ASSERT(IsValidId(id)); - return *Mip0WidthPtr(id, attachment); - } - - // `Mip0Width(id)` returns the array of values of the Mip0Width field of the object identified - // by `id` - inline Mip0WidthArray Mip0Width(Id id) { return Mip0WidthArray(static_cast(this), id); } - inline Mip0WidthConstArray Mip0Width(Id id) const - { - return Mip0WidthConstArray(static_cast(this), id); - } - - // `SetMip0Width(id,value)` sets the `Mip0Width` element of the object identified by `id` - inline SOA& SetMip0Width(Id id, uint32_t attachment, uint32_t value) + inline SOA& SetEnableAllHelperLanes(Id id, bool value) { DIVE_ASSERT(IsValidId(id)); - *Mip0WidthPtr(id, attachment) = value; - MarkFieldSet(id, kMip0WidthIndex + attachment); + *EnableAllHelperLanesPtr(id) = value; + MarkFieldSet(id, kEnableAllHelperLanesIndex); return static_cast(*this); } - inline bool IsMip0WidthSet(Id id, uint32_t attachment) const + inline bool IsEnableAllHelperLanesSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kMip0WidthIndex + attachment); + return IsFieldSet(id, kEnableAllHelperLanesIndex); } - inline const char* GetMip0WidthName() const { return "Mip0Width"; } + inline const char* GetEnableAllHelperLanesName() const { return "EnableAllHelperLanes"; } - inline const char* GetMip0WidthDescription() const + inline const char* GetEnableAllHelperLanesDescription() const { - return "Per target attachment mip0 width"; + return "Whether all helper lanes are enabled of the 2x2 quad for fine derivatives"; } //----------------------------------------------- - // FIELD Vgpr: Per shader stage vector general purpose register count. Always rounded up to - // nearest multiple of 4. + // FIELD EnablePartialHelperLanes: Whether 3 out of 4 helper lanes are enabled of the 2x2 quad + // for coarse derivatives - // `VgprPtr()` returns a shared pointer to an array of `size()` elements - inline const uint16_t* VgprPtr() const + // `EnablePartialHelperLanesPtr()` returns a shared pointer to an array of `size()` elements + inline const bool* EnablePartialHelperLanesPtr() const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVgprOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kEnablePartialHelperLanesOffset * m_cap); } - inline uint16_t* VgprPtr() + inline bool* EnablePartialHelperLanesPtr() { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVgprOffset * m_cap); + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kEnablePartialHelperLanesOffset * m_cap); } - // `VgprPtr()` returns a shared pointer to an array of `size()` elements - inline const uint16_t* VgprPtr( - Id id, - Dive::ShaderStage stage = static_cast(0)) const + // `EnablePartialHelperLanesPtr()` returns a shared pointer to an array of `size()` elements + inline const bool* EnablePartialHelperLanesPtr(Id id) const { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVgprOffset * m_cap) + - static_cast(id) * Dive::kShaderStageCount + - static_cast(stage) + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kEnablePartialHelperLanesOffset * m_cap) + + static_cast(id) ; } - inline uint16_t* VgprPtr(Id id, Dive::ShaderStage stage = static_cast(0)) + inline bool* EnablePartialHelperLanesPtr(Id id) { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kVgprOffset * m_cap) + - static_cast(id) * Dive::kShaderStageCount + - static_cast(stage) + return reinterpret_cast(reinterpret_cast(m_buffer.get()) + + kEnablePartialHelperLanesOffset * m_cap) + + static_cast(id) ; } - // `Vgpr(id)` retuns the `Vgpr` element of the object identified by `id` - inline uint16_t Vgpr(Id id, Dive::ShaderStage stage) const + // `EnablePartialHelperLanes(id)` retuns the `EnablePartialHelperLanes` element of the object + // identified by `id` + inline bool EnablePartialHelperLanes(Id id) const { DIVE_ASSERT(IsValidId(id)); - return *VgprPtr(id, stage); - } - - // `Vgpr(id)` returns the array of values of the Vgpr field of the object identified by `id` - inline VgprArray Vgpr(Id id) { return VgprArray(static_cast(this), id); } - inline VgprConstArray Vgpr(Id id) const - { - return VgprConstArray(static_cast(this), id); + return *EnablePartialHelperLanesPtr(id); } - // `SetVgpr(id,value)` sets the `Vgpr` element of the object identified by `id` - inline SOA& SetVgpr(Id id, Dive::ShaderStage stage, uint16_t value) + // `SetEnablePartialHelperLanes(id,value)` sets the `EnablePartialHelperLanes` element of the + // object identified by `id` + inline SOA& SetEnablePartialHelperLanes(Id id, bool value) { DIVE_ASSERT(IsValidId(id)); - *VgprPtr(id, stage) = value; - MarkFieldSet(id, kVgprIndex + static_cast(stage)); + *EnablePartialHelperLanesPtr(id) = value; + MarkFieldSet(id, kEnablePartialHelperLanesIndex); return static_cast(*this); } - inline bool IsVgprSet(Id id, Dive::ShaderStage stage) const - { - DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kVgprIndex + static_cast(stage)); - } - - inline const char* GetVgprName() const { return "Vgpr"; } - - inline const char* GetVgprDescription() const - { - return "Per shader stage vector general purpose register count. Always rounded up to " - "nearest multiple of 4."; - } - - //----------------------------------------------- - // FIELD Sgpr: Per shader stage scalar general purpose register count. Always rounded up to - // nearest multiple of 16 - - // `SgprPtr()` returns a shared pointer to an array of `size()` elements - inline const uint16_t* SgprPtr() const - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kSgprOffset * m_cap); - } - inline uint16_t* SgprPtr() - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kSgprOffset * m_cap); - } - // `SgprPtr()` returns a shared pointer to an array of `size()` elements - inline const uint16_t* SgprPtr( - Id id, - Dive::ShaderStage stage = static_cast(0)) const - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kSgprOffset * m_cap) + - static_cast(id) * Dive::kShaderStageCount + - static_cast(stage) - - ; - } - inline uint16_t* SgprPtr(Id id, Dive::ShaderStage stage = static_cast(0)) - { - return reinterpret_cast(reinterpret_cast(m_buffer.get()) + - kSgprOffset * m_cap) + - static_cast(id) * Dive::kShaderStageCount + - static_cast(stage) - - ; - } - // `Sgpr(id)` retuns the `Sgpr` element of the object identified by `id` - inline uint16_t Sgpr(Id id, Dive::ShaderStage stage) const - { - DIVE_ASSERT(IsValidId(id)); - return *SgprPtr(id, stage); - } - - // `Sgpr(id)` returns the array of values of the Sgpr field of the object identified by `id` - inline SgprArray Sgpr(Id id) { return SgprArray(static_cast(this), id); } - inline SgprConstArray Sgpr(Id id) const - { - return SgprConstArray(static_cast(this), id); - } - - // `SetSgpr(id,value)` sets the `Sgpr` element of the object identified by `id` - inline SOA& SetSgpr(Id id, Dive::ShaderStage stage, uint16_t value) + inline bool IsEnablePartialHelperLanesSet(Id id) const { DIVE_ASSERT(IsValidId(id)); - *SgprPtr(id, stage) = value; - MarkFieldSet(id, kSgprIndex + static_cast(stage)); - return static_cast(*this); + return IsFieldSet(id, kEnablePartialHelperLanesIndex); } - inline bool IsSgprSet(Id id, Dive::ShaderStage stage) const + inline const char* GetEnablePartialHelperLanesName() const { - DIVE_ASSERT(IsValidId(id)); - return IsFieldSet(id, kSgprIndex + static_cast(stage)); + return "EnablePartialHelperLanes"; } - inline const char* GetSgprName() const { return "Sgpr"; } - - inline const char* GetSgprDescription() const + inline const char* GetEnablePartialHelperLanesDescription() const { - return "Per shader stage scalar general purpose register count. Always rounded up to " - "nearest multiple of 16"; + return "Whether 3 out of 4 helper lanes are enabled of the 2x2 quad for coarse derivatives"; } // `operator[]` returns a reference to an element identified by `id`. E.g.: @@ -8364,20 +7062,22 @@ template class EventStateInfoT "Field type aligment requirement cannot exceed kAlignment"); static constexpr uint32_t kLogicOpEnabledIndex = PARTIAL_INDEX_EventStateInfo; static constexpr size_t kLogicOpEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kLogicOpEnabledSize = sizeof(bool); + static constexpr size_t kLogicOpEnabledArrayCount = 8; + static constexpr size_t kLogicOpEnabledSize = sizeof(bool) * kLogicOpEnabledArrayCount; #undef PARTIAL_SIZE_EventStateInfo #define PARTIAL_SIZE_EventStateInfo kLogicOpEnabledOffset + kLogicOpEnabledSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kLogicOpEnabledIndex + 1 +#define PARTIAL_INDEX_EventStateInfo kLogicOpEnabledIndex + kLogicOpEnabledArrayCount static_assert(alignof(VkLogicOp) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); static constexpr uint32_t kLogicOpIndex = PARTIAL_INDEX_EventStateInfo; static constexpr size_t kLogicOpOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kLogicOpSize = sizeof(VkLogicOp); + static constexpr size_t kLogicOpArrayCount = 8; + static constexpr size_t kLogicOpSize = sizeof(VkLogicOp) * kLogicOpArrayCount; #undef PARTIAL_SIZE_EventStateInfo #define PARTIAL_SIZE_EventStateInfo kLogicOpOffset + kLogicOpSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kLogicOpIndex + 1 +#define PARTIAL_INDEX_EventStateInfo kLogicOpIndex + kLogicOpArrayCount static_assert(alignof(VkPipelineColorBlendAttachmentState) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); static constexpr uint32_t kAttachmentIndex = PARTIAL_INDEX_EventStateInfo; @@ -8399,157 +7099,114 @@ template class EventStateInfoT #define PARTIAL_SIZE_EventStateInfo kBlendConstantOffset + kBlendConstantSize #undef PARTIAL_INDEX_EventStateInfo #define PARTIAL_INDEX_EventStateInfo kBlendConstantIndex + kBlendConstantArrayCount - static_assert(alignof(uint64_t) <= kAlignment, - "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kZAddrIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kZAddrOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kZAddrSize = sizeof(uint64_t); -#undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kZAddrOffset + kZAddrSize -#undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kZAddrIndex + 1 - static_assert(alignof(uint64_t) <= kAlignment, - "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kHTileAddrIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kHTileAddrOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kHTileAddrSize = sizeof(uint64_t); -#undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kHTileAddrOffset + kHTileAddrSize -#undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kHTileAddrIndex + 1 - static_assert(alignof(bool) <= kAlignment, - "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kHiZEnabledIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kHiZEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kHiZEnabledSize = sizeof(bool); -#undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kHiZEnabledOffset + kHiZEnabledSize -#undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kHiZEnabledIndex + 1 static_assert(alignof(bool) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kHiSEnabledIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kHiSEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kHiSEnabledSize = sizeof(bool); + static constexpr uint32_t kLRZEnabledIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kLRZEnabledOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kLRZEnabledSize = sizeof(bool); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kHiSEnabledOffset + kHiSEnabledSize +#define PARTIAL_SIZE_EventStateInfo kLRZEnabledOffset + kLRZEnabledSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kHiSEnabledIndex + 1 +#define PARTIAL_INDEX_EventStateInfo kLRZEnabledIndex + 1 static_assert(alignof(bool) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kZCompressEnabledIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kZCompressEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kZCompressEnabledSize = sizeof(bool); + static constexpr uint32_t kLRZWriteIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kLRZWriteOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kLRZWriteSize = sizeof(bool); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kZCompressEnabledOffset + kZCompressEnabledSize +#define PARTIAL_SIZE_EventStateInfo kLRZWriteOffset + kLRZWriteSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kZCompressEnabledIndex + 1 - static_assert(alignof(bool) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kLRZWriteIndex + 1 + static_assert(alignof(a6xx_lrz_dir_status) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kStencilCompressEnabledIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kStencilCompressEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kStencilCompressEnabledSize = sizeof(bool); + static constexpr uint32_t kLRZDirStatusIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kLRZDirStatusOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kLRZDirStatusSize = sizeof(a6xx_lrz_dir_status); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kStencilCompressEnabledOffset + kStencilCompressEnabledSize +#define PARTIAL_SIZE_EventStateInfo kLRZDirStatusOffset + kLRZDirStatusSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kStencilCompressEnabledIndex + 1 +#define PARTIAL_INDEX_EventStateInfo kLRZDirStatusIndex + 1 static_assert(alignof(bool) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kCompressedZFetchEnabledIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kCompressedZFetchEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kCompressedZFetchEnabledSize = sizeof(bool); -#undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kCompressedZFetchEnabledOffset + kCompressedZFetchEnabledSize -#undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kCompressedZFetchEnabledIndex + 1 - static_assert(alignof(Dive::Legacy::ZFormat) <= kAlignment, - "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kZFormatIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kZFormatOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kZFormatSize = sizeof(Dive::Legacy::ZFormat); + static constexpr uint32_t kLRZDirWriteIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kLRZDirWriteOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kLRZDirWriteSize = sizeof(bool); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kZFormatOffset + kZFormatSize +#define PARTIAL_SIZE_EventStateInfo kLRZDirWriteOffset + kLRZDirWriteSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kZFormatIndex + 1 - static_assert(alignof(Dive::Legacy::ZOrder) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kLRZDirWriteIndex + 1 + static_assert(alignof(a6xx_ztest_mode) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kZOrderIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kZOrderOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kZOrderSize = sizeof(Dive::Legacy::ZOrder); + static constexpr uint32_t kZTestModeIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kZTestModeOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kZTestModeSize = sizeof(a6xx_ztest_mode); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kZOrderOffset + kZOrderSize +#define PARTIAL_SIZE_EventStateInfo kZTestModeOffset + kZTestModeSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kZOrderIndex + 1 - static_assert(alignof(uint16_t) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kZTestModeIndex + 1 + static_assert(alignof(uint32_t) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kVSLateAllocIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kVSLateAllocOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kVSLateAllocSize = sizeof(uint16_t); + static constexpr uint32_t kBinWIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kBinWOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kBinWSize = sizeof(uint32_t); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kVSLateAllocOffset + kVSLateAllocSize +#define PARTIAL_SIZE_EventStateInfo kBinWOffset + kBinWSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kVSLateAllocIndex + 1 - static_assert(alignof(bool) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kBinWIndex + 1 + static_assert(alignof(uint32_t) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kDccEnabledIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kDccEnabledOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kDccEnabledArrayCount = 8; - static constexpr size_t kDccEnabledSize = sizeof(bool) * kDccEnabledArrayCount; + static constexpr uint32_t kBinHIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kBinHOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kBinHSize = sizeof(uint32_t); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kDccEnabledOffset + kDccEnabledSize +#define PARTIAL_SIZE_EventStateInfo kBinHOffset + kBinHSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kDccEnabledIndex + kDccEnabledArrayCount - static_assert(alignof(Dive::Legacy::ColorFormat) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kBinHIndex + 1 + static_assert(alignof(a6xx_render_mode) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kColorFormatIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kColorFormatOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kColorFormatArrayCount = 8; - static constexpr size_t kColorFormatSize = sizeof(Dive::Legacy::ColorFormat) * - kColorFormatArrayCount; + static constexpr uint32_t kRenderModeIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kRenderModeOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kRenderModeSize = sizeof(a6xx_render_mode); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kColorFormatOffset + kColorFormatSize +#define PARTIAL_SIZE_EventStateInfo kRenderModeOffset + kRenderModeSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kColorFormatIndex + kColorFormatArrayCount - static_assert(alignof(uint32_t) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kRenderModeIndex + 1 + static_assert(alignof(a6xx_buffers_location) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kMip0HeightIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kMip0HeightOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kMip0HeightArrayCount = 8; - static constexpr size_t kMip0HeightSize = sizeof(uint32_t) * kMip0HeightArrayCount; + static constexpr uint32_t kBuffersLocationIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kBuffersLocationOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kBuffersLocationSize = sizeof(a6xx_buffers_location); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kMip0HeightOffset + kMip0HeightSize +#define PARTIAL_SIZE_EventStateInfo kBuffersLocationOffset + kBuffersLocationSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kMip0HeightIndex + kMip0HeightArrayCount - static_assert(alignof(uint32_t) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kBuffersLocationIndex + 1 + static_assert(alignof(a6xx_threadsize) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kMip0WidthIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kMip0WidthOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kMip0WidthArrayCount = 8; - static constexpr size_t kMip0WidthSize = sizeof(uint32_t) * kMip0WidthArrayCount; + static constexpr uint32_t kThreadSizeIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kThreadSizeOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kThreadSizeSize = sizeof(a6xx_threadsize); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kMip0WidthOffset + kMip0WidthSize +#define PARTIAL_SIZE_EventStateInfo kThreadSizeOffset + kThreadSizeSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kMip0WidthIndex + kMip0WidthArrayCount - static_assert(alignof(uint16_t) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kThreadSizeIndex + 1 + static_assert(alignof(bool) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kVgprIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kVgprOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kVgprArrayCount = Dive::kShaderStageCount; - static constexpr size_t kVgprSize = sizeof(uint16_t) * kVgprArrayCount; + static constexpr uint32_t kEnableAllHelperLanesIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kEnableAllHelperLanesOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kEnableAllHelperLanesSize = sizeof(bool); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kVgprOffset + kVgprSize +#define PARTIAL_SIZE_EventStateInfo kEnableAllHelperLanesOffset + kEnableAllHelperLanesSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kVgprIndex + kVgprArrayCount - static_assert(alignof(uint16_t) <= kAlignment, +#define PARTIAL_INDEX_EventStateInfo kEnableAllHelperLanesIndex + 1 + static_assert(alignof(bool) <= kAlignment, "Field type aligment requirement cannot exceed kAlignment"); - static constexpr uint32_t kSgprIndex = PARTIAL_INDEX_EventStateInfo; - static constexpr size_t kSgprOffset = PARTIAL_SIZE_EventStateInfo; - static constexpr size_t kSgprArrayCount = Dive::kShaderStageCount; - static constexpr size_t kSgprSize = sizeof(uint16_t) * kSgprArrayCount; + static constexpr uint32_t kEnablePartialHelperLanesIndex = PARTIAL_INDEX_EventStateInfo; + static constexpr size_t kEnablePartialHelperLanesOffset = PARTIAL_SIZE_EventStateInfo; + static constexpr size_t kEnablePartialHelperLanesSize = sizeof(bool); #undef PARTIAL_SIZE_EventStateInfo -#define PARTIAL_SIZE_EventStateInfo kSgprOffset + kSgprSize +#define PARTIAL_SIZE_EventStateInfo kEnablePartialHelperLanesOffset + kEnablePartialHelperLanesSize #undef PARTIAL_INDEX_EventStateInfo -#define PARTIAL_INDEX_EventStateInfo kSgprIndex + kSgprArrayCount +#define PARTIAL_INDEX_EventStateInfo kEnablePartialHelperLanesIndex + 1 // Number of bytes required to store each element static constexpr size_t kElemSize = PARTIAL_SIZE_EventStateInfo; @@ -8621,22 +7278,18 @@ template class EventStateInfoT VkLogicOp* DBG_logic_op; VkPipelineColorBlendAttachmentState* DBG_attachment; float* DBG_blend_constant; - uint64_t* DBG_z_addr; - uint64_t* DBG_h_tile_addr; - bool* DBG_hi_z_enabled; - bool* DBG_hi_s_enabled; - bool* DBG_z_compress_enabled; - bool* DBG_stencil_compress_enabled; - bool* DBG_compressed_z_fetch_enabled; - Dive::Legacy::ZFormat* DBG_z_format; - Dive::Legacy::ZOrder* DBG_z_order; - uint16_t* DBG_vs_late_alloc; - bool* DBG_dcc_enabled; - Dive::Legacy::ColorFormat* DBG_color_format; - uint32_t* DBG_mip0_height; - uint32_t* DBG_mip0_width; - uint16_t* DBG_vgpr; - uint16_t* DBG_sgpr; + bool* DBG_lrz_enabled; + bool* DBG_lrz_write; + a6xx_lrz_dir_status* DBG_lrz_dir_status; + bool* DBG_lrz_dir_write; + a6xx_ztest_mode* DBG_z_test_mode; + uint32_t* DBG_bin_w; + uint32_t* DBG_bin_h; + a6xx_render_mode* DBG_render_mode; + a6xx_buffers_location* DBG_buffers_location; + a6xx_threadsize* DBG_thread_size; + bool* DBG_enable_all_helper_lanes; + bool* DBG_enable_partial_helper_lanes; #endif }; class EventStateInfoRef; @@ -8654,22 +7307,14 @@ struct EventStateInfo_CONFIG using ViewportConstArray = EventStateInfoViewportConstArray; using ScissorArray = EventStateInfoScissorArray; using ScissorConstArray = EventStateInfoScissorConstArray; + using LogicOpEnabledArray = EventStateInfoLogicOpEnabledArray; + using LogicOpEnabledConstArray = EventStateInfoLogicOpEnabledConstArray; + using LogicOpArray = EventStateInfoLogicOpArray; + using LogicOpConstArray = EventStateInfoLogicOpConstArray; using AttachmentArray = EventStateInfoAttachmentArray; using AttachmentConstArray = EventStateInfoAttachmentConstArray; using BlendConstantArray = EventStateInfoBlendConstantArray; using BlendConstantConstArray = EventStateInfoBlendConstantConstArray; - using DccEnabledArray = EventStateInfoDccEnabledArray; - using DccEnabledConstArray = EventStateInfoDccEnabledConstArray; - using ColorFormatArray = EventStateInfoColorFormatArray; - using ColorFormatConstArray = EventStateInfoColorFormatConstArray; - using Mip0HeightArray = EventStateInfoMip0HeightArray; - using Mip0HeightConstArray = EventStateInfoMip0HeightConstArray; - using Mip0WidthArray = EventStateInfoMip0WidthArray; - using Mip0WidthConstArray = EventStateInfoMip0WidthConstArray; - using VgprArray = EventStateInfoVgprArray; - using VgprConstArray = EventStateInfoVgprConstArray; - using SgprArray = EventStateInfoSgprArray; - using SgprConstArray = EventStateInfoSgprConstArray; }; template<> void EventStateInfoRefT::assign( diff --git a/dive_core/event_state.json b/dive_core/event_state.json index 084c68a49..8c9c3c031 100644 --- a/dive_core/event_state.json +++ b/dive_core/event_state.json @@ -2,11 +2,12 @@ "header": { "path": "dive_core/event_state.h", "includes": [ + "adreno.h", "common.h", + "dive_core/common/gpudefs.h", "info_id.h", "struct_of_arrays.h", - "dive_core/common/gpudefs.h", - "third_party/Vulkan-Headers/include/vulkan/vulkan.h", + "third_party/Vulkan-Headers/include/vulkan/vulkan.h" ], "options": [ "isSet", @@ -230,13 +231,25 @@ "name": "LogicOpEnabled", "ty": "bool", "category": "Color Blend", - "desc": "Whether to apply Logical Operations" + "desc": "Whether to apply Logical Operations", + "array_dims": [ + { + "name": "attachment", + "count": "8" + } + ] }, { "name": "LogicOp", "ty": "VkLogicOp", "category": "Color Blend", - "desc": "Which logical operation to apply" + "desc": "Which logical operation to apply", + "array_dims": [ + { + "name": "attachment", + "count": "8" + } + ] }, { "name": "Attachment", @@ -262,139 +275,77 @@ } ] }, - { - "name": "ZAddr", - "ty": "uint64_t", - "category": "GPU-specific", - "desc": "The read and write VA of depth buffer (assumed to be same)" - }, - { - "name": "HTileAddr", - "ty": "uint64_t", - "category": "GPU-specific", - "desc": "VA of DB's HTile buffer" - }, - { - "name": "HiZEnabled", + { + "name": "LRZEnabled", "ty": "bool", "category": "GPU-specific", - "desc": "Whether Hi-Z is enabled for depth" + "desc": "Whether LRZ is enabled for depth" }, - { - "name": "HiSEnabled", + { + "name": "LRZWrite", "ty": "bool", "category": "GPU-specific", - "desc": "Whether Hi-S is enabled for stencil" + "desc": "Whether LRZ write is enabled" }, { - "name": "ZCompressEnabled", - "ty": "bool", + "name": "LRZDirStatus", + "ty": "a6xx_lrz_dir_status", "category": "GPU-specific", - "desc": "Whether plane compression is enabled for depth buffers. To reduce bandwidth impact" + "desc": "LRZ direction" }, - { - "name": "StencilCompressEnabled", + { + "name": "LRZDirWrite", "ty": "bool", "category": "GPU-specific", - "desc": "Whether compression is enabled for stencil buffers. To reduce bandwidth impact" + "desc": "Whether LRZ direction write is enabled" }, { - "name": "CompressedZFetchEnabled", - "ty": "bool", + "name": "ZTestMode", + "ty": "a6xx_ztest_mode", "category": "GPU-specific", - "desc": "Whether shader fetch of compressed depth buffers is enabled" + "desc": "Depth test mode" }, { - "name": "ZFormat", - "ty": "Dive::Legacy::ZFormat", + "name": "BinW", + "ty": "uint32_t", "category": "GPU-specific", - "desc": "Internal GPU format of the depth buffer" + "desc": "Bin width" }, { - "name": "ZOrder", - "ty": "Dive::Legacy::ZOrder", + "name": "BinH", + "ty": "uint32_t", "category": "GPU-specific", - "desc": "Indicates application preference for LateZ, EarlyZ, or ReZ" + "desc": "Bin Height" }, { - "name": "VSLateAlloc", - "ty": "uint16_t", + "name": "RenderMode", + "ty": "a6xx_render_mode", "category": "GPU-specific", - "desc": "Late VS wavefront allocation count. Value is the number of wavefronts minus one, since at least one VS wave can always launch with late alloc enabled" + "desc": "Whether in binning pass or rendering pass" }, { - "name": "DccEnabled", - "ty": "bool", + "name": "BuffersLocation", + "ty": "a6xx_buffers_location", "category": "GPU-specific", - "desc": "Whether DCC-based bandwidth-saving color compression is enabled", - "array_dims": [ - { - "name": "attachment", - "count": "8" - } - ] + "desc": "Whether the target buffer is in GMEM or SYSMEM" }, { - "name": "ColorFormat", - "ty": "Dive::Legacy::ColorFormat", + "name": "ThreadSize", + "ty": "a6xx_threadsize", "category": "GPU-specific", - "desc": "Per target attachment hardware color format", - "array_dims": [ - { - "name": "attachment", - "count": "8" - } - ] - }, - { - "name": "Mip0Height", - "ty": "uint32_t", - "category": "GPU-specific", - "desc": "Per target attachment mip0 height", - "array_dims": [ - { - "name": "attachment", - "count": "8" - } - ] + "desc": "Whether the thread size is 64 or 128" }, { - "name": "Mip0Width", - "ty": "uint32_t", - "category": "GPU-specific", - "desc": "Per target attachment mip0 width", - "array_dims": [ - { - "name": "attachment", - "count": "8" - } - ] - }, - { - "name": "Vgpr", - "ty": "uint16_t", + "name": "EnableAllHelperLanes", + "ty": "bool", "category": "GPU-specific", - "desc": "Per shader stage vector general purpose register count. Always rounded up to nearest multiple of 4.", - "array_dims": [ - { - "name": "stage", - "ty": "Dive::ShaderStage", - "count": "Dive::kShaderStageCount" - } - ] + "desc": "Whether all helper lanes are enabled of the 2x2 quad for fine derivatives" }, - { - "name": "Sgpr", - "ty": "uint16_t", + { + "name": "EnablePartialHelperLanes", + "ty": "bool", "category": "GPU-specific", - "desc": "Per shader stage scalar general purpose register count. Always rounded up to nearest multiple of 16", - "array_dims": [ - { - "name": "stage", - "ty": "Dive::ShaderStage", - "count": "Dive::kShaderStageCount" - } - ] + "desc": "Whether 3 out of 4 helper lanes are enabled of the 2x2 quad for coarse derivatives" } ] } diff --git a/dive_core/event_state.natvis b/dive_core/event_state.natvis index 32077d19b..d6f92d10d 100644 --- a/dive_core/event_state.natvis +++ b/dive_core/event_state.natvis @@ -269,7 +269,9 @@ - m_size + Forward + 2 + $i == 0 ? m_size : 8 ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_cap)) @@ -277,7 +279,9 @@ - m_size + Forward + 2 + $i == 0 ? m_size : 8 ((VkLogicOp*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_cap)) @@ -302,143 +306,99 @@ - + m_size - ((uint64_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kZAddrOffset * m_cap)) + ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kLRZEnabledOffset * m_cap)) - + m_size - ((uint64_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kHTileAddrOffset * m_cap)) + ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kLRZWriteOffset * m_cap)) - + m_size - ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kHiZEnabledOffset * m_cap)) + ((a6xx_lrz_dir_status*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirStatusOffset * m_cap)) - + m_size - ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kHiSEnabledOffset * m_cap)) + ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirWriteOffset * m_cap)) - + m_size - ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kZCompressEnabledOffset * m_cap)) + ((a6xx_ztest_mode*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kZTestModeOffset * m_cap)) - + m_size - ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kStencilCompressEnabledOffset * m_cap)) + ((uint32_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kBinWOffset * m_cap)) - + m_size - ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kCompressedZFetchEnabledOffset * m_cap)) + ((uint32_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kBinHOffset * m_cap)) - + m_size - ((Pal::Gfx9::Chip::ZFormat*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kZFormatOffset * m_cap)) + ((a6xx_render_mode*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kRenderModeOffset * m_cap)) - + m_size - ((Pal::Gfx9::Chip::ZOrder*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kZOrderOffset * m_cap)) + ((a6xx_buffers_location*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kBuffersLocationOffset * m_cap)) - + m_size - ((uint16_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kVSLateAllocOffset * m_cap)) - - - - - - - Forward - 2 - $i == 0 ? m_size : 8 - ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kDccEnabledOffset * m_cap)) - - - - - - - Forward - 2 - $i == 0 ? m_size : 8 - ((Pal::Gfx9::Chip::ColorFormat*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kColorFormatOffset * m_cap)) - - - - - - - Forward - 2 - $i == 0 ? m_size : 8 - ((uint32_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kMip0HeightOffset * m_cap)) - - - - - - - Forward - 2 - $i == 0 ? m_size : 8 - ((uint32_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kMip0WidthOffset * m_cap)) + ((a6xx_threadsize*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kThreadSizeOffset * m_cap)) - + - Forward - 2 - $i == 0 ? m_size : Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kVgprOffset * m_cap)) + m_size + ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kEnableAllHelperLanesOffset * m_cap)) - + - Forward - 2 - $i == 0 ? m_size : Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kSgprOffset * m_cap)) + m_size + ((bool*)(((uint8_t*)m_buffer._Mypair._Myval2) + EventStateInfo::kEnablePartialHelperLanesOffset * m_cap)) @@ -550,122 +510,82 @@ ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMaxDepthBoundsOffset * m_obj_ptr->m_cap))[m_id.m_id] - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap))[m_id.m_id] - - + Forward 1 8 - ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - - - - - - - Forward - 1 - 4 - ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpEnabledArrayCount - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHTileAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiSEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kStencilCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kCompressedZFetchEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZFormatOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZOrder*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZOrderOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVSLateAllocOffset * m_obj_ptr->m_cap))[m_id.m_id] - - + Forward 1 8 - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kDccEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kDccEnabledArrayCount + ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpArrayCount - - - - Forward - 1 - 8 - ((Pal::Gfx9::Chip::ColorFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kColorFormatOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kColorFormatArrayCount - - - - - - - Forward - 1 - 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0HeightOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0HeightArrayCount - - - - + Forward 1 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0WidthOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0WidthArrayCount - - - - - - - Forward - 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kVgprArrayCount + ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - + Forward 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kSgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kSgprArrayCount + 4 + ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_lrz_dir_status*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirStatusOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_ztest_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZTestModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinWOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinHOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_render_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kRenderModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_buffers_location*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBuffersLocationOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_threadsize*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kThreadSizeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnableAllHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnablePartialHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + @@ -775,122 +695,82 @@ ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMaxDepthBoundsOffset * m_obj_ptr->m_cap))[m_id.m_id] - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap))[m_id.m_id] - - + Forward 1 8 - ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpEnabledArrayCount - - - - Forward - 1 - 4 - ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount - - - - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHTileAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiSEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kStencilCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kCompressedZFetchEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZFormatOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZOrder*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZOrderOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVSLateAllocOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - - - Forward - 1 - 8 - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kDccEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kDccEnabledArrayCount - - - - + Forward 1 8 - ((Pal::Gfx9::Chip::ColorFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kColorFormatOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kColorFormatArrayCount + ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpArrayCount - - - - Forward - 1 - 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0HeightOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0HeightArrayCount - - - - + Forward 1 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0WidthOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0WidthArrayCount - - - - - - - Forward - 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kVgprArrayCount + ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - + Forward 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kSgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kSgprArrayCount + 4 + ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_lrz_dir_status*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirStatusOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_ztest_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZTestModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinWOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinHOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_render_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kRenderModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_buffers_location*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBuffersLocationOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_threadsize*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kThreadSizeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnableAllHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnablePartialHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + @@ -1000,122 +880,82 @@ ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMaxDepthBoundsOffset * m_obj_ptr->m_cap))[m_id.m_id] - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - - - Forward - 1 - 8 - ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - - - - - - - Forward - 1 - 4 - ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount - - - - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHTileAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiSEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kStencilCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kCompressedZFetchEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZFormatOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZOrder*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZOrderOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVSLateAllocOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - - - Forward - 1 - 8 - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kDccEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kDccEnabledArrayCount - - - - + Forward 1 8 - ((Pal::Gfx9::Chip::ColorFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kColorFormatOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kColorFormatArrayCount + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpEnabledArrayCount - + Forward 1 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0HeightOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0HeightArrayCount + ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpArrayCount - + Forward 1 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0WidthOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0WidthArrayCount - - - - - - - Forward - 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kVgprArrayCount + ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - + Forward 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kSgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kSgprArrayCount + 4 + ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_lrz_dir_status*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirStatusOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_ztest_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZTestModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinWOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinHOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_render_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kRenderModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_buffers_location*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBuffersLocationOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_threadsize*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kThreadSizeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnableAllHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnablePartialHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + @@ -1225,122 +1065,82 @@ ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMaxDepthBoundsOffset * m_obj_ptr->m_cap))[m_id.m_id] - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap))[m_id.m_id] - - + Forward 1 8 - ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - - - - - - - Forward - 1 - 4 - ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpEnabledArrayCount - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint64_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHTileAddrOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kHiSEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kStencilCompressEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kCompressedZFetchEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZFormatOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((Pal::Gfx9::Chip::ZOrder*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZOrderOffset * m_obj_ptr->m_cap))[m_id.m_id] - - - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVSLateAllocOffset * m_obj_ptr->m_cap))[m_id.m_id] - - + Forward 1 8 - ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kDccEnabledOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kDccEnabledArrayCount + ((VkLogicOp*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLogicOpOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kLogicOpArrayCount - - - - Forward - 1 - 8 - ((Pal::Gfx9::Chip::ColorFormat*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kColorFormatOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kColorFormatArrayCount - - - - - - - Forward - 1 - 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0HeightOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0HeightArrayCount - - - - + Forward 1 8 - ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kMip0WidthOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kMip0WidthArrayCount - - - - - - - Forward - 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kVgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kVgprArrayCount + ((VkPipelineColorBlendAttachmentState*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kAttachmentOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kAttachmentArrayCount - + Forward 1 - Dive::kShaderStageCount - ((uint16_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kSgprOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kSgprArrayCount + 4 + ((float*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBlendConstantOffset * m_obj_ptr->m_cap)) + m_id.m_id * EventStateInfo::kBlendConstantArrayCount + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZEnabledOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_lrz_dir_status*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirStatusOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kLRZDirWriteOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_ztest_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kZTestModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinWOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((uint32_t*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBinHOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_render_mode*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kRenderModeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_buffers_location*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kBuffersLocationOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((a6xx_threadsize*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kThreadSizeOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnableAllHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + + + ((bool*)(((uint8_t*)m_obj_ptr->m_buffer._Mypair._Myval2) + EventStateInfo::kEnablePartialHelperLanesOffset * m_obj_ptr->m_cap))[m_id.m_id] + diff --git a/dive_core/generateAdrenoHeader.py b/dive_core/generateAdrenoHeader.py index 25c2e9aad..1ee829bfa 100644 --- a/dive_core/generateAdrenoHeader.py +++ b/dive_core/generateAdrenoHeader.py @@ -184,8 +184,7 @@ def outputPacketRegs(pm4_info_file, reg_list, prefix, domain): # --------------------------------------------------------------------------------------- -def outputBitfields(pm4_info_file, bitfields, extra_front_tab_str): - cur_offset = 0 +def outputBitfields(pm4_info_file, bitfields, extra_front_tab_str, cur_offset): for bitfield in bitfields: if bitfield.tag == '{http://nouveau.freedesktop.org/}doc': continue @@ -222,6 +221,7 @@ def outputBitfields(pm4_info_file, bitfields, extra_front_tab_str): pm4_info_file.write(extra_front_tab_str + "\t\t%s %s : %d;\n" % (bitfield_type, bitfield_name, bitfield_width)) cur_offset = bitfield_start + bitfield_width + return cur_offset # --------------------------------------------------------------------------------------- def outputRegUnions(pm4_info_file, a6xx_domain, name, reg, for_pm4, postfix): @@ -236,6 +236,7 @@ def outputRegUnions(pm4_info_file, a6xx_domain, name, reg, for_pm4, postfix): type = None use_bitset_as_type = False + cur_bitfield_offset = 0 if 'type' in reg.attrib: type = reg.attrib['type'] if type: @@ -257,7 +258,7 @@ def outputRegUnions(pm4_info_file, a6xx_domain, name, reg, for_pm4, postfix): pm4_info_file.write(extra_front_tab_str + "\tstruct\n") pm4_info_file.write(extra_front_tab_str + "\t{\n") - outputBitfields(pm4_info_file, bitset, extra_front_tab_str) + cur_bitfield_offset = outputBitfields(pm4_info_file, bitset, extra_front_tab_str, cur_bitfield_offset) bitfields = reg.findall('{http://nouveau.freedesktop.org/}bitfield') # This handles the case where bitfields is used to extend bitset type, see SP_VS_CTRL_REG0 @@ -265,7 +266,7 @@ def outputRegUnions(pm4_info_file, a6xx_domain, name, reg, for_pm4, postfix): if not use_bitset_as_type: pm4_info_file.write(extra_front_tab_str + "\tstruct\n") pm4_info_file.write(extra_front_tab_str + "\t{\n") - outputBitfields(pm4_info_file, bitfields, extra_front_tab_str) + cur_bitfield_offset = outputBitfields(pm4_info_file, bitfields, extra_front_tab_str, cur_bitfield_offset) if use_bitset_as_type or bitfields: pm4_info_file.write(extra_front_tab_str + "\t}bitfields" + postfix + ";\n\n") diff --git a/dive_core/generateSOAs.py b/dive_core/generateSOAs.py index db3278102..cb5277577 100644 --- a/dive_core/generateSOAs.py +++ b/dive_core/generateSOAs.py @@ -94,15 +94,14 @@ def clang_format(path: str) -> None: if 'CLANG_FORMAT' in os.environ: clang_format_path = os.environ['CLANG_FORMAT'] else: - clang_format_path = shutil.which("clang-format-7.0.1") or \ - shutil.which("clang-format-7") or \ + clang_format_path = shutil.which("clang-format-14") or \ shutil.which("clang-format") if not clang_format_path or not os.path.isfile(clang_format_path): raise (Exception("Could not find clang-format")) res = subprocess.run([clang_format_path, "--version"], capture_output=True, check=True) - if not res.stdout.decode('utf-8').startswith("clang-format version 7"): + if not res.stdout.decode('utf-8').startswith("clang-format version 14"): raise (Exception("Incorrect clang-format version")) subprocess.run([clang_format_path, "-i", path], check=True) diff --git a/pydive/py_event_statecpp b/pydive/py_event_statecpp index 1c68ccf06..7cda9a80a 100644 --- a/pydive/py_event_statecpp +++ b/pydive/py_event_statecpp @@ -179,13 +179,13 @@ void py_event_state(py::module &m) { , reinterpret_cast::type*>(self.MaxDepthBoundsPtr())); }) .def("logic_op_enabled", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} + return py::array_t::type>({ self.size(), 8}, { + sizeof(numpy_type::type)* 8, sizeof(numpy_type::type)* 8} , reinterpret_cast::type*>(self.LogicOpEnabledPtr())); }) .def("logic_op", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} + return py::array_t::type>({ self.size(), 8}, { + sizeof(numpy_type::type)* 8, sizeof(numpy_type::type)* 8} , reinterpret_cast::type*>(self.LogicOpPtr())); }) .def("attachment", [](const EventStateInfo &self) { @@ -198,85 +198,65 @@ void py_event_state(py::module &m) { sizeof(numpy_type::type)* 4, sizeof(numpy_type::type)* 4} , reinterpret_cast::type*>(self.BlendConstantPtr())); }) - .def("z_addr", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZAddrPtr())); - }) - .def("h_tile_addr", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.HTileAddrPtr())); - }) - .def("hi_z_enabled", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.HiZEnabledPtr())); - }) - .def("hi_s_enabled", [](const EventStateInfo &self) { + .def("lrz_enabled", [](const EventStateInfo &self) { return py::array_t::type>({ self.size()}, { sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.HiSEnabledPtr())); + , reinterpret_cast::type*>(self.LRZEnabledPtr())); }) - .def("z_compress_enabled", [](const EventStateInfo &self) { + .def("lrz_write", [](const EventStateInfo &self) { return py::array_t::type>({ self.size()}, { sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZCompressEnabledPtr())); + , reinterpret_cast::type*>(self.LRZWritePtr())); }) - .def("stencil_compress_enabled", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.StencilCompressEnabledPtr())); + .def("lrz_dir_status", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.LRZDirStatusPtr())); }) - .def("compressed_z_fetch_enabled", [](const EventStateInfo &self) { + .def("lrz_dir_write", [](const EventStateInfo &self) { return py::array_t::type>({ self.size()}, { sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.CompressedZFetchEnabledPtr())); - }) - .def("z_format", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZFormatPtr())); + , reinterpret_cast::type*>(self.LRZDirWritePtr())); }) - .def("z_order", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZOrderPtr())); + .def("z_test_mode", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.ZTestModePtr())); }) - .def("vs_late_alloc", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.VSLateAllocPtr())); + .def("bin_w", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.BinWPtr())); }) - .def("dcc_enabled", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size(), 8}, { - sizeof(numpy_type::type)* 8, sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.DccEnabledPtr())); + .def("bin_h", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.BinHPtr())); }) - .def("color_format", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size(), 8}, { - sizeof(numpy_type::type)* 8, sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.ColorFormatPtr())); + .def("render_mode", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.RenderModePtr())); }) - .def("mip0_height", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size(), 8}, { - sizeof(numpy_type::type)* 8, sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.Mip0HeightPtr())); + .def("buffers_location", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.BuffersLocationPtr())); }) - .def("mip0_width", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size(), 8}, { - sizeof(numpy_type::type)* 8, sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.Mip0WidthPtr())); + .def("thread_size", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.ThreadSizePtr())); }) - .def("vgpr", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size(), Dive::kShaderStageCount}, { - sizeof(numpy_type::type)* Dive::kShaderStageCount, sizeof(numpy_type::type)* Dive::kShaderStageCount} - , reinterpret_cast::type*>(self.VgprPtr())); + .def("enable_all_helper_lanes", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.EnableAllHelperLanesPtr())); }) - .def("sgpr", [](const EventStateInfo &self) { - return py::array_t::type>({ self.size(), Dive::kShaderStageCount}, { - sizeof(numpy_type::type)* Dive::kShaderStageCount, sizeof(numpy_type::type)* Dive::kShaderStageCount} - , reinterpret_cast::type*>(self.SgprPtr())); + .def("enable_partial_helper_lanes", [](const EventStateInfo &self) { + return py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.EnablePartialHelperLanesPtr())); }) .def("to_dataframe", [](const EventStateInfo &self) { py::object DataFrame = py::module::import("pandas").attr("DataFrame"); @@ -378,106 +358,74 @@ void py_event_state(py::module &m) { dict["max_depth_bounds"] = py::array_t::type>({ self.size()}, { sizeof(numpy_type::type)} , reinterpret_cast::type*>(self.MaxDepthBoundsPtr())); - dict["logic_op_enabled"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.LogicOpEnabledPtr())); - dict["logic_op"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.LogicOpPtr())); - for(uint32_t attachment=0; attachment<8; ++attachment) - { - std::ostringstream key; - key << "attachment"<< "_" << attachment; - dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.AttachmentPtr(EventStateId(0), attachment))); - } - for(uint32_t channel=0; channel<4; ++channel) - { - std::ostringstream key; - key << "blend_constant"<< "_" << channel; - dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)* 4} - , reinterpret_cast::type*>(self.BlendConstantPtr(EventStateId(0), channel))); - } - dict["z_addr"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZAddrPtr())); - dict["h_tile_addr"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.HTileAddrPtr())); - dict["hi_z_enabled"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.HiZEnabledPtr())); - dict["hi_s_enabled"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.HiSEnabledPtr())); - dict["z_compress_enabled"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZCompressEnabledPtr())); - dict["stencil_compress_enabled"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.StencilCompressEnabledPtr())); - dict["compressed_z_fetch_enabled"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.CompressedZFetchEnabledPtr())); - dict["z_format"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZFormatPtr())); - dict["z_order"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.ZOrderPtr())); - dict["vs_late_alloc"] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)} - , reinterpret_cast::type*>(self.VSLateAllocPtr())); for(uint32_t attachment=0; attachment<8; ++attachment) { std::ostringstream key; - key << "dcc_enabled"<< "_" << attachment; + key << "logic_op_enabled"<< "_" << attachment; dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.DccEnabledPtr(EventStateId(0), attachment))); - } - for(uint32_t attachment=0; attachment<8; ++attachment) - { - std::ostringstream key; - key << "color_format"<< "_" << attachment; - dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.ColorFormatPtr(EventStateId(0), attachment))); + , reinterpret_cast::type*>(self.LogicOpEnabledPtr(EventStateId(0), attachment))); } for(uint32_t attachment=0; attachment<8; ++attachment) { std::ostringstream key; - key << "mip0_height"<< "_" << attachment; - dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.Mip0HeightPtr(EventStateId(0), attachment))); + key << "logic_op"<< "_" << attachment; + dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)* 8} + , reinterpret_cast::type*>(self.LogicOpPtr(EventStateId(0), attachment))); } for(uint32_t attachment=0; attachment<8; ++attachment) { std::ostringstream key; - key << "mip0_width"<< "_" << attachment; - dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { - sizeof(numpy_type::type)* 8} - , reinterpret_cast::type*>(self.Mip0WidthPtr(EventStateId(0), attachment))); - } - for(uint32_t stage=0; stage::type>({ self.size()}, { - sizeof(numpy_type::type)* Dive::kShaderStageCount} - , reinterpret_cast::type*>(self.VgprPtr(EventStateId(0), static_cast(stage)))); + key << "attachment"<< "_" << attachment; + dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)* 8} + , reinterpret_cast::type*>(self.AttachmentPtr(EventStateId(0), attachment))); } - for(uint32_t stage=0; stage::type>({ self.size()}, { - sizeof(numpy_type::type)* Dive::kShaderStageCount} - , reinterpret_cast::type*>(self.SgprPtr(EventStateId(0), static_cast(stage)))); + key << "blend_constant"<< "_" << channel; + dict[py::cast(key.str())] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)* 4} + , reinterpret_cast::type*>(self.BlendConstantPtr(EventStateId(0), channel))); } + dict["lrz_enabled"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.LRZEnabledPtr())); + dict["lrz_write"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.LRZWritePtr())); + dict["lrz_dir_status"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.LRZDirStatusPtr())); + dict["lrz_dir_write"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.LRZDirWritePtr())); + dict["z_test_mode"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.ZTestModePtr())); + dict["bin_w"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.BinWPtr())); + dict["bin_h"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.BinHPtr())); + dict["render_mode"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.RenderModePtr())); + dict["buffers_location"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.BuffersLocationPtr())); + dict["thread_size"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.ThreadSizePtr())); + dict["enable_all_helper_lanes"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.EnableAllHelperLanesPtr())); + dict["enable_partial_helper_lanes"] = py::array_t::type>({ self.size()}, { + sizeof(numpy_type::type)} + , reinterpret_cast::type*>(self.EnablePartialHelperLanesPtr())); return DataFrame(dict); }); diff --git a/ui/event_state_view.cpp b/ui/event_state_view.cpp index 9674b028b..26443b901 100644 --- a/ui/event_state_view.cpp +++ b/ui/event_state_view.cpp @@ -264,27 +264,23 @@ void EventStateView::BuildDescriptionMap(Dive::EventStateInfo::ConstIterator eve ADD_FIELD_DESC(event_state_it->GetAttachmentName(), event_state_it->GetAttachmentDescription()); ADD_FIELD_DESC(event_state_it->GetBlendConstantName(), event_state_it->GetBlendConstantDescription()); - ADD_FIELD_DESC(event_state_it->GetZAddrName(), event_state_it->GetZAddrDescription()); - ADD_FIELD_DESC(event_state_it->GetHTileAddrName(), event_state_it->GetHTileAddrDescription()); - ADD_FIELD_DESC(event_state_it->GetHiZEnabledName(), event_state_it->GetHiZEnabledDescription()); - ADD_FIELD_DESC(event_state_it->GetHiSEnabledName(), event_state_it->GetHiSEnabledDescription()); - ADD_FIELD_DESC(event_state_it->GetZCompressEnabledName(), - event_state_it->GetZCompressEnabledDescription()); - ADD_FIELD_DESC(event_state_it->GetStencilCompressEnabledName(), - event_state_it->GetStencilCompressEnabledDescription()); - ADD_FIELD_DESC(event_state_it->GetCompressedZFetchEnabledName(), - event_state_it->GetCompressedZFetchEnabledDescription()); - ADD_FIELD_DESC(event_state_it->GetZFormatName(), event_state_it->GetZFormatDescription()); - ADD_FIELD_DESC(event_state_it->GetZOrderName(), event_state_it->GetZOrderDescription()); - ADD_FIELD_DESC(event_state_it->GetVSLateAllocName(), - event_state_it->GetVSLateAllocDescription()); - ADD_FIELD_DESC(event_state_it->GetDccEnabledName(), event_state_it->GetDccEnabledDescription()); - ADD_FIELD_DESC(event_state_it->GetColorFormatName(), - event_state_it->GetColorFormatDescription()); - ADD_FIELD_DESC(event_state_it->GetMip0HeightName(), event_state_it->GetMip0HeightDescription()); - ADD_FIELD_DESC(event_state_it->GetMip0WidthName(), event_state_it->GetMip0WidthDescription()); - ADD_FIELD_DESC(event_state_it->GetVgprName(), event_state_it->GetVgprDescription()); - ADD_FIELD_DESC(event_state_it->GetSgprName(), event_state_it->GetSgprDescription()); + ADD_FIELD_DESC(event_state_it->GetLRZEnabledName(), event_state_it->GetLRZEnabledDescription()); + ADD_FIELD_DESC(event_state_it->GetLRZWriteName(), event_state_it->GetLRZWriteDescription()); + ADD_FIELD_DESC(event_state_it->GetLRZDirStatusName(), + event_state_it->GetLRZDirStatusDescription()); + ADD_FIELD_DESC(event_state_it->GetLRZDirWriteName(), + event_state_it->GetLRZDirWriteDescription()); + ADD_FIELD_DESC(event_state_it->GetZTestModeName(), event_state_it->GetZTestModeDescription()); + ADD_FIELD_DESC(event_state_it->GetBinWName(), event_state_it->GetBinWDescription()); + ADD_FIELD_DESC(event_state_it->GetBinHName(), event_state_it->GetBinHDescription()); + ADD_FIELD_DESC(event_state_it->GetRenderModeName(), event_state_it->GetRenderModeDescription()); + ADD_FIELD_DESC(event_state_it->GetBuffersLocationName(), + event_state_it->GetBuffersLocationDescription()); + ADD_FIELD_DESC(event_state_it->GetThreadSizeName(), event_state_it->GetThreadSizeDescription()); + ADD_FIELD_DESC(event_state_it->GetEnableAllHelperLanesName(), + event_state_it->GetEnableAllHelperLanesDescription()); + ADD_FIELD_DESC(event_state_it->GetEnablePartialHelperLanesName(), + event_state_it->GetEnablePartialHelperLanesDescription()); } //-------------------------------------------------------------------------------------------------- @@ -679,30 +675,6 @@ void EventStateView::DisplayColorBlendState(Dive::EventStateInfo::ConstIterator { QList items; - // LogicOpEnabled - if (event_state_it->IsLogicOpEnabledSet()) - ADD_FIELD_TYPE_BOOL(event_state_it->GetLogicOpEnabledName(), - event_state_it->LogicOpEnabled(), - prev_event_state_it->IsLogicOpEnabledSet(), - prev_event_state_it->LogicOpEnabled(), - items) - else - ADD_FIELD_NOT_SET(event_state_it->GetLogicOpEnabledName(), items) - - // LogicOp - if (event_state_it->IsLogicOpSet()) - { - ADD_FIELD_TYPE_STRING(event_state_it->GetLogicOpName(), - GetVkLogicOp(event_state_it->LogicOp()), - prev_event_state_it->IsLogicOpSet(), - GetVkLogicOp(prev_event_state_it->LogicOp()), - items) - } - else - { - ADD_FIELD_NOT_SET(event_state_it->GetLogicOpName(), items) - } - // Attachment { QList child_items; @@ -710,6 +682,33 @@ void EventStateView::DisplayColorBlendState(Dive::EventStateInfo::ConstIterator { if (event_state_it->IsAttachmentSet(i)) { + // LogicOpEnabled + if (event_state_it->IsLogicOpEnabledSet(i)) + ADD_FIELD_TYPE_BOOL(event_state_it->GetLogicOpEnabledName() + + QString::number(i), + event_state_it->LogicOpEnabled(i), + prev_event_state_it->IsLogicOpEnabledSet(i), + prev_event_state_it->LogicOpEnabled(i), + child_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetLogicOpEnabledName() + QString::number(i), + child_items) + + // LogicOp + if (event_state_it->IsLogicOpSet(i)) + { + ADD_FIELD_TYPE_STRING(event_state_it->GetLogicOpName() + QString::number(i), + GetVkLogicOp(event_state_it->LogicOp(i)), + prev_event_state_it->IsLogicOpSet(i), + GetVkLogicOp(prev_event_state_it->LogicOp(i)), + child_items) + } + else + { + ADD_FIELD_NOT_SET(event_state_it->GetLogicOpName() + QString::number(i), + child_items) + } + QString value; VkPipelineColorBlendAttachmentState attach = event_state_it->Attachment(i); @@ -795,273 +794,194 @@ void EventStateView::DisplayHardwareSpecificStates( Dive::EventStateInfo::ConstIterator event_state_it, Dive::EventStateInfo::ConstIterator prev_event_state_it) { - QList items, depth_target_items, color_target_items; - - // ZAddr - if (event_state_it->IsZAddrSet()) - ADD_FIELD_TYPE_STRING(event_state_it->GetZAddrName(), - "0x" + QString::number(event_state_it->ZAddr(), 16).toUpper(), - prev_event_state_it->IsZAddrSet(), - "0x" + QString::number(prev_event_state_it->ZAddr(), 16).toUpper(), - depth_target_items) - else - ADD_FIELD_NOT_SET(event_state_it->GetZAddrName(), depth_target_items) - - // HTileAddr - if (event_state_it->IsHTileAddrSet()) - ADD_FIELD_TYPE_STRING(event_state_it->GetHTileAddrName(), - "0x" + QString::number(event_state_it->HTileAddr(), 16).toUpper(), - prev_event_state_it->IsHTileAddrSet(), - "0x" + - QString::number(prev_event_state_it->HTileAddr(), 16).toUpper(), - depth_target_items) - else - ADD_FIELD_NOT_SET(event_state_it->GetHTileAddrName(), depth_target_items) - - // HiZEnabled - if (event_state_it->IsHiZEnabledSet()) - ADD_FIELD_TYPE_BOOL(event_state_it->GetHiZEnabledName(), - event_state_it->HiZEnabled(), - prev_event_state_it->IsHiZEnabledSet(), - prev_event_state_it->HiZEnabled(), - depth_target_items) - else - ADD_FIELD_NOT_SET(event_state_it->GetHiZEnabledName(), depth_target_items) - - // HiSEnabled - if (event_state_it->IsHiSEnabledSet()) - ADD_FIELD_TYPE_BOOL(event_state_it->GetHiSEnabledName(), - event_state_it->HiSEnabled(), - prev_event_state_it->IsHiSEnabledSet(), - prev_event_state_it->HiSEnabled(), - depth_target_items) - else - ADD_FIELD_NOT_SET(event_state_it->GetHiSEnabledName(), depth_target_items) - - // ZCompressEnabled - if (event_state_it->IsZCompressEnabledSet()) - ADD_FIELD_TYPE_BOOL(event_state_it->GetZCompressEnabledName(), - event_state_it->ZCompressEnabled(), - prev_event_state_it->IsZCompressEnabledSet(), - prev_event_state_it->ZCompressEnabled(), - depth_target_items) - else - ADD_FIELD_NOT_SET(event_state_it->GetZCompressEnabledName(), depth_target_items) - - // StencilCompressEnabled - if (event_state_it->IsStencilCompressEnabledSet()) - ADD_FIELD_TYPE_BOOL(event_state_it->GetStencilCompressEnabledName(), - event_state_it->StencilCompressEnabled(), - prev_event_state_it->IsStencilCompressEnabledSet(), - prev_event_state_it->StencilCompressEnabled(), + QList depth_target_items, binning_items, thread_items; + + if (event_state_it->IsLRZEnabledSet()) + ADD_FIELD_TYPE_BOOL(event_state_it->GetLRZEnabledName(), + event_state_it->LRZEnabled(), + prev_event_state_it->IsLRZEnabledSet(), + prev_event_state_it->LRZEnabled(), depth_target_items) else - ADD_FIELD_NOT_SET(event_state_it->GetStencilCompressEnabledName(), depth_target_items) - - // CompressedZFetchEnabled - if (event_state_it->IsCompressedZFetchEnabledSet()) - ADD_FIELD_TYPE_BOOL(event_state_it->GetCompressedZFetchEnabledName(), - event_state_it->CompressedZFetchEnabled(), - prev_event_state_it->IsCompressedZFetchEnabledSet(), - prev_event_state_it->CompressedZFetchEnabled(), + ADD_FIELD_NOT_SET(event_state_it->GetLRZEnabledName(), depth_target_items) + + if (event_state_it->IsLRZWriteSet()) + ADD_FIELD_TYPE_BOOL(event_state_it->GetLRZWriteName(), + event_state_it->LRZWrite(), + prev_event_state_it->IsLRZWriteSet(), + prev_event_state_it->LRZWrite(), depth_target_items) else - ADD_FIELD_NOT_SET(event_state_it->GetCompressedZFetchEnabledName(), depth_target_items) - - // ZFormat - if (event_state_it->IsZFormatSet()) - ADD_FIELD_TYPE_STRING(event_state_it->GetZFormatName(), - GetZFormat(event_state_it->ZFormat()), - prev_event_state_it->IsZFormatSet(), - GetZFormat(prev_event_state_it->ZFormat()), - depth_target_items) - else - ADD_FIELD_NOT_SET(event_state_it->GetZFormatName(), depth_target_items) - - // ZOrder - if (event_state_it->IsZOrderSet()) - ADD_FIELD_TYPE_STRING(event_state_it->GetZOrderName(), - GetZOrder(event_state_it->ZOrder()), - prev_event_state_it->IsZOrderSet(), - GetZOrder(prev_event_state_it->ZOrder()), + ADD_FIELD_NOT_SET(event_state_it->GetLRZWriteName(), depth_target_items) + + auto LRZDirStatusToStr = [](const a6xx_lrz_dir_status &status) -> QString { + std::string s; + switch (status) + { + case LRZ_DIR_LE: s = "Less Equal"; break; + case LRZ_DIR_GE: s = "Greater Equal"; break; + case LRZ_DIR_INVALID: s = "Invalid"; break; + default: + s = "Undefined"; + break; // TODO(wangra): we have cases where this value is 0, same with cffdump + } + return QString::fromStdString(s); + }; + + if (event_state_it->IsLRZDirStatusSet()) + ADD_FIELD_TYPE_STRING(event_state_it->GetLRZDirStatusName(), + LRZDirStatusToStr(event_state_it->LRZDirStatus()), + prev_event_state_it->IsLRZDirStatusSet(), + LRZDirStatusToStr(prev_event_state_it->LRZDirStatus()), depth_target_items) else - ADD_FIELD_NOT_SET(event_state_it->GetZOrderName(), depth_target_items) + ADD_FIELD_NOT_SET(event_state_it->GetLRZDirStatusName(), depth_target_items) - // VSLateAlloc - if (event_state_it->IsVSLateAllocSet()) - { - ADD_FIELD_TYPE_NUMBER(event_state_it->GetVSLateAllocName(), - event_state_it->VSLateAlloc(), - prev_event_state_it->IsVSLateAllocSet(), - prev_event_state_it->VSLateAlloc(), - depth_target_items) - } + if (event_state_it->IsLRZDirWriteSet()) + ADD_FIELD_TYPE_BOOL(event_state_it->GetLRZDirWriteName(), + event_state_it->LRZDirWrite(), + prev_event_state_it->IsLRZDirWriteSet(), + prev_event_state_it->LRZDirWrite(), + depth_target_items) else - { - ADD_FIELD_NOT_SET(event_state_it->GetVSLateAllocName(), depth_target_items) - } + ADD_FIELD_NOT_SET(event_state_it->GetLRZDirWriteName(), depth_target_items) - // DccEnabled - { - QList child_items; - for (uint16_t i = 0; i < 8; ++i) + auto ZTestModeToStr = [](const a6xx_ztest_mode &mode) -> QString { + std::string s; + switch (mode) { - QString field_name = "Target# " + QString::number(i); - if (event_state_it->IsDccEnabledSet(i)) - { - ADD_FIELD_TYPE_BOOL(field_name, - event_state_it->DccEnabled(i), - prev_event_state_it->IsDccEnabledSet(i), - prev_event_state_it->DccEnabled(i), - child_items); - } - else - ADD_FIELD_NOT_SET(field_name, child_items); + case A6XX_EARLY_Z: s = "Early Z"; break; + case A6XX_LATE_Z: s = "Late Z"; break; + case A6XX_EARLY_LRZ_LATE_Z: s = "Early Z LRZ Late Z"; break; + case A6XX_INVALID_ZTEST: s = "Invalid ZTest"; break; + default: DIVE_ASSERT(false); break; } + return QString::fromStdString(s); + }; - QTreeWidgetItem - *child_widget_item = new QTreeWidgetItem((QTreeWidget *)0, - QStringList(event_state_it->GetDccEnabledName())); - child_widget_item->insertChildren(0, child_items); - color_target_items.append(child_widget_item); - } + if (event_state_it->IsZTestModeSet()) + ADD_FIELD_TYPE_STRING(event_state_it->GetZTestModeName(), + ZTestModeToStr(event_state_it->ZTestMode()), + prev_event_state_it->IsZTestModeSet(), + ZTestModeToStr(prev_event_state_it->ZTestMode()), + depth_target_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetZTestModeName(), depth_target_items) - // ColorFormat - { - QList child_items; - for (uint16_t i = 0; i < 8; ++i) - { - QString field_name = "Target# " + QString::number(i); - if (event_state_it->IsColorFormatSet(i)) - { - ADD_FIELD_TYPE_STRING(field_name, - QString(GetColorFormat(event_state_it->ColorFormat(i))), - prev_event_state_it->IsColorFormatSet(i), - QString(GetColorFormat(prev_event_state_it->ColorFormat(i))), - child_items); - } - else - ADD_FIELD_NOT_SET(field_name, child_items); - } + if (event_state_it->IsBinWSet()) + ADD_FIELD_TYPE_NUMBER(event_state_it->GetBinWName(), + event_state_it->BinW(), + prev_event_state_it->IsBinWSet(), + prev_event_state_it->BinW(), + binning_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetZTestModeName(), depth_target_items) - QTreeWidgetItem - *child_widget_item = new QTreeWidgetItem((QTreeWidget *)0, - QStringList(event_state_it->GetColorFormatName())); - child_widget_item->insertChildren(0, child_items); - color_target_items.append(child_widget_item); - } + if (event_state_it->IsBinHSet()) + ADD_FIELD_TYPE_NUMBER(event_state_it->GetBinHName(), + event_state_it->BinH(), + prev_event_state_it->IsBinHSet(), + prev_event_state_it->BinH(), + binning_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetZTestModeName(), binning_items) - // Mip0Height - { - QList child_items; - for (uint16_t i = 0; i < 8; ++i) + auto RenderModeToStr = [](const a6xx_render_mode &mode) -> QString { + std::string s; + switch (mode) { - QString field_name = "Target# " + QString::number(i); - if (event_state_it->IsMip0HeightSet(i)) - { - ADD_FIELD_TYPE_NUMBER(field_name, - event_state_it->Mip0Height(i), - prev_event_state_it->IsMip0HeightSet(i), - prev_event_state_it->Mip0Height(i), - child_items); - } - else - ADD_FIELD_NOT_SET(field_name, child_items); + case RENDERING_PASS: s = "Rendering Pass"; break; + case BINNING_PASS: s = "Binning Pass"; break; + default: DIVE_ASSERT(false); break; } + return QString::fromStdString(s); + }; - QTreeWidgetItem - *child_widget_item = new QTreeWidgetItem((QTreeWidget *)0, - QStringList(event_state_it->GetMip0HeightName())); - child_widget_item->insertChildren(0, child_items); - color_target_items.append(child_widget_item); - } + if (event_state_it->IsRenderModeSet()) + ADD_FIELD_TYPE_STRING(event_state_it->GetRenderModeName(), + RenderModeToStr(event_state_it->RenderMode()), + prev_event_state_it->IsRenderModeSet(), + RenderModeToStr(prev_event_state_it->RenderMode()), + binning_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetRenderModeName(), binning_items) - // Mip0Width - { - QList child_items; - for (uint16_t i = 0; i < 8; ++i) + // only valid for A6xx + auto BuffersLocationToStr = [](const a6xx_buffers_location &location) -> QString { + std::string s; + switch (location) { - QString field_name = "Target# " + QString::number(i); - if (event_state_it->IsMip0WidthSet(i)) - { - ADD_FIELD_TYPE_NUMBER(field_name, - event_state_it->Mip0Width(i), - prev_event_state_it->IsMip0WidthSet(i), - prev_event_state_it->Mip0Width(i), - child_items); - } - else - ADD_FIELD_NOT_SET(field_name, child_items); + case BUFFERS_IN_GMEM: s = "Buffers in GMEM"; break; + case BUFFERS_IN_SYSMEM: s = "Buffers in SYSMEM"; break; + default: s = "Unknown"; break; } + return QString::fromStdString(s); + }; - QTreeWidgetItem *child_widget_item = new QTreeWidgetItem((QTreeWidget *)0, - QStringList(event_state_it - ->GetMip0WidthName())); - child_widget_item->insertChildren(0, child_items); - color_target_items.append(child_widget_item); - } + if (event_state_it->IsBuffersLocationSet()) + ADD_FIELD_TYPE_STRING(event_state_it->GetBuffersLocationName(), + BuffersLocationToStr(event_state_it->BuffersLocation()), + prev_event_state_it->IsBuffersLocationSet(), + BuffersLocationToStr(prev_event_state_it->BuffersLocation()), + binning_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetBuffersLocationName(), binning_items) - QString shader_stage[] = { "CS", "GS", "HS", "PS", "VS" }; - // Vgpr - { - QList child_items; - for (uint32_t stage = 0; stage < Dive::kShaderStageCount; ++stage) + auto ThreadSizeToStr = [](const a6xx_threadsize &size) -> QString { + std::string s; + switch (size) { - if (event_state_it->IsVgprSet((Dive::ShaderStage)stage)) - { - ADD_FIELD_TYPE_NUMBER(shader_stage[stage], - event_state_it->Vgpr((Dive::ShaderStage)stage), - prev_event_state_it->IsVgprSet((Dive::ShaderStage)stage), - prev_event_state_it->Vgpr((Dive::ShaderStage)stage), - child_items); - } - else - ADD_FIELD_NOT_SET(shader_stage[stage], child_items); + case THREAD64: s = "Thread 64"; break; + case THREAD128: s = "Thread 128"; break; + default: DIVE_ASSERT(false); break; } + return QString::fromStdString(s); + }; - QTreeWidgetItem *child_widget_item = new QTreeWidgetItem((QTreeWidget *)0, - QStringList( - event_state_it->GetVgprName())); - child_widget_item->insertChildren(0, child_items); - items.append(child_widget_item); - } + if (event_state_it->IsThreadSizeSet()) + ADD_FIELD_TYPE_STRING(event_state_it->GetThreadSizeName(), + ThreadSizeToStr(event_state_it->ThreadSize()), + prev_event_state_it->IsThreadSizeSet(), + ThreadSizeToStr(prev_event_state_it->ThreadSize()), + thread_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetThreadSizeName(), thread_items) - // Sgpr - { - QList child_items; - for (uint32_t stage = 0; stage < Dive::kShaderStageCount; ++stage) - { - if (event_state_it->IsSgprSet((Dive::ShaderStage)stage)) - { - ADD_FIELD_TYPE_NUMBER(shader_stage[stage], - event_state_it->Sgpr((Dive::ShaderStage)stage), - prev_event_state_it->IsSgprSet((Dive::ShaderStage)stage), - prev_event_state_it->Sgpr((Dive::ShaderStage)stage), - child_items); - } - else - ADD_FIELD_NOT_SET(shader_stage[stage], child_items); - } + if (event_state_it->IsEnableAllHelperLanesSet()) + ADD_FIELD_TYPE_BOOL(event_state_it->GetEnableAllHelperLanesName(), + event_state_it->EnableAllHelperLanes(), + prev_event_state_it->IsEnableAllHelperLanesSet(), + prev_event_state_it->EnableAllHelperLanes(), + thread_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetEnableAllHelperLanesName(), thread_items) - QTreeWidgetItem *child_widget_item = new QTreeWidgetItem((QTreeWidget *)0, - QStringList( - event_state_it->GetSgprName())); - child_widget_item->insertChildren(0, child_items); - items.append(child_widget_item); - } + if (event_state_it->IsEnablePartialHelperLanesSet()) + ADD_FIELD_TYPE_BOOL(event_state_it->GetEnablePartialHelperLanesName(), + event_state_it->EnablePartialHelperLanes(), + prev_event_state_it->IsEnablePartialHelperLanesSet(), + prev_event_state_it->EnablePartialHelperLanes(), + thread_items) + else + ADD_FIELD_NOT_SET(event_state_it->GetEnablePartialHelperLanesName(), thread_items) QTreeWidgetItem *tree_widget_item = new QTreeWidgetItem(m_event_state_tree); tree_widget_item->setText(0, "GPU-specific"); + + QTreeWidgetItem *thread_item = new QTreeWidgetItem; + thread_item->setText(0, "Threads Invocation"); + thread_item->insertChildren(0, thread_items); + tree_widget_item->insertChild(0, thread_item); + QTreeWidgetItem *depth_target_item = new QTreeWidgetItem; depth_target_item->setText(0, "Depth Targets"); depth_target_item->insertChildren(0, depth_target_items); - QTreeWidgetItem *color_target_item = new QTreeWidgetItem; - color_target_item->setText(0, "Color Targets"); - color_target_item->insertChildren(0, color_target_items); tree_widget_item->insertChild(0, depth_target_item); - tree_widget_item->insertChild(0, color_target_item); - tree_widget_item->insertChildren(0, items); + + QTreeWidgetItem *binning_item = new QTreeWidgetItem; + binning_item->setText(0, "Tiling and Binning"); + binning_item->insertChildren(0, binning_items); + tree_widget_item->insertChild(0, binning_item); } //--------------------------------------------------------------------------------------------------