//------------------------------------------------------------------------------
// Lamp : Open source game middleware
// Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
//------------------------------------------------------------------------------

/** @file
 * グラフィックスデバイス能力実装
 * @author Junpee
 */

#include "LampBasic.h"
#include "Graphics/System/GraphicsDeviceCapacity.h"
#include "Graphics/System/GraphicsDeviceSettings.h"
#include "Graphics/Enumeration/GraphicsAdapterInformation.h"
#include "Graphics/Enumeration/GraphicsDeviceInformation.h"
#include "Graphics/Enumeration/GraphicsDeviceComboInformation.h"
#include "Graphics/System/GraphicsDevice.h"
#include "Graphics/Primitive/GraphicsBufferFormat.h"

namespace Lamp{

// インスタンス
GraphicsDeviceCapacity* GraphicsDeviceCapacity::instance_ = NULL;

//------------------------------------------------------------------------------
// コンストラクタ
GraphicsDeviceCapacity::GraphicsDeviceCapacity(){
	Assert(instance_ == NULL);
	instance_ = this;
}
//------------------------------------------------------------------------------
// デストラクタ
GraphicsDeviceCapacity::~GraphicsDeviceCapacity(){
	Assert(instance_ == this);
	instance_ = NULL;
}
//------------------------------------------------------------------------------
// デバイスがリセットされた
void GraphicsDeviceCapacity::deviceReset(Direct3DDevice* direct3DDevice){
	// デバイス能力の再取得
	direct3DDevice->GetDeviceCaps(&capacity_);

	//--------------------------------------------------------------------------
	// デバイス情報
	//--------------------------------------------------------------------------
	GraphicsDeviceSettings* settings = GraphicsDeviceSettings::getInstance();
	GraphicsAdapterInformation* adapterInfo = settings->getAdapterInformation();
	GraphicsDeviceInformation* deviceInfo = settings->getDeviceInformation();
	GraphicsDeviceComboInformation* deviceComboInfo =
		settings->getDeviceComboInformation();
	deviceName_ = adapterInfo->getName();
	driverName_ = adapterInfo->getDriverName();
	// capacity_に同一データ有り
	deviceOrdinal_ = adapterInfo->getAdapterOrdinal();
	Assert(adapterInfo->getAdapterOrdinal() == capacity_.AdapterOrdinal);
	// capacity_に同一データ有り
	deviceType_ = deviceInfo->getDeviceType();
	Assert(deviceInfo->getDeviceType() == capacity_.DeviceType);
	isWindowed_ = settings->isWindowed();
	vertexProcessingType_ = settings->getVertexProcessingType();
	adapterFormat_ = deviceComboInfo->getAdapterFormat();
	backBufferFormat_ = deviceComboInfo->getBackBufferFormat();
	backBufferSize_ = settings->getBackBufferSize();
	refreshRate_ = settings->getDisplayMode().RefreshRate;
	depthStencilEnabled_ = settings->getDepthStencilEnabled();
	depthStencilFormat_ = settings->getDepthStencilFormat();
	presentationInterval_ = settings->getPresentationInterval();
	multiSampleType_ = settings->getMultiSampleType();
	multiSampleQuality_ = settings->getMultiSampleQuality();

	//--------------------------------------------------------------------------
	// デバイス能力
	//--------------------------------------------------------------------------
	numSimultaneousRTs_ = capacity_.NumSimultaneousRTs;
	executeSystemMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_EXECUTESYSTEMMEMORY) != 0);
	executeVideoMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_EXECUTEVIDEOMEMORY) != 0);
	tlVertexSystemMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_TLVERTEXSYSTEMMEMORY) != 0);
	tlVertexVideoMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_TLVERTEXVIDEOMEMORY) != 0);
	textureSystemMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_TEXTURESYSTEMMEMORY) != 0);
	textureVideoMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_TEXTUREVIDEOMEMORY) != 0);
	drawPrimTlVertex_ =
		((capacity_.DevCaps & D3DDEVCAPS_DRAWPRIMTLVERTEX) != 0);
	canRenderAfterFlip_ =
		((capacity_.DevCaps & D3DDEVCAPS_CANRENDERAFTERFLIP) != 0);
	textureNonLocalVidedMemory_ =
		((capacity_.DevCaps & D3DDEVCAPS_TEXTURENONLOCALVIDMEM) != 0);
	drawPrimitives2_ =
		((capacity_.DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2) != 0);
	separateTextureMemories_ =
		((capacity_.DevCaps & D3DDEVCAPS_SEPARATETEXTUREMEMORIES) != 0);
	drawPrimitives2EX_ =
		((capacity_.DevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) != 0);
	hwTransformAndLight_ =
		((capacity_.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) != 0);
	canBltSystemToNonLocal_ =
		((capacity_.DevCaps & D3DDEVCAPS_CANBLTSYSTONONLOCAL) != 0);
	hwRasterization_ =
		((capacity_.DevCaps & D3DDEVCAPS_HWRASTERIZATION) != 0);
	pureDevice_ =
		((capacity_.DevCaps & D3DDEVCAPS_PUREDEVICE) != 0);
	quinticRtPatches_ =
		((capacity_.DevCaps & D3DDEVCAPS_QUINTICRTPATCHES) != 0);
	rtPatches_ =
		((capacity_.DevCaps & D3DDEVCAPS_RTPATCHES) != 0);
	rtPatchHanldeZero_ =
		((capacity_.DevCaps & D3DDEVCAPS_RTPATCHHANDLEZERO) != 0);
	nPatches_ =
		((capacity_.DevCaps & D3DDEVCAPS_NPATCHES) != 0);
	presentationIntervalImmediate_ =
		((capacity_.PresentationIntervals &
		D3DPRESENT_INTERVAL_IMMEDIATE) != 0);
	presentationIntervalOne_ =
		((capacity_.PresentationIntervals & D3DPRESENT_INTERVAL_ONE) != 0);
	presentationIntervalTwo_ =
		((capacity_.PresentationIntervals & D3DPRESENT_INTERVAL_TWO) != 0);
	presentationIntervalThree_ =
		((capacity_.PresentationIntervals & D3DPRESENT_INTERVAL_THREE) != 0);
	presentationIntervalFour_ =
		((capacity_.PresentationIntervals & D3DPRESENT_INTERVAL_FOUR) != 0);
	cursorColor_ =
		((capacity_.CursorCaps & D3DCURSORCAPS_COLOR) != 0);
	cursorLowRes_ =
		((capacity_.CursorCaps & D3DCURSORCAPS_LOWRES) != 0);
	stretchRectMinPoint_ =
		((capacity_.StretchRectFilterCaps & D3DPTFILTERCAPS_MINFPOINT) != 0);
	stretchRectMagPoint_ =
		((capacity_.StretchRectFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) != 0);
	stretchRectMinLinear_ =
		((capacity_.StretchRectFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) != 0);
	stretchRectMagLinear_ =
		((capacity_.StretchRectFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) != 0);

	//--------------------------------------------------------------------------
	// デバイスその他
	//--------------------------------------------------------------------------
	masterAdapterOrdinal_ = capacity_.MasterAdapterOrdinal;
	adapterOrdinalInGroup_ = capacity_.AdapterOrdinalInGroup;
	numberOfAdaptersInGroup_ = capacity_.NumberOfAdaptersInGroup;
	maskZ_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_MASKZ) != 0);
	cullNone_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_CULLNONE) != 0);
	cullCW_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_CULLCW) != 0);
	cullCCW_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_CULLCCW) != 0);
	colorWriteEnable_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_COLORWRITEENABLE) != 0);
	clipPlaneScaledPoints_ =
		((capacity_.PrimitiveMiscCaps &
		D3DPMISCCAPS_CLIPPLANESCALEDPOINTS) != 0);
	clipTlVerts_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_CLIPTLVERTS) != 0);
	tssArgTemp_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP) != 0);
	blendOp_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_BLENDOP) != 0);
	nullReference_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_NULLREFERENCE) != 0);
	independentWriteMasks_ =
		((capacity_.PrimitiveMiscCaps &
		D3DPMISCCAPS_INDEPENDENTWRITEMASKS) != 0);
	perStageConstant_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_PERSTAGECONSTANT) != 0);
	fogAndSpecularAlpha_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_FOGANDSPECULARALPHA) != 0);
	separateAlphaBlend_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND) != 0);
	mrtIndependentBitDepth_ =
		((capacity_.PrimitiveMiscCaps &
		D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS) != 0);
	mrtPostPixelShaderBlending_ =
		((capacity_.PrimitiveMiscCaps &
		D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING) != 0);
	fogVertexClamped_ =
		((capacity_.PrimitiveMiscCaps & D3DPMISCCAPS_FOGVERTEXCLAMPED) != 0);

	//--------------------------------------------------------------------------
	// ドライバ能力
	//--------------------------------------------------------------------------
	readScanLine_ =
		((capacity_.Caps & D3DCAPS_READ_SCANLINE) != 0);
	fullscreenGamma_ =
		((capacity_.Caps2 & D3DCAPS2_FULLSCREENGAMMA) != 0);
	canCalibrateGamma_ =
		((capacity_.Caps2 & D3DCAPS2_CANCALIBRATEGAMMA) != 0);
	canManageResource_ =
		((capacity_.Caps2 & D3DCAPS2_CANMANAGERESOURCE) != 0);
	dynamicTextures_ =
		((capacity_.Caps2 & D3DCAPS2_DYNAMICTEXTURES) != 0);
	canAutogenMipmap_ =
		((capacity_.Caps2 & D3DCAPS2_CANAUTOGENMIPMAP) != 0);
	alphaFullscreenFlipOrDiscard_ =
		((capacity_.Caps3 & D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD) != 0);
	linerToSrgbPresentation_ =
		((capacity_.Caps3 & D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION) != 0);
	copyToVideoMemory_ =
		((capacity_.Caps3 & D3DCAPS3_COPY_TO_VIDMEM) != 0);
	copyToSystemMemory_ =
		((capacity_.Caps3 & D3DCAPS3_COPY_TO_SYSTEMMEM) != 0);

	//--------------------------------------------------------------------------
	// プリミティブ
	//--------------------------------------------------------------------------
	maxPointSize_ = capacity_.MaxPointSize;
	lineTexture_ =		((capacity_.LineCaps & D3DLINECAPS_TEXTURE) != 0);
	lineZTest_ =		((capacity_.LineCaps & D3DLINECAPS_ZTEST) != 0);
	lineBlend_ =		((capacity_.LineCaps & D3DLINECAPS_BLEND) != 0);
	lineAlphaCompare_ =	((capacity_.LineCaps & D3DLINECAPS_ALPHACMP) != 0);
	lineFog_ =			((capacity_.LineCaps & D3DLINECAPS_FOG) != 0);
	lineAntialias_ =	((capacity_.LineCaps & D3DLINECAPS_ANTIALIAS) != 0);

	//--------------------------------------------------------------------------
	// 頂点処理
	//--------------------------------------------------------------------------
	maxPrimitiveCount_ = capacity_.MaxPrimitiveCount;
	maxVertexIndex_ = capacity_.MaxVertexIndex;
	maxStreams_ = capacity_.MaxStreams;
	maxActiveLights_ = capacity_.MaxActiveLights;
	maxVertexW_ = capacity_.MaxVertexW;
	maxVertexBlendMatrices_ = capacity_.MaxVertexBlendMatrices;
	maxVertexBlendMatrixIndex_ = capacity_.MaxVertexBlendMatrixIndex;
	guardBandLeft_ = capacity_.GuardBandLeft;
	guardBandTop_ = capacity_.GuardBandTop;
	guardBandRight_ = capacity_.GuardBandRight;
	guardBandBottom_ = capacity_.GuardBandBottom;
	maxUserCliplanes_ = capacity_.MaxUserClipPlanes;
	texGen_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN) != 0);
	materialSource_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_MATERIALSOURCE7) != 0);
	directionalLights_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_DIRECTIONALLIGHTS) != 0);
	positionalLights_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_POSITIONALLIGHTS) != 0);
	localViewer_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_LOCALVIEWER) != 0);
	tweening_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_TWEENING) != 0);
	texgenSpheremap_ =
		((capacity_.VertexProcessingCaps & D3DVTXPCAPS_TEXGEN_SPHEREMAP) != 0);
	noTexgenNonLocalViewer_ =
		((capacity_.VertexProcessingCaps &
		D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER) != 0);

	//--------------------------------------------------------------------------
	// 頂点フォーマット
	//--------------------------------------------------------------------------
	fvfTexCoordCountMask_ =
		((capacity_.FVFCaps & D3DFVFCAPS_TEXCOORDCOUNTMASK) != 0);
	fvfDoNotStripElements_ =
		((capacity_.FVFCaps & D3DFVFCAPS_DONOTSTRIPELEMENTS) != 0);
	fvfPSize_ = ((capacity_.FVFCaps & D3DFVFCAPS_PSIZE) != 0);
	declUByte4_ = ((capacity_.DeclTypes & D3DDTCAPS_UBYTE4) != 0);
	declUByte4N_ = ((capacity_.DeclTypes & D3DDTCAPS_UBYTE4N) != 0);
	declShort2N_ = ((capacity_.DeclTypes & D3DDTCAPS_SHORT2N) != 0);
	declShort4N_ = ((capacity_.DeclTypes & D3DDTCAPS_SHORT4N) != 0);
	declUShort2N_ = ((capacity_.DeclTypes & D3DDTCAPS_USHORT2N) != 0);
	declUShort4N_ = ((capacity_.DeclTypes & D3DDTCAPS_USHORT4N) != 0);
	declUDec3_ = ((capacity_.DeclTypes & D3DDTCAPS_UDEC3) != 0);
	declDec3_ = ((capacity_.DeclTypes & D3DDTCAPS_DEC3N) != 0);
	declFloat16_2_ = ((capacity_.DeclTypes & D3DDTCAPS_FLOAT16_2) != 0);
	declFloat16_4_ = ((capacity_.DeclTypes & D3DDTCAPS_FLOAT16_4) != 0);

	//--------------------------------------------------------------------------
	// テッセレーション
	//--------------------------------------------------------------------------
	maxNPatchTesselationLevel_ = capacity_.MaxNpatchTessellationLevel;
	streamOffset_ =
		((capacity_.DevCaps2 & D3DDEVCAPS2_STREAMOFFSET) != 0);
	dmapNPatch_ =
		((capacity_.DevCaps2 & D3DDEVCAPS2_DMAPNPATCH) != 0);
	adaptiveTessRTPatch_ =
		((capacity_.DevCaps2 & D3DDEVCAPS2_ADAPTIVETESSRTPATCH) != 0);
	adaptiveTessNPatch_ =
		((capacity_.DevCaps2 & D3DDEVCAPS2_ADAPTIVETESSNPATCH) != 0);
	canStretchRectFromTextures_ =
		((capacity_.DevCaps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES) != 0);
	preSampledDmapNPatch_ =
		((capacity_.DevCaps2 & D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH) != 0);
	vertexElementsCanShareStreamOffset_ =
		((capacity_.DevCaps2 &
		D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET) != 0);

	//--------------------------------------------------------------------------
	// シェーディング
	//--------------------------------------------------------------------------
	shadeColorGouraudRGB_ =
		((capacity_.ShadeCaps & D3DPSHADECAPS_COLORGOURAUDRGB) != 0);
	shadeSpecularGouraudRGB_ =
		((capacity_.ShadeCaps & D3DPSHADECAPS_SPECULARGOURAUDRGB) != 0);
	shadeAlphaGouraudBlend_ =
		((capacity_.ShadeCaps & D3DPSHADECAPS_ALPHAGOURAUDBLEND) != 0);
	shadeFogGouraud_ =
		((capacity_.ShadeCaps & D3DPSHADECAPS_FOGGOURAUD) != 0);

	//--------------------------------------------------------------------------
	// テクスチャ
	//--------------------------------------------------------------------------
	maxTextureSize_.set(capacity_.MaxTextureWidth, capacity_.MaxTextureHeight);
	maxVolumeExtent_ = capacity_.MaxVolumeExtent;
	maxTextureRepeat_ = capacity_.MaxTextureRepeat;
	maxAnisotropy_ = capacity_.MaxAnisotropy;
	maxTextureAspectRaito_ = capacity_.MaxTextureAspectRatio;
	texturePerspective_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_PERSPECTIVE) != 0);
	texturePow2_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_POW2) != 0);
	textureAlpha_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_ALPHA) != 0);
	textureSquareOnly_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) != 0);
	textureRepeatNotScaledBySize_ =
		((capacity_.TextureCaps &
		D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE) != 0);
	textureAlphaPalette_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) != 0);
	textureNonPow2Conditional_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) != 0);
	textureProjected_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_PROJECTED) != 0);
	textureCubemap_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_CUBEMAP) != 0);
	textureVolumemap_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP) != 0);
	textureMipmap_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_MIPMAP) != 0);
	textureMipmapCubemap_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP) != 0);
	textureMipmapVolumemap_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_MIPVOLUMEMAP) != 0);
	textureCubemapPow2_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2) != 0);
	textureVolumemapPow2_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP_POW2) != 0);
	textureNoProjectedBumpEnvironment_ =
		((capacity_.TextureCaps & D3DPTEXTURECAPS_NOPROJECTEDBUMPENV) != 0);

	//--------------------------------------------------------------------------
	// テクスチャアドレス
	//--------------------------------------------------------------------------
	textureAddressWrap_ =
		((capacity_.TextureAddressCaps & D3DPTADDRESSCAPS_WRAP) != 0);
	textureAddressMirror_ =
		((capacity_.TextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) != 0);
	textureAddressClamp_ =
		((capacity_.TextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) != 0);
	textureAddressBorder_ =
		((capacity_.TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) != 0);
	textureAddressIndependentUV_ =
		((capacity_.TextureAddressCaps & D3DPTADDRESSCAPS_INDEPENDENTUV) != 0);
	textureAddressMirrorOnce_ =
		((capacity_.TextureAddressCaps & D3DPTADDRESSCAPS_MIRRORONCE) != 0);
	volumeTextureAddressWrap_ =
		((capacity_.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_WRAP) != 0);
	volumeTextureAddressMirror_ =
		((capacity_.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_MIRROR) != 0);
	volumeTextureAddressClamp_ =
		((capacity_.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_CLAMP) != 0);
	volumeTextureAddressBorder_ =
		((capacity_.VolumeTextureAddressCaps & D3DPTADDRESSCAPS_BORDER) != 0);
	volumeTextureAddressIndependentUV_ =
		((capacity_.VolumeTextureAddressCaps &
		D3DPTADDRESSCAPS_INDEPENDENTUV) != 0);
	volumeTextureAddressMirrorOnce_ =
		((capacity_.VolumeTextureAddressCaps &
		D3DPTADDRESSCAPS_MIRRORONCE) != 0);

	//--------------------------------------------------------------------------
	// テクスチャフィルタ
	//--------------------------------------------------------------------------
	textureFilterMinPoint_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT) != 0);
	textureFilterMinLiner_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) != 0);
	textureFilterMinAnisotropic_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MINFANISOTROPIC) != 0);
	textureFilterMinPyramidalQuad_ =
		((capacity_.TextureFilterCaps &
		D3DPTFILTERCAPS_MINFPYRAMIDALQUAD) != 0);
	textureFilterMinGaussianQuad_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MINFGAUSSIANQUAD) != 0);
	textureFilterMagPoint_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) != 0);
	textureFilterMagLiner_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) != 0);
	textureFilterMagAnisotropic_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0);
	textureFilterMagPyramidalQuad_ =
		((capacity_.TextureFilterCaps &
		D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD) != 0);
	textureFilterMagGaussianQuad_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MAGFGAUSSIANQUAD) != 0);
	textureFilterMipmapPoint_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT) != 0);
	textureFilterMipmapLiner_ =
		((capacity_.TextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR) != 0);

	cubeTextureFilterMinPoint_ =
		((capacity_.CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT) != 0);
	cubeTextureFilterMinLiner_ =
		((capacity_.CubeTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) != 0);
	cubeTextureFilterMinAnisotropic_ =
		((capacity_.CubeTextureFilterCaps &
		D3DPTFILTERCAPS_MINFANISOTROPIC) != 0);
	cubeTextureFilterMinPyramidalQuad_ =
		((capacity_.CubeTextureFilterCaps &
		D3DPTFILTERCAPS_MINFPYRAMIDALQUAD) != 0);
	cubeTextureFilterMinGaussianQuad_ =
		((capacity_.CubeTextureFilterCaps &
		D3DPTFILTERCAPS_MINFGAUSSIANQUAD) != 0);
	cubeTextureFilterMagPoint_ =
		((capacity_.CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) != 0);
	cubeTextureFilterMagLiner_ =
		((capacity_.CubeTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) != 0);
	cubeTextureFilterMagAnisotropic_ =
		((capacity_.CubeTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0);
	cubeTextureFilterMagPyramidalQuad_ =
		((capacity_.CubeTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD) != 0);
	cubeTextureFilterMagGaussianQuad_ =
		((capacity_.CubeTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFGAUSSIANQUAD) != 0);
	cubeTextureFilterMipmapPoint_ =
		((capacity_.CubeTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT) != 0);
	cubeTextureFilterMipmapLiner_ =
		((capacity_.CubeTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR) != 0);

	volumeTextureFilterMinPoint_ =
		((capacity_.VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT) != 0);
	volumeTextureFilterMinLiner_ =
		((capacity_.VolumeTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) != 0);
	volumeTextureFilterMinAnisotropic_ =
		((capacity_.VolumeTextureFilterCaps &
		D3DPTFILTERCAPS_MINFANISOTROPIC) != 0);
	volumeTextureFilterMinPyramidalQuad_ =
		((capacity_.VolumeTextureFilterCaps &
		D3DPTFILTERCAPS_MINFPYRAMIDALQUAD) != 0);
	volumeTextureFilterMinGaussianQuad_ =
		((capacity_.VolumeTextureFilterCaps &
		D3DPTFILTERCAPS_MINFGAUSSIANQUAD) != 0);
	volumeTextureFilterMagPoint_ =
		((capacity_.VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) != 0);
	volumeTextureFilterMagLiner_ =
		((capacity_.VolumeTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) != 0);
	volumeTextureFilterMagAnisotropic_ =
		((capacity_.VolumeTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0);
	volumeTextureFilterMagPyramidalQuad_ =
		((capacity_.VolumeTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD) != 0);
	volumeTextureFilterMagGaussianQuad_ =
		((capacity_.VolumeTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFGAUSSIANQUAD) != 0);
	volumeTextureFilterMipmapPoint_ =
		((capacity_.VolumeTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT) != 0);
	volumeTextureFilterMipmapLiner_ =
		((capacity_.VolumeTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR) != 0);

	vertexTextureFilterMinPoint_ =
		((capacity_.VertexTextureFilterCaps & D3DPTFILTERCAPS_MINFPOINT) != 0);
	vertexTextureFilterMinLiner_ =
		((capacity_.VertexTextureFilterCaps & D3DPTFILTERCAPS_MINFLINEAR) != 0);
	vertexTextureFilterMinAnisotropic_ =
		((capacity_.VertexTextureFilterCaps &
		D3DPTFILTERCAPS_MINFANISOTROPIC) != 0);
	vertexTextureFilterMinPyramidalQuad_ =
		((capacity_.VertexTextureFilterCaps &
		D3DPTFILTERCAPS_MINFPYRAMIDALQUAD) != 0);
	vertexTextureFilterMinGaussianQuad_ =
		((capacity_.VertexTextureFilterCaps &
		D3DPTFILTERCAPS_MINFGAUSSIANQUAD) != 0);
	vertexTextureFilterMagPoint_ =
		((capacity_.VertexTextureFilterCaps & D3DPTFILTERCAPS_MAGFPOINT) != 0);
	vertexTextureFilterMagLiner_ =
		((capacity_.VertexTextureFilterCaps & D3DPTFILTERCAPS_MAGFLINEAR) != 0);
	vertexTextureFilterMagAnisotropic_ =
		((capacity_.VertexTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFANISOTROPIC) != 0);
	vertexTextureFilterMagPyramidalQuad_ =
		((capacity_.VertexTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD) != 0);
	vertexTextureFilterMagGaussianQuad_ =
		((capacity_.VertexTextureFilterCaps &
		D3DPTFILTERCAPS_MAGFGAUSSIANQUAD) != 0);
	vertexTextureFilterMipmapPoint_ =
		((capacity_.VertexTextureFilterCaps & D3DPTFILTERCAPS_MIPFPOINT) != 0);
	vertexTextureFilterMipmapLiner_ =
		((capacity_.VertexTextureFilterCaps & D3DPTFILTERCAPS_MIPFLINEAR) != 0);

	//--------------------------------------------------------------------------
	// テクスチャステージ
	//--------------------------------------------------------------------------
	maxTextureBlendStages_ = capacity_.MaxTextureBlendStages;
	maxSimultaneousTextures_ = capacity_.MaxSimultaneousTextures;

	textureOperationDisable_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_DISABLE) != 0);
	textureOperationSelectArg1_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_SELECTARG1) != 0);
	textureOperationSelectArg2_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_SELECTARG2) != 0);
	textureOperationModulate_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_MODULATE) != 0);
	textureOperationModulate2x_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_MODULATE2X) != 0);
	textureOperationModulate4x_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_MODULATE4X) != 0);
	textureOperationAdd_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_ADD) != 0);
	textureOperationAddSigned_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED) != 0);
	textureOperationAddSigned2x_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_ADDSIGNED2X) != 0);
	textureOperationSubtract_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_SUBTRACT) != 0);
	textureOperationAddSmooth_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_ADDSMOOTH) != 0);
	textureOperationBlendDiffuseAlpha_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BLENDDIFFUSEALPHA) != 0);
	textureOperationBlendTextureAlpha_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHA) != 0);
	textureOperationBlendFactorAlpha_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BLENDFACTORALPHA) != 0);
	textureOperationBlendTextureAlphaPM_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BLENDTEXTUREALPHAPM) != 0);
	textureOperationBlendCurrentAlpha_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BLENDCURRENTALPHA) != 0);
	textureOperationPreModulate_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_PREMODULATE) != 0);
	textureOperationModulateAlphaAddColor_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR) != 0);
	textureOperationModulateColorAddAlpha_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA) != 0);
	textureOperationModulateInvAlphaAddColor_ =
		((capacity_.TextureOpCaps &
		D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR) != 0);
	textureOperationModulateInvColorAddAlpha_ =
		((capacity_.TextureOpCaps &
		D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA) != 0);
	textureOperationBumpEnvMap_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP) != 0);
	textureOperationBumpEnvMapLuminance_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE) != 0);
	textureOperationDotProduct3_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3) != 0);
	textureOperationMultiplyAdd_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_MULTIPLYADD) != 0);
	textureOperationLerp_ =
		((capacity_.TextureOpCaps & D3DTEXOPCAPS_LERP) != 0);

	//--------------------------------------------------------------------------
	// 比較
	//--------------------------------------------------------------------------
	zCompareNever_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_NEVER) != 0);
	zCompareLess_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_LESS) != 0);
	zCompareEqual_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_EQUAL) != 0);
	zCompareLessEqual_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_LESSEQUAL) != 0);
	zCompareGreater_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_GREATER) != 0);
	zCompareNotEqual_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_NOTEQUAL) != 0);
	zCompareGreaterEqual_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_GREATEREQUAL) != 0);
	zCompareAlways_ =
		((capacity_.ZCmpCaps & D3DPCMPCAPS_ALWAYS) != 0);

	stencilKeep_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_KEEP) != 0);
	stencilZero_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_ZERO) != 0);
	stencilReplace_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_REPLACE) != 0);
	stencilIncrSat_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_INCRSAT) != 0);
	stencilDecrSat_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_DECRSAT) != 0);
	stencilInvert_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_INVERT) != 0);
	stencilIncr_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_INCR) != 0);
	stencilDecr_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_DECR) != 0);
	stencilTwoSided_ =
		((capacity_.StencilCaps & D3DSTENCILCAPS_TWOSIDED) != 0);

	alphaCompareNever_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_NEVER) != 0);
	alphaCompareLess_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_LESS) != 0);
	alphaCompareEqual_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_EQUAL) != 0);
	alphaCompareLessEqual_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_LESSEQUAL) != 0);
	alphaCompareGreater_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_GREATER) != 0);
	alphaCompareNotEqual_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_NOTEQUAL) != 0);
	alphaCompareGreaterEqual_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_GREATEREQUAL) != 0);
	alphaCompareAlways_ =
		((capacity_.AlphaCmpCaps & D3DPCMPCAPS_ALWAYS) != 0);

	//--------------------------------------------------------------------------
	// ブレンディング
	//--------------------------------------------------------------------------
	blendSourceZero_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_ZERO) != 0);
	blendSourceOne_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_ONE) != 0);
	blendSourceSrcColor_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_SRCCOLOR) != 0);
	blendSourceInvSrcColor_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) != 0);
	blendSourceSrcAlpha_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHA) != 0);
	blendSourceInvSrcAlpha_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) != 0);
	blendSourceDestAlpha_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_DESTALPHA) != 0);
	blendSourceInvDestAlpha_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) != 0);
	blendSourceDestColor_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_DESTCOLOR) != 0);
	blendSourceInvDestColor_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) != 0);
	blendSourceSrcAlphaSat_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) != 0);
	blendSourceBothSrcAlpha_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_BOTHSRCALPHA) != 0);
	blendSourceBothInvSrcAlpha_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) != 0);
	blendSourceBlendFactor_ =
		((capacity_.SrcBlendCaps & D3DPBLENDCAPS_BLENDFACTOR) != 0);

	blendDestinationZero_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_ZERO) != 0);
	blendDestinationOne_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_ONE) != 0);
	blendDestinationSrcColor_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_SRCCOLOR) != 0);
	blendDestinationInvSrcColor_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_INVSRCCOLOR) != 0);
	blendDestinationSrcAlpha_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_SRCALPHA) != 0);
	blendDestinationInvSrcAlpha_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_INVSRCALPHA) != 0);
	blendDestinationDestAlpha_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_DESTALPHA) != 0);
	blendDestinationInvDestAlpha_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_INVDESTALPHA) != 0);
	blendDestinationDestColor_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) != 0);
	blendDestinationInvDestColor_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) != 0);
	blendDestinationSrcAlphaSat_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_SRCALPHASAT) != 0);
	blendDestinationBothSrcAlpha_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_BOTHSRCALPHA) != 0);
	blendDestinationBothInvSrcAlpha_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_BOTHINVSRCALPHA) != 0);
	blendDestinationBlendFactor_ =
		((capacity_.DestBlendCaps & D3DPBLENDCAPS_BLENDFACTOR) != 0);

	//--------------------------------------------------------------------------
	// ラスタライズ
	//--------------------------------------------------------------------------
	extentsAdjust_ = capacity_.ExtentsAdjust;
	rasterDither_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_DITHER) != 0);
	rasterZTest_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_ZTEST) != 0);
	rasterFogVertex_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0);
	rasterFogTable_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0);
	rasterMipmapLODBias_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_MIPMAPLODBIAS) != 0);
	rasterZBufferLessHSR_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_ZBUFFERLESSHSR) != 0);
	rasterFogRange_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_FOGRANGE) != 0);
	rasterAnisotropy_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) != 0);
	rasterWBuffer_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_WBUFFER) != 0);
	rasterWFog_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_WFOG) != 0);
	rasterZFog_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_ZFOG) != 0);
	rasterColorPerspective_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_COLORPERSPECTIVE) != 0);
	rasterScissorTest_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_SCISSORTEST) != 0);
	rasterSlopeScaleDepthBias_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS) != 0);
	rasterDepthBias_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_DEPTHBIAS) != 0);
	rasterMultiSampleToggle_ =
		((capacity_.RasterCaps & D3DPRASTERCAPS_MULTISAMPLE_TOGGLE) != 0);

	//--------------------------------------------------------------------------
	// 頂点シェーダ
	//--------------------------------------------------------------------------
	vertexShaderMajorVersion_ =
		D3DSHADER_VERSION_MAJOR(capacity_.VertexShaderVersion);
	vertexShaderMinorVersion_ =
		D3DSHADER_VERSION_MINOR(capacity_.VertexShaderVersion);
	maxVertexShaderConst_ = capacity_.MaxVertexShaderConst;
	maxStreamStride_ = capacity_.MaxStreamStride;
	maxVShaderInstructionsExecuted_ = capacity_.MaxVShaderInstructionsExecuted;
	maxVertexShader30InstructionSlots_ =
		capacity_.MaxVertexShader30InstructionSlots;
	vertexShaderDynamicFlowControlDepth_ =
		capacity_.VS20Caps.DynamicFlowControlDepth;
	vertexShaderNumTemps_ =  capacity_.VS20Caps.NumTemps;
	vertexShaderStaticFlowControlDepth_ =
		capacity_.VS20Caps.StaticFlowControlDepth;
	vertexShaderPredication_ =
		((capacity_.VS20Caps.Caps & D3DVS20CAPS_PREDICATION) != 0);

	//--------------------------------------------------------------------------
	// ピクセルシェーダ
	//--------------------------------------------------------------------------
	pixelShaderMajorVersion_ =
		D3DSHADER_VERSION_MAJOR(capacity_.PixelShaderVersion);
	pixelShaderMinorVersion_ =
		D3DSHADER_VERSION_MINOR(capacity_.PixelShaderVersion);
	pixelShader1xMaxValue_ = capacity_.PixelShader1xMaxValue;
	maxPShaderInstructionsExecuted_ = capacity_.MaxPShaderInstructionsExecuted;
	maxPixelShader30InstructionSlots_ =
		capacity_.MaxPixelShader30InstructionSlots;
	pixelShaderDynamicFlowControlDepth_ =
		capacity_.PS20Caps.DynamicFlowControlDepth;
	pixelShaderNumTemps_ =  capacity_.PS20Caps.NumTemps;
	pixelShaderStaticFlowControlDepth_ =
		capacity_.PS20Caps.StaticFlowControlDepth;
	pixelShaderNumInstructionSlots_ =
		capacity_.PS20Caps.NumInstructionSlots;
	pixelShaderArbitrarySwizzle_ =
		((capacity_.PS20Caps.Caps & D3DPS20CAPS_ARBITRARYSWIZZLE) != 0);
	pixelShaderGradientInstructions_ =
		((capacity_.PS20Caps.Caps & D3DPS20CAPS_GRADIENTINSTRUCTIONS) != 0);
	pixelShaderPredication_ =
		((capacity_.PS20Caps.Caps & D3DPS20CAPS_PREDICATION) != 0);
	pixelShaderNoDependentReadLimit_ =
		((capacity_.PS20Caps.Caps & D3DPS20CAPS_NODEPENDENTREADLIMIT) != 0);
	pixelShaderNoTexnstructionLimit_ =
		((capacity_.PS20Caps.Caps & D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT) != 0);

}
//------------------------------------------------------------------------------
// 文字列への変換
String GraphicsDeviceCapacity::toString() const{
	String result, temp, line;
	GraphicsBufferFormat bufferFormat;
	line = "//----------------------------------------"
		"-------------------------------------\n";

	//--------------------------------------------------------------------------
	// デバイス情報
	//--------------------------------------------------------------------------
	result += line + "//\tデバイス情報\n" + line;
	result += temp.format("\tデバイス\t\t\t\t\t\t%s\n",
		getDeviceName().getBytes());
	result += temp.format("\tドライバ\t\t\t\t\t\t%s\n",
		getDriverName().getBytes());
	result += temp.format("\tデバイス番号\t\t\t\t\t%d\n", getDeviceOrdinal());
	switch(getDeviceType()){
	case D3DDEVTYPE_HAL:
		result += "\tデバイスタイプ\t\t\t\t\tハードウェア\n";
		break;
	case D3DDEVTYPE_REF:
		result += "\tデバイスタイプ\t\t\t\t\tリファレンスラスタライザ\n";
		break;
	case D3DDEVTYPE_SW:
		result += "\tデバイスタイプ\t\t\t\t\tソフトウェア\n";
		break;
	}
	if(isWindowed()){ result += "\tモード\t\t\t\t\t\t\tウィンドウ\n";}
	else{ result += "\tモード\t\t\t\t\t\t\tフルスクリーン\n"; }
	result += temp.format("\t頂点プロセスタイプ\t\t\t\t%s\n",
		getVertexProcessingType().toString().getBytes());
	bufferFormat = getAdapterFormat();
	result += "\tアダプタフォーマット\t\t\t" + bufferFormat.getName() + "\n";
	bufferFormat = getBackBufferFormat();
	result += "\tバックバッファフォーマット\t\t" + bufferFormat.getName() + "\n";
	result += temp.format("\tバックバッファサイズ\t\t\t( %d x %d )\n",
		getBackBufferSize().width, getBackBufferSize().height);
	result += temp.format("\tリフレッシュレート\t\t\t\t%d Hz\n",
		getRefreshRate());
	if(getDepthStencilEnabled()){
		result += "\t深度、ステンシルバッファ\t\t有効\n";
	}else{
		result += "\t深度、ステンシルバッファ\t\t無効\n";
	}
	bufferFormat = getDepthStencilFormat();
	result += "\t深度、ステンシルフォーマット\t" + bufferFormat.getName() + "\n";
	result += "\tプレゼンテーション間隔\t\t\t";
	switch(getPresentationInterval()){
	case D3DPRESENT_INTERVAL_IMMEDIATE:	result += "即時\n"; break;
	case D3DPRESENT_INTERVAL_DEFAULT:	result += "デフォルト\n"; break;
	case D3DPRESENT_INTERVAL_ONE:		result += "1垂直同期\n"; break;
	case D3DPRESENT_INTERVAL_TWO:		result += "2垂直同期\n"; break;
	case D3DPRESENT_INTERVAL_THREE:		result += "3垂直同期\n"; break;
	case D3DPRESENT_INTERVAL_FOUR:		result += "4垂直同期\n"; break;
	}
	result += "\tマルチサンプルタイプ\t\t\t";
	switch(getMultiSampleType()){
	case D3DMULTISAMPLE_NONE:			result += "無効\n"; break;
	case D3DMULTISAMPLE_NONMASKABLE:	result += "クォリティ\n"; break;
	case D3DMULTISAMPLE_2_SAMPLES:		result += "2サンプル\n"; break;
	case D3DMULTISAMPLE_3_SAMPLES:		result += "3サンプル\n"; break;
	case D3DMULTISAMPLE_4_SAMPLES:		result += "4サンプル\n"; break;
	case D3DMULTISAMPLE_5_SAMPLES:		result += "5サンプル\n"; break;
	case D3DMULTISAMPLE_6_SAMPLES:		result += "6サンプル\n"; break;
	case D3DMULTISAMPLE_7_SAMPLES:		result += "7サンプル\n"; break;
	case D3DMULTISAMPLE_8_SAMPLES:		result += "8サンプル\n"; break;
	case D3DMULTISAMPLE_9_SAMPLES:		result += "9サンプル\n"; break;
	case D3DMULTISAMPLE_10_SAMPLES:		result += "10サンプル\n"; break;
	case D3DMULTISAMPLE_11_SAMPLES:		result += "11サンプル\n"; break;
	case D3DMULTISAMPLE_12_SAMPLES:		result += "12サンプル\n"; break;
	case D3DMULTISAMPLE_13_SAMPLES:		result += "13サンプル\n"; break;
	case D3DMULTISAMPLE_14_SAMPLES:		result += "14サンプル\n"; break;
	case D3DMULTISAMPLE_15_SAMPLES:		result += "15サンプル\n"; break;
	case D3DMULTISAMPLE_16_SAMPLES:		result += "16サンプル\n"; break;
	}
	result += temp.format("\tマルチサンプルクォリティ\t\t%d\n",
		getMultiSampleQuality());

	//--------------------------------------------------------------------------
	// デバイス能力
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tデバイス能力\n" + line;
	result += temp.format("\tマルチレンダーターゲット数\t\t%d\n",
		getNumSimultaneousRTs());
	result += "\tシステムメモリで実行\t\t\t";
	result += supportedString(supportedExecuteSystemMemory());
	result += "\tビデオメモリで実行\t\t\t\t";
	result += supportedString(supportedExecuteVideoMemory());
	result += "\tシステムメモリ上のTL頂点\t\t";
	result += supportedString(supportedTlVertexSystemMemory());
	result += "\tビデオメモリ上のTL頂点\t\t\t";
	result += supportedString(supportedTlVertexVideoMemory());
	result += "\tシステムメモリ上のテクスチャ\t";
	result += supportedString(supportedTextureSystemMemory());
	result += "\tビデオメモリ上のテクスチャ\t\t";
	result += supportedString(supportedTextureVideoMemory());
	result += "\tTL頂点の描画\t\t\t\t\t";
	result += supportedString(supportedDrawPrimTlVertex());
	result += "\tフリップ後のレンダリング\t\t";
	result += supportedString(supportedCanRenderAfterFlip());
	result += "\t非ローカルビデオメモリ\t\t\t";
	result += supportedString(supportedTextureNonLocalVidedMemory());
	result += "\tDrawPrivitives2\t\t\t\t\t";
	result += supportedString(supportedDrawPrimitives2());
	result += "\t独立したテクスチャメモリプール\t";
	result += supportedString(supportedSeparateTextureMemories());
	result += "\tDrawPrimitives2EX\t\t\t\t";
	result += supportedString(supportedDrawPrimitives2EX());
	result += "\tハードウェアT&L\t\t\t\t\t";
	result += supportedString(supportedHwTransformAndLight());
	result += "\tシステムからビデオへのBLT\t\t";
	result += supportedString(supportedCanBltSystemToNonLocal());
	result += "\tハードウェアラスタライズ\t\t";
	result += supportedString(supportedHwRasterization());
	result += "\tピュアデバイス\t\t\t\t\t";
	result += supportedString(supportedPureDevice());
	result += "\tベジェ、Bスプライン\t\t\t\t";
	result += supportedString(supportedQuinticRtPatches());
	result += "\t矩形、三角形パッチ\t\t\t\t";
	result += supportedString(supportedRtPatches());
	result += "\t効率的なハンドル0パッチ\t\t\t";
	result += supportedString(supportedRtPatchHanldeZero());
	result += "\tNパッチ\t\t\t\t\t\t\t";
	result += supportedString(supportedNPatches());
	result += "\tプレゼンテーション間隔即時\t\t";
	result += supportedString(supportedPresentationIntervalImmediate());
	result += "\tプレゼンテーション間隔1垂直同期\t";
	result += supportedString(supportedPresentationIntervalOne());
	result += "\tプレゼンテーション間隔2垂直同期\t";
	result += supportedString(supportedPresentationIntervalTwo());
	result += "\tプレゼンテーション間隔3垂直同期\t";
	result += supportedString(supportedPresentationIntervalThree());
	result += "\tプレゼンテーション間隔4垂直同期\t";
	result += supportedString(supportedPresentationIntervalFour());
	result += "\tハードウェアカーソル\t\t\t";
	result += supportedString(supportedCursorColor());
	result += "\t低解像度ハードウェアカーソル\t";
	result += supportedString(supportedCursorLowRes());
	result += "\tStretchRectMinPointフィルタ\t\t";
	result += supportedString(supportedStretchRectMinPoint());
	result += "\tStretchRectMagPointフィルタ\t\t";
	result += supportedString(supportedStretchRectMagPoint());
	result += "\tStretchRectMinLinearフィルタ\t";
	result += supportedString(supportedStretchRectMinLinear());
	result += "\tStretchRectMagLinearフィルタ\t";
	result += supportedString(supportedStretchRectMagLinear());

	//--------------------------------------------------------------------------
	// デバイスその他
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tデバイスその他\n" + line;
	result += temp.format("\tマスターアダプタ番号\t\t\t%d\n",
		getMasterAdapterOrdinal());
	result += temp.format("\tグループ内のアダプタ番号\t\t%d\n",
		getAdapterOrdinalInGroup());
	result += temp.format("\tグループのアダプタ数\t\t\t%d\n",
		getNumberOfAdaptersInGroup());
	result += "\tZマスク\t\t\t\t\t\t\t";
	result += supportedString(supportedMaskZ());
	result += "\tカリング無し\t\t\t\t\t";
	result += supportedString(supportedCullNone());
	result += "\t時計回りカリング\t\t\t\t";
	result += supportedString(supportedCullCW());
	result += "\t反時計回りカリング\t\t\t\t";
	result += supportedString(supportedCullCCW());
	result += "\tカラーチャンネル書き込み\t\t";
	result += supportedString(supportedColorWriteEnable());
	result += "\t正確なポイントクリップ\t\t\t";
	result += supportedString(supportedClipPlaneScaledPoints());
	result += "\t頂点クリップ\t\t\t\t\t";
	result += supportedString(supportedClipTlVerts());
	result += "\tテンポラリテクスチャ引数\t\t";
	result += supportedString(supportedTssArgTemp());
	result += "\tアルファブレンディング\t\t\t";
	result += supportedString(supportedBlendOp());
	result += "\tヌルリファレンス\t\t\t\t";
	result += supportedString(supportedNullReference());
	result += "\t独立した書き込みマスク\t\t\t";
	result += supportedString(supportedIndependentWriteMasks());
	result += "\tテクスチャステージ定数\t\t\t";
	result += supportedString(supportedPerStageConstant());
	result += "\tフォグとスペキュラアルファ\t\t";
	result += supportedString(supportedFogAndSpecularAlpha());
	result += "\tアルファ用ブレンド\t\t\t\t";
	result += supportedString(supportedSeparateAlphaBlend());
	result += "\tMRTに違うZ深度\t\t\t\t\t";
	result += supportedString(supportedMrtIndependentBitDepth());
	result += "\tMRTにピクセルシェーダ後処理\t\t";
	result += supportedString(supportedMrtPostPixelShaderBlending());
	result += "\t頂点フォグのクランプ\t\t\t";
	result += supportedString(supportedFogVertexClamped());

	//--------------------------------------------------------------------------
	// ドライバ能力
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tドライバ能力\n" + line;
	result += "\tスキャンラインの読み込み\t\t";
	result += supportedString(supportedReadScanLine());
	result += "\tフルスクリーンガンマ\t\t\t";
	result += supportedString(supportedFullscreenGamma());
	result += "\tキャリブレートガンマ\t\t\t";
	result += supportedString(supportedCanCalibrateGamma());
	result += "\tマネージドリソース\t\t\t\t";
	result += supportedString(supportedCanManageResource());
	result += "\t動的テクスチャ\t\t\t\t\t";
	result += supportedString(supportedDynamicTextures());
	result += "\tミップマップ自動生成\t\t\t";
	result += supportedString(supportedCanAutogenMipmap());
	result += "\tフルスクリーンアルファブレンド\t";
	result += supportedString(supportedAlphaFullscreenFlipOrDiscard());
	result += "\tsRGBプレゼンテーション\t\t\t";
	result += supportedString(supportedLinerToSrgbPresentation());
	result += "\tビデオメモリへのコピー\t\t\t";
	result += supportedString(supportedCopyToVideoMemory());
	result += "\tシステムメモリへのコピー\t\t";
	result += supportedString(supportedCopyToSystemMemory());

	//--------------------------------------------------------------------------
	// プリミティブ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tプリミティブ\n" + line;
	result += temp.format("\t最大点サイズ\t\t\t\t\t%.2f\n", getMaxPointSize());
	result += "\tラインテクスチャ\t\t\t\t";
	result += supportedString(supportedLineTexture());
	result += "\tラインZテスト\t\t\t\t\t";
	result += supportedString(supportedLineZTest());
	result += "\tラインブレンド\t\t\t\t\t";
	result += supportedString(supportedLineBlend());
	result += "\tラインアルファ比較\t\t\t\t";
	result += supportedString(supportedLineAlphaCompare());
	result += "\tラインフォグ\t\t\t\t\t";
	result += supportedString(supportedLineFog());
	result += "\tラインアンチエイリアス\t\t\t";
	result += supportedString(supportedLineAntialias());

	//--------------------------------------------------------------------------
	// 頂点処理
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\t頂点処理\n" + line;
	result += temp.format("\t最大プリミティブ数\t\t\t\t%d\n",
		getMaxPrimitiveCount());
	result += temp.format("\t最大インデックス数\t\t\t\t%d\n",
		getMaxVertexIndex());
	result += temp.format("\t最大ストリーム数\t\t\t\t%d\n", getMaxStreams());
	result += temp.format("\t最大ライト数\t\t\t\t\t%d\n", getMaxActiveLights());
	result += temp.format("\t最大W値\t\t\t\t\t\t\t%.2e\n", getMaxVertexW());
	result += temp.format("\t最大ブレンド行列数\t\t\t\t%d\n",
		getMaxVertexBlendMatrices());
	result += temp.format("\t最大ブレンド行列インデックス数\t%d\n",
		getMaxVertexBlendMatrixIndex());
	result += temp.format("\tガードバンド左\t\t\t\t\t%.2e\n",
		getGuardBandLeft());
	result += temp.format("\tガードバンド上\t\t\t\t\t%.2e\n", getGuardBandTop());
	result += temp.format("\tガードバンド右\t\t\t\t\t%.2e\n",
		getGuardBandRight());
	result += temp.format("\tガードバンド下\t\t\t\t\t%.2e\n",
		getGuardBandBottom());
	result += temp.format("\t最大ユーザクリップ面\t\t\t%d\n",
		getMaxUserCliplanes());

	result += "\tTexgen\t\t\t\t\t\t\t";
	result += supportedString(supportedTexGen());
	result += "\tカラーマテリアルソース\t\t\t";
	result += supportedString(supportedMaterialSource());
	result += "\tディレクショナルライト\t\t\t";
	result += supportedString(supportedDirectionalLights());
	result += "\tポジションライト\t\t\t\t";
	result += supportedString(supportedPositionalLights());
	result += "\tローカルビューワ\t\t\t\t";
	result += supportedString(supportedLocalViewer());
	result += "\t頂点トゥイーニング\t\t\t\t";
	result += supportedString(supportedTweening());
	result += "\tスフィアマップ\t\t\t\t\t";
	result += supportedString(supportedTexgenSpheremap());
	result += "\tローカルビューワ外はTexgen不可\t";
	result += supportedString(supportedNoTexgenNonLocalViewer());

	//--------------------------------------------------------------------------
	// 頂点フォーマット
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\t頂点フォーマット\n" + line;
	result += "\tFVFテクスチャ座標カウントマスク\t";
	result += supportedString(supportedFvfTexCoordCountMask());
	result += "\tFVF頂点に余分な要素を含められる\t";
	result += supportedString(supportedFvfDoNotStripElements());
	result += "\tFVF頂点サイズ\t\t\t\t\t";
	result += supportedString(supportedFvfPSize());
	result += "\tu_byte4宣言\t\t\t\t\t\t";
	result += supportedString(supportedDeclUByte4());
	result += "\tu_byte4N宣言\t\t\t\t\t";
	result += supportedString(supportedDeclUByte4N());
	result += "\tshort2N宣言\t\t\t\t\t\t";
	result += supportedString(supportedDeclShort2N());
	result += "\tshort4N宣言\t\t\t\t\t\t";
	result += supportedString(supportedDeclShort4N());
	result += "\tu_short2N宣言\t\t\t\t\t";
	result += supportedString(supportedDeclUShort2N());
	result += "\tu_short4N宣言\t\t\t\t\t";
	result += supportedString(supportedDeclUShort4N());
	result += "\tuDec3宣言\t\t\t\t\t\t";
	result += supportedString(supportedDeclUDec3());
	result += "\tdec3宣言\t\t\t\t\t\t";
	result += supportedString(supportedDeclDec3());
	result += "\tfloat16_2宣言\t\t\t\t\t";
	result += supportedString(supportedDeclFloat16_2());
	result += "\tfloat16_4宣言\t\t\t\t\t";
	result += supportedString(supportedDeclFloat16_4());

	//--------------------------------------------------------------------------
	// テッセレーション
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tテッセレーション\n" + line;
	result += temp.format("\tNパッチ最大分割レベル\t\t\t%.2f\n",
		getMaxNPatchTesselationLevel());
	result += "\tストリームオフセット\t\t\t";
	result += supportedString(supportedStreamOffset());
	result += "\tディスプレースメントNパッチ\t\t";
	result += supportedString(supportedDmapNPatch());
	result += "\t適応型RTパッチ\t\t\t\t\t";
	result += supportedString(supportedAdaptiveTessRTPatch());
	result += "\t適応型Nパッチ\t\t\t\t\t";
	result += supportedString(supportedAdaptiveTessNPatch());
	result += "\tテクスチャからのStretchRect\t\t";
	result += supportedString(supportedCanStretchRectFromTextures());
	result += "\tプレディスプレースドNパッチ\t\t";
	result += supportedString(supportedPreSampledDmapNPatch());
	result += "\tストリームオフセット共有\t\t";
	result += supportedString(supportedVertexElementsCanShareStreamOffset());

	//--------------------------------------------------------------------------
	// シェーディング
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tシェーディング\n" + line;
	result += "\tカラーグーロ\t\t\t\t\t";
	result += supportedString(supportedShadeColorGouraudRGB());
	result += "\tスペキュラグーロ\t\t\t\t";
	result += supportedString(supportedShadeSpecularGouraudRGB());
	result += "\tアルファグーロ\t\t\t\t\t";
	result += supportedString(supportedShadeAlphaGouraudBlend());
	result += "\tフォググーロ\t\t\t\t\t";
	result += supportedString(supportedShadeFogGouraud());

	//--------------------------------------------------------------------------
	// テクスチャ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tテクスチャ\n" + line;
	result += temp.format("\t最大テクスチャサイズ\t\t\t( %d x %d )\n",
		getMaxTextureSize().width, getMaxTextureSize().height);
	result += temp.format("\t最大ボリュームテクスチャ辺\t\t%d\n",
		getMaxVolumeExtent());
	result += temp.format("\t最大テクスチャリピート数\t\t%d\n",
		getMaxTextureRepeat());
	result += temp.format("\t最大異方性フィルタ値\t\t\t%d\n",
		getMaxAnisotropy());
	result += temp.format("\t最大テクスチャアスペクト比\t\t%d\n",
		getMaxTextureAspectRaito());
	result += "\tパースペクティブ補正\t\t\t";
	result += supportedString(supportedTexturePerspective());
	result += "\t辺は2の累乗のみ\t\t\t\t\t";
	result += supportedString(supportedTexturePow2());
	result += "\tアルファ\t\t\t\t\t\t";
	result += supportedString(supportedTextureAlpha());
	result += "\t正方形のみ\t\t\t\t\t\t";
	result += supportedString(supportedTextureSquareOnly());
	result += "\tリピートスケール無し\t\t\t";
	result += supportedString(supportedTextureRepeatNotScaledBySize());
	result += "\tアルファパレット\t\t\t\t";
	result += supportedString(supportedTextureAlphaPalette());
	result += "\t辺は2の累乗で無くてよい\t\t\t";
	result += supportedString(supportedTextureNonPow2Conditional());
	result += "\t射影\t\t\t\t\t\t\t";
	result += supportedString(supportedTextureProjected());
	result += "\tキューブマップ\t\t\t\t\t";
	result += supportedString(supportedTextureCubemap());
	result += "\tボリュームマップ\t\t\t\t";
	result += supportedString(supportedTextureVolumemap());
	result += "\tミップマップ\t\t\t\t\t";
	result += supportedString(supportedTextureMipmap());
	result += "\tキューブミップマップ\t\t\t";
	result += supportedString(supportedTextureMipmapCubemap());
	result += "\tボリュームミップマップ\t\t\t";
	result += supportedString(supportedTextureMipmapVolumemap());
	result += "\tキューブマップ辺は2の累乗のみ\t";
	result += supportedString(supportedTextureCubemapPow2());
	result += "\tボリュームマップ辺は2の累乗のみ\t";
	result += supportedString(supportedTextureVolumemapPow2());
	result += "\t射影バンプ環境マップ無し\t\t";
	result += supportedString(supportedTextureNoProjectedBumpEnvironment());

	//--------------------------------------------------------------------------
	// テクスチャアドレス
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tテクスチャアドレス\n" + line;
	result += "\tラップ\t\t\t\t\t\t\t";
	result += supportedString(supportedTextureAddressWrap());
	result += "\tミラー\t\t\t\t\t\t\t";
	result += supportedString(supportedTextureAddressMirror());
	result += "\tUVのクランプ\t\t\t\t\t";
	result += supportedString(supportedTextureAddressClamp());
	result += "\t境界色の設定\t\t\t\t\t";
	result += supportedString(supportedTextureAddressBorder());
	result += "\t独立UVモード\t\t\t\t\t";
	result += supportedString(supportedTextureAddressIndependentUV());
	result += "\t1制限ミラー\t\t\t\t\t\t";
	result += supportedString(supportedTextureAddressMirrorOnce());
	result += "\tボリュームラップ\t\t\t\t";
	result += supportedString(supportedVolumeTextureAddressWrap());
	result += "\tボリュームミラー\t\t\t\t";
	result += supportedString(supportedVolumeTextureAddressMirror());
	result += "\tボリュームUVのクランプ\t\t\t";
	result += supportedString(supportedVolumeTextureAddressClamp());
	result += "\tボリューム境界色の設定\t\t\t";
	result += supportedString(supportedVolumeTextureAddressBorder());
	result += "\tボリューム独立UVモード\t\t\t";
	result += supportedString(supportedVolumeTextureAddressIndependentUV());
	result += "\tボリューム1制限ミラー\t\t\t";
	result += supportedString(supportedVolumeTextureAddressMirrorOnce());

	//--------------------------------------------------------------------------
	// テクスチャフィルタ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tテクスチャフィルタ\n" + line;
	result += "\t縮小ポイント\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMinPoint());
	result += "\t縮小線形\t\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMinLiner());
	result += "\t縮小異方性\t\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMinAnisotropic());
	result += "\t縮小ピラミッド\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMinPyramidalQuad());
	result += "\t縮小2次ガウス\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMinGaussianQuad());
	result += "\t拡大ポイント\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMagPoint());
	result += "\t拡大線形\t\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMagLiner());
	result += "\t拡大異方性\t\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMagAnisotropic());
	result += "\t拡大ピラミッド\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMagPyramidalQuad());
	result += "\t拡大2次ガウス\t\t\t\t\t";
	result += supportedString(supportedTextureFilterMagGaussianQuad());
	result += "\tミップマップポイント\t\t\t";
	result += supportedString(supportedTextureFilterMipmapPoint());
	result += "\tミップマップ線形\t\t\t\t";
	result += supportedString(supportedTextureFilterMipmapLiner());

	result += "\n" + line;
	result += "\tキューブ縮小ポイント\t\t\t";
	result += supportedString(supportedCubeTextureFilterMinPoint());
	result += "\tキューブ縮小線形\t\t\t\t";
	result += supportedString(supportedCubeTextureFilterMinLiner());
	result += "\tキューブ縮小異方性\t\t\t\t";
	result += supportedString(supportedCubeTextureFilterMinAnisotropic());
	result += "\tキューブ縮小ピラミッド\t\t\t";
	result += supportedString(supportedCubeTextureFilterMinPyramidalQuad());
	result += "\tキューブ縮小2次ガウス\t\t\t";
	result += supportedString(supportedCubeTextureFilterMinGaussianQuad());
	result += "\tキューブ拡大ポイント\t\t\t";
	result += supportedString(supportedCubeTextureFilterMagPoint());
	result += "\tキューブ拡大線形\t\t\t\t";
	result += supportedString(supportedCubeTextureFilterMagLiner());
	result += "\tキューブ拡大異方性\t\t\t\t";
	result += supportedString(supportedCubeTextureFilterMagAnisotropic());
	result += "\tキューブ拡大ピラミッド\t\t\t";
	result += supportedString(supportedCubeTextureFilterMagPyramidalQuad());
	result += "\tキューブ拡大2次ガウス\t\t\t";
	result += supportedString(supportedCubeTextureFilterMagGaussianQuad());
	result += "\tキューブミップマップポイント\t";
	result += supportedString(supportedCubeTextureFilterMipmapPoint());
	result += "\tキューブミップマップ線形\t\t";
	result += supportedString(supportedCubeTextureFilterMipmapLiner());

	result += "\n" + line;
	result += "\tボリューム縮小ポイント\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMinPoint());
	result += "\tボリューム縮小線形\t\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMinLiner());
	result += "\tボリューム縮小異方性\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMinAnisotropic());
	result += "\tボリューム縮小ピラミッド\t\t";
	result += supportedString(supportedVolumeTextureFilterMinPyramidalQuad());
	result += "\tボリューム縮小2次ガウス\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMinGaussianQuad());
	result += "\tボリューム拡大ポイント\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMagPoint());
	result += "\tボリューム拡大線形\t\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMagLiner());
	result += "\tボリューム拡大異方性\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMagAnisotropic());
	result += "\tボリューム拡大ピラミッド\t\t";
	result += supportedString(supportedVolumeTextureFilterMagPyramidalQuad());
	result += "\tボリューム拡大2次ガウス\t\t\t";
	result += supportedString(supportedVolumeTextureFilterMagGaussianQuad());
	result += "\tボリュームミップマップポイント\t";
	result += supportedString(supportedVolumeTextureFilterMipmapPoint());
	result += "\tボリュームミップマップ線形\t\t";
	result += supportedString(supportedVolumeTextureFilterMipmapLiner());

	result += "\n" + line;
	result += "\t頂点縮小ポイント\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMinPoint());
	result += "\t頂点縮小線形\t\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMinLiner());
	result += "\t頂点縮小異方性\t\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMinAnisotropic());
	result += "\t頂点縮小ピラミッド\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMinPyramidalQuad());
	result += "\t頂点縮小2次ガウス\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMinGaussianQuad());
	result += "\t頂点拡大ポイント\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMagPoint());
	result += "\t頂点拡大線形\t\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMagLiner());
	result += "\t頂点拡大異方性\t\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMagAnisotropic());
	result += "\t頂点拡大ピラミッド\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMagPyramidalQuad());
	result += "\t頂点拡大2次ガウス\t\t\t\t";
	result += supportedString(supportedVertexTextureFilterMagGaussianQuad());
	result += "\t頂点ミップマップポイント\t\t";
	result += supportedString(supportedVertexTextureFilterMipmapPoint());
	result += "\t頂点ミップマップ線形\t\t\t";
	result += supportedString(supportedVertexTextureFilterMipmapLiner());

	//--------------------------------------------------------------------------
	// テクスチャステージ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tテクスチャステージ\n" + line;
	result += temp.format("\t最大テクスチャステージ数\t\t\t\t%d\n",
		getMaxTextureBlendStages());
	result += temp.format("\t最大マルチテクスチャ数\t\t\t\t\t%d\n",
		getMaxSimultaneousTextures());
	result += "\tDisableオペレーション\t\t\t\t\t";
	result += supportedString(supportedTextureOperationDisable());
	result += "\tSelectArg1オペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationSelectArg1());
	result += "\tSelectArg2オペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationSelectArg2());
	result += "\tModulateオペレーション\t\t\t\t\t";
	result += supportedString(supportedTextureOperationModulate());
	result += "\tModulate2xオペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationModulate2x());
	result += "\tModulate4xオペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationModulate4x());
	result += "\tAddオペレーション\t\t\t\t\t\t";
	result += supportedString(supportedTextureOperationAdd());
	result += "\tAddSignedオペレーション\t\t\t\t\t";
	result += supportedString(supportedTextureOperationAddSigned());
	result += "\tAddSigned2xオペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationAddSigned2x());
	result += "\tSubtractオペレーション\t\t\t\t\t";
	result += supportedString(supportedTextureOperationSubtract());
	result += "\tAddSmoothオペレーション\t\t\t\t\t";
	result += supportedString(supportedTextureOperationAddSmooth());
	result += "\tBlendDiffuseAlphaオペレーション\t\t\t";
	result += supportedString(supportedTextureOperationBlendDiffuseAlpha());
	result += "\tBlendTextureAlphaオペレーション\t\t\t";
	result += supportedString(supportedTextureOperationBlendTextureAlpha());
	result += "\tBlendFactorAlphaオペレーション\t\t\t";
	result += supportedString(supportedTextureOperationBlendFactorAlpha());
	result += "\tBlendTextureAlphaPMオペレーション\t\t";
	result += supportedString(supportedTextureOperationBlendTextureAlphaPM());
	result += "\tBlendCurrentAlphaオペレーション\t\t\t";
	result += supportedString(supportedTextureOperationBlendCurrentAlpha());
	result += "\tPreModulateオペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationPreModulate());
	result += "\tModulateAlphaAddColorオペレーション\t\t";
	result += supportedString(supportedTextureOperationModulateAlphaAddColor());
	result += "\tModulateColorAddAlphaオペレーション\t\t";
	result += supportedString(supportedTextureOperationModulateColorAddAlpha());
	result += "\tModulateInvAlphaAddColorオペレーション\t";
	result += supportedString(supportedTextureOperationModulateInvAlphaAddColor());
	result += "\tModulateInvColorAddAlphaオペレーション\t";
	result += supportedString(supportedTextureOperationModulateInvColorAddAlpha());
	result += "\tBumpEnvMapオペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationBumpEnvMap());
	result += "\tBumpEnvMapLuminanceオペレーション\t\t";
	result += supportedString(supportedTextureOperationBumpEnvMapLuminance());
	result += "\tDotProduct3オペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationDotProduct3());
	result += "\tMultiplyAddオペレーション\t\t\t\t";
	result += supportedString(supportedTextureOperationMultiplyAdd());
	result += "\tLerpオペレーション\t\t\t\t\t\t";
	result += supportedString(supportedTextureOperationLerp());

	//--------------------------------------------------------------------------
	// 比較
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\t比較\n" + line;
	result += "\tZ比較Never\t\t\t\t\t\t";
	result += supportedString(supportedZCompareNever());
	result += "\tZ比較Less\t\t\t\t\t\t";
	result += supportedString(supportedZCompareLess());
	result += "\tZ比較Equal\t\t\t\t\t\t";
	result += supportedString(supportedZCompareEqual());
	result += "\tZ比較LessEqual\t\t\t\t\t";
	result += supportedString(supportedZCompareLessEqual());
	result += "\tZ比較Greater\t\t\t\t\t";
	result += supportedString(supportedZCompareGreater());
	result += "\tZ比較NotEqual\t\t\t\t\t";
	result += supportedString(supportedZCompareNotEqual());
	result += "\tZ比較GreaterEqual\t\t\t\t";
	result += supportedString(supportedZCompareGreaterEqual());
	result += "\tZ比較Always\t\t\t\t\t\t";
	result += supportedString(supportedZCompareAlways());

	result += "\n" + line;
	result += "\tステンシルKeep\t\t\t\t\t";
	result += supportedString(supportedStencilKeep());
	result += "\tステンシルZero\t\t\t\t\t";
	result += supportedString(supportedStencilZero());
	result += "\tステンシルReplace\t\t\t\t";
	result += supportedString(supportedStencilReplace());
	result += "\tステンシルIncrSat\t\t\t\t";
	result += supportedString(supportedStencilIncrSat());
	result += "\tステンシルDecrSat\t\t\t\t";
	result += supportedString(supportedStencilDecrSat());
	result += "\tステンシルInvert\t\t\t\t";
	result += supportedString(supportedStencilInvert());
	result += "\tステンシルIncr\t\t\t\t\t";
	result += supportedString(supportedStencilIncr());
	result += "\tステンシルDecr\t\t\t\t\t";
	result += supportedString(supportedStencilDecr());
	result += "\tステンシルTwoSided\t\t\t\t";
	result += supportedString(supportedStencilTwoSided());

	result += "\n" + line;
	result += "\tアルファ比較Never\t\t\t\t";
	result += supportedString(supportedAlphaCompareNever());
	result += "\tアルファ比較Less\t\t\t\t";
	result += supportedString(supportedAlphaCompareLess());
	result += "\tアルファ比較Equal\t\t\t\t";
	result += supportedString(supportedAlphaCompareEqual());
	result += "\tアルファ比較LessEqual\t\t\t";
	result += supportedString(supportedAlphaCompareLessEqual());
	result += "\tアルファ比較Greater\t\t\t\t";
	result += supportedString(supportedAlphaCompareGreater());
	result += "\tアルファ比較NotEqual\t\t\t";
	result += supportedString(supportedAlphaCompareNotEqual());
	result += "\tアルファ比較GreaterEqual\t\t";
	result += supportedString(supportedAlphaCompareGreaterEqual());
	result += "\tアルファ比較Always\t\t\t\t";
	result += supportedString(supportedAlphaCompareAlways());

	//--------------------------------------------------------------------------
	// ブレンディング
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tブレンディング\n" + line;
	result += "\tソースZero\t\t\t\t\t\t\t";
	result += supportedString(supportedBlendSourceZero());
	result += "\tソースOne\t\t\t\t\t\t\t";
	result += supportedString(supportedBlendSourceOne());
	result += "\tソースSrcColor\t\t\t\t\t\t";
	result += supportedString(supportedBlendSourceSrcColor());
	result += "\tソースInvSrcColor\t\t\t\t\t";
	result += supportedString(supportedBlendSourceInvSrcColor());
	result += "\tソースSrcAlpha\t\t\t\t\t\t";
	result += supportedString(supportedBlendSourceSrcAlpha());
	result += "\tソースInvSrcAlpha\t\t\t\t\t";
	result += supportedString(supportedBlendSourceInvSrcAlpha());
	result += "\tソースDestAlpha\t\t\t\t\t\t";
	result += supportedString(supportedBlendSourceDestAlpha());
	result += "\tソースInvDestAlpha\t\t\t\t\t";
	result += supportedString(supportedBlendSourceInvDestAlpha());
	result += "\tソースDestColor\t\t\t\t\t\t";
	result += supportedString(supportedBlendSourceDestColor());
	result += "\tソースInvDestColor\t\t\t\t\t";
	result += supportedString(supportedBlendSourceInvDestColor());
	result += "\tソースSrcAlphaSat\t\t\t\t\t";
	result += supportedString(supportedBlendSourceSrcAlphaSat());
	result += "\tソースBothSrcAlpha\t\t\t\t\t";
	result += supportedString(supportedBlendSourceBothSrcAlpha());
	result += "\tソースBothInvSrcAlpha\t\t\t\t";
	result += supportedString(supportedBlendSourceBothInvSrcAlpha());
	result += "\tソースBlendFactor\t\t\t\t\t";
	result += supportedString(supportedBlendSourceBlendFactor());

	result += "\n" + line;
	result += "\tデスティネーションZero\t\t\t\t";
	result += supportedString(supportedBlendDestinationZero());
	result += "\tデスティネーションOne\t\t\t\t";
	result += supportedString(supportedBlendDestinationOne());
	result += "\tデスティネーションSrcColor\t\t\t";
	result += supportedString(supportedBlendDestinationSrcColor());
	result += "\tデスティネーションInvSrcColor\t\t";
	result += supportedString(supportedBlendDestinationInvSrcColor());
	result += "\tデスティネーションSrcAlpha\t\t\t";
	result += supportedString(supportedBlendDestinationSrcAlpha());
	result += "\tデスティネーションInvSrcAlpha\t\t";
	result += supportedString(supportedBlendDestinationInvSrcAlpha());
	result += "\tデスティネーションDestAlpha\t\t\t";
	result += supportedString(supportedBlendDestinationDestAlpha());
	result += "\tデスティネーションInvDestAlpha\t\t";
	result += supportedString(supportedBlendDestinationInvDestAlpha());
	result += "\tデスティネーションDestColor\t\t\t";
	result += supportedString(supportedBlendDestinationDestColor());
	result += "\tデスティネーションInvDestColor\t\t";
	result += supportedString(supportedBlendDestinationInvDestColor());
	result += "\tデスティネーションSrcAlphaSat\t\t";
	result += supportedString(supportedBlendDestinationSrcAlphaSat());
	result += "\tデスティネーションBothSrcAlpha\t\t";
	result += supportedString(supportedBlendDestinationBothSrcAlpha());
	result += "\tデスティネーションBothInvSrcAlpha\t";
	result += supportedString(supportedBlendDestinationBothInvSrcAlpha());
	result += "\tデスティネーションBlendFactor\t\t";
	result += supportedString(supportedBlendDestinationBlendFactor());

	//--------------------------------------------------------------------------
	// ラスタライズ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tラスタライズ\n" + line;
	result += temp.format("\tアンチエイリアス拡張\t\t\t%.2f\n",
		getExtentsAdjust());
	result += "\tディザ\t\t\t\t\t\t\t";
	result += supportedString(supportedRasterDither());
	result += "\tZテスト\t\t\t\t\t\t\t";
	result += supportedString(supportedRasterZTest());
	result += "\t頂点フォグ\t\t\t\t\t\t";
	result += supportedString(supportedRasterFogVertex());
	result += "\tフォグテーブル\t\t\t\t\t";
	result += supportedString(supportedRasterFogTable());
	result += "\tミップマップバイアス\t\t\t";
	result += supportedString(supportedRasterMipmapLODBias());
	result += "\t隠れ面消去\t\t\t\t\t\t";
	result += supportedString(supportedRasterZBufferLessHSR());
	result += "\tレンジフォグ\t\t\t\t\t";
	result += supportedString(supportedRasterFogRange());
	result += "\t異方性フィルタリング\t\t\t";
	result += supportedString(supportedRasterAnisotropy());
	result += "\tWバッファ\t\t\t\t\t\t";
	result += supportedString(supportedRasterWBuffer());
	result += "\tWフォグ\t\t\t\t\t\t\t";
	result += supportedString(supportedRasterWFog());
	result += "\tZフォグ\t\t\t\t\t\t\t";
	result += supportedString(supportedRasterZFog());
	result += "\t色パースペクティブ補正\t\t\t";
	result += supportedString(supportedRasterColorPerspective());
	result += "\tシザーテスト\t\t\t\t\t";
	result += supportedString(supportedRasterScissorTest());
	result += "\tスロープスケール深度バイアス\t";
	result += supportedString(supportedRasterSlopeScaleDepthBias());
	result += "\t深度バイアス\t\t\t\t\t";
	result += supportedString(supportedRasterDepthBias());
	result += "\tマルチサンプル切り替え\t\t\t";
	result += supportedString(supportedRasterMultiSampleToggle());


	//--------------------------------------------------------------------------
	// 頂点シェーダ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\t頂点シェーダ\n" + line;
	result += temp.format("\t頂点シェーダバージョン\t\t\t%d.%d\n",
		getVertexShaderMajorVersion(), getVertexShaderMinorVersion());
	result += temp.format("\t最大頂点シェーダ定数\t\t\t%d\n",
		getMaxVertexShaderConst());
	result += temp.format("\t最大ストリームストライド数\t\t%d\n",
		getMaxStreamStride());
	result += temp.format("\t最大命令実行数\t\t\t\t\t%d\n",
		getMaxVShaderInstructionsExecuted());
	result += temp.format("\t最大命令スロット数\t\t\t\t%d\n",
		getMaxVertexShader30InstructionSlots());
	result += temp.format("\t動的フローネストレベル\t\t\t%d\n",
		getVertexShaderDynamicFlowControlDepth());
	result += temp.format("\tテンポラリ数\t\t\t\t\t%d\n",
		getVertexShaderNumTemps());
	result += temp.format("\t静的フローネストレベル\t\t\t%d\n",
		getVertexShaderStaticFlowControlDepth());
	result += "\tプレディケーション命令\t\t\t";
	result += supportedString(supportedVertexShaderPredication());

 	//--------------------------------------------------------------------------
	// ピクセルシェーダ
	//--------------------------------------------------------------------------
	result += "\n" + line + "//\tピクセルシェーダ\n" + line;
	result += temp.format("\tピクセルシェーダバージョン\t\t%d.%d\n",
		getPixelShaderMajorVersion(), getPixelShaderMinorVersion());
	result += temp.format("\tピクセルシェーダ1x最大値\t\t%.2f\n",
		getPixelShader1xMaxValue());
	result += temp.format("\t最大命令実行数\t\t\t\t\t%d\n",
		getMaxPShaderInstructionsExecuted());
	result += temp.format("\t最大命令スロット数\t\t\t\t%d\n",
		getMaxPixelShader30InstructionSlots());
	result += temp.format("\t動的フローネストレベル\t\t\t%d\n",
		getPixelShaderDynamicFlowControlDepth());
	result += temp.format("\tテンポラリ数\t\t\t\t\t%d\n",
		getPixelShaderNumTemps());
	result += temp.format("\t静的フローネストレベル\t\t\t%d\n",
		getPixelShaderStaticFlowControlDepth());
	result += temp.format("\t命令スロット数\t\t\t\t\t%d\n",
		getPixelShaderNumInstructionSlots());
	result += "\t任意の入れ替え\t\t\t\t\t";
	result += supportedString(supportedPixelShaderArbitrarySwizzle());
	result += "\tグラデーション命令\t\t\t\t";
	result += supportedString(supportedPixelShaderGradientInstructions());
	result += "\tプレディケーション命令\t\t\t";
	result += supportedString(supportedPixelShaderPredication());
	result += "\t従属読み込み無制限\t\t\t\t";
	result += supportedString(supportedPixelShaderNoDependentReadLimit());
	result += "\ttex命令無制限\t\t\t\t\t";
	result += supportedString(supportedPixelShaderNoTexnstructionLimit());

	//--------------------------------------------------------------------------
	result += "\n" + line;
	return result;
}
//------------------------------------------------------------------------------
} // End of namespace Lamp
//------------------------------------------------------------------------------
