A shader that writes only depth will have num_outputs > 0, but since
there are no color outputs, we must not add the swizzling.
This fixes silicon city on GLES/crosvm
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
This should help debugging shader compilation errors.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
Fixes: f50c878d61
vrend: factor out preparing the blit info
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Since we can't properly resolve the depth buffer, we have to use one
samole, so use the sample 0 and not a random value from tc.z.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>.
The extension declaration must come before the precision definition, and
in GLES we have to emit the OES extension instead of the ARB extension.
Fixes pihlit :
spec/arb_get_texture_sub_image/arb_get_texture_sub_image-cubemap
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>.
Instead of just caching the fragment shaders and use some tables
cache all shaders and use a hash table.
Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/125
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>.
Legacy FS shaders may use glColor and glSecondaryColor without the VS
actually emitting it. However, on GLES the interfaces between stages must
be matched, so replace FS input colors with a constant when they are not
emitted by the VS.
v2: - revert how the color_in_mask is populated
- handle back color too
- correctly appply the interface matching only on GLES (Bug reported
by David Riley).
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
This fixes shader compilation with
STAR WARS™ Knights of the Old Republic™ II: The Sith Lords
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
Since we use a core context on the host and all parts that are
needed for compatibility profiles are lowered, we can signal the
guest by using the feature check version.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
This is needed when the guest applications uses a compatibility
context.
v2: remove superfluous break (Italo)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
For glsl >= 140 glClipVertex is only available in compatibility context
and needs to be lowered in the last vertex stage.
In addition, reworks the handling of clip and cull distances, and add
handling for gl_PointSize to the gl_PerVertex emission.
v2: - reorder patches and remove debug messages (Rohan)
v3: - don't force require glsl 1.50 for non-last vertex stage VS (Italo)
v4: - Move expression into common if branch (John)
- fix ws (John)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
NIR-to-TGSI doesn't necessarily sort the outputs, and that breaks some
CTS tests.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: John Bates <jbates@chromium.org>
This prevents the creation of src/gallium/auxiliary/util/__pycache__/
which is untracked in git.
The directory in question could be added to .gitignore instead, but
since the script is only executed once, it doesn't seem worthwhile to
write bytecode to disk anyway.
Signed-off-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
util_hash_table_create suffices. It requires more pointer dereferences,
but it also allows us to switch to the newer hash_table from Mesa.
v2: use XXH32 directly instead of _mesa_hash_data
Reviewed-by: Ryan Neph <ryanneph@google.com> (v1)
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
The warnings that they are unused are just silenced, but there
is actually no need for these parameters, they are not even asserted.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
By removing some code from cso_cache.h, u_format.c, and u_inlines.h, we
can remove p_context.h, p_screen.h, and u_surface.h as well.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
v2: u_box.h, u_pack_color.h and u_rect.h became unused as well
The removed files have no user.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
v2: u_bitmask.* is unused as well
This is unused yet.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
uif is now defined. util_is_power_of_two is replaced by other variants.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
This requires u_string.h to be updated as well. There is no more string
functions prefixed by util_. pipe_debug_message is removed as well.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>