Commit Graph

73401 Commits

Author SHA1 Message Date
Samuel Pitoiset 7129cbf5f4 nvc0: move HW SM queries to nvc0_query_hw_sm.c/h files
Global performance counters (PCOUNTER) will be added to
nvc0_query_hw_pm.c/h files.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2015-10-09 14:09:57 +02:00
Samuel Pitoiset 224fec05ea nvc0: move HW queries to nvc0_query_hw.c/h files
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2015-10-09 14:09:57 +02:00
Samuel Pitoiset 77b6990d14 nvc0: move SW queries to nvc0_query_sw.c/h files
Loosely based on freedreno driver.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2015-10-09 14:09:57 +02:00
Samuel Pitoiset 0678530b9e nvc0: move nvc0_so_target_save_offset() to its correct location
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2015-10-09 14:09:57 +02:00
Samuel Pitoiset 0644196ab1 nvc0: add a header file for nvc0_query
This will allow to split SW and HW queries in an upcoming patch.

While we are at it, make use of nvc0_query struct instead of pipe_query.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2015-10-09 14:09:57 +02:00
Samuel Iglesias Gonsalvez 3da58730ee main: fix length of values written to glGetProgramResourceiv() for ACTIVE_VARIABLES
Return the number of values written.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2015-10-09 08:13:55 +02:00
Samuel Iglesias Gonsalvez d0992fa15a main: buffer array variables can have array size of 0 if they are unsized
From ARB_program_query_interface:

  For the property ARRAY_SIZE, a single integer identifying the number of
  active array elements of an active variable is written to <params>. The
  array size returned is in units of the type associated with the property
  TYPE. For active variables not corresponding to an array of basic types,
  the value one is written to <params>. If the variable is a shader
  storage block member in an array with no declared size, the value zero
  is written to <params>.

v2:
- Unsized arrays of arrays have an array size different than zero

v3:
- Arrays and unsized arrays will have an array_stride > 0. Use it
  instead of is_unsized_array flag (Timothy).

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2015-10-09 08:13:55 +02:00
Samuel Iglesias Gonsalvez 66ca8e6632 main: consider that unsized arrays have at least one active element
From ARB_shader_storage_buffer_object:

"When using the ARB_program_interface_query extension to enumerate the
 set of active buffer variables, only the first element of arrays (sized
 or unsized) will be enumerated"

_mesa_program_resource_array_size() is used when getting the name (and
name length) of the active variables. When it is an unsized array,
we want to indicate it has one active element so the returned name
would have "[0]" at the end.

v2:
- Use array_stride > 0 and array_elements == 0 to detect unsized
  arrays. Because of that, we don't need is_unsized_array flag
  (Timothy)

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
2015-10-09 08:13:55 +02:00
Samuel Iglesias Gonsalvez 77c0b64ce3 main: fix TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE
When the active variable is an array which is already a top-level
shader storage block member, don't return its array size and stride
when querying TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE
respectively.

Fixes the following 12 dEQP-GLES31 tests:

dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.row_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.column_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.row_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.column_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.row_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.column_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat3x4
dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.column_major_mat3x4

v2:
- Fix check when the shader storage block is instanced
- Write auxiliary function to do the check.

v3:
- Check if full_instanced_name is NULL just after allocation (Ilia)
- Remove () from one strcmp() in the if statement (Ilia)

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Tested-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-10-09 08:13:49 +02:00
Samuel Iglesias Gonsalvez 5be9bf2746 main: fix goto in program_resource_top_level_array_stride
Use found_top_level_array_stride instead of found_top_level_array_size.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-10-09 08:12:10 +02:00
Tapani Pälli d8d0e4a81e mesa: add GL_UNSIGNED_INT_24_8 to _mesa_pack_depth_span
Patch adds missing type (used with NV_read_depth) so that it gets
handled correctly. This fixes errors seen with following CTS test:

   ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
2015-10-09 09:11:14 +03:00
Brian Paul 7d7dd18711 mesa,meta: move gl_texture_object::TargetIndex initializations
Before, we were unconditionally assigning the TargetIndex field in
_mesa_BindTexture(), even if it was already set properly.  Now we
initialize TargetIndex wherever we initialize the Target field, in
_mesa_initialize_texture_object(), finish_texture_init(), etc.

v2: also update the meta_copy_image code.  In make_view() the
view_tex_obj->Target field was set, but not the TargetIndex field.
Also, remove a second, redundant assignment to view_tex_obj->Target.
Add sanity check assertions too.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
2015-10-08 13:53:33 -06:00
Brian Paul d61f492aba mesa: remove unused _mesa_create_nameless_texture()
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
2015-10-08 13:53:33 -06:00
Brian Paul b373c77693 mesa: remove unneeded error check in create_textures()
Callers of create_texture() will either pass target=0 or a validated
GL texture target enum so no need to do another error check inside
the loop.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
2015-10-08 13:53:33 -06:00
Kristian Høgsberg Kristensen c71f0d45e6 i965: Link compiler unit tests to libi965_compiler.la
We can now link the unit tests against just libi965_compiler.la. This
lets us drop a lot of DRI driver dependencies, but we still pull in all
of libmesa and more.

This also provides a few standalone users of libi965_compiler.la, which
will help us accidentally using i965_dri.so functions from the compiler.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen 08d890d3bb i965: Break out backend compiler to its own library
This introduces a new libtool helper library, libi965_compiler.la.  This
library is moderately self-contained, but still needs to link to all of
libmesa.la among other things.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen 9a2573e5fc i965/cs: Get max_cs_threads from brw_compiler devinfo
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen ee0f0108c8 i965: Move brw_get_shader_time_index() call out of emit functions
brw_get_shader_time_index() is all tangled up in brw_context state and
we can't call it from the compiler. Thanks the Jasons recent
refactoring, we can just get the index and pass to the emit functions
instead.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen ffc841cae5 i965: Move brw_select_clip_planes() to brw_shader.cpp
We call this from the compiler so move it to brw_shader.cpp.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen 365e5d7892 i965: Use util_next_power_of_two() for brw_get_scratch_size()
This function computes the next power of two, but at least 1024. We can
do that by bitwise or'ing in 1023 and calling util_next_power_of_two().

We use brw_get_scratch_size() from the compiler so we need it out of
brw_program.c. We could move it to brw_shader.cpp, but let's make it a
small inline function instead.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen cc4683992b i965: Move brw_mark_surface_used() to brw_shader.cpp
brw_program.c won't be part of the compiler library, but we need
brw_mark_surface_used() in the compiler. Move to brw_shader.cpp.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:03 -07:00
Kristian Høgsberg Kristensen 469d0e449b i965/cs: Split out helper for building local id payload
The initial motivation for this patch was to avoid calling
brw_cs_prog_local_id_payload_dwords() in gen7_cs_state.c from the
compiler. This commit ends up refactoring things a bit more so as to
split out the logic to build the local id payload to brw_fs.cpp. This
moves the payload building closer to the compiler code that uses the
payload layout and makes it available to other users of the compiler.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:15:02 -07:00
Kristian Høgsberg Kristensen 4f33700f5a i965: Move brw_link_shader() and friends to new file brw_link.cpp
We want to use the rest of brw_shader.cpp with the rest of the compiler
without pulling in the GLSL linking code.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:14:44 -07:00
Kristian Høgsberg Kristensen 99ca2256c1 i965: Configure bufmgr debug options from intel_screen.c
We need the debug flag parsing and INTEL_DEBUG in the compiler, but we
don't want the dependency on bufmgr (libdrm_intel) in there. Move to
intel_screen.c.

There are now only two lines left in brw_process_intel_debug_variable(),
but we keep it in intel_debug.h to avoid having to expose
'debug_control' as a global variable.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:13:31 -07:00
Kristian Høgsberg Kristensen 04158fb0f6 util: Move DRI parse_debug_string() to util
We want to use intel_debug.c in code that doesn't link to dri common.

