Jason Ekstrand [Mon, 25 Jan 2016 23:52:53 +0000 (15:52 -0800)]
HACK/i965: Default to scalar GS on BDW+
Jason Ekstrand [Mon, 25 Jan 2016 23:50:31 +0000 (15:50 -0800)]
Merge remote-tracking branch 'mattst88/nir-lower-pack-unpack' into vulkan
Jason Ekstrand [Mon, 25 Jan 2016 23:33:08 +0000 (15:33 -0800)]
gen7/state: Apply min/mag filters individually for samplers
This fixes tests which apply different min and mag filters, and depend on
the min filter to be correct.
Ben Widawsky [Mon, 25 Jan 2016 23:26:25 +0000 (15:26 -0800)]
gen8/state: Apply min/mag filters individually for samplers
This fixes tests which apply different min and mag filters, and depend on the
min filter to be correct.
Jason Ekstrand [Mon, 25 Jan 2016 23:00:38 +0000 (15:00 -0800)]
i965/fs: Feel free to spill partial reads/writes
Now that we properly handle write-masking, this should be safe.
Jason Ekstrand [Mon, 25 Jan 2016 20:42:01 +0000 (12:42 -0800)]
i965/fs: Properly write-mask spills
For unspills (scratch reads), we can just set WE_all all the time because
we always unspill into a new GRF. For spills, we have two options: If the
instruction has a 32-bit-per-channel destination and "normal" regioning,
then we just do a regular write and it will interleave channels from
different control-flow paths properly. If, on the other hand, the the
regioning is non-normal, then we have to unspill, run the instruction, and
spill afterwards. In this second case, we need to do the spill with
we_ALL.
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 23:14:47 +0000 (15:14 -0800)]
anv: Remove a few finished finishme
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 23:12:43 +0000 (15:12 -0800)]
anv: Remove stale assert
This goes back to when we didn't have the subpass number in the command
buffer begin info.
Matt Turner [Mon, 25 Jan 2016 19:07:28 +0000 (11:07 -0800)]
i965/gen7+: Use NIR for lowering of pack/unpack opcodes.
Matt Turner [Mon, 25 Jan 2016 18:49:15 +0000 (10:49 -0800)]
i965/vec4: Implement nir_op_pack_uvec2_to_uint.
And mark nir_op_pack_uvec4_to_uint unreachable, since it's only produced
by lowering pack[SU]norm4x8 which the vec4 backend does not need.
Matt Turner [Mon, 25 Jan 2016 19:07:02 +0000 (11:07 -0800)]
nir: Add lowering support for unpacking opcodes.
Matt Turner [Mon, 25 Jan 2016 19:05:52 +0000 (11:05 -0800)]
nir: Add lowering support for packing opcodes.
Matt Turner [Thu, 21 Jan 2016 02:56:37 +0000 (18:56 -0800)]
i965/fs: Implement support for extract_word.
The vec4 backend will lower it.
Matt Turner [Thu, 21 Jan 2016 17:09:29 +0000 (09:09 -0800)]
nir: Add opcodes to extract bytes or words.
The uint versions zero extend while the int versions sign extend.
Nanley Chery [Thu, 31 Dec 2015 00:00:47 +0000 (16:00 -0800)]
anv/meta: Fix CopyBuffer when size matches HW limit
Perform a copy when the copy_size matches the HW limit (max_copy_size).
Otherwise the current behavior is that we fail the following assertion:
assert(height < max_surface_dim);
because the values are equal.
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 19:34:32 +0000 (11:34 -0800)]
anv: Don't use uninitialized barycentric_interp_modes
If we don't have a fragment shader, wm_prog_data in undefined.
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 19:24:19 +0000 (11:24 -0800)]
anv: Disable fs dispatch for depth/stencil only pipelines
Fixes most renderpass bugs.
Matt Turner [Thu, 21 Jan 2016 19:46:22 +0000 (11:46 -0800)]
glsl: Remove 2x16 half-precision pack/unpack opcodes.
i965/fs was the only consumer, and we're now doing the lowering in NIR.
Matt Turner [Thu, 21 Jan 2016 23:30:57 +0000 (15:30 -0800)]
i965/fs: Switch from GLSL IR to NIR for un/packHalf2x16 lowering.
Matt Turner [Thu, 21 Jan 2016 23:46:47 +0000 (15:46 -0800)]
nir: Add lowering of nir_op_unpack_half_2x16.
Matt Turner [Thu, 21 Jan 2016 17:30:05 +0000 (09:30 -0800)]
i965: Make separate nir_options for scalar/vector stages.
We'll want to have different lowering options set for scalar/vector
stages.
Matt Turner [Thu, 21 Jan 2016 17:19:53 +0000 (09:19 -0800)]
i965: Move brw_compiler_create() to new brw_compiler.c.
A future patch will want to use designated initalizers, which aren't
available in C++, but this is C.
Matt Turner [Thu, 21 Jan 2016 17:54:19 +0000 (09:54 -0800)]
nir: Make argument order of unop_convert match binop_convert.
Strangely the return and parameter types were reversed.
Jason Ekstrand [Sat, 23 Jan 2016 06:57:02 +0000 (22:57 -0800)]
anv/cmd_buffer: Zero out binding tables and samplers in state_reset
This fixes a use of an undefined value if the client uses push constants in
a stage without ever setting any descriptors on GEN8-9.
Jason Ekstrand [Sat, 23 Jan 2016 06:04:09 +0000 (22:04 -0800)]
nir/opcodes: Properly flush denormals in fquantize2f16
Jason Ekstrand [Sat, 23 Jan 2016 05:24:53 +0000 (21:24 -0800)]
i965/nir: Properly flush denormals in nir_op_fquantize2f16
Jason Ekstrand [Sat, 23 Jan 2016 03:14:41 +0000 (19:14 -0800)]
anv/format: Add a helpful comment about format names
Jason Ekstrand [Sat, 23 Jan 2016 03:03:27 +0000 (19:03 -0800)]
anv/formats: Add support for 3 more formats
Jason Ekstrand [Sat, 23 Jan 2016 03:02:55 +0000 (19:02 -0800)]
anv/pipeline: Add a default L3$ setup
Chad Versace [Sat, 23 Jan 2016 01:51:24 +0000 (17:51 -0800)]
anv/formats: Rename ambiguous func parameter
vkGetPhysicalDeviceImageFormatProperties has multiple 'flags'
parameters.
Chad Versace [Sat, 23 Jan 2016 01:47:59 +0000 (17:47 -0800)]
anv/formats: Advertise multisample formats
Teach vkGetPhysicalDeviceImageFormatProperties() to advertise
multisampled formats.
Chad Versace [Sat, 23 Jan 2016 01:16:20 +0000 (17:16 -0800)]
anv/image: Drop assertion that samples == 1
Chad Versace [Sat, 23 Jan 2016 01:06:55 +0000 (17:06 -0800)]
isl: Fix gen8_choose_msaa_layout()
Gen8 requires any Y tiling, not any *standard* Y tiling.
Chad Versace [Sat, 23 Jan 2016 01:06:44 +0000 (17:06 -0800)]
isl: Add func isl_tiling_is_any_y()
Chad Versace [Thu, 21 Jan 2016 01:03:29 +0000 (17:03 -0800)]
anv/meta: Assert correct sample counts for blit funcs
Add assertions to:
anv_CmdBlitImage
anv_CmdCopyImage
anv_CmdCopyImageToBuffer
anv_CmdCopyBufferToImage
Chad Versace [Thu, 21 Jan 2016 00:34:23 +0000 (16:34 -0800)]
anv: Add anv_image::samples
It's set but not yet used.
Chad Versace [Thu, 21 Jan 2016 00:04:28 +0000 (16:04 -0800)]
anv: Use isl_device_get_sample_counts()
Use it in vkGetPhysicalDeviceProperties.
Chad Versace [Wed, 20 Jan 2016 23:53:54 +0000 (15:53 -0800)]
isl: Add func isl_device_get_sample_counts()
Nanley Chery [Fri, 22 Jan 2016 23:07:12 +0000 (15:07 -0800)]
gen8/state: Remove SKL special-casing for MinimumArrayElement
MinimumArrayElement carries the same meaning for BDW and SKL.
Suggested by Jason.
No regressions in dEQP-VK.pipeline.image.view_type.cube_array.*
Fixes a number of cube tests, including cube_array_base_slice
and cube_base_slice tests.
Chad Versace [Fri, 22 Jan 2016 22:48:36 +0000 (14:48 -0800)]
anv/state: Dedupe code for lowering surface format
Add helper anv_surface_format().
Francisco Jerez [Fri, 22 Jan 2016 23:57:02 +0000 (15:57 -0800)]
anv/meta: Set sampler type and instruction arrayness consistently in blit shader.
Francisco Jerez [Fri, 22 Jan 2016 23:57:01 +0000 (15:57 -0800)]
anv/meta: Fix meta blit fragment shader for 1D arrays.
Jason Ekstrand [Sat, 23 Jan 2016 00:34:13 +0000 (16:34 -0800)]
genX/state: Set CubeSurfaceControlMode to OVERRIDE
This makes it act like the address mode is set to TEXCOORDMODE_CUBE
whenever this sampler is combined with a cube surface. This *should* be
what we need for Vulkan. Interestingly, the PRM contains a programming
note for this field that says simply, "This field must be set to
CUBECTRLMODE_PROGRAMMED". However, emprical evidence suggests that it does
what the PRM says it does and OVERRIDE is just fine.
Jason Ekstrand [Sat, 23 Jan 2016 00:13:36 +0000 (16:13 -0800)]
gen8/state: Divide depth by 6 for cube maps for GEN8
For Broadwell cube maps, MinimumArrayElement is in terms of 2d slices (a
multiple of 6) but Depth is in terms of whole cubes.
Nanley Chery [Fri, 22 Jan 2016 20:17:25 +0000 (12:17 -0800)]
gen8_state: Enable all cube faces
These fields are ignored for non-cube surfaces. For cube surfaces
these fields should be enabled when using TEXCOORDMODE_CLAMP and
TEXCOORDMODE_CUBE.
TODO: Determine if these are the only two modes used in Vulkan.
Jason Ekstrand [Fri, 22 Jan 2016 19:57:49 +0000 (11:57 -0800)]
isl/format_layout: R11G11B10_FLOAT is unsigned
Jason Ekstrand [Fri, 22 Jan 2016 19:57:01 +0000 (11:57 -0800)]
anv/image: Move common code to anv_image.c
Jason Ekstrand [Fri, 22 Jan 2016 19:40:56 +0000 (11:40 -0800)]
anv/state: Refactor surface state setup into a "fill" function
Francisco Jerez [Fri, 22 Jan 2016 03:21:35 +0000 (19:21 -0800)]
anv/state: Add missing clflushes for storage image surface state.
Francisco Jerez [Fri, 22 Jan 2016 03:21:34 +0000 (19:21 -0800)]
anv/state: Factor out surface state calculation from genX_image_view_init.
Some fields of the surface state template were dependent on the
surface type, which is dependent on the usage of the image view, which
wasn't known until the bottom of the function after the template had
been constructed. This caused failures in all image load/store CTS
tests using cubemaps. Refactor the surface state calculation into a
function that is called once for each required usage.
Jason Ekstrand [Fri, 22 Jan 2016 19:09:24 +0000 (11:09 -0800)]
i965/nir: Temporariliy disable mul+add fusion
We don't want to do this in the long-run but it's needed for passing the
NoContraction tests at the moment. Eventually, we want to plumb this
through NIR properly.
Chad Versace [Fri, 22 Jan 2016 17:48:11 +0000 (09:48 -0800)]
isl: Fix indentation of isl_format_layout comment
Chad Versace [Fri, 22 Jan 2016 17:46:48 +0000 (09:46 -0800)]
isl/tests: Give tests less cryptic names
Chad Versace [Fri, 22 Jan 2016 16:32:00 +0000 (08:32 -0800)]
isl: Fix isl_surf_get_image_offset_sa for gen4_3d layout
Bug found by unit test
test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0.
Chad Versace [Fri, 22 Jan 2016 16:31:29 +0000 (08:31 -0800)]
isl/tests: Add test for bdw 3d surface
test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0
Currently fails.
Chad Versace [Fri, 22 Jan 2016 15:17:34 +0000 (07:17 -0800)]
isl/tests: Remove copy-paste assertion
Chad Versace [Fri, 22 Jan 2016 15:17:06 +0000 (07:17 -0800)]
isl/tests: Fix build
isl_device_init() acquired a new param for bit6 swizzling.
Francisco Jerez [Thu, 21 Jan 2016 22:14:07 +0000 (14:14 -0800)]
anv/batch_chain: Fix patching up of block pool relocations on Gen8+.
Relocations are 64 bits on Gen8+. Most CTS tests that send
non-trivial work to the GPU would fail when run from a single deqp-vk
invocation because they were effectively relying on reloc presumed
offsets to be wrong so the kernel would come and apply relocations
correctly.
Jason Ekstrand [Fri, 22 Jan 2016 00:03:06 +0000 (16:03 -0800)]
nir/spirv: Ignore cull distance
Jason Ekstrand [Fri, 22 Jan 2016 00:00:47 +0000 (16:00 -0800)]
nir/lower_system_values: Use the correct invication id for CS
Jason Ekstrand [Thu, 21 Jan 2016 20:41:45 +0000 (12:41 -0800)]
nir/spirv: Properly assign locations to split structures
Jason Ekstrand [Thu, 21 Jan 2016 18:58:53 +0000 (10:58 -0800)]
nir/spirv: Improve handling of variable loads and copies
Before we were asuming that a deref would either be something in a block or
something that we could pass off to NIR directly. However, it is possible
that someone would choose to load/store/copy a split structure all in one
go. We need to be able to handle that.
Jason Ekstrand [Thu, 21 Jan 2016 18:58:03 +0000 (10:58 -0800)]
nir/spirv: Make vectors a proper array time with an array_element
This makes dealing with single-component derefs easier
Jason Ekstrand [Thu, 21 Jan 2016 18:20:50 +0000 (10:20 -0800)]
nir/spirv: Rework access chains a bit to allow for literals
This makes them much easier to construct because you can also just specify
a literal number and it doesn't have to be a valid SPIR-V id.
Jason Ekstrand [Thu, 21 Jan 2016 16:53:04 +0000 (08:53 -0800)]
vtn/variables: Compact local loads/stores into one function
This is similar to what we did for block loads/stores.
Jason Ekstrand [Thu, 21 Jan 2016 10:09:38 +0000 (02:09 -0800)]
nir/spirv: Add an actual variable struct to spirv_to_nir
This allows us, among other things, to do structure splitting on-the-fly to
more correctly handle input/output structs.
Jason Ekstrand [Thu, 21 Jan 2016 01:40:49 +0000 (17:40 -0800)]
nir/spirv: Split variable handling out into its own file
It's 1300 lines all by itself and it will only grow.
Jason Ekstrand [Thu, 21 Jan 2016 01:11:55 +0000 (17:11 -0800)]
nir/spirv: Rework access chains
Previously, we were creating nir_deref's immediately. Now, instead, we
have an intermediate vtn_access_chain structure. While a little more
awkward initially, this will allow us to more easily do structure splitting
on-the-fly.
Kenneth Graunke [Thu, 21 Jan 2016 22:56:34 +0000 (14:56 -0800)]
nir/spirv: Implement ModfStruct opcode.
Kenneth Graunke [Thu, 21 Jan 2016 22:53:44 +0000 (14:53 -0800)]
nir/spirv: Delete stray fmod remnants.
Jason left these stray code fragments in
22804de110b97dce1415318fd02c1003e16ef14a.
cstout [Sat, 12 Dec 2015 00:58:45 +0000 (16:58 -0800)]
freedreno/a4xx: Add support for adreno 430
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Christian Gmeiner [Wed, 20 Jan 2016 21:11:52 +0000 (22:11 +0100)]
freedreno: make opc array static const
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Mon, 10 Aug 2015 16:11:13 +0000 (12:11 -0400)]
freedreno: implement emit_string_marker
Writes string to cmdstream in payload of a no-op packet.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Rob Clark [Mon, 10 Aug 2015 15:41:29 +0000 (11:41 -0400)]
gallium: add GREMEDY_string_marker
Since the GREMEDY extensions are normally only exposed by the gremedy
debugger (and could possibly trigger debug paths in the app), we don't
expose the extension by default, but instead only with
ST_DEBUG=gremedy.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Rob Clark [Sat, 5 Dec 2015 16:32:25 +0000 (11:32 -0500)]
mesa: wire up EmitStringMarker for KHR_debug
The extension spec[1] describes DEBUG_TYPE_MARKER as "Annotation of the
command stream". So for DEBUG_TYPE_MARKER, also pass the buf to the
driver's EmitStringMarker() to be inserted in the command stream.
[1] https://www.opengl.org/registry/specs/KHR/debug.txt
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Rob Clark [Mon, 10 Aug 2015 14:37:53 +0000 (10:37 -0400)]
mesa: add GREMEDY_string_marker
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Kristian Høgsberg Kristensen [Thu, 21 Jan 2016 22:14:01 +0000 (14:14 -0800)]
vk: Do render cache flush for GEN8+
This is needed for SKL as well.
Kristian Høgsberg Kristensen [Thu, 21 Jan 2016 21:52:41 +0000 (13:52 -0800)]
vk: Emit surface state base address before renderpass
If we're continuing a render pass, make sure we don't emit the depth and
stencil buffer addresses before we set the state base addresses.
Fixes crucible func.cmd-buffer.small-secondaries
Neil Roberts [Thu, 21 Jan 2016 17:28:07 +0000 (17:28 +0000)]
texobj: Remove redundant checks that the texture cube faces match size
The texture mipmap completeness checking code was checking whether all
of the faces have the same size. However this is pointless because the
code just above it checks whether the face has the expected size
calculated for the mipmap level anyway so the error condition could
never be reached. This patch just removes it.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Neil Roberts [Thu, 21 Jan 2016 17:12:29 +0000 (17:12 +0000)]
texobj: Fix the completeness checks for cube textures
According to the GL 1.4 spec section 3.8.10, a cubemap texture is only
complete if:
• The level base arrays of each of the six texture images making up
the cube map have identical, positive, and square dimensions.
• The level base arrays were each specified with the same internal
format.
• The level base arrays each have the same border width.
Previously the texture completeness code was only checking the first
point. This patch makes it additionally check the other two.
This fixes the following two dEQP tests:
deqp-gles2.functional.texture.completeness.cube.format_mismatch_rgba_rgb_level_0_neg_z
deqp-gles2.functional.texture.completeness.cube.format_mismatch_rgb_rgba_level_0_pos_z
And also this Piglit test:
spec/!opengl 2.0/incomplete-cubemap-format
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93792
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Grazvydas Ignotas [Wed, 20 Jan 2016 23:52:24 +0000 (01:52 +0200)]
r600g: don't leak driver const buffers
The buffers are referenced from r600_update_driver_const_buffers()
-> r600_set_constant_buffer() -> u_upload_data(), but nothing
ever releases the reference. Similar case with driver_consts.
Found using valgrind.
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Kristian Høgsberg Kristensen [Thu, 21 Jan 2016 18:43:32 +0000 (10:43 -0800)]
vk: Fix indirect push constants
This currently sets the base and size of all push constants to the
entire push constant block. The idea is that we'll use the base and size
to eventually optimize the amount we actually push, but for now we don't
do that.
Kristian Høgsberg Kristensen [Thu, 21 Jan 2016 19:07:09 +0000 (11:07 -0800)]
Merge remote-tracking branch 'jekstrand/wip/i965-uniforms' into vulkan
Jeremy Huddleston Sequoia [Thu, 21 Jan 2016 01:10:54 +0000 (17:10 -0800)]
mesa: Deal with size differences between GLuint and GLhandleARB in GetAttachedObjectsARB
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Nicolai Hähnle <nhaehnle@gmail.com>
Jeremy Huddleston Sequoia [Thu, 21 Jan 2016 01:03:26 +0000 (17:03 -0800)]
mesa: Fix format warnings
main/shaderapi.c:1318:51: warning: format specifies type 'unsigned int' but the argument has type 'GLhandleARB' (aka 'unsigned long') [-Wformat]
_mesa_debug(ctx, "glDeleteObjectARB(%u)\n", obj);
~~ ^~~
%lu
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Jeremy Huddleston Sequoia [Thu, 21 Jan 2016 00:59:45 +0000 (16:59 -0800)]
mesa: Fix some function prototype mismatching
main/api_exec.c:543:36: warning: incompatible pointer types passing 'void (GLhandleARB, GLuint, const GLcharARB *)' (aka 'void (unsigned long, unsigned int, const char *)') to
parameter of
type 'void (*)(GLuint, GLuint, const GLchar *)' (aka 'void (*)(unsigned int, unsigned int, const char *)') [-Wincompatible-pointer-types]
SET_BindAttribLocation(exec, _mesa_BindAttribLocation);
^~~~~~~~~~~~~~~~~~~~~~~~
./main/dispatch.h:7590:88: note: passing argument to parameter 'fn' here
static inline void SET_BindAttribLocation(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint, const GLchar *)) {
^
main/api_exec.c:547:31: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned
int)')
[-Wincompatible-pointer-types]
SET_CompileShader(exec, _mesa_CompileShader);
^~~~~~~~~~~~~~~~~~~
./main/dispatch.h:7612:83: note: passing argument to parameter 'fn' here
static inline void SET_CompileShader(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) {
^
main/api_exec.c:568:33: warning: incompatible pointer types passing 'void (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)' (aka 'void (unsigned long,
unsigned int,
int, int *, int *, unsigned int *, char *)') to parameter of type 'void (*)(GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *)' (aka 'void (*)(unsigned int,
unsigned int,
int, int *, int *, unsigned int *, char *)') [-Wincompatible-pointer-types]
SET_GetActiveAttrib(exec, _mesa_GetActiveAttrib);
^~~~~~~~~~~~~~~~~~~~~
./main/dispatch.h:7711:85: note: passing argument to parameter 'fn' here
static inline void SET_GetActiveAttrib(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint, GLsizei , GLsizei *, GLint *, GLenum *, GLchar *)) {
^
main/api_exec.c:571:35: warning: incompatible pointer types passing 'GLint (GLhandleARB, const GLcharARB *)' (aka 'int (unsigned long, const char *)') to parameter of type
'GLint (*)(GLuint, const GLchar *)' (aka 'int (*)(unsigned int, const char *)') [-Wincompatible-pointer-types]
SET_GetAttribLocation(exec, _mesa_GetAttribLocation);
^~~~~~~~~~~~~~~~~~~~~~~
./main/dispatch.h:7744:88: note: passing argument to parameter 'fn' here
static inline void SET_GetAttribLocation(struct _glapi_table *disp, GLint (GLAPIENTRYP fn)(GLuint, const GLchar *)) {
^
main/api_exec.c:585:33: warning: incompatible pointer types passing 'void (GLhandleARB, GLsizei, GLsizei *, GLcharARB *)' (aka 'void (unsigned long, int, int *, char *)') to
parameter of
type 'void (*)(GLuint, GLsizei, GLsizei *, GLchar *)' (aka 'void (*)(unsigned int, int, int *, char *)') [-Wincompatible-pointer-types]
SET_GetShaderSource(exec, _mesa_GetShaderSource);
^~~~~~~~~~~~~~~~~~~~~
./main/dispatch.h:7788:85: note: passing argument to parameter 'fn' here
static inline void SET_GetShaderSource(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, GLsizei *, GLchar *)) {
^
main/api_exec.c:597:29: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned
int)')
[-Wincompatible-pointer-types]
SET_LinkProgram(exec, _mesa_LinkProgram);
^~~~~~~~~~~~~~~~~
./main/dispatch.h:7909:81: note: passing argument to parameter 'fn' here
static inline void SET_LinkProgram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) {
^
main/api_exec.c:628:30: warning: incompatible pointer types passing 'void (GLhandleARB, GLsizei, const GLcharARB *const *, const GLint *)' (aka
'void (unsigned long, int, const char *const *, const int *)') to parameter of type 'void (*)(GLuint, GLsizei, const GLchar *const *, const GLint *)' (aka 'void (*)(unsigned
int, int,
const char *const *, const int *)') [-Wincompatible-pointer-types]
SET_ShaderSource(exec, _mesa_ShaderSource);
^~~~~~~~~~~~~~~~~~
./main/dispatch.h:7920:82: note: passing argument to parameter 'fn' here
static inline void SET_ShaderSource(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLsizei, const GLchar * const *, const GLint *)) {
^
main/api_exec.c:653:28: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned
int)')
[-Wincompatible-pointer-types]
SET_UseProgram(exec, _mesa_UseProgram);
^~~~~~~~~~~~~~~~
./main/dispatch.h:8173:80: note: passing argument to parameter 'fn' here
static inline void SET_UseProgram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) {
^
main/api_exec.c:655:33: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned
int)')
[-Wincompatible-pointer-types]
SET_ValidateProgram(exec, _mesa_ValidateProgram);
^~~~~~~~~~~~~~~~~~~~~
./main/dispatch.h:8184:85: note: passing argument to parameter 'fn' here
static inline void SET_ValidateProgram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) {
main/dlist.c:9457:26: warning: incompatible pointer types passing 'void (GLhandleARB)' (aka 'void (unsigned long)') to parameter of type 'void (*)(GLuint)' (aka 'void (*)(unsigned
int)')
[-Wincompatible-pointer-types]
SET_UseProgram(table, save_UseProgramObjectARB);
^~~~~~~~~~~~~~~~~~~~~~~~
./main/dispatch.h:8173:80: note: passing argument to parameter 'fn' here
static inline void SET_UseProgram(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint)) {
^
1 warning generated.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Andreas Boll [Wed, 9 Dec 2015 12:41:22 +0000 (13:41 +0100)]
glapi: Build glapi_gentable.c only on Darwin
Removes the public symbol _glapi_create_table_from_handle from
libGL.so.1.2.0 on all platforms except Darwin.
Since the symbol is not used on other platforms it makes sense to
build glapi_gentable.c only on Darwin.
As a side effect it accelerates the build a bit and reduces the size
of libGL.so.1.2.0 as follows:
size lib/libGL.so.1.2.0 on my system shows
text data bss dec hex filename
469211 21848 2720 493779 788d3 lib/libGL.so.1.2.0 before
420988 11240 2720 434948 6a304 lib/libGL.so.1.2.0 after
A little bit of history:
_glapi_create_table_from_handle was introduced in
commit
85937f4c0d4a78d3a11e3c1fa6148640f2a9ad7b
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Thu Jun 9 16:59:49 2011 -0700
glapi: Add API that can create a _glapi_table from a dlfcn handle
Example usage:
void *handle = dlopen(opengl_library_path, RTLD_LOCAL);
struct _glapi_table *disp = _glapi_create_table_from_handle(handle,
"gl");
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
and the only user in mesa was added in
commit
f35913b96e743c5014e99220b1a1c5532a894d69
Author: Jeremy Huddleston <jeremyhu@apple.com>
Date: Thu Jun 9 17:29:51 2011 -0700
apple: Use _glapi_create_table_from_handle to initialize our
dispatch table
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
gl_gentable.py was also used for XQuartz in xserver 1.11 - 1.14.
v2: Fix typos in commit message
Add missing XORG_GLAPI_OUTPUTS += \ into src/mapi/glapi/gen/Makefile.am
Add glapi_gentable.c to EXTRA_DIST for inclusion in the release
tarball
v3: Fix commit message: s/gl_gentable.c/glapi_gentable.c/
Reported-by: Arlie Davis <arlied@google.com>
Cc: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Arlie Davis [Thu, 17 Sep 2015 22:19:24 +0000 (15:19 -0700)]
mesa: Reduce libGL.so binary size by about 15%
This patch significantly reduces the size of the libGL.so binary. It does
not change the (externally visible) behavior of libGL.so at all.
gl_gentable.py generates a function, _glapi_create_table_from_handle.
This function allocates a large dispatch table, consisting of 1300 or so
function pointers, and fills this dispatch table by doing symbol lookups
on a given shared library. Previously, gl_gentable.py would generate a
single, very large _glapi_create_table_from_handle function, with a short
cluster of lines for each entry point (function). The idiom it generates
was a NULL check, a call to snprintf, a call to dlsym / GetProcAddress,
and then a store into the dispatch table. Since this function processes
a large number of entry points, this code is duplicated many times over.
We can encode the same information much more compactly, by using a lookup
table. The previous total size of _glapi_create_table_from_handle on x64
was 125848 bytes. By using a lookup table, the size of
_glapi_create_table_from_handle (and the related lookup tables) is reduced
to 10840 bytes. In other words, this enormous function is reduced by 91%.
The size of the entire libGL.so binary (measured when stripped) itself drops
by 15%.
So the purpose of this change is to reduce the binary size, which frees up
disk space, memory, etc.
size lib/libGL.so.1.2.0 on my system shows (Andreas)
text data bss dec hex filename
565947 11256 2720 579923 8d953 lib/libGL.so.1.2.0 before
469211 21848 2720 493779 788d3 lib/libGL.so.1.2.0 after
v2: Incorporate Matt's feedback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Signed-off-by: Andreas Boll <andreas.boll.dev@gmail.com>
Jordan Justen [Sun, 10 Jan 2016 19:12:17 +0000 (11:12 -0800)]
nir/spirv: Handle compute shared atomics
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Sat, 9 Jan 2016 03:45:45 +0000 (19:45 -0800)]
nir/spirv: Support workgroup (shared) variable translation
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Sat, 9 Jan 2016 09:28:40 +0000 (01:28 -0800)]
anv/gen8: Set SLM size in interface descriptor
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Thu, 21 Jan 2016 01:26:41 +0000 (17:26 -0800)]
anv/gen8+9: Invalidate color calc state when switching to the GPGPU pipeline
Port
044acb9256046bebec890cac7e42043754459fc2 to anv.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Sat, 9 Jan 2016 09:18:24 +0000 (01:18 -0800)]
anv/gen8: Enable SLM in L3 cache control register
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Mon, 18 Jan 2016 18:00:49 +0000 (10:00 -0800)]
anv/pipeline: Set size of shared variables in prog_data
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Mon, 18 Jan 2016 17:45:46 +0000 (09:45 -0800)]
i965/nir: Lower nir compute shader shared variables
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Mon, 18 Jan 2016 17:59:19 +0000 (09:59 -0800)]
nir: Lower shared var atomics during nir_lower_io
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Mon, 18 Jan 2016 17:44:31 +0000 (09:44 -0800)]
nir: Add support for lowering load/stores of shared variables
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Mon, 18 Jan 2016 17:53:44 +0000 (09:53 -0800)]
nir: Add atomic operations on variables
This allows us to first generate atomic operations for shared
variables using these opcodes, and then later we can lower those to
the shared atomics intrinsics with nir_lower_io.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Sat, 9 Jan 2016 01:16:29 +0000 (17:16 -0800)]
nir: Add compute shader shared variable storage class
Previously we were receiving shared variable accesses via a lowered
intrinsic function from glsl. This change allows us to send in
variables instead. For example, when converting from SPIR-V.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Jordan Justen [Sun, 17 Jan 2016 07:11:16 +0000 (23:11 -0800)]
nir/print: Add space after shader_storage var mode
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>