radeonsi: fix CS tracing and remove excessive CS dumping
gallium/util: add util_bitcount64

I'll need this in radeonsi.

v2: use __builtin_popcountll if available

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: get tgsi_shader_info only once before compilation

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
tgsi: simplify shader properties in tgsi_shader_info

Use an array of properties indexed by TGSI_PROPERTY_* definitions.
radeonsi: get fs_write_all from tgsi_shader_info directly

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
tgsi: remove some not so useful variables from tgsi_shader_info
radeonsi: remove unused variable si_shader::gs_input_prim

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: always compile shaders on demand

The first compiled shader is sometimes useless, because the key doesn't match
the key for the draw call where it's used.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: move geometry shader properties from si_shader to si_shader_selector

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: remove interp_at_sample from the key, use TGSI_INTERPOLATE_LOC_SAMPLE

st/mesa has the same flag in its shader key, we don't need to do it
in the driver anymore.

Instead, use TGSI_INTERPOLATE_LOC_SAMPLE, which is what st/mesa sets.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: don't flush shader caches when building PM4 shader states

This is a wrong place to flush caches to say the least.

I don't think we need to flush the instruction caches if we don't patch
shaders with DMA.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: make the vertex shader key smaller

We only support 16 vertex attribs, not 32.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: set LLVMByValAttribute for all descriptor arrays

I hope this is correct.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: pass the GS shader directly to si_generate_gs_copy_shader

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
radeonsi: set number of userdata SGPRs of GS copy shader to 4

It only needs the constant buffer with clip planes and read-write resources
for the GS->VS ring and streamout. That's 2 pointers.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
tgsi: change tgsi_shader_info::properties to a one-dimensional array

Reviewed-by: Roland Scheidegger <sroland@vmware.com>

v2: fix svga too
ilo: let shaders determine sampler counts

When a shader needs N samplers, we should upload N samplers and not depend on
how many are bound.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: let shaders determine surface counts

When a shader needs N surfaces, we should upload N surfaces and not depend on
how many are bound.  This commit is larger than it should be because we did
not export how many surfaces a surface uses before.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
radeonsi: Use dummy pixel shader if compilation of the real shader failed

Instead of crashing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79155#c5
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
glsl: do not emit error for non written varyings on OpenGL ES

Patch fixes following test case from 'shaders-with-varyings' WebGL
conformance suite: "vertex shader with unused varying and fragment
shader with used varying must succeed"

v2: emit still a warning if the condition happens (Ian)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>