Commit 83418fb1 by Jamie Madill Committed by Commit Bot

Don't allow for error in ProgramImpl::save.

Refactoring cleanup patch only. BUG=angleproject:1897 Change-Id: I6d12de5dab16ead9684886a1cf15b570e3c98156 Reviewed-on: https://chromium-review.googlesource.com/522871Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 88323761
...@@ -1104,7 +1104,7 @@ Error Program::saveBinary(const Context *context, ...@@ -1104,7 +1104,7 @@ Error Program::saveBinary(const Context *context,
stream.writeInt(samplerBinding.boundTextureUnits.size()); stream.writeInt(samplerBinding.boundTextureUnits.size());
} }
ANGLE_TRY(mProgram->save(&stream)); mProgram->save(&stream);
GLsizei streamLength = static_cast<GLsizei>(stream.length()); GLsizei streamLength = static_cast<GLsizei>(stream.length());
const void *streamState = stream.data(); const void *streamState = stream.data();
......
...@@ -43,7 +43,7 @@ class ProgramImpl : angle::NonCopyable ...@@ -43,7 +43,7 @@ class ProgramImpl : angle::NonCopyable
virtual LinkResult load(const gl::Context *context, virtual LinkResult load(const gl::Context *context,
gl::InfoLog &infoLog, gl::InfoLog &infoLog,
gl::BinaryInputStream *stream) = 0; gl::BinaryInputStream *stream) = 0;
virtual gl::Error save(gl::BinaryOutputStream *stream) = 0; virtual void save(gl::BinaryOutputStream *stream) = 0;
virtual void setBinaryRetrievableHint(bool retrievable) = 0; virtual void setBinaryRetrievableHint(bool retrievable) = 0;
virtual void setSeparable(bool separable) = 0; virtual void setSeparable(bool separable) = 0;
......
...@@ -24,7 +24,7 @@ class MockProgramImpl : public rx::ProgramImpl ...@@ -24,7 +24,7 @@ class MockProgramImpl : public rx::ProgramImpl
virtual ~MockProgramImpl() { destructor(); } virtual ~MockProgramImpl() { destructor(); }
MOCK_METHOD3(load, LinkResult(const gl::Context *, gl::InfoLog &, gl::BinaryInputStream *)); MOCK_METHOD3(load, LinkResult(const gl::Context *, gl::InfoLog &, gl::BinaryInputStream *));
MOCK_METHOD1(save, gl::Error(gl::BinaryOutputStream *)); MOCK_METHOD1(save, void(gl::BinaryOutputStream *));
MOCK_METHOD1(setBinaryRetrievableHint, void(bool)); MOCK_METHOD1(setBinaryRetrievableHint, void(bool));
MOCK_METHOD1(setSeparable, void(bool)); MOCK_METHOD1(setSeparable, void(bool));
......
...@@ -959,7 +959,7 @@ LinkResult ProgramD3D::load(const gl::Context *context, ...@@ -959,7 +959,7 @@ LinkResult ProgramD3D::load(const gl::Context *context,
return true; return true;
} }
gl::Error ProgramD3D::save(gl::BinaryOutputStream *stream) void ProgramD3D::save(gl::BinaryOutputStream *stream)
{ {
// Output the DeviceIdentifier before we output any shader code // Output the DeviceIdentifier before we output any shader code
// When we load the binary again later, we can validate the device identifier before trying to // When we load the binary again later, we can validate the device identifier before trying to
...@@ -1123,8 +1123,6 @@ gl::Error ProgramD3D::save(gl::BinaryOutputStream *stream) ...@@ -1123,8 +1123,6 @@ gl::Error ProgramD3D::save(gl::BinaryOutputStream *stream)
{ {
stream->writeInt(0); stream->writeInt(0);
} }
return gl::NoError();
} }
void ProgramD3D::setBinaryRetrievableHint(bool /* retrievable */) void ProgramD3D::setBinaryRetrievableHint(bool /* retrievable */)
......
...@@ -161,7 +161,7 @@ class ProgramD3D : public ProgramImpl ...@@ -161,7 +161,7 @@ class ProgramD3D : public ProgramImpl
LinkResult load(const gl::Context *context, LinkResult load(const gl::Context *context,
gl::InfoLog &infoLog, gl::InfoLog &infoLog,
gl::BinaryInputStream *stream) override; gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override; void save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override; void setBinaryRetrievableHint(bool retrievable) override;
void setSeparable(bool separable) override; void setSeparable(bool separable) override;
......
...@@ -86,7 +86,7 @@ LinkResult ProgramGL::load(const gl::Context *context, ...@@ -86,7 +86,7 @@ LinkResult ProgramGL::load(const gl::Context *context,
return true; return true;
} }
gl::Error ProgramGL::save(gl::BinaryOutputStream *stream) void ProgramGL::save(gl::BinaryOutputStream *stream)
{ {
GLint binaryLength = 0; GLint binaryLength = 0;
mFunctions->getProgramiv(mProgramID, GL_PROGRAM_BINARY_LENGTH, &binaryLength); mFunctions->getProgramiv(mProgramID, GL_PROGRAM_BINARY_LENGTH, &binaryLength);
...@@ -99,8 +99,6 @@ gl::Error ProgramGL::save(gl::BinaryOutputStream *stream) ...@@ -99,8 +99,6 @@ gl::Error ProgramGL::save(gl::BinaryOutputStream *stream)
stream->writeInt(binaryFormat); stream->writeInt(binaryFormat);
stream->writeInt(binaryLength); stream->writeInt(binaryLength);
stream->writeBytes(&binary[0], binaryLength); stream->writeBytes(&binary[0], binaryLength);
return gl::NoError();
} }
void ProgramGL::setBinaryRetrievableHint(bool retrievable) void ProgramGL::setBinaryRetrievableHint(bool retrievable)
......
...@@ -34,7 +34,7 @@ class ProgramGL : public ProgramImpl ...@@ -34,7 +34,7 @@ class ProgramGL : public ProgramImpl
LinkResult load(const gl::Context *contextImpl, LinkResult load(const gl::Context *contextImpl,
gl::InfoLog &infoLog, gl::InfoLog &infoLog,
gl::BinaryInputStream *stream) override; gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override; void save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override; void setBinaryRetrievableHint(bool retrievable) override;
void setSeparable(bool separable) override; void setSeparable(bool separable) override;
......
...@@ -29,9 +29,8 @@ LinkResult ProgramNULL::load(const gl::Context *contextImpl, ...@@ -29,9 +29,8 @@ LinkResult ProgramNULL::load(const gl::Context *contextImpl,
return true; return true;
} }
gl::Error ProgramNULL::save(gl::BinaryOutputStream *stream) void ProgramNULL::save(gl::BinaryOutputStream *stream)
{ {
return gl::NoError();
} }
void ProgramNULL::setBinaryRetrievableHint(bool retrievable) void ProgramNULL::setBinaryRetrievableHint(bool retrievable)
......
...@@ -24,7 +24,7 @@ class ProgramNULL : public ProgramImpl ...@@ -24,7 +24,7 @@ class ProgramNULL : public ProgramImpl
LinkResult load(const gl::Context *context, LinkResult load(const gl::Context *context,
gl::InfoLog &infoLog, gl::InfoLog &infoLog,
gl::BinaryInputStream *stream) override; gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override; void save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override; void setBinaryRetrievableHint(bool retrievable) override;
void setSeparable(bool separable) override; void setSeparable(bool separable) override;
......
...@@ -43,10 +43,9 @@ LinkResult ProgramVk::load(const gl::Context *contextImpl, ...@@ -43,10 +43,9 @@ LinkResult ProgramVk::load(const gl::Context *contextImpl,
return gl::InternalError(); return gl::InternalError();
} }
gl::Error ProgramVk::save(gl::BinaryOutputStream *stream) void ProgramVk::save(gl::BinaryOutputStream *stream)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return gl::InternalError();
} }
void ProgramVk::setBinaryRetrievableHint(bool retrievable) void ProgramVk::setBinaryRetrievableHint(bool retrievable)
......
...@@ -26,7 +26,7 @@ class ProgramVk : public ProgramImpl ...@@ -26,7 +26,7 @@ class ProgramVk : public ProgramImpl
LinkResult load(const gl::Context *context, LinkResult load(const gl::Context *context,
gl::InfoLog &infoLog, gl::InfoLog &infoLog,
gl::BinaryInputStream *stream) override; gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override; void save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override; void setBinaryRetrievableHint(bool retrievable) override;
void setSeparable(bool separable) override; void setSeparable(bool separable) override;
......
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