mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 06:23:01 +08:00
Add compression flags for Images
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2a9b147f2a
commit
b5d4732169
@@ -142,6 +142,48 @@ void Gmm::applyAuxFlagsForBuffer(bool preferRenderCompression) {
|
||||
hwHelper.applyAdditionalCompressionSettings(*this, !isCompressionEnabled);
|
||||
}
|
||||
|
||||
void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo) {
|
||||
uint8_t compressionFormat;
|
||||
if (this->resourceParams.Flags.Info.MediaCompressed) {
|
||||
compressionFormat = clientContext->getMediaSurfaceStateCompressionFormat(imgInfo.surfaceFormat->GMMSurfaceFormat);
|
||||
} else {
|
||||
compressionFormat = clientContext->getSurfaceStateCompressionFormat(imgInfo.surfaceFormat->GMMSurfaceFormat);
|
||||
}
|
||||
|
||||
bool compressionFormatSupported = false;
|
||||
if (clientContext->getHardwareInfo()->featureTable.ftrFlatPhysCCS) {
|
||||
compressionFormatSupported = compressionFormat != GMM_FLATCCS_FORMAT::GMM_FLATCCS_FORMAT_INVALID;
|
||||
} else {
|
||||
compressionFormatSupported = compressionFormat != GMM_E2ECOMP_FORMAT::GMM_E2ECOMP_FORMAT_INVALID;
|
||||
}
|
||||
|
||||
const bool isPackedYuv = imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_YUY2 ||
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_UYVY ||
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_YVYU ||
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat == GMM_FORMAT_VYUY;
|
||||
|
||||
auto hwInfo = clientContext->getHardwareInfo();
|
||||
|
||||
bool allowRenderCompression = HwHelper::renderCompressedImagesSupported(*hwInfo) &&
|
||||
imgInfo.preferRenderCompression &&
|
||||
compressionFormatSupported &&
|
||||
imgInfo.surfaceFormat->GMMSurfaceFormat != GMM_RESOURCE_FORMAT::GMM_FORMAT_NV12 &&
|
||||
imgInfo.plane == GMM_YUV_PLANE_ENUM::GMM_NO_PLANE &&
|
||||
!isPackedYuv;
|
||||
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
if (imgInfo.useLocalMemory || !hwInfo->featureTable.ftrLocalMemory) {
|
||||
if (allowRenderCompression) {
|
||||
hwHelper.applyRenderCompressionFlag(*this, 1);
|
||||
this->resourceParams.Flags.Gpu.CCS = 1;
|
||||
this->resourceParams.Flags.Gpu.UnifiedAuxSurface = 1;
|
||||
this->resourceParams.Flags.Gpu.IndirectClearColor = 1;
|
||||
this->isCompressionEnabled = true;
|
||||
}
|
||||
}
|
||||
hwHelper.applyAdditionalCompressionSettings(*this, !isCompressionEnabled);
|
||||
}
|
||||
|
||||
void Gmm::queryImageParams(ImageInfo &imgInfo) {
|
||||
auto imageCount = this->gmmResourceInfo->getArraySize();
|
||||
imgInfo.size = this->gmmResourceInfo->getSizeAllocation();
|
||||
|
||||
@@ -12,5 +12,4 @@
|
||||
using namespace NEO;
|
||||
|
||||
void Gmm::applyAppResource(StorageInfo &storageInfo) {}
|
||||
void Gmm::applyAuxFlagsForImage(ImageInfo &imgInfo) {}
|
||||
void Gmm::applyMemoryFlags(bool systemMemoryPool, StorageInfo &storageInfo) { this->useSystemMemoryPool = systemMemoryPool; }
|
||||
|
||||
Reference in New Issue
Block a user