Bug 94444 - Scalar FS validation failed on glDrawElements with GL_NONE draw buffer
Summary: Scalar FS validation failed on glDrawElements with GL_NONE draw buffer
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: 11.2
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-08 14:34 UTC by org.freedesktop
Modified: 2016-11-02 18:14 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Makefile (121 bytes, text/plain)
2016-03-08 14:34 UTC, org.freedesktop
Details
Main bug source (2.61 KB, text/plain)
2016-03-08 14:35 UTC, org.freedesktop
Details
Bug API trace (57.36 KB, application/octet-stream)
2016-03-08 14:36 UTC, org.freedesktop
Details
Header for example (89 bytes, text/plain)
2016-03-08 14:37 UTC, org.freedesktop
Details
Small GLFW frontend for example (1.10 KB, text/plain)
2016-03-08 14:37 UTC, org.freedesktop
Details

Description org.freedesktop 2016-03-08 14:34:27 UTC
Created attachment 122158 [details]
Makefile

Hello.

I'm using the following setup:

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) Sandybridge Mobile  (0x116)
    Version: 11.1.2
    Accelerated: yes
    Video memory: 1536MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.1.2
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

Linux copperhead 4.4.3-1-ARCH #1 SMP PREEMPT Fri Feb 26 15:09:29 CET 2016 x86_64 GNU/Linux

The following small program will trigger an assertion failure when calling glDrawArrays().

The problem seems to be triggered by declaring a vec2 fragment shader output, and writing to it, but without having an associated color attachment on the framebuffer and with all framebuffer draw buffers set to GL_NONE.

I've included sources as attachments, but you may prefer the git repository here:

https://github.com/io7m/mesa-intel-bug-20160308

Just "make && ./bug". I've also included an apitrace.
Comment 1 org.freedesktop 2016-03-08 14:35:01 UTC
Created attachment 122159 [details]
Main bug source
Comment 2 org.freedesktop 2016-03-08 14:36:01 UTC
Created attachment 122160 [details]
Bug API trace
Comment 3 org.freedesktop 2016-03-08 14:37:04 UTC
Created attachment 122161 [details]
Header for example
Comment 4 org.freedesktop 2016-03-08 14:37:47 UTC
Created attachment 122162 [details]
Small GLFW frontend for example
Comment 5 org.freedesktop 2016-03-08 14:38:38 UTC
The actual output of the program is:

GL_VERSION: 3.3 (Core Profile) Mesa 11.1.2
ASSERT: Scalar FS validation failed!
load_payload(8) vgrf2:UD, (null):UD(null):UD(null):UD, vgrf0+3.0:F 
brw_fs_validate.cpp:53: inst->src[i].reg_offset + inst->regs_read(i) <= (int)alloc.sizes[inst->src[i].nr]
Aborted (core dumped)
Comment 6 Iago Toral 2016-11-02 10:47:01 UTC
This seems to have been fixed for a while. I tracked the fix down to this commit:

commit 7f53fead5cf9a85c74a94d359dd5fccfbb87856c
Author: Timothy Arceri <timothy.arceri@collabora.com>
Date:   Mon May 23 16:48:05 2016 +1000

    i965: enable component packing for vs and fs
    
    Rather than trying to work out the total number of components
    used at a location we simply treat all outputs as vec4s. This
    removes the need for complex code looping over varyings to match
    packed locations and the need for storing the total number of
    components used at each location.
    
    Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Comment 7 org.freedesktop 2016-11-02 11:03:59 UTC
I'm now on:

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel Open Source Technology Center (0x8086)
    Device: Mesa DRI Intel(R) Sandybridge Mobile  (0x116)
    Version: 12.0.3
    Accelerated: yes
    Video memory: 1536MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile 
OpenGL core profile version string: 3.3 (Core Profile) Mesa 12.0.3
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

Linux copperhead 4.8.4-1-ARCH #1 SMP PREEMPT Sat Oct 22 18:26:57 CEST 2016 x86_64 GNU/Linux

... and I can still reproduce this problem:

$ ./bug 
GL_VERSION: 3.3 (Core Profile) Mesa 12.0.3
ASSERT: Scalar FS validation failed!
load_payload(8) vgrf3:UD, (null):UD(null):UD(null):UD, vgrf0+3.0:F 
brw_fs_validate.cpp:53: inst->src[i].reg_offset + inst->regs_read(i) <= (int)alloc.sizes[inst->src[i].nr]
Aborted (core dumped)

Has that commit actually made it into a release yet?
Comment 8 Matt Turner 2016-11-02 17:56:47 UTC
(In reply to org.freedesktop from comment #7)
> Has that commit actually made it into a release yet?

It's in mesa-13.0.0 which was just released yesterday. :)
Comment 9 org.freedesktop 2016-11-02 18:14:44 UTC
Ah, thanks. I was going to say that I'd wait for my distro to catch up, but it seems like they just pushed new 13.0.0 packages out today.


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.