diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/ChangeLog mesa-11.0.4~git20151026+11.0.ec14e6f8/ChangeLog --- mesa-11.0.2+git20151008+11.0.b1230e3e/ChangeLog 2015-10-08 10:34:48.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/ChangeLog 2015-10-26 08:16:47.000000000 +0000 @@ -1,9 +1,852 @@ -commit b61df7f073cb60c68993f1e26b2714e52e847eab +commit 9bcdd0ace85df807586dbd6650be4a56b13bfa07 Author: Rico Tzschichholz -Date: Thu Oct 8 12:34:05 2015 +0200 +Date: Mon Oct 26 09:16:10 2015 +0100 Add debian tree from origin/ubuntu +commit ec14e6f8fd05999b482e0785d8cd286042c9c254 +Author: Emil Velikov +Date: Sun Oct 25 10:04:09 2015 +0000 + + docs: add sha256 checksums for 11.0.4 + + Signed-off-by: Emil Velikov + +commit 31bf24703193cc23961923e01548b1acb2760a93 +Author: Emil Velikov +Date: Sat Oct 24 19:34:01 2015 +0100 + + docs: add release notes for 11.0.4 + + Signed-off-by: Emil Velikov + +commit b530dccbffa1de5699c3dca8c70d25ecfd0982b4 +Author: Emil Velikov +Date: Sat Oct 24 19:29:27 2015 +0100 + + Update version to 11.0.4 + + Signed-off-by: Emil Velikov + +commit 6d6a4d7c767d7d8be0ddab8e47855f16695cfb30 +Author: Jonathan Gray +Date: Sat Oct 10 17:42:40 2015 +1100 + + configure.ac: ensure RM is set + + GNU make predefines RM to rm -f but this is not required by POSIX + so ensure that RM is set. This fixes "make clean" on OpenBSD. + + v2: use AC_CHECK_PROG + + Signed-off-by: Jonathan Gray + CC: "10.6 11.0" + Reviewed-by: Emil Velikov + (cherry picked from commit 99c4079c37ac04a0dad4ead3117f786706c80aaf) + +commit 13276962c7e7a490c68bb6479f770e2d145818b8 +Author: Tapani Pälli +Date: Mon Aug 3 08:58:20 2015 +0300 + + mesa: fix ARRAY_SIZE query for GetProgramResourceiv + + Patch also refactors name length queries which were using array size + in computation, this has to be done in same time to avoid regression in + arb_program_interface_query-resource-query Piglit test. + + Fixes rest of the failures with + ES31-CTS.program_interface_query.no-locations + + v2: make additional check only for GS inputs + v3: create helper function for resource name length + so that it gets calculated only in one place + + Signed-off-by: Tapani Pälli + Reviewed-by: Martin Peres + (cherry picked from commit c0722be9f58ef89dae98d8c459ec4f9589f97748) + +commit 03ab39fa702f2e5dd95a43abd17d70706e3c0eaf +Author: Chris Wilson +Date: Fri Aug 7 21:13:12 2015 +0100 + + i965: Remove early release of DRI2 miptree + + intel_update_winsys_renderbuffer_miptree() will release the existing + miptree when wrapping a new DRI2 buffer, so we can remove the early + release and so prevent a NULL mt dereference should importing the new + DRI2 name fail for any reason. (Reusing the old DRI2 name will result + in the rendering going astray, to a stale buffer, and not shown on the + screen, but it allows us to issue a warning and not crash much later in + innocent code.) + + Signed-off-by: Chris Wilson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86281 + Reviewed-by: Martin Peres + Reviewed-by: Chad Versace + (cherry picked from commit 70e91d61fde239e8ae58148cacd4ff891126e2aa) + +commit 4d215a25d582daa1182a09205addd47cdf1422d9 +Author: Alejandro Piñeiro +Date: Tue Sep 1 17:02:20 2015 +0200 + + i965/vec4: fill src_reg type using the constructor type parameter + + The src_reg constructor that received the glsl_type was using it + only to build the swizzle, but not to fill this->type as dst_reg + is doing. + + This caused some type mismatch between movs and alu operations + on the NIR path, so copy propagation optimization was not applied + to remove unneeded movs if negate modifier was involved. This was + first detected on minus (negate+add) operations. + + Shader DB results (taking into account only vec4): + + total instructions in shared programs: 20019 -> 19934 (-0.42%) + instructions in affected programs: 2918 -> 2833 (-2.91%) + helped: 79 + HURT: 0 + GAINED: 0 + LOST: 0 + + Reviewed-by: Matt Turner + (cherry picked from commit 4de86e1371b0d59a5b9a787b726be3d373024647) + Nominated-by: Christoph Brill + +commit 6766a36e19878dc95396e550833f17b7980760d1 +Author: Alejandro Piñeiro +Date: Fri Sep 11 12:21:13 2015 +0200 + + i965/vec4: check writemask when bailing out at register coalesce + + opt_register_coalesce stopped to check previous instructions to + coalesce with if somebody else was writing on the same + destination. This can be optimized to check if somebody else was + writing to the same channels of the same destination using the + writemask. + + Shader DB results (taking into account only vec4): + + total instructions in shared programs: 1781593 -> 1734957 (-2.62%) + instructions in affected programs: 1238390 -> 1191754 (-3.77%) + helped: 12782 + HURT: 0 + GAINED: 0 + LOST: 0 + + v2: removed some parenthesis, fixed indentation, as suggested by + Matt Turner + v3: added brackets, for consistency, as suggested by Eduardo Lima + + Reviewed-by: Matt Turner + (cherry picked from commit d4e29af2344c06490913efc35430f93a966061bb) + Nominated-by: Jason Ekstrand + +commit 42364b33d16704b909ff8b0ff550638d0184a415 +Author: Brian Paul +Date: Thu Oct 15 08:43:02 2015 -0600 + + mesa: fix incorrect opcode in save_BlendFunci() + + Fixes assertion failure with new piglit + arb_draw_buffers_blend-state_set_get test. + + Cc: mesa-stable@lists.freedesktop.org + + Reviewed-by: Jose Fonseca + (cherry picked from commit e24d04e436ed48d4a0aac90590cbaa40da936208) + +commit 54a30ed94fa74ed6e3a1b6824df882fc38c6a08c +Author: Marek Olšák +Date: Tue Oct 20 18:26:02 2015 +0200 + + gallium: add PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT + + This avoids a serious r600g bug leading to a GPU hang. + The chances this bug will get fixed are pretty low now. + + I deeply regret listening to others and not pushing this patch, leaving + other users with a GPU-crashing driver. Yes, it should be fixed + in the compiler and it's ugly, but users couldn't care less about that. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86720 + + Cc: 11.0 10.6 + Reviewed-by: Brian Paul + (cherry picked from commit 814f31457e9ae83d4f1e39236f704721b279b73d) + +commit 6f48b8957ef2b3231aa0e099f3b6801b7e13ae3e +Author: Leo Liu +Date: Fri Aug 28 08:45:11 2015 -0400 + + st/omx/dec/h264: fix field picture type 0 poc disorder + + Signed-off-by: Leo Liu + Reviewed-by: Christian König + Cc: "10.6 11.0" + (cherry picked from commit 867284a8f07b69887f8adb109fb6c71156668227) + +commit b91ed628c1b2f8296986d36f1ccbce75b171c900 +Author: Indrajit Das +Date: Thu Oct 15 15:42:43 2015 +0530 + + st/va: Used correct parameter to derive the value of the "h" variable in vlVaCreateImage + + Cc: "11.0" + Reviewed-by: Christian König + Reviewed-by: Emil Velikov + (cherry picked from commit 381c17d695b39f9ab501f5aa5a3cc42c8519ac3b) + +commit 141109cc529b3a5d71c0023ad5c19c8844c05171 +Author: Marek Olšák +Date: Fri Oct 9 00:54:17 2015 +0200 + + radeonsi: fix a GS copy shader leak + + Cc: mesa-stable@lists.freedesktop.org + Reviewed-by: Michel Dänzer + (cherry picked from commit aa060e276c203baf4691d4a4722accd5bdbb8526) + [Emil Velikov: si_shader_destroy() wants the ctx as first argument] + Signed-off-by: Emil Velikov + + Conflicts: + src/gallium/drivers/radeonsi/si_shader.c + +commit 5d41a787692851991154a8c6499db2280cf31430 +Author: Marek Olšák +Date: Sat Oct 17 14:20:01 2015 +0200 + + st/mesa: fix clip state dependencies + + This allows removing FLUSH_VERTICES in MatrixMode. + + Cc: mesa-stable@lists.freedesktop.org + Reviewed-by: Brian Paul + (cherry picked from commit 3c6156a4a7b647cc55cbe3a4c13d53b5ffe505e6) + +commit da1d57faf37f935dfd87661f22e0663d57dceee2 +Author: Tapani Pälli +Date: Tue Oct 13 08:49:57 2015 +0300 + + mesa: Set api prefix to version string when overriding version + + Otherwise there are problems when user overrides version and application + such as Piglit wants to detect used api with glGetString(GL_VERSION). + + This makes it currently impossible to run glslparsertest tests for + OpenGL ES when using version override. + + Below is example when using MESA_GLES_VERSION_OVERRIDE=3.1. + + Before: + "3.1 Mesa 11.1.0-devel (git-24a1a15)" + + After: + "OpenGL ES 3.1 Mesa 11.1.0-devel (git-78042ff)" + + v2: only include api prefix for OpenGL ES (Boyan Ding) + + Signed-off-by: Tapani Pälli + Reviewed-by: Iago Toral Quiroga + Cc: "11.0" + (cherry picked from commit dc8c221e2890cc9913dfc99e1e0fcb73c89af52c) + +commit 0d87f7576318c2a22b4e3d82256e5c9de9c2e474 +Author: Rob Clark +Date: Thu Oct 15 16:22:23 2015 -0400 + + freedreno/a3xx: cache-flush is needed after MEM_WRITE + + Otherwise the mem2gmem blit would see potentially bogus texture + coordinates. Fixes an issue that shows up with glamor. + + CC: "11.0" + Signed-off-by: Rob Clark + (cherry picked from commit 6206da736c84c4f7316ab586c886b4865fda8805) + +commit 009890a0de09fcce5229e38ccb0c5b9f211a6f64 +Author: Chih-Wei Huang +Date: Thu Oct 15 23:46:32 2015 +0800 + + nv30: include the header of ffs prototype + + It fixes a building error of the android 6.0 64-bit target. + + Signed-off-by: Chih-Wei Huang + Reviewed-by: Ilia Mirkin + Cc: mesa-stable@lists.freedesktop.org + (cherry picked from commit 7599f8b167321cb8adb2ba51a53163752b668532) + +commit 938df905ea76b815d796567ff0b01886be0523dd +Author: Chih-Wei Huang +Date: Thu Oct 15 23:46:30 2015 +0800 + + nv50/ir: use C++11 standard std::unordered_map if possible + + Note Android version before Lollipop is not supported. + + Signed-off-by: Chih-Wei Huang + Reviewed-by: Ilia Mirkin + Cc: mesa-stable@lists.freedesktop.org + (cherry picked from commit d31005e3e5588b20760c774f14ac0ea80375a181) + +commit 9b561ed2d189ad65ecdfb274b10b4984927865c8 +Author: Chih-Wei Huang +Date: Mon Oct 12 23:36:59 2015 +0800 + + mesa: android: Fix the incorrect path of sse_minmax.c + + Cc: "10.6 11.0" + Fixes: 669cfc267a1 (android: mesa: fix the path of the SSE4_1 + optimisations) + Signed-off-by: Chih-Wei Huang + Reviewed-by: Emil Velikov + + (cherry picked from commit 67d8518a0e5a3df400a6e70de667d69e4b6ce9c5) + +commit b0b31397e2ecb44a7667461c87200494f31b56c4 +Author: Krzysztof Sobiecki +Date: Wed Oct 14 10:03:00 2015 -0600 + + st/fbo: use pipe_surface_release instead of pipe_surface_reference + + pipe_surface_reference have problems with deleted contexts, + so use of pipe_surface_release might be more appropriate. + + Fixes Wasteland 2 Director's Cut crash on start. + + Cc: mesa-stable@lists.freedesktop.org + + Reviewed-by: Brian Paul + (cherry picked from commit 14f7ce42484c31a45fcb6aabdf503f7496a9a94c) + +commit c0b85c5a4c8cc2fbbc25016b6c6734ff2ff4a4a5 +Author: Brian Paul +Date: Mon Oct 12 11:32:35 2015 -0600 + + vbo: fix incorrect switch statement in init_mat_currval() + + The variable 'i' is a value in [0, MAT_ATTRIB_MAX-1] so subtracting + VERT_ATTRIB_GENERIC0 gave a bogus value and we executed the default + switch clause for all loop iterations. + + This doesn't fix any known issues but was clearly incorrect. + + Cc: mesa-stable@lists.freedesktop.org + + Reviewed-by: Marek Olšák + (cherry picked from commit dd293d8aae324ac7b9d5297e33a1e732e1f3f4d3) + +commit a9da1ead7b1bd7e251091071cefd3931d3b68d71 +Author: Ian Romanick +Date: Wed Oct 7 14:26:29 2015 -0700 + + glsl: In later GLSL versions, sequence operator is cannot be a constant expression + + Fixes: + ES3-CTS.shaders.negative.constant_sequence + + spec/glsl-es-3.00/compiler/global-initializer/from-sequence.vert + spec/glsl-es-3.00/compiler/global-initializer/from-sequence.frag + + v2: Fix a couple copy-and-paste mistake in the spec quotations. + Suggested by Matt. + + Signed-off-by: Ian Romanick + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit 92635a84a7f464b827baa406578420dd6109e1a4) + +commit dab0c565d39119820b71482edbbcde06034304d5 +Author: Ian Romanick +Date: Wed Oct 7 13:03:53 2015 -0700 + + glsl: Add method to determine whether an expression contains the sequence operator + + This will be used in the next patch to enforce some language sematics. + + v2: Fix inverted logic in + ast_function_expression::has_sequence_subexpression. The method + originally had a different name and a different meaning. I fixed the + logic in ast_to_hir.cpp, but I only changed the names in + ast_function.cpp. + + Signed-off-by: Ian Romanick + Reviewed-by: Marta Lofstedt [v1] + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit 05e4601c6b9ce456cc4a4c395677a22125d889d2) + +commit 96931dbf14707ad786fee793342eb7c33d3c427e +Author: Ian Romanick +Date: Tue Oct 6 17:05:55 2015 -0700 + + glsl: Restrict initializers for global variables to constant expression in ES + + v2: Combine this check with the existing const and uniform checks. This + change depends on the previous patch (glsl: Only set + ir_variable::constant_value for const-decorated variables). + + Fixes: + + ES2-CTS.shaders.negative.initialize + ES3-CTS.shaders.negative.initialize + + spec/glsl-es-1.00/compiler/global-initializer/from-attribute.vert + spec/glsl-es-1.00/compiler/global-initializer/from-uniform.vert + spec/glsl-es-1.00/compiler/global-initializer/from-uniform.frag + spec/glsl-es-1.00/compiler/global-initializer/from-global.vert + spec/glsl-es-1.00/compiler/global-initializer/from-global.frag + spec/glsl-es-1.00/compiler/global-initializer/from-varying.frag + spec/glsl-es-3.00/compiler/global-initializer/from-uniform.vert + spec/glsl-es-3.00/compiler/global-initializer/from-uniform.frag + spec/glsl-es-3.00/compiler/global-initializer/from-in.vert + spec/glsl-es-3.00/compiler/global-initializer/from-in.frag + spec/glsl-es-3.00/compiler/global-initializer/from-global.vert + spec/glsl-es-3.00/compiler/global-initializer/from-global.frag + + Note: spec/glsl-es-3.00/compiler/global-initializer/from-sequence.* + still fail because the result of a sequence operator is still considered + to be a constant expression. + + Signed-off-by: Ian Romanick + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92304 + Reviewed-by: Tapani Pälli [v1] + Reviewed-by: Iago Toral Quiroga [v1] + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit bb329f2ff6e8bf8910a467b09f69a4d843689617) + +commit 2d5b8efd7d26c836e46720f7b349994fe7be6ecd +Author: Ian Romanick +Date: Wed Oct 7 12:52:58 2015 -0700 + + glsl: Only set ir_variable::constant_value for const-decorated variables + + Right now we're also setting for uniforms, and that doesn't seem to hurt + things. The next patch will make general global variables in GLSL ES, + and those definitely should not have constant_value set! + + Signed-off-by: Ian Romanick + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit 3524d6df33b1e3716992f9a555ffb0f7b1ae2f4f) + +commit 0c6b2107499f6f5653808f4d1181ecb1871ff695 +Author: Ian Romanick +Date: Thu Oct 8 17:32:41 2015 -0700 + + glsl: Use constant_initializer instead of constant_value to determine whether to keep an unused uniform + + This even matches the comment "uniform initializers are precious, and + could get used by another stage." + + Signed-off-by: Ian Romanick + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit 5bc68f0f2b80b21997435742af74c49eb72891f7) + +commit 8e9b698c24a2551c68ea5d7cbd67e78fc1f8d6a2 +Author: Ian Romanick +Date: Thu Oct 8 14:24:25 2015 -0700 + + glsl/linker: Use constant_initializer instead of constant_value to initialize uniforms + + Signed-off-by: Ian Romanick + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit 313372cae8e10e4b9a3de093d65c0a0d8954bb0d) + +commit 3b238aa08f527838f64d5880e6b017ba6b86cd2b +Author: Ian Romanick +Date: Thu Oct 8 11:13:00 2015 -0700 + + ff_fragment_shader: Use binding to set the sampler unit + + This is the way layout(binding=xxx) works from GLSL. The old method + just happened to work (and significantly predated support for + layout(binding=xxx)), but future changes will break this. + + v2: Remove some stale comments. Suggested by Matt and Chris Forbes. + + Signed-off-by: Ian Romanick + Reviewed-by: Matt Turner + Cc: "10.6 11.0" + (cherry picked from commit 8acce5d53af44a3d1d05a26e69559fd35f835de4) + +commit cd6ff70856f939bd1c1fbe3e5fb09a114e6f164d +Author: Ian Romanick +Date: Fri Oct 9 14:17:32 2015 -0700 + + glsl: Allow built-in functions as constant expressions in OpenGL ES 1.00 + + In d4a24745 (August 2012), Paul made functions calls not be constant + expressions in GLSL ES 1.00. Since this feature was added in desktop + GLSL 1.20, we believed that it was added in GLSL ES 3.00. That turns + out to be completely wrong. Built-in functions have always been allowed + as constant expressions in GLSL ES, and the patch adds the (many) spec + quotations to prove it. + + While we never previously encountered this, a later patch enforces a GLSL + ES 1.00 rule that global variable initializers must be constant + expressions. Without this fix, several dEQP tests fail. + + Fixes: + + tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.frag + tests/spec/glsl-es-1.00/compiler/const-initializer/from-function.vert + tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.frag + tests/spec/glsl-es-1.00/compiler/const-initializer/from-sequence-in-function.vert + + Signed-off-by: Ian Romanick + Reviewed-by: Matt Turner + Cc: "10.0 10.1 10.2 10.3 10.4 10.5 10.6 11.0" + + Yes, I know we don't maintain stable branches that far back, but that + *is* how far back this bug goes! + + (cherry picked from commit 43b07eb60faba1c65fc6f7a99087d051b00e9c0f) + +commit 2ee32ffe7c2f64f40baffc0464d54ea3e974a74a +Author: Nicolai Hähnle +Date: Sun Oct 4 00:44:00 2015 +0200 + + u_vbuf: fix vb slot assignment for translated buffers + + Vertex attributes of different categories (constant/per-instance/ + per-vertex) go into different buffers for translation, and this is now + properly reflected in the vertex buffers passed to the driver. + + Fixes e.g. piglit's point-vertex-id divisor test. + + Cc: mesa-stable@lists.freedesktop.org + Reviewed-by: Marek Olšák + (cherry picked from commit 45ed627d894aa4d51682e8b07e7234bbc6e7c02d) + +commit 25e1e909371437bd76ccc07cd3e117b6168501fb +Author: Dave Airlie +Date: Wed Sep 30 17:48:38 2015 +1000 + + mesa/uniforms: fix get_uniform for doubles (v2) + + The initial glGetUniformdv support didn't cover all the + casting cases that are apparantly legal, and cts seems to + test for them. + + I've updated the piglit test to cover these cases now. + + v2: fix indentation - it's all broken in this file (Ilia) + fix src/dst index tracking in light of fp64 support (Ilia) + + cc: "11.0" + Reviewed-by: Ilia Mirkin + Signed-off-by: Dave Airlie + (cherry picked from commit bcfaab38858fdcfbd8ffeaf6b0e3da8a726f02e6) + +commit 22aae69aa5c745b205e969a8f116ee3b2dacb1a8 +Author: Francisco Jerez +Date: Sat Aug 29 17:03:08 2015 +0300 + + mesa: Get rid of texture-dependent image unit derived state. + + The point is to avoid having to re-validate all image units when + _NEW_TEXTURE is flagged, which can be expensive if the driver exposes + a large number of image units. This has been reported to fix a 36% + performance regression in the Synmark2 Multithread benchmark on the + i965 driver which exposes 192 image units. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91788 + Reported-by: Wendy Wang + Tested-by: Ye Tian + CC: "11.0" + Reviewed-by: Ian Romanick + (cherry picked from commit 7e441bf025cf8c5d088430d546acb4c0ed58d27b) + +commit 4779eb04a45c6fed6e17463bd59f8608d8555e41 +Author: Francisco Jerez +Date: Sat Aug 29 17:01:11 2015 +0300 + + i965: Use _mesa_is_image_unit_valid() instead of gl_image_unit::_Valid. + + gl_image_unit::_Valid will be removed in a future commit. + + Tested-by: Ye Tian + CC: "11.0" + Reviewed-by: Ian Romanick + (cherry picked from commit 2d97a78b37ddf325d90e056f5eefee0548092530) + +commit df361e2311b61f215b01a98452ffb448015f896a +Author: Francisco Jerez +Date: Thu Sep 3 16:12:59 2015 +0300 + + mesa: Skip redundant texture completeness checking during image validation. + + The call to _mesa_test_texobj_completeness() is unnecessary if the + texture is already known to be complete. If the texture object is + dirtied in the meantime _BaseComplete and _MipmapComplete will be + reset to false. _mesa_is_image_unit_valid() will start to be called + more frequently in a future commit, so it seems desirable to avoid the + unnecessary work. + + Tested-by: Ye Tian + CC: "11.0" + Reviewed-by: Ian Romanick + (cherry picked from commit 25d3338be37ddbfe676716034ec5f29e27323704) + +commit 7259f17eca89060c9367c4e859d5a4ba43d010c1 +Author: Francisco Jerez +Date: Sat Aug 29 16:34:50 2015 +0300 + + mesa: Expose function to calculate whether a shader image unit is valid. + + A future commit will remove all texture object-dependent derived state + from the image unit struct to make validation unnecessary on texture + state changes. Instead of checking gl_image_unit::_Valid drivers will + be required to call this function when needed to find out whether an + image unit is in a valid state and whether access from the shader is + allowed. + + Tested-by: Ye Tian + CC: "11.0" + Reviewed-by: Ian Romanick + (cherry picked from commit 5152db415f4047569822d648fda09bdde4171d6d) + +commit 37b647b97975312d6c6b3e71d2285d057a87a735 +Author: Francisco Jerez +Date: Thu Aug 13 15:02:05 2015 +0300 + + i965: Don't tell the hardware about our UAV access. + + The hardware documentation relating to the UAV HW-assisted coherency + mechanism and UAV access enable bits is scarce and sometimes + contradictory, and there's quite some guesswork behind this commit, so + let me summarize the background first: HSW and later hardware have + infrastructure to support a stricter form of data coherency between + shader invocations from separate primitives. The mechanism is + controlled by the "Accesses UAV" bits on 3DSTATE_VS, _HS, _DS, _GS and + _PS (or _PS_EXTRA on BDW+), and the "UAV Coherency Required" bit on + the 3DPRIMITIVE command. + + Regardless of whether "UAV Coherency Required" is set, the hardware + fixed-function units will increment a per-stage semaphore for each + request received if "Accesses UAV" is set for the same or any lower + stage. An implicit DC flush is emitted by the lowermost stage with + "Accesses UAV" set once it's done processing the request, this also + happens regardless of the value of "UAV Coherency Required". The + completion of the DC flush will cause the same stage and all previous + ones to decrement the semaphore, marking the UAV accesses for the + primitive as coherent with L3. + + The "UAV Coherency Required" 3DPRIMITIVE bit will cause a pipeline + stall before any threads are dispatched for the first FF stage with + "Accesses UAV" set until the semaphore is cleared for the same stage. + Effectively this guarantees that UAV memory accesses performed by + previous primitives from any stage will be strictly ordered (and + thanks to the implicit DC flush visible in memory) with UAV accesses + from the following primitives. + + None of this is required by the usual image, atomic counter and SSBO + GL APIs which have very relaxed cross-primitive coherency and ordering + requirements, so we don't actually ever set the "UAV Coherency + Required" bit -- Ordering with respect to shader invocations from + previous stages on the same primitive where there is a data dependency + is of course already guaranteed as the spec requires, regardless of + this mechanism being enabled. We do set the "Accesses UAV" bits + though since my commit ac7664e493655e290783c23a0412b9c70936da50 (which + this patch partially reverts), mainly because of comments like the + following from the BDW PRM: + + > 3DSTATE_GS + >[...] + > 12 Accesses UAV + > Format: Enable + > This field must be set when GS has a UAV access. + + There are similar comments in the documentation for the other + 3DSTATE_*S commands. The "must" part is misleading and unjustified + AFAIK. Most of the "Accesses UAV" bits don't seem to have any side + effects other than the implicit DC flushes and the related + book-keeping in anticipation for a subsequent primitive with "UAV + Coherency Required" set, so in most cases they are unnecessary and may + incur a performance penalty. There is an exception though. On Gen8+ + the PS_EXTRA UAV access bit influences the calculation of the PS + UAV-only and ThreadDispatchEnable signals which on previous + generations were set explicitly by the driver, so we cannot always + avoid enabling it on the PS stage. + + The primary motivation for this change is that in fact the hardware + coherency mechanism is buggy and will cause a rather non-deterministic + hang on Gen8 when VS is the only stage with "Accesses UAV" set and the + processing of a request terminates immediately after the implicit DC + flush is sent for a previous primitive with no additional vertices + being emitted for the second primitive, what will cause the hardware + to skip sending a second DC flush and cause the VS to stall + indefinitely waiting for a response from the DC (BDWGFX HSD 1912017). + This hardware bug can be reproduced on current master with the + spec@arb_shader_image_load_store@host-mem-barrier@Indirect/RaW piglit + subtest (if you have the patience to run it a few dozen times). + + The proposed workaround is to insert CS STALLs speculatively between + 3DPRIMITIVE commands when "Accesses UAV" is enabled for the VS stage + only. Because this would affect one of the hottest paths in the + driver and likely decrease performance even further due to the + unnecessary serialization, and because we don't actually need the + implicit DC flushes, it seems better to just disable them. + + Cc: 11.0 + (cherry picked from commit 5346c1167064d6429c6338974c6342f8346fd34b) + +commit 41cc0965bbccc1daf3a32f52eac998e98765d21e +Author: Tapani Pälli +Date: Thu Oct 8 09:43:41 2015 +0300 + + mesa: add GL_UNSIGNED_INT_24_8 to _mesa_pack_depth_span + + Patch adds missing type (used with NV_read_depth) so that it gets + handled correctly. This fixes errors seen with following CTS test: + + ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels + + Signed-off-by: Tapani Pälli + Reviewed-by: Iago Toral Quiroga + Cc: "11.0" + (cherry picked from commit d8d0e4a81e42678cc8c8b876dfee24d5c2f4ba38) + +commit 3f802ebaf8eef91e9d17cfdd1995f58fd00349e5 +Author: Ilia Mirkin +Date: Mon Oct 5 15:19:05 2015 -0400 + + nouveau: make sure there's always room to emit a fence + + I started seeing a lot of situations on nv30 where fence emission + wouldn't fit into the previous buffer (causing assertions). This ensures + that whenever checking for space, we always leave a bit of extra room + for the fence emission commands. Adjusts the nv30 and nvc0 fence + emission logic to bypass the space checking as well. + + Signed-off-by: Ilia Mirkin + Cc: mesa-stable@lists.freedesktop.org + Reviewed-by: Samuel Pitoiset + (cherry picked from commit 47d11990b2ca3eb666b8ac81fee7f7eb5019eba1) + + Squashed with commit + + nouveau: avoid emitting new fences unnecessarily + + Right now we emit on every kick, but this is only necessary if something + will ever be able to observe that the fence completed. If there are no + refs, leave the fence alone and emit it another day. + + This also happens to work around an issue for the kick handler -- a kick + can be a result of e.g. nouveau_bo_wait or explicit kick, or it can be + due to lack of space in the pushbuf. We want the emit to happen in the + current batch, so we want there to always be enough space. However an + explicit kick could take the reserved space for the implicitly-triggered + kick's fence emission if it happened right after. With the new mechanism, + hopefully there's no way to cause two fences to be emitted into the same + reserved space. + + Signed-off-by: Ilia Mirkin + Reviewed-by: Samuel Pitoiset + Fixes: 47d11990b (nouveau: make sure there's always room to emit a fence) + Cc: mesa-stable@lists.freedesktop.org + (cherry picked from commit 8053c9208f30964d89dc4e262fdf2148f0664696) + + Squashed with commit + + nv50,nvc0: don't base decisions on available pushbuf space + + We still have to push everything out, might as well kick earlier and + flip pushbufs when we know we'll need it. This resolves some issues with + the new policy of making sure that we always leave a bit of room at the + end for fences. + + Signed-off-by: Ilia Mirkin + Reviewed-by: Samuel Pitoiset + Fixes: 47d11990b (nouveau: make sure there's always room to emit a fence) + Cc: mesa-stable@lists.freedesktop.org + (cherry picked from commit 9fe458335ffd35366ef0f4b741aad0cdb3503783) + + Squashed with commit + + nouveau: avoid double-emitting fence + + The act of ensuring that there is space can cause a flush to happen, + which will emit the current screen fence. If that is the fence we're + trying to wait on, then it will have been emitted as a result of doing + the PUSH_SPACE. Don't attempt to emit it a second time. + + Signed-off-by: Ilia Mirkin + Fixes: 8053c9208f (nouveau: avoid emitting new fences unnecessarily) + Cc: mesa-stable@lists.freedesktop.org + (cherry picked from commit bf97f8d467ad1d485c2327da3f4fe1f9e1dc7379) + +commit b4bfea0094d0037b1f66f3437e44e333f2f0c3f6 +Author: Emil Velikov +Date: Sat Oct 10 17:02:43 2015 +0100 + + docs: add sha256 checksums for 11.0.3 + + Signed-off-by: Emil Velikov + +commit 914966befcd57764941405707d8f57d3e7e7f768 +Author: Emil Velikov +Date: Sat Oct 10 16:21:58 2015 +0100 + + docs: add release notes for 11.0.3 + + Signed-off-by: Emil Velikov + +commit 3c86315ca39831a7890708dec2ebbde68ed430db +Author: Emil Velikov +Date: Sat Oct 10 16:17:43 2015 +0100 + + Update version to 11.0.3 + + Signed-off-by: Emil Velikov + +commit d0c22560a151a1ea726df4a6e001048a7c5b225e +Author: Emil Velikov +Date: Sat Oct 10 16:15:08 2015 +0100 + + Revert "nouveau: make sure there's always room to emit a fence" + + This reverts commit 30570b262971c881366deab58caf8d8d48d7d79d. + + As mentioned by Ilia Mirkin: + + Please remove this one from your list of cherry-picked patches. While + it fixes real issues on nv30 (and probably the other generations too), + it appears to introduce some new ones on nvc0. I've figured out what's + causing it, but haven't figured out a proper fix. Not sure I'll be + able to before you do a release. + +commit 1a866b3e49d05555c9f06c5d06142163fb214d5b +Author: Jason Ekstrand +Date: Wed Oct 7 15:52:09 2015 -0700 + + mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks + + The EXT_texture_format_BGRA8888 extension (which mesa supports + unconditionally) adds a new format and internal format called GL_BGRA_EXT. + Previously, this was not really handled at all in + _mesa_ex3_error_check_format_and_type. When the checks were tightened in + commit f15a7f3c, we accidentally tightened things too far and GL_BGRA_EXT + would always cause an error to be thrown. + + There were two primary issues here. First, is that + _mesa_es3_effective_internal_format_for_format_and_type didn't handle the + GL_BGRA_EXT format. Second is that it blindly uses _mesa_base_tex_format + which returns GL_RGBA for GL_BGRA_EXT. This commit fixes both of these + issues as well as adds explicit checks that GL_BGRA_EXT is only ever used + with GL_BGRA_EXT and GL_UNSIGNED_BYTE. + + Signed-off-by: Jason Ekstrand + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265 + Reviewed-by: Ian Romanick + Cc: "11.0" + (cherry picked from commit 6ad9ebb073fc4ed245ef8e9db4479a52e818cb92) + commit b1230e3e01f1b861ab374f7b115c1f7e4bfd0370 Author: Michel Dänzer Date: Mon Aug 10 18:44:18 2015 +0900 diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/configure.ac mesa-11.0.4~git20151026+11.0.ec14e6f8/configure.ac --- mesa-11.0.2+git20151008+11.0.b1230e3e/configure.ac 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/configure.ac 2015-10-26 08:16:10.000000000 +0000 @@ -106,6 +106,8 @@ LT_PREREQ([2.2]) LT_INIT([disable-static]) +AC_CHECK_PROG(RM, rm, [rm -f]) + AX_PROG_BISON([], AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"], [AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])])) diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/debian/changelog mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/changelog --- mesa-11.0.2+git20151008+11.0.b1230e3e/debian/changelog 2015-10-26 08:31:19.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/changelog 2015-10-26 08:31:20.000000000 +0000 @@ -1,14 +1,31 @@ -mesa (11.0.2+git20151008+11.0.b1230e3e-0ubuntu0ricotz) wily; urgency=medium +mesa (11.0.4~git20151026+11.0.ec14e6f8-0ubuntu0ricotz) xenial; urgency=medium - * Checkout from git 20151008 (11.0 branch) up to commit - b1230e3e01f1b861ab374f7b115c1f7e4bfd0370 + * Checkout from git 20151026 (11.0 branch) up to commit + ec14e6f8fd05999b482e0785d8cd286042c9c254 * Only added debian/ tree from origin/ubuntu * hook: Disable MIR support. * hook: Relax symbols check. * hook: Drop egl-platform-mir.patch (no-mir) + * hook: Drop i965-remove-early-release-of-dri2-miptree.patch + (upstream) + * hook: Drop core-fix-EXT_texture_format_BGRA8888.patch (upstream) * hook: update symbols. - -- Rico Tzschichholz Thu, 08 Oct 2015 12:34:49 +0200 + -- Rico Tzschichholz Mon, 26 Oct 2015 09:16:47 +0100 + +mesa (11.0.2-1ubuntu4) wily; urgency=medium + + * core-fix-EXT_texture_format_BGRA8888.patch: Cherry pick upstream commit + fixing incorrectly-strict error handling in format code. Fixes black + windows in Weston and Mir (LP: #1504387) + + -- Christopher James Halse Rogers Fri, 09 Oct 2015 14:45:54 +1100 + +mesa (11.0.2-1ubuntu3) wily; urgency=medium + + * d/patches/egl-platform-mir.patch: add mirclient dependency (LP: #1503450) + + -- Tiago Stürmer Daitx Tue, 06 Oct 2015 22:05:12 +0000 mesa (11.0.2-1ubuntu2) wily; urgency=medium diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/debian/patches/core-fix-EXT_texture_format_BGRA8888.patch mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/patches/core-fix-EXT_texture_format_BGRA8888.patch --- mesa-11.0.2+git20151008+11.0.b1230e3e/debian/patches/core-fix-EXT_texture_format_BGRA8888.patch 1970-01-01 00:00:00.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/patches/core-fix-EXT_texture_format_BGRA8888.patch 2015-10-26 08:31:20.000000000 +0000 @@ -0,0 +1,71 @@ +commit 6ad9ebb073fc4ed245ef8e9db4479a52e818cb92 +Author: Jason Ekstrand +Date: Wed Oct 7 15:52:09 2015 -0700 + + mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks + + The EXT_texture_format_BGRA8888 extension (which mesa supports + unconditionally) adds a new format and internal format called GL_BGRA_EXT. + Previously, this was not really handled at all in + _mesa_ex3_error_check_format_and_type. When the checks were tightened in + commit f15a7f3c, we accidentally tightened things too far and GL_BGRA_EXT + would always cause an error to be thrown. + + There were two primary issues here. First, is that + _mesa_es3_effective_internal_format_for_format_and_type didn't handle the + GL_BGRA_EXT format. Second is that it blindly uses _mesa_base_tex_format + which returns GL_RGBA for GL_BGRA_EXT. This commit fixes both of these + issues as well as adds explicit checks that GL_BGRA_EXT is only ever used + with GL_BGRA_EXT and GL_UNSIGNED_BYTE. + + Signed-off-by: Jason Ekstrand + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92265 + Reviewed-by: Ian Romanick + Cc: "11.0" + +diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c +index 7dab33c..faa6382 100644 +--- a/src/mesa/main/glformats.c ++++ b/src/mesa/main/glformats.c +@@ -2678,6 +2678,7 @@ _mesa_es3_effective_internal_format_for_format_and_type(GLenum format, + * internal formats, they do not correspond to GL constants, so the base + * format is returned instead. + */ ++ case GL_BGRA_EXT: + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE: + case GL_ALPHA: +@@ -2797,8 +2798,19 @@ _mesa_es3_error_check_format_and_type(const struct gl_context *ctx, + if (effectiveInternalFormat == GL_NONE) + return GL_INVALID_OPERATION; + +- GLenum baseInternalFormat = +- _mesa_base_tex_format(ctx, effectiveInternalFormat); ++ GLenum baseInternalFormat; ++ if (internalFormat == GL_BGRA_EXT) { ++ /* Unfortunately, _mesa_base_tex_format returns a base format of ++ * GL_RGBA for GL_BGRA_EXT. This makes perfect sense if you're ++ * asking the question, "what channels does this format have?" ++ * However, if we're trying to determine if two internal formats ++ * match in the ES3 sense, we actually want GL_BGRA. ++ */ ++ baseInternalFormat = GL_BGRA_EXT; ++ } else { ++ baseInternalFormat = ++ _mesa_base_tex_format(ctx, effectiveInternalFormat); ++ } + + if (internalFormat != baseInternalFormat) + return GL_INVALID_OPERATION; +@@ -2807,6 +2819,11 @@ _mesa_es3_error_check_format_and_type(const struct gl_context *ctx, + } + + switch (format) { ++ case GL_BGRA_EXT: ++ if (type != GL_UNSIGNED_BYTE || internalFormat != GL_BGRA) ++ return GL_INVALID_OPERATION; ++ break; ++ + case GL_RGBA: + switch (type) { + case GL_UNSIGNED_BYTE: diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/debian/patches/egl-platform-mir.patch mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/patches/egl-platform-mir.patch --- mesa-11.0.2+git20151008+11.0.b1230e3e/debian/patches/egl-platform-mir.patch 2015-10-26 08:31:19.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/patches/egl-platform-mir.patch 2015-10-26 08:31:20.000000000 +0000 @@ -1,17 +1,19 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1772,7 +1772,9 @@ for plat in $egl_platforms; do +Index: mesa-11.0.2/configure.ac +=================================================================== +--- mesa-11.0.2.orig/configure.ac ++++ mesa-11.0.2/configure.ac +@@ -1647,7 +1647,9 @@ for plat in $egl_platforms; do test "x$have_libdrm" != xyes && AC_MSG_ERROR([EGL platform surfaceless requires libdrm >= $LIBDRM_REQUIRED]) ;; - + mir) -+ PKG_CHECK_MODULES([MIR], [mir-client-platform-mesa-dev]) ++ PKG_CHECK_MODULES([MIR], [mirclient mir-client-platform-mesa-dev]) + ;; *) AC_MSG_ERROR([EGL platform '$plat' does not exist]) ;; -@@ -1798,6 +1800,7 @@ AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND +@@ -1673,6 +1675,7 @@ AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm') AM_CONDITIONAL(HAVE_EGL_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless') AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null') @@ -19,8 +21,10 @@ AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x") ---- a/include/EGL/eglplatform.h -+++ b/include/EGL/eglplatform.h +Index: mesa-11.0.2/include/EGL/eglplatform.h +=================================================================== +--- mesa-11.0.2.orig/include/EGL/eglplatform.h ++++ mesa-11.0.2/include/EGL/eglplatform.h @@ -105,6 +105,13 @@ typedef struct ANativeWindow* typedef struct egl_native_pixmap_t* EGLNativePixmapType; typedef void* EGLNativeDisplayType; @@ -35,8 +39,10 @@ #elif defined(__unix__) || defined(__APPLE__) #if defined(MESA_EGL_NO_X11_HEADERS) ---- a/include/GL/internal/dri_interface.h -+++ b/include/GL/internal/dri_interface.h +Index: mesa-11.0.2/include/GL/internal/dri_interface.h +=================================================================== +--- mesa-11.0.2.orig/include/GL/internal/dri_interface.h ++++ mesa-11.0.2/include/GL/internal/dri_interface.h @@ -886,10 +886,12 @@ struct __DRIbufferRec { unsigned int pitch; unsigned int cpp; @@ -51,8 +57,10 @@ struct __DRIdri2LoaderExtensionRec { __DRIextension base; ---- a/src/egl/drivers/dri2/egl_dri2.c -+++ b/src/egl/drivers/dri2/egl_dri2.c +Index: mesa-11.0.2/src/egl/drivers/dri2/egl_dri2.c +=================================================================== +--- mesa-11.0.2.orig/src/egl/drivers/dri2/egl_dri2.c ++++ mesa-11.0.2/src/egl/drivers/dri2/egl_dri2.c @@ -757,6 +757,12 @@ dri2_initialize(_EGLDriver *drv, _EGLDis return EGL_TRUE; return dri2_initialize_wayland(drv, disp); @@ -90,8 +98,10 @@ for (i = 0; dri2_dpy->driver_configs[i]; i++) free((__DRIconfig *) dri2_dpy->driver_configs[i]); free(dri2_dpy->driver_configs); ---- a/src/egl/drivers/dri2/egl_dri2.h -+++ b/src/egl/drivers/dri2/egl_dri2.h +Index: mesa-11.0.2/src/egl/drivers/dri2/egl_dri2.h +=================================================================== +--- mesa-11.0.2.orig/src/egl/drivers/dri2/egl_dri2.h ++++ mesa-11.0.2/src/egl/drivers/dri2/egl_dri2.h @@ -66,6 +66,10 @@ #endif /* HAVE_ANDROID_PLATFORM */ @@ -156,8 +166,10 @@ +dri2_initialize_mir(_EGLDriver *drv, _EGLDisplay *disp); + #endif /* EGL_DRI2_INCLUDED */ +Index: mesa-11.0.2/src/egl/drivers/dri2/platform_mir.c +=================================================================== --- /dev/null -+++ b/src/egl/drivers/dri2/platform_mir.c ++++ mesa-11.0.2/src/egl/drivers/dri2/platform_mir.c @@ -0,0 +1,617 @@ +/* + * Copyright © 2012 Canonical, Inc @@ -776,8 +788,10 @@ + + return EGL_FALSE; +} ---- a/src/egl/main/egldisplay.c -+++ b/src/egl/main/egldisplay.c +Index: mesa-11.0.2/src/egl/main/egldisplay.c +=================================================================== +--- mesa-11.0.2.orig/src/egl/main/egldisplay.c ++++ mesa-11.0.2/src/egl/main/egldisplay.c @@ -56,7 +56,10 @@ #ifdef HAVE_DRM_PLATFORM #include @@ -867,8 +881,10 @@ char *detection_method = NULL; if (native_platform == _EGL_INVALID_PLATFORM) { ---- a/src/egl/main/egldisplay.h -+++ b/src/egl/main/egldisplay.h +Index: mesa-11.0.2/src/egl/main/egldisplay.h +=================================================================== +--- mesa-11.0.2.orig/src/egl/main/egldisplay.h ++++ mesa-11.0.2/src/egl/main/egldisplay.h @@ -50,6 +50,7 @@ enum _egl_platform_type { _EGL_PLATFORM_ANDROID, _EGL_PLATFORM_HAIKU, @@ -877,8 +893,10 @@ _EGL_NUM_PLATFORMS, _EGL_INVALID_PLATFORM = -1 ---- a/src/gallium/state_trackers/dri/dri2.c -+++ b/src/gallium/state_trackers/dri/dri2.c +Index: mesa-11.0.2/src/gallium/state_trackers/dri/dri2.c +=================================================================== +--- mesa-11.0.2.orig/src/gallium/state_trackers/dri/dri2.c ++++ mesa-11.0.2/src/gallium/state_trackers/dri/dri2.c @@ -531,12 +531,20 @@ dri2_allocate_textures(struct dri_contex templ.height0 = dri_drawable->h; templ.format = format; @@ -904,8 +922,10 @@ drawable->textures[statt] = screen->base.screen->resource_from_handle(screen->base.screen, &templ, &whandle); ---- a/src/gbm/backends/dri/gbm_dri.c -+++ b/src/gbm/backends/dri/gbm_dri.c +Index: mesa-11.0.2/src/gbm/backends/dri/gbm_dri.c +=================================================================== +--- mesa-11.0.2.orig/src/gbm/backends/dri/gbm_dri.c ++++ mesa-11.0.2/src/gbm/backends/dri/gbm_dri.c @@ -202,7 +202,7 @@ static const __DRIimageLookupExtension i }; @@ -979,7 +999,7 @@ static struct gbm_bo * gbm_dri_bo_import(struct gbm_device *gbm, uint32_t type, void *buffer, uint32_t usage) -@@ -836,31 +876,7 @@ gbm_dri_bo_create(struct gbm_device *gbm +@@ -852,31 +892,7 @@ gbm_dri_bo_create(struct gbm_device *gbm bo->base.base.height = height; bo->base.base.format = format; @@ -1012,8 +1032,10 @@ if (usage & GBM_BO_USE_SCANOUT) dri_use |= __DRI_IMAGE_USE_SCANOUT; ---- a/src/egl/Makefile.am -+++ b/src/egl/Makefile.am +Index: mesa-11.0.2/src/egl/Makefile.am +=================================================================== +--- mesa-11.0.2.orig/src/egl/Makefile.am ++++ mesa-11.0.2/src/egl/Makefile.am @@ -75,6 +75,12 @@ AM_CFLAGS += -DHAVE_SURFACELESS_PLATFORM dri2_backend_FILES += drivers/dri2/platform_surfaceless.c endif diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/debian/patches/series mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/patches/series --- mesa-11.0.2+git20151008+11.0.b1230e3e/debian/patches/series 2015-10-26 08:31:19.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/debian/patches/series 2015-10-26 08:31:20.000000000 +0000 @@ -3,4 +3,5 @@ # Ubuntu patches. #egl-platform-mir.patch i915-dont-default-to-2.1.patch -i965-remove-early-release-of-dri2-miptree.patch +#i965-remove-early-release-of-dri2-miptree.patch +#core-fix-EXT_texture_format_BGRA8888.patch diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/docs/relnotes/11.0.3.html mesa-11.0.4~git20151026+11.0.ec14e6f8/docs/relnotes/11.0.3.html --- mesa-11.0.2+git20151008+11.0.b1230e3e/docs/relnotes/11.0.3.html 1970-01-01 00:00:00.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/docs/relnotes/11.0.3.html 2015-10-26 08:16:10.000000000 +0000 @@ -0,0 +1,185 @@ + + + + + Mesa Release Notes + + + + +
+

The Mesa 3D Graphics Library

+
+ + +
+ +

Mesa 11.0.3 Release Notes / October 10, 2015

+ +

+Mesa 11.0.3 is a bug fix release which fixes bugs found since the 11.0.2 release. +

+

+Mesa 11.0.3 implements the OpenGL 4.1 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 4.1. OpenGL +4.1 is only available if requested at context creation +because compatibility contexts are not supported. +

+ + +

SHA256 checksums

+
+c2210e3daecc10ed9fdcea500327652ed6effc2f47c4b9cee63fb08f560d7117  mesa-11.0.3.tar.gz
+ab2992eece21adc23c398720ef8c6933cb69ea42e1b2611dc09d031e17e033d6  mesa-11.0.3.tar.xz
+
+ + +

New features

+

None

+ +

Bug fixes

+ +

This list is likely incomplete.

+ +
    + +
  • Bug 55552 - Compile errors with --enable-mangling
  • + +
  • Bug 71789 - [r300g] Visuals not found in (default) depth = 24
  • + +
  • Bug 91044 - piglit spec/egl_khr_create_context/valid debug flag gles* fail
  • + +
  • Bug 91342 - Very dark textures on some objects in indoors environments in Postal 2
  • + +
  • Bug 91596 - EGL_KHR_gl_colorspace (v2) causes problem with Android-x86 GUI
  • + +
  • Bug 91718 - piglit.spec.arb_shader_image_load_store.invalid causes intermittent GPU HANG
  • + +
  • Bug 92072 - Wine breakage since d082c5324 (st/mesa: don't call st_validate_state in BlitFramebuffer)
  • + +
  • Bug 92265 - Black windows in weston after update mesa to 11.0.2-1
  • + +
+ + +

Changes

+ +

Brian Paul (1):

+
    +
  • st/mesa: try PIPE_BIND_RENDER_TARGET when choosing float texture formats
  • +
+ +

Daniel Scharrer (1):

+
    +
  • mesa: Add abs input modifier to base for POW in ffvertex_prog
  • +
+ +

Emil Velikov (3):

+
    +
  • docs: add sha256 checksums for 11.0.2
  • +
  • Revert "nouveau: make sure there's always room to emit a fence"
  • +
  • Update version to 11.0.3
  • +
+ +

Francisco Jerez (1):

+
    +
  • i965/fs: Fix hang on IVB and VLV with image format mismatch.
  • +
+ +

Ian Romanick (1):

+
    +
  • meta: Handle array textures in scaled MSAA blits
  • +
+ +

Ilia Mirkin (6):

+
    +
  • nouveau: be more careful about freeing temporary transfer buffers
  • +
  • nouveau: delay deleting buffer with unflushed fence
  • +
  • nouveau: wait to unref the transfer's bo until it's no longer used
  • +
  • nv30: pretend to have packed texture/surface formats
  • +
  • nv30: always go through translate module on big-endian
  • +
  • nouveau: make sure there's always room to emit a fence
  • +
+ +

Jason Ekstrand (1):

+
    +
  • mesa: Correctly handle GL_BGRA_EXT in ES3 format_and_type checks
  • +
+ +

Kyle Brenneman (3):

+
    +
  • glx: Fix build errors with --enable-mangling (v2)
  • +
  • mapi: Make _glapi_get_stub work with "gl" or "mgl" prefix.
  • +
  • glx: Don't hard-code the name "libGL.so.1" in driOpenDriver (v3)
  • +
+ +

Leo Liu (1):

+
    +
  • radeon/vce: fix vui time_scale zero error
  • +
+ +

Marek Olšák (21):

+
    +
  • st/mesa: fix front buffer regression after dropping st_validate_state in Blit
  • +
  • radeonsi: handle index buffer alloc failures
  • +
  • radeonsi: handle constant buffer alloc failures
  • +
  • gallium/radeon: handle buffer_map staging buffer failures better
  • +
  • gallium/radeon: handle buffer alloc failures in r600_draw_rectangle
  • +
  • gallium/radeon: add a fail path for depth MSAA texture readback
  • +
  • radeonsi: report alloc failure from si_shader_binary_read
  • +
  • radeonsi: add malloc fail paths to si_create_shader_state
  • +
  • radeonsi: skip drawing if the tess factor ring allocation fails
  • +
  • radeonsi: skip drawing if GS ring allocations fail
  • +
  • radeonsi: handle shader precompile failures
  • +
  • radeonsi: handle fixed-func TCS shader create failure
  • +
  • radeonsi: skip drawing if VS, TCS, TES, GS fail to compile or upload
  • +
  • radeonsi: skip drawing if PS fails to compile or upload
  • +
  • radeonsi: skip drawing if updating the scratch buffer fails
  • +
  • radeonsi: don't forget to update scratch relocations for LS, HS, ES shaders
  • +
  • radeonsi: handle dummy constant buffer allocation failure
  • +
  • gallium/u_blitter: handle allocation failures
  • +
  • radeonsi: add scratch buffer to the buffer list when it's re-allocated
  • +
  • st/dri: don't use _ctx in client_wait_sync
  • +
  • egl/dri2: don't require a context for ClientWaitSync (v2)
  • +
+ +

Matthew Waters (1):

+
    +
  • egl: rework handling EGL_CONTEXT_FLAGS
  • +
+ +

Michel Dänzer (1):

+
    +
  • st/dri: Use packed RGB formats
  • +
+ +

Roland Scheidegger (1):

+
    +
  • mesa: fix mipmap generation for immutable, compressed textures
  • +
+ +

Tom Stellard (3):

+
    +
  • gallium/radeon: Use call_once() when initailizing LLVM targets
  • +
  • gallivm: Allow drivers and state trackers to initialize gallivm LLVM targets v2
  • +
  • radeon/llvm: Initialize gallivm targets when initializing the AMDGPU target v2
  • +
+ +

Varad Gautam (1):

+
    +
  • egl: restore surface type before linking config to its display
  • +
+ +

Ville Syrjälä (3):

+
    +
  • i830: Fix collision between I830_UPLOAD_RASTER_RULES and I830_UPLOAD_TEX(0)
  • +
  • i915: Fix texcoord vs. varying collision in fragment programs
  • +
  • i915: Remember to call intel_prepare_render() before blitting
  • +
+ + +
+ + diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/docs/relnotes/11.0.4.html mesa-11.0.4~git20151026+11.0.ec14e6f8/docs/relnotes/11.0.4.html --- mesa-11.0.2+git20151008+11.0.b1230e3e/docs/relnotes/11.0.4.html 1970-01-01 00:00:00.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/docs/relnotes/11.0.4.html 2015-10-26 08:16:10.000000000 +0000 @@ -0,0 +1,168 @@ + + + + + Mesa Release Notes + + + + +
+

The Mesa 3D Graphics Library

+
+ + +
+ +

Mesa 11.0.4 Release Notes / October 24, 2015

+ +

+Mesa 11.0.4 is a bug fix release which fixes bugs found since the 11.0.3 release. +

+

+Mesa 11.0.4 implements the OpenGL 4.1 API, but the version reported by +glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) / +glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used. +Some drivers don't support all the features required in OpenGL 4.1. OpenGL +4.1 is only available if requested at context creation +because compatibility contexts are not supported. +

+ + +

SHA256 checksums

+
+ed412ca6a46d1bd055120e5c12806c15419ae8c4dd6d3f6ea20a83091d5c78bf  mesa-11.0.4.tar.gz
+40201bf7fc6fa12a6d9edfe870b41eb4dd6669154e3c42c48a96f70805f5483d  mesa-11.0.4.tar.xz
+
+ + +

New features

+

None

+ +

Bug fixes

+ +

This list is likely incomplete.

+ +
    + +
  • Bug 86281 - brw_meta_fast_clear (brw=brw@entry=0x7fffd4097a08, fb=fb@entry=0x7fffd40fa900, buffers=buffers@entry=2, partial_clear=partial_clear@entry=false)
  • + +
  • Bug 86720 - [radeon] Europa Universalis 4 freezing during game start (10.3.3+, still broken on 11.0.2)
  • + +
  • Bug 91788 - [HSW Regression] Synmark2_v6 Multithread performance case FPS reduced by 36%
  • + +
  • Bug 92304 - [cts] cts.shaders.negative conformance tests fail
  • + +
+ + +

Changes

+ +

Alejandro Piñeiro (2):

+
    +
  • i965/vec4: check writemask when bailing out at register coalesce
  • +
  • i965/vec4: fill src_reg type using the constructor type parameter
  • +
+ +

Brian Paul (2):

+
    +
  • vbo: fix incorrect switch statement in init_mat_currval()
  • +
  • mesa: fix incorrect opcode in save_BlendFunci()
  • +
+ +

Chih-Wei Huang (3):

+
    +
  • mesa: android: Fix the incorrect path of sse_minmax.c
  • +
  • nv50/ir: use C++11 standard std::unordered_map if possible
  • +
  • nv30: include the header of ffs prototype
  • +
+ +

Chris Wilson (1):

+
    +
  • i965: Remove early release of DRI2 miptree
  • +
+ +

Dave Airlie (1):

+
    +
  • mesa/uniforms: fix get_uniform for doubles (v2)
  • +
+ +

Emil Velikov (1):

+
    +
  • docs: add sha256 checksums for 11.0.3
  • +
+ +

Francisco Jerez (5):

+
    +
  • i965: Don't tell the hardware about our UAV access.
  • +
  • mesa: Expose function to calculate whether a shader image unit is valid.
  • +
  • mesa: Skip redundant texture completeness checking during image validation.
  • +
  • i965: Use _mesa_is_image_unit_valid() instead of gl_image_unit::_Valid.
  • +
  • mesa: Get rid of texture-dependent image unit derived state.
  • +
+ +

Ian Romanick (8):

+
    +
  • glsl: Allow built-in functions as constant expressions in OpenGL ES 1.00
  • +
  • ff_fragment_shader: Use binding to set the sampler unit
  • +
  • glsl/linker: Use constant_initializer instead of constant_value to initialize uniforms
  • +
  • glsl: Use constant_initializer instead of constant_value to determine whether to keep an unused uniform
  • +
  • glsl: Only set ir_variable::constant_value for const-decorated variables
  • +
  • glsl: Restrict initializers for global variables to constant expression in ES
  • +
  • glsl: Add method to determine whether an expression contains the sequence operator
  • +
  • glsl: In later GLSL versions, sequence operator is cannot be a constant expression
  • +
+ +

Ilia Mirkin (1):

+
    +
  • nouveau: make sure there's always room to emit a fence
  • +
+ +

Indrajit Das (1):

+
    +
  • st/va: Used correct parameter to derive the value of the "h" variable in vlVaCreateImage
  • +
+ +

Jonathan Gray (1):

+
    +
  • configure.ac: ensure RM is set
  • +
+ +

Krzysztof Sobiecki (1):

+
    +
  • st/fbo: use pipe_surface_release instead of pipe_surface_reference
  • +
+ +

Leo Liu (1):

+
    +
  • st/omx/dec/h264: fix field picture type 0 poc disorder
  • +
+ +

Marek Olšák (3):

+
    +
  • st/mesa: fix clip state dependencies
  • +
  • radeonsi: fix a GS copy shader leak
  • +
  • gallium: add PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT
  • +
+ +

Nicolai Hähnle (1):

+
    +
  • u_vbuf: fix vb slot assignment for translated buffers
  • +
+ +

Rob Clark (1):

+
    +
  • freedreno/a3xx: cache-flush is needed after MEM_WRITE
  • +
+ +

Tapani Pälli (3):

+
    +
  • mesa: add GL_UNSIGNED_INT_24_8 to _mesa_pack_depth_span
  • +
  • mesa: Set api prefix to version string when overriding version
  • +
  • mesa: fix ARRAY_SIZE query for GetProgramResourceiv
  • +
+ + +
+ + diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/.lastcommit mesa-11.0.4~git20151026+11.0.ec14e6f8/.lastcommit --- mesa-11.0.2+git20151008+11.0.b1230e3e/.lastcommit 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/.lastcommit 2015-10-26 08:16:10.000000000 +0000 @@ -1 +1 @@ -commit b1230e3e01f1b861ab374f7b115c1f7e4bfd0370 +commit ec14e6f8fd05999b482e0785d8cd286042c9c254 diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/auxiliary/gallivm/lp_bld_limits.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/auxiliary/gallivm/lp_bld_limits.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/auxiliary/gallivm/lp_bld_limits.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/auxiliary/gallivm/lp_bld_limits.h 2015-10-26 08:16:10.000000000 +0000 @@ -137,6 +137,8 @@ case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED: case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; } /* if we get here, we missed a shader cap above (and should have seen * a compiler warning.) diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/auxiliary/tgsi/tgsi_exec.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/auxiliary/tgsi/tgsi_exec.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/auxiliary/tgsi/tgsi_exec.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/auxiliary/tgsi/tgsi_exec.h 2015-10-26 08:16:10.000000000 +0000 @@ -463,6 +463,8 @@ case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED: case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; } /* if we get here, we missed a shader cap above (and should have seen * a compiler warning.) diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/auxiliary/util/u_vbuf.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/auxiliary/util/u_vbuf.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/auxiliary/util/u_vbuf.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/auxiliary/util/u_vbuf.c 2015-10-26 08:16:10.000000000 +0000 @@ -545,6 +545,7 @@ index = ffs(unused_vb_mask) - 1; fallback_vbs[type] = index; + unused_vb_mask &= ~(1 << index); /*printf("found slot=%i for type=%i\n", index, type);*/ } } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/docs/source/screen.rst mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/docs/source/screen.rst --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/docs/source/screen.rst 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/docs/source/screen.rst 2015-10-26 08:16:10.000000000 +0000 @@ -355,6 +355,10 @@ are supported. * ``PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE``: Whether the driver doesn't ignore tgsi_declaration_range::Last for shader inputs and outputs. +* ``PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT``: This is the maximum number + of iterations that loops are allowed to have to be unrolled. It is only + a hint to state trackers. Whether any loops will be unrolled is not + guaranteed. .. _pipe_compute_cap: diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/a3xx/fd3_emit.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/a3xx/fd3_emit.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/a3xx/fd3_emit.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/a3xx/fd3_emit.c 2015-10-26 08:16:10.000000000 +0000 @@ -828,11 +828,7 @@ OUT_RING(ring, A3XX_HLSQ_CONST_FSPRESV_RANGE_REG_STARTENTRY(0) | A3XX_HLSQ_CONST_FSPRESV_RANGE_REG_ENDENTRY(0)); - OUT_PKT0(ring, REG_A3XX_UCHE_CACHE_INVALIDATE0_REG, 2); - OUT_RING(ring, A3XX_UCHE_CACHE_INVALIDATE0_REG_ADDR(0)); - OUT_RING(ring, A3XX_UCHE_CACHE_INVALIDATE1_REG_ADDR(0) | - A3XX_UCHE_CACHE_INVALIDATE1_REG_OPCODE(INVALIDATE) | - A3XX_UCHE_CACHE_INVALIDATE1_REG_ENTIRE_CACHE); + fd3_emit_cache_flush(ctx, ring); OUT_PKT0(ring, REG_A3XX_GRAS_CL_CLIP_CNTL, 1); OUT_RING(ring, 0x00000000); /* GRAS_CL_CLIP_CNTL */ diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/a3xx/fd3_emit.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/a3xx/fd3_emit.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/a3xx/fd3_emit.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/a3xx/fd3_emit.h 2015-10-26 08:16:10.000000000 +0000 @@ -90,4 +90,15 @@ void fd3_emit_init(struct pipe_context *pctx); +static inline void +fd3_emit_cache_flush(struct fd_context *ctx, struct fd_ringbuffer *ring) +{ + fd_wfi(ctx, ring); + OUT_PKT0(ring, REG_A3XX_UCHE_CACHE_INVALIDATE0_REG, 2); + OUT_RING(ring, A3XX_UCHE_CACHE_INVALIDATE0_REG_ADDR(0)); + OUT_RING(ring, A3XX_UCHE_CACHE_INVALIDATE1_REG_ADDR(0) | + A3XX_UCHE_CACHE_INVALIDATE1_REG_OPCODE(INVALIDATE) | + A3XX_UCHE_CACHE_INVALIDATE1_REG_ENTIRE_CACHE); +} + #endif /* FD3_EMIT_H */ diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/a3xx/fd3_gmem.c 2015-10-26 08:16:10.000000000 +0000 @@ -558,6 +558,8 @@ OUT_RING(ring, fui(x1)); OUT_RING(ring, fui(y1)); + fd3_emit_cache_flush(ctx, ring); + for (i = 0; i < 4; i++) { OUT_PKT0(ring, REG_A3XX_RB_MRT_CONTROL(i), 1); OUT_RING(ring, A3XX_RB_MRT_CONTROL_ROP_CODE(ROP_COPY) | diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/freedreno_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/freedreno_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/freedreno/freedreno_screen.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/freedreno/freedreno_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -407,6 +407,8 @@ return 16; case PIPE_SHADER_CAP_PREFERRED_IR: return PIPE_SHADER_IR_TGSI; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; } debug_printf("unknown shader param %d\n", param); return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/i915/i915_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/i915/i915_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/i915/i915_screen.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/i915/i915_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -167,6 +167,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap); return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/ilo/ilo_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/ilo/ilo_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/ilo/ilo_screen.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/ilo/ilo_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -138,6 +138,8 @@ return PIPE_SHADER_IR_TGSI; case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED: return 1; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -25,10 +25,24 @@ #include #include +#if __cplusplus >= 201103L +#include +#else #include +#endif namespace nv50_ir { +#if __cplusplus >= 201103L +using std::hash; +using std::unordered_map; +#elif !defined(ANDROID) +using std::tr1::hash; +using std::tr1::unordered_map; +#else +#error Android release before Lollipop is not supported! +#endif + #define MAX_REGISTER_FILE_SIZE 256 class RegisterSet @@ -349,12 +363,12 @@ struct PhiMapHash { size_t operator()(const std::pair& val) const { - return std::tr1::hash()(val.first) * 31 + - std::tr1::hash()(val.second); + return hash()(val.first) * 31 + + hash()(val.second); } }; -typedef std::tr1::unordered_map< +typedef unordered_map< std::pair, Value *, PhiMapHash> PhiMap; // Critical edges need to be split up so that work can be inserted along diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nouveau_fence.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nouveau_fence.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nouveau_fence.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nouveau_fence.c 2015-10-26 08:16:10.000000000 +0000 @@ -190,8 +190,14 @@ /* wtf, someone is waiting on a fence in flush_notify handler? */ assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING); - if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) - nouveau_fence_emit(fence); + if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) { + PUSH_SPACE(screen->pushbuf, 8); + /* The space allocation might trigger a flush, which could emit the + * current fence. So check again. + */ + if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) + nouveau_fence_emit(fence); + } if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED) if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel)) @@ -224,8 +230,12 @@ void nouveau_fence_next(struct nouveau_screen *screen) { - if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTING) - nouveau_fence_emit(screen->fence.current); + if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTING) { + if (screen->fence.current->ref > 1) + nouveau_fence_emit(screen->fence.current); + else + return; + } nouveau_fence_ref(NULL, &screen->fence.current); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv30/nv30_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv30/nv30_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv30/nv30_screen.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv30/nv30_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -261,6 +261,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: debug_printf("unknown vertex shader param %d\n", param); return 0; @@ -302,6 +304,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: debug_printf("unknown fragment shader param %d\n", param); return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c 2015-10-26 08:16:10.000000000 +0000 @@ -1,3 +1,4 @@ +#include #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv50/nv50_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv50/nv50_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv50/nv50_screen.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv50/nv50_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -297,6 +297,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param); return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv50/nv50_shader_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -65,14 +65,9 @@ PUSH_DATA (push, (b << 12) | (i << 8) | p | 1); } while (words) { - unsigned nr; - - if (!PUSH_SPACE(push, 16)) - break; - nr = PUSH_AVAIL(push); - assert(nr >= 16); - nr = MIN2(MIN2(nr - 3, words), NV04_PFIFO_MAX_PACKET_LEN); + unsigned nr = MIN2(words, NV04_PFIFO_MAX_PACKET_LEN); + PUSH_SPACE(push, nr + 3); BEGIN_NV04(push, NV50_3D(CB_ADDR), 1); PUSH_DATA (push, (start << 8) | b); BEGIN_NI04(push, NV50_3D(CB_DATA(0)), nr); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv50/nv50_transfer.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv50/nv50_transfer.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nv50/nv50_transfer.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nv50/nv50_transfer.c 2015-10-26 08:16:10.000000000 +0000 @@ -187,14 +187,7 @@ PUSH_DATA (push, 0); while (count) { - unsigned nr; - - if (!PUSH_SPACE(push, 16)) - break; - nr = PUSH_AVAIL(push); - assert(nr >= 16); - nr = MIN2(count, nr - 1); - nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN); + unsigned nr = MIN2(count, NV04_PFIFO_MAX_PACKET_LEN); BEGIN_NI04(push, NV50_2D(SIFC_DATA), nr); PUSH_DATAp(push, src, nr); @@ -395,12 +388,9 @@ nouveau_pushbuf_validate(push); while (words) { - unsigned nr; - - nr = PUSH_AVAIL(push); - nr = MIN2(nr - 7, words); - nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN - 1); + unsigned nr = MIN2(words, NV04_PFIFO_MAX_PACKET_LEN); + PUSH_SPACE(push, nr + 7); BEGIN_NV04(push, NV50_3D(CB_DEF_ADDRESS_HIGH), 3); PUSH_DATAh(push, bo->offset + base); PUSH_DATA (push, bo->offset + base); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -310,6 +310,8 @@ return 16; /* would be 32 in linked (OpenGL-style) mode */ case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS: return 16; /* XXX not sure if more are really safe */ + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: NOUVEAU_ERR("unknown PIPE_SHADER_CAP %d\n", param); return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/nouveau/nvc0/nvc0_transfer.c 2015-10-26 08:16:10.000000000 +0000 @@ -188,14 +188,10 @@ nouveau_pushbuf_validate(push); while (count) { - unsigned nr; + unsigned nr = MIN2(count, NV04_PFIFO_MAX_PACKET_LEN); - if (!PUSH_SPACE(push, 16)) + if (!PUSH_SPACE(push, nr + 9)) break; - nr = PUSH_AVAIL(push); - assert(nr >= 16); - nr = MIN2(count, nr - 9); - nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN); BEGIN_NVC0(push, NVC0_M2MF(OFFSET_OUT_HIGH), 2); PUSH_DATAh(push, dst->offset + offset); @@ -234,14 +230,10 @@ nouveau_pushbuf_validate(push); while (count) { - unsigned nr; + unsigned nr = MIN2(count, (NV04_PFIFO_MAX_PACKET_LEN - 1)); - if (!PUSH_SPACE(push, 16)) + if (!PUSH_SPACE(push, nr + 10)) break; - nr = PUSH_AVAIL(push); - assert(nr >= 16); - nr = MIN2(count, nr - 8); - nr = MIN2(nr, (NV04_PFIFO_MAX_PACKET_LEN - 1)); BEGIN_NVC0(push, NVE4_P2MF(UPLOAD_DST_ADDRESS_HIGH), 2); PUSH_DATAh(push, dst->offset + offset); @@ -571,9 +563,7 @@ PUSH_DATA (push, bo->offset + base); while (words) { - unsigned nr = PUSH_AVAIL(push); - nr = MIN2(nr, words); - nr = MIN2(nr, NV04_PFIFO_MAX_PACKET_LEN - 1); + unsigned nr = MIN2(words, NV04_PFIFO_MAX_PACKET_LEN - 1); PUSH_SPACE(push, nr + 2); PUSH_REFN (push, bo, NOUVEAU_BO_WR | domain); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/r300/r300_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/r300/r300_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/r300/r300_screen.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/r300/r300_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -300,6 +300,8 @@ case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED: case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; case PIPE_SHADER_CAP_PREFERRED_IR: return PIPE_SHADER_IR_TGSI; } @@ -356,6 +358,8 @@ case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED: case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; case PIPE_SHADER_CAP_PREFERRED_IR: return PIPE_SHADER_IR_TGSI; } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/r600/r600_pipe.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/r600/r600_pipe.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/r600/r600_pipe.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/r600/r600_pipe.c 2015-10-26 08:16:10.000000000 +0000 @@ -504,6 +504,12 @@ case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED: case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + /* due to a bug in the shader compiler, some loops hang + * if they are not unrolled, see: + * https://bugs.freedesktop.org/show_bug.cgi?id=86720 + */ + return 255; } return 0; } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/radeonsi/si_pipe.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/radeonsi/si_pipe.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/radeonsi/si_pipe.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/radeonsi/si_pipe.c 2015-10-26 08:16:10.000000000 +0000 @@ -489,6 +489,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 1; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; } return 0; } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/radeonsi/si_shader.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/radeonsi/si_shader.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/radeonsi/si_shader.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/radeonsi/si_shader.c 2015-10-26 08:16:10.000000000 +0000 @@ -4201,8 +4201,10 @@ void si_shader_destroy(struct pipe_context *ctx, struct si_shader *shader) { - if (shader->gs_copy_shader) + if (shader->gs_copy_shader) { si_shader_destroy(ctx, shader->gs_copy_shader); + FREE(shader->gs_copy_shader); + } if (shader->scratch_bo) r600_resource_reference(&shader->scratch_bo, NULL); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/svga/svga_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/svga/svga_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/svga/svga_screen.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/svga/svga_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -383,6 +383,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; } /* If we get here, we failed to handle a cap above */ debug_printf("Unexpected fragment shader query %u\n", param); @@ -441,6 +443,8 @@ case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED: case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE: return 0; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; } /* If we get here, we failed to handle a cap above */ debug_printf("Unexpected vertex shader query %u\n", param); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/vc4/vc4_screen.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/vc4/vc4_screen.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/drivers/vc4/vc4_screen.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/drivers/vc4/vc4_screen.c 2015-10-26 08:16:10.000000000 +0000 @@ -334,6 +334,8 @@ return VC4_MAX_TEXTURE_SAMPLERS; case PIPE_SHADER_CAP_PREFERRED_IR: return PIPE_SHADER_IR_TGSI; + case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT: + return 32; default: fprintf(stderr, "unknown shader param %d\n", param); return 0; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/include/pipe/p_defines.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/include/pipe/p_defines.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/include/pipe/p_defines.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/include/pipe/p_defines.h 2015-10-26 08:16:10.000000000 +0000 @@ -674,7 +674,8 @@ PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED, /* all rounding modes */ PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED, PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED, - PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE + PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE, + PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT, }; /** diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/state_trackers/omx/vid_dec_h264.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/state_trackers/omx/vid_dec_h264.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/state_trackers/omx/vid_dec_h264.c 2015-08-29 13:59:39.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/state_trackers/omx/vid_dec_h264.c 2015-10-26 08:16:10.000000000 +0000 @@ -753,10 +753,14 @@ priv->codec_data.h264.delta_pic_order_cnt_bottom = delta_pic_order_cnt_bottom; } - priv->picture.h264.field_order_cnt[0] = pic_order_cnt_msb + pic_order_cnt_lsb; - priv->picture.h264.field_order_cnt[1] = pic_order_cnt_msb + pic_order_cnt_lsb; - if (!priv->picture.h264.field_pic_flag) - priv->picture.h264.field_order_cnt[1] += priv->codec_data.h264.delta_pic_order_cnt_bottom; + if (!priv->picture.h264.field_pic_flag) { + priv->picture.h264.field_order_cnt[0] = pic_order_cnt_msb + pic_order_cnt_lsb; + priv->picture.h264.field_order_cnt[1] = priv->picture.h264.field_order_cnt [0] + + priv->codec_data.h264.delta_pic_order_cnt_bottom; + } else if (!priv->picture.h264.bottom_field_flag) + priv->picture.h264.field_order_cnt[0] = pic_order_cnt_msb + pic_order_cnt_lsb; + else + priv->picture.h264.field_order_cnt[1] = pic_order_cnt_msb + pic_order_cnt_lsb; } else if (sps->pic_order_cnt_type == 1) { unsigned MaxFrameNum = 1 << (sps->log2_max_frame_num_minus4 + 4); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/state_trackers/va/image.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/state_trackers/va/image.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/gallium/state_trackers/va/image.c 2015-02-25 15:01:21.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/gallium/state_trackers/va/image.c 2015-10-26 08:16:10.000000000 +0000 @@ -116,7 +116,7 @@ img->width = width; img->height = height; w = align(width, 2); - h = align(width, 2); + h = align(height, 2); switch (format->fourcc) { case VA_FOURCC('N','V','1','2'): diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/ast_function.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/ast_function.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/ast_function.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/ast_function.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -395,13 +395,54 @@ } } - /* If the function call is a constant expression, don't generate any - * instructions; just generate an ir_constant. + /* Section 4.3.2 (Const) of the GLSL 1.10.59 spec says: + * + * "Initializers for const declarations must be formed from literal + * values, other const variables (not including function call + * paramaters), or expressions of these. + * + * Constructors may be used in such expressions, but function calls may + * not." + * + * Section 4.3.3 (Constant Expressions) of the GLSL 1.20.8 spec says: + * + * "A constant expression is one of + * + * ... + * + * - a built-in function call whose arguments are all constant + * expressions, with the exception of the texture lookup + * functions, the noise functions, and ftransform. The built-in + * functions dFdx, dFdy, and fwidth must return 0 when evaluated + * inside an initializer with an argument that is a constant + * expression." + * + * Section 5.10 (Constant Expressions) of the GLSL ES 1.00.17 spec says: + * + * "A constant expression is one of + * + * ... + * + * - a built-in function call whose arguments are all constant + * expressions, with the exception of the texture lookup + * functions." * - * Function calls were first allowed to be constant expressions in GLSL - * 1.20 and GLSL ES 3.00. + * Section 4.3.3 (Constant Expressions) of the GLSL ES 3.00.4 spec says: + * + * "A constant expression is one of + * + * ... + * + * - a built-in function call whose arguments are all constant + * expressions, with the exception of the texture lookup + * functions. The built-in functions dFdx, dFdy, and fwidth must + * return 0 when evaluated inside an initializer with an argument + * that is a constant expression." + * + * If the function call is a constant expression, don't generate any + * instructions; just generate an ir_constant. */ - if (state->is_version(120, 300)) { + if (state->is_version(120, 100)) { ir_constant *value = sig->constant_expression_value(actual_parameters, NULL); if (value != NULL) { return value; @@ -1911,6 +1952,17 @@ unreachable("not reached"); } +bool +ast_function_expression::has_sequence_subexpression() const +{ + foreach_list_typed(const ast_node, ast, link, &this->expressions) { + if (ast->has_sequence_subexpression()) + return true; + } + + return false; +} + ir_rvalue * ast_aggregate_initializer::hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/ast.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/ast.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/ast.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/ast.h 2015-10-26 08:16:10.000000000 +0000 @@ -62,6 +62,8 @@ virtual ir_rvalue *hir(exec_list *instructions, struct _mesa_glsl_parse_state *state); + virtual bool has_sequence_subexpression() const; + /** * Retrieve the source location of an AST node * @@ -221,6 +223,8 @@ virtual void hir_no_rvalue(exec_list *instructions, struct _mesa_glsl_parse_state *state); + virtual bool has_sequence_subexpression() const; + ir_rvalue *do_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state, bool needs_rvalue); @@ -299,6 +303,8 @@ virtual void hir_no_rvalue(exec_list *instructions, struct _mesa_glsl_parse_state *state); + virtual bool has_sequence_subexpression() const; + private: /** * Is this function call actually a constructor? diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/ast_to_hir.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/ast_to_hir.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/ast_to_hir.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/ast_to_hir.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -939,6 +939,12 @@ return NULL; } +bool +ast_node::has_sequence_subexpression() const +{ + return false; +} + void ast_function_expression::hir_no_rvalue(exec_list *instructions, struct _mesa_glsl_parse_state *state) @@ -1850,6 +1856,80 @@ return result; } +bool +ast_expression::has_sequence_subexpression() const +{ + switch (this->oper) { + case ast_plus: + case ast_neg: + case ast_bit_not: + case ast_logic_not: + case ast_pre_inc: + case ast_pre_dec: + case ast_post_inc: + case ast_post_dec: + return this->subexpressions[0]->has_sequence_subexpression(); + + case ast_assign: + case ast_add: + case ast_sub: + case ast_mul: + case ast_div: + case ast_mod: + case ast_lshift: + case ast_rshift: + case ast_less: + case ast_greater: + case ast_lequal: + case ast_gequal: + case ast_nequal: + case ast_equal: + case ast_bit_and: + case ast_bit_xor: + case ast_bit_or: + case ast_logic_and: + case ast_logic_or: + case ast_logic_xor: + case ast_array_index: + case ast_mul_assign: + case ast_div_assign: + case ast_add_assign: + case ast_sub_assign: + case ast_mod_assign: + case ast_ls_assign: + case ast_rs_assign: + case ast_and_assign: + case ast_xor_assign: + case ast_or_assign: + return this->subexpressions[0]->has_sequence_subexpression() || + this->subexpressions[1]->has_sequence_subexpression(); + + case ast_conditional: + return this->subexpressions[0]->has_sequence_subexpression() || + this->subexpressions[1]->has_sequence_subexpression() || + this->subexpressions[2]->has_sequence_subexpression(); + + case ast_sequence: + return true; + + case ast_field_selection: + case ast_identifier: + case ast_int_constant: + case ast_uint_constant: + case ast_float_constant: + case ast_bool_constant: + case ast_double_constant: + return false; + + case ast_aggregate: + unreachable("ast_aggregate: Should never get here."); + + case ast_function_call: + unreachable("should be handled by ast_function_expression::hir"); + } + + return false; +} ir_rvalue * ast_expression_statement::hir(exec_list *instructions, @@ -3146,16 +3226,72 @@ /* Calculate the constant value if this is a const or uniform * declaration. + * + * Section 4.3 (Storage Qualifiers) of the GLSL ES 1.00.17 spec says: + * + * "Declarations of globals without a storage qualifier, or with + * just the const qualifier, may include initializers, in which case + * they will be initialized before the first line of main() is + * executed. Such initializers must be a constant expression." + * + * The same section of the GLSL ES 3.00.4 spec has similar language. */ if (type->qualifier.flags.q.constant - || type->qualifier.flags.q.uniform) { + || type->qualifier.flags.q.uniform + || (state->es_shader && state->current_function == NULL)) { ir_rvalue *new_rhs = validate_assignment(state, initializer_loc, lhs, rhs, true); if (new_rhs != NULL) { rhs = new_rhs; + /* Section 4.3.3 (Constant Expressions) of the GLSL ES 3.00.4 spec + * says: + * + * "A constant expression is one of + * + * ... + * + * - an expression formed by an operator on operands that are + * all constant expressions, including getting an element of + * a constant array, or a field of a constant structure, or + * components of a constant vector. However, the sequence + * operator ( , ) and the assignment operators ( =, +=, ...) + * are not included in the operators that can create a + * constant expression." + * + * Section 12.43 (Sequence operator and constant expressions) says: + * + * "Should the following construct be allowed? + * + * float a[2,3]; + * + * The expression within the brackets uses the sequence operator + * (',') and returns the integer 3 so the construct is declaring + * a single-dimensional array of size 3. In some languages, the + * construct declares a two-dimensional array. It would be + * preferable to make this construct illegal to avoid confusion. + * + * One possibility is to change the definition of the sequence + * operator so that it does not return a constant-expression and + * hence cannot be used to declare an array size. + * + * RESOLUTION: The result of a sequence operator is not a + * constant-expression." + * + * Section 4.3.3 (Constant Expressions) of the GLSL 4.30.9 spec + * contains language almost identical to the section 4.3.3 in the + * GLSL ES 3.00.4 spec. This is a new limitation for these GLSL + * versions. + */ ir_constant *constant_value = rhs->constant_expression_value(); - if (!constant_value) { + if (!constant_value || + (state->is_version(430, 300) && + decl->initializer->has_sequence_subexpression())) { + const char *const variable_mode = + (type->qualifier.flags.q.constant) + ? "const" + : ((type->qualifier.flags.q.uniform) ? "uniform" : "global"); + /* If ARB_shading_language_420pack is enabled, initializers of * const-qualified local variables do not have to be constant * expressions. Const-qualified global variables must still be @@ -3166,22 +3302,24 @@ _mesa_glsl_error(& initializer_loc, state, "initializer of %s variable `%s' must be a " "constant expression", - (type->qualifier.flags.q.constant) - ? "const" : "uniform", + variable_mode, decl->identifier); if (var->type->is_numeric()) { /* Reduce cascading errors. */ - var->constant_value = ir_constant::zero(state, var->type); + var->constant_value = type->qualifier.flags.q.constant + ? ir_constant::zero(state, var->type) : NULL; } } } else { rhs = constant_value; - var->constant_value = constant_value; + var->constant_value = type->qualifier.flags.q.constant + ? constant_value : NULL; } } else { if (var->type->is_numeric()) { /* Reduce cascading errors. */ - var->constant_value = ir_constant::zero(state, var->type); + var->constant_value = type->qualifier.flags.q.constant + ? ir_constant::zero(state, var->type) : NULL; } } } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/link_uniform_initializers.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/link_uniform_initializers.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/link_uniform_initializers.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/link_uniform_initializers.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -326,9 +326,9 @@ } else { assert(!"Explicit binding not on a sampler, UBO or atomic."); } - } else if (var->constant_value) { + } else if (var->constant_initializer) { linker::set_uniform_initializer(mem_ctx, prog, var->name, - var->type, var->constant_value, + var->type, var->constant_initializer, boolean_true); } } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/opt_dead_code.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/opt_dead_code.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/glsl/opt_dead_code.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/glsl/opt_dead_code.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -103,7 +103,7 @@ */ if (entry->var->data.mode == ir_var_uniform || entry->var->data.mode == ir_var_shader_storage) { - if (uniform_locations_assigned || entry->var->constant_value) + if (uniform_locations_assigned || entry->var->constant_initializer) continue; /* Section 2.11.6 (Uniform Variables) of the OpenGL ES 3.0.3 spec diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/Android.libmesa_dricore.mk mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/Android.libmesa_dricore.mk --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/Android.libmesa_dricore.mk 2015-08-29 13:59:39.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/Android.libmesa_dricore.mk 2015-10-26 08:16:10.000000000 +0000 @@ -50,7 +50,7 @@ ifeq ($(ARCH_X86_HAVE_SSE4_1),true) LOCAL_SRC_FILES += \ main/streaming-load-memcpy.c \ - mesa/main/sse_minmax.c + main/sse_minmax.c LOCAL_CFLAGS := \ -msse4.1 \ -DUSE_SSE41 diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_context.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_context.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_context.c 2015-10-08 10:34:50.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_context.c 2015-10-26 08:16:10.000000000 +0000 @@ -1412,7 +1412,6 @@ buffer->cpp, buffer->pitch); } - intel_miptree_release(&rb->mt); bo = drm_intel_bo_gem_create_from_name(brw->bufmgr, buffer_name, buffer->name); if (!bo) { diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_gs_surface_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_gs_surface_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_gs_surface_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_gs_surface_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -129,7 +129,7 @@ ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY]; if (prog) { - /* BRW_NEW_GS_PROG_DATA, BRW_NEW_IMAGE_UNITS */ + /* BRW_NEW_GS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */ brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_GEOMETRY], &brw->gs.base, &brw->gs.prog_data->base.base); } @@ -137,6 +137,7 @@ const struct brw_tracked_state brw_gs_image_surfaces = { .dirty = { + .mesa = _NEW_TEXTURE, .brw = BRW_NEW_BATCH | BRW_NEW_GEOMETRY_PROGRAM | BRW_NEW_GS_PROG_DATA | diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_vec4.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_vec4.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_vec4.cpp 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_vec4.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -61,6 +61,8 @@ this->swizzle = brw_swizzle_for_size(type->vector_elements); else this->swizzle = BRW_SWIZZLE_XYZW; + if (type) + this->type = brw_type_for_base_type(type); } /** Generic unset register constructor. */ @@ -1105,11 +1107,13 @@ if (interfered) break; - /* If somebody else writes our destination here, we can't coalesce - * before that. + /* If somebody else writes the same channels of our destination here, + * we can't coalesce before that. */ - if (inst->dst.in_range(scan_inst->dst, scan_inst->regs_written)) - break; + if (inst->dst.in_range(scan_inst->dst, scan_inst->regs_written) && + (inst->dst.writemask & scan_inst->dst.writemask) != 0) { + break; + } /* Check for reads of the register we're trying to coalesce into. We * can't go rewriting instructions above that to put some other value diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_vs_surface_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_vs_surface_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_vs_surface_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_vs_surface_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -201,7 +201,7 @@ ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX]; if (prog) { - /* BRW_NEW_VS_PROG_DATA, BRW_NEW_IMAGE_UNITS */ + /* BRW_NEW_VS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */ brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_VERTEX], &brw->vs.base, &brw->vs.prog_data->base.base); } @@ -209,6 +209,7 @@ const struct brw_tracked_state brw_vs_image_surfaces = { .dirty = { + .mesa = _NEW_TEXTURE, .brw = BRW_NEW_BATCH | BRW_NEW_IMAGE_UNITS | BRW_NEW_VERTEX_PROGRAM | diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_wm_surface_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_wm_surface_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/brw_wm_surface_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/brw_wm_surface_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -34,6 +34,7 @@ #include "main/blend.h" #include "main/mtypes.h" #include "main/samplerobj.h" +#include "main/shaderimage.h" #include "program/prog_parameter.h" #include "main/framebuffer.h" @@ -1033,7 +1034,7 @@ ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE]; if (prog) { - /* BRW_NEW_CS_PROG_DATA, BRW_NEW_IMAGE_UNITS */ + /* BRW_NEW_CS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */ brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE], &brw->cs.base, &brw->cs.prog_data->base); } @@ -1041,7 +1042,7 @@ const struct brw_tracked_state brw_cs_image_surfaces = { .dirty = { - .mesa = _NEW_PROGRAM, + .mesa = _NEW_TEXTURE | _NEW_PROGRAM, .brw = BRW_NEW_BATCH | BRW_NEW_CS_PROG_DATA | BRW_NEW_IMAGE_UNITS @@ -1174,7 +1175,7 @@ uint32_t *surf_offset, struct brw_image_param *param) { - if (u->_Valid) { + if (_mesa_is_image_unit_valid(&brw->ctx, u)) { struct gl_texture_object *obj = u->TexObj; const unsigned format = get_image_format(brw, u->_ActualFormat, access); @@ -1259,7 +1260,7 @@ struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram; if (prog) { - /* BRW_NEW_FS_PROG_DATA, BRW_NEW_IMAGE_UNITS */ + /* BRW_NEW_FS_PROG_DATA, BRW_NEW_IMAGE_UNITS, _NEW_TEXTURE */ brw_upload_image_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_FRAGMENT], &brw->wm.base, &brw->wm.prog_data->base); } @@ -1267,6 +1268,7 @@ const struct brw_tracked_state brw_wm_image_surfaces = { .dirty = { + .mesa = _NEW_TEXTURE, .brw = BRW_NEW_BATCH | BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_FS_PROG_DATA | diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen7_gs_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen7_gs_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen7_gs_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen7_gs_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -59,9 +59,7 @@ OUT_BATCH(((ALIGN(stage_state->sampler_count, 4)/4) << GEN6_GS_SAMPLER_COUNT_SHIFT) | ((brw->gs.prog_data->base.base.binding_table.size_bytes / 4) << - GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT) | - (brw->is_haswell && prog_data->base.nr_image_params ? - HSW_GS_UAV_ACCESS_ENABLE : 0)); + GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); if (brw->gs.prog_data->base.base.total_scratch) { OUT_RELOC(stage_state->scratch_bo, diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen7_vs_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen7_vs_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen7_vs_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen7_vs_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -126,9 +126,7 @@ ((ALIGN(stage_state->sampler_count, 4)/4) << GEN6_VS_SAMPLER_COUNT_SHIFT) | ((brw->vs.prog_data->base.base.binding_table.size_bytes / 4) << - GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT) | - (brw->is_haswell && prog_data->base.nr_image_params ? - HSW_VS_UAV_ACCESS_ENABLE : 0)); + GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); if (prog_data->base.total_scratch) { OUT_RELOC(stage_state->scratch_bo, diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen7_wm_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen7_wm_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen7_wm_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen7_wm_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -113,7 +113,14 @@ else if (prog_data->base.nr_image_params) dw1 |= GEN7_WM_EARLY_DS_CONTROL_PSEXEC; - /* _NEW_BUFFERS | _NEW_COLOR */ + /* The "UAV access enable" bits are unnecessary on HSW because they only + * seem to have an effect on the HW-assisted coherency mechanism which we + * don't need, and the rasterization-related UAV_ONLY flag and the + * DISPATCH_ENABLE bit can be set independently from it. + * C.f. gen8_upload_ps_extra(). + * + * BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_FS_PROG_DATA | _NEW_BUFFERS | _NEW_COLOR + */ if (brw->is_haswell && !(brw_color_buffer_write_enabled(brw) || writes_depth) && prog_data->base.nr_image_params) @@ -221,9 +228,6 @@ _mesa_get_min_invocations_per_fragment(ctx, fp, false); assert(min_inv_per_frag >= 1); - if (brw->is_haswell && prog_data->base.nr_image_params) - dw4 |= HSW_PS_UAV_ACCESS_ENABLE; - if (prog_data->prog_offset_16 || prog_data->no_8) { dw4 |= GEN7_PS_16_DISPATCH_ENABLE; if (!prog_data->no_8 && min_inv_per_frag == 1) { diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen8_gs_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen8_gs_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen8_gs_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen8_gs_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -52,9 +52,7 @@ ((ALIGN(stage_state->sampler_count, 4)/4) << GEN6_GS_SAMPLER_COUNT_SHIFT) | ((prog_data->base.binding_table.size_bytes / 4) << - GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT) | - (prog_data->base.nr_image_params ? - HSW_GS_UAV_ACCESS_ENABLE : 0)); + GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); if (brw->gs.prog_data->base.base.total_scratch) { OUT_RELOC64(stage_state->scratch_bo, diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen8_ps_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen8_ps_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen8_ps_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen8_ps_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -25,6 +25,7 @@ #include "program/program.h" #include "brw_state.h" #include "brw_defines.h" +#include "brw_wm.h" #include "intel_batchbuffer.h" void @@ -61,8 +62,33 @@ if (brw->gen >= 9 && prog_data->pulls_bary) dw1 |= GEN9_PSX_SHADER_PULLS_BARY; - if (_mesa_active_fragment_shader_has_atomic_ops(&brw->ctx) || - prog_data->base.nr_image_params) + /* The stricter cross-primitive coherency guarantees that the hardware + * gives us with the "Accesses UAV" bit set for at least one shader stage + * and the "UAV coherency required" bit set on the 3DPRIMITIVE command are + * redundant within the current image, atomic counter and SSBO GL APIs, + * which all have very loose ordering and coherency requirements and + * generally rely on the application to insert explicit barriers when a + * shader invocation is expected to see the memory writes performed by the + * invocations of some previous primitive. Regardless of the value of "UAV + * coherency required", the "Accesses UAV" bits will implicitly cause an in + * most cases useless DC flush when the lowermost stage with the bit set + * finishes execution. + * + * It would be nice to disable it, but in some cases we can't because on + * Gen8+ it also has an influence on rasterization via the PS UAV-only + * signal (which could be set independently from the coherency mechanism in + * the 3DSTATE_WM command on Gen7), and because in some cases it will + * determine whether the hardware skips execution of the fragment shader or + * not via the ThreadDispatchEnable signal. However if we know that + * GEN8_PS_BLEND_HAS_WRITEABLE_RT is going to be set and + * GEN8_PSX_PIXEL_SHADER_NO_RT_WRITE is not set it shouldn't make any + * difference so we may just disable it here. + * + * BRW_NEW_FS_PROG_DATA | BRW_NEW_FRAGMENT_PROGRAM | _NEW_BUFFERS | _NEW_COLOR + */ + if ((_mesa_active_fragment_shader_has_atomic_ops(&brw->ctx) || + prog_data->base.nr_image_params) && + !brw_color_buffer_write_enabled(brw)) dw1 |= GEN8_PSX_SHADER_HAS_UAV; BEGIN_BATCH(2); @@ -87,7 +113,7 @@ const struct brw_tracked_state gen8_ps_extra = { .dirty = { - .mesa = 0, + .mesa = _NEW_BUFFERS | _NEW_COLOR, .brw = BRW_NEW_CONTEXT | BRW_NEW_FRAGMENT_PROGRAM | BRW_NEW_FS_PROG_DATA | diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen8_vs_state.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen8_vs_state.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/drivers/dri/i965/gen8_vs_state.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/drivers/dri/i965/gen8_vs_state.c 2015-10-26 08:16:10.000000000 +0000 @@ -53,9 +53,7 @@ ((ALIGN(stage_state->sampler_count, 4) / 4) << GEN6_VS_SAMPLER_COUNT_SHIFT) | ((prog_data->base.binding_table.size_bytes / 4) << - GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT) | - (prog_data->base.nr_image_params ? - HSW_VS_UAV_ACCESS_ENABLE : 0)); + GEN6_VS_BINDING_TABLE_ENTRY_COUNT_SHIFT)); if (prog_data->base.total_scratch) { OUT_RELOC64(stage_state->scratch_bo, diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/dlist.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/dlist.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/dlist.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/dlist.c 2015-10-26 08:16:10.000000000 +0000 @@ -1401,7 +1401,7 @@ GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 3); + n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_I, 3); if (n) { n[1].ui = buf; n[2].e = sfactor; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/ff_fragment_shader.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/ff_fragment_shader.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/ff_fragment_shader.cpp 2015-02-25 15:01:21.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/ff_fragment_shader.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -976,13 +976,11 @@ ir_var_uniform); p->top_instructions->push_head(sampler); - /* Set the texture unit for this sampler. The linker will pick this value - * up and do-the-right-thing. - * - * NOTE: The cast to int is important. Without it, the constant will have - * type uint, and things later on may get confused. + /* Set the texture unit for this sampler in the same way that + * layout(binding=X) would. */ - sampler->constant_value = new(p->mem_ctx) ir_constant(int(unit)); + sampler->data.explicit_binding = true; + sampler->data.binding = unit; deref = new(p->mem_ctx) ir_dereference_variable(sampler); tex->set_sampler(deref, glsl_type::vec4_type); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/glformats.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/glformats.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/glformats.c 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/glformats.c 2015-10-26 08:16:10.000000000 +0000 @@ -2619,6 +2619,7 @@ * internal formats, they do not correspond to GL constants, so the base * format is returned instead. */ + case GL_BGRA_EXT: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE: case GL_ALPHA: @@ -2738,8 +2739,19 @@ if (effectiveInternalFormat == GL_NONE) return GL_INVALID_OPERATION; - GLenum baseInternalFormat = - _mesa_base_tex_format(ctx, effectiveInternalFormat); + GLenum baseInternalFormat; + if (internalFormat == GL_BGRA_EXT) { + /* Unfortunately, _mesa_base_tex_format returns a base format of + * GL_RGBA for GL_BGRA_EXT. This makes perfect sense if you're + * asking the question, "what channels does this format have?" + * However, if we're trying to determine if two internal formats + * match in the ES3 sense, we actually want GL_BGRA. + */ + baseInternalFormat = GL_BGRA_EXT; + } else { + baseInternalFormat = + _mesa_base_tex_format(ctx, effectiveInternalFormat); + } if (internalFormat != baseInternalFormat) return GL_INVALID_OPERATION; @@ -2748,6 +2760,11 @@ } switch (format) { + case GL_BGRA_EXT: + if (type != GL_UNSIGNED_BYTE || internalFormat != GL_BGRA) + return GL_INVALID_OPERATION; + break; + case GL_RGBA: switch (type) { case GL_UNSIGNED_BYTE: diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/mtypes.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/mtypes.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/mtypes.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/mtypes.h 2015-10-26 08:16:10.000000000 +0000 @@ -4171,13 +4171,6 @@ GLboolean Layered; /** - * GL_TRUE if the state of this image unit is valid and access from - * the shader is allowed. Otherwise loads from this unit should - * return zero and stores should have no effect. - */ - GLboolean _Valid; - - /** * Layer of the texture object bound to this unit as specified by the * application. */ diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/pack.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/pack.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/pack.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/pack.c 2015-10-26 08:16:10.000000000 +0000 @@ -1074,6 +1074,21 @@ } } break; + case GL_UNSIGNED_INT_24_8: + { + const GLdouble scale = (GLdouble) 0xffffff; + GLuint *dst = (GLuint *) dest; + GLuint i; + for (i = 0; i < n; i++) { + GLuint z = (GLuint) (depthSpan[i] * scale); + assert(z <= 0xffffff); + dst[i] = (z << 8); + } + if (dstPacking->SwapBytes) { + _mesa_swap4( (GLuint *) dst, n ); + } + break; + } case GL_UNSIGNED_INT: { GLuint *dst = (GLuint *) dest; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/program_resource.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/program_resource.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/program_resource.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/program_resource.c 2015-10-26 08:16:10.000000000 +0000 @@ -111,11 +111,9 @@ for (i = 0, *params = 0; i < shProg->NumProgramResourceList; i++) { if (shProg->ProgramResourceList[i].Type != programInterface) continue; - const char *name = - _mesa_program_resource_name(&shProg->ProgramResourceList[i]); - unsigned array_size = - _mesa_program_resource_array_size(&shProg->ProgramResourceList[i]); - *params = MAX2(*params, strlen(name) + (array_size ? 3 : 0) + 1); + unsigned len = + _mesa_program_resource_name_len(&shProg->ProgramResourceList[i]); + *params = MAX2(*params, len + 1); } break; case GL_MAX_NUM_ACTIVE_VARIABLES: diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shaderapi.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shaderapi.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shaderapi.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shaderapi.h 2015-10-26 08:16:10.000000000 +0000 @@ -245,6 +245,9 @@ GLsizei bufSize, GLsizei *length, GLchar *name, const char *caller); +extern unsigned +_mesa_program_resource_name_len(struct gl_program_resource *res); + extern GLint _mesa_program_resource_location(struct gl_shader_program *shProg, GLenum programInterface, const char *name); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shaderimage.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shaderimage.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shaderimage.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shaderimage.c 2015-10-26 08:16:10.000000000 +0000 @@ -415,8 +415,8 @@ ctx->ImageUnits[i] = _mesa_default_image_unit(ctx); } -static GLboolean -validate_image_unit(struct gl_context *ctx, struct gl_image_unit *u) +GLboolean +_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u) { struct gl_texture_object *t = u->TexObj; mesa_format tex_format; @@ -424,7 +424,8 @@ if (!t) return GL_FALSE; - _mesa_test_texobj_completeness(ctx, t); + if (!t->_BaseComplete && !t->_MipmapComplete) + _mesa_test_texobj_completeness(ctx, t); if (u->Level < t->BaseLevel || u->Level > t->_MaxLevel || @@ -473,17 +474,6 @@ return GL_TRUE; } -void -_mesa_validate_image_units(struct gl_context *ctx) -{ - unsigned i; - - for (i = 0; i < ctx->Const.MaxImageUnits; ++i) { - struct gl_image_unit *u = &ctx->ImageUnits[i]; - u->_Valid = validate_image_unit(ctx, u); - } -} - static GLboolean validate_bind_image_texture(struct gl_context *ctx, GLuint unit, GLuint texture, GLint level, GLboolean layered, @@ -567,7 +557,6 @@ u->Access = access; u->Format = format; u->_ActualFormat = _mesa_get_shader_image_format(format); - u->_Valid = validate_image_unit(ctx, u); if (u->TexObj && _mesa_tex_target_is_layered(u->TexObj->Target)) { u->Layered = layered; @@ -707,7 +696,6 @@ u->Access = GL_READ_WRITE; u->Format = tex_format; u->_ActualFormat = _mesa_get_shader_image_format(tex_format); - u->_Valid = validate_image_unit(ctx, u); } else { /* Unbind the texture from the unit */ _mesa_reference_texobj(&u->TexObj, NULL); @@ -717,7 +705,6 @@ u->Access = GL_READ_ONLY; u->Format = GL_R8; u->_ActualFormat = MESA_FORMAT_R_UNORM8; - u->_Valid = GL_FALSE; } /* Pass the BindImageTexture call down to the device driver */ diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shaderimage.h mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shaderimage.h --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shaderimage.h 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shaderimage.h 2015-10-26 08:16:10.000000000 +0000 @@ -55,13 +55,15 @@ _mesa_init_image_units(struct gl_context *ctx); /** - * Recalculate the \c _Valid flag of a context's shader image units. + * Return GL_TRUE if the state of the image unit passed as argument is valid + * and access from the shader is allowed. Otherwise loads from this unit + * should return zero and stores should have no effect. * - * To be called when the state of any texture bound to an image unit - * changes. + * The result depends on context state other than the passed image unit, part + * of the _NEW_TEXTURE set. */ -void -_mesa_validate_image_units(struct gl_context *ctx); +GLboolean +_mesa_is_image_unit_valid(struct gl_context *ctx, struct gl_image_unit *u); void GLAPIENTRY _mesa_BindImageTexture(GLuint unit, GLuint texture, GLint level, diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shader_query.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shader_query.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/shader_query.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/shader_query.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -476,7 +476,7 @@ RESOURCE_XFB(res)->Size : 0; case GL_PROGRAM_INPUT: case GL_PROGRAM_OUTPUT: - return RESOURCE_VAR(res)->data.max_array_access; + return RESOURCE_VAR(res)->type->length; case GL_UNIFORM: case GL_VERTEX_SUBROUTINE_UNIFORM: case GL_GEOMETRY_SUBROUTINE_UNIFORM: @@ -661,6 +661,57 @@ return NULL; } +/* Function returns if resource name is expected to have index + * appended into it. + * + * + * Page 61 (page 73 of the PDF) in section 2.11 of the OpenGL ES 3.0 + * spec says: + * + * "If the active uniform is an array, the uniform name returned in + * name will always be the name of the uniform array appended with + * "[0]"." + * + * The same text also appears in the OpenGL 4.2 spec. It does not, + * however, appear in any previous spec. Previous specifications are + * ambiguous in this regard. However, either name can later be passed + * to glGetUniformLocation (and related APIs), so there shouldn't be any + * harm in always appending "[0]" to uniform array names. + * + * Geometry shader stage has different naming convention where the 'normal' + * condition is an array, therefore for variables referenced in geometry + * stage we do not add '[0]'. + * + * Note, that TCS outputs and TES inputs should not have index appended + * either. + */ +static bool +add_index_to_name(struct gl_program_resource *res) +{ + bool add_index = !(((res->Type == GL_PROGRAM_INPUT) && + res->StageReferences & (1 << MESA_SHADER_GEOMETRY))); + + /* Transform feedback varyings have array index already appended + * in their names. + */ + if (res->Type == GL_TRANSFORM_FEEDBACK_VARYING) + add_index = false; + + return add_index; +} + +/* Get name length of a program resource. This consists of + * base name + 3 for '[0]' if resource is an array. + */ +extern unsigned +_mesa_program_resource_name_len(struct gl_program_resource *res) +{ + unsigned length = strlen(_mesa_program_resource_name(res)); + if (_mesa_program_resource_array_size(res) && add_index_to_name(res)) + length += 3; + return length; +} + /* Get full name of a program resource. */ bool @@ -696,36 +747,7 @@ _mesa_copy_string(name, bufSize, length, _mesa_program_resource_name(res)); - /* Page 61 (page 73 of the PDF) in section 2.11 of the OpenGL ES 3.0 - * spec says: - * - * "If the active uniform is an array, the uniform name returned in - * name will always be the name of the uniform array appended with - * "[0]"." - * - * The same text also appears in the OpenGL 4.2 spec. It does not, - * however, appear in any previous spec. Previous specifications are - * ambiguous in this regard. However, either name can later be passed - * to glGetUniformLocation (and related APIs), so there shouldn't be any - * harm in always appending "[0]" to uniform array names. - * - * Geometry shader stage has different naming convention where the 'normal' - * condition is an array, therefore for variables referenced in geometry - * stage we do not add '[0]'. - * - * Note, that TCS outputs and TES inputs should not have index appended - * either. - */ - bool add_index = !(((programInterface == GL_PROGRAM_INPUT) && - res->StageReferences & (1 << MESA_SHADER_GEOMETRY))); - - /* Transform feedback varyings have array index already appended - * in their names. - */ - if (programInterface == GL_TRANSFORM_FEEDBACK_VARYING) - add_index = false; - - if (add_index && _mesa_program_resource_array_size(res)) { + if (_mesa_program_resource_array_size(res) && add_index_to_name(res)) { int i; /* The comparison is strange because *length does *NOT* include the @@ -972,13 +994,9 @@ switch (res->Type) { case GL_ATOMIC_COUNTER_BUFFER: goto invalid_operation; - case GL_TRANSFORM_FEEDBACK_VARYING: - *val = strlen(_mesa_program_resource_name(res)) + 1; - break; default: - /* Base name +3 if array '[0]' + terminator. */ - *val = strlen(_mesa_program_resource_name(res)) + - (_mesa_program_resource_array_size(res) > 0 ? 3 : 0) + 1; + /* Resource name length + terminator. */ + *val = _mesa_program_resource_name_len(res) + 1; } return 1; case GL_TYPE: @@ -1003,7 +1021,7 @@ return 1; case GL_PROGRAM_INPUT: case GL_PROGRAM_OUTPUT: - *val = MAX2(RESOURCE_VAR(res)->type->length, 1); + *val = MAX2(_mesa_program_resource_array_size(res), 1); return 1; case GL_TRANSFORM_FEEDBACK_VARYING: *val = MAX2(RESOURCE_XFB(res)->Size, 1); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/texstate.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/texstate.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/texstate.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/texstate.c 2015-10-26 08:16:10.000000000 +0000 @@ -34,7 +34,6 @@ #include "context.h" #include "enums.h" #include "macros.h" -#include "shaderimage.h" #include "texobj.h" #include "teximage.h" #include "texstate.h" @@ -741,8 +740,6 @@ if (!prog[MESA_SHADER_FRAGMENT] || !prog[MESA_SHADER_VERTEX]) update_texgen(ctx); - - _mesa_validate_image_units(ctx); } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/uniform_query.cpp mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/uniform_query.cpp --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/uniform_query.cpp 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/uniform_query.cpp 2015-10-26 08:16:10.000000000 +0000 @@ -319,19 +319,12 @@ return; } - if ((uni->type->base_type == GLSL_TYPE_DOUBLE && - returnType != GLSL_TYPE_DOUBLE) || - (uni->type->base_type != GLSL_TYPE_DOUBLE && - returnType == GLSL_TYPE_DOUBLE)) { - _mesa_error( ctx, GL_INVALID_OPERATION, - "glGetnUniform*vARB(incompatible uniform types)"); - return; - } { unsigned elements = (uni->type->is_sampler()) ? 1 : uni->type->components(); const int dmul = uni->type->base_type == GLSL_TYPE_DOUBLE ? 2 : 1; + const int rmul = returnType == GLSL_TYPE_DOUBLE ? 2 : 1; /* Calculate the source base address *BEFORE* modifying elements to * account for the size of the user's buffer. @@ -343,7 +336,7 @@ returnType == GLSL_TYPE_UINT || returnType == GLSL_TYPE_DOUBLE); /* doubles have a different size than the other 3 types */ - unsigned bytes = sizeof(src[0]) * elements * dmul; + unsigned bytes = sizeof(src[0]) * elements * rmul; if (bufSize < 0 || bytes > (unsigned) bufSize) { _mesa_error( ctx, GL_INVALID_OPERATION, "glGetnUniform*vARB(out of bounds: bufSize is %d," @@ -367,32 +360,57 @@ } else { union gl_constant_value *const dst = (union gl_constant_value *) paramsOut; - /* This code could be optimized by putting the loop inside the switch * statements. However, this is not expected to be * performance-critical code. */ for (unsigned i = 0; i < elements; i++) { + int sidx = i * dmul; + int didx = i * rmul; + switch (returnType) { case GLSL_TYPE_FLOAT: switch (uni->type->base_type) { case GLSL_TYPE_UINT: - dst[i].f = (float) src[i].u; + dst[didx].f = (float) src[sidx].u; break; case GLSL_TYPE_INT: case GLSL_TYPE_SAMPLER: case GLSL_TYPE_IMAGE: - dst[i].f = (float) src[i].i; + dst[didx].f = (float) src[sidx].i; break; case GLSL_TYPE_BOOL: - dst[i].f = src[i].i ? 1.0f : 0.0f; + dst[didx].f = src[sidx].i ? 1.0f : 0.0f; + break; + case GLSL_TYPE_DOUBLE: + dst[didx].f = *(double *)&src[sidx].f; + break; + default: + assert(!"Should not get here."); + break; + } + break; + case GLSL_TYPE_DOUBLE: + switch (uni->type->base_type) { + case GLSL_TYPE_UINT: + *(double *)&dst[didx].f = (double) src[sidx].u; + break; + case GLSL_TYPE_INT: + case GLSL_TYPE_SAMPLER: + case GLSL_TYPE_IMAGE: + *(double *)&dst[didx].f = (double) src[sidx].i; + break; + case GLSL_TYPE_BOOL: + *(double *)&dst[didx].f = src[sidx].i ? 1.0f : 0.0f; + break; + case GLSL_TYPE_FLOAT: + *(double *)&dst[didx].f = (double) src[sidx].f; break; default: assert(!"Should not get here."); break; } break; - case GLSL_TYPE_INT: case GLSL_TYPE_UINT: switch (uni->type->base_type) { @@ -414,10 +432,13 @@ * a floating-point value is rounded to the * nearest integer..." */ - dst[i].i = IROUND(src[i].f); + dst[didx].i = IROUND(src[sidx].f); break; case GLSL_TYPE_BOOL: - dst[i].i = src[i].i ? 1 : 0; + dst[didx].i = src[sidx].i ? 1 : 0; + break; + case GLSL_TYPE_DOUBLE: + dst[didx].i = *(double *)&src[sidx].f; break; default: assert(!"Should not get here."); diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/version.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/version.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/main/version.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/main/version.c 2015-10-26 08:16:10.000000000 +0000 @@ -24,6 +24,7 @@ #include +#include "context.h" #include "imports.h" #include "mtypes.h" #include "version.h" @@ -181,7 +182,23 @@ { if (_mesa_override_gl_version_contextless(&ctx->Const, &ctx->API, &ctx->Version)) { - create_version_string(ctx, ""); + /* We need to include API in version string for OpenGL ES, otherwise + * application can not detect GLES via glGetString(GL_VERSION) query. + * + * From OpenGL ES 3.2 spec, Page 436: + * + * "The VERSION string is laid out as follows: + * + * OpenGL ES N.M vendor-specific information" + * + * From OpenGL 4.5 spec, Page 538: + * + * "The VERSION and SHADING_LANGUAGE_VERSION strings are laid out as + * follows: + * + * " + */ + create_version_string(ctx, _mesa_is_gles(ctx) ? "OpenGL ES " : ""); } } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/state_tracker/st_atom_clip.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/state_tracker/st_atom_clip.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/state_tracker/st_atom_clip.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/state_tracker/st_atom_clip.c 2015-10-26 08:16:10.000000000 +0000 @@ -56,6 +56,9 @@ use_eye = TRUE; } + /* _ClipUserPlane = _NEW_TRANSFORM | _NEW_PROJECTION + * EyeUserPlane = _NEW_TRANSFORM + */ memcpy(clip.ucp, use_eye ? ctx->Transform.EyeUserPlane : ctx->Transform._ClipUserPlane, sizeof(clip.ucp)); @@ -70,7 +73,7 @@ const struct st_tracked_state st_update_clip = { "st_update_clip", /* name */ { /* dirty */ - _NEW_TRANSFORM, /* mesa */ + _NEW_TRANSFORM | _NEW_PROJECTION, /* mesa */ ST_NEW_VERTEX_PROGRAM, /* st */ }, update_clip /* update */ diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/state_tracker/st_cb_fbo.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/state_tracker/st_cb_fbo.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/state_tracker/st_cb_fbo.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/state_tracker/st_cb_fbo.c 2015-10-26 08:16:10.000000000 +0000 @@ -478,7 +478,7 @@ surf_tmpl.u.tex.first_layer = first_layer; surf_tmpl.u.tex.last_layer = last_layer; - pipe_surface_reference(&strb->surface, NULL); + pipe_surface_release(pipe, &strb->surface); strb->surface = pipe->create_surface(pipe, resource, &surf_tmpl); } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/state_tracker/st_extensions.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/state_tracker/st_extensions.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/state_tracker/st_extensions.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/state_tracker/st_extensions.c 2015-10-26 08:16:10.000000000 +0000 @@ -249,6 +249,9 @@ if (options->EmitNoLoops) options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536); + else + options->MaxUnrollIterations = screen->get_shader_param(screen, sh, + PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT); options->LowerClipDistance = true; } diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/vbo/vbo_context.c mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/vbo/vbo_context.c --- mesa-11.0.2+git20151008+11.0.b1230e3e/src/mesa/vbo/vbo_context.c 2015-09-28 06:03:49.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/src/mesa/vbo/vbo_context.c 2015-10-26 08:16:10.000000000 +0000 @@ -121,7 +121,7 @@ /* Size is fixed for the material attributes, for others will * be determined at runtime: */ - switch (i - VERT_ATTRIB_GENERIC0) { + switch (i) { case MAT_ATTRIB_FRONT_SHININESS: case MAT_ATTRIB_BACK_SHININESS: cl->Size = 1; diff -Nru mesa-11.0.2+git20151008+11.0.b1230e3e/VERSION mesa-11.0.4~git20151026+11.0.ec14e6f8/VERSION --- mesa-11.0.2+git20151008+11.0.b1230e3e/VERSION 2015-10-08 10:34:05.000000000 +0000 +++ mesa-11.0.4~git20151026+11.0.ec14e6f8/VERSION 2015-10-26 08:16:10.000000000 +0000 @@ -1 +1 @@ -11.0.2 +11.0.4