本文整理汇总了C++中D3D11RenderSystem::_getFeatureLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ D3D11RenderSystem::_getFeatureLevel方法的具体用法?C++ D3D11RenderSystem::_getFeatureLevel怎么用?C++ D3D11RenderSystem::_getFeatureLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类D3D11RenderSystem
的用法示例。
在下文中一共展示了D3D11RenderSystem::_getFeatureLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
//---------------------------------------------------------------------
D3D11_TEXTURE_ADDRESS_MODE D3D11Mappings::get(TextureAddressingMode tam)
{
D3D11RenderSystem* rsys = static_cast<D3D11RenderSystem*>(Root::getSingleton().getRenderSystem());
if (rsys->_getFeatureLevel() == D3D_FEATURE_LEVEL_9_1)
return D3D11_TEXTURE_ADDRESS_WRAP;
//return D3D11_TEXTURE_ADDRESS_WRAP;
switch( tam )
{
case TAM_WRAP:
return D3D11_TEXTURE_ADDRESS_WRAP;
case TAM_MIRROR:
return D3D11_TEXTURE_ADDRESS_MIRROR;
case TAM_CLAMP:
return D3D11_TEXTURE_ADDRESS_CLAMP;
case TAM_BORDER:
return D3D11_TEXTURE_ADDRESS_BORDER;
}
return D3D11_TEXTURE_ADDRESS_WRAP;
}
示例2: switch
//-----------------------------------------------------------------------------
void D3D11HardwarePixelBuffer::blitFromMemory(const PixelBox &src, const Image::Box &dstBox)
{
bool isDds = false;
switch(mFormat)
{
case PF_DXT1:
case PF_DXT2:
case PF_DXT3:
case PF_DXT4:
case PF_DXT5:
isDds = true;
break;
default:
break;
}
if (isDds && (dstBox.getWidth() % 4 != 0 || dstBox.getHeight() % 4 != 0 ))
{
return;
}
// for scoped deletion of conversion buffer
MemoryDataStreamPtr buf;
PixelBox converted = src;
D3D11_BOX dstBoxDx11 = OgreImageBoxToDx11Box(dstBox);
dstBoxDx11.front = 0;
dstBoxDx11.back = converted.getDepth();
// convert to pixelbuffer's native format if necessary
if (src.format != mFormat)
{
buf.bind(new MemoryDataStream(
PixelUtil::getMemorySize(src.getWidth(), src.getHeight(), src.getDepth(),
mFormat)));
converted = PixelBox(src.getWidth(), src.getHeight(), src.getDepth(), mFormat, buf->getPtr());
PixelUtil::bulkPixelConversion(src, converted);
}
if (mUsage & HBU_DYNAMIC)
{
size_t sizeinbytes;
if (PixelUtil::isCompressed(converted.format))
{
// D3D wants the width of one row of cells in bytes
if (converted.format == PF_DXT1)
{
// 64 bits (8 bytes) per 4x4 block
sizeinbytes = std::max<size_t>(1, converted.getWidth() / 4) * std::max<size_t>(1, converted.getHeight() / 4) * 8;
}
else
{
// 128 bits (16 bytes) per 4x4 block
sizeinbytes = std::max<size_t>(1, converted.getWidth() / 4) * std::max<size_t>(1, converted.getHeight() / 4) * 16;
}
}
else
{
sizeinbytes = converted.getHeight() * converted.getWidth() * PixelUtil::getNumElemBytes(converted.format);
}
const Ogre::PixelBox &locked = lock(dstBox, HBL_DISCARD);
memcpy(locked.data, converted.data, sizeinbytes);
unlock();
}
else
{
size_t rowWidth;
if (PixelUtil::isCompressed(converted.format))
{
// D3D wants the width of one row of cells in bytes
if (converted.format == PF_DXT1)
{
// 64 bits (8 bytes) per 4x4 block
rowWidth = (converted.rowPitch / 4) * 8;
}
else
{
// 128 bits (16 bytes) per 4x4 block
rowWidth = (converted.rowPitch / 4) * 16;
}
}
else
{
rowWidth = converted.rowPitch * PixelUtil::getNumElemBytes(converted.format);
}
switch(mParentTexture->getTextureType()) {
case TEX_TYPE_1D:
{
D3D11RenderSystem* rsys = reinterpret_cast<D3D11RenderSystem*>(Root::getSingleton().getRenderSystem());
if (rsys->_getFeatureLevel() >= D3D_FEATURE_LEVEL_10_0)
{
mDevice.GetImmediateContext()->UpdateSubresource(
mParentTexture->GetTex1D(),
//.........这里部分代码省略.........