本文整理汇总了C++中ObjectFactory::GetUnderlying方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectFactory::GetUnderlying方法的具体用法?C++ ObjectFactory::GetUnderlying怎么用?C++ ObjectFactory::GetUnderlying使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectFactory
的用法示例。
在下文中一共展示了ObjectFactory::GetUnderlying方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
GeometryShader::GeometryShader(const CompiledShaderByteCode& compiledShader, const StreamOutputInitializers& soInitializers)
{
if (compiledShader.GetStage() != ShaderStage::Null) {
assert(compiledShader.GetStage() == ShaderStage::Geometry);
auto byteCode = compiledShader.GetByteCode();
intrusive_ptr<ID3D::GeometryShader> underlying;
if (soInitializers._outputBufferCount == 0) {
underlying = ObjectFactory().CreateGeometryShader(byteCode.first, byteCode.second);
} else {
assert(soInitializers._outputBufferCount <= D3D11_SO_BUFFER_SLOT_COUNT);
D3D11_SO_DECLARATION_ENTRY nativeDeclaration[D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT];
auto delcCount = BuildNativeDeclaration(nativeDeclaration, dimof(nativeDeclaration), soInitializers);
ObjectFactory objFactory;
auto featureLevel = objFactory.GetUnderlying()->GetFeatureLevel();
underlying = objFactory.CreateGeometryShaderWithStreamOutput(
byteCode.first, byteCode.second,
nativeDeclaration, delcCount,
soInitializers._outputBufferStrides, soInitializers._outputBufferCount,
// Note -- "NO_RASTERIZED_STREAM" is only supported on feature level 11. For other feature levels
// we must disable the rasterization step some other way
(featureLevel>=D3D_FEATURE_LEVEL_11_0)?D3D11_SO_NO_RASTERIZED_STREAM:0);
}
_underlying = std::move(underlying);
}
}
示例2: StringMeldInPlace
GeometryShader::GeometryShader( const ResChar initializer[],
const StreamOutputInitializers& soInitializers)
{
//
// We have to append the shader model to the resource name
// (if it's not already there)
//
ResChar temp[MaxPath];
if (!XlFindStringI(initializer, "gs_")) {
StringMeldInPlace(temp) << initializer << ":" GS_DefShaderModel;
initializer = temp;
}
intrusive_ptr<ID3D::GeometryShader> underlying;
if (soInitializers._outputBufferCount == 0) {
const auto& compiledShader = ::Assets::GetAssetComp<CompiledShaderByteCode>(initializer);
assert(compiledShader.GetStage() == ShaderStage::Geometry);
auto byteCode = compiledShader.GetByteCode();
underlying = ObjectFactory().CreateGeometryShader(byteCode.first, byteCode.second);
} else {
assert(soInitializers._outputBufferCount < D3D11_SO_BUFFER_SLOT_COUNT);
D3D11_SO_DECLARATION_ENTRY nativeDeclaration[D3D11_SO_STREAM_COUNT * D3D11_SO_OUTPUT_COMPONENT_COUNT];
auto delcCount = BuildNativeDeclaration(nativeDeclaration, dimof(nativeDeclaration), soInitializers);
ObjectFactory objFactory;
auto featureLevel = objFactory.GetUnderlying()->GetFeatureLevel();
const auto& compiledShader = ::Assets::GetAssetComp<CompiledShaderByteCode>(initializer);
assert(compiledShader.GetStage() == ShaderStage::Geometry);
auto byteCode = compiledShader.GetByteCode();
underlying = objFactory.CreateGeometryShaderWithStreamOutput(
byteCode.first, byteCode.second,
nativeDeclaration, delcCount,
soInitializers._outputBufferStrides, soInitializers._outputBufferCount,
// Note -- "NO_RASTERIZED_STREAM" is only supported on feature level 11. For other feature levels
// we must disable the rasterization step some other way
(featureLevel>=D3D_FEATURE_LEVEL_11_0)?D3D11_SO_NO_RASTERIZED_STREAM:0);
}
// (creation successful; we can commit to member now)
_underlying = std::move(underlying);
}