mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 08:51:52 +01:00
Introduce a pipeline state accessor that reads from a bundle
This commit is contained in:
parent
7dd3a1db0f
commit
06bf1b38af
@ -210,6 +210,7 @@ add_library(skyline SHARED
|
||||
${source_DIR}/skyline/gpu/interconnect/common/textures.cpp
|
||||
${source_DIR}/skyline/gpu/interconnect/common/shader_cache.cpp
|
||||
${source_DIR}/skyline/gpu/interconnect/common/pipeline_state_bundle.cpp
|
||||
${source_DIR}/skyline/gpu/interconnect/common/file_pipeline_state_accessor.cpp
|
||||
${source_DIR}/skyline/gpu/shaders/helper_shaders.cpp
|
||||
${source_DIR}/skyline/soc/smmu.cpp
|
||||
${source_DIR}/skyline/soc/host1x/syncpoint.cpp
|
||||
|
@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#include "file_pipeline_state_accessor.h"
|
||||
|
||||
namespace skyline::gpu::interconnect::maxwell3d {
|
||||
FilePipelineStateAccessor::FilePipelineStateAccessor(PipelineStateBundle &bundle) : bundle{bundle} {}
|
||||
|
||||
Shader::TextureType FilePipelineStateAccessor::GetTextureType(u32 index) const {
|
||||
return bundle.LookupTextureType(index);
|
||||
}
|
||||
|
||||
u32 FilePipelineStateAccessor::GetConstantBufferValue(u32 shaderStage, u32 index, u32 offset) const {
|
||||
return bundle.LookupConstantBufferValue(shaderStage, index, offset);
|
||||
}
|
||||
|
||||
ShaderBinary FilePipelineStateAccessor::GetShaderBinary(u32 pipelineStage) const {
|
||||
return bundle.GetShaderBinary(pipelineStage);
|
||||
}
|
||||
|
||||
void FilePipelineStateAccessor::MarkComplete() {}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
// Copyright © 2022 Skyline Team and Contributors (https://github.com/skyline-emu/)
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "pipeline_state_accessor.h"
|
||||
#include "pipeline_state_bundle.h"
|
||||
|
||||
namespace skyline::gpu::interconnect::maxwell3d {
|
||||
/**
|
||||
* @brief Implements the PipelineStateAccessor interface for pipelines loaded from a file
|
||||
*/
|
||||
class FilePipelineStateAccessor : public PipelineStateAccessor {
|
||||
private:
|
||||
PipelineStateBundle &bundle;
|
||||
|
||||
public:
|
||||
FilePipelineStateAccessor(PipelineStateBundle &bundle);
|
||||
|
||||
Shader::TextureType GetTextureType(u32 index) const override;
|
||||
|
||||
u32 GetConstantBufferValue(u32 shaderStage, u32 index, u32 offset) const override;
|
||||
|
||||
ShaderBinary GetShaderBinary(u32 pipelineStage) const override;
|
||||
|
||||
void MarkComplete() override;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user