Ignores alpha channel while blitting R8G8B8X8_UNIFORM colorspace.
framebuffer It would be nice to perform some code refactoring in
vrend_blitter to minimize dup code. Fixes following test:
dEQP-GLES3.functional.fbo.blit.conversion.rgb8_to_rgba8']
dEQP-GLES3.functional.fbo.blit.conversion.rgb8_to_rgb10_a2
dEQP-GLES3.functional.fbo.blit.conversion.rgb8_to_rgba4']
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The 'invariant' output data attrib was not properly implemented in
mesa's TGSI serialization, and was ignored in virglrender's conversion
from TGSI text to GLSL text. This patch adds 'invariant' support
and sets a new virgl cap to enable it since older versions of
virglrenderer will fail if invariant appears in the TGSI stream.
Tested: chromeos on qemu + virglrenderer
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Joe M. Kniss <djmk@google.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
We don't need to use gl blend if both source and target buffers are in sRGB
and colorspace transformation isn't requiqred. Fixes this test:
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_srgb8_alpha8
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
I hit app stall frequently when running virgl on Windows/macOS, it
turned out virgl kept calling glClientWaitSync and just got timeout.
According to https://www.khronos.org/opengl/wiki/Sync_Object, the sync
object may never be signaled without proper flushing. This glFlush fixes
the stall issue on Windows/macOS.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Lepton Wu <lepton@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
This adds texture array and primitive restart caps which are
available on gles3.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Forces using vrend_render_blit_gl if sourceframebuffers is in sRGB
colorspace. Fixes following tests:
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rgba8
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rgb10_a2
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rgba4
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rgb5_a1
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rgb8
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rgb565
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_rg8
dEQP-GLES3.functional.fbo.blit.conversion.srgb8_alpha8_to_r8
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This fixes the remaining cull distance tests by making sure
we pipe the cull distance sizing through all the shaders properly.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
if the TGSI has CLIPDIST[0], we have to translate that into
vec4(gl_in[0].gl_ClipDistance[0], gl_in[1].gl_ClipDistance[1],
gl_in[0].gl_ClipDistance[2], gl_in[2].gl_ClipDistance[3]);
This fixes:
tests/spec/glsl-1.50/execution/geometry/clip-distance-bulk-copy.shader_test
tests/spec/glsl-1.50/execution/geometry/clip-distance-in-param.shader_test
tests/spec/glsl-1.50/execution/geometry/clip-distance-in-values.shader_test
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Without this, when running under ES 3.2 profile (nvidia driver), I
hit "error C5121: multiple bindings to output semantic".
Tested by running Chrome OS under qemu with these profiles:
core profile: 4.5.0 NVIDIA 384.111
core profile: 3.3 (Core Profile) Mesa 17.3.3
es profile: OpenGL ES 3.2 NVIDIA 384.111
es profile: OpenGL ES 3.0 Mesa 17.3.3
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
We need it when uploading a 3D texture without a temporary buffer.
Fixes:
dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex1
dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex2
dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex3
dEQP-GLES3.functional.texture.specification.texsubimage3d_unpack_params.r8_complex4
When we blit between depth or stencil buffers, but MSAA is enabled,
we can hit that path and set the GL_SCALED_RESOLVE_NICEST_EXT. This
causes the blit to fail. Fix this by not going in that path for
depth/stencil buffers.
Fixes:
dEQP-GLES3.functional.fbo.invalidate.whole.unbind_blit_msaa_color
dEQP-GLES3.functional.fbo.invalidate.whole.unbind_blit_msaa_depth
dEQP-GLES3.functional.fbo.invalidate.whole.unbind_blit_msaa_stencil
dEQP-GLES3.functional.fbo.invalidate.sub.unbind_blit_msaa_color
dEQP-GLES3.functional.fbo.invalidate.sub.unbind_blit_msaa_depth
dEQP-GLES3.functional.fbo.invalidate.sub.unbind_blit_msaa_stencil
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
This was pretty trivial to implement, so let's just get it out of the way.
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Change to use strcmp since memcmp is confusing here.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
The code would previously look at the emulated alpha texture's
swizzle, or the application swizzle, but wouldn't combine them
together. This means that swizzling was incorrect when using an
emulated alpha texture in conjunction with application swizzle.
Also, remove swizzle_* from struct vrend_sampler_view since these
aren't used outside of this single function.
Fixes:
dEQP-GLES3.functional.texture.swizzle.multi_channel.alpha_*
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Introduce the VIRGL_FORMAT_R10G10B10{A2,X2}_UNORM formats and add
support for them in the renderer.
Fixes:
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgba_unsigned_int_2_10_10_10_rev
v2:
Also update cvs file with newly added format.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Update p_format.h to bring in new formats, which will be used (in their
VIRGL_FORMAT form) in upcoming commits.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
We don't want to end up with a height of zero.
Fixes "vrend: further modify read_transfer_data / write_transfer_data"
and the following dEQP tests:
dEQP-GLES3.functional.texture.specification.texstorage3d.format.*2d_array*
Example tests:
dEQP-GLES3.functional.texture.specification.texstorage3d.format.rgba16i_2d_array
dEQP-GLES3.functional.texture.specification.texstorage3d.format.rgba16ui_2d_array
Use the GL_RGB565 internal format (provided by GL_ARB_ES2_compatibility)
for VIRGL_FORMAT_B5G6R5_UNORM.
Fixes:
dEQP-GLES2.functional.texture.format.rgb565_2d_npot
dEQP-GLES2.functional.texture.format.rgb565_2d_pot
dEQP-GLES2.functional.texture.format.rgb565_cube_npot
dEQP-GLES2.functional.texture.format.rgb565_cube_pot
dEQP-GLES2.functional.texture.mipmap.2d.generate.rgb565_fastest
dEQP-GLES2.functional.texture.mipmap.2d.generate.rgb565_nicest
dEQP-GLES2.functional.texture.mipmap.2d.generate.rgb565_non_square_fastest
dEQP-GLES2.functional.texture.mipmap.2d.generate.rgb565_non_square_nicest
dEQP-GLES2.functional.texture.mipmap.cube.generate.rgb565_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.rgb565_nicest
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Fix compiler warnings about incorrect format type and possible format
overflow.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
glGetTexImage returns the entire texture, and we always copy from
the beginning of the texture. Instead, we should start copying
from the offset specified by the bounding box.
Fixes:
dEQP-GLES3.functional.texture.shadow.2d_array.*.*depth*
Example test cases:
dEQP-GLES3.functional.texture.shadow.2d_array.linear.not_equal_depth_component32f
dEQP-GLES3.functional.texture.shadow.2d_array.nearest_mipmap_nearest.less_or_equal_depth_component16
dEQP-GLES3.functional.texture.shadow.2d_array.nearest_mipmap_nearest.greater_or_equal_depth_component16
v2: Cubemap textures seem to suffer from the same issue:
Fixes:
dEQP-GLES3.functional.texture.shadow.cube.nearest.*
Example test cases:
dEQP-GLES3.functional.texture.shadow.cube.nearest.less_or_equal_depth_component16
dEQP-GLES3.functional.texture.shadow.cube.nearest.less_or_equal_depth24_stencil8
v3: Make sure we still make only 1 glTexSubImage3D call in the non-cubemap case
v4: Fix slice size and texture size calculations.
Fixes:
dEQP-GLES3.functional.texture.filtering.3d.formats.rgb9_e5_nearest
dEQP-GLES3.functional.texture.filtering.3d.formats.rgb9_e5_linear
Signed-off-by: Dave Airlie <airlied@redhat.com>
The current default value is not big enough for running android app
inside Chrome OS under qemu+virgl. Increase it to 64 so we can run
several android apps inside ARC++ under Chrome OS in qemu+virgl at
same time.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This was previously ignored.
Along with the mesa patch, this fixes ~100 dEQP tests:
dEQP-GLES3.functional.texture.filtering.cube.*
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We don't always start at a z-offset of zero. For example, when
Gallium copies a temporary depth texture to the final depth texture
[i.e, the one finalized in st_finalize_texture(..)], it sends the
copy commands one slice at a time.
Fixes:
dEQP-GLES3.functional.texture.specification.teximage3d_depth.depth_component32f_2d_array
dEQP-GLES3.functional.texture.specification.teximage3d_depth.depth_component24_2d_array
Resets stencil buffer write mask to ~0u before glClear().
Fixes many tests which use stencil buffer with increment, decrement or
invert operations. For example:
dEQP-GLES3.functional.fragment_ops.random.18
dEQP-GLES3.functional.fragment_ops.random.25
dEQP-GLES3.functional.fragment_ops.interaction.basic_shader.2
We need a case for 24-bit formats, like GL_RGB8I.
Fixes:
dEQP-GLES3.functional.texture.specification.*.{rgb8i, rgb8ui}
dEQP-GLES3.functional.texture.format.sized.2d.*.{rgb8i, rgb8ui}
Example test cases:
dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb8i_2d
dEQP-GLES3.functional.texture.specification.basic_teximage2d.rgb8ui_2d
dEQP-GLES3.functional.texture.format.sized.2d.rgb8i_npot
Signed-off-by: Dave Airlie <airlied@redhat.com>
The piglit test generates a failed to compile shader:
gl-2.1-fbo-mrt-alphatest-no-buffer-zero-write
The test never validates any result as it can't, but this fixes
the debug logging of the error on the host.
outputs from vertex shaders are now vso
and outputs from geometry shaders are now gso.
This allows adding tessellation a bit easier.
Signed-off-by: Dave Airlie <airlied@redhat.com>
1) The offset at each depth should be the layer stride
i.e.,(depth * stride * height)
2) We shouldn't do a single write / read when the depth != 1.
Fixes:
dEQP-GLES3.functional.texture.specification.basic_texsubimage3d.*
Example test:
dEQP-GLES3.functional.texture.specification.basic_texsubimage3d.rgba32f_3d
Signed-off-by: Dave Airlie <airlied@redhat.com>
The previous calculation (block_stride * block_height * depth) led
to data corruption since we don't take stride into account when
allocating the temporary buffer.
With this fix,
dEQP-GLES3.functional.texture.specification.basic_texsubimage3d.rgba32f_3d
doesn't crash the virtual machine (though the test fails).
Signed-off-by: Dave Airlie <airlied@redhat.com>
In the case of PIPE_TEXTURE_CUBE, util_gen_mipmap (in Mesa)
encodes the target face in blit.{src,dst}.box.z. We need to
bind to the correct texture target before we draw.
Also removed extraneous whitespace.
Fixes:
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_nicest
dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_alpha
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_alpha
[airlied: also fixes piglit:
spec@arb_texture_cube_map@copyteximage cube]
v2: Set layer to dst_z for cases other than GL_CUBE_MAP
Signed-off-by: Dave Airlie <airlied@redhat.com>
"vrend: Fix iovec read/write for depth" started making of use of
the bounding box's depth in the fallback path. It turns out in
some instances, the temporary buffer used by iovec read/write
is not large enough, leading to memory corruption.
Let's separate send_size from alloc_size in some cases, since
glReadnPixels requires it.
With this fix,
dEQP-GLES3.functional.texture.specification.basic_texsubimage3d.rgba32f_3d
doesn't crash the virtual machine (though the test fails).
Signed-off-by: Dave Airlie <airlied@redhat.com>
When emulating GL_ALPHA8 with GL_R8, we should make the alpha
component equal to the red color channel.
Fixes:
['dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_fastest']
['dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_nicest']
on OpenGL 4.5 (core).
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
The depth was ignored in the fallback path, which caused us to copy
only the first layer.
This fixes:
dEQP-GLES3.functional.shaders.texture_functions.texture.isampler2darray.*
and probably other 3D texture/sample array tests.
Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
glBindBufferRange(..) in vrend_draw_bind_ubo is failing with
more than one uniform block. This is due to improper alignment
of the start of the second block. Let's query the proper
alignment from the driver and pass it back to Mesa.
Let's also query for GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT just in
case, even though don't use glTexBufferRange yet.
Fixes:
dEQP-GLES3.functional.ubo.* on Nvidia
Example test:
dEQP-GLES3.functional.ubo.multi_basic_types.single_buffer.shared_vertex
Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenGL ES don't support 1D texture.
So we replace these textures by some 2D texture with one of
the component set to 0.5
v2: Use new use_gles state on vrend_shader_cfg.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Some features:
* Always use the "#version 300 es" header
* Set high precision by default
* Do not use noperspective attribute
v2: Do not create a global state but instead add field
vrend_shader_cfg and send that into more functions.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Refactors vertex/fragment shader exit routine. Handles all end points properly.
Fixes dEQP-GLES2.functional.shaders.return.output_write_dynamic_vertex test.
[airlied: cleanup damaged whitespace + remove old geom lines of no use]
Signed-off-by: Dave Airlie <airlied@redhat.com>