Compare commits

..

47 Commits

Author SHA1 Message Date
Emil Velikov
df1b0a5a86 docs: Update 13.0.0 release notes
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-01 15:55:24 +00:00
Emil Velikov
acc06a239a Update version to 13.0.0(final)
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-11-01 15:47:33 +00:00
Vinson Lee
5ef2504759 util: Include string.h in bitscan.h.
Fix build error with clang.

  Compiling src/compiler/glsl/link_varyings.cpp ...
In file included from src/compiler/glsl/link_varyings.cpp:33:
In file included from src/compiler/glsl/glsl_symbol_table.h:34:
In file included from src/compiler/glsl/ir.h:33:
In file included from src/compiler/glsl_types.h:29:
/usr/include/string.h:518:12: error: exception specification in declaration does not match previous declaration
extern int ffs (int __i) __THROW __attribute__ ((__const__));
           ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
            ^
src/util/bitscan.h:96:18: note: previous declaration is here
   const int i = ffs(*mask) - 1;
                 ^
src/util/bitscan.h:51:13: note: expanded from macro 'ffs'
            ^

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97952
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 889ee4da05)
2016-11-01 13:21:51 +00:00
Leo Liu
8daa9b33c0 st/omx/dec: disable tunnel for size different case
When the video coded size is different from frame size, we need the result
buffers are same as coded size, which are not size compatible with encode
required size, so that simply use no tunnel for this case instead of frame
by frame converting.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 06e3cd6a45)
2016-11-01 12:55:49 +00:00
Leo Liu
16a4d76374 st/omx/dec: result buffers size should match codec decoder size
Otherwise fails the check of matching between decoder size and buffers
size in kernel.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Cc: 13.0 <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d9b2c4048d)
2016-11-01 12:54:11 +00:00
Jason Ekstrand
4251e076d5 i965/fs/generator: Don't use the address immediate for MOV_INDIRECT
The address immediate field is only 9 bits and, since the value is in
bytes, the highest GRF we can point to with it is g15.  This makes it
pretty close to useless for MOV_INDIRECT.  There were already piles of
restrictions preventing us from using it prior to Broadwell, so let's get
rid of the gen8+ code path entirely.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97779
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 2a4a86862c)
2016-11-01 12:52:40 +00:00
Marek Olšák
6c55e33424 radeonsi: fix behavior of GLSL findLSB(0)
12.0 and older need the same fix but elsewhere.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 4bf45a6079)
2016-11-01 12:50:53 +00:00
Marek Olšák
2ec8ad91b3 radeonsi: set VGT_GS_ONCHIP_CNTL on CIK and later
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: 11.2 12.0 13.0  <mesa-stable@lists.freedesktop.org>
(cherry picked from commit e24dc43164)
2016-11-01 12:49:02 +00:00
Kenneth Graunke
0ff597c39b glsl: Improve accuracy of alpha scaling in advanced blend lowering.
When blending with GL_COLORBURN_KHR and these colors:

   dst = <0.372549027, 0.372549027, 0.372549027, 0.372549027>
   src = <0.09375, 0.046875, 0.0, 0.375>

the normalized dst value became 0.99999994 (due to precision problems
in the floating point divide of rgb by alpha).  This caused the color
burn equation to fail the dst >= 1.0 comparison.  The blue channel would
then fall through to the dst < 1.0 && src >= 0 comparison, which was
true, since src.b == 0.  This produced a factor of 0.0 instead of 1.0.

This is an inherent numerical instability in the color burn and dodge
equations - depending on the precision of alpha scaling, the value can
be either 0.0 or 1.0.  Technically, GLSL floating point division doesn't
even guarantee that 0.372549027 / 0.372549027 = 1.0.  So arguably, the
CTS should allow either value.  I've filed a bug at Khronos for further
discussion (linked below).

In the meantime, this patch improves the precision of alpha scaling by
replacing the division with (rgb == alpha ? 1.0 : rgb / alpha).  We may
not need this long term, but for now, it fixes the following CTS tests:

ES31-CTS.blend_equation_advanced.blend_specific.GL_COLORBURN_KHR
ES31-CTS.blend_equation_advanced.blend_all.GL_COLORBURN_KHR_all_qualifier

Cc: currojerez@riseup.net
Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16042
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit e6aeeace69)
2016-11-01 12:47:32 +00:00
Jason Ekstrand
89cefe6325 intel/blorp: Rework our usage of ralloc when compiling shaders
Previously, we were creating the shader with a NULL ralloc context and then
trusting in blorp_compile_fs to clean it up.  The only problem was that
blorp_compile_fs didn't clean up its context properly so we were leaking.
When I went to fix that, I realized that it couldn't because it has to
return the shader binary which is allocated off of that context and used by
the caller.  The solution is to make blorp_compile_fs take a ralloc
context, allocate the nir_shaders directly off that context, and clean it
all up in whatever function creates the shader and calls blorp_compile_fs.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: "12.0, 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 43dadb6edd)
[Emil Velikov: resolve trivial conflicts]
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>

Conflicts:
	src/intel/blorp/blorp_clear.c
2016-11-01 12:45:43 +00:00
Jason Ekstrand
75258017dd intel/blorp: Rename compile_nir_shader to compile_fs
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
(cherry picked from commit ab92480272)
2016-11-01 12:44:10 +00:00
Jason Ekstrand
875534e14c intel/blorp: Fix a couple asserts around image copy rectangles
With dealing with rectangles in compressed images, you can have a width or
height that isn't a multiple of the corresponding compression block
dimension but only if that edge of your rectangle is on the edge of the
image.  When we call convert_to_single_slice, it creates an 2-D image and a
set of tile offsets into that image.  When detecting the right-edge and
bottom-edge cases, we weren't including the tile offsets so the assert
would misfire.  This caused crashes in a few UE4 demos

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reported-by: "Eero Tamminen" <eero.t.tamminen@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98431
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Tested-by: "Eero Tamminen" <eero.t.tamminen@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
(cherry picked from commit 4964a5149b)
2016-11-01 12:31:43 +00:00
Samuel Pitoiset
06baf2cd86 nvc0/ir: fix emission of IMAD with NEG modifiers
The emitter tried to emit sub instead of subr when src0 has
actually a NEG modifier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.0 12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 84e946380b)
2016-11-01 12:14:47 +00:00
Emil Velikov
91b2b925d1 Update version to 13.0.0-rc3
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-31 11:53:03 +00:00
Samuel Iglesias Gonsálvez
7a977612fc glsl: update default precision qualifier when it is set in the shader
Default precision qualifier for a data type could be set several times
inside a shader. This patch allows to update the default precision
qualifier for the given type that is saved in the symbol table.

If it is not in the symbol table, just add it.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97804
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 0e742926c6)
2016-10-27 19:47:20 +01:00
Samuel Iglesias Gonsálvez
95b5a69093 mesa/program: Add _mesa_symbol_table_replace_symbol()
This function allows to modify an existing symbol.

v2:
- Remove namespace usage now that it was deleted.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit dfbdb2c0b3)
Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2016-10-27 19:12:06 +01:00
Timothy Arceri
ea37a06037 glsl/mesa: remove unused namespace support from the symbol table
Namespace support seems to have been unused for a very long time.

Previously the hash table entry was never removed and the symbol name
wasn't freed until the symbol table was destroyed.

In theory this could reduced the number of times we need to copy a string
as duplicate names are reused. However in practice there is likely only a
limited number of symbols that are the same and this is likely to cause
other less than optimal behaviour such as the hash_table continuously
growing.

Along with dropping namespace support this change removes entries from
the hash table as they become unused.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
(cherry picked from commit 6dbe8a1b9f)
Nominated-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2016-10-27 19:11:47 +01:00
Kenneth Graunke
02d5e60ee0 glsl: Size TCS->TES unsized arrays to gl_MaxPatchVertices for queries.
SSO validation and other program interface queries want to see that
unsized (non-patch) TCS output/TES input arrays are implicitly sized
to gl_MaxPatchVertices.

By the time we create the program resource lists, we've sized the arrays
to their actual size.  (We try to create TCS output arrays to match the
output patch size right away, and at this point, we should have shrunk
TES input arrays.)  One option would be to keep them sized to
gl_MaxPatchVertices, and defer shrinking them.  But that's a big change,
and I don't think it's a good idea.

Instead, this patch introduces a new ir_variable flag which indicates
the variable is implicitly to gl_MaxPatchVertices.  Then, the linker
munges the types when creating the resource list, ignoring the size
in the IR's types.  Basically, lie about it for resource queries.
It's ugly, but I think it ought to work.

We probably could use var->data.implicit_sized_array for this, but
I opted for a separate bit to try and avoid convoluting the existing
SSBO handling.  They're similar in concept, but share none of the
same code...

Fixes:
ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage
and the ES32-CTS and ESEXT-CTS variants.

v2: Add a comment (requested by Timothy, written by me).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 173558445d)
2016-10-27 11:33:14 +01:00
Kenneth Graunke
649a47a834 glsl: Pass ctx to program interface query helper functions.
The next commit will use this in add_shader_variable - this just
separates out some of the mechanical changes for easier review.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
(cherry picked from commit 34fd2ffed8)
2016-10-27 11:31:59 +01:00
Tapani Pälli
d640b0d71b egl: set preserved behavior for surface only if config supports it
Otherwise we can end up with mismatching behavior between config and
surface when client queries surface attributes. As example, configs
for DRI3 do not support preserved behavior but here we were setting
preserved behavior for pixmap and pbuffer.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Tested-by: Mark Janes <mark.a.janes@intel.com>
(cherry picked from commit 2035930966)
2016-10-27 11:30:54 +01:00
Dave Airlie
d35c4d1512 radv/ac/llvm: trim texture return values
The intrinsic engine asserts in llvm due to this,
as we put a vec4 into a vec1, and the next instruction
isn't expecting it.

So trim the vector at the end before inserting it.

Reported-by: Christoph Haag <haagch+mesadev@frickel.club>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit d548fa882b)
2016-10-27 11:29:49 +01:00
Samuel Pitoiset
5c00425354 nvc0/ir: fix emission of SHLADD with NEG modifiers
This affects GF100:GK110 chipsets, but not GM107+ where the
logic is a bit different. The emitters tried to emit sub
instead of subr when src0 has a NEG modifier.

This fixes the following piglit tests glsl-fs-loop-nested
and glsl-vs-loop-nested.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1ec7227d44)
2016-10-27 11:28:30 +01:00
Eric Engestrom
6458a9dc6c egl/dri2: swap_buffers_with_damage falls back to swap_buffers
Since commit 0a606a400f ("egl: add eglSwapBuffersWithDamageKHR"),
Android has been broken because the function eglSwapBuffersWithDamageKHR
is provided regardless of the extension being present. Also, the Android
meta-EGL always advertises the extension regardless of the underlying
EGL implementation. As there doesn't seem to be a simple way
conditionally make the EGL function ptr NULL, just implement a brain
dead version of eglSwapBuffersWithDamage{KHR,EXT}.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
CC: Rob Clark <robdclark@gmail.com>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Rob Herring <robh@kernel.org>
[Emil Velikov: copy the original commit message from Rob's patch]
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>

(cherry picked from commit 4fa799ae04)
2016-10-27 11:27:23 +01:00
Marek Olšák
b1d02e7006 st/mesa: allow multiple concurrent waiters in ClientWaitSync
so->fence can be unreferenced by one thread while another thread is
somewhere in ClientWaitSync and expecting so->fence to be non-NULL.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98172

Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit b687f766fd)
2016-10-27 11:26:18 +01:00
Marek Olšák
c29a37c444 st/mesa: unduplicate st_check_sync code
It's the same as st_client_wait_sync. Discovered by Michel.
This is needed to make the following fix simpler.

Cc: 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit f240ad98bc)
2016-10-27 11:25:14 +01:00
Marek Olšák
9c5bbfcbc8 winsys/amdgpu: fix radeon_surf::macro_tile_index for imported textures
Maybe this is why SDMA has been broken for many amdgpu users?

SDMA is the only block which is used with imported textures and relies
on this variable. DB also uses it, but it doesn't get imported textures,
so it's unaffected.

I do get SDMA failures on Tonga before this patch if R600_DEBUG=testdma
is changed to use imported textures.

Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 6ec3b2a4b1)
2016-10-27 11:24:02 +01:00
Marek Olšák
cf82ceb21e gallium/radeon: make sure the address of separate CMASK is aligned properly
This should fix random GPU hangs on Hawaii and Fiji.

Cc: 11.2 12.0 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit dce05b3423)
2016-10-27 11:22:44 +01:00
Marek Olšák
b214af38b9 gallium/radeon: fix incorrect bpe use in si_set_optimal_micro_tile_mode
Oh my god, I wonder what catastrophic issues this was causing on SI.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
(cherry picked from commit 8a21f52d73)
2016-10-27 11:21:24 +01:00
Fredrik Höglund
fbfc01e654 vulkan/wsi/wayland: fix ARGB window support
Use an ARGB format for the DRM buffer when the compositeAlpha field
in VkSwapchainCreateInfoKHR is set to
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 68db0fe034)
2016-10-27 11:20:16 +01:00
Fredrik Höglund
100851b1f5 vulkan/wsi/x11: fix ARGB window support
Pass the correct depth to xcb_dri3_pixmap_from_buffer_checked().
Otherwise xcb_present_pixmap() fails with a BadMatch error.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 972670c200)
2016-10-27 11:19:09 +01:00
Fredrik Höglund
8ec30b87c0 radv: mark the fence as submitted and signalled in vkAcquireNextImageKHR
This stops the debug layers from complaining when fences are used to
throttle image acquisition.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 0a153f4ee4)
2016-10-27 11:17:55 +01:00
Matt Turner
cc5995d9e6 radv: Replace "abi_versions" with correct "api_version".
git history shows "abi_versions" was used from the outset.

Cc: <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 14aac061e9)
2016-10-27 11:16:51 +01:00
Matt Turner
42de0666ec anv: Replace "abi_versions" with correct "api_version".
git history shows "abi_versions" was used from the outset.

Cc: <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98415
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 07755237d3)
2016-10-27 11:15:44 +01:00
Samuel Pitoiset
4083feb939 nvc0: use correct bufctx when invalidating CP textures
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 7b2712c367)
2016-10-27 11:14:28 +01:00
Tapani Pälli
92a50b3d6e mesa: fix error handling in DrawBuffers
Patch rearranges error checking so that enum checking provided via
destmask happens before other checks. It needs to be done in this
order because other error checks do not work properly if there were
invalid enums passed.

Patch also refines one existing check and it's documentation to match
GLES 3.0 spec (also in later specs). This was somewhat mysteriously
referring to desktop GL but had a check for gles3.

Fixes following dEQP tests:

   dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers

no CI regressions observed.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98134
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit a1652a059e)
2016-10-27 11:13:24 +01:00
Tapani Pälli
732b39507b egl: add check that eglCreateContext gets a valid config
Fixes following dEQP test:

   dEQP-EGL.functional.negative_api.create_context

v2: don't break EGL_KHR_no_config_context (Eric Engestrom)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5876f3c85a)
2016-10-27 11:12:19 +01:00
Tapani Pälli
8962e9a239 Revert "egl/android: Set EGL_MAX_PBUFFER_WIDTH and EGL_MAX_PBUFFER_HEIGHT"
This reverts commit b1d636aa00, previous
commit sets these values for all egl configs.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
Suggested-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 1ef7873397)
2016-10-27 11:11:13 +01:00
Tapani Pälli
29f70e8e09 egl/dri2: set max values for pbuffer width and height
While these max values were previously fixed for pbuffer creation, this
change makes also eglGetConfigAttrib() return correct values.

Fixes following dEQP tests:

   dEQP-EGL.functional.create_surface.pbuffer.rgb888_no_depth_no_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgb888_depth_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgba8888_no_depth_no_stencil
   dEQP-EGL.functional.create_surface.pbuffer.rgba8888_depth_stencil

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98326
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0 13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit b91e1e38e8)
2016-10-27 11:10:08 +01:00
Kenneth Graunke
04bd51d7d0 i965: Drop nir_inputs from fs_visitor.
It's unused.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 41034abfe6)
2016-10-27 11:08:41 +01:00
Kenneth Graunke
f17450ff7e i965: Don't use nir_assign_var_locations for VS/TES/GS outputs.
Fixes spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.

v2: Remove nir_outputs field from fs_visitor (caught by Tim and Iago).

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 59864e8e02)
2016-10-27 11:07:08 +01:00
Kenneth Graunke
de826a10a7 i965: Make split_virtual_grfs() call compact_virtual_grfs().
Post-splitting, VGRFs have a maximum size (MAX_VGRF_SIZE).  This is
required by the register allocator, as we have to create classes for
each size of VGRF.

We can (and do) allocate virtual registers larger than MAX_VGRF_SIZE,
but we must ensure that they are splittable.  split_virtual_grfs()
asserts that the post-splitting register size is in range.

Unfortunately, these trip for completely dead registers which are too
large - we only set split points for live registers.  So dead ones are
never split, and if they happened to be too large, they'd trip asserts.

To fix this, call compact_virtual_grfs() to eliminate dead registers
before splitting.

v2: Add a comment written by Iago.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 27715c73ff)
2016-10-27 11:06:02 +01:00
Kenneth Graunke
188a866fd0 i965: Drop unnecessary switch statement in nir_setup_outputs()
TCS and FS are skipped above.  CS has no output variables.
All remaining cases take the same path.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
(cherry picked from commit 3728ee000a)
2016-10-27 11:04:57 +01:00
Axel Davy
a850e69b7e st/nine: Fix locking CubeTexture surfaces.
Only one face of Cubetextures was locked when in DEFAULT Pool.
Fixes:
https://github.com/iXit/Mesa-3D/issues/129

CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit eed605a473)
2016-10-27 11:03:50 +01:00
Axel Davy
d576a2b0e6 st/nine: Fix mistake in Volume9 UnlockBox
In the format fallback path,
the height was used instead of the depth.

CC: "12.0 13.0" <mesa-stable@lists.freedesktop.org>

Signed-off-by: Axel Davy <axel.davy@ens.fr>
(cherry picked from commit fe7bb46134)
2016-10-27 11:02:45 +01:00
Axel Davy
32caa7438a st/nine: Fix leak with integer and boolean constants
Leak introduced by:
a83dce0128

The patch also moves the part to
release changed.vs_const_i and changed.vs_const_b
before the if (!cb.buffer_size) check,
to avoid reuploading every draw call if
integer or boolean constants are dirty, but the shaders
use no constants.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
CC: "13.0" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 25beccb379)
2016-10-27 11:01:38 +01:00
Nicolai Hähnle
074ede8d4f st/mesa: cleanup and fix primitive restart for indirect draws
There are three intended functional changes here:

1. OpenGL 4.5 clarifies that primitive restart should only apply with index
   buffers, so make that change explicit in the indirect draw path.

2. Make PrimitiveRestartFixedIndex work with indirect draws.

3. The change where primitive_restart is only set when the restart index can
   actually have an effect (based on the size of indices) is also applied for
   indirect draws.

Cc: 13.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit 3d6b5dee3a)
2016-10-27 10:41:13 +01:00
Emil Velikov
497cf4a9d1 cherry-ignore: add mapi VISILITY_CFLAGS patch
Cherry-picked without -x

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-27 10:36:07 +01:00
57 changed files with 781 additions and 563 deletions

View File

@@ -1 +1 @@
13.0.0-rc2
13.0.0

2
bin/.cherry-ignore Normal file
View File

@@ -0,0 +1,2 @@
# Commit was picked with -x
907ace57986733add2aebfa9dd7c83c67efed70e mapi: automake: set VISIBILITY_CFLAGS for shared glapi

View File

@@ -14,7 +14,7 @@
<iframe src="../contents.html"></iframe>
<div class="content">
<h1>Mesa 13.0.0 Release Notes / TBD</h1>
<h1>Mesa 13.0.0 Release Notes / November 1, 2016</h1>
<p>
Mesa 13.0.0 is a new development release.
@@ -74,11 +74,236 @@ Note: some of the new features are only available with certain drivers.
<h2>Bug fixes</h2>
TBD.
<ul>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=61907">Bug 61907</a> - Indirect rendering of multi-texture vertex arrays broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69622">Bug 69622</a> - eglTerminate then eglMakeCurrent crahes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71759">Bug 71759</a> - Intel driver fails with &quot;intel_do_flush_locked failed: No such file or directory&quot; if buffer imported with EGL_NATIVE_PIXMAP_KHR</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83036">Bug 83036</a> - [ILK]Piglit spec_ARB_copy_image_arb_copy_image-formats fails</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89599">Bug 89599</a> - symbol 'x86_64_entry_start' is already defined when building with LLVM/clang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90513">Bug 90513</a> - Odd gray and red flicker in The Talos Principle on GK104</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91342">Bug 91342</a> - Very dark textures on some objects in indoors environments in Postal 2</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=92306">Bug 92306</a> - GL Excess demo renders incorrectly on nv43</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=94148">Bug 94148</a> - Framebuffer considered invalid when a draw call is done before glCheckFramebufferStatus</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=94354">Bug 94354</a> - R9285 Unigine Valley perf regression since radeonsi: use re-Z</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=94561">Bug 94561</a> - [llvmpipe] PIPE_CAP_VIDEO_MEMORY reports negative value on 32 bits (with 16GB ram)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=94627">Bug 94627</a> - Game Risen on wine black grass</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=94681">Bug 94681</a> - dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.23 takes 25 minutes to compile</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95000">Bug 95000</a> - deqp: assert in dEQP-GLES3.functional.vertex_arrays.single_attribute.strides.fixed.user_ptr_stride17_components2_quads1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95130">Bug 95130</a> - Derivatives of gl_Color wrong when helper pixels used</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95246">Bug 95246</a> - Segfault in glBindFramebuffer()</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95419">Bug 95419</a> - [HSW][regression][bisect] RPG Maker game gives &quot;invalid floating point operation&quot; at startup</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95462">Bug 95462</a> - [BXT,BSW] arb_gpu_shader_fp64 causes gpu hang</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=95529">Bug 95529</a> - [regression, bisected] Image corruption in Chrome</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96235">Bug 96235</a> - st_nir.h:34: error: redefinition of typedef nir_shader</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96274">Bug 96274</a> - [NVC0] Failure when compiling compute shader: Assertion `bb-&gt;getFirst()-&gt;serial &lt;= bb-&gt;getExit()-&gt;serial' failed</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96285">Bug 96285</a> - Mesa build broken</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96299">Bug 96299</a> - [vulkan] 64 regressions due to mesa d5f2f32</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96343">Bug 96343</a> - oom since st/mesa: implement PBO downloads for ReadPixels</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96346">Bug 96346</a> - [SNB,CTS] es2-cts.gtf.gl.atan regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96349">Bug 96349</a> - [CTS,SKL,BSW,BDW,KBL,BXT] es31-cts.arrays_of_arrays.interactionuniformbuffers3</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96351">Bug 96351</a> - [CTS,SKL,KBL,BXT] es2-cts.gtf.gl2extensiontests.egl_image.egl_image</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96358">Bug 96358</a> - SSO: wrong interface validation between GS and VS (regresion due to latest gles 3.1)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96425">Bug 96425</a> - [bisected] occasional dark render in The Talos Principle</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96484">Bug 96484</a> - [vulkan] deqp-vk.glsl.builtin.precision.sin / cos regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96504">Bug 96504</a> - [vulkancts] compute tests crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96516">Bug 96516</a> - [bisected: 482526] &quot;clover: Update OpenCL version string to match OpenGL&quot;: clover's build fails because of missing git_sha1.h</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96528">Bug 96528</a> - Location qualifier segfaults during shader compilation</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96541">Bug 96541</a> - Tonga Unreal elemental bad rendering since radeonsi: Decompress DCC textures in a render feedback loop</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96565">Bug 96565</a> - Clive Barker's Jericho displays strange,vivid colors when motion blur enabled</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96607">Bug 96607</a> - [bisected] texture misrender / flicker in The Talos Principle on SKL</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96617">Bug 96617</a> - gl_SecondaryFragDataEXT doesn't work for extended blend func</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96629">Bug 96629</a> - dEQP-GLES2.functional.texture.completeness.cube.not_positive_level_0: Assertion `width &gt;= 1' failed.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96639">Bug 96639</a> - st/mesa: transfer_map with too-high level with dEQP-GLES2.functional.texture.completeness.cube.extra_level</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96674">Bug 96674</a> - [SNB, ILK] spec.ext_image_dma_buf_import.ext_image_dma_buf_import-sample_nv1</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96729">Bug 96729</a> - Wrong shader compilation error message</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96762">Bug 96762</a> - [radeonsi,apitrace] Firewatch: nothing rendered in scrollable (text) areas</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96765">Bug 96765</a> - BindFragDataLocationIndexed on array fragment shader output.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96770">Bug 96770</a> - include/GL/mesa_glinterop.h:62: error: redefinition of typedef GLXContext</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96782">Bug 96782</a> - [regression bisected] R600 fp64 and glsl-4.00 piglit failures</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96791">Bug 96791</a> - Cannot use image from swapchains for sampling</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96825">Bug 96825</a> - anv_device.c:31:27: fatal error: anv_timestamp.h: No such file or directory</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96835">Bug 96835</a> - &quot;gallium: Force blend color to 16-byte alignment&quot; crash with &quot;-march=native -O3&quot; causes some 32bit games to crash</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96850">Bug 96850</a> - Crucible tests fail for 32bit mesa</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96878">Bug 96878</a> - [Bisected: cc2d0e6][HSW] &quot;GPU HANG&quot; msg after autologin to gnome-session</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96908">Bug 96908</a> - [radeonsi] MSAA causes graphical artifacts</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96911">Bug 96911</a> - webgl2 conformance2/textures/misc/tex-mipmap-levels.html crashes 12.1 Intel driver</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96949">Bug 96949</a> - [regression] Piglit numSamples assertion failures with 9a23a177b90</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96950">Bug 96950</a> - Another regression from bc4e0c486: vbo: Use a bitmask to track the active arrays in vbo_exec*.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=96971">Bug 96971</a> - invariant qualifier is not valid for shader inputs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97019">Bug 97019</a> - [clover] build failure in llvm/codegen/native.cpp:129:52</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97032">Bug 97032</a> - [BDW,SKL] piglit.spec.arb_gpu_shader5.arb_gpu_shader5-interpolateatcentroid-flat</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97033">Bug 97033</a> - [BDW,SKL] piglit.spec.arb_gpu_shader_fp64.varying-packing.simple regressions</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97039">Bug 97039</a> - The Talos Principle and Serious Sam 3 GPU faults</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97083">Bug 97083</a> - [IVB,BYT] GPU hang on deqp-gles31.functional.separate.shader.random</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97140">Bug 97140</a> - dd_draw.c:949:11: error: implicit declaration of function 'fmemopen' is invalid in C99 [-Werror,-Wimplicit-function-declaration]</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97207">Bug 97207</a> - [IVY BRIDGE] Fragment shader discard writing to depth</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97214">Bug 97214</a> - X not running with error &quot;Failed to make EGL context current&quot;</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97225">Bug 97225</a> - [i965 on HD4600 Haswell] xcom switch to ingame cinematics cause segmentation fault</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97231">Bug 97231</a> - GL_DEPTH_CLAMP doesn't clamp to the far plane</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97233">Bug 97233</a> - vkQuake VkSpecializationMapEntry related bug</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97260">Bug 97260</a> - R9 290 low performance in Linux 4.7</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97267">Bug 97267</a> - [BDW] GL45-CTS.texture_cube_map_array.sampling asserts inside brw_fs.cpp</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97278">Bug 97278</a> - [vulkancts,HSW] all vulkancts tests assert on HSW</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97285">Bug 97285</a> - Darkness in Dota 2 after Patch &quot;Make Gallium's BlitFramebuffer follow the GL 4.4 sRGB rules&quot;</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97286">Bug 97286</a> - `make check` fails uniform-initializer-test</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97305">Bug 97305</a> - Gallium: TBOs and images set the offset in elements, not bytes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97307">Bug 97307</a> - glsl/glcpp/tests/glcpp-test regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97309">Bug 97309</a> - piglit.spec.glsl-1_30.compiler.switch-statement.switch-case-duplicated.vert regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97322">Bug 97322</a> - GenerateMipmap creates wrong mipmap for sRGB texture</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97331">Bug 97331</a> - glDrawElementsBaseVertex doesn't work in display list on i915</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97351">Bug 97351</a> - DrawElementsBaseVertex with VBO ignores base vertex on Intel GMA 9xx in some cases</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97413">Bug 97413</a> - BioShock Infinite crashes on startup with Mesa Git version, R7 370</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97426">Bug 97426</a> - glScissor gives vertically inverted result</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97448">Bug 97448</a> - [HSW] deqp-vk.api_.copy_and_blit.image_to_image_stencil regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97476">Bug 97476</a> - Shader binaries should not be stored in the PipelineCache</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97477">Bug 97477</a> - i915g: gl_FragCoord is always (0.0, max_y)</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97513">Bug 97513</a> - clover reports wrong device pointer size</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97549">Bug 97549</a> - [SNB, BXT] up to 40% perf drop from &quot;loader/dri3: Overhaul dri3_update_num_back&quot; commit</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97587">Bug 97587</a> - make check nir/tests/control_flow_tests regression</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97761">Bug 97761</a> - es2-cts.gtf.gl2extensiontests.egl_image_external.testsimpleunassociated crashes</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97773">Bug 97773</a> - New Mesa master now results in warnings in glrender (and subsurfaces and simple-egl), black screen</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97779">Bug 97779</a> - [regression, bisected][BDW, GPU hang] stuck on render ring, always reproducible</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97790">Bug 97790</a> - Vulkan cts regressions due to 24be63066</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97804">Bug 97804</a> - Later precision statement isn't overriding earlier one</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97808">Bug 97808</a> - &quot;tgsi/scan: don't set interp flags for inputs only used by INTERP instructions&quot; causes glitches in wine with gallium nine</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97887">Bug 97887</a> - llvm segfault in janusvr -render vive</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97894">Bug 97894</a> - Crash in u_transfer_unmap_vtbl when unmapping a buffer mapped in different context</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97952">Bug 97952</a> - /usr/include/string.h:518:12: error: exception specification in declaration does not match previous declaration</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97969">Bug 97969</a> - [radeonsi, bisected: fb827c0] Video decoding shows green artifacts</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=97976">Bug 97976</a> - VCE regression BO to small for addr since winsys/amdgpu: enable buffer allocation from slabs</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98005">Bug 98005</a> - VCE dual instance encoding inconsistent since st/va: enable dual instances encode by sync surface</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98025">Bug 98025</a> - [radeonsi] incorrect primitive restart index used</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98128">Bug 98128</a> - nir/tests/control_flow_tests.cpp:79:73: error: nir_loop_first_cf_node was not declared in this scope</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98131">Bug 98131</a> - Compiler should reject lowp/mediump qualifiers on atomic_uints</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98133">Bug 98133</a> - GetSynciv should raise an error if bufSize &lt; 0</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98134">Bug 98134</a> - dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers wants a different GL error code</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98135">Bug 98135</a> - dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.transform_feedback_varyings wants a different GL error code</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98167">Bug 98167</a> - [vulkan, radv] missing libgcrypt and openssl devel results in linker error in libvulkan_common</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98172">Bug 98172</a> - Concurrent call to glClientWaitSync results in segfault in one of the waiters.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98244">Bug 98244</a> - dEQP: textureOffset(sampler2DArrayShadow, ...) should not exist.</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98264">Bug 98264</a> - Build broken for i965 due to multiple deifnitions of intelFenceExtension</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98307">Bug 98307</a> - &quot;st/glsl_to_tgsi: explicitly track all input and output declaration&quot; broke flightgear colors on rs780</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98326">Bug 98326</a> - [dEQP, EGL] pbuffer depth/stencil tests fail</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98415">Bug 98415</a> - Vulkan Driver JSON file contains incorrect field</li>
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=98431">Bug 98431</a> - UnrealEngine v4 demos startup fails to blorp blit assert</li>
</ul>
<h2>Changes</h2>
TBD.
Mesa no longer depends on libudev.
</div>
</body>

View File

@@ -3520,7 +3520,8 @@ static void visit_tex(struct nir_to_llvm_context *ctx, nir_tex_instr *instr)
LLVMValueRef z = LLVMBuildExtractElement(ctx->builder, result, two, "");
z = LLVMBuildSDiv(ctx->builder, z, six, "");
result = LLVMBuildInsertElement(ctx->builder, result, z, two, "");
}
} else if (instr->dest.ssa.num_components != 4)
result = trim_vector(ctx, result, instr->dest.ssa.num_components);
write_result:
if (result) {

View File

@@ -2,6 +2,6 @@
"file_format_version": "1.0.0",
"ICD": {
"library_path": "@build_libdir@/libvulkan_radeon.so",
"abi_versions": "1.0.3"
"api_version": "1.0.3"
}
}

View File

@@ -2,6 +2,6 @@
"file_format_version": "1.0.0",
"ICD": {
"library_path": "libvulkan_radeon.so",
"abi_versions": "1.0.3"
"api_version": "1.0.3"
}
}

View File

@@ -44,12 +44,6 @@
#include "util/debug.h"
struct radv_dispatch_table dtable;
struct radv_fence {
struct radeon_winsys_fence *fence;
bool submitted;
bool signalled;
};
static VkResult
radv_physical_device_init(struct radv_physical_device *device,
struct radv_instance *instance,

View File

@@ -1206,6 +1206,13 @@ void radv_initialise_cmask(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image, uint32_t value);
void radv_initialize_dcc(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image, uint32_t value);
struct radv_fence {
struct radeon_winsys_fence *fence;
bool submitted;
bool signalled;
};
#define RADV_DEFINE_HANDLE_CASTS(__radv_type, __VkType) \
\
static inline struct __radv_type * \

View File

@@ -318,13 +318,21 @@ VkResult radv_AcquireNextImageKHR(
VkSwapchainKHR _swapchain,
uint64_t timeout,
VkSemaphore semaphore,
VkFence fence,
VkFence _fence,
uint32_t* pImageIndex)
{
RADV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
RADV_FROM_HANDLE(radv_fence, fence, _fence);
return swapchain->acquire_next_image(swapchain, timeout, semaphore,
pImageIndex);
VkResult result = swapchain->acquire_next_image(swapchain, timeout, semaphore,
pImageIndex);
if (fence && result == VK_SUCCESS) {
fence->submitted = true;
fence->signalled = true;
}
return result;
}
VkResult radv_QueuePresentKHR(

View File

@@ -4330,6 +4330,8 @@ handle_tess_ctrl_shader_output_decl(struct _mesa_glsl_parse_state *state,
if (var->data.patch)
return;
var->data.tess_varying_implicit_sized_array = var->type->is_unsized_array();
validate_layout_qualifier_vertex_count(state, loc, var, num_vertices,
&state->tcs_output_size,
"tessellation control shader output");
@@ -4366,6 +4368,7 @@ handle_tess_shader_input_decl(struct _mesa_glsl_parse_state *state,
if (var->type->is_unsized_array()) {
var->type = glsl_type::get_array_instance(var->type->fields.array,
state->Const.MaxPatchVertices);
var->data.tess_varying_implicit_sized_array = true;
} else if (var->type->length != state->Const.MaxPatchVertices) {
_mesa_glsl_error(&loc, state,
"per-vertex tessellation shader input arrays must be "

View File

@@ -126,7 +126,7 @@ void glsl_symbol_table::pop_scope()
bool glsl_symbol_table::name_declared_this_scope(const char *name)
{
return _mesa_symbol_table_symbol_scope(table, -1, name) == 0;
return _mesa_symbol_table_symbol_scope(table, name) == 0;
}
bool glsl_symbol_table::add_variable(ir_variable *v)
@@ -152,7 +152,7 @@ bool glsl_symbol_table::add_variable(ir_variable *v)
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
if (existing != NULL)
entry->f = existing->f;
int added = _mesa_symbol_table_add_symbol(table, -1, v->name, entry);
int added = _mesa_symbol_table_add_symbol(table, v->name, entry);
assert(added == 0);
(void)added;
return true;
@@ -162,13 +162,13 @@ bool glsl_symbol_table::add_variable(ir_variable *v)
/* 1.20+ rules: */
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(v);
return _mesa_symbol_table_add_symbol(table, -1, v->name, entry) == 0;
return _mesa_symbol_table_add_symbol(table, v->name, entry) == 0;
}
bool glsl_symbol_table::add_type(const char *name, const glsl_type *t)
{
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(t);
return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
return _mesa_symbol_table_add_symbol(table, name, entry) == 0;
}
bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i,
@@ -180,7 +180,7 @@ bool glsl_symbol_table::add_interface(const char *name, const glsl_type *i,
symbol_table_entry *entry =
new(mem_ctx) symbol_table_entry(i, mode);
bool add_interface_symbol_result =
_mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
_mesa_symbol_table_add_symbol(table, name, entry) == 0;
assert(add_interface_symbol_result);
return add_interface_symbol_result;
} else {
@@ -199,7 +199,7 @@ bool glsl_symbol_table::add_function(ir_function *f)
}
}
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
return _mesa_symbol_table_add_symbol(table, -1, f->name, entry) == 0;
return _mesa_symbol_table_add_symbol(table, f->name, entry) == 0;
}
bool glsl_symbol_table::add_default_precision_qualifier(const char *type_name,
@@ -213,13 +213,16 @@ bool glsl_symbol_table::add_default_precision_qualifier(const char *type_name,
symbol_table_entry *entry =
new(mem_ctx) symbol_table_entry(default_specifier);
return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
if (!get_entry(name))
return _mesa_symbol_table_add_symbol(table, name, entry) == 0;
return _mesa_symbol_table_replace_symbol(table, name, entry) == 0;
}
void glsl_symbol_table::add_global_function(ir_function *f)
{
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
int added = _mesa_symbol_table_add_global_symbol(table, -1, f->name, entry);
int added = _mesa_symbol_table_add_global_symbol(table, f->name, entry);
assert(added == 0);
(void)added;
}
@@ -261,7 +264,7 @@ int glsl_symbol_table::get_default_precision_qualifier(const char *type_name)
symbol_table_entry *glsl_symbol_table::get_entry(const char *name)
{
return (symbol_table_entry *)
_mesa_symbol_table_find_symbol(table, -1, name);
_mesa_symbol_table_find_symbol(table, name);
}
void

View File

@@ -832,6 +832,12 @@ public:
unsigned implicit_sized_array:1;
/**
* Is this a non-patch TCS output / TES input array that was implicitly
* sized to gl_MaxPatchVertices?
*/
unsigned tess_varying_implicit_sized_array:1;
/**
* Whether this is a fragment shader output implicitly initialized with
* the previous contents of the specified render target at the

View File

@@ -130,14 +130,14 @@ ir_print_visitor::unique_name(ir_variable *var)
/* If there's no conflict, just use the original name */
const char* name = NULL;
if (_mesa_symbol_table_find_symbol(this->symbols, -1, var->name) == NULL) {
if (_mesa_symbol_table_find_symbol(this->symbols, var->name) == NULL) {
name = var->name;
} else {
static unsigned i = 1;
name = ralloc_asprintf(this->mem_ctx, "%s@%u", var->name, ++i);
}
_mesa_hash_table_insert(this->printable_names, var, (void *) name);
_mesa_symbol_table_add_symbol(this->symbols, -1, name, var);
_mesa_symbol_table_add_symbol(this->symbols, name, var);
return name;
}

View File

@@ -3574,6 +3574,7 @@ static gl_shader_variable *
create_shader_variable(struct gl_shader_program *shProg,
const ir_variable *in,
const char *name, const glsl_type *type,
const glsl_type *interface_type,
bool use_implicit_location, int location,
const glsl_type *outermost_struct_type)
{
@@ -3631,7 +3632,7 @@ create_shader_variable(struct gl_shader_program *shProg,
out->type = type;
out->outermost_struct_type = outermost_struct_type;
out->interface_type = in->get_interface_type();
out->interface_type = interface_type;
out->component = in->data.location_frac;
out->index = in->data.index;
out->patch = in->data.patch;
@@ -3643,8 +3644,21 @@ create_shader_variable(struct gl_shader_program *shProg,
return out;
}
static const glsl_type *
resize_to_max_patch_vertices(const struct gl_context *ctx,
const glsl_type *type)
{
if (!type)
return NULL;
return glsl_type::get_array_instance(type->fields.array,
ctx->Const.MaxPatchVertices);
}
static bool
add_shader_variable(struct gl_shader_program *shProg, struct set *resource_set,
add_shader_variable(const struct gl_context *ctx,
struct gl_shader_program *shProg,
struct set *resource_set,
unsigned stage_mask,
GLenum programInterface, ir_variable *var,
const char *name, const glsl_type *type,
@@ -3673,7 +3687,7 @@ add_shader_variable(struct gl_shader_program *shProg, struct set *resource_set,
for (unsigned i = 0; i < type->length; i++) {
const struct glsl_struct_field *field = &type->fields.structure[i];
char *field_name = ralloc_asprintf(shProg, "%s.%s", name, field->name);
if (!add_shader_variable(shProg, resource_set,
if (!add_shader_variable(ctx, shProg, resource_set,
stage_mask, programInterface,
var, field_name, field->type,
use_implicit_location, field_location,
@@ -3687,6 +3701,29 @@ add_shader_variable(struct gl_shader_program *shProg, struct set *resource_set,
}
default: {
const glsl_type *interface_type = var->get_interface_type();
/* Unsized (non-patch) TCS output/TES input arrays are implicitly
* sized to gl_MaxPatchVertices. Internally, we shrink them to a
* smaller size.
*
* This can cause trouble with SSO programs. Since the TCS declares
* the number of output vertices, we can always shrink TCS output
* arrays. However, the TES might not be linked with a TCS, in
* which case it won't know the size of the patch. In other words,
* the TCS and TES may disagree on the (smaller) array sizes. This
* can result in the resource names differing across stages, causing
* SSO validation failures and other cascading issues.
*
* Expanding the array size to the full gl_MaxPatchVertices fixes
* these issues. It's also what program interface queries expect,
* as that is the official size of the array.
*/
if (var->data.tess_varying_implicit_sized_array) {
type = resize_to_max_patch_vertices(ctx, type);
interface_type = resize_to_max_patch_vertices(ctx, interface_type);
}
/* Issue #16 of the ARB_program_interface_query spec says:
*
* "* If a variable is a member of an interface block without an
@@ -3699,8 +3736,7 @@ add_shader_variable(struct gl_shader_program *shProg, struct set *resource_set,
*/
const char *prefixed_name = (var->data.from_named_ifc_block &&
!is_gl_identifier(var->name))
? ralloc_asprintf(shProg, "%s.%s", var->get_interface_type()->name,
name)
? ralloc_asprintf(shProg, "%s.%s", interface_type->name, name)
: name;
/* The ARB_program_interface_query spec says:
@@ -3711,6 +3747,7 @@ add_shader_variable(struct gl_shader_program *shProg, struct set *resource_set,
*/
gl_shader_variable *sha_v =
create_shader_variable(shProg, var, prefixed_name, type,
interface_type,
use_implicit_location, location,
outermost_struct_type);
if (!sha_v)
@@ -3723,7 +3760,8 @@ add_shader_variable(struct gl_shader_program *shProg, struct set *resource_set,
}
static bool
add_interface_variables(struct gl_shader_program *shProg,
add_interface_variables(const struct gl_context *ctx,
struct gl_shader_program *shProg,
struct set *resource_set,
unsigned stage, GLenum programInterface)
{
@@ -3774,7 +3812,7 @@ add_interface_variables(struct gl_shader_program *shProg,
(stage == MESA_SHADER_VERTEX && var->data.mode == ir_var_shader_in) ||
(stage == MESA_SHADER_FRAGMENT && var->data.mode == ir_var_shader_out);
if (!add_shader_variable(shProg, resource_set,
if (!add_shader_variable(ctx, shProg, resource_set,
1 << stage, programInterface,
var, var->name, var->type, vs_input_or_fs_output,
var->data.location - loc_bias))
@@ -3784,7 +3822,9 @@ add_interface_variables(struct gl_shader_program *shProg,
}
static bool
add_packed_varyings(struct gl_shader_program *shProg, struct set *resource_set,
add_packed_varyings(const struct gl_context *ctx,
struct gl_shader_program *shProg,
struct set *resource_set,
int stage, GLenum type)
{
struct gl_linked_shader *sh = shProg->_LinkedShaders[stage];
@@ -3810,7 +3850,7 @@ add_packed_varyings(struct gl_shader_program *shProg, struct set *resource_set,
if (type == iface) {
const int stage_mask =
build_stageref(shProg, var->name, var->data.mode);
if (!add_shader_variable(shProg, resource_set,
if (!add_shader_variable(ctx, shProg, resource_set,
stage_mask,
iface, var, var->name, var->type, false,
var->data.location - VARYING_SLOT_VAR0))
@@ -3822,7 +3862,9 @@ add_packed_varyings(struct gl_shader_program *shProg, struct set *resource_set,
}
static bool
add_fragdata_arrays(struct gl_shader_program *shProg, struct set *resource_set)
add_fragdata_arrays(const struct gl_context *ctx,
struct gl_shader_program *shProg,
struct set *resource_set)
{
struct gl_linked_shader *sh = shProg->_LinkedShaders[MESA_SHADER_FRAGMENT];
@@ -3834,7 +3876,7 @@ add_fragdata_arrays(struct gl_shader_program *shProg, struct set *resource_set)
if (var) {
assert(var->data.mode == ir_var_shader_out);
if (!add_shader_variable(shProg, resource_set,
if (!add_shader_variable(ctx, shProg, resource_set,
1 << MESA_SHADER_FRAGMENT,
GL_PROGRAM_OUTPUT, var, var->name, var->type,
true, var->data.location - FRAG_RESULT_DATA0))
@@ -4093,24 +4135,24 @@ build_program_resource_list(struct gl_context *ctx,
/* Program interface needs to expose varyings in case of SSO. */
if (shProg->SeparateShader) {
if (!add_packed_varyings(shProg, resource_set,
if (!add_packed_varyings(ctx, shProg, resource_set,
input_stage, GL_PROGRAM_INPUT))
return;
if (!add_packed_varyings(shProg, resource_set,
if (!add_packed_varyings(ctx, shProg, resource_set,
output_stage, GL_PROGRAM_OUTPUT))
return;
}
if (!add_fragdata_arrays(shProg, resource_set))
if (!add_fragdata_arrays(ctx, shProg, resource_set))
return;
/* Add inputs and outputs to the resource list. */
if (!add_interface_variables(shProg, resource_set,
if (!add_interface_variables(ctx, shProg, resource_set,
input_stage, GL_PROGRAM_INPUT))
return;
if (!add_interface_variables(shProg, resource_set,
if (!add_interface_variables(ctx, shProg, resource_set,
output_stage, GL_PROGRAM_OUTPUT))
return;

View File

@@ -308,12 +308,18 @@ calc_blend_result(ir_factory f,
f.emit(assign(dst_alpha, swizzle_w(fb)));
f.emit(if_tree(equal(dst_alpha, imm1(0)),
assign(dst_rgb, imm3(0)),
assign(dst_rgb, div(swizzle_xyz(fb), dst_alpha))));
assign(dst_rgb, csel(equal(swizzle_xyz(fb),
swizzle(fb, SWIZZLE_WWWW, 3)),
imm3(1),
div(swizzle_xyz(fb), dst_alpha)))));
f.emit(assign(src_alpha, swizzle_w(src)));
f.emit(if_tree(equal(src_alpha, imm1(0)),
assign(src_rgb, imm3(0)),
assign(src_rgb, div(swizzle_xyz(src), src_alpha))));
assign(src_rgb, csel(equal(swizzle_xyz(src),
swizzle(src, SWIZZLE_WWWW, 3)),
imm3(1),
div(swizzle_xyz(src), src_alpha)))));
ir_variable *factor = f.make_temp(glsl_type::vec3_type, "__blend_factor");

View File

@@ -193,6 +193,8 @@ flatten_named_interface_blocks_declarations::run(exec_list *instructions)
new_var->data.patch = iface_t->fields.structure[i].patch;
new_var->data.stream = var->data.stream;
new_var->data.how_declared = var->data.how_declared;
new_var->data.tess_varying_implicit_sized_array =
var->data.tess_varying_implicit_sized_array;
new_var->data.from_named_ifc_block = 1;
new_var->init_interface_type(var->type);

View File

@@ -241,6 +241,15 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
return NULL;
break;
case __DRI_ATTRIB_MAX_PBUFFER_WIDTH:
_eglSetConfigKey(&base, EGL_MAX_PBUFFER_WIDTH,
_EGL_MAX_PBUFFER_WIDTH);
break;
case __DRI_ATTRIB_MAX_PBUFFER_HEIGHT:
_eglSetConfigKey(&base, EGL_MAX_PBUFFER_HEIGHT,
_EGL_MAX_PBUFFER_HEIGHT);
break;
default:
key = dri2_to_egl_attribute_map[attrib];
if (key != 0)

View File

@@ -66,7 +66,8 @@ dri2_fallback_swap_buffers_with_damage(_EGLDriver *drv, _EGLDisplay *dpy,
_EGLSurface *surf,
const EGLint *rects, EGLint n_rects)
{
return EGL_FALSE;
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
return dri2_dpy->vtbl->swap_buffers(drv, dpy, surf);
}
static inline EGLBoolean

View File

@@ -766,8 +766,6 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
EGL_NATIVE_VISUAL_TYPE, 0,
EGL_FRAMEBUFFER_TARGET_ANDROID, EGL_TRUE,
EGL_RECORDABLE_ANDROID, EGL_TRUE,
EGL_MAX_PBUFFER_WIDTH, _EGL_MAX_PBUFFER_WIDTH,
EGL_MAX_PBUFFER_HEIGHT, _EGL_MAX_PBUFFER_HEIGHT,
EGL_NONE
};
unsigned int format_count[ARRAY_SIZE(visuals)] = { 0 };

View File

@@ -734,7 +734,9 @@ eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_list,
_EGL_CHECK_DISPLAY(disp, EGL_NO_CONTEXT, drv);
if (!config && !disp->Extensions.KHR_no_config_context)
if (config != EGL_NO_CONFIG_KHR)
_EGL_CHECK_CONFIG(disp, conf, EGL_NO_CONTEXT, drv);
else if (!disp->Extensions.KHR_no_config_context)
RETURN_EGL_ERROR(disp, EGL_BAD_CONFIG, EGL_NO_CONTEXT);
if (!share && share_list != EGL_NO_CONTEXT)

View File

@@ -262,9 +262,13 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
{
const char *func;
EGLint renderBuffer = EGL_BACK_BUFFER;
EGLint swapBehavior = EGL_BUFFER_PRESERVED;
EGLint swapBehavior = EGL_BUFFER_DESTROYED;
EGLint err;
/* Swap behavior can be preserved only if config supports this. */
if (conf->SurfaceType & EGL_SWAP_BEHAVIOR_PRESERVED_BIT)
swapBehavior = EGL_BUFFER_PRESERVED;
switch (type) {
case EGL_WINDOW_BIT:
func = "eglCreateWindowSurface";

View File

@@ -727,7 +727,7 @@ void
CodeEmitterGK110::emitIMAD(const Instruction *i)
{
uint8_t addOp =
(i->src(2).mod.neg() << 1) | (i->src(0).mod.neg() ^ i->src(1).mod.neg());
i->src(2).mod.neg() | ((i->src(0).mod.neg() ^ i->src(1).mod.neg()) << 1);
emitForm_21(i, 0x100, 0xa00);
@@ -760,7 +760,7 @@ CodeEmitterGK110::emitISAD(const Instruction *i)
void
CodeEmitterGK110::emitSHLADD(const Instruction *i)
{
uint8_t addOp = (i->src(2).mod.neg() << 1) | i->src(0).mod.neg();
uint8_t addOp = (i->src(0).mod.neg() << 1) | i->src(2).mod.neg();
const ImmediateValue *imm = i->src(1).get()->asImm();
assert(imm);

View File

@@ -737,7 +737,7 @@ void
CodeEmitterNVC0::emitIMAD(const Instruction *i)
{
uint8_t addOp =
(i->src(2).mod.neg() << 1) | (i->src(0).mod.neg() ^ i->src(1).mod.neg());
i->src(2).mod.neg() | ((i->src(0).mod.neg() ^ i->src(1).mod.neg()) << 1);
assert(i->encSize == 8);
emitForm_A(i, HEX64(20000000, 00000003));
@@ -762,7 +762,7 @@ CodeEmitterNVC0::emitIMAD(const Instruction *i)
void
CodeEmitterNVC0::emitSHLADD(const Instruction *i)
{
uint8_t addOp = (i->src(2).mod.neg() << 1) | i->src(0).mod.neg();
uint8_t addOp = (i->src(0).mod.neg() << 1) | i->src(2).mod.neg();
const ImmediateValue *imm = i->src(1).get()->asImm();
assert(imm);

View File

@@ -607,7 +607,7 @@ void nvc0_validate_textures(struct nvc0_context *nvc0)
/* Invalidate all CP textures because they are aliased. */
for (int i = 0; i < nvc0->num_textures[5]; i++)
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CP_TEX(i));
nouveau_bufctx_reset(nvc0->bufctx_cp, NVC0_BIND_CP_TEX(i));
nvc0->textures_dirty[5] = ~0;
nvc0->dirty_cp |= NVC0_NEW_CP_TEXTURES;
}

View File

@@ -826,8 +826,9 @@ static void r600_texture_alloc_cmask_separate(struct r600_common_screen *rscreen
}
rtex->cmask_buffer = (struct r600_resource *)
pipe_buffer_create(&rscreen->b, PIPE_BIND_CUSTOM,
PIPE_USAGE_DEFAULT, rtex->cmask.size);
r600_aligned_buffer_create(&rscreen->b, 0, PIPE_USAGE_DEFAULT,
rtex->cmask.size,
rtex->cmask.alignment);
if (rtex->cmask_buffer == NULL) {
rtex->cmask.size = 0;
return;
@@ -2442,29 +2443,29 @@ static void si_set_optimal_micro_tile_mode(struct r600_common_screen *rscreen,
switch (rtex->last_msaa_resolve_target_micro_mode) {
case 0: /* displayable */
switch (rtex->surface.bpe) {
case 8:
case 1:
rtex->surface.tiling_index[0] = 10;
break;
case 16:
case 2:
rtex->surface.tiling_index[0] = 11;
break;
default: /* 32, 64 */
default: /* 4, 8 */
rtex->surface.tiling_index[0] = 12;
break;
}
break;
case 1: /* thin */
switch (rtex->surface.bpe) {
case 8:
case 1:
rtex->surface.tiling_index[0] = 14;
break;
case 16:
case 2:
rtex->surface.tiling_index[0] = 15;
break;
case 32:
case 4:
rtex->surface.tiling_index[0] = 16;
break;
default: /* 64, 128 */
default: /* 8, 16 */
rtex->surface.tiling_index[0] = 17;
break;
}

View File

@@ -491,23 +491,32 @@ static void emit_lsb(const struct lp_build_tgsi_action *action,
struct lp_build_emit_data *emit_data)
{
struct gallivm_state *gallivm = bld_base->base.gallivm;
LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef args[2] = {
emit_data->args[0],
/* The value of 1 means that ffs(x=0) = undef, so LLVM won't
* add special code to check for x=0. The reason is that
* the LLVM behavior for x=0 is different from what we
* need here.
*
* The hardware already implements the correct behavior.
* need here. However, LLVM also assumes that ffs(x) is
* in [0, 31], but GLSL expects that ffs(0) = -1, so
* a conditional assignment to handle 0 is still required.
*/
LLVMConstInt(LLVMInt1TypeInContext(gallivm->context), 1, 0)
};
emit_data->output[emit_data->chan] =
LLVMValueRef lsb =
lp_build_intrinsic(gallivm->builder, "llvm.cttz.i32",
emit_data->dst_type, args, ARRAY_SIZE(args),
LLVMReadNoneAttribute);
/* TODO: We need an intrinsic to skip this conditional. */
/* Check for zero: */
emit_data->output[emit_data->chan] =
LLVMBuildSelect(builder,
LLVMBuildICmp(builder, LLVMIntEQ, args[0],
bld_base->uint_bld.zero, ""),
lp_build_const_int32(gallivm, -1), lsb, "");
}
/* Find the last bit set. */

View File

@@ -3925,6 +3925,14 @@ static void si_init_config(struct si_context *sctx)
si_pm4_set_reg(pm4, R_028408_VGT_INDX_OFFSET, 0);
if (sctx->b.chip_class >= CIK) {
/* If this is 0, Bonaire can hang even if GS isn't being used.
* Other chips are unaffected. These are suboptimal values,
* but we don't use on-chip GS.
*/
si_pm4_set_reg(pm4, R_028A44_VGT_GS_ONCHIP_CNTL,
S_028A44_ES_VERTS_PER_SUBGRP(64) |
S_028A44_GS_PRIMS_PER_SUBGRP(4));
si_pm4_set_reg(pm4, R_00B51C_SPI_SHADER_PGM_RSRC3_LS, S_00B51C_CU_EN(0xffff));
si_pm4_set_reg(pm4, R_00B41C_SPI_SHADER_PGM_RSRC3_HS, 0);
si_pm4_set_reg(pm4, R_00B31C_SPI_SHADER_PGM_RSRC3_ES, S_00B31C_CU_EN(0xffff));

View File

@@ -126,7 +126,6 @@ prepare_vs_constants_userbuf_swvp(struct NineDevice9 *device)
cb.user_buffer = state->vs_const_i;
state->pipe.cb2_swvp = cb;
state->changed.vs_const_i = 0;
}
if (state->changed.vs_const_b || state->changed.group & NINE_STATE_SWVP) {
@@ -138,7 +137,6 @@ prepare_vs_constants_userbuf_swvp(struct NineDevice9 *device)
cb.user_buffer = state->vs_const_b;
state->pipe.cb3_swvp = cb;
state->changed.vs_const_b = 0;
}
if (!device->driver_caps.user_cbufs) {
@@ -236,14 +234,30 @@ prepare_vs_constants_userbuf(struct NineDevice9 *device)
if (state->changed.vs_const_i || state->changed.group & NINE_STATE_SWVP) {
int *idst = (int *)&state->vs_const_f[4 * device->max_vs_const_f];
memcpy(idst, state->vs_const_i, NINE_MAX_CONST_I * sizeof(int[4]));
state->changed.vs_const_i = 0;
}
if (state->changed.vs_const_b || state->changed.group & NINE_STATE_SWVP) {
int *idst = (int *)&state->vs_const_f[4 * device->max_vs_const_f];
uint32_t *bdst = (uint32_t *)&idst[4 * NINE_MAX_CONST_I];
memcpy(bdst, state->vs_const_b, NINE_MAX_CONST_B * sizeof(BOOL));
state->changed.vs_const_b = 0;
}
if (device->state.changed.vs_const_i) {
struct nine_range *r = device->state.changed.vs_const_i;
struct nine_range *p = r;
while (p->next)
p = p->next;
nine_range_pool_put_chain(&device->range_pool, r, p);
device->state.changed.vs_const_i = NULL;
}
if (device->state.changed.vs_const_b) {
struct nine_range *r = device->state.changed.vs_const_b;
struct nine_range *p = r;
while (p->next)
p = p->next;
nine_range_pool_put_chain(&device->range_pool, r, p);
device->state.changed.vs_const_b = NULL;
}
if (!cb.buffer_size)
@@ -290,23 +304,6 @@ prepare_vs_constants_userbuf(struct NineDevice9 *device)
device->state.changed.vs_const_f = NULL;
}
if (device->state.changed.vs_const_i) {
struct nine_range *r = device->state.changed.vs_const_i;
struct nine_range *p = r;
while (p->next)
p = p->next;
nine_range_pool_put_chain(&device->range_pool, r, p);
device->state.changed.vs_const_i = NULL;
}
if (device->state.changed.vs_const_b) {
struct nine_range *r = device->state.changed.vs_const_b;
struct nine_range *p = r;
while (p->next)
p = p->next;
nine_range_pool_put_chain(&device->range_pool, r, p);
device->state.changed.vs_const_b = NULL;
}
state->changed.group &= ~NINE_STATE_VS_CONST;
state->commit |= NINE_STATE_COMMIT_CONST_VS;
}

View File

@@ -447,6 +447,7 @@ NineSurface9_LockRect( struct NineSurface9 *This,
} else {
u_box_origin_2d(This->desc.Width, This->desc.Height, &box);
}
box.z = This->layer;
user_warn(This->desc.Format == D3DFMT_NULL);

View File

@@ -373,7 +373,7 @@ NineVolume9_UnlockBox( struct NineVolume9 *This )
This->layer_stride_conversion,
0, 0, 0,
This->desc.Width, This->desc.Height,
This->desc.Height);
This->desc.Depth);
if (!This->data)
pipe_transfer_unmap(This->pipe, transfer);

View File

@@ -425,24 +425,19 @@ void vid_dec_NeedTarget(vid_dec_PrivateType *priv)
struct pipe_video_buffer templat = {};
struct vl_screen *omx_screen;
struct pipe_screen *pscreen;
omx_base_video_PortType *port;
omx_screen = priv->screen;
port = (omx_base_video_PortType *)priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
assert(omx_screen);
assert(port);
pscreen = omx_screen->pscreen;
assert(pscreen);
if (!priv->target) {
memset(&templat, 0, sizeof(templat));
templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.width = port->sPortParam.format.video.nFrameWidth;
templat.height = port->sPortParam.format.video.nFrameHeight;
templat.width = priv->codec->width;
templat.height = priv->codec->height;
templat.buffer_format = pscreen->get_video_param(
pscreen,
PIPE_VIDEO_PROFILE_UNKNOWN,
@@ -626,7 +621,7 @@ static void vid_dec_FrameDecoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE*
}
if (input->pInputPortPrivate) {
if (output->pInputPortPrivate) {
if (output->pInputPortPrivate && !priv->disable_tunnel) {
struct pipe_video_buffer *tmp, *vbuf, *new_vbuf;
tmp = output->pOutputPortPrivate;

View File

@@ -129,6 +129,7 @@ DERIVEDCLASS(vid_dec_PrivateType, omx_base_filter_PrivateType)
bool frame_started; \
unsigned bytes_left; \
const void *slice; \
bool disable_tunnel; \
struct vl_compositor compositor; \
struct vl_compositor_state cstate;
ENDCLASS(vid_dec_PrivateType)

View File

@@ -105,13 +105,6 @@ static void vid_dec_h264_BeginFrame(vid_dec_PrivateType *priv)
if (priv->frame_started)
return;
vid_dec_NeedTarget(priv);
if (priv->first_buf_in_frame)
priv->timestamp = priv->timestamps[0];
priv->first_buf_in_frame = false;
priv->picture.h264.num_ref_frames = priv->picture.h264.pps->sps->max_num_ref_frames;
if (!priv->codec) {
struct pipe_video_codec templat = {};
omx_base_video_PortType *port;
@@ -128,6 +121,15 @@ static void vid_dec_h264_BeginFrame(vid_dec_PrivateType *priv)
priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
}
vid_dec_NeedTarget(priv);
if (priv->first_buf_in_frame)
priv->timestamp = priv->timestamps[0];
priv->first_buf_in_frame = false;
priv->picture.h264.num_ref_frames = priv->picture.h264.pps->sps->max_num_ref_frames;
priv->picture.h264.slice_count = 0;
priv->codec->begin_frame(priv->codec, priv->target, &priv->picture.base);
priv->frame_started = true;

View File

@@ -612,13 +612,10 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
if (priv->frame_started)
return;
vid_dec_NeedTarget(priv);
if (priv->first_buf_in_frame)
priv->timestamp = priv->timestamps[0];
priv->first_buf_in_frame = false;
if (!priv->codec) {
struct pipe_video_codec templat = {};
omx_base_video_PortType *port = (omx_base_video_PortType *)
priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
templat.profile = priv->profile;
templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
@@ -628,7 +625,21 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
templat.height = priv->codec_data.h265.pic_height_in_luma_samples;
templat.level = priv->codec_data.h265.level_idc;
priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
/* disable transcode tunnel if video size is different from coded size */
if (priv->codec_data.h265.pic_width_in_luma_samples !=
port->sPortParam.format.video.nFrameWidth ||
priv->codec_data.h265.pic_height_in_luma_samples !=
port->sPortParam.format.video.nFrameHeight)
priv->disable_tunnel = true;
}
vid_dec_NeedTarget(priv);
if (priv->first_buf_in_frame)
priv->timestamp = priv->timestamps[0];
priv->first_buf_in_frame = false;
priv->codec->begin_frame(priv->codec, priv->target, &priv->picture.base);
priv->frame_started = true;
}

View File

@@ -303,6 +303,20 @@ static void set_micro_tile_mode(struct radeon_surf *surf,
surf->micro_tile_mode = G_009910_MICRO_TILE_MODE(tile_mode);
}
static unsigned cik_get_macro_tile_index(struct radeon_surf *surf)
{
unsigned index, tileb;
tileb = 8 * 8 * surf->bpe;
tileb = MIN2(surf->tile_split, tileb);
for (index = 0; tileb > 64; index++)
tileb >>= 1;
assert(index < 16);
return index;
}
static int amdgpu_surface_init(struct radeon_winsys *rws,
struct radeon_surf *surf)
{
@@ -475,6 +489,9 @@ static int amdgpu_surface_init(struct radeon_winsys *rws,
AddrSurfInfoIn.tileIndex = 10; /* 2D displayable */
else
AddrSurfInfoIn.tileIndex = 14; /* 2D non-displayable */
/* Addrlib doesn't set this if tileIndex is forced like above. */
AddrSurfInfoOut.macroModeIndex = cik_get_macro_tile_index(surf);
}
}

View File

@@ -165,21 +165,15 @@ nir_uniform_type_size(const struct glsl_type *type)
}
const unsigned *
brw_blorp_compile_nir_shader(struct blorp_context *blorp, struct nir_shader *nir,
const struct brw_wm_prog_key *wm_key,
bool use_repclear,
struct brw_blorp_prog_data *prog_data,
unsigned *program_size)
blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
struct nir_shader *nir,
const struct brw_wm_prog_key *wm_key,
bool use_repclear,
struct brw_blorp_prog_data *prog_data,
unsigned *program_size)
{
const struct brw_compiler *compiler = blorp->compiler;
void *mem_ctx = ralloc_context(NULL);
/* Calling brw_preprocess_nir and friends is destructive and, if cloning is
* enabled, may end up completely replacing the nir_shader. Therefore, we
* own it and might as well put it in our context for easy cleanup.
*/
ralloc_steal(mem_ctx, nir);
nir->options =
compiler->glsl_compiler_options[MESA_SHADER_FRAGMENT].NirOptions;

View File

@@ -997,7 +997,7 @@ blorp_nir_manual_blend_bilinear(nir_builder *b, nir_ssa_def *pos,
* of samples).
*/
static nir_shader *
brw_blorp_build_nir_shader(struct blorp_context *blorp,
brw_blorp_build_nir_shader(struct blorp_context *blorp, void *mem_ctx,
const struct brw_blorp_blit_prog_key *key)
{
const struct gen_device_info *devinfo = blorp->isl_dev->info;
@@ -1044,7 +1044,7 @@ brw_blorp_build_nir_shader(struct blorp_context *blorp,
(key->dst_samples <= 1));
nir_builder b;
nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);
nir_builder_init_simple_shader(&b, mem_ctx, MESA_SHADER_FRAGMENT, NULL);
struct brw_blorp_blit_vars v;
brw_blorp_blit_vars_init(&b, &v, key);
@@ -1233,6 +1233,8 @@ brw_blorp_get_blit_kernel(struct blorp_context *blorp,
&params->wm_prog_kernel, &params->wm_prog_data))
return;
void *mem_ctx = ralloc_context(NULL);
const unsigned *program;
unsigned program_size;
struct brw_blorp_prog_data prog_data;
@@ -1240,7 +1242,7 @@ brw_blorp_get_blit_kernel(struct blorp_context *blorp,
/* Try and compile with NIR first. If that fails, fall back to the old
* method of building shaders manually.
*/
nir_shader *nir = brw_blorp_build_nir_shader(blorp, prog_key);
nir_shader *nir = brw_blorp_build_nir_shader(blorp, mem_ctx, prog_key);
struct brw_wm_prog_key wm_key;
brw_blorp_init_wm_prog_key(&wm_key);
wm_key.tex.compressed_multisample_layout_mask =
@@ -1248,13 +1250,15 @@ brw_blorp_get_blit_kernel(struct blorp_context *blorp,
wm_key.tex.msaa_16 = prog_key->tex_samples == 16;
wm_key.multisample_fbo = prog_key->rt_samples > 1;
program = brw_blorp_compile_nir_shader(blorp, nir, &wm_key, false,
&prog_data, &program_size);
program = blorp_compile_fs(blorp, mem_ctx, nir, &wm_key, false,
&prog_data, &program_size);
blorp->upload_shader(blorp, prog_key, sizeof(*prog_key),
program, program_size,
&prog_data, sizeof(prog_data),
&params->wm_prog_kernel, &params->wm_prog_data);
ralloc_free(mem_ctx);
}
static void
@@ -1761,10 +1765,14 @@ surf_convert_to_uncompressed(const struct isl_device *isl_dev,
surf_convert_to_single_slice(isl_dev, info);
if (width || height) {
#ifndef NDEBUG
uint32_t right_edge_px = info->tile_x_sa + *x + *width;
uint32_t bottom_edge_px = info->tile_y_sa + *y + *height;
assert(*width % fmtl->bw == 0 ||
*x + *width == info->surf.logical_level0_px.width);
right_edge_px == info->surf.logical_level0_px.width);
assert(*height % fmtl->bh == 0 ||
*y + *height == info->surf.logical_level0_px.height);
bottom_edge_px == info->surf.logical_level0_px.height);
#endif
*width = DIV_ROUND_UP(*width, fmtl->bw);
*height = DIV_ROUND_UP(*height, fmtl->bh);
}

View File

@@ -56,6 +56,7 @@ blorp_params_get_clear_kernel(struct blorp_context *blorp,
nir_builder b;
nir_builder_init_simple_shader(&b, NULL, MESA_SHADER_FRAGMENT, NULL);
nir_builder_init_simple_shader(&b, mem_ctx, MESA_SHADER_FRAGMENT, NULL);
b.shader->info.name = ralloc_strdup(b.shader, "BLORP-clear");
nir_variable *v_color = nir_variable_create(b.shader, nir_var_shader_in,
@@ -76,8 +77,8 @@ blorp_params_get_clear_kernel(struct blorp_context *blorp,
struct brw_blorp_prog_data prog_data;
unsigned program_size;
const unsigned *program =
brw_blorp_compile_nir_shader(blorp, b.shader, &wm_key, use_replicated_data,
&prog_data, &program_size);
blorp_compile_fs(blorp, mem_ctx, b.shader, &wm_key, use_replicated_data,
&prog_data, &program_size);
blorp->upload_shader(blorp, &blorp_key, sizeof(blorp_key),
program, program_size,

View File

@@ -310,11 +310,12 @@ struct brw_blorp_blit_prog_key
void brw_blorp_init_wm_prog_key(struct brw_wm_prog_key *wm_key);
const unsigned *
brw_blorp_compile_nir_shader(struct blorp_context *blorp, struct nir_shader *nir,
const struct brw_wm_prog_key *wm_key,
bool use_repclear,
struct brw_blorp_prog_data *prog_data,
unsigned *program_size);
blorp_compile_fs(struct blorp_context *blorp, void *mem_ctx,
struct nir_shader *nir,
const struct brw_wm_prog_key *wm_key,
bool use_repclear,
struct brw_blorp_prog_data *prog_data,
unsigned *program_size);
/** \} */

View File

@@ -2,6 +2,6 @@
"file_format_version": "1.0.0",
"ICD": {
"library_path": "@build_libdir@/libvulkan_intel.so",
"abi_versions": "1.0.3"
"api_version": "1.0.3"
}
}

View File

@@ -2,6 +2,6 @@
"file_format_version": "1.0.0",
"ICD": {
"library_path": "@install_libdir@/libvulkan_intel.so",
"abi_versions": "1.0.3"
"api_version": "1.0.3"
}
}

View File

@@ -492,19 +492,6 @@ type_size_scalar(const struct glsl_type *type)
return 0;
}
/**
* Returns the number of scalar components needed to store type, assuming
* that vectors are padded out to vec4.
*
* This has the packing rules of type_size_vec4(), but counts components
* similar to type_size_scalar().
*/
extern "C" int
type_size_vec4_times_4(const struct glsl_type *type)
{
return 4 * type_size_vec4(type);
}
/* Attribute arrays are loaded as one vec4 per element (or matrix column),
* except for double-precision types, which are loaded as one dvec4.
*/
@@ -1687,6 +1674,12 @@ fs_visitor::assign_gs_urb_setup()
void
fs_visitor::split_virtual_grfs()
{
/* Compact the register file so we eliminate dead vgrfs. This
* only defines split points for live registers, so if we have
* too large dead registers they will hit assertions later.
*/
compact_virtual_grfs();
int num_vars = this->alloc.count;
/* Count the total number of registers */

View File

@@ -324,8 +324,6 @@ public:
fs_reg *nir_locals;
fs_reg *nir_ssa_values;
fs_reg nir_inputs;
fs_reg nir_outputs;
fs_reg *nir_system_values;
bool failed;

View File

@@ -400,34 +400,33 @@ fs_generator::generate_mov_indirect(fs_inst *inst,
indirect_byte_offset =
retype(spread(indirect_byte_offset, 2), BRW_REGISTER_TYPE_UW);
struct brw_reg ind_src;
if (devinfo->gen < 8) {
/* From the Haswell PRM section "Register Region Restrictions":
*
* "The lower bits of the AddressImmediate must not overflow to
* change the register address. The lower 5 bits of Address
* Immediate when added to lower 5 bits of address register gives
* the sub-register offset. The upper bits of Address Immediate
* when added to upper bits of address register gives the register
* address. Any overflow from sub-register offset is dropped."
*
* This restriction is only listed in the Haswell PRM but emperical
* testing indicates that it applies on all older generations and is
* lifted on Broadwell.
*
* Since the indirect may cause us to cross a register boundary, this
* makes the base offset almost useless. We could try and do
* something clever where we use a actual base offset if
* base_offset % 32 == 0 but that would mean we were generating
* different code depending on the base offset. Instead, for the
* sake of consistency, we'll just do the add ourselves.
*/
brw_ADD(p, addr, indirect_byte_offset, brw_imm_uw(imm_byte_offset));
ind_src = brw_VxH_indirect(0, 0);
} else {
brw_MOV(p, addr, indirect_byte_offset);
ind_src = brw_VxH_indirect(0, imm_byte_offset);
}
/* There are a number of reasons why we don't use the base offset here.
* One reason is that the field is only 9 bits which means we can only
* use it to access the first 16 GRFs. Also, from the Haswell PRM
* section "Register Region Restrictions":
*
* "The lower bits of the AddressImmediate must not overflow to
* change the register address. The lower 5 bits of Address
* Immediate when added to lower 5 bits of address register gives
* the sub-register offset. The upper bits of Address Immediate
* when added to upper bits of address register gives the register
* address. Any overflow from sub-register offset is dropped."
*
* Since the indirect may cause us to cross a register boundary, this
* makes the base offset almost useless. We could try and do something
* clever where we use a actual base offset if base_offset % 32 == 0 but
* that would mean we were generating different code depending on the
* base offset. Instead, for the sake of consistency, we'll just do the
* add ourselves. This restriction is only listed in the Haswell PRM
* but empirical testing indicates that it applies on all older
* generations and is lifted on Broadwell.
*
* In the end, while base_offset is nice to look at in the generated
* code, using it saves us 0 instructions and would require quite a bit
* of case-by-case work. It's just not worth it.
*/
brw_ADD(p, addr, indirect_byte_offset, brw_imm_uw(imm_byte_offset));
struct brw_reg ind_src = brw_VxH_indirect(0, 0);
brw_inst *mov = brw_MOV(p, dst, retype(ind_src, dst.type));

View File

@@ -48,56 +48,18 @@ fs_visitor::emit_nir_code()
}
}
void
fs_visitor::nir_setup_single_output_varying(fs_reg *reg,
const glsl_type *type,
unsigned *location)
{
if (type->is_array() || type->is_matrix()) {
const struct glsl_type *elem_type = glsl_get_array_element(type);
const unsigned length = glsl_get_length(type);
for (unsigned i = 0; i < length; i++) {
nir_setup_single_output_varying(reg, elem_type, location);
}
} else if (type->is_record()) {
for (unsigned i = 0; i < type->length; i++) {
const struct glsl_type *field_type = type->fields.structure[i].type;
nir_setup_single_output_varying(reg, field_type, location);
}
} else {
assert(type->is_scalar() || type->is_vector());
unsigned num_iter = 1;
if (type->is_dual_slot())
num_iter = 2;
for (unsigned count = 0; count < num_iter; count++) {
this->outputs[*location] = *reg;
*reg = offset(*reg, bld, 4);
(*location)++;
}
}
}
void
fs_visitor::nir_setup_outputs()
{
if (stage == MESA_SHADER_TESS_CTRL || stage == MESA_SHADER_FRAGMENT)
return;
nir_outputs = bld.vgrf(BRW_REGISTER_TYPE_F, nir->num_outputs);
nir_foreach_variable(var, &nir->outputs) {
switch (stage) {
case MESA_SHADER_VERTEX:
case MESA_SHADER_TESS_EVAL:
case MESA_SHADER_GEOMETRY: {
fs_reg reg = offset(nir_outputs, bld, var->data.driver_location);
unsigned location = var->data.location;
nir_setup_single_output_varying(&reg, var->type, &location);
break;
}
default:
unreachable("unhandled shader stage");
const unsigned vec4s = type_size_vec4(var->type);
fs_reg reg = bld.vgrf(BRW_REGISTER_TYPE_F, 4 * vec4s);
for (unsigned i = 0; i < vec4s; i++) {
if (outputs[var->data.driver_location + i].file == BAD_FILE)
outputs[var->data.driver_location + i] = offset(reg, bld, 4 * i);
}
}
}
@@ -4251,12 +4213,11 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr
case nir_intrinsic_store_output: {
fs_reg src = get_nir_src(instr->src[0]);
fs_reg new_dest = offset(retype(nir_outputs, src.type), bld,
instr->const_index[0]);
nir_const_value *const_offset = nir_src_as_const_value(instr->src[1]);
assert(const_offset && "Indirect output stores not allowed");
new_dest = offset(new_dest, bld, const_offset->u32[0]);
fs_reg new_dest = retype(offset(outputs[instr->const_index[0]], bld,
4 * const_offset->u32[0]), src.type);
unsigned num_components = instr->num_components;
unsigned first_component = nir_intrinsic_component(instr);

View File

@@ -327,16 +327,11 @@ void
brw_nir_lower_vue_outputs(nir_shader *nir,
bool is_scalar)
{
if (is_scalar) {
nir_assign_var_locations(&nir->outputs, &nir->num_outputs,
VARYING_SLOT_VAR0,
type_size_vec4_times_4);
nir_lower_io(nir, nir_var_shader_out, type_size_vec4_times_4, 0);
} else {
nir_foreach_variable(var, &nir->outputs)
var->data.driver_location = var->data.location;
nir_lower_io(nir, nir_var_shader_out, type_size_vec4, 0);
nir_foreach_variable(var, &nir->outputs) {
var->data.driver_location = var->data.location;
}
nir_lower_io(nir, nir_var_shader_out, type_size_vec4, 0);
}
void

View File

@@ -34,7 +34,6 @@ extern "C" {
int type_size_scalar(const struct glsl_type *type);
int type_size_vec4(const struct glsl_type *type);
int type_size_dvec4(const struct glsl_type *type);
int type_size_vec4_times_4(const struct glsl_type *type);
int type_size_vs_input(const struct glsl_type *type);
static inline int

View File

@@ -389,17 +389,48 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb,
/* complicated error checking... */
for (output = 0; output < n; output++) {
/* Section 4.2 (Whole Framebuffer Operations) of the OpenGL 3.0
destMask[output] = draw_buffer_enum_to_bitmask(ctx, buffers[output]);
/* From the OpenGL 3.0 specification, page 258:
* "Each buffer listed in bufs must be one of the values from tables
* 4.5 or 4.6. Otherwise, an INVALID_ENUM error is generated.
*/
if (destMask[output] == BAD_MASK) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
caller, _mesa_enum_to_string(buffers[output]));
return;
}
/* From the OpenGL 4.0 specification, page 256:
* "For both the default framebuffer and framebuffer objects, the
* constants FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK are not
* valid in the bufs array passed to DrawBuffers, and will result in
* the error INVALID_ENUM. This restriction is because these
* constants may themselves refer to multiple buffers, as shown in
* table 4.4."
* Previous versions of the OpenGL specification say INVALID_OPERATION,
* but the Khronos conformance tests expect INVALID_ENUM.
*/
if (_mesa_bitcount(destMask[output]) > 1) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
caller, _mesa_enum_to_string(buffers[output]));
return;
}
/* Section 4.2 (Whole Framebuffer Operations) of the OpenGL ES 3.0
* specification says:
*
* "Each buffer listed in bufs must be BACK, NONE, or one of the values
* from table 4.3 (NONE, COLOR_ATTACHMENTi)"
* "If the GL is bound to a draw framebuffer object, the ith buffer
* listed in bufs must be COLOR_ATTACHMENTi or NONE . Specifying a
* buffer out of order, BACK , or COLOR_ATTACHMENTm where m is greater
* than or equal to the value of MAX_- COLOR_ATTACHMENTS , will
* generate the error INVALID_OPERATION .
*/
if (_mesa_is_gles3(ctx) && buffers[output] != GL_NONE &&
buffers[output] != GL_BACK &&
if (_mesa_is_gles3(ctx) && _mesa_is_user_fbo(fb) &&
buffers[output] != GL_NONE &&
(buffers[output] < GL_COLOR_ATTACHMENT0 ||
buffers[output] >= GL_COLOR_ATTACHMENT0 + ctx->Const.MaxColorAttachments)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawBuffers(buffer)");
_mesa_error(ctx, GL_INVALID_OPERATION, "glDrawBuffers(buffer)");
return;
}
@@ -423,34 +454,6 @@ draw_buffers(struct gl_context *ctx, struct gl_framebuffer *fb,
return;
}
destMask[output] = draw_buffer_enum_to_bitmask(ctx, buffers[output]);
/* From the OpenGL 3.0 specification, page 258:
* "Each buffer listed in bufs must be one of the values from tables
* 4.5 or 4.6. Otherwise, an INVALID_ENUM error is generated.
*/
if (destMask[output] == BAD_MASK) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
caller, _mesa_enum_to_string(buffers[output]));
return;
}
/* From the OpenGL 4.0 specification, page 256:
* "For both the default framebuffer and framebuffer objects, the
* constants FRONT, BACK, LEFT, RIGHT, and FRONT_AND_BACK are not
* valid in the bufs array passed to DrawBuffers, and will result in
* the error INVALID_ENUM. This restriction is because these
* constants may themselves refer to multiple buffers, as shown in
* table 4.4."
* Previous versions of the OpenGL specification say INVALID_OPERATION,
* but the Khronos conformance tests expect INVALID_ENUM.
*/
if (_mesa_bitcount(destMask[output]) > 1) {
_mesa_error(ctx, GL_INVALID_ENUM, "%s(invalid buffer %s)",
caller, _mesa_enum_to_string(buffers[output]));
return;
}
/* From the OpenGL 3.0 specification, page 259:
* "If the GL is bound to the default framebuffer and DrawBuffers is
* supplied with a constant (other than NONE) that does not indicate

View File

@@ -123,7 +123,7 @@ handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval)
{
lval->string = strdup(text);
return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL)
return (_mesa_symbol_table_find_symbol(state->st, text) == NULL)
? IDENTIFIER : USED_IDENTIFIER;
}

View File

@@ -724,7 +724,7 @@ extSwizSel: INTEGER
srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, $1);
_mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -812,7 +812,7 @@ dstReg: resultBinding
| USED_IDENTIFIER /* temporaryReg | vertexResultReg */
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, $1);
_mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -841,7 +841,7 @@ dstReg: resultBinding
progParamArray: USED_IDENTIFIER
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, $1);
_mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -914,7 +914,7 @@ addrRegNegOffset: INTEGER
addrReg: USED_IDENTIFIER
{
struct asm_symbol *const s = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, $1);
_mesa_symbol_table_find_symbol(state->st, $1);
free($1);
@@ -2028,9 +2028,9 @@ legacyTexUnitNum: INTEGER
ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
{
struct asm_symbol *exist = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, $2);
_mesa_symbol_table_find_symbol(state->st, $2);
struct asm_symbol *target = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, $4);
_mesa_symbol_table_find_symbol(state->st, $4);
free($4);
@@ -2046,7 +2046,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER
"undefined variable binding in ALIAS statement");
YYERROR;
} else {
_mesa_symbol_table_add_symbol(state->st, 0, $2, target);
_mesa_symbol_table_add_symbol(state->st, $2, target);
}
}
;
@@ -2235,7 +2235,7 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
{
struct asm_symbol *s = NULL;
struct asm_symbol *exist = (struct asm_symbol *)
_mesa_symbol_table_find_symbol(state->st, 0, name);
_mesa_symbol_table_find_symbol(state->st, name);
if (exist != NULL) {
@@ -2273,7 +2273,7 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t,
break;
}
_mesa_symbol_table_add_symbol(state->st, 0, s->name, s);
_mesa_symbol_table_add_symbol(state->st, s->name, s);
s->next = state->sym;
state->sym = s;
}

View File

@@ -26,6 +26,9 @@
#include "../../util/hash_table.h"
struct symbol {
/** Symbol name. */
char *name;
/**
* Link to the next symbol in the table with the same name
*
@@ -34,7 +37,6 @@ struct symbol {
*/
struct symbol *next_with_same_name;
/**
* Link to the next symbol in the table with the same scope
*
@@ -43,21 +45,6 @@ struct symbol {
*/
struct symbol *next_with_same_scope;
/**
* Header information for the list of symbols with the same name.
*/
struct symbol_header *hdr;
/**
* Name space of the symbol
*
* Name space are arbitrary user assigned integers. No two symbols can
* exist in the same name space at the same scope level.
*/
int name_space;
/** Scope depth where this symbol was defined. */
unsigned depth;
@@ -68,20 +55,6 @@ struct symbol {
};
/**
*/
struct symbol_header {
/** Linkage in list of all headers in a given symbol table. */
struct symbol_header *next;
/** Symbol name. */
char *name;
/** Linked list of symbols with the same name. */
struct symbol *symbols;
};
/**
* Element of the scope stack.
*/
@@ -104,41 +77,10 @@ struct _mesa_symbol_table {
/** Top of scope stack. */
struct scope_level *current_scope;
/** List of all symbol headers in the table. */
struct symbol_header *hdr;
/** Current scope depth. */
unsigned depth;
};
static void
check_symbol_table(struct _mesa_symbol_table *table)
{
#if !defined(NDEBUG)
struct scope_level *scope;
for (scope = table->current_scope; scope != NULL; scope = scope->next) {
struct symbol *sym;
for (sym = scope->symbols
; sym != NULL
; sym = sym->next_with_same_name) {
const struct symbol_header *const hdr = sym->hdr;
struct symbol *sym2;
for (sym2 = hdr->symbols
; sym2 != NULL
; sym2 = sym2->next_with_same_name) {
assert(sym2->hdr == hdr);
}
}
}
#else
(void) table;
#endif /* !defined(NDEBUG) */
}
void
_mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table)
{
@@ -152,18 +94,22 @@ _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table)
while (sym != NULL) {
struct symbol *const next = sym->next_with_same_scope;
struct symbol_header *const hdr = sym->hdr;
assert(hdr->symbols == sym);
hdr->symbols = sym->next_with_same_name;
struct hash_entry *hte = _mesa_hash_table_search(table->ht,
sym->name);
if (sym->next_with_same_name) {
/* If there is a symbol with this name in an outer scope update
* the hash table to point to it.
*/
hte->key = sym->next_with_same_name->name;
hte->data = sym->next_with_same_name;
} else {
_mesa_hash_table_remove(table->ht, hte);
free(sym->name);
}
free(sym);
sym = next;
}
check_symbol_table(table);
}
@@ -171,7 +117,6 @@ void
_mesa_symbol_table_push_scope(struct _mesa_symbol_table *table)
{
struct scope_level *const scope = calloc(1, sizeof(*scope));
if (scope == NULL) {
_mesa_error_no_memory(__func__);
return;
@@ -183,11 +128,11 @@ _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table)
}
static struct symbol_header *
static struct symbol *
find_symbol(struct _mesa_symbol_table *table, const char *name)
{
struct hash_entry *entry = _mesa_hash_table_search(table->ht, name);
return entry ? (struct symbol_header *) entry->data : NULL;
return entry ? (struct symbol *) entry->data : NULL;
}
@@ -201,200 +146,140 @@ find_symbol(struct _mesa_symbol_table *table, const char *name)
*/
int
_mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table,
int name_space, const char *name)
const char *name)
{
struct symbol_header *const hdr = find_symbol(table, name);
struct symbol *sym;
struct symbol *const sym = find_symbol(table, name);
if (hdr != NULL) {
for (sym = hdr->symbols; sym != NULL; sym = sym->next_with_same_name) {
assert(sym->hdr == hdr);
if (sym) {
assert(sym->depth <= table->depth);
return sym->depth - table->depth;
}
if ((name_space == -1) || (sym->name_space == name_space)) {
assert(sym->depth <= table->depth);
return sym->depth - table->depth;
}
}
}
return -1;
return -1;
}
void *
_mesa_symbol_table_find_symbol(struct _mesa_symbol_table *table,
int name_space, const char *name)
const char *name)
{
struct symbol_header *const hdr = find_symbol(table, name);
struct symbol *const sym = find_symbol(table, name);
if (sym)
return sym->data;
if (hdr != NULL) {
struct symbol *sym;
for (sym = hdr->symbols; sym != NULL; sym = sym->next_with_same_name) {
assert(sym->hdr == hdr);
if ((name_space == -1) || (sym->name_space == name_space)) {
return sym->data;
}
}
}
return NULL;
return NULL;
}
int
_mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table,
int name_space, const char *name,
void *declaration)
const char *name, void *declaration)
{
struct symbol_header *hdr;
struct symbol *sym;
struct symbol *new_sym;
struct symbol *sym = find_symbol(table, name);
check_symbol_table(table);
if (sym && sym->depth == table->depth)
return -1;
hdr = find_symbol(table, name);
new_sym = calloc(1, sizeof(*sym));
if (new_sym == NULL) {
_mesa_error_no_memory(__func__);
return -1;
}
check_symbol_table(table);
if (sym) {
/* Store link to symbol in outer scope with the same name */
new_sym->next_with_same_name = sym;
new_sym->name = sym->name;
} else {
new_sym->name = strdup(name);
if (new_sym->name == NULL) {
free(new_sym);
_mesa_error_no_memory(__func__);
return -1;
}
}
if (hdr == NULL) {
hdr = calloc(1, sizeof(*hdr));
if (hdr == NULL) {
_mesa_error_no_memory(__func__);
return -1;
}
new_sym->next_with_same_scope = table->current_scope->symbols;
new_sym->data = declaration;
new_sym->depth = table->depth;
hdr->name = strdup(name);
if (hdr->name == NULL) {
free(hdr);
_mesa_error_no_memory(__func__);
return -1;
}
table->current_scope->symbols = new_sym;
_mesa_hash_table_insert(table->ht, hdr->name, hdr);
hdr->next = table->hdr;
table->hdr = hdr;
}
_mesa_hash_table_insert(table->ht, new_sym->name, new_sym);
check_symbol_table(table);
return 0;
}
/* If the symbol already exists in this namespace at this scope, it cannot
* be added to the table.
*/
for (sym = hdr->symbols
; (sym != NULL) && (sym->name_space != name_space)
; sym = sym->next_with_same_name) {
/* empty */
}
int
_mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
const char *name,
void *declaration)
{
struct symbol *sym = find_symbol(table, name);
if (sym && (sym->depth == table->depth))
/* If the symbol doesn't exist, it cannot be replaced. */
if (sym == NULL)
return -1;
sym = calloc(1, sizeof(*sym));
if (sym == NULL) {
_mesa_error_no_memory(__func__);
return -1;
}
sym->next_with_same_name = hdr->symbols;
sym->next_with_same_scope = table->current_scope->symbols;
sym->hdr = hdr;
sym->name_space = name_space;
sym->data = declaration;
sym->depth = table->depth;
assert(sym->hdr == hdr);
hdr->symbols = sym;
table->current_scope->symbols = sym;
check_symbol_table(table);
return 0;
}
int
_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *table,
int name_space, const char *name,
void *declaration)
const char *name, void *declaration)
{
struct symbol_header *hdr;
struct symbol *sym;
struct symbol *curr;
struct scope_level *top_scope;
struct scope_level *top_scope;
struct symbol *inner_sym = NULL;
struct symbol *sym = find_symbol(table, name);
check_symbol_table(table);
while (sym) {
if (sym->depth == 0)
return -1;
hdr = find_symbol(table, name);
inner_sym = sym;
check_symbol_table(table);
/* Get symbol from the outer scope with the same name */
sym = sym->next_with_same_name;
}
if (hdr == NULL) {
hdr = calloc(1, sizeof(*hdr));
if (hdr == NULL) {
_mesa_error_no_memory(__func__);
return -1;
}
/* Find the top-level scope */
for (top_scope = table->current_scope; top_scope->next != NULL;
top_scope = top_scope->next) {
/* empty */
}
hdr->name = strdup(name);
sym = calloc(1, sizeof(*sym));
if (sym == NULL) {
_mesa_error_no_memory(__func__);
return -1;
}
_mesa_hash_table_insert(table->ht, hdr->name, hdr);
hdr->next = table->hdr;
table->hdr = hdr;
}
if (inner_sym) {
/* In case we add the global out of order store a link to the global
* symbol in global.
*/
inner_sym->next_with_same_name = sym;
check_symbol_table(table);
sym->name = inner_sym->name;
} else {
sym->name = strdup(name);
if (sym->name == NULL) {
free(sym);
_mesa_error_no_memory(__func__);
return -1;
}
}
/* If the symbol already exists in this namespace at this scope, it cannot
* be added to the table.
*/
for (sym = hdr->symbols
; (sym != NULL) && (sym->name_space != name_space)
; sym = sym->next_with_same_name) {
/* empty */
}
sym->next_with_same_scope = top_scope->symbols;
sym->data = declaration;
if (sym && sym->depth == 0)
return -1;
top_scope->symbols = sym;
/* Find the top-level scope */
for (top_scope = table->current_scope
; top_scope->next != NULL
; top_scope = top_scope->next) {
/* empty */
}
_mesa_hash_table_insert(table->ht, sym->name, sym);
sym = calloc(1, sizeof(*sym));
if (sym == NULL) {
_mesa_error_no_memory(__func__);
return -1;
}
sym->next_with_same_scope = top_scope->symbols;
sym->hdr = hdr;
sym->name_space = name_space;
sym->data = declaration;
assert(sym->hdr == hdr);
/* Since next_with_same_name is ordered by scope, we need to append the
* new symbol to the _end_ of the list.
*/
if (hdr->symbols == NULL) {
hdr->symbols = sym;
} else {
for (curr = hdr->symbols
; curr->next_with_same_name != NULL
; curr = curr->next_with_same_name) {
/* empty */
}
curr->next_with_same_name = sym;
}
top_scope->symbols = sym;
check_symbol_table(table);
return 0;
return 0;
}
@@ -418,19 +303,10 @@ _mesa_symbol_table_ctor(void)
void
_mesa_symbol_table_dtor(struct _mesa_symbol_table *table)
{
struct symbol_header *hdr;
struct symbol_header *next;
while (table->current_scope != NULL) {
_mesa_symbol_table_pop_scope(table);
}
for (hdr = table->hdr; hdr != NULL; hdr = next) {
next = hdr->next;
free(hdr->name);
free(hdr);
}
_mesa_hash_table_destroy(table->ht, NULL);
free(table);
}

View File

@@ -30,17 +30,22 @@ extern void _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table);
extern void _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table);
extern int _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *symtab,
int name_space, const char *name, void *declaration);
const char *name, void *declaration);
extern int _mesa_symbol_table_add_global_symbol(
struct _mesa_symbol_table *symtab, int name_space, const char *name,
void *declaration);
extern int _mesa_symbol_table_replace_symbol(struct _mesa_symbol_table *table,
const char *name,
void *declaration);
extern int
_mesa_symbol_table_add_global_symbol(struct _mesa_symbol_table *symtab,
const char *name,
void *declaration);
extern int _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table,
int name_space, const char *name);
const char *name);
extern void *_mesa_symbol_table_find_symbol(
struct _mesa_symbol_table *symtab, int name_space, const char *name);
extern void *_mesa_symbol_table_find_symbol(struct _mesa_symbol_table *symtab,
const char *name);
extern struct _mesa_symbol_table *_mesa_symbol_table_ctor(void);

View File

@@ -41,16 +41,21 @@ struct st_sync_object {
struct gl_sync_object b;
struct pipe_fence_handle *fence;
mtx_t mutex; /**< protects "fence" */
};
static struct gl_sync_object * st_new_sync_object(struct gl_context *ctx,
GLenum type)
{
if (type == GL_SYNC_FENCE)
return (struct gl_sync_object*)CALLOC_STRUCT(st_sync_object);
else
if (type == GL_SYNC_FENCE) {
struct st_sync_object *so = CALLOC_STRUCT(st_sync_object);
mtx_init(&so->mutex, mtx_plain);
return &so->b;
} else {
return NULL;
}
}
static void st_delete_sync_object(struct gl_context *ctx,
@@ -60,6 +65,7 @@ static void st_delete_sync_object(struct gl_context *ctx,
struct st_sync_object *so = (struct st_sync_object*)obj;
screen->fence_reference(screen, &so->fence, NULL);
mtx_destroy(&so->mutex);
free(so->b.Label);
free(so);
}
@@ -76,24 +82,6 @@ static void st_fence_sync(struct gl_context *ctx, struct gl_sync_object *obj,
pipe->flush(pipe, &so->fence, PIPE_FLUSH_DEFERRED);
}
static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)
{
struct pipe_context *pipe = st_context(ctx)->pipe;
struct pipe_screen *screen = pipe->screen;
struct st_sync_object *so = (struct st_sync_object*)obj;
/* If the fence doesn't exist, assume it's signalled. */
if (!so->fence) {
so->b.StatusFlag = GL_TRUE;
return;
}
if (screen->fence_finish(screen, pipe, so->fence, 0)) {
screen->fence_reference(screen, &so->fence, NULL);
so->b.StatusFlag = GL_TRUE;
}
}
static void st_client_wait_sync(struct gl_context *ctx,
struct gl_sync_object *obj,
GLbitfield flags, GLuint64 timeout)
@@ -101,13 +89,22 @@ static void st_client_wait_sync(struct gl_context *ctx,
struct pipe_context *pipe = st_context(ctx)->pipe;
struct pipe_screen *screen = pipe->screen;
struct st_sync_object *so = (struct st_sync_object*)obj;
struct pipe_fence_handle *fence = NULL;
/* If the fence doesn't exist, assume it's signalled. */
mtx_lock(&so->mutex);
if (!so->fence) {
mtx_unlock(&so->mutex);
so->b.StatusFlag = GL_TRUE;
return;
}
/* We need a local copy of the fence pointer, so that we can call
* fence_finish unlocked.
*/
screen->fence_reference(screen, &fence, so->fence);
mtx_unlock(&so->mutex);
/* Section 4.1.2 of OpenGL 4.5 (Compatibility Profile) says:
* [...] if ClientWaitSync is called and all of the following are true:
* - the SYNC_FLUSH_COMMANDS_BIT bit is set in flags,
@@ -120,11 +117,18 @@ static void st_client_wait_sync(struct gl_context *ctx,
* Assume GL_SYNC_FLUSH_COMMANDS_BIT is always set, because applications
* forget to set it.
*/
if (so->fence &&
screen->fence_finish(screen, pipe, so->fence, timeout)) {
if (screen->fence_finish(screen, pipe, fence, timeout)) {
mtx_lock(&so->mutex);
screen->fence_reference(screen, &so->fence, NULL);
mtx_unlock(&so->mutex);
so->b.StatusFlag = GL_TRUE;
}
screen->fence_reference(screen, &fence, NULL);
}
static void st_check_sync(struct gl_context *ctx, struct gl_sync_object *obj)
{
st_client_wait_sync(ctx, obj, 0, 0);
}
static void st_server_wait_sync(struct gl_context *ctx,

View File

@@ -126,6 +126,30 @@ setup_index_buffer(struct st_context *st,
}
/**
* Set the restart index.
*/
static void
setup_primitive_restart(struct gl_context *ctx,
const struct _mesa_index_buffer *ib,
struct pipe_draw_info *info)
{
if (ctx->Array._PrimitiveRestart) {
info->restart_index = _mesa_primitive_restart_index(ctx, ib->type);
/* Enable primitive restart only when the restart index can have an
* effect. This is required for correctness in radeonsi VI support.
* Other hardware may also benefit from taking a faster, non-restart path
* when possible.
*/
if ((ib->type == GL_UNSIGNED_INT) ||
(ib->type == GL_UNSIGNED_SHORT && info->restart_index <= 0xffff) ||
(ib->type == GL_UNSIGNED_BYTE && info->restart_index <= 0xff))
info->primitive_restart = true;
}
}
/**
* Translate OpenGL primtive type (GL_POINTS, GL_TRIANGLE_STRIP, etc) to
* the corresponding Gallium type.
@@ -205,19 +229,7 @@ st_draw_vbo(struct gl_context *ctx,
/* The VBO module handles restart for the non-indexed GLDrawArrays
* so we only set these fields for indexed drawing:
*/
if (ctx->Array._PrimitiveRestart) {
info.restart_index = _mesa_primitive_restart_index(ctx, ib->type);
/* Enable primitive restart only when the restart index can have an
* effect. This is required for correctness in radeonsi VI support,
* though other hardware may also benefit from taking a faster,
* non-restart path when possible.
*/
if ((ibuffer.index_size >= 4) ||
(ibuffer.index_size >= 2 && info.restart_index <= 0xffff) ||
(info.restart_index <= 0xff))
info.primitive_restart = true;
}
setup_primitive_restart(ctx, ib, &info);
}
else {
/* Transform feedback drawing is always non-indexed. */
@@ -310,6 +322,9 @@ st_indirect_draw_vbo(struct gl_context *ctx,
}
info.indexed = TRUE;
/* Primitive restart is not handled by the VBO module in this case. */
setup_primitive_restart(ctx, ib, &info);
}
info.mode = translate_prim(ctx, mode);
@@ -317,10 +332,6 @@ st_indirect_draw_vbo(struct gl_context *ctx,
info.indirect = st_buffer_object(indirect_data)->buffer;
info.indirect_offset = indirect_offset;
/* Primitive restart is not handled by the VBO module in this case. */
info.primitive_restart = ctx->Array._PrimitiveRestart;
info.restart_index = ctx->Array.RestartIndex;
if (ST_DEBUG & DEBUG_DRAW) {
debug_printf("st/draw indirect: mode %s drawcount %d indexed %d\n",
u_prim_name(info.mode),

View File

@@ -31,6 +31,7 @@
#include <assert.h>
#include <stdint.h>
#include <string.h>
#if defined(_MSC_VER)
#include <intrin.h>

View File

@@ -702,6 +702,9 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
if (chain == NULL)
return VK_ERROR_OUT_OF_HOST_MEMORY;
bool alpha = pCreateInfo->compositeAlpha ==
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR;
chain->base.device = device;
chain->base.destroy = wsi_wl_swapchain_destroy;
chain->base.get_images = wsi_wl_swapchain_get_images;
@@ -711,7 +714,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
chain->surface = surface->surface;
chain->extent = pCreateInfo->imageExtent;
chain->vk_format = pCreateInfo->imageFormat;
chain->drm_format = wl_drm_format_for_vk_format(chain->vk_format, false);
chain->drm_format = wl_drm_format_for_vk_format(chain->vk_format, alpha);
chain->present_mode = pCreateInfo->presentMode;
chain->fifo_ready = true;

View File

@@ -471,6 +471,7 @@ struct x11_swapchain {
xcb_connection_t * conn;
xcb_window_t window;
xcb_gc_t gc;
uint32_t depth;
VkExtent2D extent;
uint32_t image_count;
@@ -625,7 +626,6 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
uint32_t row_pitch;
uint32_t offset;
uint32_t bpp = 32;
uint32_t depth = 24;
int fd;
uint32_t size;
@@ -651,7 +651,7 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
pCreateInfo->imageExtent.width,
pCreateInfo->imageExtent.height,
row_pitch,
depth, bpp, fd);
chain->depth, bpp, fd);
xcb_discard_reply(chain->conn, cookie.sequence);
int fence_fd = xshmfence_alloc_shm();
@@ -752,18 +752,29 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
if (chain == NULL)
return VK_ERROR_OUT_OF_HOST_MEMORY;
xcb_connection_t *conn = x11_surface_get_connection(icd_surface);
xcb_window_t window = x11_surface_get_window(icd_surface);
xcb_get_geometry_reply_t *geometry =
xcb_get_geometry_reply(conn, xcb_get_geometry(conn, window), NULL);
if (geometry == NULL)
return VK_ERROR_SURFACE_LOST_KHR;
chain->base.device = device;
chain->base.destroy = x11_swapchain_destroy;
chain->base.get_images = x11_get_images;
chain->base.acquire_next_image = x11_acquire_next_image;
chain->base.queue_present = x11_queue_present;
chain->base.image_fns = image_fns;
chain->conn = x11_surface_get_connection(icd_surface);
chain->window = x11_surface_get_window(icd_surface);
chain->conn = conn;
chain->window = window;
chain->depth = geometry->depth;
chain->extent = pCreateInfo->imageExtent;
chain->image_count = num_images;
chain->send_sbc = 0;
free(geometry);
chain->event_id = xcb_generate_id(chain->conn);
xcb_present_select_input(chain->conn, chain->event_id, chain->window,
XCB_PRESENT_EVENT_MASK_CONFIGURE_NOTIFY |