summaryrefslogtreecommitdiff
path: root/src/mesa
AgeCommit message (Collapse)AuthorFilesLines
2013-12-07mesa: Require per-sample shading if the `sample` qualifier is used.Chris Forbes1-0/+8
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07mesa: add IsSample bitfield to gl_fragment_programChris Forbes1-0/+6
Drivers will need to look at this to decide if they need to do per-sample fragment shader dispatch. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2013-12-07i965: Don't flag gather quirks for Gen8+Chris Forbes1-1/+1
My understanding is that Broadwell retains the same SCS mechanism that Haswell has, so even if the underlying issue with this format is not fixed, the w/a will be applied in SCS rather than needing shader code. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Cc: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07i965/Gen7: Allow CMS layout for multisample texturesChris Forbes1-17/+1
Now that all the pieces are in place, this should provide a nice performance boost for apps using multisample textures. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07i965/vs: Sample from MCS surface when requiredChris Forbes2-7/+40
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-07i965/fs: Sample from MCS surface when requiredChris Forbes3-10/+41
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-07i965: Add shader opcode for sampling MCS surfaceChris Forbes6-0/+16
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07i965/Gen7: Include bitfield in the sampler key for CMS layoutChris Forbes2-0/+18
We need to emit extra shader code in this case to sample the MCS surface first; we can't just blindly do this all the time since IVB will sometimes try to access the MCS surface even if disabled. V3: Use actual MSAA layout from the texture's mt, rather then computing what would have been used based on the format. This is simpler and less fragile - there's at least one case where we might want to have a texture's MSAA layout change based on what the app does (CMS SINT falling back to UMS if the app ever attempts to render to it with a channel disabled.) This also obsoletes V2's 1/10 -- compute_msaa_layout can now remain an implementation detail of the miptree code. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-07i965/Gen7: Move decision to allocate MCS surface into intel_mipmap_createChris Forbes1-6/+8
This gives us correct behavior for both renderbuffers (which previously worked) and multisample textures (which would never get an MCS surface allocated, even if CMS layout was selected) Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07i965/Gen7: emit mcs info for multisample texturesChris Forbes1-0/+5
Previously this was only done for render targets. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07i965/wm: Set copy of sample mask in 3DSTATE_PS correctly for HaswellChris Forbes1-2/+7
The bspec says: "SW must program the sample mask value in this field so that it matches with 3DSTATE_SAMPLE_MASK" I haven't observed this to actually fix anything, but stumbled across it while adding the rest of the support for CMS layout for multisample textures. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-07i965: refactor sample mask calculationChris Forbes4-33/+41
Haswell needs a copy of the sample mask in 3DSTATE_PS; this makes that convenient. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05i965: Replace non-standard INLINE macro with "inline".Kenneth Graunke6-22/+22
These are identical: main/compiler.h defines INLINE to "inline". Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05i965: Don't use GL types in files shared with intel-gpu-tools.Kenneth Graunke6-1035/+1035
sed -i -e 's/GLuint/unsigned/g' -e 's/GLint/int/g' \ -e 's/GLfloat/float/g' -e 's/GLubyte/uint8_t/g' \ -e 's/GLshort/int16_t/g' \ brw_eu* brw_disasm.c brw_structs.h Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05i965: Drop trailing whitespace from the rest of the driver.Kenneth Graunke72-621/+621
Performed via: $ for file in *; do sed -i 's/ *//g'; done Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-05i965: Drop trailing whitespace from files shared with intel-gpu-tools.Kenneth Graunke5-276/+276
Performed via s/ *$//g. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2013-12-04i965: Emit better code for ir_unop_sign.Matt Turner2-15/+49
total instructions in shared programs: 1550449 -> 1550048 (-0.03%) instructions in affected programs: 15207 -> 14806 (-2.64%) Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2013-12-04i965/fs: New peephole optimization to flatten IF/BREAK/ENDIF.Matt Turner4-0/+99
total instructions in shared programs: 1550713 -> 1550449 (-0.02%) instructions in affected programs: 7931 -> 7667 (-3.33%) Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04i965/fs: Emit a MOV instead of a SEL if the sources are the same.Matt Turner1-19/+23
One program affected. instructions in affected programs: 436 -> 428 (-1.83%) Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04i965/fs: Extend SEL peephole to handle only matching MOVs.Matt Turner1-3/+2
Before this patch, the following code would not be optimized even though the first two instructions were common to the then and else blocks: (+f0) IF MOV dst0 ... MOV dst1 ... MOV dst2 ... ELSE MOV dst0 ... MOV dst1 ... MOV dst3 ... ENDIF This commit extends the peephole to handle this case. No shader-db changes. Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/fs: New peephole optimization to generate SEL.Matt Turner4-0/+225
fs_visitor::try_replace_with_sel optimizes only if statements whose "then" and "else" bodies contain a single MOV instruction. It also could not handle constant arguments, since they cause an extra MOV immediate to be generated (since we haven't run constant propagation, there are more than the single MOV). This peephole fixes both of these and operates as a normal optimization pass. fs_visitor::try_replace_with_sel is still arguably necessary, since it runs before pull constant loads are lowered. total instructions in shared programs: 1559129 -> 1545833 (-0.85%) instructions in affected programs: 167120 -> 153824 (-7.96%) GAINED: 13 LOST: 6 Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04i965/fs: Add SEL() convenience function.Matt Turner2-0/+2
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-12-04i965: Print conditional mod in dump_instruction().Matt Turner2-2/+6
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965: Externalize conditional_modifier for use in dump_instruction().Matt Turner2-1/+2
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965: Print argument types in dump_instruction().Matt Turner2-2/+10
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965: Externalize reg_encoding for use in dump_instruction().Matt Turner2-1/+2
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/vec4: Don't print swizzles for immediate values.Matt Turner1-4/+6
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/vec4: Print negate and absolute value for src args.Matt Turner1-0/+7
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/vec4: Add support for printing HW_REGs in dump_instruction().Matt Turner1-0/+60
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/fs: Print ARF registers properly in dump_instruction().Matt Turner1-2/+46
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965: Don't print extra (null) arguments in dump_instruction().Matt Turner2-4/+4
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965: Allow commuting the operands of ADDC for const propagation.Matt Turner2-2/+2
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/fs: Rename register_coalesce_2() -> register_coalesce().Matt Turner2-6/+6
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/fs: Remove now useless register_coalesce() pass.Matt Turner2-148/+0
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/fs: Let register_coalesce_2() eliminate self-moves.Matt Turner1-1/+2
This is the last thing that register_coalesce() still handled. total instructions in shared programs: 1561060 -> 1560908 (-0.01%) instructions in affected programs: 15758 -> 15606 (-0.96%) Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965: Allow constant propagation into ASR and BFI1.Matt Turner2-0/+4
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Document cur_* variables.Matt Turner1-2/+5
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Remove ip & cur from brw_cfg.Matt Turner2-26/+17
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Clean up cfg_t constructors.Matt Turner9-23/+9
parent_mem_ctx was unused since db47074a, so remove the two wrappers around create() and make create() the constructor. Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Throw out confusing make_list method.Matt Turner2-15/+7
make_list is just a one-line wrapper and was confusingly called by NULL objects. E.g., cur_if == NULL; cur_if->make_list(mem_ctx). Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Include only needed headers.Matt Turner2-2/+3
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Remove unnecessary endif_stack.Matt Turner1-3/+1
Unnecessary since last commit. Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Rework to make IF & ELSE blocks flow into ENDIF.Matt Turner2-15/+25
Previously we made the basic block following an ENDIF instruction a successor of the basic blocks ending with IF and ELSE. The PRM says that IF and ELSE instructions jump *to* the ENDIF, rather than over it. This should be immaterial to dataflow analysis, except for if, break, endif sequences: START B1 <-B0 <-B9 0x00000100: cmp.g.f0(8) null g15<8,8,1>F g4<0,1,0>F 0x00000110: (+f0) if(8) 0 0 null 0x00000000UD END B1 ->B2 ->B4 START B2 <-B1 break 0x00000120: break(8) 0 0 null 0D END B2 ->B10 START B3 0x00000130: endif(8) 2 null 0x00000002UD END B3 ->B4 The ENDIF block would have no parents, so dataflow analysis would generate incorrect results, preventing copy propagation from eliminating some instructions. This patch changes the CFG to make ENDIF start rather than end basic blocks, so that it can be the jump target of the IF and ELSE instructions. It helps three programs (including two fs8/fs16 pairs). total instructions in shared programs: 1561126 -> 1561060 (-0.00%) instructions in affected programs: 837 -> 771 (-7.89%) More importantly, it allows copy propagation to handle more cases. Disabling the register_coalesce() pass before this patch hurts 58 programs, while afterward it only hurts 11 programs. Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Keep pointers to IF/ELSE/ENDIF instructions in the cfg.Matt Turner2-3/+38
Useful for finding the associated control flow instructions, given a block ending in one. Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04i965/cfg: Add code to dump blocks and cfg.Matt Turner2-0/+37
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-12-04mesa: Remove support for GL_MESA_texture_arrayIan Romanick6-45/+0
This extension enabled the use of texture array with fixed-function and assembly fragment shaders. No applications are known to use this extension. NOTE: This patch regresses GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY cases of the copyteximage piglit test. The test is incorrectly using texture arrays with fixed function while only requiring the GL_EXT_texture_array extension. A fix for the test has been posted to the piglit mailing list. http://lists.freedesktop.org/archives/piglit/2013-November/008639.html Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04mesa: Use a single enable for GL_EXT_texture_array and GL_MESA_texture_arrayIan Romanick14-57/+29
Every driver that enables one also enables the other. The difference between the two is MESA adds support for fixed-function and assembly fragment shaders, but EXT only adds support for GLSL. The MESA extension was created back when Mesa did not support GLSL. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04mesa: Minor clean-up of target_enum_to_indexIan Romanick1-6/+6
Constify the gl_context parameter, and remove suffixes from enums that have non-suffix versions. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04mesa: Silence GCC warning in count_tex_sizeIan Romanick1-0/+2
main/texobj.c: In function 'count_tex_size': main/texobj.c:886:23: warning: unused parameter 'key' [-Wunused-parameter] Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
2013-12-04mesa: Silence GCC warning in _mesa_test_texobj_completenessIan Romanick1-1/+1
main/texobj.c: In function '_mesa_test_texobj_completeness': main/texobj.c:553:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] main/texobj.c:553:193: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] main/texobj.c:553:254: warning: signed and unsigned type in conditional expression [-Wsign-compare] main/texobj.c:553:148: warning: signed and unsigned type in conditional expression [-Wsign-compare] Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>