aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* i965: Re-enable the -RHW workaround for original gen4 chips.Eric Anholt2013-02-131-12/+8
| | | | | | | | Fixes broken clipping in supertuxkart and presumably many other applications. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=51471 NOTE: Candidate for the stable branches. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen4: Work around missing sRGB RGB DXT1 support.Eric Anholt2013-02-133-4/+20
| | | | | | | | | | | The hardware just doesn't support it. I suspect this was a regression from the move to fixed MESA_FORMATs for compressed textures and that previously we were storing uncompressed for this or something. Fixes GPU hangs in piglit "texwrap GL_EXT_texture_sRGB-s3tc bordercolor swizzled" on my GM965. Reviewed-by: Kenneth Graunke <[email protected]>
* st/mesa: fix texture buffer objectsMarek Olšák2013-02-131-4/+10
| | | | | | Broken by 624528834f53f54c7a934f929769b7e6b230a0b1. Reviewed-by: Brian Paul <[email protected]>
* i965: Use derived state for Haswell's 3DSTATE_VF packet.Kenneth Graunke2013-02-121-2/+2
| | | | | | | | | | | Otherwise, we fail to correctly handle GL_PRIMITIVE_RESTART_FIXED_INDEX. Fixes gles3conform's primitive_restart_mode test. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* st/mesa: accelerate glGetTexImage for all formats using a blitMarek Olšák2013-02-132-49/+152
| | | | | | | | | | This commit allows using glGetTexImage during rendering and still maintain interactive framerates. This improves performance of WarCraft 3 under Wine. The framerate is improved from 25 fps to 39 fps in the main menu, and from 0.5 fps to 32 fps in the game. v2: fix choosing the format for decompression
* CopyTexImage: Don't check sRGB vs LINEAR for desktop GLJordan Justen2013-02-121-18/+10
| | | | | | | | | | | | | | In OpenGL 4.3, new language was added that would require this check. But, if this check results in broken applications then perhaps it will be reversed. For now, remove this check and re-evaluate when desktop GL 4.3 is closer. NOTE: This is a candidate for the 9.1 branch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* radeon: Remove dead STANDALONE_MMIO definesMatt Turner2013-02-112-3/+0
| | | | | | | | | | | | These were, at some point in the past, used to request that Xorg's compiler.h export a static inline xf86ReadMmio32 instead of a function pointer. compiler.h only has this option for DEC Alpha. But Xorg's compiler.h isn't being included by either of these two files and the radeon driver still works on Alpha, so the definitions are dead and not needed. Reviewed-by: Michel Dänzer <[email protected]>
* i965: Add missing dirty bits to INTEL_DEBUG=state arrays.Kenneth Graunke2013-02-111-0/+7
| | | | | | | | These are more recent additions, and no one remembered to update the INTEL_DEBUG=state code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Reorganize brw_bits to match the order in brw_context.h.Kenneth Graunke2013-02-111-5/+5
| | | | | | | | | | This reorders the "brw_bits" array in brw_state_upload.c to match the order of the #defines in brw_context.h. Otherwise, it's really hard to see if any are missing. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965: Use BRW_NEW_CONTEXT for gen7_disable rather than BRW_NEW_BATCH.Kenneth Graunke2013-02-111-1/+1
| | | | | | | | These don't need to be re-disabled on every batch if we're using hardware contexts. (If we're not, this is equivalent.) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* vbo: Merge GL_QUADS drawing requests in display lists.Eric Anholt2013-02-111-0/+43
| | | | | | | | | | | minecraft apparently has its piles of display lists each contain 6 instances of glBegin(GL_QUADS)/verts/glEnd(), which appear in the compiled list as 6 prims of 4 verts each in one draw call. We can reduce driver overhead even more by making that one prim of 24 verts. Improves minecraft performance by 1.6% +/- .25% (n=446) Reviewed-by: Jordan Justen <[email protected]>
* vbo: Print display list debug using printf() like dlist.c does.Eric Anholt2013-02-111-8/+8
| | | | | | | Otherwise, the stderr and stdout debug end up interleaved wrong when I pipe them to a file. Reviewed-by: Jordan Justen <[email protected]>
* i965: Remove some stale comments about the brw_constant_buffer atom.Eric Anholt2013-02-112-12/+0
| | | | | | | These have been wrong since f428255bde93a452a7cdd48fba21839c99beb6cb back in 2009! Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Simplify VS push constant upload code since removal of old path.Eric Anholt2013-02-111-7/+11
| | | | | | | | | | We used to have clip planes optionally included in the push constants, resulting in a variable amount of data uploaded, but no more. This also means less wasted space in the batch for our push constants. v2: Update _NEW_TRANSFORM state bit information. Reviewed-by: Kenneth Graunke <[email protected]> (v1)
* i965: Add perf debug for a corner case.Eric Anholt2013-02-111-0/+3
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix access mode of index buffer rebase.Eric Anholt2013-02-111-1/+1
| | | | | | | It doesn't matter with our current implementation of MapBufferRange, but it was wrong -- the result pointer is read by intel_upload_data(). Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Fix indentation of index buffer rebase code.Eric Anholt2013-02-111-9/+9
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: fix GetTexImage if mesa format and internal format don't matchMarek Olšák2013-02-112-0/+71
| | | | | | | | Tested with softpipe only exposing RGBA formats. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use memcpy fast path for GetTexImage if base format is differentMarek Olšák2013-02-111-4/+6
| | | | | | | | | | | The Mesa format can be RGBA8888_REV, the format/type can be GL_RGBA/GL_UNSIGNED_BYTE, but the actual texture internal format can be LUMINANCE_ALPHA, INTENSITY, etc. Therefore we should look at the base internal format as well. NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: don't use _mesa_base_tex_format for format parameter of GetTexImageMarek Olšák2013-02-111-1/+36
| | | | | | | | | | _mesa_base_tex_format doesn't accept GL_BGR and GL_ABGR_EXT, etc. v2: add a (now hopefully complete) helper function to deal with this NOTE: This is a candidate for the stable branches. Reviewed-by: Brian Paul <[email protected]>
* mesa: adjust usage of swapBytes/littleEndian in format_matches_format_and_typeMarek Olšák2013-02-111-25/+17
| | | | | | | | | | - swapBytes has no effect on 8-bit single-component formats - GL_SHORT is in host byte order, so checking for littleEndian is unnecessary, I decided to make the change for single-component formats only Based on suggestions from Michel Dänzer. Reviewed-by: Michel Dänzer <[email protected]>
* mesa: remove per-format memcpy codepaths from texstore functionsMarek Olšák2013-02-111-590/+64
| | | | | | It's obsoleted by the common function _mesa_texstore_memcpy. Reviewed-by: Brian Paul <[email protected]>
* mesa: implement common texstore memcpy function for all formatsMarek Olšák2013-02-111-0/+60
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fill in Z32_FLOAT_X24S8 in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-1/+2
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: fill in signed cases and RGBA16 in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-4/+26
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fill in INT/UINT format cases in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-6/+61
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fill in YCBCR cases in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-1/+6
| | | | | | | based on the texstore code Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
* mesa: fill in SRGB cases in _mesa_format_matches_format_and_typeMarek Olšák2013-02-111-5/+5
| | | | | | Texstore takes the same codepath as the corresponding linear formats. Reviewed-by: Brian Paul <[email protected]>
* intel: Do not expose OES_compressed_ETC1_RGB8_texture or ↵Ian Romanick2013-02-081-2/+2
| | | | | | | | | | | | | | ARB_texture_rgb10_a2ui pre-GEN4 Older hardware cannot do ARB_texture_rgb10_a2ui, and the translation code for OES_compressed_ETC1_RGB8_texture was never implemented in the i915 driver. NOTE: This is a candidate for all stable branches. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel: Ensure variable intel is used in i915 builds.Vinson Lee2013-02-081-1/+1
| | | | | | | | Fixes unused pointer value defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Consolidate some redundant definitions of ARRAY_SIZE() macro.Paul Berry2013-02-087-10/+7
| | | | | | | | | | | | | | | | | | | | | Previous to this patch, there were 13 identical definitions of this macro in Mesa source. That's ridiculous. This patch consolidates 6 of them to a single definition in src/mesa/main/macros.h. Unfortunately, I wasn't able to eliminate the remaining definitions, since they occur in places that don't include src/mesa/main/macros.h: - include/pci_ids/pci_id_driver_map.h - src/egl/drivers/dri2/egl_dri2.h - src/egl/main/egldefines.h - src/gbm/main/backend.c - src/gbm/main/gbm.c - src/glx/glxclient.h - src/mapi/mapi/stub.c I'm open to suggestions as to how to deal with the remaining redundancy. Reviewed-by: Kenneth Graunke <[email protected]>
* intel/pre-gen6: Disable EXT_framebuffer_multisample.Paul Berry2013-02-083-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the i965 driver enabled EXT_framebuffer_multisample even on pre-gen6 chipsets. However, since we don't support multisampling on these chips, we set GL_MAX_SAMPLES=1 (the minimum allowed by EXT_framebuffer_multisample), and if the client ever requested a multisample buffer, we quietly supplied them with a single-sampled buffer instead. After some discussion on the mailing list (see thread "ext_framebuffer_multisample: check for num_samples<=1"), it's clear that this was the wrong approach. The correct approach is to only expose EXT_framebuffer_multisample when we truly support multisampling; that frees us to set a sensible value of GL_MAX_SAMPLES=0 on other chipsets, so that we never have to deal with a client requesting a multisample buffer when multisampling isn't supported. This change causes the following piglit tests to be skipped on chipsets prior to Gen6: - "ARB_framebuffer_sRGB/blit {renderbuffer,texture} {linear,linear_to_srgb,srgb,srgb_to_linear} {downsample,msaa,upsample} {disabled,enabled}" - EXT_framebuffer_multisample/blit-mismatched-formats - EXT_framebuffer_multisample/blit-mismatched-sizes - EXT_framebuffer_multisample/dlist - EXT_framebuffer_multisample/interpolation 0 * - EXT_framebuffer_multisample/minmax - EXT_framebuffer_multisample/negative-copypixels - EXT_framebuffer_multisample/negative-copyteximage - EXT_framebuffer_multisample/negative-max-samples - EXT_framebuffer_multisample/negative-mismatched-samples - EXT_framebuffer_multisample/negative-readpixels - EXT_framebuffer_multisample/renderbuffer-samples - EXT_framebuffer_multisample/renderbufferstorage-samples - EXT_framebuffer_multisample/samples This is expected, since the above tests exercise MSAA functionality, and shouldn't be run on systems prior to Gen6. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Don't check (offset + size <= bufObj->Size) in BindBufferRange.Paul Berry2013-02-071-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the documentation for BindBufferRange, OpenGL specs from 3.0 through 4.1 contain this language: "The error INVALID_VALUE is generated if size is less than or equal to zero or if offset + size is greater than the value of BUFFER_SIZE." This text was dropped from OpenGL 4.2, and it does not appear in the GLES 3.0 spec. Presumably the reason for the change is because come clients change the size of the buffer after calling BindBufferRange. We don't want to generate an error at the time of the BindBufferRange call just because the old size of the buffer was too small, when the buffer is about to be resized. Since this is a deliberate relaxation of error conditions in order to allow clients to work, it seems sensible to apply it to all versions of GL, not just GL 4.2 and above. (Note that there is no danger of this change allowing a client to access data beyond the end of a buffer. We already have code to ensure that that doesn't happen in the case where the client shrinks the buffer after calling BindBufferRange). Eliminates a spurious error message in the gles3 conformance test "transform_feedback_offset_size". Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Set UniformBufferOffsetAlignment to sizeof(vec4)Ian Romanick2013-02-071-0/+1
| | | | | | | | | | | This matches the behavior of the Windows driver, but a bspec reference should would be nice. NOTE: This is a candidate for the 9.0 and 9.1 branches. Signed-off-by: Ian Romanick <[email protected] Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Allow glGet* queries of MAX_VARYING_COMPONENTS in ES 3Matt Turner2013-02-071-3/+1
| | | | | | | | | Should have been done in d9948e49 but I missed it because MAX_VARYING_FLOATS doesn't appear in the ES 3 spec, but is the same value as MAX_VARYING_COMPONENTS. NOTE: Candidate for the 9.1 branch Reviewed-by: Ian Romanick <[email protected]>
* 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]>