Commit 1b2dd6f9 by Tim Van Patten Committed by Commit Bot

Vulkan: Refactor varying validation for separable programs

The varying validation is being refactored to better handle separable programs. Some additional validation is being added as well regarding: - Number of varyings (inputs vs outputs) - Precision This refactor will also allow ProgramPipelines to validate varyings between shaders that are in different Programs. Bug: angleproject:3570 Change-Id: I13f324da2ffea039e696962d6971a54f7a7b6f77 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2083847 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent b387ce93
...@@ -503,6 +503,11 @@ class Program final : angle::NonCopyable, public LabeledObject ...@@ -503,6 +503,11 @@ class Program final : angle::NonCopyable, public LabeledObject
void bindFragmentOutputLocation(GLuint index, const char *name); void bindFragmentOutputLocation(GLuint index, const char *name);
void bindFragmentOutputIndex(GLuint index, const char *name); void bindFragmentOutputIndex(GLuint index, const char *name);
angle::Result linkMergedVaryings(const Context *context,
VaryingPacking &varyingPacking,
const ProgramMergedVaryings &mergedVaryings,
ProgramLinkedResources *resources);
// KHR_parallel_shader_compile // KHR_parallel_shader_compile
// Try to link the program asynchrously. As a result, background threads may be launched to // Try to link the program asynchrously. As a result, background threads may be launched to
// execute the linking tasks concurrently. // execute the linking tasks concurrently.
...@@ -842,6 +847,26 @@ class Program final : angle::NonCopyable, public LabeledObject ...@@ -842,6 +847,26 @@ class Program final : angle::NonCopyable, public LabeledObject
const ProgramExecutable &getExecutable() const { return mState.getProgramExecutable(); } const ProgramExecutable &getExecutable() const { return mState.getProgramExecutable(); }
ProgramExecutable &getExecutable() { return mState.getProgramExecutable(); } ProgramExecutable &getExecutable() { return mState.getProgramExecutable(); }
static void getFilteredVaryings(const std::vector<sh::ShaderVariable> &varyings,
std::vector<const sh::ShaderVariable *> *filteredVaryingsOut);
static bool doShaderVariablesMatch(gl::Shader *generatingShader,
gl::Shader *consumingShader,
const sh::ShaderVariable &input,
const sh::ShaderVariable &output,
bool validateGeometryShaderInputs,
bool isSeparable,
gl::InfoLog &infoLog);
static bool linkValidateShaderInterfaceMatching(Shader *generatingShader,
Shader *consumingShader,
bool isSeparable,
InfoLog &infoLog);
static bool linkValidateBuiltInVaryings(Shader *vertexShader,
Shader *fragmentShader,
InfoLog &infoLog);
// Check for aliased path rendering input bindings (if any).
// If more than one binding refer statically to the same location the link must fail.
bool linkValidateFragmentInputBindings(InfoLog &infoLog) const;
private: private:
struct LinkingState; struct LinkingState;
...@@ -877,13 +902,9 @@ class Program final : angle::NonCopyable, public LabeledObject ...@@ -877,13 +902,9 @@ class Program final : angle::NonCopyable, public LabeledObject
const sh::ShaderVariable &inputVarying, const sh::ShaderVariable &inputVarying,
int shaderVersion, int shaderVersion,
bool validateGeometryShaderInputVarying, bool validateGeometryShaderInputVarying,
bool isSeparable,
std::string *mismatchedStructFieldName); std::string *mismatchedStructFieldName);
bool linkValidateShaderInterfaceMatching(Shader *generatingShader,
Shader *consumingShader,
InfoLog &infoLog) const;
bool linkValidateBuiltInVaryings(InfoLog &infoLog) const;
bool linkValidateTransformFeedback(const Version &version, bool linkValidateTransformFeedback(const Version &version,
InfoLog &infoLog, InfoLog &infoLog,
const ProgramMergedVaryings &linkedVaryings, const ProgramMergedVaryings &linkedVaryings,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment