当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectFactory::CreateGeometryShaderWithStreamOutput方法代码示例

本文整理汇总了C++中ObjectFactory::CreateGeometryShaderWithStreamOutput方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectFactory::CreateGeometryShaderWithStreamOutput方法的具体用法?C++ ObjectFactory::CreateGeometryShaderWithStreamOutput怎么用?C++ ObjectFactory::CreateGeometryShaderWithStreamOutput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectFactory的用法示例。


在下文中一共展示了ObjectFactory::CreateGeometryShaderWithStreamOutput方法的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);
        }
    }
开发者ID:Clever-Boy,项目名称:XLE,代码行数:33,代码来源:Shader.cpp

示例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);
    }
开发者ID:Clever-Boy,项目名称:XLE,代码行数:47,代码来源:Shader.cpp


注:本文中的ObjectFactory::CreateGeometryShaderWithStreamOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。