Up until now sme of the info stored in sinfo was changed
based on the shader key, and since this info is used for
all shader variants when evaluating the key for shaders
to be linked, this may result in the wrong shader
variant being picked up.
Instead track the shader info that can be changed like this
in the shader variant itself.
Closes: #239
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
RELEASE_TRACKED_OBJECTS did not like track_list to include "obj" after
expansion. Fix the callers and fix the gotcha.
v2: replace RELEASE_TRACKED_OBJECTS by an inline function (Ryan)
Fixes: 9da6721 ("vkr: add RELEASE_TRACKED_OBJECTS for tracked vkr_object")
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
dev_obj is internal to the macro. Rename it to _dev.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
The first argument is the identifier (e.g., cmd or set) of the object.
Because these macros create multiple objects, it is useless.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Fixes e5fabecbe0
vrend: pass texture levels per shader on GLES as uniform
v2: - only emit texlod uniform when textureQueryLevels is called
- initialize uniform location to -1 if the mask shows that
the texture lod levels arenot needed and ony test this when
uploading the data
(all suggested in a way by Chia-I Wu)
Closes: #237
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
While this should be the job of VVL, vkr dereferences the pointers
sometimes before calling down to the driver. It should be better for
the decoder to validate for us.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Follow up to commit a108be89e3 to clarify
acceptable length values for VIRGL_CCMD_SEND_STRING_MARKER command
buffers. This imposes no functional change.
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Fixes a missed internalformat fixup when glTextureView() is used to create
vrend_surfaces for resources backed by shared EGL images without an
alpha channel (e.g. RGBX, BGRX). Such resources are registered in host
Mesa with internalformat GL_RGB8, but virglrenderer prefers to create
32bpp textures and do it's own swizzling.
fixes: commit ebb2cf3 "vrend: convert linear color to srgb for 24bpp
imported EGL resources".
Signed-off-by: Ryan Neph <ryanneph@google.com>
Break it up into vkr_{device,instance,physical_device}.c. Suggested by
Ryan Neph.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Break it up into vkr_{device,instance,physical_device}.h. Suggested by
Ryan Neph.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
vkEnumerateDeviceExtensionProperties and
vkEnumerateDeviceLayerProperties should be physical device commands.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
This allows individual headers to be included without warnings.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
A header that is included by all internal source files. It replaces
vkr_object.h.
No functional change.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
The below are tracked:
- CREATE_OBJECT
- DESTROY_OBJECT
- CREATE_PIPELINE_ARRAY
- vkAllocateMemory
- vkFreeMemory
- vkCreateRenderPass2
The descriptor sets and command buffers are tracked by the pools.
The queues are not tracked as device objects.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
The same call cannot be reused in physical device enumeration error,
because apps can still normally destroy objects without mistake.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
This is also to prepare for destroying device level objects here.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
This doesn't do much. It would be more ideal if it could do 32-bit
builds as well.
To run deqp-vk, while there is lavapipe, lavapipe lacks external memory
that vkr requires. Some efforts will be needed to make the combination
work.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Wrap the below:
vkCreateGraphicsPipelines
vkCreateComputePipelines
The difference between pipeline creation and pool objects allocation is
too much to share macro.
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Although anisotropic filtering uses a float value, most hw doesn't
care below integer levels, so just transmit 1-16 for the sampler value
not the full float.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Previously, virgl generated invalid GLSL for atomicCompSwap leading
to compile errors.
Signed-off-by: John Bates <jbates@chromium.org>
Reviewed-by: Lepton Wu <lepton@chromium.org>
Detected by fuzzer.
glDebugMessageInsert() expects either a char buffer and non-negative
length, or a null-terminated c-string and negative length. If a
non-null-terminated buffer is passed with a negative length, mesa
attempts to determine the length with strlen() and accesses out of
bounds memory.
This patch drops support for negative length, and consequently for
null-terminated debug messages from virglrenderer.
v2: explicitly disallow negative string lengths and null-terminated
strings.
Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>