diff --git a/lgc/include/lgc/state/PipelineState.h b/lgc/include/lgc/state/PipelineState.h index 31206fd30a..ed2ce0d118 100644 --- a/lgc/include/lgc/state/PipelineState.h +++ b/lgc/include/lgc/state/PipelineState.h @@ -295,9 +295,6 @@ class PipelineState final : public Pipeline { const RasterizerState &getRasterizerState() const { return m_rasterizerState; } const DepthStencilState &getDepthStencilState() const { return m_depthStencilState; } - // Determine whether to use off-chip tessellation mode - bool isTessOffChip(); - // Set GS on-chip mode void setGsOnChip(bool gsOnChip) { m_gsOnChip = gsOnChip; } diff --git a/lgc/patch/Gfx9ConfigBuilder.cpp b/lgc/patch/Gfx9ConfigBuilder.cpp index 6aa70f824e..aaf3c3d29c 100644 --- a/lgc/patch/Gfx9ConfigBuilder.cpp +++ b/lgc/patch/Gfx9ConfigBuilder.cpp @@ -953,9 +953,7 @@ template void ConfigBuilder::buildVsRegConfig(ShaderStage shaderSta SET_REG_FIELD(&config->vsRegs, SPI_SHADER_PGM_RSRC1_VS, VGPR_COMP_CNT, 2); } - if (m_pipelineState->isTessOffChip()) { - SET_REG_FIELD(&config->vsRegs, SPI_SHADER_PGM_RSRC2_VS, OC_LDS_EN, true); - } + SET_REG_FIELD(&config->vsRegs, SPI_SHADER_PGM_RSRC2_VS, OC_LDS_EN, true); } setupPaSpecificRegisters(&config->vsRegs); @@ -1016,7 +1014,6 @@ void ConfigBuilder::buildLsHsRegConfig(ShaderStage shaderStage1, ShaderStage sha SET_REG_FIELD(&config->lsHsRegs, SPI_SHADER_PGM_RSRC2_HS, USER_SGPR, userDataCount); const auto &calcFactor = tcsResUsage->inOutUsage.tcs.calcFactor; - assert(m_pipelineState->isTessOffChip()); // Must be off-chip on GFX9+ const unsigned ldsSizeDwordGranularityShift = m_pipelineState->getTargetInfo().getGpuProperty().ldsSizeDwordGranularityShift; @@ -2055,10 +2052,7 @@ void ConfigBuilder::setupVgtTfParam(LsHsRegConfig *config) { SET_REG_FIELD(config, VGT_TF_PARAM, TYPE, primType); SET_REG_FIELD(config, VGT_TF_PARAM, PARTITIONING, partition); SET_REG_FIELD(config, VGT_TF_PARAM, TOPOLOGY, topology); - - if (m_pipelineState->isTessOffChip()) { - SET_REG_FIELD(config, VGT_TF_PARAM, DISTRIBUTION_MODE, TRAPEZOIDS); - } + SET_REG_FIELD(config, VGT_TF_PARAM, DISTRIBUTION_MODE, TRAPEZOIDS); } // ===================================================================================================================== diff --git a/lgc/patch/NggPrimShader.cpp b/lgc/patch/NggPrimShader.cpp index d430438d80..682e90e91a 100644 --- a/lgc/patch/NggPrimShader.cpp +++ b/lgc/patch/NggPrimShader.cpp @@ -3117,11 +3117,9 @@ void NggPrimShader::runEs(ArrayRef args) { if (m_hasTes) { // Set up system value SGPRs - if (m_pipelineState->isTessOffChip()) { - Value *isOffChip = PoisonValue::get(m_builder.getInt32Ty()); // Unused - esArgs.push_back(m_hasGs ? offChipLdsBase : isOffChip); - esArgs.push_back(m_hasGs ? isOffChip : offChipLdsBase); - } + Value *isOffChip = PoisonValue::get(m_builder.getInt32Ty()); // Unused + esArgs.push_back(m_hasGs ? offChipLdsBase : isOffChip); + esArgs.push_back(m_hasGs ? isOffChip : offChipLdsBase); if (m_hasGs) esArgs.push_back(esGsOffset); @@ -3335,11 +3333,9 @@ Value *NggPrimShader::runPartEs(ArrayRef args, Value *position) { if (m_hasTes) { // Set up system value SGPRs - if (m_pipelineState->isTessOffChip()) { - Value *isOffChip = PoisonValue::get(m_builder.getInt32Ty()); // Unused - partEsArgs.push_back(isOffChip); - partEsArgs.push_back(offChipLdsBase); - } + Value *isOffChip = PoisonValue::get(m_builder.getInt32Ty()); // Unused + partEsArgs.push_back(isOffChip); + partEsArgs.push_back(offChipLdsBase); // Set up system value VGPRs partEsArgs.push_back(tessCoordX); @@ -7510,11 +7506,9 @@ Value *NggPrimShader::fetchXfbOutput(Function *target, ArrayRef args if (m_hasTes) { // Set up system value SGPRs - if (m_pipelineState->isTessOffChip()) { - Value *isOffChip = PoisonValue::get(m_builder.getInt32Ty()); // Unused - xfbFetcherArgs.push_back(isOffChip); - xfbFetcherArgs.push_back(offChipLdsBase); - } + Value *isOffChip = PoisonValue::get(m_builder.getInt32Ty()); // Unused + xfbFetcherArgs.push_back(isOffChip); + xfbFetcherArgs.push_back(offChipLdsBase); // Set up system value VGPRs xfbFetcherArgs.push_back(tessCoordX); diff --git a/lgc/patch/PatchInOutImportExport.cpp b/lgc/patch/PatchInOutImportExport.cpp index 3d15ac692b..89b011e6f8 100644 --- a/lgc/patch/PatchInOutImportExport.cpp +++ b/lgc/patch/PatchInOutImportExport.cpp @@ -371,18 +371,11 @@ void PatchInOutImportExport::processShader() { calcFactor.outPatchSize = outPatchSize; calcFactor.inPatchSize = inPatchSize; - // NOTE: Tess factors are always stored to on-chip LDS first. Then, they are store to TF buffer and on-chip LDS - // or off-chip LDS buffer (which will be loaded by TES). - if (m_pipelineState->isTessOffChip()) { - calcFactor.offChip.outPatchStart = 0; - calcFactor.offChip.patchConstStart = calcFactor.offChip.outPatchStart + outPatchTotalSize; - - calcFactor.onChip.tessFactorStart = inPatchTotalSize; - } else { - calcFactor.onChip.outPatchStart = inPatchTotalSize; - calcFactor.onChip.patchConstStart = calcFactor.onChip.outPatchStart + outPatchTotalSize; - calcFactor.onChip.tessFactorStart = calcFactor.onChip.patchConstStart + patchConstTotalSize; - } + // NOTE: Tess factors are always stored to on-chip LDS first. Then, they are store to TF buffer and off-chip + // LDS buffer (which will be loaded by TES). + calcFactor.offChip.outPatchStart = 0; + calcFactor.offChip.patchConstStart = calcFactor.offChip.outPatchStart + outPatchTotalSize; + calcFactor.onChip.tessFactorStart = inPatchTotalSize; calcFactor.tessFactorStride = tessFactorStride; calcFactor.tessOnChipLdsSize = calcFactor.onChip.tessFactorStart + tessFactorTotalSize; @@ -430,16 +423,12 @@ void PatchInOutImportExport::processShader() { LLPC_OUTS("Output vertex count: " << outVertexCount << "\n"); LLPC_OUTS("Output vertex stride: " << calcFactor.outVertexStride << "\n"); LLPC_OUTS("Output patch size (in dwords): " << outPatchSize << "\n"); - LLPC_OUTS("Output patch start: " << (m_pipelineState->isTessOffChip() ? calcFactor.offChip.outPatchStart - : calcFactor.onChip.outPatchStart) - << (m_pipelineState->isTessOffChip() ? " (LDS buffer)" : "(LDS)") << "\n"); + LLPC_OUTS("Output patch start: " << calcFactor.offChip.outPatchStart << " (LDS buffer)\n"); LLPC_OUTS("Output patch total size (in dwords): " << outPatchTotalSize << "\n"); LLPC_OUTS("\n"); LLPC_OUTS("Patch constant count: " << patchConstCount << "\n"); LLPC_OUTS("Patch constant size (in dwords): " << calcFactor.patchConstSize << "\n"); - LLPC_OUTS("Patch constant start: " << (m_pipelineState->isTessOffChip() ? calcFactor.offChip.patchConstStart - : calcFactor.onChip.patchConstStart) - << (m_pipelineState->isTessOffChip() ? " (LDS buffer)" : "(LDS)") << "\n"); + LLPC_OUTS("Patch constant start: " << calcFactor.offChip.patchConstStart << " (LDS buffer)\n"); LLPC_OUTS("Patch constant total size (in dwords): " << patchConstTotalSize << "\n"); LLPC_OUTS("\n"); LLPC_OUTS("Tess factor start: " << calcFactor.onChip.tessFactorStart << " (LDS)\n"); @@ -1606,7 +1595,7 @@ Value *PatchInOutImportExport::patchTesGenericInputImport(Type *inputTy, unsigne assert(compIdx); auto ldsOffset = calcLdsOffsetForTesInput(inputTy, location, locOffset, compIdx, vertexIdx, builder); - return readValueFromLds(m_pipelineState->isTessOffChip(), inputTy, ldsOffset, builder); + return readValueFromLds(true, inputTy, ldsOffset, builder); } // ===================================================================================================================== @@ -1963,7 +1952,7 @@ Value *PatchInOutImportExport::patchTcsGenericOutputImport(Type *outputTy, unsig Value *compIdx, Value *vertexIdx, BuilderBase &builder) { assert(compIdx); auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, location, locOffset, compIdx, vertexIdx, builder); - return readValueFromLds(m_pipelineState->isTessOffChip(), outputTy, ldsOffset, builder); + return readValueFromLds(true, outputTy, ldsOffset, builder); } // ===================================================================================================================== @@ -2016,7 +2005,7 @@ void PatchInOutImportExport::patchTcsGenericOutputExport(Value *output, unsigned assert(compIdx); Type *outputTy = output->getType(); auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, location, locOffset, compIdx, vertexIdx, builder); - writeValueToLds(m_pipelineState->isTessOffChip(), output, ldsOffset, builder); + writeValueToLds(true, output, ldsOffset, builder); } // ===================================================================================================================== @@ -2230,7 +2219,7 @@ Value *PatchInOutImportExport::patchTesBuiltInInputImport(Type *inputTy, unsigne const unsigned loc = builtInInLocMap.find(builtInId)->second; auto ldsOffset = calcLdsOffsetForTesInput(inputTy, loc, nullptr, elemIdx, vertexIdx, builder); - input = readValueFromLds(m_pipelineState->isTessOffChip(), inputTy, ldsOffset, builder); + input = readValueFromLds(true, inputTy, ldsOffset, builder); break; } @@ -2242,7 +2231,7 @@ Value *PatchInOutImportExport::patchTesBuiltInInputImport(Type *inputTy, unsigne const unsigned loc = builtInInLocMap.find(builtInId)->second; auto ldsOffset = calcLdsOffsetForTesInput(inputTy, loc, nullptr, nullptr, vertexIdx, builder); - input = readValueFromLds(m_pipelineState->isTessOffChip(), inputTy, ldsOffset, builder); + input = readValueFromLds(true, inputTy, ldsOffset, builder); break; } @@ -2259,12 +2248,12 @@ Value *PatchInOutImportExport::patchTesBuiltInInputImport(Type *inputTy, unsigne for (unsigned i = 0; i < inputTy->getArrayNumElements(); ++i) { auto elemIdx = builder.getInt32(i); auto ldsOffset = calcLdsOffsetForTesInput(elemTy, loc, nullptr, elemIdx, vertexIdx, builder); - auto elem = readValueFromLds(m_pipelineState->isTessOffChip(), elemTy, ldsOffset, builder); + auto elem = readValueFromLds(true, elemTy, ldsOffset, builder); input = builder.CreateInsertValue(input, elem, {i}); } } else { auto ldsOffset = calcLdsOffsetForTesInput(inputTy, loc, nullptr, elemIdx, vertexIdx, builder); - input = readValueFromLds(m_pipelineState->isTessOffChip(), inputTy, ldsOffset, builder); + input = readValueFromLds(true, inputTy, ldsOffset, builder); } break; @@ -2307,12 +2296,12 @@ Value *PatchInOutImportExport::patchTesBuiltInInputImport(Type *inputTy, unsigne for (unsigned i = 0; i < inputTy->getArrayNumElements(); ++i) { auto elemIdx = builder.getInt32(i); auto ldsOffset = calcLdsOffsetForTesInput(elemTy, loc, nullptr, elemIdx, vertexIdx, builder); - auto elem = readValueFromLds(m_pipelineState->isTessOffChip(), elemTy, ldsOffset, builder); + auto elem = readValueFromLds(true, elemTy, ldsOffset, builder); input = builder.CreateInsertValue(input, elem, {i}); } } else { auto ldsOffset = calcLdsOffsetForTesInput(inputTy, loc, nullptr, elemIdx, vertexIdx, builder); - input = readValueFromLds(m_pipelineState->isTessOffChip(), inputTy, ldsOffset, builder); + input = readValueFromLds(true, inputTy, ldsOffset, builder); } break; @@ -2825,7 +2814,7 @@ Value *PatchInOutImportExport::patchTcsBuiltInOutputImport(Type *outputTy, unsig unsigned loc = builtInOutLocMap.find(builtInId)->second; auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, loc, nullptr, elemIdx, vertexIdx, builder); - output = readValueFromLds(m_pipelineState->isTessOffChip(), outputTy, ldsOffset, builder); + output = readValueFromLds(true, outputTy, ldsOffset, builder); break; } @@ -2851,12 +2840,12 @@ Value *PatchInOutImportExport::patchTcsBuiltInOutputImport(Type *outputTy, unsig for (unsigned i = 0; i < outputTy->getArrayNumElements(); ++i) { auto elemIdx = builder.getInt32(i); auto ldsOffset = calcLdsOffsetForTcsOutput(elemTy, loc, nullptr, elemIdx, vertexIdx, builder); - auto elem = readValueFromLds(m_pipelineState->isTessOffChip(), elemTy, ldsOffset, builder); + auto elem = readValueFromLds(true, elemTy, ldsOffset, builder); output = builder.CreateInsertValue(output, elem, {i}); } } else { auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, loc, nullptr, elemIdx, vertexIdx, builder); - output = readValueFromLds(m_pipelineState->isTessOffChip(), outputTy, ldsOffset, builder); + output = readValueFromLds(true, outputTy, ldsOffset, builder); } break; @@ -3102,7 +3091,7 @@ void PatchInOutImportExport::patchTcsBuiltInOutputExport(Value *output, unsigned unsigned loc = builtInOutLocMap.find(builtInId)->second; auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, loc, nullptr, elemIdx, vertexIdx, builder); - writeValueToLds(m_pipelineState->isTessOffChip(), output, ldsOffset, builder); + writeValueToLds(true, output, ldsOffset, builder); break; } @@ -3123,11 +3112,11 @@ void PatchInOutImportExport::patchTcsBuiltInOutputExport(Value *output, unsigned auto elem = ExtractValueInst::Create(output, {i}, "", insertPos); auto elemIdx = ConstantInt::get(Type::getInt32Ty(*m_context), i); auto ldsOffset = calcLdsOffsetForTcsOutput(elem->getType(), loc, nullptr, elemIdx, vertexIdx, builder); - writeValueToLds(m_pipelineState->isTessOffChip(), elem, ldsOffset, builder); + writeValueToLds(true, elem, ldsOffset, builder); } } else { auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, loc, nullptr, elemIdx, vertexIdx, builder); - writeValueToLds(m_pipelineState->isTessOffChip(), output, ldsOffset, builder); + writeValueToLds(true, output, ldsOffset, builder); } break; @@ -3168,12 +3157,12 @@ void PatchInOutImportExport::patchTcsBuiltInOutputExport(Value *output, unsigned for (unsigned i = 0; i < outputTy->getArrayNumElements(); ++i) { auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, loc, nullptr, builder.getInt32(i), nullptr, builder); auto elem = builder.CreateExtractValue(output, {i}); - writeValueToLds(m_pipelineState->isTessOffChip(), elem, ldsOffset, builder); + writeValueToLds(true, elem, ldsOffset, builder); } } else { // Handle a single element of tessLevelOuter array auto ldsOffset = calcLdsOffsetForTcsOutput(outputTy, loc, nullptr, elemIdx, nullptr, builder); - writeValueToLds(m_pipelineState->isTessOffChip(), output, ldsOffset, builder); + writeValueToLds(true, output, ldsOffset, builder); } } @@ -4545,11 +4534,8 @@ Value *PatchInOutImportExport::calcLdsOffsetForTcsOutput(Type *outputTy, unsigne const auto &inOutUsage = m_pipelineState->getShaderResourceUsage(ShaderStageTessControl)->inOutUsage.tcs; const auto &calcFactor = inOutUsage.calcFactor; - auto outPatchStart = - m_pipelineState->isTessOffChip() ? calcFactor.offChip.outPatchStart : calcFactor.onChip.outPatchStart; - - auto patchConstStart = - m_pipelineState->isTessOffChip() ? calcFactor.offChip.patchConstStart : calcFactor.onChip.patchConstStart; + auto outPatchStart = calcFactor.offChip.outPatchStart; + auto patchConstStart = calcFactor.offChip.patchConstStart; // attribOffset = (location + locOffset) * 4 + compIdx * bitWidth / 32 Value *attribOffset = builder.getInt32(location); @@ -4617,11 +4603,8 @@ Value *PatchInOutImportExport::calcLdsOffsetForTesInput(Type *inputTy, unsigned const auto &calcFactor = m_pipelineState->getShaderResourceUsage(ShaderStageTessControl)->inOutUsage.tcs.calcFactor; - auto outPatchStart = - m_pipelineState->isTessOffChip() ? calcFactor.offChip.outPatchStart : calcFactor.onChip.outPatchStart; - - auto patchConstStart = - m_pipelineState->isTessOffChip() ? calcFactor.offChip.patchConstStart : calcFactor.onChip.patchConstStart; + auto outPatchStart = calcFactor.offChip.outPatchStart; + auto patchConstStart = calcFactor.offChip.patchConstStart; const auto &entryArgIdxs = m_pipelineState->getShaderInterfaceData(m_shaderStage)->entryArgIdxs.tes; @@ -4735,12 +4718,10 @@ unsigned PatchInOutImportExport::calcPatchCountPerThreadGroup(unsigned inVertexC patchCountPerThreadGroup = std::min(patchCountPerThreadGroup, optimalPatchCountPerThreadGroup); - if (m_pipelineState->isTessOffChip()) { - auto outPatchLdsBufferSize = (outPatchSize + patchConstSize) * 4; - auto tessOffChipPatchCountPerThreadGroup = - m_pipelineState->getTargetInfo().getGpuProperty().tessOffChipLdsBufferSize / outPatchLdsBufferSize; - patchCountPerThreadGroup = std::min(patchCountPerThreadGroup, tessOffChipPatchCountPerThreadGroup); - } + auto outPatchLdsBufferSize = (outPatchSize + patchConstSize) * 4; + auto tessOffChipPatchCountPerThreadGroup = + m_pipelineState->getTargetInfo().getGpuProperty().tessOffChipLdsBufferSize / outPatchLdsBufferSize; + patchCountPerThreadGroup = std::min(patchCountPerThreadGroup, tessOffChipPatchCountPerThreadGroup); // TF-Buffer-based limit for Patchers per Thread Group: // --------------------------------------------------------------------------------------------- @@ -4758,13 +4739,11 @@ unsigned PatchInOutImportExport::calcPatchCountPerThreadGroup(unsigned inVertexC patchCountPerThreadGroup = std::min(patchCountPerThreadGroup, tfBufferPatchCountLimit); - if (m_pipelineState->isTessOffChip()) { - // For all-offchip tessellation, we need to write an additional 4-byte TCS control word to the TF buffer whenever - // the patch-ID is zero. - const unsigned offChipTfBufferPatchCountLimit = - (tfBufferSizeInBytes - (patchCountPerThreadGroup * sizeof(unsigned))) / (tessFactorStride * sizeof(unsigned)); - patchCountPerThreadGroup = std::min(patchCountPerThreadGroup, offChipTfBufferPatchCountLimit); - } + // For all-offchip tessellation, we need to write an additional 4-byte TCS control word to the TF buffer whenever + // the patch-ID is zero. + const unsigned offChipTfBufferPatchCountLimit = + (tfBufferSizeInBytes - (patchCountPerThreadGroup * sizeof(unsigned))) / (tessFactorStride * sizeof(unsigned)); + patchCountPerThreadGroup = std::min(patchCountPerThreadGroup, offChipTfBufferPatchCountLimit); return patchCountPerThreadGroup; } diff --git a/lgc/patch/RegisterMetadataBuilder.cpp b/lgc/patch/RegisterMetadataBuilder.cpp index 8a1990f4bf..94c0bbc05c 100644 --- a/lgc/patch/RegisterMetadataBuilder.cpp +++ b/lgc/patch/RegisterMetadataBuilder.cpp @@ -248,7 +248,6 @@ void RegisterMetadataBuilder::buildLsHsRegisters() { getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::LsVgprCompCnt] = lsVgprCompCnt; // Set LDS_SIZE of SPI_SHADER_PGM_RSRC2_HS - assert(m_pipelineState->isTessOffChip()); // Must be off-chip on GFX9+ unsigned ldsSizeInDwords = calcFactor.tessOnChipLdsSize; ldsSizeInDwords += calcFactor.rayQueryLdsStackSize; @@ -743,8 +742,7 @@ void RegisterMetadataBuilder::buildHwVsRegisters() { else getGraphicsRegNode()[Util::Abi::GraphicsRegisterMetadataKey::VsVgprCompCnt] = 2; - if (m_pipelineState->isTessOffChip()) - getHwShaderNode(Util::Abi::HardwareStage::Vs)[Util::Abi::HardwareStageMetadataKey::OffchipLdsEn] = true; + getHwShaderNode(Util::Abi::HardwareStage::Vs)[Util::Abi::HardwareStageMetadataKey::OffchipLdsEn] = true; } } @@ -1563,8 +1561,7 @@ void RegisterMetadataBuilder::setVgtTfParam() { vgtTfParam[Util::Abi::VgtTfParamMetadataKey::Type] = primType; vgtTfParam[Util::Abi::VgtTfParamMetadataKey::Partitioning] = partition; vgtTfParam[Util::Abi::VgtTfParamMetadataKey::Topology] = topology; - if (m_pipelineState->isTessOffChip()) - vgtTfParam[Util::Abi::VgtTfParamMetadataKey::DistributionMode] = TRAPEZOIDS; + vgtTfParam[Util::Abi::VgtTfParamMetadataKey::DistributionMode] = TRAPEZOIDS; } // ===================================================================================================================== diff --git a/lgc/patch/ShaderInputs.cpp b/lgc/patch/ShaderInputs.cpp index 4aff8a2b7f..c32f9d0a9c 100644 --- a/lgc/patch/ShaderInputs.cpp +++ b/lgc/patch/ShaderInputs.cpp @@ -609,23 +609,20 @@ uint64_t ShaderInputs::getShaderArgTys(PipelineState *pipelineState, ShaderStage } break; case ShaderStageTessControl: - if (pipelineState->isTessOffChip()) { - // LDS buffer base for off-chip - getShaderInputUsage(shaderStage, ShaderInput::OffChipLdsBase)->enable(); - } + // LDS buffer base for off-chip + getShaderInputUsage(shaderStage, ShaderInput::OffChipLdsBase)->enable(); break; case ShaderStageTessEval: - if (pipelineState->isTessOffChip()) { - // LDS buffer base for off-chip - getShaderInputUsage(shaderStage, ShaderInput::OffChipLdsBase)->enable(); - // is_off_chip register. Enabling it here only has an effect when TES is hardware ES. - getShaderInputUsage(shaderStage, ShaderInput::IsOffChip)->enable(); - } + // LDS buffer base for off-chip + getShaderInputUsage(shaderStage, ShaderInput::OffChipLdsBase)->enable(); + // is_off_chip register. Enabling it here only has an effect when TES is hardware ES. + getShaderInputUsage(shaderStage, ShaderInput::IsOffChip)->enable(); + if (!hasGs) { // TES as hardware VS: handle HW stream-out. StreamOutInfo is required for off-chip even if there is no // stream-out. - if (pipelineState->isTessOffChip() || enableHwXfb) - getShaderInputUsage(shaderStage, ShaderInput::StreamOutInfo)->enable(); + getShaderInputUsage(shaderStage, ShaderInput::StreamOutInfo)->enable(); + if (enableHwXfb) { getShaderInputUsage(shaderStage, ShaderInput::StreamOutWriteIndex)->enable(); for (unsigned i = 0; i < MaxTransformFeedbackBuffers; ++i) { diff --git a/lgc/patch/ShaderMerger.cpp b/lgc/patch/ShaderMerger.cpp index 9fa7155370..d1f7cf60eb 100644 --- a/lgc/patch/ShaderMerger.cpp +++ b/lgc/patch/ShaderMerger.cpp @@ -523,8 +523,7 @@ Function *ShaderMerger::generateLsHsEntryPoint(Function *lsEntryPoint, Function appendUserData(builder, hsArgs, hsEntryPoint, 0, userData, intfData->userDataCount, substitutions); // Set up system value SGPRs - if (m_pipelineState->isTessOffChip()) - hsArgs.push_back(offChipLdsBase); + hsArgs.push_back(offChipLdsBase); hsArgs.push_back(tfBufferBase); // Set up system value VGPRs @@ -799,10 +798,8 @@ Function *ShaderMerger::generateEsGsEntryPoint(Function *esEntryPoint, Function if (hasTs) { // Set up system value SGPRs - if (m_pipelineState->isTessOffChip()) { - esArgs.push_back(offChipLdsBase); - esArgs.push_back(offChipLdsBase); - } + esArgs.push_back(offChipLdsBase); + esArgs.push_back(offChipLdsBase); esArgs.push_back(esGsOffset); // Set up system value VGPRs diff --git a/lgc/state/PipelineState.cpp b/lgc/state/PipelineState.cpp index cb555d570f..34efe6768d 100644 --- a/lgc/state/PipelineState.cpp +++ b/lgc/state/PipelineState.cpp @@ -1333,13 +1333,6 @@ unsigned PipelineState::getNumPatchControlPoints() const { return getShaderModes()->getTessellationMode().inputVertices; } -// ===================================================================================================================== -// Determine whether to use off-chip tessellation mode -bool PipelineState::isTessOffChip() { - // For GFX9+, always enable tessellation off-chip mode - return EnableTessOffChip || getLgcContext()->getTargetInfo().getGfxIpVersion().major >= 9; -} - // ===================================================================================================================== // Gets wave size for the specified shader stage //