summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
Commit message (Collapse)AuthorAgeFilesLines
* i965: Check reg.nr for BRW_ARF_NULL instead of reg.file.Matt Turner2013-04-171-1/+1
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Implement work-around for CMP with null dest on Haswell.Matt Turner2013-04-171-0/+12
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Fix hypothetical use of uninitialized data in attribute_map[].Paul Berry2013-04-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue identified by Klocwork analysis: 'attribute_map' array elements might be used uninitialized in this function (vec4_visitor::lower_attributes_to_hw_regs). The attribute_map array contains the mapping from shader input attributes to the hardware registers they are stored in. vec4_vs_visitor::setup_attributes() only populates elements of this array which, according to core Mesa, are actually used by the shader. Therefore, when vec4_visitor::lower_attributes_to_hw_regs() accesses the array to lower a register access in the shader, it should in principle only access elements of attribute_map that contain valid data. However, if a bug ever caused the driver back-end to access an input that was not flagged as used by core Mesa, then lower_attributes_to_hw_regs() would access uninitialized memory, which could cause illegal instructions to get generated, resulting in a possible GPU hang. This patch makes the situation more robust by using memset() to pre-initialize the attribute_map array to zero, so that if such a bug ever occurred, lower_attributes_to_hw_regs() would generate a (mostly) harmless access to r0. In addition, it adds assertions to lower_attributes_to_hw_regs() so that if we do have such a bug, we're likely to discover it quickly. Reviewed-by: Jordan Justen <[email protected]>
* mesa: remove #include "mfeatures.h" from numerous source filesBrian Paul2013-04-1714-14/+0
| | | | | | None of the remaining FEATURE_x symbols in mfeatures.h are used anymore. Reviewed-by: Jordan Justen <[email protected]>
* intel: Don't dereference a NULL pointer of calloc failsIan Romanick2013-04-171-0/+4
| | | | | | | | | | The caller of NewTextureObject does the right thing if NULL is returned, so this function should do the right thing too. NOTE: This is a candidate for stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Trim trailing whitespace in brw_defines.h.Eric Anholt2013-04-171-144/+144
| | | | | | It was all over the formats section I wanted to edit. Reviewed-by: Kenneth Graunke <[email protected]>
* r200: fix build failure introduced with cbbcb0247e6aa8d7adc274a94206ee02f9c70beaLaurent Carlier2013-04-171-1/+1
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: remove gl_context::_TriangleCapsBrian Paul2013-04-171-3/+4
| | | | | | No longer used anywhere. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_LIGHT_TWOSIDE flagBrian Paul2013-04-173-7/+16
| | | | | | v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_UNFILLED flagBrian Paul2013-04-175-11/+31
| | | | | | | Use alternate code in intel, r200, radeon drivers. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_STIPPLE flagBrian Paul2013-04-171-0/+2
| | | | | | | Make it a local macro for the i915 driver. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_TRI_OFFSET flagBrian Paul2013-04-171-0/+4
| | | | | | | Make it a local macro for the i915 driver. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_POINT_ATTEN flagBrian Paul2013-04-171-1/+3
| | | | | | | For the i915 driver, make it a local macro. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_POINT_SMOOTH flagBrian Paul2013-04-172-2/+2
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_LINE_STIPPLE flagBrian Paul2013-04-171-1/+3
| | | | | | | For the i915 driver, make it a local macro. v2: use conditional operator instead of bit shifting Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove DD_SEPARATE_SPECULAR flagBrian Paul2013-04-173-3/+6
| | | | Reviewed-by: Eric Anholt <[email protected]>
* intel: Add a null pointer check before dereferencing the pointerAnuj Phogat2013-04-171-0/+9
| | | | | Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Enable the Bay Trail platform.Kenneth Graunke2013-04-163-0/+24
| | | | | | | | This patch adds PCI IDs for Bay Trail (sometimes called Valley View). As far as the 3D driver is concerned, it's very similar to Ivybridge, so the existing code should work just fine. Signed-off-by: Kenneth Graunke <[email protected]>
* build: Get rid of DRIVER_DIRSMatt Turner2013-04-151-22/+0
| | | | | | Tested-by: Emil Velikov <[email protected]> Reviewed-and-Tested-by: Andreas Boll <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Shut up the last release build warning.Eric Anholt2013-04-121-0/+1
| | | | | | | I don't see a sensible value to use in this path, but we shouldn't ever hit this outside of developer new-texture-target enabling. Reviewed-by: Matt Turner <[email protected]>
* i965: Silence one more compile warning.Eric Anholt2013-04-121-0/+1
| | | | | | | | We don't want to store this thing in the class, and we do need the definition to be at the top of the function and held onto until the end here, so there's not much to do besides (void) reference it. Reviewed-by: Matt Turner <[email protected]>
* i965: Fix a warning in the release build.Eric Anholt2013-04-121-2/+1
| | | | | | | This was copy and pasted from can_reswizzle_dst(), and we can just fold it in instead to avoid the warning. Reviewed-by: Matt Turner <[email protected]>
* i965: Fix an unused variable warning in the release build.Eric Anholt2013-04-121-4/+2
| | | | | | | I think this actually clarifies what's going on in the asserts a bit, given how many regions we've got floating around. Reviewed-by: Matt Turner <[email protected]>
* i965: Fix an unused variable warning in the release build.Eric Anholt2013-04-121-1/+0
| | | | | | It's used in an assert, but we have this as a member of the class anyway. Reviewed-by: Matt Turner <[email protected]>
* intel: Return failure properly in the texsubimage blit path.Eric Anholt2013-04-121-1/+1
| | | | | | | | We assert that failure doesn't happen, but it fixes a warning in the release build and it would at least give working behavior for a user by falling back to the normal texsubimage path. Reviewed-by: Matt Turner <[email protected]>
* intel: Fix a warning in the release build.Eric Anholt2013-04-121-2/+1
| | | | | | | This was silly -- checking that we didn't overflow the array by dividing the array size by 2 and then multiplying it back up by 2. Reviewed-by: Matt Turner <[email protected]>
* intel: Fix an unused variable warning in the release build.Eric Anholt2013-04-121-2/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* intel: Improve diagnostics for emit_linear_blit failure path.Eric Anholt2013-04-121-2/+5
| | | | | | | This fixes unused variable warnings in the release build, and should be more useful if it ever triggers. Reviewed-by: Matt Turner <[email protected]>
* i965: Fix error path for MCS allocation.Eric Anholt2013-04-121-1/+1
| | | | | | | | Asserts don't stop execution in release builds, so we would continue on to use an uninitialized format value. Just take the failure path, which appears to continue up the call stack for a while. Reviewed-by: Matt Turner <[email protected]>
* i830: Move assert-only code into the assert.Eric Anholt2013-04-121-4/+1
| | | | | | | The call has no side effects, and moving it into the assert cleans up a compile warning in the release build. Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Fix some untriggered optimization bugs with uncompressed/sechalf.Eric Anholt2013-04-121-4/+4
| | | | | | | | | We have this support for firsthalf/sechalf instructions, which would be called in the !has_compr4 (aka original gen4) 16-wide case. We currently only support 16-wide for gen5+, so we weren't tripping over this, but it would have been a problem if we ever try to enable it. Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Add basic-block-level dead code elimination.Eric Anholt2013-04-122-0/+161
| | | | | | | | | | | | | | | | | This is a poor substitute for proper global dead code elimination that could replace both our current paths, but it was very easy to write. It particularly helps with Valve's shaders that are translated out of DX assembly, which has been register allocated and thus have a bunch of unrelated uses of the same variable (some of which get copy-propagated from and then left for dead). shader-db results: total instructions in shared programs: 1735753 -> 1731698 (-0.23%) instructions in affected programs: 492620 -> 488565 (-0.82%) v2: Fix comment typo Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Remove incorrect note of writing attr in centroid workaround.Eric Anholt2013-04-121-1/+1
| | | | | | | | This instruction doesn't update its IR destination, it just moves from payload to f0. This caused the dead code elimination pass I'm adding to dead-code-eliminate the first step of interpolation. Reviewed-by: Matt Turner <[email protected]>
* i965/fs: Add a helper function for checking for partial register updates.Eric Anholt2013-04-125-22/+24
| | | | | | | | These checks were all over, and every time I wrote one I had to try to decide again what the cases were for partial updates. v2: Fix inadvertent reladdr check removal. Reviewed-by: Matt Turner <[email protected]>
* mesa: Add a macro to bitset for determining bitset size.Eric Anholt2013-04-122-3/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965: Fix compiler warnings since the introduction of texture multisample.Eric Anholt2013-04-121-1/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* i965/vs: Print error if vertex shader fails to compile.Matt Turner2013-04-111-0/+4
| | | | Reviewed-by: Eric Anholt <[email protected]>
* i965: NULL check prog on shader compilation failure.Matt Turner2013-04-112-7/+11
| | | | | | Also change if (shader) to if (prog) for consistency. Reviewed-by: Eric Anholt <[email protected]>
* i965/vs: Don't hardcode DEBUG_VS in generic vec4 code.Paul Berry2013-04-115-14/+25
| | | | | | | | | | | | Since the vec4_visitor and vec4_generator classes are going to be re-used for geometry shaders, we can't enable their debug functionality based on (INTEL_DEBUG & DEBUG_VS) anymore. Instead, add a debug_flag boolean to these two classes, so that when they're instantiated the caller can specify whether debug dumps are needed. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Generalize computation of array strides in preparation for GS.Paul Berry2013-04-112-4/+16
| | | | | | | | | | | | | | | | | | | Geometry shader inputs are arrays, but they use an unusual array layout: instead of all array elements for a given geometry shader input being stored consecutively, all geometry shader inputs are interleaved into one giant array. As a result, the array stride we use to access geometry shader inputs must be equal to the size of the input VUE, rather than the size of the array element. This patch introduces a new virtual function, vec4_visitor::compute_array_stride(), which will allow geometry shader compilation to specialize the computation of array stride to account for the unusual layout of geometry shader input arrays. It also renames the local variable that the ir_dereference_array visitor uses to store the stride, to avoid confusion. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Generalize attribute setup code in preparation for GS.Paul Berry2013-04-112-22/+33
| | | | | | | | | | | This patch introduces a new function, vec4_visitor::lower_attributes_to_hw_regs(), which replaces registers of type ATTR in the instruction stream with the hardware registers that store those attributes. This logic will need to be common between the vertex and geometry shaders. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Generalize vertex emission code in preparation for GS.Paul Berry2013-04-113-19/+59
| | | | | | | | | | | | | | | | | | | | This patch introduces a new function, vec4_visitor::emit_vertex(), which contains the code for emitting vertices that will need to be common between the vertex and geometry shaders. Geometry shaders will need to use a different message header, and a different opcode, for their URB writes, so we introduce virtual functions emit_urb_write_header() and emit_urb_write_opcode() to take care of the GS-specific behaviours. Also, since vertex emission happens at the end of the VS, but in the middle of the GS, we need to be sure to only call emit_shader_time_end() during VS vertex emission. We accomplish this by moving the call to emit_shader_time_end() into the VS implementation of emit_urb_write_opcode(). Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: rename vec4_generator::generate_vs_instruction.Paul Berry2013-04-112-7/+7
| | | | | | | | | Since this function is going to get used for geometry shaders too, it deserves a more generic name: generate_vec4_instruction. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Generalize data structures pointed to by vec4_generator.Paul Berry2013-04-113-9/+7
| | | | | | | | | | | | | | | | | | | | | | This patch removes the following field from vec4_generator, since it is not used: - struct brw_vs_compile *c And changes the following field: - struct gl_vertex_program *vp => struct gl_program *prog With these changes, vec4_generator no longer refers to any VS-specific data structures. This will pave the way for re-using it for geometry shaders. Reviewed-by: Jordan Justen <[email protected]> v2: Use the name "prog" rather than "p". Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Rename vec4_generator::prog to shader_prog.Paul Berry2013-04-112-6/+6
| | | | | | | | | | | The next patch is going to change the type of vec4_generator::vp from struct gl_vertex_program * to struct gl_program *, and rename it. The sensible name to change it to is vec4_generator::prog. However, prog is already used. Since the existing vec4_generator::prog is of type struct gl_shader_program, it makes sense to rename it to shader_prog. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: move VS-specific data members to vs_vec4_visitor.Paul Berry2013-04-116-88/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the following data structures from vec4_visitor to vec4_vs_visitor, since they contain VS-specific data: - struct brw_vs_compile *c (renamed to vs_compile) - struct brw_vs_prog_data *prog_data (renamed to vs_prog_data) - src_reg *vp_temp_regs - src_reg vp_addr_reg Since brw_vs_compile and brw_vs_prog_data also contain vec4-generic data, the following pointers are added to the base class, to allow it to access the vec4-generic portions of these data structures: - struct brw_vec4_compile *c - struct brw_vec4_prog_key *key - struct brw_vec4_prog_data *prog_data Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> v2: Use shorter names in the base class and longer names in the derived class. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: move ARB_vertex_program functions to vec4_vs_visitor.Paul Berry2013-04-112-6/+8
| | | | | | | | | | | | | | | | This patch moves functions from vec4_visitor to vec4_vs_visitor that deal with ARB (assembly) vertex programs. There's no point in having these functions in the base class since we don't intend to support assembly programs for the GS stage. The following functions are moved: - setup_vp_regs - get_vp_dst_reg - get_vp_src_reg Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Add virtual function make_reg_for_system_value().Paul Berry2013-04-113-18/+36
| | | | | | | | | | | | The system values handled by vec4_visitor::visit(ir_variable *) are VS-specific (vertex ID and instance ID). This patch moves the handling of those values into a new virtual function, make_reg_for_system_value(), so that this VS-specific code won't be inherited by geomtry shaders. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Make some vec4_visitor functions virtual.Paul Berry2013-04-115-11/+41
| | | | | | | | | | | | | | | | This patch makes the following vec4_visitor functions virtual, since they will need to be implemented differently for vertex and geometry shaders. Some of the functions are renamed to reflect their generic purpose, rather than their VS-specific behaviour: - setup_attributes - emit_attribute_fixups (renamed to emit_prolog) - emit_vertex_program_code (renamed to emit_program_code) - emit_urb_writes (renamed to emit_thread_end) Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Make vec4_vs_visitor class derived from vec4_visitor.Paul Berry2013-04-114-2/+37
| | | | | | | | | | This patch just creates the derived class; later patches will migrate VS-specific functions and data structures from the base class into the derived class. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>