mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-02-17 01:31:25 +00:00
Remove EPassType from VkShaderManager::Get and CompileNextShader() from VkShaderManager constructor
This commit is contained in:
parent
f220577ca4
commit
6d3cb20699
4 changed files with 5 additions and 6 deletions
|
@ -245,7 +245,7 @@ std::unique_ptr<VulkanPipeline> VkRenderPassSetup::CreatePipeline(const VkPipeli
|
|||
GraphicsPipelineBuilder builder;
|
||||
builder.Cache(fb->GetRenderPassManager()->GetCache());
|
||||
|
||||
VkShaderProgram *program = fb->GetShaderManager()->Get(key.ShaderKey, PassKey.DrawBuffers > 1 ? GBUFFER_PASS : NORMAL_PASS);
|
||||
VkShaderProgram *program = fb->GetShaderManager()->Get(key.ShaderKey);
|
||||
builder.AddVertexShader(program->vert.get());
|
||||
builder.AddFragmentShader(program->frag.get());
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
VkShaderManager::VkShaderManager(VulkanRenderDevice* fb) : fb(fb)
|
||||
{
|
||||
CompileNextShader();
|
||||
}
|
||||
|
||||
VkShaderManager::~VkShaderManager()
|
||||
|
@ -45,10 +44,8 @@ void VkShaderManager::Deinit()
|
|||
RemoveVkPPShader(PPShaders.back());
|
||||
}
|
||||
|
||||
VkShaderProgram* VkShaderManager::Get(const VkShaderKey& k, EPassType passType)
|
||||
VkShaderProgram* VkShaderManager::Get(const VkShaderKey& key)
|
||||
{
|
||||
VkShaderKey key = k;
|
||||
key.GBufferPass = passType;
|
||||
auto& program = programs[key];
|
||||
if (program.frag)
|
||||
return &program;
|
||||
|
|
|
@ -112,7 +112,7 @@ public:
|
|||
|
||||
void Deinit();
|
||||
|
||||
VkShaderProgram* Get(const VkShaderKey& key, EPassType passType);
|
||||
VkShaderProgram* Get(const VkShaderKey& key);
|
||||
|
||||
bool CompileNextShader() { return true; }
|
||||
|
||||
|
|
|
@ -296,6 +296,8 @@ void VkRenderState::ApplyRenderPass(int dt)
|
|||
pipelineKey.ShaderKey.UseShadowmap = gl_light_shadowmap;
|
||||
pipelineKey.ShaderKey.UseRaytrace = gl_light_raytrace;
|
||||
|
||||
pipelineKey.ShaderKey.GBufferPass = mRenderTarget.DrawBuffers > 1;
|
||||
|
||||
// Is this the one we already have?
|
||||
bool inRenderPass = mCommandBuffer;
|
||||
bool changingPipeline = (!inRenderPass) || (pipelineKey != mPipelineKey);
|
||||
|
|
Loading…
Reference in a new issue