Drivers supporting native integers set UniformBooleanTrue to the integer value
that should be used for true when uploading uniform booleans. This is ~0 for
Gallium and 1 for i965.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/* If we're using the new shader backend, we require integer uniforms
* stored as actual integers.
*/
- if (brw->new_vs_backend)
+ if (brw->new_vs_backend) {
ctx->Const.NativeIntegers = true;
+ ctx->Const.UniformBooleanTrue = 1;
+ }
return GL_TRUE;
}
*/
GLboolean NativeIntegers;
+ /**
+ * If the driver supports real 32-bit integers, what integer value should be
+ * used for boolean true in uniform uploads? (Usually 1 or ~0.)
+ */
+ GLuint UniformBooleanTrue;
+
/** Which texture units support GL_ATI_envmap_bumpmap as targets */
GLbitfield SupportedBumpUnits;
else
uniformVal[i].b = uniformVal[i].u ? 1 : 0;
- if (!ctx->Const.NativeIntegers)
+ if (ctx->Const.NativeIntegers)
+ uniformVal[i].u =
+ uniformVal[i].b ? ctx->Const.UniformBooleanTrue : 0;
+ else
uniformVal[i].f = uniformVal[i].b ? 1.0f : 0.0f;
}
}
c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET);
c->GLSLVersion = 120;
+ c->UniformBooleanTrue = ~0;
}
}