Fixed mip count programming in surface state for regular images

This commit addresses crashes during AUB playbacks in image scenarios.

Change-Id: I6d2f3917cdb3458c62382205c1a17bdc57239bb4
This commit is contained in:
Milczarek, Slawomir
2018-04-04 14:52:17 +02:00
committed by sys_ocldev
parent b6b92ae808
commit 6506df559b
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -110,7 +110,7 @@ void ImageHw<GfxFamily>::setImageArg(void *memory, bool setAsMediaBlockImage, ui
surfaceState->setRenderTargetViewExtent(renderTargetViewExtent);
surfaceState->setMinimumArrayElement(minimumArrayElement);
surfaceState->setSurfaceMinLod(this->mipLevel + mipLevel);
surfaceState->setMipCountLod(this->mipCount - 1);
surfaceState->setMipCountLod((this->mipCount > 0) ? (this->mipCount - 1) : 0);
// SurfaceQpitch is in rows but must be a multiple of VALIGN
surfaceState->setSurfaceQpitch(qPitch);