There's no point in eagerly setting the blend-state, when we need to
also know the framebuffers to get it right.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
In the only codepath that leads here, this exact binding has already
been made, so let's avoid double-work.
This one makes sense on it's own.
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is only updated from one place, and it's usually going to stay
zero. So let's cache it to prevent excessive state emission.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is always passed as zero, so let's make the code a bit easier to
grok by removing this unused argument. We still need to pass zero to the
externally passed callback, though.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This should help a bit with CPU overhead when running on top of OpenGL 4.4
(or newer).
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh [gurchetansingh@chromium.org]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Fixes: tests/spec/arb_compute_shader/execution/basic-local-id-atomic.shader_test
Reviewed-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This fixes rendering in Minecraft (Java Edition), where we would
otherwise incorrectly mark a fog-inputs as flat.
While we're at it, fix a similar issue for auxprefix.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
When running tests it's easy to lose track the segfaults in the console spam,
very simply just catch the segfault and printf.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
When changing the from a one-by-one upload to an array upload the test for the
array pointer to the uniform IDs was replaced by testing the uniform array ID
against -1. However, this is not enough, because when the context is allocated
all is cleared to zero, and apparently the structure is re-used in different
invocations of shader programs. Here, one shader might have been removed but
the const field was still allocated resulting in a sigsegv. This happens e.g.
by running
dEQP-GLES31.functional.primitive_bounding_box.wide_points.
global_state.vertex_tessellation_geometry_fragment.fbo_bbox_larger
global_state.vertex_tessellation_geometry_fragment.fbo_bbox_smaller
tessellation_set_per_draw.vertex_tessellation_fragment.default_framebuffer_bbox_equal
tessellation_set_per_draw.vertex_tessellation_fragment.default_framebuffer_bbox_larger
resulting in
AddressSanitizer: SEGV on unknown address 0x00000000001c
The signal is caused by a READ memory access.
Hint: address points to the zero page.
#0 0x7f595b9eb875 in vrend_draw_bind_const_shader src/vrend_renderer.c:3677
#1 0x7f595b9ed37f in vrend_draw_bind_objects src/vrend_renderer.c:3810
Work around this by checking whether the shader type data is allocated.
Fixes: 172c9679b4
vrend/shader: handle uniforms as array
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Acked-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
It's a pkg-config 0.28 feature and Travis-CI ships with an older version.
Do the trivial task of writing it out manually ;-)
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
As suggested by libtoolize
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Also remove some trailing whitespace, while we're in here.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
check is more practical than distcheck since it doesn't
remove logs after the face, which allows us to always
keep logs. Even for non-failures.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
When the CI is run locally, the results directory has
to be cleared between runs in order to no exit early
or contain junk.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Apart from just doing a local run, this script enables
a local mesa repository to be used for the CI run.
For this to work the mesa repository is assumed to
be located in a directory next to the virgilrenderer.
$ ls -la
.
..
mesa
virgilrenderer
$ virgilrenderer/ci/run_ci_locally.sh
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The only reason for wanting this is to lower the chance
of being unable to used a cached image incase of
changes to the Dockerfile.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The selected subsets only contains tests that are currently passing with
a softpipe GL/GLES host.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
- rename options
- switch to softpipe since it supports up to GLES 3.1
- force host GL version 4.4 because otherwise we don't get GLES 3.1 in the
guest
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Let's be a little less conservative then QEMU -- fence only
on draw calls and possible fence creations.
Can we do even better, and fence only when Gallium requests
VIRGL_BIND_CUSTOM? Someone should look into this, but let's
get this landed to unblock the CQ.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Include stdint.h in virgl_hw.h, since it uses uint32_t.
Remove now duplicate structure virgl_box in vtest_renderer.c
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The buffer size is not an vector, and consequently we can't add a swizzle
operator. (This was probably the reason why the write mask was only emmited
when the it was larger then 1 before).
v2: Also handle 1D and Shadow1D textures (Dave)
Fixes: 70dedae465
shader: TXQ: also emit a write mask if only one bit is set.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The sub-context holds a pointer to the last shader program used and this
is de-referenced , e.g. in vrend_vbo_draw. However, the guest may destroy
the program without notifying the sub-context, and as a result the pointer
becomes stale and may ber used after free.
As a solution add a pointer to the owning context when a program is
referenced and if the program gets destroyed, clean the pointer in the sub-context.
Closes: #52
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
0x1 << 31 is undefined behavior based on C99 rules. (see ...)
Use unsigned syntax as an alternative to disable the warning.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>