Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace IA_MULTI_VGT_PARAM_PIPED #2887

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions lgc/include/lgc/state/AbiMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ static constexpr char VgtGsMode[] = ".vgt_gs_mode";
static constexpr char VgtTfParam[] = ".vgt_tf_param";
static constexpr char VgtLsHsConfig[] = ".vgt_ls_hs_config";
static constexpr char IaMultiVgtParam[] = ".ia_multi_vgt_param";
static constexpr char IaMultiVgtParamPiped[] = ".ia_multi_vgt_param_piped";
static constexpr char SpiInterpControl[] = ".spi_interp_control";
static constexpr char SpiPsInputCntl[] = ".spi_ps_input_cntl";
static constexpr char VgtHosMinTessLevel[] = ".vgt_hos_min_tess_level";
Expand Down Expand Up @@ -331,12 +330,6 @@ static constexpr char SwitchOnEoi[] = ".switch_on_eoi";
static constexpr char PartialEsWaveOn[] = ".partial_es_wave_on";
}; // namespace IaMultiVgtParamMetadataKey

namespace IaMultiVgtParamPipedMetadataKey {
static constexpr char PrimgroupSize[] = ".primgroup_size";
static constexpr char SwitchOnEoi[] = ".switch_on_eoi";
static constexpr char PartialEsWaveOn[] = ".partial_es_wave_on";
}; // namespace IaMultiVgtParamPipedMetadataKey

namespace VgtGsModeMetadataKey {
static constexpr char Mode[] = ".mode";
static constexpr char Onchip[] = ".onchip";
Expand Down
25 changes: 6 additions & 19 deletions lgc/patch/RegisterMetadataBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1459,8 +1459,6 @@ void RegisterMetadataBuilder::setVgtShaderStagesEn(unsigned hwStageMask) {
// =====================================================================================================================
// Set up the metadata for register IA_MULT_VGT_PARAM
void RegisterMetadataBuilder::setIaMultVgtParam() {
bool isIaMultVgtParamPiped = m_isNggMode || (m_gfxIp.major == 10 && !m_isNggMode);

if (m_hasTcs || m_hasTes) {
// With tessellation, SWITCH_ON_EOI and PARTIAL_ES_WAVE_ON must be set if primitive ID is used by either the TCS,
// TES, or GS.
Expand All @@ -1477,19 +1475,15 @@ void RegisterMetadataBuilder::setIaMultVgtParam() {
usePrimitiveId = gsBuiltInUsage.primitiveId;
}

if (isIaMultVgtParamPiped) {
auto iaMultVgtParamPiped =
getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::IaMultiVgtParamPiped].getMap(true);
iaMultVgtParamPiped[Util::Abi::IaMultiVgtParamPipedMetadataKey::SwitchOnEoi] = usePrimitiveId;
auto iaMultVgtParam = getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::IaMultiVgtParam].getMap(true);
iaMultVgtParam[Util::Abi::IaMultiVgtParamMetadataKey::SwitchOnEoi] = usePrimitiveId;
if (m_isNggMode || (m_gfxIp.major == 10 && !m_isNggMode)) {
AMD-dwang marked this conversation as resolved.
Show resolved Hide resolved
if (needWaveOnField)
iaMultVgtParamPiped[Util::Abi::IaMultiVgtParamPipedMetadataKey::PartialEsWaveOn] = usePrimitiveId;
iaMultVgtParam[Util::Abi::IaMultiVgtParamMetadataKey::PartialEsWaveOn] = usePrimitiveId;
} else {
auto iaMultVgtParam = getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::IaMultiVgtParam].getMap(true);
iaMultVgtParam[Util::Abi::IaMultiVgtParamMetadataKey::SwitchOnEoi] = usePrimitiveId;
if (needWaveOnField)
iaMultVgtParam[Util::Abi::IaMultiVgtParamMetadataKey::PrimgroupSize] = usePrimitiveId;
}

} else {
unsigned primGroupSize = 128;
if (!m_hasGs && !m_hasMesh) {
Expand All @@ -1499,15 +1493,8 @@ void RegisterMetadataBuilder::setIaMultVgtParam() {
if (numShaderEngines > 2)
primGroupSize = alignTo(primGroupSize, 2);
}

if (isIaMultVgtParamPiped || m_hasMesh) {
auto iaMultVgtParamPiped =
getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::IaMultiVgtParamPiped].getMap(true);
iaMultVgtParamPiped[Util::Abi::IaMultiVgtParamPipedMetadataKey::PrimgroupSize] = primGroupSize - 1;
} else {
auto iaMultVgtParam = getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::IaMultiVgtParam].getMap(true);
iaMultVgtParam[Util::Abi::IaMultiVgtParamMetadataKey::PrimgroupSize] = primGroupSize - 1;
}
auto iaMultVgtParam = getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::IaMultiVgtParam].getMap(true);
iaMultVgtParam[Util::Abi::IaMultiVgtParamMetadataKey::PrimgroupSize] = primGroupSize - 1;
}
}

Expand Down
2 changes: 1 addition & 1 deletion llpc/test/shaderdb/general/PipelineVsFs_TestNullFs.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ colorBuffer[0].blendSrcAlphaToColor = 0
; CHECK-NEXT: .stencil_test_val_export_enable: 0
; CHECK-NEXT: .z_export_enable: 0
; CHECK-NEXT: .z_order: 0x1
; CHECK-NEXT: .ia_multi_vgt_param_piped:
; CHECK-NEXT: .ia_multi_vgt_param:
; CHECK-NEXT: .primgroup_size: 0x7f
; CHECK-NEXT: .pa_cl_clip_cntl:
; CHECK-NEXT: .dx_linear_attr_clip_ena: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ entryPoint = main
; SHADERTEST-NEXT: .stencil_test_val_export_enable: 0
; SHADERTEST-NEXT: .z_export_enable: 0
; SHADERTEST-NEXT: .z_order: 0x1
; SHADERTEST-NEXT: .ia_multi_vgt_param_piped:
; SHADERTEST-NEXT: .ia_multi_vgt_param:
; SHADERTEST-NEXT: .primgroup_size: 0x7f
; SHADERTEST-NEXT: .pa_cl_clip_cntl:
; SHADERTEST-NEXT: .dx_linear_attr_clip_ena: true
Expand Down
2 changes: 1 addition & 1 deletion llpc/test/shaderdb/gfx11/SgprUserDataInit_Fs.pipe
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ colorBuffer[0].blendSrcAlphaToColor = 0
; CHECK-NEXT: .prim_amp_factor: 0x1
; CHECK-NEXT: .threads_per_subgroup: 0x100
; CHECK-NEXT: .gs_vgpr_comp_cnt: 0x1
; CHECK-NEXT: .ia_multi_vgt_param_piped:
; CHECK-NEXT: .ia_multi_vgt_param:
; CHECK-NEXT: .primgroup_size: 0x7f
; CHECK-NEXT: .max_verts_per_subgroup: 0x80
; CHECK-NEXT: .pa_cl_clip_cntl:
Expand Down
Loading