Bug 92758 - Fixed function programs generated multiple times per draw call
Summary: Fixed function programs generated multiple times per draw call
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-31 20:20 UTC by Ilia Mirkin
Modified: 2019-09-18 20:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
trace that demonstrates 2 FS and 2 VS programs generated in a single draw call (2.35 MB, application/octet-stream)
2015-10-31 20:20 UTC, Ilia Mirkin
Details

Description Ilia Mirkin 2015-10-31 20:20:18 UTC
Created attachment 119318 [details]
trace that demonstrates 2 FS and 2 VS programs generated in a single draw call

FF programs are affected by various state. It seems it's possible to do things "just right" to cause them to be regenerated twice in a single draw. The attached trace produces the following for me:

48: message: shader compiler issue 1: type: 1,
48: message: shader compiler issue 1: type: 0,
53: message: shader compiler issue 1: type: 1,
53: message: shader compiler issue 1: type: 0,
172: message: shader compiler issue 1: type: 1,
172: message: shader compiler issue 1: type: 0,
172: message: shader compiler issue 1: type: 1,
172: message: shader compiler issue 1: type: 0,
275: message: shader compiler issue 1: type: 1,
275: message: shader compiler issue 1: type: 0,
275: message: shader compiler issue 1: type: 0,
2172: message: shader compiler issue 1: type: 1
2172: message: shader compiler issue 1: type: 0
2172: message: shader compiler issue 1: type: 0
2239: message: shader compiler issue 1: type: 1
2239: message: shader compiler issue 1: type: 0
2328: message: shader compiler issue 1: type: 1
2328: message: shader compiler issue 1: type: 0
2328: message: shader compiler issue 1: type: 1
2328: message: shader compiler issue 1: type: 0

Type 0/1 are VS and FS (id corresponds to PIPE_SHADER_*). Note that the draw calls at 172 and 2328 both generate 2 programs each, while draw calls 275 and 2172 generate 2 programs for one of the types.

One set is generated via the path

vbo_exec_DrawRangeElementsBaseVertex -> validate_DrawElements_common -> check_valid_to_render -> _mesa_valid_to_render -> _mesa_update_state -> update_program

while the second is generated via

vbo_exec_DrawRangeElementsBaseVertex -> vbo_validated_drawrangeelements -> vbo_bind_arrays -> _mesa_update_state -> update_program.

I guess in between the _NEW_PROGRAM bit manages to set itself.
Comment 1 GitLab Migration User 2019-09-18 20:24:33 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/995.


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.