Skip to contentSkip to conversation

Mesa shader compiling/optimizing process is too slow

DISCUSSION Tiziano Bacocco 3 participants 3 messages Jul 9, 2012 – Jul 10, 2012

lore
Share & tools
lore
#0 lore raw

I've done benchmarks and comparison between proprietary drivers and Mesa, Mesa seems to be up to 200x slower compiling the same shader, since i understand optimizing such part of code may take months or even more, i have thought to solve it this way:

Upon calling glLinkProgram , an unoptimized version of the shader ( compiles much much faster ) is uploaded to the GPU
Then a separate thread is launched that will optimize the shader and as soon it is done, on the next call to glUseProgram it will upload optimized version in place of unoptimized one.

This will solve many performance issues and temporary freezes with games that load/unload content while running, while not reducing performance once the background optimization is done

#1 lore raw
Quoted 11 lines · Tiziano Bacocco

I've done benchmarks and comparison between proprietary drivers and Mesa, Mesa seems to be up to 200x slower compiling the same shader, since i understand optimizing such part of code may take months or even more, i have thought to solve it this way:

Upon calling glLinkProgram , an unoptimized version of the shader ( compiles much much faster ) is uploaded to the GPU
Then a separate thread is launched that will optimize the shader and as soon it is done, on the next call to glUseProgram it will upload optimized version in place of unoptimized one.

Quoted 3 lines

This will solve many performance issues and temporary freezes with games that load/unload content while running, while not reducing performance once the background optimization is done

Yeah, we've thought of this, and it would take some work. Sounds like a fun project for someone.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Presumably there needs to be a api-level mechanism to wait for the background optimization to finish, so that piglit etc can validate the behavior of the optimized shader?

-- Chris

Quoted 25 lines · Eric Anholt
Quoted 11 lines · Tiziano Bacocco

I've done benchmarks and comparison between proprietary drivers and Mesa, Mesa seems to be up to 200x slower compiling the same shader, since i understand optimizing such part of code may take months or even more, i have thought to solve it this way:

Upon calling glLinkProgram , an unoptimized version of the shader ( compiles much much faster ) is uploaded to the GPU
Then a separate thread is launched that will optimize the shader and as soon it is done, on the next call to glUseProgram it will upload optimized version in place of unoptimized one.

Quoted 3 lines

This will solve many performance issues and temporary freezes with games that load/unload content while running, while not reducing performance once the background optimization is done

Yeah, we've thought of this, and it would take some work. Sounds like a fun project for someone.

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel