Fix issue #2: use zero extend to convert bool->int, not sign extend.

This way, we match C/C++ in that casting a bool to an int gives either the value
zero or the value one.  There is a new stdlib function int sign_extend(bool)
that does sign extension for cases where that's desired.
This commit is contained in:
Matt Pharr
2011-07-12 13:30:05 +01:00
parent 6e8af5038b
commit a535aa586b
8 changed files with 94 additions and 28 deletions

View File

@@ -20,7 +20,7 @@ export void f_fu(uniform float RET[], uniform float aFOO[], uniform float b) {
float v = float4(1,1,0,0);
bool b = (v == 1.);
ret = __movmsk(((int)b));
ret = __movmsk((sign_extend(b)));
RET[programIndex] = ret;
}