v2: Remove unnecessary stddef.h include (Topi), use util/debug.h
    in all DRI driver and remove driParseDebugString() (Iago).

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:13:31 -07:00
Kristian Høgsberg Kristensen ba71d581ae i965: Move brw_dump_ir() out of brw_*_emit() functions
We move these calls one level up into the codegen functions.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
2015-10-08 12:13:31 -07:00
Emil Velikov 1fda56cdb2 gallium/ddebug: add missing dd_util.h to sources list
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2015-10-08 18:13:24 +01:00
Emil Velikov 62741ff052 gallium/ddebug: automake: sort sources alphabetically
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2015-10-08 18:13:24 +01:00
Jason Ekstrand 9c528f5dfa nir/sweep: Reparent the shader name
Previously the name of the nir shader was being freed prematurely during
nir_sweep. Since 756613ed35 the name was later being used to generate
filenames for the optimiser debug output and these would end up with
garbage from the dangling pointer.

Co-authored-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2015-10-08 08:20:31 -07:00
Jan Vesely c8031a879a c11/threads: initialize timeout structure
Signed-off-by: Jan Vesely <jano.vesely@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-10-08 14:05:57 +01:00
Boyan Ding 89ae41ab4c docs/relnotes: document EGL_KHR_create_context on llvmpipe and softpipe
Signed-off-by: Boyan Ding <boyan.j.ding@gmail.com>
2015-10-08 14:05:36 +01:00
Iago Toral Quiroga 1efbb8151b i965/gs/gen6: Maximum allowed size of SEND messages is 15 (4 bits)
Comit d48ac93066 addressed this for VS, but we forgot to do the same for
URB writes generated by the gen6 GS.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-08 11:28:16 +02:00
Iago Toral Quiroga 3141906fa3 i965: Define FIRST_SPILL_MRF and FIRST_PULL_LOAD_MRF only once and in one place
That should make tracking where we do spills and pull loads a bit easier.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-08 11:28:16 +02:00
Iago Toral Quiroga 36e82b137d i965: make pull constant loads in gen6 start at MRFs 16/17
So they do not conflict with our (un)spills (MRF 21..23) or our
URB writes (MRF 1..15)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-08 11:28:16 +02:00
Iago Toral Quiroga 0c2add7751 i965: Fix remove_duplicate_mrf_writes so it can handle 24 MRFs in gen6
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-10-08 11:28:16 +02:00
Tapani Pälli aee28a0aa3 mesa: include bad type in error string of _mesa_pack_depth_span
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-10-08 09:25:16 +03:00
Tapani Pälli 4e7fd66cf0 glsl: add varyings to resource list only with SSO
Varyings can be considered inputs or outputs of a program only when
SSO is in use. With multi-stage programs, inputs contain only inputs
for first stage and outputs contains outputs of the final shader stage.

I've tested that fix works for Assault Android Cactus (demo version)
and does not cause Piglit or CTS regressions in glGetProgramiv tests.

Following ES 3.1 CTS separate shader tests that do query properties
of varyings in SSO shader programs pass:

   ES31-CTS.program_interface_query.separate-programs-vertex
   ES31-CTS.program_interface_query.separate-programs-fragment

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92122
2015-10-08 07:43:11 +03:00
Jason Ekstrand 6ad9ebb073 mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks
The EXT_texture_format_BGRA8888 extension (which mesa supports
unconditionally) adds a new format and internal format called GL_BGRA_EXT.
Previously, this was not really handled at all in
_mesa_ex3_error_check_format_and_type.  When the checks were tightened in
commit f15a7f3c, we accidentally tightened things too far and GL_BGRA_EXT
would always cause an error to be thrown.

There were two primary issues here.  First, is that
_mesa_es3_effective_internal_format_for_format_and_type didn't handle the
GL_BGRA_EXT format.  Second is that it blindly uses _mesa_base_tex_format
which returns GL_RGBA for GL_BGRA_EXT.  This commit fixes both of these
issues as well as adds explicit checks that GL_BGRA_EXT is only ever used
with GL_BGRA_EXT and GL_UNSIGNED_BYTE.

Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "11.0" <mesa-stable@lists.freedesktop.org>
2015-10-07 20:32:53 -07:00
Emil Velikov bbf728f11b Revert "mesa: enable KHR_debug for ES contexts"
This reverts commit b69cfbdf18.

