Hash :
d0280f09
Author :
Date :
2024-06-03T13:21:06
Cleanup Program Executable post link task wait Frontend changes: - Add `ASSERT` into `ProgramExecutable::waitForPostLinkTasks()` to check that `mPostLinkSubTasks` must be empty after backend wait. - Add `UNIMPLEMENTED` into `ProgramExecutableImpl` `waitForPostLinkTasks()`, because this method is only required if backend fills `postLinkSubTasksOut` in `LinkTask`, and frontend must not call this method if `mPostLinkSubTasks` are empty. Vulkan backend changes: - Add public `ProgramExecutableVk::waitForComputePostLinkTasks()` with ASSERT to only allow usage with Compute executable. This change avoids confusion calling `waitForPostLinkTasksIfNecessary()` with `nullptr` in case of the Compute pipelines, which will always wait. - Rename `waitForPostLinkTasksIfNecessary()` to `waitForGraphicsPostLinkTasks()`, add ASSERT to only allow usage with Graphics executable, and change optional pointer to the `GraphicsPipelineDesc` to the reference. - Add `WaitableEvent::AllReady()` check into `ProgramExecutableVk` `waitForGraphicsPostLinkTasks()` when going to skip waiting, in order to process tasks (by calling wait) when all tasks are ready. Without this change, post link task may never be processed, causing repeated `GraphicsPipelineDesc` comparisons. - Replace `GraphicsPipelineDesc` hash comparison in `waitForGraphicsPostLinkTasks()` with `keyEqual()` call. This method is around 7 times faster, however effect on the overall performance will likely be unmeasurable. Changed for clarity. - Remove unnecessary `mWarmUpGraphicsPipelineDesc` reset from: `ProgramExecutableVk` initializer list (has default constructor), Compute warmup (already clean after constructor), wait post link tasks (not used when no tasks). - Other minor changes. Bug: angleproject:8297 Change-Id: I7d790da6712be013243083e314af75f82e73886d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5592474 Reviewed-by: mohan maiya <m.maiya@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Igor Nazarov <i.nazarov@samsung.com>
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
//
// Copyright 2023 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.
//
// ProgramExecutableImpl.h: Defines the abstract rx::ProgramExecutableImpl class.
#ifndef LIBANGLE_RENDERER_PROGRAMEXECUTABLEIMPL_H_
#define LIBANGLE_RENDERER_PROGRAMEXECUTABLEIMPL_H_
#include "common/angleutils.h"
namespace gl
{
class Context;
class ProgramExecutable;
} // namespace gl
namespace rx
{
// ProgramExecutable holds the result of link. The backend ProgramExecutable* classes similarly
// hold additonaly backend-specific link results. A program's executable is changed on successful
// link. This allows the program to continue to work with its existing executable despite a failed
// relink.
class ProgramExecutableImpl : angle::NonCopyable
{
public:
ProgramExecutableImpl(const gl::ProgramExecutable *executable) : mExecutable(executable) {}
virtual ~ProgramExecutableImpl() {}
virtual void destroy(const gl::Context *context) {}
virtual void setUniform1fv(GLint location, GLsizei count, const GLfloat *v) = 0;
virtual void setUniform2fv(GLint location, GLsizei count, const GLfloat *v) = 0;
virtual void setUniform3fv(GLint location, GLsizei count, const GLfloat *v) = 0;
virtual void setUniform4fv(GLint location, GLsizei count, const GLfloat *v) = 0;
virtual void setUniform1iv(GLint location, GLsizei count, const GLint *v) = 0;
virtual void setUniform2iv(GLint location, GLsizei count, const GLint *v) = 0;
virtual void setUniform3iv(GLint location, GLsizei count, const GLint *v) = 0;
virtual void setUniform4iv(GLint location, GLsizei count, const GLint *v) = 0;
virtual void setUniform1uiv(GLint location, GLsizei count, const GLuint *v) = 0;
virtual void setUniform2uiv(GLint location, GLsizei count, const GLuint *v) = 0;
virtual void setUniform3uiv(GLint location, GLsizei count, const GLuint *v) = 0;
virtual void setUniform4uiv(GLint location, GLsizei count, const GLuint *v) = 0;
virtual void setUniformMatrix2fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix3fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix4fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix2x3fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix3x2fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix2x4fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix4x2fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix3x4fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
virtual void setUniformMatrix4x3fv(GLint location,
GLsizei count,
GLboolean transpose,
const GLfloat *value) = 0;
// Done in the back-end to avoid having to keep a system copy of uniform data.
virtual void getUniformfv(const gl::Context *context,
GLint location,
GLfloat *params) const = 0;
virtual void getUniformiv(const gl::Context *context, GLint location, GLint *params) const = 0;
virtual void getUniformuiv(const gl::Context *context,
GLint location,
GLuint *params) const = 0;
// Optional. Implement in backends that fill |postLinkSubTasksOut| in |LinkTask|.
virtual void waitForPostLinkTasks(const gl::Context *context) { UNIMPLEMENTED(); }
const gl::ProgramExecutable *getExecutable() const { return mExecutable; }
protected:
const gl::ProgramExecutable *mExecutable;
};
} // namespace rx
#endif // LIBANGLE_RENDERER_PROGRAMEXECUTABLEIMPL_H_