This adds the texture barrier support for the texture barriers,
a separate patch would be needed to implement the framebuffer fetch
barriers.
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Add the combinations that include compressed format to the check to use
glCopyImageSubData. This fixes a number tests of "arb_copy_image-formats"
were compressed textures are the source and uncompressed textures the
destination (no regressions).
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Based on the website, glTexStorage2DMultisample requires at least
opengles >= 31 and opengl >= 43 or the extension.
Adding the check here.
v2: rebased using the features.
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is needed to make tests/test_virgl_cmd pass
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
The extension is also provied by GL 4.0 and GLES 3.1.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
glTexStorage*D is more restrictive in supporting texture formats, especially
on GLES. Specifically, it doesn't support BGRA textures that are needed to get
any useful display, but it is needed to get immutable textures that are required
for glTextureView.
Check which formats are supported and use glTexStorage*D for these, otherwise
fall back to use glTexImage*D.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This fix all dEQP-GLES31.functional.shaders.builtin_functions.* tests on GLES
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
On GLES low MSAA textures with low sample counts like 1 and 2 are not
supported as render targets, therefore, copy the sample positions from the
lowest number of samples.
Remove the debug output too.
Fixes on GLES host:
dEQP-GLES31.functional.texture.multisample.samples_1.sample_position
dEQP-GLES31.functional.texture.multisample.samples_2.sample_position
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This was bogus from the beginning.
Fixes: c0e0274e8c
virgl: Add method to query supported MSAA samples and positions
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This warning was encountered:
vrend_shader.c:4257:57: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
(ctx->key->coord_replace & (1 << ctx->inputs[i].sid))) {
Fix this.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
In certain cases, specifying level and layer for TBOs causes
tests to fail. Don't do this.
Fixes:
dEQP-GLES31.functional.image_load_store.buffer.image_size.writeonly_12
dEQP-GLES31.functional.image_load_store.buffer.image_size.writeonly_1
dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_writeonly_12
dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_writeonly_1
dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_12
dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_1
Signed-off-by: Dave Airlie <airlied@redhat.com>
Move all v2 caps into the caps_v2 function that also gets renamed.
Protect the GL only value queries by using the according gl_ver test.
(Part two of cleanup suggested by Gurchetan)
v4: rebase after image support and compute shader patches landed
v5: use basic check for GL for GL_SMOOTH_*_SIZE_RANGE (Erik)
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> (v3)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Also rename the function caps_common to indicated that only v1 caps are
set here.
(This is part one of the cleanup suggested by Gurchetan)
v4: rebase after image and compute shader patches landed
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> (v3)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Also move the function code up in the file to let the code reflect the
call logic.
v4: rebase after image and computer shader patches landed
v5: take changes in previous patch into account
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> (v3)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Since the gles code path is now reduced to just setting the gles
version, move all the glsl stuff into one place.
v3: remove now unused parameter gl_ver
v4: rebase after image and compute shader patches landed
v5: rework logic a bit taking Eriks suggestion into account
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> (v3)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Use the new cap code path for setting it on GLES
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
v2: Move some common version 2 caps into new function (Dave pointed
out there were some in common without checking the caps version)
v5: also fill common caps v2 from gles (Erik)
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
This is usefull for running vtest under apitrace.
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Input/output layout qualifiers used by early depth stencil are
glsl 150 feature.
Fixes on SKL:
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_depth
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_stencil
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_depth_fbo
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_stencil_fbo
Signed-off-by: Dave Airlie <airlied@redhat.com>
On an GL host set the sRGB blit framebuffer state explicitly to make virgl
behave like on a GLES host.
This does not correct the handing of sRGB completely, because the state
GL_FRAMEBUFFER_SRGB is not properly transmitted to the host. As a result
the piglits "blit texture linear_to_srgb * * *" flip.
Tests thatset "enable" failed before and pass now, and tests that set "disable"
now fail.
v2: - Move setting the fbo state out of the loop (Robert Tarasov)
- Use the blitter context to set and store the state, since it is only,
and currently we don't pass the state from the guest
relevant when the dst texture is SRGB, there is no need to disable it
- Just enforce that a source SRGB texture is always decoded when this could
be disabled
Fixes on GL host:
dEQP-GLES3.functional.fbo.blit.conversion.rgb8_to_srgb8_alpha8
dEQP-GLES3.functional.fbo.blit.default_framebuffer.srgb8_alpha8
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
This seems to be quite common, but we should still test for its
availability because it doesn't seem to be part of any standard.
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The TGSI FBFETCH instruction is used for implementing framebuffer-reads
when doing for instance advanced blends. It's used by both
EXT_shader_framebuffer_fetch_non_coherent and
KHR_blend_equation_advanced.
Sadly, libepoxy doesn't yet support the glFramebufferFetchBarrierEXT
function needed to implement this on top of
EXT_shader_framebuffer_fetch_non_coherent itself, so let's just implement
it on top of EXT_shader_framebuffer_fetch instead for now.
This means that we'll have slightly higher requirements for enabling
this functionality than the level of functionality we provide through it.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
[cherry-picked from mesa 1393999541f3956156bf227209ecbf6d814ffc8f]
Signed-off-by: Dave Airlie <airlied@redhat.com>
This requires adding new protocol to pass the width/height/layers/sample
default values from the host.
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Add a capability and some queries to expose compute shaders
to the host.
v2: expose more limits, check feature on launch grid
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
For compute shaders we put the req local memory into the streamout
places in the protocol, and we create compute shaders in a separate
lookup function
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This mostly consists of adding local memory support, and
support for the compute system values.
The req_local_mem need to be gotten from the guest side
and passed into the shader compile so we can size the
shared memory correctly.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This fixes somes bugs in the existing code and
refactors the sampler array support to more closely
follow the image array code.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Adds a VIRGL_RENDERER_USE_GLES flag for specifying the API to request
when creating the EGL context.
Users can enable this flag when using vtest with the VTEST_USE_GLES
environment variable.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
To make it easier to run the test suite on environments without graphics
hardware, add an environment variable VIRGL_EGL_SURFACELESS that will
force the use of the surfaceless platform.
Combined with the following flags, we can run virglrenderer and its
tests without any graphics hardware or windowing system present:
LIBGL_ALWAYS_SOFTWARE=true GALLIUM_DRIVER=llvmpipe VIRGL_EGL_SURFACELESS=yes
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
GL4.2/GLES3.1 adds glMemoryBarrier so make sure we can handle it.
v2: add a cap bit for this for guest
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This adds support for the TXQS opcode, and RESQ w channel
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This adds support for tracking images, and binding them
to the GL context.
includes:
vrend_renderer: create texture when TBO is used as image
vrend_renderer: specify correct access to glBindImageTexture
v2:
vrend_renderer: invert glBindImageTexture layered logic
v3: fix decode macros (Gert pointed out for ssbo)
v4: add max image samples to the caps.
add image arrays.
use mask var outside loop (Gert)
change img_locs type to GLint and printf on fail (Gert)
Co-authors: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>