summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Permanently enable features supported by target CPU at compile time.Siavash Eliasi2014-11-261-0/+26
| | | | | | | | | | | This will remove the need for unnecessary runtime checks for CPU features if already supported by target CPU, resulting in smaller and less branchy code. V2: - Removed the SSSE3 related part for the not yet merged patch. - Avoiding redefinition of macros. Tested-by: David Heidelberg <[email protected]>
* util: update hash type commentsTimothy Arceri2014-11-261-5/+5
| | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/vec4: Handle destination writemasks in VEC4_OPCODE_PACK_BYTES.Matt Turner2014-11-251-2/+13
| | | | | | | | | | | | | | Since pack_bytes expands to two mov(4) align1 instructions, we can't use swizzles directly. For an instruction like pack_bytes m4.y:UD, vgrf13.xyzw:UD we can write into the .y component by settings the offset based on the swizzle. Also while we're doing this, we can set the dependency control hints properly, so that a series of pack_bytes writing into separate components of a register can issue without blocking.
* i965/vec4: Optimize packSnorm4x8().Matt Turner2014-11-253-4/+29
| | | | | Reduces the number of instructions needed to implement packSnorm4x8() from 13 -> 7.
* i965/vec4: Optimize packUnorm4x8().Matt Turner2014-11-253-4/+27
| | | | | Reduces the number of instructions needed to implement packUnorm4x8() from 11 -> 6.
* i965/vec4: Add VEC4_OPCODE_PACK_4_BYTES.Matt Turner2014-11-254-0/+52
| | | | Will be used by emit_pack_{s,u}norm_4x8().
* i965/vec4: Optimize unpackSnorm4x8().Matt Turner2014-11-253-3/+33
| | | | | | | Reduces the number of instructions needed to implement unpackSnorm4x8() from 16 -> 6. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Optimize unpackUnorm4x8().Matt Turner2014-11-253-3/+31
| | | | | | | Reduces the number of instructions needed to implement unpackUnorm4x8() from 11 -> 4. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Add vector float immediate infrastructure.Matt Turner2014-11-253-0/+23
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Add vector float immediate infrastructure.Matt Turner2014-11-253-0/+24
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Disassemble vector float immediates properly.Matt Turner2014-11-251-1/+5
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965: Add unit test for float <-> VF conversions.Matt Turner2014-11-252-0/+105
| | | | | Using Eric's original VF -> float conversion code to initialize the table.
* i965: Add functions to convert float <-> VF.Matt Turner2014-11-253-0/+80
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/Gen6-7: Do not replace texcoords with point coord if not drawing pointsChris Forbes2014-11-252-12/+49
| | | | | | | | | | | | | | | | | | | | | | Fixes broken rendering in Windows-based QtQuick2 apps run through Wine. This library sets all texture units' GL_COORD_REPLACE, leaves point sprite mode enabled, and then draws a triangle fan. Will need a slightly different fix for Gen4-5, but I don't have my old machines in a usable state currently. V2: - Simplify patch -- the real changes are no longer duplicated across the Gen6 and Gen7 atoms. - Also don't clobber attr overrides -- which matters on Haswell too, and fixes the other half of the problem - Fix newly-introduced warnings V3: - Use BRW_NEW_GEOMETRY_PROGRAM and brw->geometry_program rather than core flag and state; keep the state flags in order. Signed-off-by: Chris Forbes <[email protected]> Cc: "10.4" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84651 Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Make lower_constant_arrays_to_uniforms require dereferences.Kenneth Graunke2014-11-241-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ilia noticed that my lowering pass was converting the constant array used by textureGatherOffsets' offsets parameter to a uniform. This broke textureGather for Nouveau, and is generally a horrible plan, since it violates the GLSL constraint that offsets must be an immediate constant. When I wrote this pass, I neglected to consider whole array assignment. I figured opt_array_splitting would handle constant indexing, so this pass was really about fixing variable indexing. textureGatherOffsets is an example of whole array access that we really don't want to touch. Whole array copies don't appear to benefit from this either - they're most likely initializers for temporary arrays which are going to be mutated anyway. Since you're copying, you may as well copy from immediates, not uniforms. This patch makes the pass look for ir_dereference_arrays of ir_constants, rather than looking for any ir_constant directly. This way, it ignores whole array assignment. No shader-db changes or Piglit regressions on Haswell. Some Piglit tests generate different code (fixing textureGatherOffsets on Nouveau). Signed-off-by: Kenneth Graunke <[email protected]> Tested-by: Ilia Mirkin <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "10.4" <[email protected]>
* i965: Precompile ARB programs.Kenneth Graunke2014-11-241-2/+9
| | | | | | | | | | | | We already precompile GLSL programs; it seems logical to precompile ARB programs as well. We just never hooked it up. This also makes the programs compile even if no drawing occurs, which is useful for shader-db. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Make precompile functions accessible from C.Kenneth Graunke2014-11-245-10/+19
| | | | | | | | | | | | | Previously, the prototypes for brw_vs/gs/fs_precompile were scattered between brw_vs.h (C), brw_gs.h (C), and brw_fs.h (C++ only). Also, brw_fs_precompile had C++ linkage, while the others were C. This patch moves all the prototypes to a central location (brw_shader.h) and makes brw_fs_precompile have C linkage. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Pass gl_program pointers into precompile functions.Kenneth Graunke2014-11-247-29/+33
| | | | | | | | | | | | We'd like to do precompiling for ARB vertex and fragment programs, which only have gl_program structures - gl_shader_program is NULL. This patch makes the various precompile functions take a gl_program parameter directly, rather than accessing it via gl_shader_program. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Move brw->precompile checks out a level.Kenneth Graunke2014-11-241-4/+4
| | | | | | | | | brw_shader_precompile should just do a precompile; it makes more sense for the caller to decide whether we should do one. Simpler. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* llvmpipe: (trivial) remove redundant util_cpu_detect() call in lp_test_mainRoland Scheidegger2014-11-251-2/+0
| | | | Already called earlier.
* llvmpipe: fix lp_test_arit denorm handlingRoland Scheidegger2014-11-251-1/+37
| | | | | | | | | | | | | | | | | | llvmpipe disables denorms on purpose (on x86/sse only), because denorms are generally neither required nor desired for graphic apis (and in case of d3d10, they are forbidden). However, this caused some arithmetic tests using denorms to fail on some systems, because the reference did not generate the same results anymore. (It did not fail on all systems - behavior of these math functions is sort of undefined when called with non-standard floating point mode, hence the result differing depending on implementation and in particular the sse capabilities.) So, for the reference, simply flush all (input/output) denorms manually to zero in this case. This fixes https://bugs.freedesktop.org/show_bug.cgi?id=67672. Reviewed-by: Jose Fonseca <[email protected]>
* nouveau: Fix build after STR/BRA opcode dropping.Eric Anholt2014-11-241-2/+0
| | | | | I missed these while git grepping for users of the dead opcodes. Sigh, macros.
* mesa: Drop unused NV_fragment_program opcodes.Eric Anholt2014-11-244-177/+0
| | | | | | | | | The extension itself was deleted 2 years ago. There are still some prog_instruction opcodes from NV_fp that exist because they're used by ir_to_mesa.cpp, though. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Ian Roamnick <[email protected]>
* mesa: Drop unused SFL/STR opcodes.Eric Anholt2014-11-243-16/+0
| | | | | | | | They're part of NV_vertex_program2, which I'm pretty sure we're never going to support. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Ian Roamnick <[email protected]>
* gallium: Drop the unused CND opcode.Eric Anholt2014-11-2411-82/+5
| | | | | | Nothing in the tree generates it. Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Drop unused BRA opcode.Eric Anholt2014-11-2412-37/+5
| | | | | | Never generated, and implemented in only nvfx vertprog. Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Drop the unused SFL/STR opcodes.Eric Anholt2014-11-2413-150/+10
| | | | | | Nothing generated them. Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Drop the unused RFL opcode.Eric Anholt2014-11-2410-98/+5
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Drop unused X2D opcode.Eric Anholt2014-11-2410-77/+4
| | | | | | Nothing in the tree generates it. Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Drop the unused ARA opcode.Eric Anholt2014-11-2410-28/+5
| | | | | | | | Nothing in the tree generated it. v2: Only drop ARA, not ARR as well. Reviewed-by: Jose Fonseca <[email protected]> (v2)
* gallium: Drop the unused RCC opcode.Eric Anholt2014-11-2411-47/+5
| | | | | | Nothing in the tree generated it. Reviewed-by: Jose Fonseca <[email protected]>
* gallium: Drop the NRM and NRM4 opcodes.Eric Anholt2014-11-2411-347/+10
| | | | | | | They weren't generated in tree, and as far as I know all hardware had to lower it to a DP, RSQ, MUL. Reviewed-by: Jose Fonseca <[email protected]>
* ilo: Drop the explicit intialization of gaps in TGSI opcodes.Eric Anholt2014-11-241-22/+6
| | | | | | | | | The nice thing about the good way of initializing arrays like this is that you don't need to initialize everything in order, or even everything at all. Taking advantage of that only needs a tiny fixup to deal with the default NULL value of the pointers. I haven't dropped the initialization of opcodes that exist and are unsupported.
* r300: Drop the "/* gap */" notes.Eric Anholt2014-11-241-3/+0
| | | | | This switch statement's code structure isn't dependent on the numbers of the opcodes at all.
* r600: Drop the "/* gap */" notes.Eric Anholt2014-11-241-19/+0
| | | | | | | These are obviously the gaps already, due to the bare numbers with unsupported implementations. This makes inserting new gaps less irritating.
* nine: Drop use of TGSI_OPCODE_CND.Jose Fonseca2014-11-241-9/+1
| | | | | | | | | | | | This was the only state tracker emitting it, and hardware was just having to lower it anyway (or failing to lower it at all). v2: Extracted from a larger patch by Jose (which also dropped DP2A), fixed to actually not reference TGSI_OPCODE_CND. Change by anholt. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]>
* nine: Don't reference the dead TGSI_OPCODE_NRM.Jose Fonseca2014-11-241-1/+1
| | | | | | | | | | The translation is lowering it to not using TGSI_OPCODE_NRM, anyway. v2: Extracted from a larger patch by Jose that also dropped DP2A usage. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]>
* nine: Don't use the otherwise-dead SFL opcode in an unreachable path.Eric Anholt2014-11-241-1/+1
| | | | | | Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Axel Davy <[email protected]> Reviewed-by: David Heidelberg <[email protected]>
* i965/gen6/gs: Don't declare a src_reg with struct.Matt Turner2014-11-241-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/disasm: Fix all32h/any32h predicate disassembly.Matt Turner2014-11-241-1/+1
| | | | Reviewed-by: Chris Forbes <[email protected]>
* glsl: Fix tautological comparison.Matt Turner2014-11-241-1/+1
| | | | | | | | | | | | Caught by clang. warning: comparison of constant -1 with expression of type 'ir_texture_opcode' is always false [-Wtautological-constant-out-of-range-compare] if (op == -1) ~~ ^ ~~ Reviewed-by: Kenneth Graunke <[email protected]>
* util: Prefer atomic intrinsics to inline assembly.Matt Turner2014-11-241-2/+2
| | | | | | | | | | | | | Cuts a little more than 1k of .text size from i915g. This was previously done in commit 5f66b340 and subsequently reverted in commit 3661f757 after bug 30514 was filed. I believe the cause of bug 30514 wasn't anything related to cross compiling, but rather that the toolchain used defaulted to -march=i386, and i386 doesn't have the CMPXCHG or XADD instructions used to implement the intrinsics. So we reverted a patch that improved things so that we didn't break compilation for a platform that never could have worked anyway.
* util: Implement assume() for clang.Matt Turner2014-11-241-1/+11
| | | | Reviewed-by: Jordan Justen <[email protected]>
* i965: Don't overwrite the math function with conditional mod.Matt Turner2014-11-242-2/+4
| | | | | | | | | | | | | | | Ben was asking about the undocumented restriction that the math instruction cannot use the dependency control hints. I went to reconfirm and disabled the is_math() check in opt_set_dependency_control() and saw that the disassembled math instructions with dependency hints had a bogus math function. We were mistakenly overwriting it by setting an empty conditional mod. Unfortunately, this wasn't the cause of the aforementioned problem (I reproduced it). This bug is benign, since we don't set dependeny hints on math instructions -- but maybe some day. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Assert that math instructions don't have conditional mod.Matt Turner2014-11-242-0/+4
| | | | | | The math function field is at the same location as conditional mod. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Remove unused ast copy constructors.Matt Turner2014-11-241-29/+0
| | | | | | | | | These were added in commits a760c738 and 43757135 to be used in implementing C-style aggregate initializers (commit 1b0d6aef). Paul rewrote that code in commit 0da1a2cc to use GLSL types, rather than AST types, leaving these copy constructors unused. Tested by making them private and providing no definition.
* glapi: Remove dead gl_offsets.py.Matt Turner2014-11-241-120/+0
| | | | Dead since commit 07b85457.
* glapi: Remove dead extension_helper.py.Matt Turner2014-11-242-326/+0
| | | | Dead since commit 3d16088f.
* vc4: Fix some inconsistent indentation.Eric Anholt2014-11-241-6/+6
|
* vc4: Don't forget to actually connect the fence code.Eric Anholt2014-11-241-0/+2
| | | | I thought I'd tested this.