Bug 57436 - [GLSL1.40 IVB/HSW]Piglit spec/glsl-1.40/compiler_built-in-functions/inverse-mat2.frag fails
Summary: [GLSL1.40 IVB/HSW]Piglit spec/glsl-1.40/compiler_built-in-functions/inverse-m...
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-23 02:08 UTC by lu hua
Modified: 2013-04-01 02:15 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description lu hua 2012-11-23 02:08:46 UTC
System Environment:
--------------------------
Arch:             x86_64
Platform:         Ivybridge
Libdrm:	(master)libdrm-2.4.40-2-g171666e4b8127c17c68ea0d44cf4e81ec342f2d0
Mesa:		(master)f8840057710041e2d43fddfe4ef9f392c475e129
Xserver:(master)xorg-server-1.13.0-143-g6a6c3afe71ac82a93d9fd0034dd5bbdcf0eae1ea
Xf86_video_intel:(master)2.20.13-33-gd3a49f36395d737698616fe8ba9da7b74cd2d89a
Cairo:	(master)62b795fe52c73ad58101c101aa77449f4b61a576
Libva:	(staging)38c94cd922473095814ed9a9f99ad98fcc9c285d
Libva_intel_driver:(staging)c0ef9d99df37ae45589fecb898727be495e50304
Kernel:	(drm-intel-nightly) ea33b66e9cc2332decab09870054fa99f2a16f6f

Bug detailed description:
-------------------------
It fails on ivybridge and haswell. 

Following cases also fail:
spec_glsl-1.40_compiler_built-in-functions_inverse-mat2.vert
spec_glsl-1.40_compiler_built-in-functions_inverse-mat3.frag
spec_glsl-1.40_compiler_built-in-functions_inverse-mat3.vert
spec_glsl-1.40_compiler_built-in-functions_inverse-mat4.frag
spec_glsl-1.40_compiler_built-in-functions_inverse-mat4.vert

output:
Failed to compile fragment shader tests/../generated_tests/spec/glsl-1.40/compiler/built-in-functions/inverse-mat2.frag: 0:14(224): error: array size must be > 0
0:15(205): error: array size must be > 0
0:16(36): error: length called on unsized array.
0:16(54): error: length called on unsized array.

Shader source:
/* [config]
 * expect_result: pass
 * glsl_version: 1.40
 * [end config]
 *
 * Check that the following test vectors are constant folded correctly:
 * inverse(mat2(1.6, 1.53, 0.75999999, -1.0)) => mat2(0.36195165, 0.55378598, 0.27508324, -0.57912266)
 * inverse(mat2(-0.13, -1.4, -0.87, 1.4)) => mat2(-1.0, -1.0, -0.62142861, 0.092857137)
 */
#version 140

void main()
{
  float[pow(distance(inverse(mat2(1.6, 1.53, 0.75999999, -1.0))[0], vec2(0.36195165, 0.55378598)), 2) + pow(distance(inverse(mat2(1.6, 1.53, 0.75999999, -1.0))[1], vec2(0.27508324, -0.57912266)), 2) <= 8.4874177e-11 ? 1 : -1] array0;
  float[pow(distance(inverse(mat2(-0.13, -1.4, -0.87, 1.4))[0], vec2(-1.0, -1.0)), 2) + pow(distance(inverse(mat2(-0.13, -1.4, -0.87, 1.4))[1], vec2(-0.62142861, 0.092857137)), 2) <= 2.3947955e-10 ? 1 : -1] array1;
  gl_FragColor = vec4(array0.length() + array1.length());
}

PIGLIT: {'result': 'fail' }

Reproduce steps:
----------------------------
1. xinit
2. ./bin/glslparsertest tests/../generated_tests/spec/glsl-1.40/compiler/built-\
in-functions/inverse-mat2.frag pass 1.40
Comment 1 lu hua 2013-04-01 02:15:01 UTC
Fixed by commit dbf94d105a48b7aafb2c8cf64d8b4392d87efea1.
commit dbf94d105a48b7aafb2c8cf64d8b4392d87efea1
Author: Ian Romanick 
Date: Fri Mar 15 18:05:55 2013 -0700

glsl: Replace constant-index vector array accesses with swizzles

Search and replace:

][0] -> ].x
][1] -> ].y
][2] -> ].z
][3] -> ].w
Comment 2 lu hua 2013-04-01 02:15:24 UTC
Verified.Fixed.


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.