mirror of
https://github.com/godotengine/godot-angle-static.git
synced 2026-01-06 02:09:55 +03:00
Vulkan: Make sure ProgramVk has no members other than executable
The program is really just an interface to the executable. It should not hold on to any data on its own. The SpvProgramInterfaceInfo member did not even need to be a member, and was left over from previous refactorings. Bug: angleproject:8297 Change-Id: I4edb53c1c8b27e242a62fb4fc253ade58bd8dde1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4812137 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
This commit is contained in:
committed by
Angle LUCI CQ
parent
e066b68967
commit
57388ab2e2
@@ -300,12 +300,10 @@ class ProgramExecutableVk
|
||||
}
|
||||
void assignAllSpvLocations(vk::Context *context,
|
||||
const gl::ProgramState &programState,
|
||||
const gl::ProgramLinkedResources &resources,
|
||||
SpvProgramInterfaceInfo *programInterfaceInfo)
|
||||
const gl::ProgramLinkedResources &resources)
|
||||
{
|
||||
SpvSourceOptions options = SpvCreateSourceOptions(context->getFeatures());
|
||||
SpvAssignAllLocations(options, programState, resources, programInterfaceInfo,
|
||||
&mVariableInfoMap);
|
||||
SpvAssignAllLocations(options, programState, resources, &mVariableInfoMap);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -36,8 +36,7 @@ angle::Result ProgramPipelineVk::link(const gl::Context *glContext,
|
||||
ContextVk *contextVk = vk::GetImpl(glContext);
|
||||
const gl::ProgramExecutable &glExecutable = mState.getExecutable();
|
||||
SpvSourceOptions options = SpvCreateSourceOptions(contextVk->getFeatures());
|
||||
SpvProgramInterfaceInfo spvProgramInterfaceInfo;
|
||||
spvProgramInterfaceInfo = {};
|
||||
SpvProgramInterfaceInfo spvProgramInterfaceInfo = {};
|
||||
|
||||
reset(contextVk);
|
||||
mExecutable.clearVariableInfoMap();
|
||||
|
||||
@@ -59,7 +59,6 @@ class LinkTaskVk final : public vk::Context, public angle::Closure
|
||||
ProgramExecutableVk *executable,
|
||||
gl::ProgramMergedVaryings &&mergedVaryings,
|
||||
const gl::ProgramLinkedResources &resources,
|
||||
SpvProgramInterfaceInfo *programInterfaceInfo,
|
||||
bool isGLES1,
|
||||
vk::PipelineRobustness pipelineRobustness,
|
||||
vk::PipelineProtectedAccess pipelineProtectedAccess)
|
||||
@@ -69,7 +68,6 @@ class LinkTaskVk final : public vk::Context, public angle::Closure
|
||||
mExecutable(executable),
|
||||
mMergedVaryings(std::move(mergedVaryings)),
|
||||
mResources(resources),
|
||||
mProgramInterfaceInfo(programInterfaceInfo),
|
||||
mIsGLES1(isGLES1),
|
||||
mPipelineRobustness(pipelineRobustness),
|
||||
mPipelineProtectedAccess(pipelineProtectedAccess),
|
||||
@@ -154,7 +152,6 @@ class LinkTaskVk final : public vk::Context, public angle::Closure
|
||||
ProgramExecutableVk *mExecutable;
|
||||
const gl::ProgramMergedVaryings mMergedVaryings;
|
||||
const gl::ProgramLinkedResources &mResources;
|
||||
SpvProgramInterfaceInfo *mProgramInterfaceInfo;
|
||||
const bool mIsGLES1;
|
||||
const vk::PipelineRobustness mPipelineRobustness;
|
||||
const vk::PipelineProtectedAccess mPipelineProtectedAccess;
|
||||
@@ -184,7 +181,7 @@ angle::Result LinkTaskVk::linkImpl()
|
||||
mExecutable->clearVariableInfoMap();
|
||||
|
||||
// Gather variable info and compiled SPIR-V binaries.
|
||||
mExecutable->assignAllSpvLocations(this, mState, mResources, mProgramInterfaceInfo);
|
||||
mExecutable->assignAllSpvLocations(this, mState, mResources);
|
||||
|
||||
gl::ShaderMap<const angle::spirv::Blob *> spirvBlobs;
|
||||
SpvGetShaderSpirvCode(mState, &spirvBlobs);
|
||||
@@ -437,8 +434,6 @@ void ProgramVk::destroy(const gl::Context *context)
|
||||
|
||||
void ProgramVk::reset(ContextVk *contextVk)
|
||||
{
|
||||
mSpvProgramInterfaceInfo = {};
|
||||
|
||||
mExecutable.reset(contextVk);
|
||||
}
|
||||
|
||||
@@ -478,16 +473,14 @@ std::unique_ptr<LinkEvent> ProgramVk::link(const gl::Context *context,
|
||||
|
||||
ContextVk *contextVk = vk::GetImpl(context);
|
||||
reset(contextVk);
|
||||
mExecutable.resetLayout(contextVk);
|
||||
|
||||
const gl::ProgramExecutable &programExecutable = mState.getExecutable();
|
||||
|
||||
std::shared_ptr<LinkTaskVk> linkTask = std::make_shared<LinkTaskVk>(
|
||||
contextVk->getRenderer(), contextVk->getPipelineLayoutCache(),
|
||||
contextVk->getDescriptorSetLayoutCache(), mState, programExecutable, &mExecutable,
|
||||
std::move(mergedVaryings), resources, &mSpvProgramInterfaceInfo,
|
||||
context->getState().isGLES1(), contextVk->pipelineRobustness(),
|
||||
contextVk->pipelineProtectedAccess());
|
||||
std::move(mergedVaryings), resources, context->getState().isGLES1(),
|
||||
contextVk->pipelineRobustness(), contextVk->pipelineProtectedAccess());
|
||||
return std::make_unique<LinkEventVulkan>(context->getShaderCompileThreadPool(), linkTask);
|
||||
}
|
||||
|
||||
|
||||
@@ -117,8 +117,6 @@ class ProgramVk : public ProgramImpl
|
||||
const ProgramExecutableVk &getExecutable() const { return mExecutable; }
|
||||
ProgramExecutableVk &getExecutable() { return mExecutable; }
|
||||
|
||||
const SpvProgramInterfaceInfo &getSpvProgramInterfaceInfo() { return mSpvProgramInterfaceInfo; }
|
||||
|
||||
private:
|
||||
template <int cols, int rows>
|
||||
void setUniformMatrixfv(GLint location,
|
||||
@@ -137,9 +135,6 @@ class ProgramVk : public ProgramImpl
|
||||
angle::Result createGraphicsPipelineWithDefaultState(const gl::Context *context,
|
||||
vk::PipelineCacheAccess *pipelineCache);
|
||||
|
||||
// We keep the SPIR-V code to use for draw call pipeline creation.
|
||||
SpvProgramInterfaceInfo mSpvProgramInterfaceInfo;
|
||||
|
||||
ProgramExecutableVk mExecutable;
|
||||
};
|
||||
|
||||
|
||||
@@ -4956,10 +4956,10 @@ void SpvGetShaderSpirvCode(const gl::ProgramState &programState,
|
||||
void SpvAssignAllLocations(const SpvSourceOptions &options,
|
||||
const gl::ProgramState &programState,
|
||||
const gl::ProgramLinkedResources &resources,
|
||||
SpvProgramInterfaceInfo *programInterfaceInfo,
|
||||
ShaderInterfaceVariableInfoMap *variableInfoMapOut)
|
||||
{
|
||||
const gl::ProgramExecutable &programExecutable = programState.getExecutable();
|
||||
SpvProgramInterfaceInfo spvProgramInterfaceInfo = {};
|
||||
const gl::ProgramExecutable &programExecutable = programState.getExecutable();
|
||||
gl::ShaderType xfbStage = programState.getAttachedTransformFeedbackStage();
|
||||
|
||||
// This should be done before assigning varying location. Otherwise, We can encounter shader
|
||||
@@ -4973,12 +4973,12 @@ void SpvAssignAllLocations(const SpvSourceOptions &options,
|
||||
gl::ShaderTypeSupportsTransformFeedback(shaderType))
|
||||
{
|
||||
SpvAssignTransformFeedbackLocations(shaderType, programExecutable, isXfbStage,
|
||||
programInterfaceInfo, variableInfoMapOut);
|
||||
&spvProgramInterfaceInfo, variableInfoMapOut);
|
||||
}
|
||||
}
|
||||
|
||||
SpvAssignLocations(options, programExecutable, resources.varyingPacking, xfbStage,
|
||||
programInterfaceInfo, variableInfoMapOut);
|
||||
&spvProgramInterfaceInfo, variableInfoMapOut);
|
||||
}
|
||||
|
||||
angle::Result SpvTransformSpirvCode(const SpvTransformOptions &options,
|
||||
|
||||
@@ -133,7 +133,6 @@ void SpvGetShaderSpirvCode(const gl::ProgramState &programState,
|
||||
void SpvAssignAllLocations(const SpvSourceOptions &options,
|
||||
const gl::ProgramState &programState,
|
||||
const gl::ProgramLinkedResources &resources,
|
||||
SpvProgramInterfaceInfo *programInterfaceInfo,
|
||||
ShaderInterfaceVariableInfoMap *variableInfoMapOut);
|
||||
|
||||
angle::Result SpvTransformSpirvCode(const SpvTransformOptions &options,
|
||||
|
||||
Reference in New Issue
Block a user