i915 needs an instruction scheduler
Submitted by gnn
Assigned to Ian Romanick
Description
Created attachment 113313 Full glxinfo output
Following fragment shader code fails to software emulation:
uniform sampler2D tex; varying vec2 tx1,tx2,tx3,tx4,tx5; void main () { vec4 a = texture2D(tex,tx1); vec4 b = texture2D(tex,tx2); vec4 c = texture2D(tex,tx3); vec4 d = texture2D(tex,tx4); vec4 e = texture2D(tex,tx5); vec4 f = texture2D(tex,tx5); vec4 res = ( a * 0.3 + b * 0.1 + c * 0.2 + d * 0.08 + e* 0.2 + f * 0.099) / 6.456; gl_FragColor = res; }
With output:
Fragment Program/Shader 9
0: TEX TEMP[0], INPUT[26].xyyy, texture[0], 2D; 1: TEX TEMP[1], INPUT[25].zwww, texture[0], 2D; 2: TEX TEMP[2], INPUT[25].xyyy, texture[0], 2D; 3: TEX TEMP[3], INPUT[24].zwww, texture[0], 2D; 4: TEX TEMP[4], INPUT[24].xyyy, texture[0], 2D; 5: MUL TEMP[5], TEMP[4], CONST[2].yyyy; 6: MAD TEMP[4], TEMP[3], CONST[2].xxxx, TEMP[5]; 7: MAD TEMP[3], TEMP[2], CONST[1].wwww, TEMP[4]; 8: MAD TEMP[2], TEMP[1], CONST[1].zzzz, TEMP[3]; 9: MAD TEMP[1], TEMP[0], CONST[1].yyyy, TEMP[2]; 10: MAD TEMP[2], TEMP[0], CONST[1].xxxx, TEMP[1]; 11: MUL OUTPUT[2], TEMP[2], CONST[2].zzzz; 12: END i915_program_error: Exceeded max nr indirect texture lookups (6 out of 4) ENTER FALLBACK 10000: Program
As I understand, varying packing optimization leads to swizzle operation, which generates dependent texture lookup for every single texture access. I consider this as a bug, since it makes all shaders with more then 3 texture accesses unusable on i915 chips.
Bug is reproduced on Atom 230 board with Intel 945g video + Linux Ubuntu 14.04 with stock Mesa 10.1
A bit of GL info (more in attachment): OpenGL vendor string: Intel Open Source Technology Center OpenGL renderer string: Mesa DRI Intel(R) 945G OpenGL version string: 2.1 Mesa 10.1.3 OpenGL shading language version string: 1.20
Attachment 113313, "Full glxinfo output":
Intel_945g_Ubuntu_14.04.log
Version: git