Commit c6a13041 authored by Matt Turner's avatar Matt Turner

Add a new runner, written in C.

Whereas run.py runs piglit's shader_runner binary to compile each shader
individually and parses the output of INTEL_DEBUG=fs,vs,gs to find the
number of instructions and loops, this runner compiles all of the
shaders from a single process and uses output from GL_KHR_debug to get
the information we want.

It uses EGL and GBM (and render nodes) to create a GL display and uses
libepoxy for GL function pointer management.

It creates one thread per-CPU using OpenMP, each of which compiles
shaders in parallel. It creates two OpenGL contexts, one core context
and one compatibility context and switches between them as needed.

run.py is able to compile all of the GLSL shaders in shader-db
(including the closed portion) in about 300 seconds on my quad-core
Haswell. This program can do the same in 90 seconds.

Profiling shows that it's largely limited by malloc performance, and
preloading jemalloc (LD_PRELOAD=/usr/lib64/libjemalloc.so.1) reduces the
execution time to about 80 seconds.
parent a38c5fc5
# Copyright © 2014 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
CFLAGS ?= -g -O2 -march=native -pipe
CFLAGS += -std=gnu99 -fopenmp
LDFLAGS = -lepoxy -lgbm
run:
clean:
rm -f run
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment