[svn] Fixed output for software vertex shader versions. trunk
authoricculus
Fri, 14 Mar 2008 07:12:31 -0400
branchtrunk
changeset 19 8bca9cb2252f
parent 18 0dbdb2be8bf8
child 20 bb2e8f285acc
[svn] Fixed output for software vertex shader versions.
d3d2glsl.c
--- a/d3d2glsl.c	Fri Mar 14 07:07:49 2008 -0400
+++ b/d3d2glsl.c	Fri Mar 14 07:12:31 2008 -0400
@@ -415,10 +415,19 @@
 {
     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.",
@@ -1515,7 +1524,7 @@
         } // while
     } // if
 
-    if (ctx->failstr == NULL)
+//    if (ctx->failstr == NULL)
     {
         char *str = build_output(ctx);
         if (str != NULL)