Bug 44477 - [glsl]Fail to compile one advanced build-in-fuction: MIX
Summary: [glsl]Fail to compile one advanced build-in-fuction: MIX
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: glsl-compiler (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Kenneth Graunke
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-04 20:33 UTC by Guang Yang
Modified: 2012-01-10 22:25 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
a glslparsertest case (401 bytes, text/plain)
2012-01-04 20:33 UTC, Guang Yang
Details

Description Guang Yang 2012-01-04 20:33:09 UTC
Created attachment 55146 [details]
a glslparsertest case

System Environment:
--------------------------
Arch:           x86_64
Platform:       SandyBridge
Libdrm:         (master)2.4.29-17-ga9dd34a7ee9d03d357e15f045ab85a12f6f6e4b8
Mesa:           (master)4535874c1a6da74d9130e494d514284302e4d08e
Xserver:        (master)xorg-server-1.11.99.901
Xf86_video_intel:              
                (master)2.17.0-286-g04a6260016fb5ebefc1056ed6acf5001ec535d5c
Cairo:          (master)6816f70da54e730e88b98c8592aa6fc84e082928

Kernel: (drm-intel-next)097354eb14fa94d31a09c64d640643f58e4a5a9a
Bug detailed description:
-------------------------
  when we use the build-in-function mix(float, float, bool),it failes to compile a vertex shader,and the error is :
  error: no matching function for call to `mix(float, float, bool)'
  error: candidates are: float mix(float, float, float)

  This issue occurs in version 1.3,but in the GLSLangSpec.1.30 ,we find a new Syntax as:
  genType mix (genType x,genType y,bvec a),
and the Description is:
   Selects which vector each returned component comes from. For a component of a that is false, the corresponding component of x is returned. For a component of a that is true, the corresponding component of y is returned. Components of x and y that are not selected are allowed to be invalid floating point values and will have no effect on the results. Thus, this provides different functionality than genType mix(genType x, genType y, genType(a)) where a is a Boolean vector.
  Below cases are failed cases with MIX:
glsl-bif-com(advanced.mix.float)
glsl-bif-com(advanced.mix.vec2)
glsl-bif-com(advanced.mix.vec3)
glsl-bif-com(advanced.mix.vec4)
Comment 1 Kenneth Graunke 2012-01-05 13:34:10 UTC
Patch on mailing list:
[PATCH] glsl/builtins: Add missing mix(genType, genType, bvec) built-ins.

I'll commit it tomorrow if there are no objections.  Thanks for the report!
Comment 2 Kenneth Graunke 2012-01-10 16:22:54 UTC
commit 7ccf04ebcf6284a68ab6c571dabc5f3e0c6b740b
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Thu Jan 5 13:54:41 2012 -0800

    i965/vs: Fix invalid array access in copy propagation.
    
    Accessing virtual_grf_reg_map[inst->dst.reg] is invalid if
    inst->dst.file != GRF.  Since is_direct_copy already implies a GRF
    destination, we can just move the check earlier.
    
    Fixes a regression in commit 07ee9f374f2946f852896e9264c7fa83eafc3f16.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44302
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Eric Anholt <eric@anholt.net>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.