mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
VideoCommon: store the configuration used to create the AbstractPipeline on the pipeline itself, so that it's easy to duplicate pipelines with slightly altered configuration
This commit is contained in:
@ -496,9 +496,10 @@ Metal::ObjectCache::CreatePipeline(const AbstractPipelineConfig& config)
|
||||
Internal::StoredPipeline pipeline = m_internal->GetOrCreatePipeline(config);
|
||||
if (!pipeline.first)
|
||||
return nullptr;
|
||||
return std::make_unique<Pipeline>(
|
||||
std::move(pipeline.first), pipeline.second, Convert(config.rasterization_state.primitive),
|
||||
Convert(config.rasterization_state.cullmode), config.depth_state, config.usage);
|
||||
return std::make_unique<Pipeline>(config, std::move(pipeline.first), pipeline.second,
|
||||
Convert(config.rasterization_state.primitive),
|
||||
Convert(config.rasterization_state.cullmode),
|
||||
config.depth_state, config.usage);
|
||||
}
|
||||
|
||||
void Metal::ObjectCache::ShaderDestroyed(const Shader* shader)
|
||||
|
@ -27,7 +27,8 @@ struct PipelineReflection
|
||||
class Pipeline final : public AbstractPipeline
|
||||
{
|
||||
public:
|
||||
explicit Pipeline(MRCOwned<id<MTLRenderPipelineState>> pipeline,
|
||||
explicit Pipeline(const AbstractPipelineConfig& config,
|
||||
MRCOwned<id<MTLRenderPipelineState>> pipeline,
|
||||
const PipelineReflection& reflection, MTLPrimitiveType prim, MTLCullMode cull,
|
||||
DepthState depth, AbstractPipelineUsage usage);
|
||||
|
||||
|
@ -53,11 +53,12 @@ Metal::PipelineReflection::PipelineReflection(MTLRenderPipelineReflection* refle
|
||||
GetArguments([reflection fragmentArguments], &textures, &samplers, &fragment_buffers);
|
||||
}
|
||||
|
||||
Metal::Pipeline::Pipeline(MRCOwned<id<MTLRenderPipelineState>> pipeline,
|
||||
Metal::Pipeline::Pipeline(const AbstractPipelineConfig& config,
|
||||
MRCOwned<id<MTLRenderPipelineState>> pipeline,
|
||||
const PipelineReflection& reflection, MTLPrimitiveType prim,
|
||||
MTLCullMode cull, DepthState depth, AbstractPipelineUsage usage)
|
||||
: m_pipeline(std::move(pipeline)), m_prim(prim), m_cull(cull), m_depth_stencil(depth),
|
||||
m_usage(usage), m_reflection(reflection)
|
||||
: AbstractPipeline(config), m_pipeline(std::move(pipeline)), m_prim(prim), m_cull(cull),
|
||||
m_depth_stencil(depth), m_usage(usage), m_reflection(reflection)
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user