Skip to content

Commit

Permalink
Moved some booleans to true bitfields.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Jun 18, 2008
1 parent d1a6e55 commit 9ff8ace
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 24 deletions.
20 changes: 6 additions & 14 deletions mojoshader.c
Expand Up @@ -320,14 +320,6 @@ typedef struct
} SourceArgInfo;


// !!! FIXME: get rid of this. use a bitfield instead.
typedef enum
{
// Specific to GLSL profile...
CTX_FLAGS_GLSL_LIT_OPCODE = (1 << 0),
CTX_FLAGS_MASK = 0xFFFFFFFF
} ContextFlags;


#define SCRATCH_BUFFER_SIZE 128
#define SCRATCH_BUFFERS 32
Expand Down Expand Up @@ -375,11 +367,7 @@ struct Context
int instruction_count;
uint32 instruction_controls;
uint32 previous_opcode;
ContextFlags flags;
int predicated;
int max_constreg;
int uniform_array;
int support_nv2;
int loops;
int reps;
int cmps;
Expand All @@ -397,6 +385,10 @@ struct Context
RegisterList attributes;
int sampler_count;
RegisterList samplers;
int predicated:1;
int uniform_array:1;
int support_nv2:1;
int glsl_generated_lit_opcode:1;
};


Expand Down Expand Up @@ -2648,10 +2640,10 @@ static void emit_GLSL_LIT_helper(Context *ctx)
{
const char *maxp = "127.9961f"; // value from the dx9 reference.

if (ctx->flags & CTX_FLAGS_GLSL_LIT_OPCODE)
if (ctx->glsl_generated_lit_opcode)
return;

ctx->flags = (ContextFlags) (ctx->flags | CTX_FLAGS_GLSL_LIT_OPCODE);
ctx->glsl_generated_lit_opcode = 1;

push_output(ctx, &ctx->helpers);
output_line(ctx, "const vec4 LIT(const vec4 src)");
Expand Down
20 changes: 10 additions & 10 deletions mojoshader_opengl.c
Expand Up @@ -140,16 +140,16 @@ struct MOJOSHADER_glContext
char profile[16];

// Extensions...
int have_base_opengl;
int have_GL_ARB_vertex_program;
int have_GL_ARB_fragment_program;
int have_GL_NV_vertex_program2_option;
int have_GL_NV_fragment_program2;
int have_GL_ARB_shader_objects;
int have_GL_ARB_vertex_shader;
int have_GL_ARB_fragment_shader;
int have_GL_ARB_shading_language_100;
int have_GL_NV_half_float;
int have_base_opengl:1;
int have_GL_ARB_vertex_program:1;
int have_GL_ARB_fragment_program:1;
int have_GL_NV_vertex_program2_option:1;
int have_GL_NV_fragment_program2:1;
int have_GL_ARB_shader_objects:1;
int have_GL_ARB_vertex_shader:1;
int have_GL_ARB_fragment_shader:1;
int have_GL_ARB_shading_language_100:1;
int have_GL_NV_half_float:1;

// Entry points...
PFNGLGETSTRINGPROC glGetString;
Expand Down

0 comments on commit 9ff8ace

Please sign in to comment.