Bug 94485

Summary: dEQP-GLES3.functional.negative_api.shader.compile_shader and delete_shader broken by Meta
Product: Mesa Reporter: Kenneth Graunke <kenneth>
Component: Mesa coreAssignee: Kenneth Graunke <kenneth>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: idr
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 94448    

Description Kenneth Graunke 2016-03-11 00:35:00 UTC
Running the following case list:
dEQP-GLES3.functional.negative_api.buffer.clear
dEQP-GLES3.functional.negative_api.shader.compile_shader
dEQP-GLES3.functional.negative_api.shader.delete_shader

causes compile_shader and delete_shader to fail.  The problem is that buffer.clear produces Meta shaders, and compile_shader/delete_shader see those.  We correctly identify them as internal shaders, but always return INVALID_OPERATION, while the test expects INVALID_OPERATION or INVALID_ENUM.
Comment 1 Kenneth Graunke 2016-03-11 01:21:42 UTC
Actually, the problem is that compile_shader's first subtest assumes that no shaders exist, i.e.

glCompileShader(9)

should return GL_INVALID_VALUE because 9 simply does not exist.

But because of Meta, it does exist - and the real bug is that applications can observe and even alter these shaders.  In the dEQP test sequence, it happens to be a gl_shader_program, so we return GL_INVALID_OPERATION.  But it could be a shader, at which point we would return it.
Comment 2 Kenneth Graunke 2016-03-16 01:34:23 UTC
I have patches to fix this.
Comment 3 Kenneth Graunke 2016-03-17 07:09:30 UTC
commit 9c1e01c4a883ac4a738f6f8c17c0236621101e28
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Tue Mar 15 10:51:55 2016 -0700

    meta: Don't use integer handles for shaders or programs.

and the previous patches.

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.