Skip to content

Commit ac964bd

Browse files
authored
Failing the resource allocation if the U plane offset exceeds the HW limitations (#191)
1 parent 93cf7ea commit ac964bd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Source/GmmLib/Texture/GmmTextureAlloc.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,17 @@ bool GmmLib::GmmTextureCalc::ValidateTexInfo(GMM_TEXTURE_INFO * pTexInfo,
349349
return false;
350350
}
351351

352+
if(GmmIsPlanar(pTexInfo->Format))
353+
{
354+
if((!GmmIsReconstructableSurface(pTexInfo->Format)) && (pTexInfo->OffsetInfo.Plane.Y[GMM_PLANE_U] >= GMM_MAX_UV_PLANE_Y_OFFSET))
355+
{
356+
GMM_ASSERTDPF(0,
357+
"GmmLib::GmmTextureCalc::ValidateTexInfo:Y offset of U plane"
358+
"exceeds max HW U plane Y offset restriction.\r\n");
359+
return false;
360+
}
361+
}
362+
352363
GMM_DPF_EXIT;
353364
return true;
354365
}

Source/GmmLib/inc/External/Common/GmmConst.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ OTHER DEALINGS IN THE SOFTWARE.
5454
#define GMM_MEDIA_COMPRESSION_STATE_SIZE (64)
5555
#define GMM_CLEAR_COLOR_FLOAT_SIZE (16)
5656
#define GMM_MAX_LCU_SIZE 64 // Media Largest coding Unit
57+
#define GMM_MAX_UV_PLANE_Y_OFFSET GMM_KBYTE(16) // RENDER_SURFACE_STATE limits to write Y Offset for U or UV Plane so that max value is < 16384

0 commit comments

Comments
 (0)