Commit Graph

96252 Commits

Author SHA1 Message Date
Wladimir J. van der Laan a2132fbd79 etnaviv: Fix point sprite rendering on GC3000
Setting PA_VIEWPORT_UNK state correctly is necessary to make point sprite
rendering on GC3000 work.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-10-03 19:51:52 +02:00
Wladimir J. van der Laan ec254f4bfa etnaviv: Add support for DP2 instruction
A two-component dot product instruction is supported with HALTI2, use it
on hardware that supports it.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-10-03 19:49:47 +02:00
Wladimir J. van der Laan 80f608b530 etnaviv: Support opcodes with bit 6 set in assembler
Support opcodes with bit 6 set in assembler, and assert that only ops
0x00..0x7f are used.

Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2017-10-03 19:49:38 +02:00
Dylan Baker df82012b2c travis: add meson build for vulkan drivers.
v2: - use -isystem`pwd` instead of cp to include fake linux header
      (Eric E., Emil)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-03 10:02:08 -07:00
Dylan Baker 7a5a986ddd meson: convert gtest to an internal dependency
In truth gtest is an external dependency that upstream expects you to
"vendor" into your own tree. As such, it makes sense to treat it more
like a dependency than an internal library, and collect it's
requirements together in a dependency object.

v2: - include with -isystem instead of setting compiler args (Eric)

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-03 10:02:08 -07:00
Dylan Baker 052c0d5eda meson: set C++ standard to C++11
RadeonSI requires C++11, clover requires C++11, LLVM requires it, so
llvmpipe may require it, and that covers most of the C++ code in mesa.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-03 10:02:04 -07:00
Dylan Baker af867d72c6 meson: add window system deps to intel vulkan common
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-03 10:01:45 -07:00
Dylan Baker cc4f587307 meson: look for libelf as a library if there is no pkgconfig
Required for older versions of libelf that don't have a pkgconfig file.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-10-03 10:01:45 -07:00
Gurchetan Singh 9d9a46d4ef egl/surfaceless: Use KMS swrast fallback
The kms_swrast extension is an actively developed software fallback,
and platform_surfaceless can use it if there are no available
hardware drivers.

v2: Split into 2 patches, use booleans, check LIBGL_ALWAYS_SOFTWARE,
    and modify the eglLog level (Emil, Eric, Tomasz).

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-03 17:56:15 +01:00
Gurchetan Singh 540c804297 egl/surfaceless: add probe device helper function
This will help us initialize a software driver, if it's needed
or requested.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-03 17:56:15 +01:00
George Kyriazis a8e4a0f609 gallium/u_tests: fix ifdef for sync_file fences
include libsync.h only when libdrm is compiled in

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2017-10-03 11:50:48 -05:00
Brian Paul 2d4b57fc3e util: include stdlib.h in u_string.h to silence MinGW warning
Otherwise we don't get a prototype for malloc().

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2017-10-03 10:15:03 +01:00
Kenneth Graunke bf15dc7a1b intel: Always set Cube Face Enables for all surfaces.
These shouldn't matter for non-cubes, and we always enable them all
for cubes, so we may as well set them all the time.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-03 00:06:34 -07:00
Kenneth Graunke 45cf049ba6 intel: Make Cube Face Enable fields consistent across generations.
I decided to use the one-boolean-per-cube-face approach because it's
clearer which bits correspond to which cube face.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-03 00:06:34 -07:00
Matt Turner d400348c73 docs: Document that libtxc_dxtn is now no longer needed 2017-10-02 22:32:59 -07:00
Matt Turner e057cda2ef docs: GL_ARB_indirect_parameters is now supported on i965/gen7+ 2017-10-02 22:32:59 -07:00
Matt Turner 40ef8362e5 travis: Remove libtxc_dxtn from the build
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 74b5568978 build: Remove HAVE_DLOPEN
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 8d02abd0fe mesa: Delete now unused dlopen.h
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner c17c47207b mesa: Remove force_s3tc_enable driconf variable
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner dc546a7bb3 gallium: Remove util_format_s3tc_init()
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 3a8a5e77e8 gallium: Remove util_format_s3tc_enabled
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner f6c56e07fc mesa/st: Drop has_lib_dxtc argument from st_init_extensions()
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner c5d5080284 mesa: Drop Mesa_DXTn from gl_context
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 78c6221f18 mesa: Drop function pointer checks in s3tc code
Now never null!

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 34cf3c43be mesa: Call DXTn functions directly
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner fb5338c4b7 mesa: Remove fprintf referring to libdxtn
When this file is included by Gallium, the fprintf causes it to fail to
compile. This is an unreachable error case, and we shouldn't be calling
fprintf directly.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 82c54c4fdc mesa: Remove prototypes and mark S3TC functions static
This file will be #included, so the functions should be static.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 7ce9999166 mesa: Remove commented-out DXTn fetch code
Has been disabled for 12 years.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner f7daa737d1 mesa: Combine libtxc_dxtn sources into texcompress_s3tc_tmp.h
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Matt Turner 04396a134f mesa: Import libtxc_dxtn sources
Imported from master (commit ef07298391c6dcad843e0b13e985090c1dd76e76)
of https://cgit.freedesktop.org/~mareko/libtxc_dxtn/

