| 1 |
/*============================================================================== |
| 2 |
Copyright(c) 2019 Intel Corporation |
| 3 |
|
| 4 |
Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
copy of this software and associated documentation files(the "Software"), |
| 6 |
to deal in the Software without restriction, including without limitation |
| 7 |
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
and / or sell copies of the Software, and to permit persons to whom the |
| 9 |
Software is furnished to do so, subject to the following conditions: |
| 10 |
|
| 11 |
The above copyright notice and this permission notice shall be included |
| 12 |
in all copies or substantial portions of the Software. |
| 13 |
|
| 14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
============================================================================*/ |
| 22 |
|
| 23 |
#pragma once |
| 24 |
#ifdef __cplusplus |
| 25 |
#include "GmmGen11TextureCalc.h" |
| 26 |
#include "../Platform/GmmGen12Platform.h" |
| 27 |
|
| 28 |
///////////////////////////////////////////////////////////////////////////////////// |
| 29 |
/// @file GmmGen12TextureCalc.h |
| 30 |
/// @brief This file contains the functions and members definations for texture alloc- |
| 31 |
/// ation on all Gen12 platforms. |
| 32 |
///////////////////////////////////////////////////////////////////////////////////// |
| 33 |
namespace GmmLib |
| 34 |
{ |
| 35 |
///////////////////////////////////////////////////////////////////////// |
| 36 |
/// Contains texture calc functions and members for Gen12 platforms. |
| 37 |
/// This class is derived from the base GmmTextureCalc class so clients |
| 38 |
/// shouldn't have to ever interact with this class directly. |
| 39 |
///////////////////////////////////////////////////////////////////////// |
| 40 |
class NON_PAGED_SECTION GmmGen12TextureCalc : |
| 41 |
public GmmGen11TextureCalc |
| 42 |
{ |
| 43 |
private: |
| 44 |
|
| 45 |
protected: |
| 46 |
virtual uint32_t GetMipTailByteOffset( |
| 47 |
GMM_TEXTURE_INFO *pTexInfo, |
| 48 |
uint32_t MipLevel); |
| 49 |
|
| 50 |
virtual void GetMipTailGeometryOffset( |
| 51 |
GMM_TEXTURE_INFO *pTexInfo, |
| 52 |
uint32_t MipLevel, |
| 53 |
uint32_t * OffsetX, |
| 54 |
uint32_t * OffsetY, |
| 55 |
uint32_t * OffsetZ); |
| 56 |
|
| 57 |
virtual uint32_t Get2DMipMapHeight( |
| 58 |
GMM_TEXTURE_INFO *pTexInfo); |
| 59 |
virtual GMM_STATUS FillTexCCS( |
| 60 |
GMM_TEXTURE_INFO *pSurf, |
| 61 |
GMM_TEXTURE_INFO *pAuxTexInfo); |
| 62 |
public: |
| 63 |
/* Constructors */ |
| 64 |
GmmGen12TextureCalc(Context *pGmmLibContext) |
| 65 |
: GmmGen11TextureCalc(pGmmLibContext) |
| 66 |
{ |
| 67 |
|
| 68 |
} |
| 69 |
|
| 70 |
~GmmGen12TextureCalc() |
| 71 |
{ |
| 72 |
|
| 73 |
} |
| 74 |
|
| 75 |
/* Function prototypes */ |
| 76 |
|
| 77 |
virtual GMM_STATUS GMM_STDCALL FillTex2D(GMM_TEXTURE_INFO *pTexInfo, |
| 78 |
__GMM_BUFFER_TYPE *pRestrictions); |
| 79 |
|
| 80 |
|
| 81 |
virtual GMM_STATUS GMM_STDCALL FillTexPlanar(GMM_TEXTURE_INFO *pTexInfo, |
| 82 |
__GMM_BUFFER_TYPE *pRestrictions); |
| 83 |
|
| 84 |
virtual GMM_STATUS GMM_STDCALL GetCCSScaleFactor(GMM_TEXTURE_INFO * pTexInfo, |
| 85 |
CCS_UNIT& ScaleFactor); |
| 86 |
|
| 87 |
GMM_STATUS GMM_STDCALL GetCCSExMode(GMM_TEXTURE_INFO * AuxSurf); |
| 88 |
|
| 89 |
virtual uint32_t GMM_STDCALL ScaleTextureHeight(GMM_TEXTURE_INFO * pTexInfo, |
| 90 |
uint32_t Height); |
| 91 |
|
| 92 |
virtual uint32_t GMM_STDCALL ScaleTextureWidth (GMM_TEXTURE_INFO* pTexInfo, |
| 93 |
uint32_t Width); |
| 94 |
|
| 95 |
virtual uint32_t GMM_STDCALL ScaleFCRectHeight(GMM_TEXTURE_INFO * pTexInfo, |
| 96 |
uint32_t Height); |
| 97 |
|
| 98 |
virtual uint64_t GMM_STDCALL ScaleFCRectWidth(GMM_TEXTURE_INFO* pTexInfo, |
| 99 |
uint64_t Width); |
| 100 |
virtual GMM_STATUS GMM_STDCALL MSAACCSUsage(GMM_TEXTURE_INFO *pTexInfo); |
| 101 |
virtual void GMM_STDCALL AllocateOneTileThanRequied(GMM_TEXTURE_INFO *pTexInfo, |
| 102 |
GMM_GFX_SIZE_T &WidthBytesRender, |
| 103 |
GMM_GFX_SIZE_T &WidthBytesPhysical, |
| 104 |
GMM_GFX_SIZE_T &WidthBytesLock) |
| 105 |
{ |
| 106 |
GMM_UNREFERENCED_PARAMETER(pTexInfo); |
| 107 |
GMM_UNREFERENCED_PARAMETER(WidthBytesRender); |
| 108 |
GMM_UNREFERENCED_PARAMETER(WidthBytesPhysical); |
| 109 |
GMM_UNREFERENCED_PARAMETER(WidthBytesLock); |
| 110 |
} |
| 111 |
virtual uint64_t GMM_STDCALL Get2DFCSurfaceWidthFor3DSurface(GMM_TEXTURE_INFO *pTexInfo, |
| 112 |
uint64_t Width); |
| 113 |
virtual uint64_t GMM_STDCALL Get2DFCSurfaceHeightFor3DSurface(GMM_TEXTURE_INFO *pTexInfo, |
| 114 |
uint32_t Height, |
| 115 |
uint32_t Depth); |
| 116 |
|
| 117 |
/* inline functions */ |
| 118 |
}; |
| 119 |
} |
| 120 |
#endif // #ifdef __cplusplus |