Skip to content

Commit c839e26

Browse files
aratajewigcbot
authored andcommitted
Remove surface state generation in patch tokens for printf buffer
Printf buffer is always addressed with stateless addressing mode, so surface state is useless
1 parent ea705c5 commit c839e26

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

IGC/AdaptorOCL/OCL/sp/sp_g8.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -788,21 +788,6 @@ RETVAL CGen8OpenCLStateProcessor::CreateSurfaceStateHeap(
788788
}
789789
}
790790

791-
if (annotations.m_printfBufferAnnotation != NULL)
792-
{
793-
unsigned int bti = annotations.m_argIndexMap.at(annotations.m_printfBufferAnnotation->ArgumentNumber);
794-
context.Surface.SurfaceOffset[bti] = (DWORD)membuf.Size();
795-
796-
SurfaceStates.insert(
797-
std::make_pair(
798-
bti,
799-
SurfaceState(
800-
SURFACE_BUFFER,
801-
SURFACE_FORMAT_RAW,
802-
0,
803-
false)));
804-
}
805-
806791
if (annotations.m_syncBufferAnnotation != NULL)
807792
{
808793
unsigned int bti = annotations.m_argIndexMap.at(annotations.m_syncBufferAnnotation->ArgumentNumber);
@@ -1653,12 +1638,10 @@ RETVAL CGen8OpenCLStateProcessor::CreatePatchList(
16531638
iOpenCL::SPatchAllocateStatelessPrintfSurface patch;
16541639
memset(&patch, 0, sizeof(patch));
16551640

1656-
unsigned int bti = annotations.m_argIndexMap.at(printfBufAnn->ArgumentNumber);
1657-
16581641
patch.Token = iOpenCL::PATCH_TOKEN_ALLOCATE_STATELESS_PRINTF_SURFACE;
16591642
patch.Size = sizeof(patch);
16601643
patch.PrintfSurfaceIndex = printfBufAnn->Index;
1661-
patch.SurfaceStateHeapOffset = context.Surface.SurfaceOffset[bti];
1644+
patch.SurfaceStateHeapOffset = UINT32_MAX;
16621645
patch.DataParamOffset = printfBufAnn->PayloadPosition;
16631646
patch.DataParamSize = printfBufAnn->DataSize;
16641647

IGC/Compiler/CISACodeGen/OpenCLKernelCodeGen.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,13 +1495,9 @@ namespace IGC
14951495

14961496
case KernelArg::ArgType::IMPLICIT_PRINTF_BUFFER:
14971497
{
1498-
int argNo = kernelArg->getAssociatedArgNo();
1499-
SOpenCLKernelInfo::SResourceInfo resInfo = getResourceInfo(argNo);
1500-
m_kernelInfo.m_argIndexMap[argNo] = getBTI(resInfo);
1501-
15021498
auto printfBuffer = std::make_unique<iOpenCL::PrintfBufferAnnotation>();
15031499

1504-
printfBuffer->ArgumentNumber = argNo;
1500+
printfBuffer->ArgumentNumber = kernelArg->getAssociatedArgNo();
15051501
printfBuffer->PayloadPosition = payloadPosition;
15061502
printfBuffer->DataSize = kernelArg->getAllocateSize();
15071503
printfBuffer->Index = 0; // This value is not used by Runtime.

IGC/Compiler/Optimizer/OpenCLPasses/ResourceAllocator/ResourceAllocator.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ static AllocationType getAllocationType(KernelArg::ArgType argType, BindlessAllo
158158
case KernelArg::ArgType::IMPLICIT_CONSTANT_BASE:
159159
case KernelArg::ArgType::IMPLICIT_GLOBAL_BASE:
160160
case KernelArg::ArgType::IMPLICIT_PRIVATE_BASE:
161-
case KernelArg::ArgType::IMPLICIT_PRINTF_BUFFER:
162161
case KernelArg::ArgType::IMPLICIT_SYNC_BUFFER:
163162
case KernelArg::ArgType::IMPLICIT_RT_GLOBAL_BUFFER:
164163
case KernelArg::ArgType::IMPLICIT_DEVICE_ENQUEUE_EVENT_POOL:

0 commit comments

Comments
 (0)