Skip to content

Commit ee29c1e

Browse files
srividyakarumurisys_zuul
authored andcommitted
Assigning different buffer type for constant buffers and resources
Change-Id: I39fb0583478312216086618e8e876b1d75396aa6
1 parent 8be38d7 commit ee29c1e

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

IGC/Compiler/CISACodeGen/ConstantCoalescing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ void ConstantCoalescing::ProcessBlock(
431431
unsigned int bufId = 0;
432432
BufferType bufType = DecodeAS4GFXResource(
433433
ldRaw->getResourceValue()->getType()->getPointerAddressSpace(), directIdx, bufId);
434-
if (bufType != BINDLESS_READONLY)
434+
if ((bufType != BINDLESS_CONSTANT_BUFFER) && (bufType != BINDLESS_TEXTURE))
435435
{
436436
continue;
437437
}

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@ namespace IGC
127127
temp.u32Val = addressSpaceOfPtr;
128128

129129
// Mark buffer as it is bindless for further processing
130-
if (bufferType == BufferType::RESOURCE ||
131-
bufferType == BufferType::CONSTANT_BUFFER ||
132-
bufferType == BufferType::UAV)
130+
if (bufferType == BufferType::RESOURCE)
131+
{
132+
temp.bits.bufType = IGC::BINDLESS_TEXTURE + 1;
133+
}
134+
if (bufferType == BufferType::CONSTANT_BUFFER)
135+
{
136+
temp.bits.bufType = IGC::BINDLESS_CONSTANT_BUFFER + 1;
137+
}
138+
if(bufferType == BufferType::UAV)
133139
{
134140
temp.bits.bufType = IGC::BINDLESS + 1;
135141
}
@@ -524,7 +530,8 @@ namespace IGC
524530
{
525531
case BufferType::CONSTANT_BUFFER:
526532
case BufferType::RESOURCE:
527-
case BufferType::BINDLESS_READONLY:
533+
case BufferType::BINDLESS_TEXTURE:
534+
case BufferType::BINDLESS_CONSTANT_BUFFER:
528535
case BufferType::STATELESS_READONLY:
529536
case BufferType::SAMPLER:
530537
return BufferAccessType::ACCESS_READ;

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ namespace IGC
201201

202202
inline bool IsBindless(BufferType t)
203203
{
204-
return t == BINDLESS || t == BINDLESS_READONLY;
204+
return t == BINDLESS || t == BINDLESS_CONSTANT_BUFFER || t == BINDLESS_TEXTURE;
205205
}
206206

207207
bool IsUnsignedCmp(const llvm::CmpInst::Predicate Pred);

IGC/Compiler/CodeGenPublicEnums.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ namespace IGC
104104
SLM,
105105
POINTER,
106106
BINDLESS,
107-
BINDLESS_READONLY,
107+
BINDLESS_CONSTANT_BUFFER,
108+
BINDLESS_TEXTURE,
108109
SAMPLER,
109110
BINDLESS_SAMPLER,
110111
RENDER_TARGET,

0 commit comments

Comments
 (0)