The enhanced layout extension allows for gaps in the streamout bindings
so we have to be able to handle no-handles in the middle of the target array.
TGSI also has to deal with components outputs where multiple outputs
can be mentioned in the TGSI. It's safe for use to just skip the
extra outputs at least for the tests I've been able to run.
Once we have those changes in place, the renderer can expose the
new CAP bit to the host without any further host extension checks.
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The extension is already included in this GLSL version and adding it results
in compilation failures.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
In 47387e4 (emit precise keyword), I added code to try to declare
outputs as 'precise' if an instruction flagged as precise wrote to it.
Turns out, redeclaring built-ins as 'precise' isn't allowed, so that bit
was a mistake. And because mesa transforms "invariant" into instructions
with the precise-flag set, we can end up writing to built-ins with the
precise-flag, leading to shaders that doesn't compile correctly.
So let's remove the code that emits the precise-keyword when re-declaring
built-ins.
This fixes a regression in dEQP-GLES2.functional.shaders.algorithm.hsl_to_rgb_vertex
when ran right after dEQP-GLES2.functional.shaders.invariance.highp.subexpression_precision_lowp.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Just like we do for normal GL, we also need to generate the extension
require string for OpenGL ES.
This fixes dEQP-GLES31.functional.blend_equation_advanced.*
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Gert Wollny gert.wollny@collabora.com
Signed-off-by: Dave Airlie <airlied@redhat.com>
ro/wo
Closes: #16
Fixes:
dEQP-GLES31.functional.image_load_store.*.format_reinterpret.*
dEQP-GLES31.functional.image_load_store.*.image_size.writeonly_*
dEQP-GLES31.functional.image_load_store.*.load_store.*
dEQP-GLES31.functional.image_load_store.*.qualifiers.restrict
dEQP-GLES31.functional.image_load_store.*.store.*
v2: remove superfluous check (Erik)
v3: Only emit the writeonly tag for these image formats when on
gles (Erik)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> (v2)
Some extensions that are by default available on GLSL 3.20 ES need to
be enabled when on GLSL 3.10 ES on a as-needed bases.
Closes: #25
Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
The vertex shader always gl_PerVertex, but the tesselation shaders only
define the structure when the point size extension is enabled, otherwise
gl_PointSize is passed as a generic varying and can not be written to.
If one enables the extension based on whether the value gl_PointSize is
actually accessed in the tess shaders then it might happend that tess_ctrl
doesn't touch the value, and the extension isn't enabled, and tess_eval
accesses it and the extension is enabled. In such a case gl_PointSize is
passed as a generic to and from the tess_ctrl shader and linking of the
shaders will fail because of different definitions of gl_PerVertex.
Since in this case there is no indication in the tess_ctrl shader that
point_size is accessed, and it is not known whether the shader will be
linked with a tess_eval shader that uses gl_PointSize the workaround is to
always enable the extension for all tesselation shaders.
Fixes:
dEQP-GLES31.functional.tessellation_geometry_interaction.
point_size.evaluation_set
point_size.vertex_set_control_set
point_size.vertex_set_evaluation_set
point_size.vertex_set_evaluation_set_geometry_default
dEQP-GLES31.functional.primitive_bounding_box.wide_points.
global_state.vertex_tessellation_fragment.
default_framebuffer_bbox_equal
default_framebuffer_bbox_larger
default_framebuffer_bbox_smaller
fbo_bbox_equal
fbo_bbox_larger
fbo_bbox_smaller
dEQP-GLES31.functional.primitive_bounding_box.wide_points.
tessellation_set_per_draw.vertex_tessellation_fragment.
default_framebuffer_bbox_equal
default_framebuffer_bbox_equal
default_framebuffer_bbox_larger
default_framebuffer_bbox_smaller
fbo_bbox_equal
fbo_bbox_larger
fbo_bbox_smaller
tessellation_set_per_primitive.vertex_tessellation_fragment.
default_framebuffer
fragment.fbo
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
GLES 3.1 might support tesselation shaders through the extension, but
this requires the extension to be enabled manually.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(i|u)mulextended require that the all parameters are of the same
signedness. Accordingly create both, the output variabale for MSB and
the (unused) variable for the LSB to be of the same corresponding
signedness. Closes: #17
Fixes:
dEQP-
GLES31.functional.shaders.builtin_functions.integer.imulextended.*
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Certain source regs (GRID_SIZE, THREAD_ID, BLOCK_ID) don't need
to be cast.
Fixes:
dEQP-GLES31.functional.compute.basic.image_atomic_op_local_size_1
dEQP-GLES31.functional.compute.basic.image_atomic_op_local_size_8
dEQP-GLES31.functional.compute.basic.image_barrier_multiple
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Fixes:
tests/spec/arb_gpu_shader5/execution/ubo_array_indexing/vs-mixed-with-const-access.shader_test
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
When using OpenGL ES 3.1, we either need to emit a precision qualifier,
or set a default precision.
Since it's not unthinkable that we'd want to forward lowp/mediump
in the future, let's use the precision qualifier so it's easier
to get this right later on.
This gets rid of a shader compile error.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenGL ES 3.1 only supports writing to a few formats, while it can
read from all of them. So let's make sure we emit readonly, so the
OpenGL driver knows we'll only read.
This avoids a shader-compiler error on OpenGL ES 3.1.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenGL ES 3.1 doesn't support using glUniform1i() for binding
images, so let's use layout qualifiers instead. This should in
theory be slightly more performant as well, as we do less API
calls.
A future improvement would be to also do this on GL 4.2 and later
as well.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We essentially repeat the same code twice here, with a small
variation. Let's factor out the common code into a helper, so we
don't have to keep updating two copies. This is similar to what's
already done for samplers.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
There's no point in copying the two only members out of the struct and
onto the stack. So let's just pass the struct directly.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
In GLES, these need a precision specifier, otherwise we get
compile errors.
This fixes a shader-compile error on OpenGL ES 3.1.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We can emit them during the second pass. Since a load
or store can come before an atomic max or min, we have to
type the memory before we emit instructions.
Reviewed-by: Dave Airlie <airlied@redhat.com>
vrend_shader.c:4400: Warning: Comparison between signed and unsigned integer expressions [-Wsign-compare]
for (i = 0; i < ctx->cfg->max_draw_buffers; i++) {
^
vrend_shader.c:4728:28: Warning: Unused variable »i« [-Wunused-variable]
int start, count, i;
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
When emitting an image array, the code errorously used the loop
counter instead of the image entry for looking up the resource.
The rest of the code uses idx, which seems like the right thing
to do. So let's match that instead.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This is needed to make tests/test_virgl_cmd pass
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This fix all dEQP-GLES31.functional.shaders.builtin_functions.* tests on GLES
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This warning was encountered:
vrend_shader.c:4257:57: warning: ‘i’ may be used uninitialized in this function [-Wmaybe-uninitialized]
(ctx->key->coord_replace & (1 << ctx->inputs[i].sid))) {
Fix this.
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Input/output layout qualifiers used by early depth stencil are
glsl 150 feature.
Fixes on SKL:
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_depth
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_stencil
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_depth_fbo
dEQP-GLES31.functional.image_load_store.early_fragment_tests.early_fragment_tests_stencil_fbo
Signed-off-by: Dave Airlie <airlied@redhat.com>
The TGSI FBFETCH instruction is used for implementing framebuffer-reads
when doing for instance advanced blends. It's used by both
EXT_shader_framebuffer_fetch_non_coherent and
KHR_blend_equation_advanced.
Sadly, libepoxy doesn't yet support the glFramebufferFetchBarrierEXT
function needed to implement this on top of
EXT_shader_framebuffer_fetch_non_coherent itself, so let's just implement
it on top of EXT_shader_framebuffer_fetch instead for now.
This means that we'll have slightly higher requirements for enabling
this functionality than the level of functionality we provide through it.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This mostly consists of adding local memory support, and
support for the compute system values.
The req_local_mem need to be gotten from the guest side
and passed into the shader compile so we can size the
shared memory correctly.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This fixes somes bugs in the existing code and
refactors the sampler array support to more closely
follow the image array code.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
This adds support for the TXQS opcode, and RESQ w channel
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This converts the image related opcodes, and tracks the used
images.
Images need some extensions for extra features:
ES_3_1_compatability is needed for r32f image support
shader_image_size for image size support
v2: image: fix missing emit for atomic,
use a shader req for images extension
extend cas_str - we overflowed this
v2.1: drop extra breaks, use decl last for range check (Tomeu)
v3: add indirect support,
drop pointless debug print (Gert)
use 512 in load path.
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This avois them overflowing when we have long swizzled gl_
which happens more with compute shaders and images
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
TGSI has a different model for precise than GLSL, so we have to mark
all outputs that has gotten an precise operation output to it as
precise.
This only implements part of the 'precise' keyword (still lacking
support on individual operations), but it's enough to pass some dEQP
tests, in particular:
- dEQP-GLES31.functional.tessellation.common_edge.triangles_equal_spacing_precise
- dEQP-GLES31.functional.tessellation.common_edge.triangles_fractional_odd_spacing_precise
- dEQP-GLES31.functional.tessellation.common_edge.triangles_fractional_even_spacing_precise
- dEQP-GLES31.functional.tessellation.common_edge.quads_equal_spacing_precise
- dEQP-GLES31.functional.tessellation.common_edge.quads_fractional_odd_spacing_precise
- dEQP-GLES31.functional.tessellation.common_edge.quads_fractional_even_spacing_precise
v2: flipped ordering of "invariant" and "precise", to avoid compiler
errors if both are emitted.
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This passes the structs into translate_tex and cleans up after.
(Inspired while look at merging some stuff from gles tree)
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>