Re: cmp instruction in GLSL - problems

2006-07-11 Thread Ivan Gyurdiev
-shader_addline(arg->buffer, "%s.w = (%s.w > 0.0) ? %s.w : %s.w;\n", dst_reg, src0_reg, src1_reg, src2_reg); +shader_glsl_add_dst(arg->dst, dst_reg, dst_mask, tmpLine); +shader_addline(arg->buffer, "%smix(vec4(%s), vec4(%s), vec4(lessThan(vec4(%s), vec4(0.0)%s;\n", +tmp

cmp instruction in GLSL - problems

2006-07-11 Thread Ivan Gyurdiev
This patch is causing trouble for me. The current GLSL cmp implementation is wrong - here's 4 reasons why, only the first of which is mentioned in the source: - it ignores destination write mask - it ignores source swizzle - it ignores other source modifiers. - it works incorrectly src0 = 0 So

Re: cmp instruction in GLSL - problems

2006-07-11 Thread Ivan Gyurdiev
...but.. I shouldn't have to swap the two arguments in cmp, they are correct as is, imho, and the previous implementation worked by accident. In fact, swapping them will cause artifacts to appear in the Hair demo.