This adds all the shader program building and dirtying for
tess shaders.
The big change is building the key so that we get the correct
tess input/output blocks.
It might be possible SSO could reduce some of that overheads
v2: fixup warnings
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This adds support for tess factors and tess coord semantics
v2: remove no wm settings for some vars, fix int required for
vertices in, fix tessinner/outer building, handle primid/verticesin
as ints.
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
Just add clip dist support for tess shaders.
v2: drop create_swizzled changes no need at this point
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This takes the tgsi shader properties and emits the correct GLSL
layouts.
It also exports the tes prim and point info to the renderer,
for transform feedback
v2: add prim/point for transform feedback
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This adds the shader key bits, along with a bunch of the
string handling for tess shaders
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
tess will needs this as well
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This name makes more sense if we have output blocks
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This passes the default tessellation factors from the guest to
the host.
v2: fix warnings
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This just adds a flag to say we have tessellation available
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This just cleans the code up so adding more shader types gets easier.
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This pulls in the latest TGSI properties.
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
With tessellation we can have 32 patch varyings on top of the old limit
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This was missing the emit line.
Tested-by: Elie Tournier <elie.tournier@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
This is a basic step towards GL4.0 and greater,
add support for the FP64 extension.
This requires ARB_gpu_shader5 on the host, to
implement ldexp using bitfieldInsert.
v2: drop fp64_srcs into local var
fix imul regression due to rebase
Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
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>
For dual src blending to work we have to link the shader in a certain
way, so we have to dirty the shaders on a new blend state, then
we have to make sure the dual src bit is the same before avoiding
a relink state, otherwise have to relink.
This fixes:
piglit arb_blend_func_extended-fbo-extended-blend
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
v3: Turn check for -Wint-to-pointer-cast into check for
-Werror=int-to-pointer-cast
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
test_virgl_transfer.c: In function »virgl_test_transfer_1d«:
test_virgl_transfer.c:302:19: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < sizeof(data); i++)
^
test_virgl_transfer.c:313:19: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < sizeof(data); i++) {
v2: Correct language of warning messages
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
testvirgl_encode.c: In function »virgl_emit_shader_streamout«:
testvirgl_encode.c:219:21: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < so_info->num_outputs; i++) {
^
testvirgl_encode.c: In function »virgl_encode_clear«:
testvirgl_encode.c:315:4: Warning: Dereferenzing a type-punned
pointer violates strict-aliasing-rules [-Wstrict-aliasing]
virgl_encoder_write_qword(ctx->cbuf, *(uint64_t *)&depth);
^~~~~~~~~~~~~~~~~~~~~~~~~
testvirgl_encode.c: In function »virgl_encoder_set_framebuffer_state«:
testvirgl_encode.c:329:18: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < state->nr_cbufs; i++) {
^
testvirgl_encode.c: In function »virgl_encoder_create_vertex_elements«:
testvirgl_encode.c:362:18: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < num_elements; i++) {
^
testvirgl_encode.c: In function »virgl_encoder_set_vertex_buffers«:
testvirgl_encode.c:377:18: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < num_buffers; i++) {
^
testvirgl_encode.c: In function »virgl_encoder_inline_write«:
testvirgl_encode.c:531:26: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (layer = 0; layer < box->depth; layer++) {
^
testvirgl_encode.c:537:24: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (row = 0; row < box->height; row++) {
^
testvirgl_encode.c: In function »virgl_encoder_flush_frontbuffer«:
testvirgl_encode.c:566:59: Warning: unused parameter »ctx« [-Wunused-
parameter]
int virgl_encoder_flush_frontbuffer(struct virgl_context *ctx,
^~~
testvirgl_encode.c:567:59: Warning: unused parameter »res« [-Wunused-
parameter]
struct virgl_resource *res)
^~~
testvirgl_encode.c: In function »virgl_encode_set_sampler_views«:
testvirgl_encode.c:637:18: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < num_views; i++) {
^
testvirgl_encode.c: In function »virgl_encode_bind_sampler_states«:
testvirgl_encode.c:654:18: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < num_handles; i++)
^
testvirgl_encode.c: In function »virgl_encoder_set_so_targets«:
testvirgl_encode.c:872:18: warning: comparison between signed
and unsigned integer expressions [-Wsign-
compare]
for (i = 0; i < num_targets; i++) {
v2: - use mesa style UNUSED annotation of unused parameters
- correct language of warning messages
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_decode.c: In function »vrend_decode_create_shader«:
vrend_decode.c:92:24: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < so_info.num_outputs; i++) {
^
vrend_decode.c: In function »vrend_decode_set_framebuffer_state«:
vrend_decode.c:139:15: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (length != (2 + nr_cbufs))
^~
vrend_decode.c:145:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < nr_cbufs; i++)
^
vrend_decode.c: In function »vrend_decode_set_viewport_state«:
vrend_decode.c:195:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (v = 0; v < num_viewports; v++) {
^
vrend_decode.c: In function »vrend_decode_set_sampler_views«:
vrend_decode.c:296:19: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
start_slot > (PIPE_MAX_SHADER_SAMPLER_VIEWS - num_samps))
^
vrend_decode.c: In function »vrend_decode_set_scissor_state«:
vrend_decode.c:810:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (s = 0; s < num_scissor; s++) {
^
vrend_decode.c: In function »vrend_decode_set_streamout_targets«:
vrend_decode.c:1064:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (i = 0; i < num_handles; i++)
v2: correct language of warnung messages
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: in function »vrend_renderer_transfer_write_iov«:
vrend_renderer.c:5145:65: warning: comparison between
signed and unsigned integer expressions [-Wsign-compare]
if (res->readback_fb_id == 0 ||
res->readback_fb_level != info->level) {
^~
vrend_renderer.c:5167:86: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
glWindowPos2i(info->box->x, res->y_0_top ? res->base.height0 -
info->box->y : info->box->y);
vrend_renderer.c:5186:76: warning: signed and unsigned type in
conditional expression [-Wsign-compare]
y = invert ? res->base.height0 - info->box->y - info->box-
> height : info->box->y;
vrend_renderer.c: in function »vrend_transfer_send_readpixels«:
vrend_renderer.c:5394:59: warning: comparison between
signed and unsigned integer expressions [-Wsign-
compare]
if (res->readback_fb_id == 0 || res->readback_fb_level != info-
>level || res->readback_fb_z != info->box->z) {
^~
vrend_renderer.c:5394:96: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (res->readback_fb_id == 0 ||
res->readback_fb_level != info->level ||
res->readback_fb_z != info->box->z) {
^~
vrend_renderer.c:5463:18: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (imp != type) {
^~
vrend_renderer.c:5469:18: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (imp != format) {
^~
vrend_renderer.c: in function »vrend_transfer_send_readonly«:
vrend_renderer.c:5510:22: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (res->num_iovs == num_iovs) {
^~
vrend_renderer.c:5511:21: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (i = 0; i < res->num_iovs; i++) {
^
vrend_renderer.c:5502:63: Warnung: unused parameter »ctx« [-Wunused-
parameter]
static int vrend_transfer_send_readonly(struct vrend_context *ctx,
^~~
vrend_renderer.c:5505:75: Warnung: unused parameter »info« [-Wunused-
parameter]
const struct vrend_transfer_info *info)
v2: use mesa style UNUSED define for unused parameter annotation
correct language in some warning messages
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: in function »vrend_renderer_resource_create«:
vrend_renderer.c:4735:35: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c:4745:32: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c:4756:32: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c:4763:32: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (level = 0; level <= args->last_level; level++) {
^~
vrend_renderer.c: in function »read_transfer_data«:
vrend_renderer.c:4893:27: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (h = 0; h < bh; h++) {
^
vrend_renderer.c: in function »write_transfer_data«:
vrend_renderer.c:4936:24: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
for (h = 0; h < bh; h++) {
^
vrend_renderer.c: in function »check_transfer_bounds«:
vrend_renderer.c:4981:28: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (info->box->depth > res->base.array_size)
^
vrend_renderer.c:4983:24: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (info->box->z > res->base.array_size)
^
vrend_renderer.c:4985:43: warning: comparison between
signed and unsigned integer expressions[-Wsign-compare]
if (info->box->z + info->box->depth > res->base.array_size)
v2: Correct language of warnings
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: In Funktion »set_stream_out_varyings«:
vrend_renderer.c:867:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < n_outputs; i++)
^
vrend_renderer.c: In Funktion »vrend_set_framebuffer_state«:
vrend_renderer.c:1636:38: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = ctx->sub->nr_cbufs; i < old_num; i++) {
^
vrend_renderer.c:1652:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < ctx->sub->nr_cbufs; i++) {
^
vrend_renderer.c: In Funktion »vrend_set_viewport_states«:
vrend_renderer.c:1707:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_viewports; i++) {
^
vrend_renderer.c: In Funktion »vrend_create_vertex_elements_state«:
vrend_renderer.c:1778:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_elements; i++) {
^
vrend_renderer.c:1844:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_elements; i++) {
^
vrend_renderer.c: In Funktion »vrend_set_constants«:
rend_renderer.c:1902:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < num_constant; i++)
^
vrend_renderer.c:1887:35: Warnung: unused parameter »index« [-Wunused-
parameter]
uint32_t index,
^~~~~
vrend_renderer.c: In Funktion »vrend_set_num_sampler_views«:
vrend_renderer.c:2118:39: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
if (start_slot + num_sampler_views < ctx->sub-
>views[shader_type].num_views) {
In this case the if-condition enclosing the for loop was removed because
it was superfluous.
v2: Use mesa-style UNUSED for unused parameters
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: In Funktion »vrend_hw_set_zsurf_texture«:
vrend_renderer.c:1516:65: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
first_layer != last_layer ? 0xffffffff :
first_layer);
^
vrend_renderer.c: In Funktion »vrend_hw_set_color_surface«:
vrend_renderer.c:1535:68: Warnung: signed and unsigned type in
conditional expression [-Wsign-compare]
first_layer != last_layer ? 0xffffffff :
first_layer);
^
vrend_renderer.c: In Funktion »vrend_set_framebuffer_state«:
vrend_renderer.c:1618:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < nr_cbufs; i++) {
^
vrend_renderer.c:1666:31: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
if (ctx->sub->fb_height != new_height || ctx->sub-
>inverted_fbo_content != new_ibf) {
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
vrend_renderer.c: In Funktion »vrend_destroy_shader_selector«:
vrend_renderer.c:627:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < sel->sinfo.so_info.num_outputs; i++)
^
vrend_renderer.c: In Funktion »dump_stream_out«:
vrend_renderer.c:776:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < so->num_outputs; i++) {
^
vrend_renderer.c: In Funktion »set_stream_out_varyings«:
vrend_renderer.c:828:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < so->num_outputs; i++) {
^
vrend_renderer.c: In Funktion »vrend_destroy_streamout_object«:
vrend_renderer.c:1130:18: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < obj->num_targets; i++)
^
vrend_renderer.c: In Funktion »vrend_destroy_so_target_object«:
vrend_renderer.c:1200:21: Warnung: Vergleich zwischen
vorzeichenbehafteten und vorzeichenlosen Ganzzahlausdrücken [-Wsign-
compare]
for (i = 0; i < obj->num_targets; i++) {
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
The warning doesn't really add value, because the way the code is
written the fields will be initialized to zero, hence disable the warning
in this file.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
This is required to silence -Wunused-parameter warnings.
v2: - Use mesa-style UNUSED for unused parameters
- Add it it gallium/aux/os_misc.h instead of util/u_debug.h, here it seems
a bit more apropriate
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Multisample fragment operations are part of the OpenGL ES 3.0 spec and
enabling them doesn't required the extensions to be listed explicitly.
Fixes:
dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_alpha_to_coverage
dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_sample_coverage
dEQP-GLES3.functional.multisample.fbo_max_samples.proportionality_sample_coverage_inverted
dEQP-GLES3.functional.multisample.fbo_max_samples.sample_coverage_invert
on an GLES host with GLES >= 3.0.
v2: - Do not set GL_SAMPLE_ALPHA_TO_ONE state when on gles host, because it is
not supported there. This silences a number of according warnings on the
host.
v3: - Properly place if statement to not send GL_SAMPLE_ALPHA_TO_ONE.
- Do not set GL_MULTISAMPLE state when on gles host (same as above).
v4: - fix nitpicks in commit message
v5: - seperate setting of GL_MULTISAMPLE (not available on GLES) and
GL_SAMPLES_TEST
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>