This isn't quite baked yet. Seems that despite building the ES piglits,
none of them got executed.
2015-10-07 21:49:50 +01:00
Matt Turner 164c8277f0 egl/dri2: Properly dereference array.
Fixes a regression that broke EGL since

commit 858f2f2ae6
Author: Emil Velikov <emil.l.velikov@gmail.com>
Date:   Sun Sep 13 12:25:27 2015 +0100

    egl/dri2: ease srgb __DRIconfig conditionals
2015-10-07 11:48:49 -07:00
Marek Olšák 13e69805ea radeonsi: fix a GS hang on VI
Broken by one of the cleanups: 0d46c3bc9d
Not applicable to stable.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-07 19:18:50 +02:00
Marek Olšák 5749676d03 radeonsi: remove TC L2 cache flush for index buffers on VI
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-07 19:18:50 +02:00
Brian Paul 6ed8fd3d67 svga: whitespace fixes in svga_sampler_view.c 2015-10-07 08:45:56 -06:00
Brian Paul 70c4cde453 svga: whitespace fixes in svga_resource_buffer.c 2015-10-07 08:45:56 -06:00
Stefan Dösinger a2bc4a7b04 mesa: Remove GL_ARB_sampler_object depth compare error checking.
Version 3: Simplify the code comment, word wrap commit description.

Version 2: Return GL_FALSE if ARB_shadow is unsupported instead of
pretending to store the value as suggested by Brian Paul.

This fixes a GL error warning on r200 in Wine.

The GL_ARB_sampler_objects extension does not specify a dependency on
GL_ARB_shadow or GL_ARB_depth_texture for setting the depth texture
compare mode and function. Silently ignore attempts to change these
settings. They won't matter without a depth texture being assigned
anyway.

Reviewed-by: Brian Paul <brianp@vmware.com>
2015-10-07 08:45:56 -06:00
Brian Paul 2bad030ac9 svga: round UBO constant buffer size up/down to multiple of 16 bytes
The svga3d device requires constant buffers to be a multiple of 16 bytes
in size.  OpenGL UBOs may not fit that restriction.  As a work-around,
round the size up if possible, else round down.

Note that this patch only effects UBO constant buffers (index 1 or higher),
not the 0th/default constant buffer.

Fixes the game Grim Fandango Remastered.  VMware bug 1510130.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
2015-10-07 08:45:56 -06:00
Emil Velikov 4ea5ed9f51 egl/dri2: enable EGL_KHR_gl_colorspace for swrast
No driver changes needed for softpipe/llvmpipe - things just work.

v2: Whitespace fixes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Boyan Ding <boyan.j.ding@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-07 15:18:03 +01:00
Emil Velikov 858f2f2ae6 egl/dri2: ease srgb __DRIconfig conditionals
One can simplify the if-else chain, by declaring the driconfigs as a
two sized array, whist using srgb as a index to the correct entry.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
2015-10-07 15:17:57 +01:00
Emil Velikov b69cfbdf18 mesa: enable KHR_debug for ES contexts
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-07 15:08:50 +01:00
Matthew Waters 70643a1389 main/get: make KHR_debug enums available everywhere
Move all the enums but CONTEXT_FLAGS. The spec seems quite explicit
about the latter (wrt OpenGL ES)

    "In OpenGL ES versions prior to and including ES 3.1 there is no
    CONTEXT_FLAGS state and therefore the CONTEXT_FLAG_DEBUG_BIT cannot
    be queried."

v2 [Emil Velikov] Rebase.
v3 [Emil Veliokv] Drop the CONTEXT_FLAGS hunk - not applicable for GLES

Signed-off-by: Matthew Waters <ystreet00@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2015-10-07 15:07:01 +01:00