vrend_renderer.c: in function »vrend_renderer_resource_create«:
vrend_renderer.c:4735:35: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c:4745:32: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c:4756:32: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c:4763:32: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c: in function »read_transfer_data«:
vrend_renderer.c:4893:27: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (h = 0; h < bh; h++) {
^
vrend_renderer.c: in function »write_transfer_data«:
vrend_renderer.c:4936:24: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (h = 0; h < bh; h++) {
^
vrend_renderer.c: in function »check_transfer_bounds«:
vrend_renderer.c:4981:28: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (info->box->depth > res->base.array_size)
^
vrend_renderer.c:4983:24: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (info->box->z > res->base.array_size)
^
vrend_renderer.c:4985:43: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (info->box->z + info->box->depth > res->base.array_size)
v2: Correct language of warnings
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: In Funktion »set_stream_out_varyings«:
vrend_renderer.c:867:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < n_outputs; i++)
^
vrend_renderer.c: In Funktion »vrend_set_framebuffer_state«:
vrend_renderer.c:1636:38: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = ctx->sub->nr_cbufs; i < old_num; i++) {
^
vrend_renderer.c:1652:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < ctx->sub->nr_cbufs; i++) {
^
vrend_renderer.c: In Funktion »vrend_set_viewport_states«:
vrend_renderer.c:1707:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_viewports; i++) {
^
vrend_renderer.c: In Funktion »vrend_create_vertex_elements_state«:
vrend_renderer.c:1778:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_elements; i++) {
^
vrend_renderer.c:1844:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_elements; i++) {
^
vrend_renderer.c: In Funktion »vrend_set_constants«:
rend_renderer.c:1902:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_constant; i++)
^
vrend_renderer.c:1887:35: Warnung: unused parameter »index« [-Wunused-
parameter]
uint32_t index,
^~~~~
vrend_renderer.c: In Funktion »vrend_set_num_sampler_views«:
vrend_renderer.c:2118:39: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
if (start_slot + num_sampler_views < ctx->sub-
>views[shader_type].num_views) {
In this case the if-condition enclosing the for loop was removed because
it was superfluous.
v2: Use mesa-style UNUSED for unused parameters
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: In Funktion »vrend_hw_set_zsurf_texture«:
vrend_renderer.c:1516:65: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
first_layer != last_layer ? 0xffffffff :
first_layer);
^
vrend_renderer.c: In Funktion »vrend_hw_set_color_surface«:
vrend_renderer.c:1535:68: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
first_layer != last_layer ? 0xffffffff :
first_layer);
^
vrend_renderer.c: In Funktion »vrend_set_framebuffer_state«:
vrend_renderer.c:1618:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < nr_cbufs; i++) {
^
vrend_renderer.c:1666:31: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
if (ctx->sub->fb_height != new_height || ctx->sub-
>inverted_fbo_content != new_ibf) {
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: In Funktion »vrend_destroy_shader_selector«:
vrend_renderer.c:627:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < sel->sinfo.so_info.num_outputs; i++)
^
vrend_renderer.c: In Funktion »dump_stream_out«:
vrend_renderer.c:776:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < so->num_outputs; i++) {
^
vrend_renderer.c: In Funktion »set_stream_out_varyings«:
vrend_renderer.c:828:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < so->num_outputs; i++) {
^
vrend_renderer.c: In Funktion »vrend_destroy_streamout_object«:
vrend_renderer.c:1130:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < obj->num_targets; i++)
^
vrend_renderer.c: In Funktion »vrend_destroy_so_target_object«:
vrend_renderer.c:1200:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < obj->num_targets; i++) {
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Multisample fragment operations are part of the OpenGL ES 3.0 spec and
enabling them doesn't required the extensions to be listed explicitly.
Fixes:
dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_alpha_to_coverage
dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_sample_coverage
dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_sample_coverage_inverted
dEQP-GLES3.functional.multisample.fbo_max_samples.sample_coverage_invert
on an GLES host with GLES >= 3.0.
v2: - Do not set GL_SAMPLE_ALPHA_TO_ONE state when on gles host, because it is
not supported there. This silences a number of according warnings on the
host.
v3: - Properly place if statement to not send GL_SAMPLE_ALPHA_TO_ONE.
- Do not set GL_MULTISAMPLE state when on gles host (same as above).
v4: - fix nitpicks in commit message
v5: - seperate setting of GL_MULTISAMPLE (not available on GLES) and
GL_SAMPLES_TEST
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 resources we create for gallium resources should be immutable
wrt the layout we want, so if we have the texture storage APIs
available we should use those instead of the tex image ones to
create the initial storage.
This is also a necessary precursor for texture view support.
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
This just makes sure we use the correct destruction path.
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Virglrender holds the values in a structure vrend_sub_context that is zeroed
out when it is initialized.
So, when the first state change set the near_val and far_val to zero,
the check assumes it is the old state and doesn't call glDepthRange.
Fixes: dEQP-GLES2.functional.depth_range.write.zero_to_zero
v2: initialize far_val in vrend_renderer_create_sub_ctx (Gurchetan)
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
On GLES >= 3.1 all the functionality that is currently relevant for
attribute binding in virglrenderer is available. However, GLES 3.1 does
not fully implement GL_ARB_vertex_attrib_binding. Therefore, rename the
flag "have_vertex_attrib_binding" to "have_gles31_vertex_attrib_binding",
and set it when the host implements GL_ARB_vertex_attrib_binding, is
GL >= 4.3 or GLES >= 3.1. As a result with these configuration the new
code path vrend_draw_bind_vertex_binding is used.
Fixes on GLES 3.1 hosts:
dEQP-GLES3.functional.clipping.point.wide_point_z_clip
dEQP-GLES3.functional.clipping.point.wide_point_z_clip_viewport_center
dEQP-GLES3.functional.clipping.point.wide_point_z_clip_viewport_corner
On an Intel Kabylake GLES 3.1 host this also fixes:
dEQP-GLES3.functional.clipping.point.wide_point_clip
dEQP-GLES3.functional.clipping.point.wide_point_clip_viewport_center
dEQP-GLES3.functional.clipping.point.wide_point_clip_viewport_corner
but it should be noted that these three tests expect that also points with a
centre outside the clip volume will be partially drawn when they overlap with
the clip volume because of being "wide" (i.e. when moving towards the clip
volume boundary a wide point would "naturally" move out). The OpenGL standard
defines that points should be clipped the moment the centre is outside the
clip volume (i.e. points will "pop" in and out of the view when moving across
the border). Hence, for a host implementation following the standard to the
letter these tests should actually fail.
v2: - rename have_vertex_attrib_binding to have_gles31_vertex_attrib_binding
- clarify the commit message describing the wide point clipping problem
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
We don't need the entire 32 bits to report the presence of TGSI
invariant support.
Suggested-by: Gert Wollny <gert.wollny@collabora.com>
Suggested-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
and make sure that on GLES it it chosen for GL_RGBA4 over
VIRGL_FORMAT_B4G4R4A4_UNORM, by removing support for the latter.
This is needed because on GLES3 GL_BGRA isn't a supported format to pass
to glTexImage3D.
Fixes the test dEQP-GLES3.functional.texture.format.sized.3d.rgba4_pot
on GLES hosts.
v2: * Make more explicit the GL/GLES split (Gert Wollny)
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Suggested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This allows the tbo code to properly detect if we are using a buffer
as a texture or not, instead of relying on GL_TEXTURE_BUFFER being used.
We also don't need to special case generate the tbo texture id until
sampler bind time.
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Until we support ARB_texture_buffer_range we shouldn't report
this value as mesa will enable the extension.
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
This adds support for the transform feedback vertex streams
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Warn if the expected native format/type differs from the allowed
type and format that are accepted by the OpenGL ES spec.
This is hopefully only a problem for Mesa which we have now fixed.
Other option is to add two extra copies and format conversions.
v2: More verbose and better comment.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Just set the cap if we have GLES 3.0 and call the
glTexStorage*DMultisample functions as appropriate.
Causes a bunch of the tests in
dEQP-GLES3.functional.fbo.msaa.*_samples to pass.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Newer versions of libepoxy treats glFramebuffer3DEXT and glFramebuffer3DOES as
different functions. They differ very slightly but it might be best to be as
proper as possible when it comes to function usage.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Take into account the gallium uniform buffer indices when associating
host UBOs with gallium uniform buffers.
Previously the code disregarded the gallium uniform buffer indices,
leading, under specific circumstances, to the provision of incorrect
data to the shaders. The problem manifested typically when a context
contained active UBOs which were not accessed by a particular shader,
but ended up being used instead of the correct UBOs for that shader.
This occurred, for example, when running the dEQP-GLES3.functional.ubo.*
in batch mode, in which case left over UBOs from previous tests would
cause subsequent tests to fail.
Fixes:
dEQP-GLES3.functional.ubo.* when run in batch mode
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Joe Kniss <djmk@chromiumos.org, djmk@google.com>
Tested-by: Elie Tournier <elie.tournier@collabora.com>
This is needed for fixing CTS:
dEQP-GLES3.functional.occlusion_query.conservative*
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
vrend_clear is passed in from gallium clear which, unlike glClear, must
not obey rasterizer discard and depth_clmap. However, the guest doesn't
foreard the latest update of the rendering states to the host before issuing
"clear". Therefore, the host clear command must clear these states before
calling glClear in turn. After calling glClear these states are again brought
into sync with what the host assumes.
Fixes CTS:
dEQP-GLES3.functional.rasterizer_discard.fbo.*
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
As I have only done testing on the gles-backend with this patch
the code is only enabled on it. Further testing might show that
it is possible to run this code on all backends.
v2: Try getteximage path on failure.
Fixes:
dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_fastest
dEQP-GLES2.functional.texture.mipmap.2d.generate.a8_nicest
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_fastest
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_nicest
dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_fastest
dEQP-GLES2.functional.texture.mipmap.2d.generate.la88_nicest
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_nicest
dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_nicest
dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_nicest
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Update the blit shader creation code to take the destination format
swizzle into account. This involves inverting the swizzle information
and using the inverted swizzle to reorder the texel components in the
shader. The new swizzle code also removes the need for having a special
case if the destination format uses emulated alpha.
This commit temporarily removes the VIRGL_FORMAT_R8G8B8X8_UNORM special
case. Improved support for it, and other similar "ignore alpha" cases,
is added back in an upcoming commit using appropriate swizzles.
At the moment we always recreate the shader in case we have a swizzle,
but a more efficient shader caching scheme could be devised to improve
this.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Use the source format swizzle information to set the
GL_TEXTURE_SWIZZLE_* parameters for the GL blit operation. This also
removes the need for the emulated alpha special case, since when using
emulated alpha the source format already has proper swizzle information.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
This is the SSBO analogue to 88444a. SSBOs are core in GL4.3 and
GLES31, so let's query for it.
This fixes 44 GLES31 tests on airlied@'s GLES31 sketch branches with
Nvidia hardware, but this patch standalone can be applied to master.
Example tests:
dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.0
dEQP-GLES31.functional.ssbo.layout.multi_basic_types.single_buffer.std430
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
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>