This converts the image related opcodes, and tracks the used
images.
Images need some extensions for extra features:
ES_3_1_compatability is needed for r32f image support
shader_image_size for image size support
v2: image: fix missing emit for atomic,
use a shader req for images extension
extend cas_str - we overflowed this
v2.1: drop extra breaks, use decl last for range check (Tomeu)
v3: add indirect support,
drop pointless debug print (Gert)
use 512 in load path.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This just brings over some defines from the gallium codebase.
Co-authors: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
This avois them overflowing when we have long swizzled gl_
which happens more with compute shaders and images
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
v3: Correct gl_ver parameter for vrend_renderer_fill_caps_gl (Gurchetan)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
[airlied: remove some extra whitespace]
Signed-off-by: Dave Airlie <airlied@redhat.com>
The values are set to zero by clearing the structure, no need to set
them individually.
v2: - Don't remove max_viewports initialization (Erik)
- remove some more zero-initializations
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
If the client sends vrend_transfer_send_readpixels a stride (and vtest does),
then it is in bytes, but glPixelStorei(GL_PACK_ROW_LENGTH, stride) expects
the value to be pixels.
Fixes:
42e2a4ca7d
vrend: use the row-stride when directly reading back to an IOV
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Currently based on feat_multisample, but glSampleMaski isn't supported
with the same versions.
v2: Update to use new feature code.
Signed-off-by: David Riley <davidriley@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
When guest mesa does a glReadPixel call, it expects the data to be placed
with correct row strides into the readback buffer. While for calls that
invert or require more then one IOV this is done in write_transfer_data,
for a read that only uses a small area and offset making it fit into the
first IOV this was not done. Consequently, in this case configure the
PACK_ROW_LENGTH accordingly.
v2: fix whitespace issues
This fixes a number of piglits:
arb_copy_image-targets (for texture_2d source or dest, non-compressed)
arb_get_texture_multisample/sample_position
arb_texture_rectangle/fbo-blit rect
arb_get_texture__sub_image-cubemap
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
These VREND_BIND_*-flags here are basically a subset of the
VIRGL_BIND_*-flags, with one custom flag added. So let's just use
those, and use an unused big from the others for the swizzle-flag.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This copy of the bind-flags should not be used, as they are a duplicate
set of what can already be found in virgl_hw.h.
But to avoid breaking theoretical, unknown users, we shouldn't remove
them either. So let's just add a comment to tell people not to use
them.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
These are identical to the corresponding VIRGL_BIND-flags,
so let's get rid of this duplicate definition.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Mesa have these in it's virgl_hw.h copy, and the values needs to
stay in sync between mesa and virglrenderer here. So let's add this
definition here, where it can be defined only once.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This controls access to the Blend*i* interfaces.
remove comment for colormask interfaces where this doesn't apply.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Similar to e387116, we also need to report this for GLES hosts.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We end up evaluating vrend_format_is_emulated_alpha once in either
case, so let's just lift the logic up so we only have one call-site
in this function.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We already set up a short-hand accessor for vstate->base, so let's
use that for somewhat cleaner code.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Use LLVM's libFuzzer to fuzz the virgl_renderer_submit_cmd API.
Signed-off-by: David Riley <davidriley@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We now support version 2 of the virgl_renderer_callbacks struct, so
update the test to check for an unsupported version. Use
VIRGL_RENDERER_CALLBACKS_VERSION + 1 as the test version to ensure we
don't fail this test again when we update the struct in the future.
Fixes: test_virgl_init.virgl_init_cbs_wrong_ver
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Since the framebuffer used for blits is reused, attachements must be removed
after executing the blits, otherwise, a still bound depth buffer results
in failing color blits and vice versa.
Stabelizes piglits from "fbo-generatemipmap-formats"
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Instead of having the features in separate named bool, convert it
to an array of bools indexed by an enum.
This is a straight mechanical patch, no code flows should change
and it doesn't change any functionality, it just refactors the
code to use the enum list and a bool array.
Future work should be a lot easier on this, so I'd like to
land it first.
v2: use lowercase enum, move debug_cb in as well.
rename tf2, sort list.
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>