[Mesa-dev] [PATCH] mesa, glsl_to_tgsi: fixes for native integers
Eric Anholt
eric at anholt.net
Mon Aug 29 09:31:51 PDT 2011
On Fri, 26 Aug 2011 21:58:12 -0500, Bryan Cain <bryancain3 at gmail.com> wrote:
> This fixes all of the piglit regressions in softpipe when native integers are
> enabled.
> ---
> src/mesa/main/uniforms.c | 8 +----
> src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 45 ++++++++++++++++++++++++++--
> 2 files changed, 43 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/main/uniforms.c b/src/mesa/main/uniforms.c
> index cda840f..0801476 100644
> --- a/src/mesa/main/uniforms.c
> +++ b/src/mesa/main/uniforms.c
> @@ -776,13 +776,7 @@ set_program_uniform(struct gl_context *ctx, struct gl_program *program,
> /* if the uniform is bool-valued, convert to 1 or 0 */
> if (isUniformBool) {
> for (i = 0; i < elems; i++) {
> - if (basicType == GL_FLOAT)
> - uniformVal[i].b = uniformVal[i].f != 0.0f ? 1 : 0;
> - else
> - uniformVal[i].b = uniformVal[i].u ? 1 : 0;
> -
> - if (!ctx->Const.NativeIntegers)
> - uniformVal[i].f = uniformVal[i].b ? 1.0f : 0.0f;
> + uniformVal[i].f = uniformVal[i].f != 0.0f ? 1.0f : 0.0f;
> }
> }
> }
I think booleans should be integer 1 as uniforms. Otherwise I'll need a
RealNativeIntegers flag to get that behavior.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110829/f5ef5c69/attachment-0001.pgp>
More information about the mesa-dev
mailing list