Skip to content

Commit

Permalink
[svn] Fixed output for software vertex shader versions.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Mar 14, 2008
1 parent 4197ea7 commit 76d3970
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions d3d2glsl.c
Expand Up @@ -415,10 +415,19 @@ static void emit_D3D_start(Context *ctx)
{
const uint major = (uint) ctx->major_ver;
const uint minor = (uint) ctx->minor_ver;

if (ctx->shader_type == SHADER_TYPE_PIXEL)
output_line(ctx, "ps_%u_%u", major, minor);
else if (ctx->shader_type == SHADER_TYPE_VERTEX)
output_line(ctx, "vs_%u_%u", major, minor);
{
char minorstr[16];
if (minor == 0xFF)
strcpy(minorstr, "sw");
else
snprintf(minorstr, sizeof (minorstr), "%u", (uint) minor);

output_line(ctx, "vs_%u_%s", major, minorstr);
} // else if
else
{
failf(ctx, "Shader type %u unsupported in this profile.",
Expand Down Expand Up @@ -1515,7 +1524,7 @@ int D3D2GLSL_parse(const char *profile, const unsigned char *tokenbuf,
} // while
} // if

if (ctx->failstr == NULL)
// if (ctx->failstr == NULL)
{
char *str = build_output(ctx);
if (str != NULL)
Expand Down

0 comments on commit 76d3970

Please sign in to comment.