Skip to content

Commit

Permalink
Removed comment emitters.
Browse files Browse the repository at this point in the history
They really aren't worth anything, on second thought. But I might want to
 parse out that "CTAB" comment from Microsoft's HLSL compiler, some day.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 21, 2008
1 parent a9d201f commit 2705dfe
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions mojoshader.c
Expand Up @@ -133,9 +133,6 @@ typedef struct Context Context;
// one emit function for each opcode in each profile.
typedef void (*emit_function)(Context *ctx);

// one emit function for comments in each profile.
typedef void (*emit_comment)(Context *ctx, const char *str, size_t len);

// one emit function for starting output in each profile.
typedef void (*emit_start)(Context *ctx);

Expand Down Expand Up @@ -169,7 +166,6 @@ typedef struct
const char *name;
emit_start start_emitter;
emit_end end_emitter;
emit_comment comment_emitter;
emit_global global_emitter;
emit_uniform uniform_emitter;
emit_sampler sampler_emitter;
Expand Down Expand Up @@ -1132,12 +1128,6 @@ static void emit_D3D_attribute(Context *ctx, RegisterType regtype, int regnum,
} // emit_D3D_attribute


static void emit_D3D_comment(Context *ctx, const char *str, size_t len)
{
// no-op.
} // emit_D3D_comment


static void emit_D3D_RESERVED(Context *ctx)
{
// do nothing; fails in the state machine.
Expand Down Expand Up @@ -1500,7 +1490,6 @@ static void emit_PASSTHROUGH_finalize(Context *ctx) {}
static void emit_PASSTHROUGH_global(Context *ctx, RegisterType t, int n) {}
static void emit_PASSTHROUGH_uniform(Context *ctx, RegisterType t, int n) {}
static void emit_PASSTHROUGH_sampler(Context *ctx, int s, TextureType ttype) {}
static void emit_PASSTHROUGH_comment(Context *ctx, const char *s, size_t l) {}
static void emit_PASSTHROUGH_attribute(Context *ctx, RegisterType t, int n,
MOJOSHADER_usage u, int i, int w) {}

Expand Down Expand Up @@ -2119,11 +2108,6 @@ static void emit_GLSL_attribute(Context *ctx, RegisterType regtype, int regnum,
} // else
} // emit_GLSL_attribute

static void emit_GLSL_comment(Context *ctx, const char *str, size_t len)
{
// no-op.
} // emit_GLSL_comment

static void emit_GLSL_NOP(Context *ctx)
{
// no-op is a no-op. :)
Expand Down Expand Up @@ -2900,7 +2884,6 @@ static void emit_GLSL_RESERVED(Context *ctx)
MOJOSHADER_PROFILE_##prof, \
emit_##prof##_start, \
emit_##prof##_end, \
emit_##prof##_comment, \
emit_##prof##_global, \
emit_##prof##_uniform, \
emit_##prof##_sampler, \
Expand Down Expand Up @@ -4106,8 +4089,6 @@ static int parse_comment_token(Context *ctx)
else
{
const uint32 commenttoks = ((token >> 16) & 0xFFFF);
const uint32 len = commenttoks * sizeof (uint32);
ctx->profile->comment_emitter(ctx, (const char *)(ctx->tokens+1), len);
return commenttoks + 1; // comment data plus the initial token.
} // else

Expand Down

0 comments on commit 2705dfe

Please sign in to comment.