As we transition to perfetto, there are more efficient ways
of adding metadata to traces that we can use when it is
needed.
Signed-off-by: John Bates <jbates@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
We requre version 330 when we create a compute shader on OpenGL, so we
should also report the cap only when we have this version.
Closes#200
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
This fixes a regression introduced by !462 which breaks some GLES3 and
GLES31 dEQP tests.
Fixes: 1b51495 ("vrend: replace if-chain by using switch/case")
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This reverts 374dd5bae8
Fix i965 crash with bin/gl-3.1-vao-broken-attrib
The crash with i965 can't be reproduced anymore, and the Gallium
drivers do the correct checks to not crash there, so it is
not necessary to do the extra checking.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Also change the interface of called functions to take sub_ctx
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
When we want to pass sub contexts directly to the function to avoid
having to de-reference the context pointer all the time there are rare
cases when we need the pointer to the parent context (e.g. for error
reporting). For these cases we need to be able to get the parent context.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
An untyped resource is a virgl_resource without pipe_resource while
vrend_context works with pipe_resources exclusively. When an untyped
resource is attached, we defer the insersion into res_hash until
VIRGL_CCMD_PIPE_RESOURCE_SET_TYPE is submitted.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Gurchetan Singh <gurchetansingh@chromium.org> (protocol)
Track them with a list and a single-slot cache in vrend_context. The
cache hit rate is expected to be ~100%.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
An untyped virgl_resource does not have a pipe_resource.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
egl_image always wraps gbm_bo so far so this is not a real issue. But
it will change soon.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Make virgl_egl_image_from_dmabuf a generic helper. Add
virgl_egl_image_from_gbm_bo and virgl_egl_aux_plane_image_from_gbm_bo
that use the helper.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Gert Wollny <gert.wollny@collabora.com>
Use helper variables for some pointer derefs and query the shader ID's
only once.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
v2: rename ctx to sub_ctx (inspired by comment of Chia-I)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
This info is only used when creating the shader key, so it can reside in
the sub context.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
With that Unigine Heaven goes from around 56 FPS to 58
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
With that shaders that are used more frequently will remain at the
top of the list, and since the search in the shader program list is
linear, this should save some time.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
This gives a 6% speed improvement with Unigine Heaven
v2: remove the unlikely for dual_src, the whole statement will
be changed later (Chia-I Wu)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
if-chains can usually not be optimized very well, switch/case might be
implemented as a jump table.
v2: Add a break in bese before default (Chia-I Wu)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
This makes the code a bit easier to read and may help the complier
to avoid needless dereferencing of pointers.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
v2: add comment about that INDEX is not used (Chia-I Wu)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Comparing to virgl_renderer_context_create, it allows flags to be
specified. flags can only be used to specify the capset id in this
commit, but that may change in the future.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>