Store optimization level in program binaries and do not load those compiled with a different level.

Review URL: https://codereview.appspot.com/9427043 Conflicts: src/libGLESv2/renderer/Renderer9.cpp git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2332 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 482eb95c
#define MAJOR_VERSION 1
#define MINOR_VERSION 1
#define BUILD_VERSION 0
#define BUILD_REVISION 2204
#define BUILD_REVISION 2212
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -1440,6 +1440,14 @@ bool ProgramBinary::load(InfoLog &infoLog, const void *binary, GLsizei length)
return false;
}
int compileFlags = 0;
stream.read(&compileFlags);
if (compileFlags != ANGLE_COMPILE_OPTIMIZATION_LEVEL)
{
infoLog.append("Mismatched compilation flags.");
return false;
}
for (int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
{
stream.read(&mLinkedAttribute[i].type);
......@@ -1639,6 +1647,7 @@ bool ProgramBinary::save(void* binary, GLsizei bufSize, GLsizei *length)
stream.write(GL_PROGRAM_BINARY_ANGLE);
stream.write(VERSION_DWORD);
stream.write(ANGLE_COMPILE_OPTIMIZATION_LEVEL);
for (unsigned int i = 0; i < MAX_VERTEX_ATTRIBS; ++i)
{
......
......@@ -20,10 +20,6 @@
#define ANGLE_ENABLE_D3D11 0
#endif
#if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL)
#define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL3
#endif
namespace rx
{
......
......@@ -13,6 +13,10 @@
#include "libGLESv2/Uniform.h"
#include "libGLESv2/angletypes.h"
#if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL)
#define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL3
#endif
const int versionWindowsVista = MAKEWORD(0x00, 0x06);
const int versionWindows7 = MAKEWORD(0x01, 0x06);
......
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