mirror of
https://github.com/intel/compute-runtime.git
synced 2025-11-10 05:49:51 +08:00
Adding support to packed formats
Related-To: NEO-4949 Change-Id: I5cbff44d6463fa6c7aa71f641e11b593a1dcf11e Signed-off-by: Andrzej Koska <andrzej.koska@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
4ec90b2a56
commit
0cc717b1b4
@@ -82,13 +82,22 @@ void D3DSharing<D3D>::updateImgInfoAndDesc(Gmm *gmm, ImageInfo &imgInfo, ImagePl
|
||||
}
|
||||
|
||||
template <typename D3D>
|
||||
const ClSurfaceFormatInfo *D3DSharing<D3D>::findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features) {
|
||||
const ClSurfaceFormatInfo *D3DSharing<D3D>::findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported) {
|
||||
ArrayRef<const ClSurfaceFormatInfo> formats = SurfaceFormats::surfaceFormats(flags, supportsOcl20Features);
|
||||
for (auto &format : formats) {
|
||||
if (gmmFormat == format.surfaceFormat.GMMSurfaceFormat) {
|
||||
return &format;
|
||||
}
|
||||
}
|
||||
if (packedSupported) {
|
||||
formats = SurfaceFormats::packed();
|
||||
for (auto &format : formats) {
|
||||
if (gmmFormat == format.surfaceFormat.GMMSurfaceFormat) {
|
||||
return &format;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class D3DSharing : public SharingHandler {
|
||||
unsigned int &getSubresource() { return subresource; }
|
||||
typename D3DQuery *getQuery() { return d3dQuery; }
|
||||
bool isSharedResource() { return sharedResource; }
|
||||
static const ClSurfaceFormatInfo *findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features);
|
||||
static const ClSurfaceFormatInfo *findSurfaceFormatInfo(GMM_RESOURCE_FORMAT_ENUM gmmFormat, cl_mem_flags flags, bool supportsOcl20Features, bool packedSupported);
|
||||
static bool isFormatWithPlane1(DXGI_FORMAT format);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -99,17 +99,17 @@ Image *D3DTexture<D3D>::create2d(Context *context, D3DTexture2d *d3dTexture, cl_
|
||||
|
||||
auto d3dTextureObj = new D3DTexture<D3D>(context, d3dTexture, subresource, textureStaging, sharedResource);
|
||||
|
||||
auto hwInfo = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
const ClSurfaceFormatInfo *clSurfaceFormat = nullptr;
|
||||
if ((textureDesc.Format == DXGI_FORMAT_NV12) || (textureDesc.Format == DXGI_FORMAT_P010) || (textureDesc.Format == DXGI_FORMAT_P016)) {
|
||||
clSurfaceFormat = findYuvSurfaceFormatInfo(textureDesc.Format, imagePlane, flags);
|
||||
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
|
||||
} else {
|
||||
clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features, hwHelper.packedFormatsSupported());
|
||||
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
|
||||
}
|
||||
|
||||
auto hwInfo = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
if (alloc->getDefaultGmm()->unifiedAuxTranslationCapable()) {
|
||||
alloc->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(*hwInfo) ? memoryManager->mapAuxGpuVA(alloc)
|
||||
: true;
|
||||
@@ -182,14 +182,14 @@ Image *D3DTexture<D3D>::create3d(Context *context, D3DTexture3d *d3dTexture, cl_
|
||||
|
||||
updateImgInfoAndDesc(alloc->getDefaultGmm(), imgInfo, ImagePlane::NO_PLANE, 0u);
|
||||
|
||||
auto hwInfo = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
auto d3dTextureObj = new D3DTexture<D3D>(context, d3dTexture, subresource, textureStaging, sharedResource);
|
||||
auto *clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features);
|
||||
auto *clSurfaceFormat = findSurfaceFormatInfo(alloc->getDefaultGmm()->gmmResourceInfo->getResourceFormat(), flags, context->getDevice(0)->getHardwareInfo().capabilityTable.supportsOcl21Features, hwHelper.packedFormatsSupported());
|
||||
imgInfo.qPitch = alloc->getDefaultGmm()->queryQPitch(GMM_RESOURCE_TYPE::RESOURCE_3D);
|
||||
|
||||
imgInfo.surfaceFormat = &clSurfaceFormat->surfaceFormat;
|
||||
|
||||
auto hwInfo = memoryManager->peekExecutionEnvironment().rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
||||
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
|
||||
if (alloc->getDefaultGmm()->unifiedAuxTranslationCapable()) {
|
||||
alloc->getDefaultGmm()->isRenderCompressed = hwHelper.isPageTableManagerSupported(*hwInfo) ? memoryManager->mapAuxGpuVA(alloc)
|
||||
: true;
|
||||
|
||||
Reference in New Issue
Block a user