mirror of https://github.com/intel/gmmlib.git
Fail if pTextureCalc is NULL (#196)
This commit is contained in:
parent
dcc4b85ea3
commit
e2a8b80fb1
|
@ -447,6 +447,13 @@ GMM_STATUS GMM_STDCALL GmmLib::GmmResourceInfoCommon::Create(Context &GmmLibCont
|
|||
pPlatform = GMM_OVERRIDE_PLATFORM_INFO(&Surf, GetGmmLibContext());
|
||||
pTextureCalc = GMM_OVERRIDE_TEXTURE_CALC(&Surf, GetGmmLibContext());
|
||||
|
||||
if (!pTextureCalc)
|
||||
{
|
||||
Status = GMM_ERROR;
|
||||
GMM_ASSERTDPF(0, "Texture Calculation pointer is NULL.");
|
||||
goto ERROR_CASE;
|
||||
}
|
||||
|
||||
#if defined(__GMM_KMD__) || !defined(_WIN32)
|
||||
if(!CreateParams.Flags.Info.ExistingSysMem)
|
||||
#else
|
||||
|
|
|
@ -443,6 +443,12 @@ uint8_t GMM_STDCALL GmmLib::GmmResourceInfoCommon::ValidateParams()
|
|||
pPlatformResource = GMM_OVERRIDE_PLATFORM_INFO(&Surf, GetGmmLibContext());
|
||||
pTextureCalc = GMM_OVERRIDE_TEXTURE_CALC(&Surf, GetGmmLibContext());
|
||||
|
||||
if (!pTextureCalc)
|
||||
{
|
||||
GMM_ASSERTDPF(0, "Texture Calculation pointer is NULL.");
|
||||
goto ERROR_CASE;
|
||||
}
|
||||
|
||||
__GMM_ASSERT(!(
|
||||
Surf.Flags.Gpu.Query &&
|
||||
!Surf.Flags.Info.Cacheable)); // Why query not set as cacheable? If not cacheable, what keeps from stolen memory (because STORE_DWORD/PIPE_CONTROL/etc. targets can't be in stolen)?
|
||||
|
|
|
@ -76,7 +76,10 @@ void GmmLib::GmmResourceInfoCommon::GetRestrictions(__GMM_BUFFER_TYPE &Restricti
|
|||
|
||||
GMM_TEXTURE_CALC *pTextureCalc = NULL;
|
||||
pTextureCalc = GMM_OVERRIDE_TEXTURE_CALC(&Surf, GetGmmLibContext());
|
||||
pTextureCalc->GetResRestrictions(&Surf, Restrictions);
|
||||
if (pTextureCalc)
|
||||
{
|
||||
pTextureCalc->GetResRestrictions(&Surf, Restrictions);
|
||||
}
|
||||
|
||||
GMM_DPF_EXIT;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue