Native ALU instruction count is reported wrongly
Submitted by Ruslan Kabatsayev
Assigned to Ian Romanick
Created attachment 124941 Fragment program exhibiting the problem
Testing goes on this device: VGA compatible controller: Intel Corporation Atom Processor D4xx/D5xx/N4xx/N5xx Integrated Graphics Controller (rev 02)
When I query GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB for the attached fragment program, I get 57. Maximum value, GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB, is given as 64. A query of GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB gives me GL_FALSE. This is fine, but if I set environment variable INTEL_DEBUG=fs, then on the query whether the program is under native limits it Mesa prints to console this (returning false):
i915_program_error: Exceeded max ALU instructions (65 out of 64)
Apparently, it has 65 native instructions, not 57 as reported via glGetProgramivARB(). Instead, 57 is equal to number of ALU instructions in the source, as reported by GL_PROGRAM_ALU_INSTRUCTIONS_ARB.
The expected result is that 65 is returned to the program as native ALU instructions count.
Attachment 124941, "Fragment program exhibiting the problem":