It seems under some GPU/profile, GL_INVALID_ENUM is generated
instead of GL_INVALID_VALUE for unsupported internal format.
This is even conflicted in reference documents. Just handle
them at same time.
From:
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml
GL_INVALID_ENUM is generated if internalFormat is not one of the accepted
resolution and format symbolic constants.
From:
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml
GL_INVALID_VALUE is generated if internalFormat is not one of the accepted
resolution and format symbolic constants.
Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
v2: drop interp_temp, less special case temps
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This adds the bitfield and multiplies and barrier.
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This adds support for the transform feedback vertex streams
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
These are needed for ARB_gpu_shader5
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This adds the ability for the scanner to locate files
that need dimensions.
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
We will use the scanner to find a few things needed for ARB_gpu_shader5.
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>
This along with another patch allows us to expose
GL_[EXT|ARB]_framebuffer_sRGB on a GLES host.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
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>
When bounding a blit within the source resource extents, whether a
coordinate bound is inclusive or exclusive depends on the direction of
the read. Take this direction into account and bound the coordinates
accordingly.
Fixes: piglit fbo-blit-stretch
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenGL ES didn't support GL_POINT_SPRITE_COORD_ORIGIN.
So when we read from a fbo, the image is upside down.
This is because the guest renders into a window drawable
which is inverted, while the host renders into a FBO.
This patch inverts the y coordinate.
Fixes: dEQP-GLES2.functional.shaders.builtin_variable.pointcoord
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
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>
Use GL_RG based formats with a swizzle to implement virgl
luminance/alpha formats. Since GL_RG is color renderable this patch
allows more operations to be implemented for virgl luminance/alpha
formats.
Fixes:
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.la88_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.la88_nicest
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 GL_RED based formats with a swizzle to implement virgl luminance
formats. Since GL_RED is color renderable this patch allows more
operations to be implemented for virgl luminance formats.
Fixes:
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_fastest
dEQP-GLES2.functional.texture.mipmap.2d.generate.l8_nicest
dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.l8_nicest
dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.2d_luminance
dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_luminance
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.2d_luminance
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_luminance
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>
Ensure we don't blit pixels originating from outside the extents of the
source resource. To achieve this we clip the source blit region, and
update the destination blit region accordingly, while respecting scaled
blits.
This fix will allow us to introduce swizzles for some formats in
upcoming commits, and thus use the GL blitter for them, without
introducing any regressions
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>
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>
Explicitly describe the swizzle of all supported formats in the format
table. In this commit all format swizzles are set to NO_SWIZZLE, but
future commits will update some format/swizzle combinations to improve
support for the corresponding virgl formats.
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>
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>