Hash :
92e7bc89
Author :
Date :
2020-12-23T15:18:42
Remove ProgramLinkedResources from ProgramExecutable. Instead of storing the entire LinkedResources struct, we can keep it only for the duration of the linking calls. Refactoring change only. It sets the stage for more refactoring. This change also switches the link call to use LinkingState's ProgramLinkedResources directly to avoid the need to copy the varying packing or use a pointer. Bug: angleproject:4514 Bug: angleproject:5496 Change-Id: Iefea3c16a33213dc338cc54efaa7c3064ea6ae08 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2601403 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
//
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// ProgramPipelineVk.h:
// Defines the class interface for ProgramPipelineVk, implementing ProgramPipelineImpl.
//
#ifndef LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_
#define LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_
#include "libANGLE/renderer/ProgramPipelineImpl.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/ProgramExecutableVk.h"
#include "libANGLE/renderer/vulkan/ProgramVk.h"
namespace rx
{
class ProgramPipelineVk : public ProgramPipelineImpl
{
public:
ProgramPipelineVk(const gl::ProgramPipelineState &state);
~ProgramPipelineVk() override;
void destroy(const gl::Context *context) override;
void reset(ContextVk *contextVk);
const ProgramExecutableVk &getExecutable() const { return mExecutable; }
ProgramExecutableVk &getExecutable() { return mExecutable; }
ProgramVk *getShaderProgram(const gl::State &glState, gl::ShaderType shaderType) const
{
gl::ProgramPipeline *pipeline = glState.getProgramPipeline();
const gl::Program *program = pipeline->getShaderProgram(shaderType);
if (program)
{
return vk::GetImpl(program);
}
return nullptr;
}
void fillProgramStateMap(const ContextVk *contextVk,
gl::ShaderMap<const gl::ProgramState *> *programStatesOut);
angle::Result link(const gl::Context *glContext,
const gl::ProgramMergedVaryings &mergedVaryings,
const gl::VaryingPacking &varyingPacking) override;
angle::Result updateUniforms(ContextVk *contextVk);
bool dirtyUniforms(const gl::State &glState);
void onProgramBind(ContextVk *contextVk);
private:
size_t calcUniformUpdateRequiredSpace(ContextVk *contextVk,
const gl::ProgramExecutable &glExecutable,
const gl::State &glState,
gl::ShaderMap<VkDeviceSize> *uniformOffsets) const;
void setAllDefaultUniformsDirty(const gl::State &glState);
ProgramExecutableVk mExecutable;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_VULKAN_PROGRAMPIPELINEVK_H_