summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* st/mesa: use new RGBX formatsMarek Olšák2013-02-071-17/+111
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: add RGBX formats for existing GL RGB texture formatsMarek Olšák2013-02-076-47/+959
| | | | v2: fix compilation of swrast
* i965/blorp: Support blits between ARGB and XRGB formats.Kenneth Graunke2013-02-061-14/+12
| | | | | | | | | | | | | | | Now that we have support for overriding alpha to 1.0, we can handle blitting between these formats in either direction. For now, we only support two XRGB formats: MESA_FORMAT_XRGB8888 and MESA_FORMAT_RGBX8888_REV. Most places only appear to worry about the former, so ignore the latter for now. We can always add it later. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Martin Steigerwald <[email protected]>
* i965/blorp: Support overriding destination alpha to 1.0.Kenneth Graunke2013-02-061-0/+19
| | | | | | | | | | | | | | | | | | | | Currently, Blorp requires the source and destination formats to be equal. However, we'd really like to be able to blit between XRGB and ARGB formats; our BLT engine paths have supported this for a long time. For ARGB -> XRGB, nothing needs to occur: the missing alpha is already interpreted as 1.0. For XRGB -> ARGB, we need to smash the alpha channel to 1.0 when writing the destination colors. This is fairly straightforward with blending. For now, this code is never used, as the source and destination formats still must be equal. The next patch will relax that restriction. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Tested-by: Martin Steigerwald <[email protected]>
* i965: Implement CopyTexSubImage2D via BLORP (and use it by default).Kenneth Graunke2013-02-065-8/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BLT engine has many limitations. Currently, it can only blit X-tiled buffers (since we don't have a kernel API to whack the BLT tiling mode register), which means all depth/stencil operations get punted to meta code, which can be very CPU-intensive. Even if we used the BLT engine, it can't blit between buffers with different tiling modes, such as an X-tiled non-MSAA ARGB8888 texture and a Y-tiled CMS ARGB8888 renderbuffer. This is a fundamental limitation, and the only way around that is to use BLORP. Previously, BLORP only handled BlitFramebuffer. This patch adds an additional frontend for doing CopyTexSubImage. It also makes it the default. This is partly to increase testing and avoid hiding bugs, and partly because the BLORP path can already handle more cases. With trivial extensions, it should be able to handle everything the BLT can. This helps PlaneShift massively, which tries to CopyTexSubImage2D between depth buffers whenever a player casts a spell. Since these are Y-tiled, we hit meta and software ReadPixels paths, eating 99% CPU while delivering ~1 FPS. This is particularly bad in an MMO setting because people cast spells all the time. It also helps Xonotic in 4X MSAA mode. At default power management settings, I measured a 6.35138% +/- 0.672548% performance boost (n=5). (This data is from v1 of the patch.) No Piglit regressions on Ivybridge (v3) or Sandybridge (v2). v2: Create a fake intel_renderbuffer to wrap the destination texture image and then reuse do_blorp_blit rather than reimplementing most of it. Remove unnecessary clipping code and conditional rendering check. v3: Reuse formats_match() to centralize checks; delete temporary renderbuffers. Reorganize the code. v4: Actually copy stencil when dealing with separate stencil buffers but packed depth/stencil formats. Tested by a new Piglit test. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> [v4] Reviewed-by: Ian Romanick <[email protected]> [v3] Reviewed-and-tested-by: Carl Worth <[email protected]> [v2] Tested-by: Martin Steigerwald <[email protected]> [v3]
* mesa: Put extern "C" guards in renderbuffer.h.Kenneth Graunke2013-02-061-1/+7
| | | | | | | | | I need to use this from C++ code. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* st/mesa: get rid of GET_CURRENT_CONTEXT in st_choose_formatMarek Olšák2013-02-066-22/+21
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: adjust texture format selection to try the closest base format firstMarek Olšák2013-02-061-18/+13
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: put RGBX8 and RGBA8 in the default format listsMarek Olšák2013-02-061-0/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add the rest of RGB8 format/type combos to exact_format_mapping tablesMarek Olšák2013-02-061-2/+0
| | | | | | | | These formats were added a few months after these tables were committed. No idea why we have the table though. AFAIK, texstore always takes the slow path for GL_RGBn. Reviewed-by: Brian Paul <[email protected]>
* mesa: fixup inconsistent naming of RG16 formatsMarek Olšák2013-02-0612-37/+37
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: emit saturates in the vertex shader if Shader Model 3.0 is supportedMarek Olšák2013-02-063-3/+6
| | | | v2: change the requirement from GLSL 1.30 to SM 3.0 (R500 can do this)
* st/mesa: advertise ARB_shading_language_packing for GLSL >= 1.30Marek Olšák2013-02-062-0/+16
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/mesa: do most of GLSL lowering outside of the optimization do-while loopMarek Olšák2013-02-061-36/+29
| | | | | | based on the intel driver Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove dead code depending on EmitCondCodesMarek Olšák2013-02-061-22/+2
| | | | | | EmitCondCodes is always false. Reviewed-by: Brian Paul <[email protected]>
* i965: Disable write masking when setting up texturing m0.Eric Anholt2013-02-042-1/+4
| | | | | | | | | | v2/Kayden: Also disable write masking in the vec4 backend. Fixes 78 oglconform glsl-bif-tex-* subcases. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]> [v1] Reviewed-by: Eric Anholt <[email protected]> [v2]
* intel: Fix regression in intel_create_image_from_name stride handlingTapani Pälli2013-02-041-1/+1
| | | | | | | | | Strangely, the DRIimage interface we have passes the pitch in pixels instead of bytes, which anholt missed in the change to using bytes for region pitch. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Fix segfaults from 45a28a927ab7f29ff325b9326d386a39ba538c18Eric Anholt2013-02-042-2/+4
| | | | | | If you look up a level that isn't in the miptree, you crash. Reviewed-by: Chad Versace <[email protected]>
* glsl: Rename uniform_field_visitor to program_resource_visitor.Paul Berry2013-02-041-2/+2
| | | | | | | | | | | | | | | | There's actually nothing uniform-specific in uniform_field_visitor. It is potentially useful for all kinds of program resources (in particular, future patches will use it for transform feedback varyings). This patch renames it to program_resource_visitor, and clarifies several comments, to reflect the fact that it is useful for more than just uniforms. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/glsl: Separate parsing logic from _mesa_get_uniform_location.Paul Berry2013-02-042-61/+28
| | | | | | | | | | | | | | | | The parsing logic is moved to a new function in the GLSL module, parse_program_resource_name(). This name was chosen because it should eventually be useful for handling everything that OpenGL 4.3 calls "program resources" (e.g. uniforms, vertex inputs, fragment outputs, and transform feedback varyings). Future patches will make use of this function for linking transform feedback varyings. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: make sure to setup image dimension in image_from_planar setupAbdiel Janulgue2013-02-041-0/+1
| | | | | | | | Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60212 Tested-by: Scott Moreau <[email protected]> Tested-by: Tiago Vignatti <[email protected]> Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Abdiel Janulgue <[email protected]>
* st/mesa: emit SQRT opcode when driver supports itBrian Paul2013-02-041-7/+21
|
* st/mesa: simplify the update_single_texture() functionBrian Paul2013-02-041-28/+7
| | | | | | | | In particular, rework the sRGB/linear format selection code. There's no reason to mess with the Mesa format. Just do everything in terms of the gallium pipe_format. Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: merge st_ChooseTextureFormat_renderable() into st_ChooseTextureFormat()Brian Paul2013-02-042-38/+21
| | | | That was the only place it was being called from.
* st/mesa: improve the format choosing code for DrawPixelsBrian Paul2013-02-041-6/+8
| | | | | | The code before was getting a pipe format, then calling st_pipe_format_to_mesa_format() and then converting back again with st_mesa_format_to_pipe_format(). This removes one conversion step.
* st/mesa: don't choose DXT formats if we can't do DXT compressionBrian Paul2013-02-045-13/+29
| | | | | | | | | | | | | | | | | | | | If we call gl[Copy]TexImage2D() with a generic compression format (e.g. intFormat=GL_COMPRESSED_RGBA) we can't choose a DXT format if we don't have the external DXT compression library. We weren't actually enforcing this before since the pipe_screen::is_format_supported(DXT) query has no dependency on the DXT compression library. Now if we're given a generic compressed format and we can't do DXT compression we'll fall back to a non-compressed format. v2: use util_format_is_s3tc() function and add more comments about the allow_dxt parameter. Note: This is a candidate for the stable branches. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: don't use format chooser code for glCompressedTexImageBrian Paul2013-02-041-2/+12
| | | | | | | | | | When glCompressedTexImage is called the internalFormat is a specific format for the incoming image and the the hardware format should be the same (since we never do format transcoding). So use the simpler _mesa_glenum_to_compressed_format() function. This change is also needed for the next patch. Note: This is a candidate for the stable branches.
* i965: Fix the SF Vertex URB Read Length calculation for Gen7 platforms.Kenneth Graunke2013-02-031-16/+16
| | | | | | | | | | | | | | | | | | | Ivybridge doesn't appear to have the same errata as Sandybridge; no corruption was observed by setting it to more than the minimal correct value. It's possible that we were simply lucky, since the URB entries are 1024-bit on Ivybridge vs. 512-bit Sandybridge. Or perhaps the underlying hardware issue is fixed. Either way, we may as well program the minimum value since it's now readily available, likely to be more efficient, and possibly more correct. v2: Use GEN7_SBE_* defines rather than GEN6_SF_*. (A copy and paste mistake.) They're the same, but using the right names is better. NOTE: This is a candidate for all stable branches. Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Fix the SF Vertex URB Read Length calculation for Sandybridge.Kenneth Graunke2013-02-031-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This commit message was primarily written by Paul Berry, who explained what's going on far better than I would have.) Previous to this patch, we thought that the only restrictions on 3DSTATE_SF's URB read length were (a) it needs to be large enough to read all the VUE data that the SF needs, and (b) it can't be so large that it tries to read VUE data that doesn't exist. Since the VUE map already tells us how much VUE data exists, we didn't bother worrying about restriction (a); we just did the easy thing and programmed the read length to satisfy restriction (b). However, we didn't notice this erratum in the hardware docs: "[errata] Corruption/Hang possible if length programmed larger than recommended". Judging by the context surrounding this erratum, it's pretty clear that it means "URB read length must be exactly the size necessary to read all the VUE data that the SF needs, and no larger". Which means that we can't program the read length based on restriction (b)--we have to program it based on restriction (a). The URB read size needs to precisely match the amount of data that the SF consumes; it doesn't work to simply base it on the size of the VUE. Thankfully, the PRM contains the precise formula the hardware expects. Fixes random UI corruption in Steam's "Big Picture Mode", random terrain corruption in PlaneShift, and Piglit's fbo-5-varyings test. NOTE: This is a candidate for all stable branches. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56920 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60172 Tested-by: Jordan Justen <[email protected]> (v1/Piglit) Tested-by: Martin Steigerwald <[email protected]> (PlaneShift) Reviewed-by: Paul Berry <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Compute the maximum SF source attribute.Kenneth Graunke2013-02-033-4/+12
| | | | | | | | | | The maximum SF source attribute is necessary to compute the Vertex URB read length properly, which will be done in the next commit. NOTE: This is a candidate for all stable branches. Reviewed-by: Paul Berry <[email protected]> Tested-by: Martin Steigerwald <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Refactor Gen6+ SF attribute override code.Kenneth Graunke2013-02-031-12/+13
| | | | | | | | | | | The next patch will benefit from easy access to the source attribute number and whether or not we're swizzling. It doesn't want the final attr_override DWord form, however. NOTE: This is a candidate for all stable branches. Reviewed-by: Paul Berry <[email protected]> Tested-by: Martin Steigerwald <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* i965: Remove dead field brw_wm_prog_data::error.Kenneth Graunke2013-02-031-1/+0
|
* i965: Remove dead field brw_context::constant_map.Kenneth Graunke2013-02-031-1/+0
| | | | This was used by the old VS backend, but that's long gone.
* swrast: Fix memory leak.Vinson Lee2013-02-011-0/+1
| | | | | | | Fixes resource leak defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* intel: implement create image from textureAbdiel Janulgue2013-02-011-21/+138
| | | | | | | | | | | | | | | | | Save miptree level info to DRIImage: - Appropriately-aligned base offset pointing to the image - Additional x/y adjustment offsets from above. v8: -Bump intelImageExtension version v9: -Don't use internal _eglError but implement error reporting in new DRI inteface instead. This fixes Android build problems based on feedback from Adrian M Negreanu and Chad Versace. -Move the non-tile-aligned check and error-reporting to intel_set_texture_image_region v10: -Don't #include "egl/main/eglcurrent.h". [chadv] Reviewed-by: Eric Anholt <[email protected]> (v6) Acked-by: Chad Versace <[email protected]> (v10) Signed-off-by: Abdiel Janulgue <[email protected]>
* intel: Account for mt->offset in intel_miptree_mapAbdiel Janulgue2013-02-011-2/+2
| | | | | | | | | | | We need to take account the offset from original bo when using glTexSubImage() and other functions that manipulate the subregion of an exported texture. Offsets are appended to mapped region address and when blitting from a source region. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Abdiel Janulgue <[email protected]>
* intel: Create a miptree using offsets in intel_set_texture_image_regionAbdiel Janulgue2013-02-011-7/+53
| | | | | | | | | | | | | | | | When binding a region to a texture image, re-create the miptree base-level considering the offset and dimension information exported by DRIImage. v8: - Move the alignment surface address checks from the image-from-texture code to the texture-from-image side. This allows the error reporting to conform to OES_EGL_Image and to prevent mixing up EGL and GL errors. Reported by Chad Versace. - Addressed an existing issue in renderbuffer case where there is a a possibility of creating EGL images out of depthstencil textures which isn't really possible. This was spotted by Eric earlier. Reviewed-by: Eric Anholt <[email protected]> (v6) Reviewed-by: Chad Versace <[email protected]> (v8) Signed-off-by: Abdiel Janulgue <[email protected]>
* i965: Account for offsets when updating SURFACE_STATE.Abdiel Janulgue2013-02-012-2/+21
| | | | | | | | | If the offsets are present, this lets us specify a particular level and slice in a shared region using the base level of an exported mip-map tree. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Abdiel Janulgue <[email protected]>
* intel: add pixel offset calculator for miptree levelsAbdiel Janulgue2013-02-012-0/+21
| | | | | | | | | Add helper to calculate fine-grained x and y adjustment pixels to an image within a miptree level for tiled regions. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Abdiel Janulgue <[email protected]>
* intel: Expose intel_miptree_create_internal as intel_miptree_create_layout.Abdiel Janulgue2013-02-012-14/+25
| | | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Chad Versace <[email protected]> Signed-off-by: Abdiel Janulgue <[email protected]>
* intel: expose dimensions and offsets of a miptree level in DRIImageAbdiel Janulgue2013-02-011-0/+7
| | | | | | | | v8: - Append has_depthstencil field in DRIImage structure. Reviewed-by: Eric Anholt <[email protected]> (v6) Reviewed-by: Chad Versace <[email protected]> (v8) Signed-off-by: Abdiel Janulgue <[email protected]>
* st/mesa: whitespace/indentation fixBrian Paul2013-02-011-2/+2
|
* mesa: don't expose IBM_rasterpos_clip in a core contextMarek Olšák2013-02-011-1/+1
| | | | | | | | | glRasterPos doesn't exist in the core profile. NOTE: This is a candidate for the stable branches (9.0 and 9.1). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: bump version to 9.2 (devel)Andreas Boll2013-01-311-2/+2
| | | | | | | Now that branch 9.1 is created, bump the minor version in master. Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "mesa: Return INVALID_OPERATION when type is known but not allowed"Matt Turner2013-01-301-11/+1
| | | | | | | | | | | | This reverts commit 2906e2034c9d674601960a5b586b6e986e6ef04f. Fixes a regression in the glean depthStencil test. Reverting this does not affect any tests in es3conform, so a more recent patch must have also fixed the failure this one was intended to fix. Reported-by: lu hua <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59494
* mesa: Add TexBufferRange to dispatch_sanity.Kenneth Graunke2013-01-301-1/+1
| | | | | | Christoph implemented this, so we should expect it to be present now. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60082
* st/mesa: add support for GL_ARB_texture_buffer_rangeChristoph Bumiller2013-01-302-1/+28
| | | | | | | | v2: Update to handle BufferSize being -1 and return a NULL sampler view if the specified range would cause out of bounds access. Reviewed-by: Brian Paul <[email protected]> Acked-by: Ian Romanick <[email protected]>
* mesa: implement GL_ARB_texture_buffer_rangeChristoph Bumiller2013-01-308-17/+103
| | | | | | | | | | | | | | | | | | | | | | | v2: Record texObj.BufferSize as -1 in TexBuffer(non-Range) instead of the buffer's current size so we know we always have to use the full size of the buffer object (i.e. even if it changes without the user calling TexBuffer again) for the texture. Clarify invalid offset alignment error message. v3: Use extra GL_CORE-only section in get_hash_params.py for TEXTURE_BUFFER_OFFSET_ALIGNMENT. v4: Remove unnecessary check for profile in _mesa_TexBufferRange. Add check for extension enable in get_tex_level_parameter_buffer. v5: Fix position in gl_API.xml. Add comment about meaning of BufferSize == -1. v6: Add back checks for core profile and add a note about it. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove ctx->Driver.Error() hookBrian Paul2013-01-293-12/+0
| | | | | | Not used by any driver anymore. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix comment typo: s/formaat/format/Brian Paul2013-01-291-1/+1
|