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>
OpenGL ES don't support 1D texture.
So we replace these textures by some 2D texture with one of
the component set to 0.5
v2: Use new use_gles state on vrend_shader_cfg.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Some features:
* Always use the "#version 300 es" header
* Set high precision by default
* Do not use noperspective attribute
v2: Do not create a global state but instead add field
vrend_shader_cfg and send that into more functions.
Signed-off-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Refactors vertex/fragment shader exit routine. Handles all end points properly.
Fixes dEQP-GLES2.functional.shaders.return.output_write_dynamic_vertex test.
[airlied: cleanup damaged whitespace + remove old geom lines of no use]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Previously, vrend_shader insterted a scale & bias to emulate
glDepthRange in all vertex shaders. This approach will fail
to match the gl spec in some situations. glDepthRange() is also
called, causing the transformation to be applied twice. The
winsys_adjust uniform is now a scalar to implement the y-flip only.
This bug was discovered and tested using the
dEQP-GLES2.functional.depth_range test suite. This test now passes
all but one case, which appears to be a separate issue.
Signed-off-by: Joe M. Kniss <djmk@google.com>
[airlied: fixes some piglit tests as well - no regressions]
Signed-off-by: Dave Airlie <airlied@redhat.com>
This just adds backend conversion support for the extended
texture gather instructions used for arb_gpu_shader5.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Another requirement for GL4.0 is support for ARB_sample_shading.
This enables it and turns on the cap when needed.
Signed-off-by: Dave Airlie <airlied@redhat.com>
The benchmark fails to start, the translation of gl_Identity is incorrect,
UMAD TEMP[0], SV[0].xxxx, TEMP[0].xxxx, TEMP[1]
is translated to:
temp0[0] = vec4(uintBitsToFloat((gl_InstanceID * floatBitsToUint(temp0[0].xxxx) + floatBitsToUint(temp0[1]))));
Which results in the following error:
shader failed to compile
0:23(34): error: could not implicitly convert operands to arithmetic operator
0:23(34): error: operands to arithmetic operators must be numeric
0:23(17): error: no matching function for call to `uintBitsToFloat(error)'; candidates are:
It seems we can use the same workaround as gl_VertexID, I didn't
observe any regression running various gl_InstanceId tests from
piglit:
temp0[0] = vec4(uintBitsToFloat((floatBitsToUint(vec4(intBitsToFloat(gl_InstanceID))) * floatBitsToUint(temp0[0].xxxx) + floatBitsToUint(temp0[1]))));
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Some piglit tests read/write outside of fix-sized arrays. Return an
error in this case. Note: further investigation needed to avoid
such access in the first place.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
We weren't converting integer sampler results correctly,
so bad things ensued, this uses the info in the sampler
view to recreate the proper return values and do the
correct casting.
We are seeing shaders with 0 and 2 inputs, but no 1, so we need
to handle gaps properly.
This fixes some regressions in drawpixels after some mesa changes
on the guest.
TXQ may query levels and size.
Fixes all piglit texturesize tests and others.
[airlied: use EMIT_BUF_WITH_RET].
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Commit 53286c6f5a introduced a regression, there is a missing break in the switch..
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Create a bunch of temp arrays based on the input TGSI
ranges. Otherwise the temps code triggers a lack of
some passes in the mesa GLSL compiler.
A large shader from shadertoy triggered 1m30s compile in mesa
due to the large temp array.
Reported-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This updates the tgsi code from mesa, it introduces
changes necessary to deal with tessellation and doubles.
It also drops an unused saturate feature, which we didn't
use anyways.
I'm not sure this is 100% complete, piglit fbo-alpha now passes.
This was a guess as to why gnome-shell was broken, but I don't think
it was the correct one.
the scaling stuff needs to happen in the geom shader instead
of the vertex shader if a geom shader is present.
fixes: tests/spec/glsl-1.50/execution/geometry/core-inputs.shader_test
this fixes:
tests/spec/glsl-1.50/execution/geometry/clip-distance-itemized-copy.shader_test
tests/spec/glsl-1.50/execution/geometry/clip-distance-bulk-copy.shader_test