Refactor getCmdSizeForPipelineSelect

Change-Id: Ib601974250d4a3576bf90d74ba36c4216c3cb1af
Related-To: NEO-3457
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2019-08-21 14:08:51 +02:00
committed by sys_ocldev
parent a103ce177e
commit 9b198a113d
3 changed files with 19 additions and 9 deletions

View File

@@ -612,6 +612,24 @@ size_t CommandStreamReceiverHw<GfxFamily>::getRequiredCmdStreamSize(const Dispat
return size;
}
template <typename GfxFamily>
inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPipelineSelect() const {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
using PIPELINE_SELECT = typename GfxFamily::PIPELINE_SELECT;
size_t size = 0;
if (csrSizeRequestFlags.mediaSamplerConfigChanged ||
csrSizeRequestFlags.specialPipelineSelectModeChanged ||
!isPreambleSent) {
size += sizeof(PIPELINE_SELECT);
if (HardwareCommandsHelper<GfxFamily>::isPipeControlPriorToPipelineSelectWArequired(peekHwInfo())) {
size += sizeof(PIPE_CONTROL);
}
}
return size;
}
template <typename GfxFamily>
inline void CommandStreamReceiverHw<GfxFamily>::emitNoop(LinearStream &commandStream, size_t bytesToUpdate) {
if (bytesToUpdate) {

View File

@@ -53,14 +53,6 @@ void CommandStreamReceiverHw<GfxFamily>::programPipelineSelect(LinearStream &com
}
}
template <typename GfxFamily>
inline size_t CommandStreamReceiverHw<GfxFamily>::getCmdSizeForPipelineSelect() const {
if (csrSizeRequestFlags.mediaSamplerConfigChanged || !isPreambleSent) {
return sizeof(typename GfxFamily::PIPELINE_SELECT);
}
return 0;
}
template <typename GfxFamily>
void CommandStreamReceiverHw<GfxFamily>::createScratchSpaceController() {
scratchSpaceController = std::make_unique<ScratchSpaceControllerBase>(executionEnvironment, *internalAllocationStorage.get());