iter_instruction is a big function. Let's make it smaller
by moving some functionality.
v2: In certain cases, FLOAT_BITS_TO_UINT --> FLOAT_BITS_TO_INT (Elie)
Fix commit message
v3: Allow for multiple destinations again.
[airlied: fix missing dtypeprefix->*dtypeprefix regression]
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit uses the get_string() helper to convert various
enums to prefixes / conversion strings.
v2: In certain cases, FLOAT_BITS_TO_UINT --> FLOAT_BITS_TO_INT (Elie)
[airlied: fixup one more incorrect uint->int for interp sample]
Signed-off-by: Dave Airlie <airlied@redhat.com>
This associates the conversions / casts with enums. The idea is
to make conversion into a string the last step in the process.
Signed-off-by: Dave Airlie <airlied@redhat.com>
This makes sure we never accidentally set a lower glsl version
after a higher one (we don't ever, but best to make sure).
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Followup to the previous patch that introduced bit to string table.
Patchset tested using GLES3 dEQP suite.
Reviewed-by: Dave Airlie <airlied@redhat.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>
[addr%d] could in theory be [addr65536] so needs a few more bytes.
Fixes warning:
vrend_shader.c: In function ‘iter_instruction’:
vrend_shader.c:1861:38: warning: ‘%d’ directive writing between 1 and 6 bytes into a region of size 4 [-Wformat-overflow=]
sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
^~
vrend_shader.c:1861:32: note: directive argument in the range [-32768, 32767]
sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
^~~~~~~~~~
vrend_shader.c:1861:13: note: ‘sprintf’ output between 8 and 13 bytes into a destination of size 9
sprintf(arrayname, "[addr%d]", src->DimIndirect.Index);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
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>