|
|
@@ -23,6 +23,17 @@ namespace BansheeEngine
|
|
|
output.domainProgram = input.domainProgram != nullptr ? input.domainProgram->getCore() : nullptr;
|
|
|
}
|
|
|
|
|
|
+ SPtr<GpuParamDesc> getParamDesc(const SPtr<GpuProgram>& program)
|
|
|
+ {
|
|
|
+ program->blockUntilCoreInitialized();
|
|
|
+ return program->getParamDesc();
|
|
|
+ }
|
|
|
+
|
|
|
+ SPtr<GpuParamDesc> getParamDesc(const SPtr<GpuProgramCore>& program)
|
|
|
+ {
|
|
|
+ return program->getParamDesc();
|
|
|
+ }
|
|
|
+
|
|
|
template<bool Core>
|
|
|
TGraphicsPipelineState<Core>::TGraphicsPipelineState()
|
|
|
{ }
|
|
|
@@ -33,19 +44,19 @@ namespace BansheeEngine
|
|
|
{
|
|
|
GPU_PIPELINE_PARAMS_DESC paramsDesc;
|
|
|
if (data.vertexProgram != nullptr)
|
|
|
- paramsDesc.vertexParams = data.vertexProgram->getParamDesc();
|
|
|
+ paramsDesc.vertexParams = getParamDesc(data.vertexProgram);
|
|
|
|
|
|
if (data.fragmentProgram != nullptr)
|
|
|
- paramsDesc.fragmentParams = data.fragmentProgram->getParamDesc();
|
|
|
+ paramsDesc.fragmentParams = getParamDesc(data.fragmentProgram);
|
|
|
|
|
|
if (data.geometryProgram != nullptr)
|
|
|
- paramsDesc.geometryParams = data.geometryProgram->getParamDesc();
|
|
|
+ paramsDesc.geometryParams = getParamDesc(data.geometryProgram);
|
|
|
|
|
|
if (data.hullProgram != nullptr)
|
|
|
- paramsDesc.hullParams = data.hullProgram->getParamDesc();
|
|
|
+ paramsDesc.hullParams = getParamDesc(data.hullProgram);
|
|
|
|
|
|
if (data.domainProgram != nullptr)
|
|
|
- paramsDesc.domainParams = data.domainProgram->getParamDesc();
|
|
|
+ paramsDesc.domainParams = getParamDesc(data.domainProgram);
|
|
|
|
|
|
mParamInfo = GpuPipelineParamInfo::create(paramsDesc);
|
|
|
}
|
|
|
@@ -59,7 +70,7 @@ namespace BansheeEngine
|
|
|
|
|
|
SPtr<GraphicsPipelineStateCore> GraphicsPipelineStateCore::create(const PIPELINE_STATE_CORE_DESC& desc, GpuDeviceFlags deviceMask)
|
|
|
{
|
|
|
- return RenderStateCoreManager::instance().createPipelineState(desc, deviceMask);
|
|
|
+ return RenderStateCoreManager::instance().createGraphicsPipelineState(desc, deviceMask);
|
|
|
}
|
|
|
|
|
|
GraphicsPipelineState::GraphicsPipelineState(const PIPELINE_STATE_DESC& desc)
|
|
|
@@ -76,7 +87,7 @@ namespace BansheeEngine
|
|
|
PIPELINE_STATE_CORE_DESC desc;
|
|
|
convertPassDesc(mData, desc);
|
|
|
|
|
|
- return RenderStateCoreManager::instance()._createPipelineState(desc);
|
|
|
+ return RenderStateCoreManager::instance()._createGraphicsPipelineState(desc);
|
|
|
}
|
|
|
|
|
|
SPtr<GraphicsPipelineState> GraphicsPipelineState::create(const PIPELINE_STATE_DESC& desc)
|
|
|
@@ -84,6 +95,52 @@ namespace BansheeEngine
|
|
|
return RenderStateManager::instance().createGraphicsPipelineState(desc);
|
|
|
}
|
|
|
|
|
|
+ template<bool Core>
|
|
|
+ TComputePipelineState<Core>::TComputePipelineState()
|
|
|
+ { }
|
|
|
+
|
|
|
+ template<bool Core>
|
|
|
+ TComputePipelineState<Core>::TComputePipelineState(const GpuProgramType& program)
|
|
|
+ :mProgram(program)
|
|
|
+ {
|
|
|
+ GPU_PIPELINE_PARAMS_DESC paramsDesc;
|
|
|
+ paramsDesc.computeParams = getParamDesc(program);
|
|
|
+
|
|
|
+ mParamInfo = GpuPipelineParamInfo::create(paramsDesc);
|
|
|
+ }
|
|
|
+
|
|
|
+ template class TComputePipelineState < false >;
|
|
|
+ template class TComputePipelineState < true >;
|
|
|
+
|
|
|
+ ComputePipelineStateCore::ComputePipelineStateCore(const SPtr<GpuProgramCore>& program, GpuDeviceFlags deviceMask)
|
|
|
+ :TComputePipelineState(program)
|
|
|
+ { }
|
|
|
+
|
|
|
+ SPtr<ComputePipelineStateCore> ComputePipelineStateCore::create(const SPtr<GpuProgramCore>& program,
|
|
|
+ GpuDeviceFlags deviceMask)
|
|
|
+ {
|
|
|
+ return RenderStateCoreManager::instance().createComputePipelineState(program, deviceMask);
|
|
|
+ }
|
|
|
+
|
|
|
+ ComputePipelineState::ComputePipelineState(const SPtr<GpuProgram>& program)
|
|
|
+ :TComputePipelineState(program)
|
|
|
+ { }
|
|
|
+
|
|
|
+ SPtr<ComputePipelineStateCore> ComputePipelineState::getCore() const
|
|
|
+ {
|
|
|
+ return std::static_pointer_cast<ComputePipelineStateCore>(mCoreSpecific);
|
|
|
+ }
|
|
|
+
|
|
|
+ SPtr<CoreObjectCore> ComputePipelineState::createCore() const
|
|
|
+ {
|
|
|
+ return RenderStateCoreManager::instance()._createComputePipelineState(mProgram->getCore());
|
|
|
+ }
|
|
|
+
|
|
|
+ SPtr<ComputePipelineState> ComputePipelineState::create(const SPtr<GpuProgram>& program)
|
|
|
+ {
|
|
|
+ return RenderStateManager::instance().createComputePipelineState(program);
|
|
|
+ }
|
|
|
+
|
|
|
GpuPipelineParamInfo::GpuPipelineParamInfo(const GPU_PIPELINE_PARAMS_DESC& desc)
|
|
|
:mTotalNumSets(0)
|
|
|
{
|