@@ -74,7 +74,7 @@ void CMKernel::createConstArgumentAnnotation(unsigned argNo, unsigned sizeInByte
74
74
}
75
75
76
76
// TODO: this is incomplete.
77
- void CMKernel::createSamplerAnnotation (unsigned argNo, unsigned payloadPosition )
77
+ void CMKernel::createSamplerAnnotation (unsigned argNo)
78
78
{
79
79
iOpenCL::SAMPLER_OBJECT_TYPE samplerType;
80
80
samplerType = iOpenCL::SAMPLER_OBJECT_TEXTURE;
@@ -88,12 +88,12 @@ void CMKernel::createSamplerAnnotation(unsigned argNo, unsigned payloadPosition)
88
88
samplerArg->LocationCount = 0 ;
89
89
samplerArg->IsBindlessAccess = false ;
90
90
samplerArg->IsEmulationArgument = false ;
91
- samplerArg->PayloadPosition = payloadPosition ;
91
+ samplerArg->PayloadPosition = 0 ;
92
92
93
93
m_kernelInfo.m_samplerArgument .push_back (samplerArg);
94
94
}
95
95
96
- void CMKernel::createImageAnnotation (unsigned argNo, unsigned BTI, unsigned payloadPosition, unsigned dim, bool isWriteable)
96
+ void CMKernel::createImageAnnotation (unsigned argNo, unsigned BTI, unsigned dim, bool isWriteable)
97
97
{
98
98
iOpenCL::ImageArgumentAnnotation* imageInput = new iOpenCL::ImageArgumentAnnotation;
99
99
@@ -115,7 +115,7 @@ void CMKernel::createImageAnnotation(unsigned argNo, unsigned BTI, unsigned payl
115
115
imageInput->AccessedByFloatCoords = false ;
116
116
imageInput->AccessedByIntCoords = false ;
117
117
imageInput->IsBindlessAccess = false ;
118
- imageInput->PayloadPosition = payloadPosition ;
118
+ imageInput->PayloadPosition = 0 ;
119
119
imageInput->Writeable = isWriteable;
120
120
m_kernelInfo.m_imageInputAnnotations .push_back (imageInput);
121
121
}
@@ -314,7 +314,8 @@ static void generatePatchTokens(const cmc_kernel_info *info, CMKernel& kernel)
314
314
kernel.m_kernelInfo .m_argIndexMap .clear ();
315
315
316
316
for (auto &AI : info->arg_descs ) {
317
- maxArgEnd = std::max (AI.offset + AI.sizeInBytes , maxArgEnd);
317
+ if (AI.offset > 0 )
318
+ maxArgEnd = std::max (AI.offset + AI.sizeInBytes , maxArgEnd);
318
319
bool isWriteable = AI.access != cmc_access_kind::read_only;
319
320
320
321
switch (AI.kind ) {
@@ -332,19 +333,19 @@ static void generatePatchTokens(const cmc_kernel_info *info, CMKernel& kernel)
332
333
kernel.createPointerGlobalAnnotation (AI.index , AI.sizeInBytes , AI.offset - constantPayloadStart, -1 );
333
334
break ;
334
335
case cmc_arg_kind::Sampler:
335
- kernel.createSamplerAnnotation (AI.index , AI. offset - constantPayloadStart );
336
+ kernel.createSamplerAnnotation (AI.index );
336
337
kernel.m_kernelInfo .m_argIndexMap [AI.index ] = AI.BTI ;
337
338
break ;
338
339
case cmc_arg_kind::Image1d:
339
- kernel.createImageAnnotation (AI.index , AI.BTI , AI. offset - constantPayloadStart, 1 , isWriteable);
340
+ kernel.createImageAnnotation (AI.index , AI.BTI , 1 , isWriteable);
340
341
kernel.m_kernelInfo .m_argIndexMap [AI.index ] = AI.BTI ;
341
342
break ;
342
343
case cmc_arg_kind::Image2d:
343
- kernel.createImageAnnotation (AI.index , AI.BTI , AI. offset - constantPayloadStart, 2 , isWriteable);
344
+ kernel.createImageAnnotation (AI.index , AI.BTI , 2 , isWriteable);
344
345
kernel.m_kernelInfo .m_argIndexMap [AI.index ] = AI.BTI ;
345
346
break ;
346
347
case cmc_arg_kind::Image3d:
347
- kernel.createImageAnnotation (AI.index , AI.BTI , AI. offset - constantPayloadStart, 3 , isWriteable);
348
+ kernel.createImageAnnotation (AI.index , AI.BTI , 3 , isWriteable);
348
349
kernel.m_kernelInfo .m_argIndexMap [AI.index ] = AI.BTI ;
349
350
break ;
350
351
}
0 commit comments