diff options
author | Brian <[email protected]> | 2007-03-07 16:13:22 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-07 16:13:22 -0700 |
commit | da899d190e6835c46dc09e401098c660886e0c4c (patch) | |
tree | 437601d12dddc1af3761b2c9d72d175bf004bb55 /src | |
parent | 29bc4b8974c163507be06b4991a23368e69b177a (diff) |
add missing gl_Point state, fix IR storage bug
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/shader/slang/slang_builtin.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index 2db7b7983b6..8b5434c9080 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -104,7 +104,33 @@ lookup_statevar(const char *var, GLint index1, GLint index2, const char *field, tokens[0] = STATE_POINT_SIZE; *swizzleOut = SWIZZLE_XXXX; } - /* XXX finish */ + else if (strcmp(field, "sizeMin") == 0) { + tokens[0] = STATE_POINT_SIZE; + *swizzleOut = SWIZZLE_YYYY; + } + else if (strcmp(field, "sizeMax") == 0) { + tokens[0] = STATE_POINT_SIZE; + *swizzleOut = SWIZZLE_ZZZZ; + } + else if (strcmp(field, "fadeThresholdSize") == 0) { + tokens[0] = STATE_POINT_SIZE; + *swizzleOut = SWIZZLE_WWWW; + } + else if (strcmp(field, "distanceConstantAttenuation") == 0) { + tokens[0] = STATE_POINT_ATTENUATION; + *swizzleOut = SWIZZLE_XXXX; + } + else if (strcmp(field, "distanceLinearAttenuation") == 0) { + tokens[0] = STATE_POINT_ATTENUATION; + *swizzleOut = SWIZZLE_YYYY; + } + else if (strcmp(field, "distanceQuadraticAttenuation") == 0) { + tokens[0] = STATE_POINT_ATTENUATION; + *swizzleOut = SWIZZLE_ZZZZ; + } + else { + return -1; + } } else if (strcmp(var, "gl_FrontMaterial") == 0 || strcmp(var, "gl_BackMaterial") == 0) { @@ -343,6 +369,7 @@ GLint _slang_alloc_statevar(slang_ir_node *n, struct gl_program_parameter_list *paramList) { + slang_ir_node *n0 = n; const char *field = NULL, *var; GLint index1 = -1, index2 = -1, pos; GLuint swizzle; @@ -372,8 +399,8 @@ _slang_alloc_statevar(slang_ir_node *n, pos = lookup_statevar(var, index1, index2, field, &swizzle, paramList); assert(pos >= 0); if (pos >= 0) { - n->Store->Index = pos; - n->Store->Swizzle = swizzle; + n0->Store->Index = pos; + n0->Store->Swizzle = swizzle; } return pos; } |