1 /* 2 * Copyright (c) 2017, 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 //! \file cm_surface_sampler8x8.h 24 //! \brief Contains Class CmSurfaceSampler8x8 definitions 25 //! 26 #pragma once 27 #include "cm_surface.h" 28 29 namespace CMRT_UMD 30 { 31 class CmSurfaceSampler8x8 : public CmSurface 32 { 33 public: 34 static int32_t Create( 35 uint32_t index, 36 uint32_t indexFor2D, 37 uint32_t cmIndex, 38 CmSurfaceManager* surfaceManager, 39 CmSurfaceSampler8x8* &surface, 40 CM_SAMPLER8x8_SURFACE sampler8x8Type, 41 CM_SURFACE_ADDRESS_CONTROL_MODE mode, 42 CM_FLAG* flag); 43 44 virtual int32_t GetIndex(SurfaceIndex*& index); 45 int32_t GetIndexCurrent( uint32_t& index ); 46 int32_t GetCmIndex( uint16_t & index ); 47 CM_SAMPLER8x8_SURFACE GetSampler8x8SurfaceType(); 48 CM_SURFACE_ADDRESS_CONTROL_MODE GetAddressControlMode(); 49 int32_t SetMemoryObjectControl(MEMORY_OBJECT_CONTROL memCtrl, MEMORY_TYPE memType, uint32_t age); 50 51 //NOT depend on RTTI::dynamic_cast Type()52 CM_ENUM_CLASS_TYPE Type() const {return CM_ENUM_CLASS_TYPE_CMSURFACESAMPLER8X8;}; 53 54 protected: 55 CmSurfaceSampler8x8( 56 uint32_t cmIndex, //SurfaceIndex's ID for 2D, also indexing surface array in cmrt@umd 57 uint32_t indexFor2D, 58 CmSurfaceManager* surfaceManager, 59 CM_SAMPLER8x8_SURFACE sampler8x8Type, 60 CM_SURFACE_ADDRESS_CONTROL_MODE mode, 61 CM_FLAG* flag); 62 ~CmSurfaceSampler8x8( void ); 63 64 int32_t Initialize( uint32_t index ); 65 uint32_t m_indexFor2D; 66 uint32_t m_surfaceIndex; 67 CM_SAMPLER8x8_SURFACE m_sampler8x8Type; 68 CM_SURFACE_ADDRESS_CONTROL_MODE m_nAddressMode; 69 CM_FLAG m_flag; 70 71 private: 72 CmSurfaceSampler8x8(const CmSurfaceSampler8x8& other); 73 CmSurfaceSampler8x8& operator=(const CmSurfaceSampler8x8& other); 74 }; 75 }; //namespace 76 77