mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Return buffer compressed when render buffer compressed is enable
Change-Id: I62fde1573849139ca16ff9d7e5d5672eab7ccd2b
This commit is contained in:
@@ -340,11 +340,8 @@ GraphicsAllocation::AllocationType Buffer::getGraphicsAllocationType(const Memor
|
|||||||
return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isValueSet(properties.flags, CL_MEM_USE_HOST_PTR)) {
|
if (isValueSet(properties.flags, CL_MEM_USE_HOST_PTR) && (isValueSet(properties.flags, CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL) || !isLocalMemoryEnabled)) {
|
||||||
if (isValueSet(properties.flags, CL_MEM_FORCE_SHARED_PHYSICAL_MEMORY_INTEL) || !isLocalMemoryEnabled) {
|
return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
||||||
return GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY;
|
|
||||||
}
|
|
||||||
return GraphicsAllocation::AllocationType::BUFFER;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MemObjHelper::isSuitableForRenderCompression(renderCompressedBuffers, properties, contextType)) {
|
if (MemObjHelper::isSuitableForRenderCompression(renderCompressedBuffers, properties, contextType)) {
|
||||||
|
|||||||
@@ -300,6 +300,16 @@ TEST(Buffer, givenRenderCompressedBuffersEnabledWhenAllocationTypeIsQueriedThenB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(Buffer, givenRenderCompressedBuffersDisabledLocalMemoryEnabledWhenAllocationTypeIsQueriedThenBufferTypeIsReturnedIn64Bit) {
|
||||||
|
MemoryProperties properties;
|
||||||
|
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(properties, false, ContextType::CONTEXT_TYPE_UNRESTRICTIVE, false, true);
|
||||||
|
if (is32bit) {
|
||||||
|
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type);
|
||||||
|
} else {
|
||||||
|
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
TEST(Buffer, givenSharedContextWhenAllocationTypeIsQueriedThenBufferHostMemoryTypeIsReturned) {
|
||||||
MemoryProperties properties;
|
MemoryProperties properties;
|
||||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(properties, true, ContextType::CONTEXT_TYPE_UNRESTRICTIVE, false, false);
|
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(properties, true, ContextType::CONTEXT_TYPE_UNRESTRICTIVE, false, false);
|
||||||
@@ -353,7 +363,7 @@ TEST(Buffer, givenUseHostPtrFlagAndLocalMemoryEnabledAndRenderCompressedBuffersE
|
|||||||
properties.flags = CL_MEM_USE_HOST_PTR;
|
properties.flags = CL_MEM_USE_HOST_PTR;
|
||||||
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(properties, false, ContextType::CONTEXT_TYPE_UNRESTRICTIVE, true, true);
|
auto type = MockPublicAccessBuffer::getGraphicsAllocationType(properties, false, ContextType::CONTEXT_TYPE_UNRESTRICTIVE, true, true);
|
||||||
if (is64bit) {
|
if (is64bit) {
|
||||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER, type);
|
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, type);
|
||||||
} else {
|
} else {
|
||||||
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type);
|
EXPECT_EQ(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, type);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user