Skip to content

Commit 98e521b

Browse files
jhananitigcbot
authored andcommitted
Expanding BufferType
Buffer Type range is set to 32 instead of 16.
1 parent a70235e commit 98e521b

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

IGC/Compiler/CISACodeGen/helper.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ namespace IGC
4343
struct _bits
4444
{
4545
unsigned int bufId : 16;
46-
unsigned int bufType : 4;
46+
unsigned int bufType : 5;
4747
unsigned int indirect : 1; // bool
48-
unsigned int reserved : 11;
48+
unsigned int reserved : 10;
4949
} bits;
5050
uint32_t u32Val;
5151
} GFXResourceAddrSpace;
@@ -61,8 +61,9 @@ namespace IGC
6161
GFXResourceAddrSpace temp;
6262
static_assert(sizeof(temp) == 4, "Code below may need and update.");
6363
temp.u32Val = 0;
64-
IGC_ASSERT((bufType + 1) < 16);
64+
IGC_ASSERT((bufType + 1) < BUFFER_TYPE_UNKNOWN + 1);
6565
temp.bits.bufType = bufType + 1;
66+
6667
if (bufType == SLM)
6768
{
6869
return ADDRESS_SPACE_LOCAL;

IGC/Compiler/CodeGenPublicEnums.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ namespace IGC
9393
STATELESS,
9494
STATELESS_READONLY,
9595
STATELESS_A32,
96-
BUFFER_TYPE_UNKNOWN = 15,
96+
BUFFER_TYPE_UNKNOWN = 31
9797
};
9898

9999
enum BufferAccessType : short

IGC/Compiler/PromoteResourceToDirectAS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ void PromoteResourceToDirectAS::PromoteBufferToDirectAS(Instruction* inst, Value
522522
// Vulkan encodes address space differently, with the reserve bits set.
523523
// TODO: Investigate how addrspace is encoded in Vulkan,
524524
// for now skip promoting if it's an address space we dont recognize.
525-
if ((addrSpace & 0xFFE00000) != 0x0)
525+
if ((addrSpace & 0xFFC00000) != 0x0)
526526
{
527527
return;
528528
}

IGC/LLVM3DBuilder/BuiltinsFrontendDefinitions.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ typedef union _gfxResourceAddressSpace
2323
struct _bits
2424
{
2525
unsigned int bufId : 16;
26-
unsigned int bufType : 4;
26+
unsigned int bufType : 5;
2727
unsigned int indirect : 1; // bool
28-
unsigned int reserved : 11;
28+
unsigned int reserved : 10;
2929
} bits;
3030
unsigned int u32Val;
3131
} GFXResourceAddressSpace;
@@ -51,7 +51,7 @@ unsigned LLVM3DBuilder<preserveNames, T, Inserter>::EncodeASForGFXResource(
5151
static_assert(sizeof(temp) == 4, "Code below may need and update.");
5252

5353
temp.u32Val = 0;
54-
IGC_ASSERT((bufType + 1) < 16);
54+
IGC_ASSERT((bufType + 1) < IGC::BUFFER_TYPE_UNKNOWN + 1);
5555
temp.bits.bufType = bufType + 1;
5656
if (bufType == IGC::BufferType::SLM)
5757
{

0 commit comments

Comments
 (0)