gfxD3D11CardProfiler.cpp
Engine/source/gfx/D3D11/gfxD3D11CardProfiler.cpp
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2015 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#include "gfx/D3D11/gfxD3D11CardProfiler.h" 25#include "gfx/D3D11/gfxD3D11Device.h" 26#include "gfx/D3D11/gfxD3D11EnumTranslate.h" 27#include "platformWin32/videoInfo/wmiVideoInfo.h" 28#include "console/console.h" 29#include "gfx/primBuilder.h" 30 31 32GFXD3D11CardProfiler::GFXD3D11CardProfiler() : GFXCardProfiler() 33{ 34} 35 36GFXD3D11CardProfiler::~GFXD3D11CardProfiler() 37{ 38 39} 40 41void GFXD3D11CardProfiler::init() 42{ 43 U32 adapterIndex = D3D11->getAdaterIndex(); 44 WMIVideoInfo wmiVidInfo; 45 if (wmiVidInfo.profileAdapters()) 46 { 47 const PlatformVideoInfo::PVIAdapter &adapter = wmiVidInfo.getAdapterInformation(adapterIndex); 48 49 mCardDescription = adapter.description; 50 mChipSet = adapter.chipSet; 51 mVersionString = adapter.driverVersion; 52 mVideoMemory = adapter.vram; 53 } 54 Parent::init(); 55} 56 57void GFXD3D11CardProfiler::setupCardCapabilities() 58{ 59 setCapability("maxTextureWidth", D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION); 60 setCapability("maxTextureHeight", D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION); 61 setCapability("maxTextureSize", D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION); 62} 63 64bool GFXD3D11CardProfiler::_queryCardCap(const String &query, U32 &foundResult) 65{ 66 return false; 67} 68 69bool GFXD3D11CardProfiler::_queryFormat( const GFXFormat fmt, const GFXTextureProfile *profile, bool &inOutAutogenMips ) 70{ 71 // D3D11 feature level should guarantee that any format is valid! 72 return GFXD3D11TextureFormat[fmt] != DXGI_FORMAT_UNKNOWN; 73} 74