summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965/vec4: Pass argument by reference to src_reg/dst_reg conversion ↵Francisco Jerez2015-03-232-4/+4
| | | | | | constructors. Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Remove swizzle_for_size() in favour of brw_swizzle_for_size().Francisco Jerez2015-03-233-31/+8
| | | | | | | | | | It could be objected that swizzle_for_size() is "faster" than brw_swizzle_for_size(). It's not measurably better in any reasonable CPU-bound benchmark on VLV according to the Finnish benchmarking system (including the SynMark2 DrvShComp shader compilation benchmark). Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Remove broken vector size deduction in ↵Francisco Jerez2015-03-231-14/+9
| | | | | | | | | | | setup_builtin_uniform_values(). This seemed to be trying to deduce the number of uniform vector components from the parameter swizzle, but the algorithm would always give 4 as result. Instead grab the correct number of components from the GLSL type. Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Simplify visitor handling of swizzles using the swizzle utils.Francisco Jerez2015-03-231-49/+10
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Simplify opt_register_coalesce() using the swizzle utils.Francisco Jerez2015-03-231-26/+7
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Simplify reswizzle() using the swizzle utils.Francisco Jerez2015-03-231-29/+11
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Simplify opt_reduce_swizzle() using the swizzle utils.Francisco Jerez2015-03-231-44/+7
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965: Fix signedness of backend_reg::reg_offset.Francisco Jerez2015-03-231-1/+1
| | | | | | And make it 16-bit so it packs nicely with the previous field. Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Fix signedness of dst_reg::writemask.Francisco Jerez2015-03-232-3/+4
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Don't use GL types in the IR data structures.Francisco Jerez2015-03-231-1/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/vec4: Fix signedness of brw_is_single_value_swizzle() argument.Francisco Jerez2015-03-231-1/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965: Define some useful swizzle helper functions.Francisco Jerez2015-03-231-0/+97
| | | | | | | | | | This defines helper functions implementing some common swizzle transformations that are usually open-coded in the compiler back-end, causing a lot of clutter. Some optimization passes will become almost trivial implemented in terms of these functions (e.g. vec4_visitor::opt_reduce_swizzle()). Reviewed-by: Matt Turner <[email protected]>
* i965/nir: Use signed integer type for booleansJason Ekstrand2015-03-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FS instructions with NIR on i965: total instructions in shared programs: 2663561 -> 2619051 (-1.67%) instructions in affected programs: 1612965 -> 1568455 (-2.76%) helped: 5455 HURT: 12 FS instructions with NIR on g4x: total instructions in shared programs: 2352633 -> 2307908 (-1.90%) instructions in affected programs: 1441842 -> 1397117 (-3.10%) helped: 5463 HURT: 11 FS instructions with NIR on ilk: total instructions in shared programs: 3997305 -> 3934278 (-1.58%) instructions in affected programs: 2189409 -> 2126382 (-2.88%) helped: 8969 HURT: 22 FS instructions with NIR on hsw (snb and ivb were similar): total instructions in shared programs: 4109389 -> 4109242 (-0.00%) instructions in affected programs: 109869 -> 109722 (-0.13%) helped: 339 HURT: 190 No SIMD16 programs were gained or lost on any platform Reviewed-by: Matt Turner <[email protected]>
* i965/nir: Do boolean resolves on GEN <= 5Jason Ekstrand2015-03-231-0/+20
| | | | | | v2: A couple comment clean-ups from Matt Reviewed-by: Matt Turner <[email protected]>
* i965: Add a NIR analysis pass for determining when a boolean resolve is neededJason Ekstrand2015-03-233-0/+348
| | | | | | | | | | v2: Fix the spelling of analyze and re-arrange code for better readability as per Connor's comments. v3: Make the naming of things more consistent and add a pile of comments v4: Stop trying to avoid vectors Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* i965/nir: Properly set the predicate on the SEL used in min/maxJason Ekstrand2015-03-231-0/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/nir: Use NIR lowering for ffma for gen < 6Jason Ekstrand2015-03-231-2/+10
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/nir: Use emit_lrp for emitting flrpJason Ekstrand2015-03-231-2/+1
| | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965/fs: Make emit_lrp return an fs_instJason Ekstrand2015-03-232-5/+5
| | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: define I915_PARAM_REVISIONDave Airlie2015-03-231-0/+5
| | | | | | | we are broken against the libdrm 2.4.60 minimum specified, so fix it for now. Signed-off-by: Dave Airlie <[email protected]>
* scons: Cleanup flex/bison settings specification.Jose Fonseca2015-03-221-1/+1
| | | | Reviewed-by: Brian Paul <[email protected]>
* scons: Ensure git_sha1.h's directory exists.Jose Fonseca2015-03-221-1/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/vdpau: Avoid constness cast warnings.Jose Fonseca2015-03-221-1/+1
| | | | | | | | | Fixes MSVC warning C4090: '=' : different 'const' qualifiers Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Christian König <[email protected]>
* glsl: Avoid GLboolean vs bool arithmetic MSVC warnings.Jose Fonseca2015-03-221-2/+2
| | | | | | | | | | | | | Note that GLboolean is an alias for unsigned char, which lacks the implicit true/false semantics that C++/C99 bool have. Reviewed-by: Brian Paul <[email protected]> v2: Change gl_shader::IsES and gl_shader_program::IsES to be bool as recommended by Ian Romanick. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: reorder gl_light_attribDave Airlie2015-03-211-4/+7
| | | | | | | | reduces from 2664->2656. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_framebufferDave Airlie2015-03-211-8/+9
| | | | | | | | this reduces it from 1088 -> 1080 bytes Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix hole in vertex_array_objectDave Airlie2015-03-211-1/+3
| | | | | | | | this just removes 4 bytes from this object. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: repack gl_texture_attrib.Dave Airlie2015-03-211-4/+5
| | | | | | | | This removes a hole, and puts the large allocation at the end, Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reduce gl_colorbuffer_attrib and gl_fog_attribDave Airlie2015-03-211-3/+4
| | | | | | | | These 392->388 and 72->68. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_image_unitDave Airlie2015-03-211-6/+7
| | | | | | | | | reduces 40->32 but reduces use in context from 7680->6144. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_program, gl_shader, gl_shader_programDave Airlie2015-03-211-6/+9
| | | | | | | | | | gl_program : 1344->1336 gl_shader: 488->472 gl_shader_program: 352->344. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_transform_feedback_objectDave Airlie2015-03-211-9/+9
| | | | | | | | Reduces size from 184 to 176 bytes. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder prog_instructionDave Airlie2015-03-211-3/+3
| | | | | | | | reduces size from 64 to 56 bytes. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_array_attribDave Airlie2015-03-211-3/+3
| | | | | | | | drops 80 bytes to 72. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_client_arrayDave Airlie2015-03-211-1/+1
| | | | | | | | | drops from 56 to 48 bytes, drops gl_vertex_array_object from 4584 to 4320 bytes Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_texture_unitDave Airlie2015-03-211-2/+3
| | | | | | | | | drops size from 520 -> 512 bytes, which then makes gl_texture_attrib go from 99984 to 98440. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_point_attribDave Airlie2015-03-211-1/+1
| | | | | | | | this drops the size from 52 bytes to 48 bytes. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: reorder gl_multisample_attribDave Airlie2015-03-211-2/+4
| | | | | | | | drops size from 28 bytes to 20. Acked-by: Brian Paul <[email protected]> Reviewed-by: Alex Deucher [email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965/fs: Use correct null destination register in cmod testsIan Romanick2015-03-201-3/+3
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89670 Reviewed-by: Matt Turner <[email protected]> Cc: Vinson Lee <[email protected]>
* i965/fs: bail on move-to-flag in sel peepholeConnor Abbott2015-03-201-1/+3
| | | | | | | | | Fixes a piglit regression (shaders/glsl-fs-vec4-indexing-temp-dst-in-nested-loop-combined) with my series for GVN. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Connor Abbott <[email protected]>
* i965: Mask out unused Align16 components in brw_untyped_atomic.Francisco Jerez2015-03-201-2/+11
| | | | | | | | | | | | This is currently not a problem because the vec4 visitor happens to mask out unused components from the destination, but it might become an issue when we start using atomics without writeback message. In any case it seems sensible to set it again here because the consequences of setting the wrong writemask (random graphics memory corruption) are difficult to debug and can easily go unnoticed. Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Pass number of components explicitly to brw_untyped_atomic and ↵Francisco Jerez2015-03-204-16/+32
| | | | | | | | | | | | _surface_read. And calculate the message response size based on the number of components rather than the other way around. This simplifies their interface somewhat and allows the caller to request a writeback message with more than one vector component in SIMD4x2 mode. Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Don't disable exec masking for sampler message sends.Francisco Jerez2015-03-202-8/+8
| | | | | | | | | | This was telling the sampler to do texture fetches for *all* channels in the non-constant surface index case, what could have reduced throughput unnecessarily when some of the channels were disabled by control flow. Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Factor out logic to build a send message instruction with indirect ↵Francisco Jerez2015-03-204-96/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | descriptor. This is going to be useful because the Gen7+ uniform and varying pull constant, texturing, typed and untyped surface read, write, and atomic generation code on the vec4 and fs back-end all require the same logic to handle conditionally indirect surface indices. In pseudocode: | if (surface.file == BRW_IMMEDIATE_VALUE) { | inst = brw_SEND(p, dst, payload); | set_descriptor_control_bits(inst, surface, ...); | } else { | inst = brw_OR(p, addr, surface, 0); | set_descriptor_control_bits(inst, ...); | inst = brw_SEND(p, dst, payload); | set_indirect_send_descriptor(inst, addr); | } This patch abstracts out this frequently recurring pattern so we can now write: | inst = brw_send_indirect_message(p, sfid, dst, payload, surface) | set_descriptor_control_bits(inst, ...); without worrying about handling the immediate and indirect surface index cases explicitly. v2: Rebase. Improve documentatation and commit message. (Topi) Preserve UW destination type cargo-cult. (Topi, Ken, Matt) Reviewed-by: Topi Pohjolainen <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* i965: Set nr_params to the number of uniform components in the VS/GS path.Francisco Jerez2015-03-203-15/+4
| | | | | | | | | | | | | | | | | | Both do_vs_prog and do_gs_prog initialize brw_stage_prog_data::nr_params to the number of uniform *vectors* required by the shader rather than the number of uniform components, contradicting the comment. This is inconsistent with what the state upload code and scalar path expect but it happens to work until Gen8 because vec4_visitor interprets it as a number of vectors on construction and later on overwrites its original value with the number of uniform components referenced by the shader. Also there's no need to add the number of samplers, they're not actually passed in as uniforms. Fixes a memory corruption issue on BDW with SIMD8 VS. Cc: "10.5" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/skl: Break down SIMD16 3-source instructions when required.Kenneth Graunke2015-03-201-0/+6
| | | | | | | | | | | | | Several steppings of Skylake fail when using SIMD16 with 3-source instructions (such as MAD). This implements WaDisableSIMD16On3SrcInstr and fixes ~190 Piglit tests. Based on a patch by Neil Roberts. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Neil Roberts <[email protected]>
* i965: Refactor SIMD16-to-2xSIMD8 checks.Neil Roberts2015-03-201-4/+14
| | | | | | | | | | | The places that were checking whether 3-source instructions are supported have now been combined into a small helper function. This will be used in the next patch to add an additonal restriction. Based on a patch by Kenneth Graunke. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Store the GPU revision number in brw_contextNeil Roberts2015-03-202-0/+23
| | | | | | | | | | | brwContextInit now queries the GPU revision number via a new parameter for DRM_I915_GETPARAM. This new parameter requires a kernel patch and a patch to libdrm. If the kernel doesn't support it then it will continue but set the revision number to -1. The intention is to use this to implement workarounds that are only needed on certain steppings of the GPU. Reviewed-by: Kristian Høgsberg <[email protected]>
* mesa: Make sure the buffer exists in _mesa_lookup_bufferobj_errFredrik Höglund2015-03-201-4/+6
| | | | | | | | | | Generate GL_INVALID_OPERATION and return NULL when the buffer object hasn't been created. All callers expect this. v2: Use a more concise error message. Cc: Laura Ekstrand <[email protected]> Reviewed-by: Laura Ekstrand <[email protected]>
* i965/fp: Emit discard jumps.Kenneth Graunke2015-03-191-0/+3
| | | | | | | | | | | | This should improve the performance of any shaders using the KIL instruction. I'm a bit surprised we missed this. Unfortunately, I have not been able to measure any performance improvements from this patch. It does make ARB_fragment_program behave similarly to GLSL code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>