Skip to content

Commit

Permalink
Merge pull request #9 from gabrielcuvillier/master
Browse files Browse the repository at this point in the history
Better disabling of REGAL_JSON and REGAL_GLSL_OPTIMIZER
  • Loading branch information
gabrielcuvillier authored Dec 2, 2019
2 parents 9ba65ea + 212cd8a commit cee02e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/regal/RegalJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

#include "RegalUtil.h"

#if REGAL_NO_JSON
#else

REGAL_GLOBAL_BEGIN

#include "RegalLog.h"
Expand Down Expand Up @@ -663,3 +666,4 @@ Parser::parseString(const char *json)

REGAL_NAMESPACE_END

#endif
10 changes: 4 additions & 6 deletions src/regal/RegalShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,22 @@ REGAL_GLOBAL_END

REGAL_NAMESPACE_BEGIN


#if REGAL_GLSL_OPTIMIZER
extern "C" struct gl_shader *
_mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type);

#endif

namespace Shader {

// external interface for using the GLSL optimizer
bool OptimizeGLSL (bool is_es, GLenum type, string input, string& output, Emu::Iff::CompareFunc comp )

#if ! REGAL_GLSL_OPTIMIZER

#if !REGAL_GLSL_OPTIMIZER
{
// returning false here means output will be ignored and the original shader will be used
return false;
}

#else

{
bool res = true;

Expand Down
6 changes: 3 additions & 3 deletions src/regal/RegalShader.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ REGAL_GLOBAL_BEGIN
#include "RegalEmu.h"
#include "RegalIff.h"

#include "program.h"

using std::string;

REGAL_GLOBAL_END
Expand All @@ -52,6 +50,8 @@ REGAL_NAMESPACE_BEGIN

namespace Shader {

bool OptimizeGLSL (bool is_es, GLenum type, string input, string& output, Emu::Iff::CompareFunc comp );
#if REGAL_GLSL_OPTIMIZER
struct regal_glsl_shader;
struct regal_glsl_ctx;

Expand All @@ -60,7 +60,6 @@ namespace Shader {
kRegalGlslShaderFragment,
};

bool OptimizeGLSL (bool is_es, GLenum type, string input, string& output, Emu::Iff::CompareFunc comp );
regal_glsl_ctx* regal_glsl_initialize (gl_api api);
void regal_glsl_cleanup (regal_glsl_ctx* ctx);

Expand All @@ -75,6 +74,7 @@ namespace Shader {
const char* regal_glsl_get_raw_output (regal_glsl_shader* shader);
const char* regal_glsl_get_log (regal_glsl_shader* shader);
void regal_glsl_shader_delete (regal_glsl_shader* shader);
#endif
}

REGAL_NAMESPACE_END
Expand Down
2 changes: 1 addition & 1 deletion src/regal/RegalUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ enum Library
LIBRARY_EGL
};

#ifndef __native_client__
#if !defined(__native_client__) && !defined(__EMSCRIPTEN__)
static
const char *libraryLocation(const Library &library)
{
Expand Down

0 comments on commit cee02e8

Please sign in to comment.