Some shaders seem to set this flag when dual-src is enabled,
we don't want to trash the cbuf1 write in that case.
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
This just cleans this out to a separate fn
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Update the GL blit code to emit correct shaders when integer color
formats are involved.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
iter_instruction is a big function. Let's make it smaller
by moving some functionality.
v2: Fix comment
v3: Four sources again
Signed-off-by: Dave Airlie <airlied@redhat.com>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>