Commit acd20b1f by Geoff Lang Committed by Commit Bot

Refactor BlitGL to potentially hold multiple blit shader types.

BUG=angleproject:1932 Change-Id: I4d19892852540797c765916131498c96511b4f55 Reviewed-on: https://chromium-review.googlesource.com/600509Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent d2d0b30e
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include <map>
namespace gl namespace gl
{ {
class Framebuffer; class Framebuffer;
...@@ -95,13 +97,24 @@ class BlitGL : angle::NonCopyable ...@@ -95,13 +97,24 @@ class BlitGL : angle::NonCopyable
const WorkaroundsGL &mWorkarounds; const WorkaroundsGL &mWorkarounds;
StateManagerGL *mStateManager; StateManagerGL *mStateManager;
GLuint mBlitProgram; struct BlitProgram
GLint mTexCoordAttributeLocation; {
GLint mSourceTextureLocation; GLuint program = 0;
GLint mScaleLocation; GLint sourceTextureLocation = -1;
GLint mOffsetLocation; GLint scaleLocation = -1;
GLint mMultiplyAlphaLocation; GLint offsetLocation = -1;
GLint mUnMultiplyAlphaLocation; GLint multiplyAlphaLocation = -1;
GLint unMultiplyAlphaLocation = -1;
};
enum class BlitProgramType
{
FLOAT_TO_FLOAT,
};
gl::Error getBlitProgram(BlitProgramType type, BlitProgram **program);
std::map<BlitProgramType, BlitProgram> mBlitPrograms;
GLuint mScratchTextures[2]; GLuint mScratchTextures[2];
GLuint mScratchFBO; GLuint mScratchFBO;
......
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