samplers on GLES
Since the sampler is emulated by a 2D sampler the offset must also be a
2D vector and the coordinate argument must be ivec2.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Since the 1D texture arrays are emulated by using 2D texture
arrays the number of array layers is in the z component.
Fixes piglits on GLES:
textureSize * *sampler1DArray
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
These textures are emulated by 2D textures and textureSize needs the swizzle
for the result to be assignable to a float value.
Fixes piglits on GLES hosts:
textureSize * *sampler1D
textureSize * *sampler1DShadow
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
On GLES GL_EXT_disjoint_timer_query provides this functionality, so we
should make use of it.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Makes things a tiny bit more consistent and easier to read.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
[airlied: rebased and fixed these up]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Use explicit named initializers for the enum to string mappings.
Makes the code tiny bit easier to follow and grep through.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
[airlied: rebased these and fix up the fallout]
Signed-off-by: Dave Airlie <airlied@redhat.com>
This fixes running Metro Redux 2033 on the GLES host.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Fixes:
KHR-GL41.viewport_array.dynamic_viewport_index
KHR-GL41.viewport_array.draw_mulitple_viewports_with_single_invocation
when run in a batch as KHR-GL41.viewport_array.*
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
With OES_viewport_array available the depth ranges can also be set
on GLES.
Fixes on GLES when run individually:
KHR-GL41.viewport_array.*
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Apart from fp64 about which we lie aynway the features required by
GLSL level 4.10 on top of 4.00 can be supported by GLES, so report
this higher feature level and it will give us GL 4.1 in the guest.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This enables indexed access to viewports on GLES hosts.
v2: Also add the extension to shaders when needed
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
There's no poin t in keeping u_format_pack.py around just to declare
this one function. Let's move it into where it's used.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This makes this code a bit simpler to follow.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This code never gets called from anywhere, so let's get rid of it.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We already removed the high-level format-conversion code from our
gallium sources, so there's no point in keeping this code around.
It's not included nor compiled, so it's just cruft right now.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
These functions was removed years ago, keeping the prototypes just leads
to confusion. Let's rip them out as well.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This helps a lot locating errors in the shaders.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Check args of the following function:
- vrend_decode_set_vertex_buffers
- vrend_decode_set_shader_buffers
- vrend_decode_set_atomic_buffers
- vrend_decode_set_shader_images
And change variable type to uint as the protocol should never send negative number.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Left shift int 1 by 31 bit is undefined behavior, which causes fuzzer
failure. Change 1 to 1u to avoid the runtime error.
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
There's little reason to confuse lod-bias and cubemap seamlessness. So
let's give lod-bias its own warning string.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This flag is *always* passed as zero, so it carries no information.
Let's just get rid of it.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This flag is *always* passed as zero, so it carries no information.
Let's just get rid of it.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
These already have to be the same as VIRGL_TRANSFER_{TO,FROM}_HOST, as
defined by the protocol. There's no point in having a separate set of
internal names for them.
While we're at it, rewrite tan if as a switch for clarity. This allows
us to detect internal usage of invalid values.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Fixes a number of piglitson GLES hosts. e.g. :
texelFetch * sampler2DMS * *
v2: Manually shift pixel center only on GLES
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
Virglrenderer sometimes tries to remove resources from the hash table
twice. Which will mess up the ressource hash table and reference counts
and therefore and leads to qemu/virglrenderer crashes.
Reproducer:
(a) guest creates resource foo, id 42.
(b) guest creates an object bar referencing resource foo.
(c) guest unreferences resource foo.
-> resource id 42 is removed from hash.
(d) guest creates a new resource baz, re-using id 42.
(e) guest destroys object bar.
-> resource foo refcount goes down to zero.
-> resource id 42 gets removed from hash the second time,
but id 42 entry points to resource baz not foo now.
Oops.
Note that most linux kernel drivers will never ever re-use resource ids
due to a bug in the virtio-gpu kms driver, in which case this bug
doesn't cause any harm.
Root cause is that vrend_renderer_resource_destroy() may call
vrend_resource_remove(), depending on the call chain. This is wrong.
Only vrend_renderer_resource_unref() which is called when the guest
unreferences a resource should remove the id from the hash table by
calling vrend_resource_remove().
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
This is easier than having to remember environment variables.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This means we can change them a bit more easily, for instance... from
command-line arguments!
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
A recent change in the mesa glsl code mesa/e551040c resulted in a
regression for
dEQP-GLES31.functional.shaders.builtin_functions.
integer.umulextended.uvec*
because the generated TGSI was staring to use only certain components of
the temporary return values. Therefore, it became visible that the
swizzle was not honored on these values.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: <Dave Airlie airlied@redhat.com>
With enhanced layouts and input arrays enabled it may happen that more then
one shader IO variable have the same sid, and since the other parts of the
glsl_name are not available at this point rewrite the patching routine to
be able to patch more than one instance of a delaration with the same
variable prefix.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Gurchetan Singh <gurchetansingh@chromium.org>
By enabling input arrays the TGSI may emit code that defines a number
of POS inputs individually, but accesses them indirectly. Rewriting them
as array makes it possible to emit proper GLSL in this case.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Gurchetan Singh <gurchetansingh@chromium.org>
Some varying outputs can be directly used for tranform feedback, so don't
emit an additional varying in these cases. This should save a move
instruction and also reduces the possibility of hitting the output varying
limit.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Gurchetan Singh <gurchetansingh@chromium.org>
Same as for outputs, since inputs might be passed interleaved we also
have to check the access mask and if the component comes with an offset
then we have to shift the swizzle.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-By: Gurchetan Singh <gurchetansingh@chromium.org>