glsl: Allow texture2DProjLod and textureCubeLod in GL ES

According to GLES (i.e. 1.0 and above) spec textureCubeLod and
texture2DProjLod are built in functions. We seem to disable support
for these functions with GLES. This patch enables the support.

Signed-off-by: Kalyan Kondapally <kalyan.kondapally@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84355
ilo: fix a missing 'else'

An 'else' is missing in the disassembler.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
egl: setup screen iterator before using it

commit 4ed23fd broke creation of pbuffer surfaces, patch fixes
the failure, noticed when running chrome with '--use-gl=egl'.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
vc4: Stop trying to reuse temporaries that store uniform values.

Almost always, the MOV will get copy propagated out.  Even if it doesn't,
it's probably better to just reload the uniform at next use (to reduce
register pressure) rather than try to save instruction count.

I was looking at this because in the presence of texturing (which calls
add_uniform() directly to get the uniform load forced into the
instruction) the c->uniform_contents indices don't match 1:1 with the
temporary qregs.
vc4: Rename the slice's size0.

In the other related fields, "0" refers to the size of the first miplevel,
while this is a field in a slice.  The other implicit slices we have
(cubemap layers) don't vary in size compared to the first one.
vc4: Add support for texture cube maps.

It's not passing some of the piglit tests, because it looks like at small
miplevels some contents from surrounding faces are getting filtered in at
the corners.  It does get 7 new tests passing.
vc4: Turn a SEL_X_Y(x, 0) into SEL_X_0(x).

This may reduce register pressure and uniform counts.  Drops a bunch of 0
uniform loads on vs-temp-array-mat4-index-col-row-wr.shader_test, which is
failing to register allocate.
vc4: Dump constant uniform values in VC4_DEBUG=qir.

Definitely helps when trying to understand and optimize a program.
vc4: Optimize out silly SUBs of 0.

Drops instructions on vs-temp-array-mat4-index-col-row-wr.shader_test,
which I was looking at because it's failing to register allocate.
vc4: Add the necessary stubs for occlusion queries.

We have to expose them for GL 2.0, but we just always return a value of 0.
We should be advertising 0 query bits instead of 64, but gallium doesn't
have plumbing for that yet.  At least this stops the segfaults.
vc4: Add support for texture border color.

One spot in the docs says that it's stored at a miplevel just beyond the
last miplevel, which was scary.  But really, you just load it as the R
coordinate (which conflicts with cubemaps, but you don't do border
clamping on cubes).
vc4: Add support for GL 1.1's stupid CLAMP mode.

We just clamp the incoming texture coordinates.  This breaks the lambda
calculation, but it gets the piglit tests to pass.  This is the same
behavior as in i965.
freedreno/a3xx: add 32bit integer vtx formats

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: fix border color order

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: move bind_sampler_states to per-generation

Keep the existing function as a common helper.  But this lets us move an
a2xx specific hack out of common code.  And the PIPE_TEX_WRAP_CLAMP
emulation will require an a3xx specific hack.  So rather than piling on
hacks, split this out.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: add texcoord clamp support to lowering

This is for hw that needs to emulate some texture wrap modes (like
CLAMP) with some help from the shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: add support to emulate GL_CLAMP

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/ir3: add some cmdline args

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: re-emit shaders on variant change

We need to keep track if a state change other than frag/vert shader
state will trigger us to need a different shader variant, and if
necessary mark the appropriate shader state as dirty.  Otherwise we will
forget to re-emit the shader state.

Signed-off-by: Rob Clark <robclark@freedesktop.org>