summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
Commit message (Collapse)AuthorAgeFilesLines
* i965/vs: Handle destinations in the MRF file.Eric Anholt2011-09-201-0/+6
| | | | | We've been referencing MRFs through the HW_REG file so far, but that makes it harder to handle compute-to-MRF and similar optimizations.
* i965/vs: Add a function for how many MRFs get written as part of a SEND.Eric Anholt2011-09-202-0/+39
| | | | | This will be used for compute-to-mrf, which needs to know when MRFs get overwritten.
* i965/vs: Remove dead fields of src_reg.Eric Anholt2011-09-201-2/+0
| | | | | | These were copy and pasted from the FS, and are never used. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Add support for simple algebraic optimizations.Eric Anholt2011-09-203-0/+96
| | | | | | | | | | | | | | We generate silly code for array access, and it's easier to generally support the cleanup than to specifically avoid the bad code in each place we might generate it. Removes 4.6% of instructions from 41.6% of shaders in shader-db, particularly savage2/hon and unigine. v2: Fixes by Ken: Make is_zero/one member functions, and fix a progress flag. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix polygon stipple offset state flagging.Eric Anholt2011-09-201-4/+6
| | | | | | | | | | | _NEW_WINDOW_POS wasn't a real Mesa state flag, but we were missing _NEW_BUFFERS to update the stipple offset when FBO binding or window size changed, and _NEW_POLYGON to update when stippling gets enabled. Fixes oglconform's tristrip test. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Add missing _NEW_POLYGON flag to polygon stipple upload.Eric Anholt2011-09-201-1/+3
| | | | | | | | Because we skip the pattern upload when stippling is disabled, we need to check again when it might have been turned on. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Fix compiler warnings.Eric Anholt2011-09-201-6/+4
|
* i965/fs: Implement texelFetch() on Gen4.Kenneth Graunke2011-09-192-4/+18
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Implement texelFetch() on Ivybridge.Kenneth Graunke2011-09-191-4/+21
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965/fs: Implement texelFetch() on Ironlake and Sandybridge.Kenneth Graunke2011-09-195-2/+17
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Replace _mesa_rgba_logicop_enabled(ctx) with ↵Ian Romanick2011-09-195-11/+11
| | | | | | | | | | | | ctx->Color.ColorLogicOpEnabled Since GL_EXT_blend_logic_op is removed, _mesa_rgba_logicop_enabled(ctx) just returns ctx->Color.ColorLogicOpEnabled. That seems kind of silly. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Use ColorLogicOpEnabled instead of _LogicOpEnabledIan Romanick2011-09-194-4/+4
| | | | | | | | | | Since GL_EXT_blend_logic_op is removed, _LogicOpEnabled and ColorLogicOpEnabled always have the same value. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965 new VS: Fix copy propagation of double negatives.Paul Berry2011-09-191-1/+1
| | | | | | | | | | | | | When copy propagating a value into an instruction that negates its argument, we need to invert the sense of the value's "negate" flag, so that -(+x) becomes -x and -(-x) becomes +x. Previously, we were always setting the value's "negate" flag to true in this circumstance, so that both -(+x) and -(-x) turned into -x. Fixes Piglit test vs-double-negative.shader_test. Reviewed-by: Kenneth Graunke <[email protected]>
* radeon: make radeon_texture_image a subclass of swrast_texture_imageBrian Paul2011-09-175-32/+43
|
* intel: make intel_texture_image a subclass of swrast_texture_imageBrian Paul2011-09-178-93/+101
| | | | | We need to subclass swrast_texture_image because if we use swrast for fallback rendering, we'll need to have swrast_texture_image objects.
* mesa: add new DeleteTextureImage() driver hookBrian Paul2011-09-172-0/+16
| | | | | | Matches the NewTextureImage() hook. With new subclasses of gl_texture_image coming we need a new hook to properly delete objects of those subclasses.
* mesa: move software texel fetch code into swrastBrian Paul2011-09-171-1/+1
| | | | It's only used by swrast now so move it out of core Mesa.
* Change strerror(ret) to strerror(-ret).Eugeni Dodonov2011-09-151-1/+1
|
* DRI: Log something if we don't support legacy DRIAndrew Deason2011-09-141-1/+3
| | | | | | | | If we are called via the legacy DRI interface, and we don't support legacy DRI (InitScreen is NULL), print a debug message, so it is easy to see why the driver fails to initialize. See https://bugs.freedesktop.org/show_bug.cgi?id=40437
* mesa/colormac: introduce inline helper for 4 unclamped float to ubyte.Dave Airlie2011-09-144-17/+6
| | | | | | | | | This introduces an UNCLAMPED_FLOAT_TO_UBYTE x 4 inline function, as suggested by Brian. It uses it in a few places I noticed from previous color changes, and also some core mesa places. I haven't updated other places yet. Signed-off-by: Dave Airlie <[email protected]>
* mesa: introduce a clear color union to be used for int/unsigned buffersDave Airlie2011-09-146-17/+29
| | | | | | | | | | This introduces a new gl_color_union union and moves the current ClearColorUnclamped to use it, it removes current ClearColor completely and renames CCU to CC, then all drivers are modified to expected unclamped floats instead. also fixes st to use translated color in one place it wasn't. Signed-off-by: Dave Airlie <[email protected]>
* dri: Remove all extension enabling utility functionsIan Romanick2011-09-094-148/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* swrast-dri: Remove call to driInitExtensionsIan Romanick2011-09-091-2/+0
| | | | | | | | The only purpose this call served in the DRI swrast driver was to initialize the remap table. Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver.
* radeon: Enable extensions by just setting the flagsIan Romanick2011-09-091-59/+39
| | | | | | | | | | | | | | | | | Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver. Since the call to _mesa_enable_imaging_extensions (via driInitExtensions) is removed, EXT_blend_color, EXT_blend_logic_op, and EXT_blend_minmax are no longer advertised. These all resulted in software fallbacks, so their loss will not be mourned. EXT_blend_subtract is, however, explicitly added to the list. GL_FUNC_SUBTRACT is fully accelerated, but GL_FUNC_REVERSE_SUBTRACT (still) results in a software fallback. Cc: Alex Deucher <[email protected]> Cc: Dave Airlie <[email protected]>
* r600: Enable extensions by just setting the flagsIan Romanick2011-09-091-105/+61
| | | | | | | | | | | | | | | | Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver. Since the call to _mesa_enable_imaging_extensions (via driInitExtensions) is removed, EXT_blend_color is explicitly added to the list. EXT_blend_logic_op is removed from the list of extensions because blend factors and separate blend equations are not handled correctly. Cc: Alex Deucher <[email protected]> Cc: Dave Airlie <[email protected]>
* r300: Enable extensions by just setting the flagsIan Romanick2011-09-091-100/+62
| | | | | | | | | | | | | | | | | | | Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver. Since the call to _mesa_enable_imaging_extensions (via driInitExtensions) is removed, EXT_blend_color is explicitly added to the list. EXT_blend_logic_op is removed from the list of extensions because blend factors and separate blend equations are not handled correctly. Based on feedback from Roland Scheidegger. Cc: Dave Airlie <[email protected]> Cc: Alex Deucher <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Corbin Simpson <[email protected]>
* r200: Enable extensions by just setting the flagsIan Romanick2011-09-091-107/+63
| | | | | | | | | | | | | | | | | | Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver. Since the call to _mesa_enable_imaging_extensions (via driInitExtensions) is removed, EXT_blend_color is explicitly added with a dependency on the drmSupportsBlendColor flag. EXT_blend_logic_op is removed from the list of extensions because blend factors and separate blend equations are not handled correctly. Based on feedback from Roland Scheidegger. Cc: Alex Deucher <[email protected]> Cc: Dave Airlie <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* nouveau: Enable extensions by just setting the flagsIan Romanick2011-09-093-43/+28
| | | | | | | | | | | | | | | | | Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver. Since the call to _mesa_enable_imaging_extensions (via driInitExtensions) is removed, EXT_blend_color, EXT_blend_minmax, and EXT_blend_subtract are explicitly added to the list. EXT_blend_logic_op is removed from the list of extensions because blend factors and separate blend equations are not handled correctly. Cc: Ben Skeggs <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Cc: Viktor Novotný <[email protected]>
* intel: Move S3TC extension enable bits to intel_extensions.cIan Romanick2011-09-092-7/+8
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Enable extensions by just setting the flagsIan Romanick2011-09-091-191/+98
| | | | | | | | | | | | Core Mesa already does the dispatch offset remapping for every function that could possibly ever be supported. There's no need to continue using that cruft in the driver. EXT_blend_logic_op is removed from the list of extensions because blend factors and separate blend equations are not handled correctly. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* spantmp2: Silence many "warning: unused parameter ‘ctx’"Ian Romanick2011-09-091-0/+20
| | | | | Not all drivers use ctx in LOCAL_VARS, so '(void) ctx;' is added to all the function templates to make GCC happy.
* swrast-dri: Silence several "warning: unused parameter"Ian Romanick2011-09-091-0/+14
|
* dri: Silence several "warning: unused parameter"Ian Romanick2011-09-091-0/+8
|
* dri_util: Silence several "warning: unused parameter"Ian Romanick2011-09-091-1/+11
| | | | The parameters can't be removed because they are part of the DRI ABI.
* intel: Silence "intel/intel_fbo.h:105:4: warning: comparison of unsigned ↵Ian Romanick2011-09-091-3/+3
| | | | | | | | | | | expression < 0 is always false" The test was of an enum, attIndex, which should be unsigned. The explicit check for < 0 was replaced with a cast to unsigned in an assertion that attIndex is less than the size of the array it will be used to index. Reviewed-by: Eric Anholt <[email protected]>
* intel: Silence several "warning: unused parameter"Ian Romanick2011-09-091-0/+2
| | | | | | | Trivially silence the compiler by adding '(void) foo;' for each unused parameter. These parameters could not be removed. They are part of interface used elsewhere in Mesa, and some of the other customers actually use these parameters.
* intel: Silence several "warning: unused parameter"Ian Romanick2011-09-091-13/+4
| | | | | | | | | | | | | | | | | | | | | The internalFormat, format, and type parameters were not used by either try_pbo_upload or try_pbo_zcopy, so remove them. The width parameter was also not used by try_pbo_zcopy (because it doesn't actually copy anything), so remove it too. Eric Anholt notes: The current structure of this code is so hateful I can't bring myself to say anything about whether changing the current code is good or bad. I have a dream that one call would try to make a surface (miptree/region) out of the PBO, then we'd see about whether it matches up nicely and zero-copy/blit using that. That would be reusable for texsubimage, which is currently awful in this respect. At some point we should revisit this code with pitchforks and torches.
* intel: Silence "warning: unused parameter ‘depth0’"Ian Romanick2011-09-093-7/+4
| | | | | | | | | | The depth0 parameter was not used in intel_miptree_create_for_region, so remove it. All of the places that call this function, pass 1 for that parameter, and the place where it looks like it should have been used (the call to intel_miptree_create_internal) also had 1 hard coded. Reviewed-by: Eric Anholt <[email protected]>
* intel: Silence "warning: unused parameter ‘target’"Ian Romanick2011-09-093-13/+5
| | | | | | | | | The GLenum target parameter was not used in intel_copy_texsubimage, so remove it. Also remove the GLenum internalFormat parameter. Each caller just copied this out of the intel_texture_image that is already passed to intel_copy_texsubimage. Reviewed-by: Eric Anholt <[email protected]>
* intel: Silence several "warning: unused parameter"Ian Romanick2011-09-096-53/+30
| | | | | | The intel_context and tiling parameters were not used by any if the i9[14]5_miptree_layout or the functions they call, and the tiling parameter was not used by brw_miptree_layout. Remove the unnecessary parameters.
* intel: Silence "warning: unused parameter ‘fb’"Ian Romanick2011-09-094-7/+7
| | | | | | The gl_framebuffer was not used in intel_draw_buffer, so remove it. Reviewed-by: Eric Anholt <[email protected]>
* intel: Silence "warning: unused parameter ‘intel’"Ian Romanick2011-09-093-11/+7
| | | | The intel_context was not used in any of these functions, so remove it.
* intel: Silence several "warning: unused parameter"Ian Romanick2011-09-091-22/+38
| | | | | | | | | Also clean-up some of the naming, etc. in intel_buffer_object_purgeable. 'intel' is usually used as the name of an intel_context pointer, and intel_obj is usually used as the name of an intel_*_obj pointer. These changes were suggested by Eric Anholt. Reviewed-by: Eric Anholt <[email protected]>
* intel: Silence many "intel_batchbuffer.h:97:39: warning: comparison between ↵Ian Romanick2011-09-091-2/+3
| | | | | | | | | | | | | | | | | | | | | signed and unsigned integer expressions" v2: Remove the assertion in intel_batchbuffer_space: assert((intel->batch.state_batch_offset - intel->batch.reserved_space) >= intel->batch.used*4); After reviewing all the places where this is called, I'm (fairly) comfortable that this assertion was redundant. Having the assertion adds ~20KiB to a driver build: text data bss dec hex filename 903173 26392 1552 931117 e352d i965_dri.so 924093 26392 1552 952037 e86e5 i965_dri.so Based on feedback from Eric Anholt. Reviewed-by: Eric Anholt <[email protected]>
* nouveau: remove target parameter from nouveau_bufferobj_map_range()Brian Paul2011-09-091-1/+1
| | | | | This was missed back when the target parameter was removed from all the buffer-related driver hooks.
* i965/vs: Allow copy propagation on GRFs.Eric Anholt2011-09-081-1/+6
| | | | | Further reduces instruction count by 4.0% in 40.7% of the vertex shaders.
* i965/vs: Clear tracked copy propagation values whose source gets overwritten.Eric Anholt2011-09-081-3/+12
| | | | | This only occurs for GRFs, and hasn't mattered until now because we only copy propagated non-GRFs.
* i965/vs: Add support for copy propagation of the UNIFORM and ATTR files.Eric Anholt2011-09-083-1/+72
| | | | Removes 2.0% of the instructions from 35.7% of vertex shaders in shader-db.
* i965/vs: Add constant propagation to a few opcodes.Eric Anholt2011-09-085-0/+281
| | | | | | | | | | | This differs from the FS in that we track constants in each destination channel, and we we have to look at all the swizzled source channels. Also, the instruction stream walk is done in an O(n) manner instead of O(n^2). Across shader-db, this reduces 8.0% of the instructions from 60.0% of the vertex shaders, leaving us now behind the old backend by 11.1% overall.
* i965/vs: Keep track of indices into a per-register array for virtual GRFs.Eric Anholt2011-09-082-0/+15
| | | | | | | | | | | | Tracking virtual GRFs has tension between using a packed array per virtual GRF (which is good for register allocation), and sparse arrays where there's an element per actual register (so the first and second column of a mat2 can be distinguished inside of an optimization pass). The FS mostly avoided the need for this second sparse array by doing virtual GRF splitting, but that meant that instances where virtual GRF splitting didn't work, instructions using those registers got much less optimized.