findLSB, findMSB, and countBits always return a signed integer
Fixes:
dEQP-GLES31.functional.shaders.builtin_functions.uniform.findLSBMinusOne.*
dEQP-GLES31.functional.shaders.builtin_functions.integer.findmsb.*
dEQP-GLES31.functional.shaders.builtin_functions.integer.bitcount.*
Changes resulting from the discussion on mesa-dev with
Roland Schneidegger:
v2: Set values in infer_(src|dst)_type only
v3: Set values in the common infer_type code path, and only add
the source type for UMSB
Signed-off-by: Gert Wollny gert.wollny@collabora.com
Reviewed-by: Dave Airlie <airlied@redhat.com>
Only decorate function as noreturn when DEBUG is not defined, because
when compiled in DEBUG mode the function actually executes an int3 and
may return, fixes:
u_debug.c: In function '_debug_assert_fail':
u_debug.c:309:1: warning: 'noreturn' function does return
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>
tgsi_scan.c:37:0:
tgsi_scan.c: In function 'tgsi_scan_shader':
tgsi_scan.c:212:46: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
assert(src->Register.Index < Elements(info->is_msaa_sampler));
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>
Change the type of util_cpu_caps::nr_cpus to int because sysconfig
returns a signed value, fixes:
u_cpu_detect.c: In function 'util_cpu_detect':
u_cpu_detect.c:317:30: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (util_cpu_caps.nr_cpus == -1)
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>
u_debug_describe.c: In function 'debug_describe_reference':
u_debug_describe.c:33:65: warning: unused parameter 'ptr' [-Wunused-
parameter]
debug_describe_reference(char* buf, const struct pipe_reference*ptr)
u_format.c: In function 'util_format_is_float':
u_format.c:57:10: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i == -1) {
v2: Replace VREND_UNUSED by UNUSED (Erik)
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>
tgsi_ureg.c: In function 'ureg_DECL_sampler':
tgsi_ureg.c:601:34: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->sampler[i].Index == nr)
^~
tgsi_ureg.c: In function 'validate':
tgsi_ureg.c:908:32: warning: unused parameter 'opcode' [-Wunused-
parameter]
static void validate( unsigned opcode,
^~~~~~
tgsi_ureg.c:909:32: warning: unused parameter 'nr_dst' [-Wunused-
parameter]
unsigned nr_dst,
^~~~~~
tgsi_ureg.c:910:32: warning: unused parameter 'nr_src' [-Wunused-
parameter]
unsigned nr_src )
^~~~~~
tgsi_ureg.c: In function 'emit_decls':
tgsi_ureg.c:1335:31: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->properties[i] != ~0)
^~
tgsi_ureg.c: In function 'ureg_create':
tgsi_ureg.c:1594:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(ureg->properties); i++)
^
v2: Replace VREND_UNUSED by UNUSED (Erik)
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>
tgsi_ureg.c: In function 'ureg_DECL_sampler':
tgsi_ureg.c:601:34: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->sampler[i].Index == nr)
^~
tgsi_ureg.c: In function 'validate':
tgsi/tgsi_ureg.c:908:32: warning: unused parameter 'opcode' [-Wunused-
parameter]
static void validate( unsigned opcode,
^~~~~~
tgsi_ureg.c:909:32: warning: unused parameter 'nr_dst' [-Wunused-
parameter]
unsigned nr_dst,
^~~~~~
tgsi_ureg.c:910:32: warning: unused parameter 'nr_src' [-Wunused-
parameter]
unsigned nr_src )
^~~~~~
tgsi_ureg.c: In function 'emit_decls':
tgsi_ureg.c:1335:31: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ureg->properties[i] != ~0)
^~
tgsi_ureg.c: In function 'ureg_create':
tgsi_ureg.c:1594:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < ARRAY_SIZE(ureg->properties); i++)
^
CC tgsi/tgsi_util.lo
tgsi_util.c: In function 'tgsi_util_get_full_src_register_sign_mode':
tgsi_util.c:109:13: warning: unused parameter 'component' [-Wunused-
parameter]
unsigned component )
^~~~~~~~~
v2: Eliminate use of VREND_UNUSED (Erik)
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>
_surface.c: In function 'util_copy_rect':
u_surface.c:101:37: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (width == dst_stride && width == src_stride)
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>
In function 'parse_identifier':
tgsi_text.c:190:16: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i == len - 1)
^~
tgsi_text.c: In function 'parse_optional_swizzle':
tgsi_text.c:816:21: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < components; i++) {
^
tgsi_text.c: In function 'parse_instruction':
tgsi_text.c:1025:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < info->num_dst + info->num_src + info->is_tex; i++) {
^
tgsi_text.c:1040:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
else if (i < info->num_dst + info->num_src) {
^
tgsi_text.c: In function 'parse_immediate':
tgsi/tgsi_text.c:1525:24: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
for (type = 0; type < Elements(tgsi_immediate_type_names); ++type) {
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>
tgsi_sanity.c: In function 'iter_instruction':
tgsi_sanity.c:316:29: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ctx->index_of_END != ~0) {
^~
tgsi_sanity.c: In function 'epilog':
tgsi_sanity.c:488:26: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (ctx->index_of_END == ~0) {
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>
tgsi_parse.c: In function 'tgsi_parse_free':
tgsi_parse.c:54:31: warning: unused parameter 'ctx' [-Wunused-parameter]
struct tgsi_parse_context *ctx )
^~~
tgsi_parse.c: In function 'tgsi_parse_end_of_tokens':
tgsi_parse.c:62:25: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
return ctx->Position >=
v2: Replace VREND_UNUSED by UNUSED (Erik)
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>
tgsi_dump.c: In function 'iter_property':
tgsi_dump.c:443:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for (i = 0; i < prop->Property.NrTokens - 1; ++i) {
^
tgsi_dump.c:459:13: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
if (i < prop->Property.NrTokens - 2)
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>
/tgsi_build.c: In function 'tgsi_build_full_immediate':
tgsi_build.c:599:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for( i = 0; i < full_imm->Immediate.NrTokens - 1; i++ ) {
^
tgsi_build.c: In function 'tgsi_build_instruction_label':
tgsi_build.c:689:24: warning: unused parameter 'prev_token' [-Wunused-
parameter]
struct tgsi_token *prev_token,
^~~~~~~~~~
tgsi_build.c: In function 'tgsi_build_instruction_texture':
tgsi_build.c:720:23: warning: unused parameter 'prev_token' [-Wunused-
parameter]
struct tgsi_token *prev_token,
^~~~~~~~~~
tgsi_build.c: In function 'tgsi_build_texture_offset':
tgsi_build.c:755:23: warning: unused parameter 'prev_token' [-Wunused-
parameter]
struct tgsi_token *prev_token,
^~~~~~~~~~
tgsi_build.c: In function 'tgsi_build_full_property':
tgsi_build.c:1307:18: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]
for( i = 0; i < full_prop->Property.NrTokens - 1; i++ ) {
v2: remove the unused prev_token (in sync with mesa)
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>
This adds the texture barrier support for the texture barriers,
a separate patch would be needed to implement the framebuffer fetch
barriers.
Reviewed-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
[cherry-picked from mesa 1393999541f3956156bf227209ecbf6d814ffc8f]
Signed-off-by: Dave Airlie <airlied@redhat.com>
GL4.2/GLES3.1 adds glMemoryBarrier so make sure we can handle it.
v2: add a cap bit for this for guest
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
This just brings over some defines from the gallium codebase.
Co-authors: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
v2: use str_match_no_case to fix _SAT_PRECISE detection
v4: usd is_digit_alpha_underscore to match end of mods
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
[cherry-picked from 4611343bcc05c75bcc9697243dabbb083f7078de in mesa]
Signed-off-by: Dave Airlie <airlied@redhat.com>
Only implemented for glsl->tgsi. Other converters just set precise to 0.
v2: remove precise paramter from ureg_tex_insn and ureg_memory_insn
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
[cherry-picked from d0dfdf704d6ef974a3bbac826cfd7e511e918f4b in mesa]
Signed-off-by: Dave Airlie <airlied@redhat.com>
This just pulls in a bunch of TGSI changes from upstream
that make adding GLES3.1 features easier.
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
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>
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>
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>
and make sure that on GLES it it chosen for GL_RGBA4 over
VIRGL_FORMAT_B4G4R4A4_UNORM, by removing support for the latter.
This is needed because on GLES3 GL_BGRA isn't a supported format to pass
to glTexImage3D.
Fixes the test dEQP-GLES3.functional.texture.format.sized.3d.rgba4_pot
on GLES hosts.
v2: * Make more explicit the GL/GLES split (Gert Wollny)
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Suggested-by: Jakob Bornecrantz <jakob@collabora.com>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
Tested-by: Jakob Bornecrantz <jakob@collabora.com>
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>
This is needed for fixing CTS:
dEQP-GLES3.functional.occlusion_query.conservative*
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Gert Wollny <gert.wollny@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>
Introduce the VIRGL_FORMAT_R10G10B10{A2,X2}_UNORM formats and add
support for them in the renderer.
Fixes:
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_unsigned_int_2_10_10_10_rev
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgba_unsigned_int_2_10_10_10_rev
v2:
Also update cvs file with newly added format.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.com>
Update p_format.h to bring in new formats, which will be used (in their
VIRGL_FORMAT form) in upcoming commits.
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Signed-off-by: Jakob Bornecrantz <jakob@collabora.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>
These are needed for ARB_draw_indirect and GL4.0
This enables support and turns in the cap when
support is present.
This also enhances the draw packets to cover
future features, it doesn't enable or show these
yet, since other work is required in the shaders.
Signed-off-by: Dave Airlie <airlied@redhat.com>
When parsing texture instruction, it doesn't stop if the
'cur' is ',', the loop variable 'i' will also be increased
and be used to index the 'inst.TexOffsets' array. This can lead
an oob access issue. This patch avoid this.
Signed-off-by: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>