Commit 57f20894 by Jamie Madill

Revert "Add a centralized workarounds module."

Was missing an initialization in Renderer.cpp. This reverts commit 815a1dc3. Change-Id: Ia4666911c2ff58660e0ab5c7cec4431b1c30a1e1 Reviewed-on: https://chromium-review.googlesource.com/220420Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 815a1dc3
......@@ -242,7 +242,6 @@
<ClInclude Include="..\..\src\libGLESv2\validationES.h"/>
<ClInclude Include="..\..\src\libGLESv2\renderer\TextureImpl.h"/>
<ClInclude Include="..\..\src\libGLESv2\renderer\Renderer.h"/>
<ClInclude Include="..\..\src\libGLESv2\renderer\Workarounds.h"/>
<ClInclude Include="..\..\src\libGLESv2\renderer\ShaderImpl.h"/>
<ClInclude Include="..\..\src\libGLESv2\renderer\TransformFeedbackImpl.h"/>
<ClInclude Include="..\..\src\libGLESv2\renderer\ShaderExecutable.h"/>
......
......@@ -267,9 +267,6 @@
<None Include="..\..\src\libGLESv2\renderer\loadimage.inl">
<Filter>src\libGLESv2\renderer</Filter>
</None>
<ClInclude Include="..\..\src\libGLESv2\renderer\Workarounds.h">
<Filter>src\libGLESv2\renderer</Filter>
</ClInclude>
<ClInclude Include="..\..\src\libGLESv2\renderer\ShaderImpl.h">
<Filter>src\libGLESv2\renderer</Filter>
</ClInclude>
......
......@@ -115,7 +115,6 @@
'libGLESv2/renderer/TextureImpl.h',
'libGLESv2/renderer/TransformFeedbackImpl.h',
'libGLESv2/renderer/VertexArrayImpl.h',
'libGLESv2/renderer/Workarounds.h',
'libGLESv2/renderer/copyimage.cpp',
'libGLESv2/renderer/copyimage.h',
'libGLESv2/renderer/copyimage.inl',
......
......@@ -16,7 +16,6 @@
#include "libGLESv2/FramebufferAttachment.h"
#include "libGLESv2/renderer/Renderer.h"
#include "libGLESv2/renderer/RenderTarget.h"
#include "libGLESv2/renderer/Workarounds.h"
#include "libGLESv2/renderer/d3d/TextureD3D.h"
#include "common/utilities.h"
......@@ -690,10 +689,12 @@ ColorbufferInfo Framebuffer::getColorbuffersForRender() const
ASSERT(drawBufferState == GL_BACK || drawBufferState == (GL_COLOR_ATTACHMENT0_EXT + colorAttachment));
colorbuffersForRender.push_back(colorbuffer);
}
else if (!mRenderer->getWorkarounds().mrtPerfWorkaround)
#if (ANGLE_MRT_PERF_WORKAROUND == ANGLE_WORKAROUND_DISABLED)
else
{
colorbuffersForRender.push_back(NULL);
}
#endif
}
return colorbuffersForRender;
......
......@@ -24,6 +24,11 @@
#include <string>
#include <vector>
// TODO(jmadill): place this in workarounds library
#define ANGLE_WORKAROUND_ENABLED 1
#define ANGLE_WORKAROUND_DISABLED 2
#define ANGLE_MRT_PERF_WORKAROUND ANGLE_WORKAROUND_ENABLED
namespace sh
{
class HLSLBlockEncoder;
......
......@@ -250,6 +250,13 @@ enum VertexConversionType
VERTEX_CONVERT_BOTH = 3
};
enum D3DWorkaroundType
{
ANGLE_D3D_WORKAROUND_NONE,
ANGLE_D3D_WORKAROUND_SKIP_OPTIMIZATION,
ANGLE_D3D_WORKAROUND_MAX_OPTIMIZATION
};
}
#endif // LIBGLESV2_ANGLETYPES_H_
......@@ -79,17 +79,6 @@ const gl::Extensions &Renderer::getRendererExtensions() const
return mExtensions;
}
const Workarounds &Renderer::getWorkarounds() const
{
if (!mWorkaroundsInitialized)
{
mWorkarounds = generateWorkarounds();
mWorkaroundsInitialized = true;
}
return mWorkarounds;
}
typedef Renderer *(*CreateRendererFunction)(egl::Display*, EGLNativeDisplayType, EGLint);
template <typename RendererType>
......
......@@ -15,7 +15,6 @@
#include "libGLESv2/Caps.h"
#include "common/NativeWindow.h"
#include "libGLESv2/Error.h"
#include "libGLESv2/renderer/Workarounds.h"
#include <cstdint>
......@@ -250,8 +249,6 @@ class Renderer
virtual rx::VertexConversionType getVertexConversionType(const gl::VertexFormat &vertexFormat) const = 0;
virtual GLenum getVertexComponentType(const gl::VertexFormat &vertexFormat) const = 0;
const Workarounds &getWorkarounds() const;
protected:
egl::Display *mDisplay;
......@@ -259,16 +256,12 @@ class Renderer
DISALLOW_COPY_AND_ASSIGN(Renderer);
virtual void generateCaps(gl::Caps *outCaps, gl::TextureCapsMap* outTextureCaps, gl::Extensions *outExtensions) const = 0;
virtual Workarounds generateWorkarounds() const = 0;
mutable bool mCapsInitialized;
mutable gl::Caps mCaps;
mutable gl::TextureCapsMap mTextureCaps;
mutable gl::Extensions mExtensions;
mutable bool mWorkaroundsInitialized;
mutable Workarounds mWorkarounds;
int mCurrentClientVersion;
};
......
//
// Copyright (c) 2014 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.
//
// angletypes.h: Workarounds for driver bugs and other issues.
#ifndef LIBGLESV2_RENDERER_WORKAROUNDS_H_
#define LIBGLESV2_RENDERER_WORKAROUNDS_H_
// TODO(jmadill,zmo,geofflang): make a workarounds library that can operate
// independent of ANGLE's renderer. Workarounds should also be accessible
// outside of the Renderer.
namespace rx
{
enum D3DWorkaroundType
{
ANGLE_D3D_WORKAROUND_NONE,
ANGLE_D3D_WORKAROUND_SKIP_OPTIMIZATION,
ANGLE_D3D_WORKAROUND_MAX_OPTIMIZATION
};
struct Workarounds
{
bool mrtPerfWorkaround;
};
}
#endif // LIBGLESV2_RENDERER_WORKAROUNDS_H_
......@@ -10,7 +10,6 @@
#define LIBGLESV2_RENDERER_PROGRAMD3D_H_
#include "libGLESv2/renderer/ProgramImpl.h"
#include "libGLESv2/renderer/Workarounds.h"
#include <string>
#include <vector>
......
......@@ -10,7 +10,6 @@
#define LIBGLESV2_RENDERER_SHADERD3D_H_
#include "libGLESv2/renderer/ShaderImpl.h"
#include "libGLESv2/renderer/Workarounds.h"
#include "libGLESv2/Shader.h"
#include <map>
......
......@@ -3156,9 +3156,4 @@ void Renderer11::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureC
d3d11_gl::GenerateCaps(mDevice, outCaps, outTextureCaps, outExtensions);
}
Workarounds Renderer11::generateWorkarounds() const
{
return d3d11::GenerateWorkarounds();
}
}
......@@ -205,7 +205,6 @@ class Renderer11 : public Renderer
DISALLOW_COPY_AND_ASSIGN(Renderer11);
virtual void generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureCaps, gl::Extensions *outExtensions) const;
virtual Workarounds generateWorkarounds() const;
gl::Error drawLineLoop(GLsizei count, GLenum type, const GLvoid *indices, int minIndex, gl::Buffer *elementArrayBuffer);
gl::Error drawTriangleFan(GLsizei count, GLenum type, const GLvoid *indices, int minIndex, gl::Buffer *elementArrayBuffer, int instances);
......
......@@ -10,7 +10,6 @@
#include "libGLESv2/renderer/d3d/d3d11/renderer11_utils.h"
#include "libGLESv2/renderer/d3d/d3d11/formatutils11.h"
#include "libGLESv2/renderer/d3d/d3d11/RenderTarget11.h"
#include "libGLESv2/renderer/Workarounds.h"
#include "libGLESv2/ProgramBinary.h"
#include "libGLESv2/Framebuffer.h"
......@@ -1072,13 +1071,6 @@ RenderTarget11 *GetAttachmentRenderTarget(gl::FramebufferAttachment *attachment)
return RenderTarget11::makeRenderTarget11(renderTarget);
}
Workarounds GenerateWorkarounds()
{
Workarounds workarounds;
workarounds.mrtPerfWorkaround = true;
return workarounds;
}
}
}
......@@ -23,7 +23,6 @@ class FramebufferAttachment;
namespace rx
{
class RenderTarget11;
struct Workarounds;
namespace gl_d3d11
{
......@@ -179,8 +178,6 @@ inline void SetBufferData(ID3D11DeviceContext *context, ID3D11Buffer *constantBu
RenderTarget11 *GetAttachmentRenderTarget(gl::FramebufferAttachment *attachment);
Workarounds GenerateWorkarounds();
}
}
......
......@@ -3111,9 +3111,4 @@ void Renderer9::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureCa
d3d9_gl::GenerateCaps(mD3d9, mDevice, mDeviceType, mAdapter, outCaps, outTextureCaps, outExtensions);
}
Workarounds Renderer9::generateWorkarounds() const
{
return d3d9::GenerateWorkarounds();
}
}
......@@ -202,7 +202,6 @@ class Renderer9 : public Renderer
DISALLOW_COPY_AND_ASSIGN(Renderer9);
virtual void generateCaps(gl::Caps *outCaps, gl::TextureCapsMap *outTextureCaps, gl::Extensions *outExtensions) const;
virtual Workarounds generateWorkarounds() const;
void release();
......
......@@ -9,7 +9,6 @@
#include "libGLESv2/renderer/d3d/d3d9/renderer9_utils.h"
#include "libGLESv2/renderer/d3d/d3d9/formatutils9.h"
#include "libGLESv2/renderer/Workarounds.h"
#include "libGLESv2/formatutils.h"
#include "libGLESv2/Framebuffer.h"
#include "libGLESv2/renderer/d3d/d3d9/RenderTarget9.h"
......@@ -538,13 +537,6 @@ RenderTarget9 *GetAttachmentRenderTarget(gl::FramebufferAttachment *attachment)
return RenderTarget9::makeRenderTarget9(renderTarget);
}
Workarounds GenerateWorkarounds()
{
Workarounds workarounds;
workarounds.mrtPerfWorkaround = true;
return workarounds;
}
}
}
......@@ -21,7 +21,6 @@ class FramebufferAttachment;
namespace rx
{
class RenderTarget9;
struct Workarounds;
namespace gl_d3d9
{
......@@ -76,7 +75,6 @@ inline bool isDeviceLostError(HRESULT errorCode)
}
RenderTarget9 *GetAttachmentRenderTarget(gl::FramebufferAttachment *attachment);
Workarounds GenerateWorkarounds();
}
......
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