Acked-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
2017-10-02 19:41:22 -07:00
Józef Kucia 14555d0b7a anv: Remove unreachable cases from isl_format_for_size()
The dstOffset and fillSize parameters must be multiple of 4.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "17.1 17.2" <mesa-stable@lists.freedesktop.org>
2017-10-03 00:43:06 +01:00
Józef Kucia 15fdbf9c39 anv: Fix vkCmdFillBuffer()
The vkCmdFillBuffer() command fills a buffer with an uint32_t value.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "17.1 17.2" <mesa-stable@lists.freedesktop.org>
2017-10-03 00:42:50 +01:00
Marek Olšák 2d62817da9 st/mesa: don't use pipe_surface for passing information about EGLImage
Use st_egl_image instead. radeonsi doesn't like when we create
a pipe_surface with PIPE_FORMAT_NV12.

This fixes NV12 texturing on radeonsi using kmscube.

Cc: 17.1 17.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-03 01:27:18 +02:00
Marek Olšák d50ead53b8 gallium/u_tests: test sync_file fences
This should be sufficient for testing all kernel/libdrm/radeonsi codepaths
that are used by radeonsi.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
2017-10-03 01:27:18 +02:00
Plamena Manolova 598d613dc3 i965: Implement ARB_indirect_parameters.
We can implement ARB_indirect_parameters for i965 by
taking advantage of the conditional rendering mechanism.
This works by issuing maxdrawcount draw calls and using
conditional rendering to predicate each of them with
"drawcount > gl_DrawID"

Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-02 16:25:36 -07:00
Plamena Manolova 3fb8483565 i965: Refactor brw_try_draw_prims.
In order to add our ARB_indirect_parameters implementation we
need to refactor brw_try_draw_prims so that it operates on a
per primitive basis and move the loop into brw_draw_prims.
This commit refactors the brw_try_draw_prims function and
renames it to brw_draw_single_prim.

Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-02 16:25:36 -07:00
Plamena Manolova 646e112385 i965: Indroduce brw_finish_drawing.
In order to add our ARB_indirect_parameters implementation we
need to refactor brw_try_draw_prims so that it operates on a
per primitive basis and move the loop into brw_draw_prims.
This commit introduces the brw_finish_drawing function where
we move the code that executes once after the loop.

Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-02 16:25:36 -07:00
Plamena Manolova c63c8f5135 i965: Introduce brw_prepare_drawing.
In order to add our ARB_indirect_parameters implementation we
need to refactor brw_try_draw_prims so that it operates on a
per primitive basis and move the loop into brw_draw_prims.
This commit introduces the brw_prepare_drawing function where
we move the code that executes once before the loop.

Signed-off-by: Plamena Manolova <plamena.manolova@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-02 16:25:36 -07:00
Ian Romanick 765e1fa372 glsl: Remove spurious assertions
It's inside an if-statement that already checks that the variables are
not NULL.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:11 -07:00
Ian Romanick ff5254bf08 glsl: Move 'foo = foo;' optimization to opt_dead_code_local
The optimization as done in opt_copy_propagation would have to be
removed in the next patch.  If we just eliminate that optimization
altogether, shader-db results, even on platforms that use NIR, are hurt
quite substantially.  I have not investigated why NIR isn't picking up
the slack here.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
2017-10-02 14:46:11 -07:00
Ian Romanick 623002f0b2 glsl/ast: Use logical-or instead of conditional assignment to set fallthru_var
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:11 -07:00
Ian Romanick d5361d9f01 glsl/ast: Generate a more compact expression to disable execution of default case
Instead of generating a sequence like:

    run_default = true;
    if (i == 3) // some label that appears after default
        run_default = false;
    if (i == 4) // some label that appears after default
        run_default = false;
    ...
    if (run_default) {
        ...
    }

generate something like:

    run_default = !((i == 3) || (i == 4) || ...);
    if (run_default) {
        ...
    }

This eliminates one use of conditional assignment, and it enables the
elimination of another.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:10 -07:00
Ian Romanick 3e5cd2aba9 glsl/ast: Explicitly track the set of case labels that occur after default
Previously the instruction stream was walked looking for comparisons
with case-label values.  This should generate nearly identical code.
For at least fs-default-notlast-fallthrough.shader_test, the code is
identical.

This change will make later changes possible.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:10 -07:00
Ian Romanick f307de2838 glsl/ast: Convert ast_case_label::hir to ir_builder
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:10 -07:00
Ian Romanick 4a8086c5a5 glsl/ast: Use ir_binop_equal instead of ir_binop_all_equal
The values being compared are scalars, so these are the same.  While
I'm here, simplify the run_default condition to just deref the flag
(instead of comparing a scalar bool with true).

There is a bit of extra change in this patch.  When constructing an
ir_binop_equal ir_expression, there is an assertion that the types are
the same.  There is no such assertion for ir_binop_all_equal, so
passing glsl_type::uint_type with glsl_type::int_type was previously
fine.  A bunch of the code motion is to deal with that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:10 -07:00
Ian Romanick ed80746c1c glsl/ast: Stop processing a switch-statement after an error in the init-expression
This happens to work now because ir_binop_all_equal is used.  This
causes vector typed init-expressions to produce scalar Boolean values
after comparison.

The next commit changes ir_binop_all_equal to ir_binop_equal.  Vector
typed init-expressions will then produce vector Boolean values, and, in
debug builds, the ir_assignment constructor will fail an assertion.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:02 -07:00
Ian Romanick 6d1765c63a glsl: Don't pass NULL to ir_assignment constructor when not necessary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:02 -07:00
Ian Romanick 3cc997c7c8 glsl: Convert lower_variable_index_to_cond_assign to ir_builder
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2017-10-02 14:46:02 -07:00
Ian Romanick eb58668525 glsl: Fix coding standards issues in lower_variable_index_to_cond_assign
Mostly tabs-before-spaces, but there was some other trivium too.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
2017-10-02 14:46:02 -07:00