Revert "Clean up interface to ProgramImpl::link."
Probably causing bot failures in a prior dependent patch.
BUG=angleproject:1123
This reverts commit b83592750d00ca96413575016b0e27bc9d861f58.
Change-Id: I7642c4a66b190dda49cbb16611abc893f3eb6422
Reviewed-on: https://chromium-review.googlesource.com/296700
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index 7a77fd4..179186a 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -1128,24 +1128,24 @@
return LinkResult(linkSuccess, gl::Error(GL_NO_ERROR));
}
-LinkResult ProgramD3D::link(const gl::Data &data, gl::InfoLog &infoLog)
+LinkResult ProgramD3D::link(const gl::Data &data,
+ gl::InfoLog &infoLog,
+ gl::Shader *fragmentShader,
+ gl::Shader *vertexShader)
{
- const gl::Shader *vertexShader = mData.getAttachedVertexShader();
- const gl::Shader *fragmentShader = mData.getAttachedFragmentShader();
+ ShaderD3D *vertexShaderD3D = GetImplAs<ShaderD3D>(vertexShader);
+ ShaderD3D *fragmentShaderD3D = GetImplAs<ShaderD3D>(fragmentShader);
- const ShaderD3D *vertexShaderD3D = GetImplAs<ShaderD3D>(vertexShader);
- const ShaderD3D *fragmentShaderD3D = GetImplAs<ShaderD3D>(fragmentShader);
-
- mSamplersVS.resize(data.caps->maxVertexTextureImageUnits);
mSamplersPS.resize(data.caps->maxTextureImageUnits);
+ mSamplersVS.resize(data.caps->maxVertexTextureImageUnits);
+
+ mPixelHLSL = fragmentShaderD3D->getTranslatedSource();
+ fragmentShaderD3D->generateWorkarounds(&mPixelWorkarounds);
mVertexHLSL = vertexShaderD3D->getTranslatedSource();
vertexShaderD3D->generateWorkarounds(&mVertexWorkarounds);
mShaderVersion = vertexShaderD3D->getShaderVersion();
- mPixelHLSL = fragmentShaderD3D->getTranslatedSource();
- fragmentShaderD3D->generateWorkarounds(&mPixelWorkarounds);
-
if (mRenderer->getRendererLimitations().noFrontFacingSupport)
{
if (fragmentShaderD3D->usesFrontFacing())
diff --git a/src/libANGLE/renderer/d3d/ProgramD3D.h b/src/libANGLE/renderer/d3d/ProgramD3D.h
index 6efc654..9ce3b0d 100644
--- a/src/libANGLE/renderer/d3d/ProgramD3D.h
+++ b/src/libANGLE/renderer/d3d/ProgramD3D.h
@@ -70,7 +70,11 @@
gl::Error getVertexExecutableForInputLayout(const gl::InputLayout &inputLayout, ShaderExecutableD3D **outExectuable, gl::InfoLog *infoLog);
ShaderExecutableD3D *getGeometryExecutable() const { return mGeometryExecutable; }
- LinkResult link(const gl::Data &data, gl::InfoLog &infoLog) override;
+ LinkResult link(const gl::Data &data,
+ gl::InfoLog &infoLog,
+ gl::Shader *fragmentShader,
+ gl::Shader *vertexShader) override;
+
GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) override;
void initializeUniformStorage();