summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex_copy.c
AgeCommit message (Collapse)Author
2011-03-01intel: Support glCopyTexImage() from ARGB8888 to XRGB8888.Kenneth Graunke
Nexuiz was hitting a software fallback.
2011-02-24intel: Try using glCopyTexSubImage2D in _mesa_meta_BlitFramebufferNeil Roberts
In the case where glBlitFramebuffer is being used to copy to a texture without scaling it is faster if we can use the hardware to do a blit rather than having to do a texture render. In most of the drivers glCopyTexSubImage2D will use a blit so this patch makes it check for when glBlitFramebuffer is doing a simple copy and then divert to glCopyTexSubImage2D. This was originally proposed as an extension to the common meta-ops. However, it was rejected as using the BLT is only advantageous for Intel hardware. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=33934 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-23intel: Remove unnecessary headers.Vinson Lee
2010-12-16intel: Support glCopyTexImage() from XRGB8888 to ARGB8888.Eric Anholt
The only mismatch between the two is that we have to clear the destination's alpha to 1.0. Fixes WOW performance on my Ironlake, from a few frames a second to almost playable.
2010-12-16intel: Try to sanely check that formats match for CopyTexImage.Eric Anholt
Before, we were going off of a couple of known (hopeful) matches between internalFormats and the cpp of the read buffer. Instead, we can now just look at the gl_format of the two to see if they match. We should avoid bad blits that might have been possible before, but also allow different internalFormats to work without having to enumerate each one.
2010-12-16intel: Drop commented intel_flush from copy_teximage.Eric Anholt
The blit that follows appears in the command stream so it's serialized with previous rendering. Any queued vertices in the tnl layer were already flushed up in mesa/main/.
2010-12-16intel: Update renderbuffers before looking up CopyTexImage's read buffer.Eric Anholt
Not fixing a particular bug, just noticed by code inspection.
2010-11-20intel: Remove unnecessary header.Vinson Lee
2010-11-03intel: Annotate debug printout checks with unlikely().Eric Anholt
This provides the optimizer with hints about code hotness, which we're quite certain about for debug printouts (or, rather, while we developers often hit the checks for debug printouts, we don't care about performance while doing so).
2010-10-13Drop GLcontext typedef and use struct gl_context insteadKristian Høgsberg
2010-10-12intel: Allow CopyTexSubImage to InternalFormat 3/4 textures, like RGB/RGBA.Eric Anholt
The format selection of the CopyTexSubImage is pretty bogus still, but this at least avoids software fallbacks in nexuiz, bringing performance from 7.5fps to 12.8fps on my machine.
2010-08-05intel: Check for a NULL src buffer prior to bltChris Wilson
This can only happen along a malloc failure path, but check anyway. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-06-08intel: Update comment in intel_tex_copy from before miptree x/y rework.Eric Anholt
2010-06-01intel: Fallback to meta if we're asked to CopyTexImage2D from RGB to RGBAKristian Høgsberg
The pixel transfer rules state that we must set alpha to 1.0 in this case which we can't easily do with the blitter. We can do to passes: one that sets the alpha to 0xff and one that copies the RGB bits or we can just use the 3D engine. Neither approach seems worth it for this case.
2010-05-10intel: Drop intelFlush()Kristian Høgsberg
Now that intel_flush() deosn't use the needs_mi_flush argument, we can finally drop one of the two flush functions.
2010-03-30intel: Use fb->Height when flipping read buffer orientationKristian Høgsberg
With DRI2, x and y are always zero and fb->Height is always up to date with the drawable height.
2010-03-17intel: Replace mt->pitch with mt->region->pitch.Eric Anholt
The pitch is not really an inherent part of the miptree, since it's not part of any of the layout calculations, and it's dictated by the libdrm-allocated region pitch now.
2010-02-17intel: Implement the DRI2 invalidate function properlyKristian Høgsberg
This uses a stamp mechanisms to mark the DRI drawable as invalid. Instead of immediately updating the buffers we just bump the drawable stamp and call out to DRI2GetBuffers "later". "Later" used to be at LOCK_HARDWARE time, and this patch brings back callouts at the points where we used to call LOCK_HARDWARE. A new function, intel_prepare_render(), is called where we used to call LOCK_HARDWARE, and if the buffers are invalid, we call out to DRI2GetBuffers there. This lets us invalidate buffers only when notified instead of on every glViewport() call. If the loader calls the DRI invalidate entrypoint, we disable viewport triggered buffer invalidation. Additionally, we can clean up the old viewport mechanism a bit, since we can just invalidate the buffers and not worry about reentrancy and whatnot.
2010-01-26intel: Remove dead code from having to clip copyteximage source rect.Eric Anholt
mesa core does it now. If only it did so for other entrypoints.
2010-01-25Merge branch 'mesa_7_7_branch'Brian Paul
Conflicts: src/mesa/drivers/dri/intel/intel_screen.c src/mesa/drivers/dri/intel/intel_swapbuffers.c src/mesa/drivers/dri/r300/r300_emit.c src/mesa/drivers/dri/r300/r300_ioctl.c src/mesa/drivers/dri/r300/r300_tex.c src/mesa/drivers/dri/r300/r300_texstate.c
2010-01-23intel: Remove unnecessary headers.Vinson Lee
2010-01-05Merge branch 'remove-intel-dri1'Kristian Høgsberg
* remove-intel-dri1: intel: intelScreenContext() is no longer used intel: Remove remaining dri2.enabled tests intel: Drop more cliprect bookkeeping intel: Remove struct intel_framebuffer intel: Remove client-side vblank code intel: Drop intelWindowMoved() intel: Drop batchbuffer cliprect_mode tracking intel: Drop DRI1 static regions intel: Use depth buffer from ctx.DrawBuffer in copypix_src_region() intel: Drop LOCK/UNLOCK_HARDWARE() intel: Drop DRI1 SwapBuffer implementation intel: Drop DRI1 CopySubBuffer implementation intel: Drop DRI1 support Push __driDriverExtensions out of dri_util.c and into the drivers Remove leftover __DRI{screen,drawable,context}Private references Check for libdrm_$chipset.pc when needed
2010-01-04intel: Fix CopyTexImage from tiled mipmap levels > 0.Eric Anholt
Fixes piglit fbo-copyteximage.
2010-01-04intel: Drop LOCK/UNLOCK_HARDWARE()Kristian Høgsberg
2010-01-04Remove leftover __DRI{screen,drawable,context}Private referencesKristian Høgsberg
As part of the DRI driver interface rewrite I merged __DRIscreenPrivate and __DRIscreen, and likewise for __DRIdrawablePrivate and __DRIcontextPrivate. I left typedefs in place though, to avoid renaming all the *Private use internal to the driver. That was probably a mistake, and it turns out a one-line find+sed combo can do the mass rename. Better late than never.
2009-12-28intel: Silence compiler warnings.Vinson Lee
2009-11-21intel: make CopyTex[Sub]Image fallback debug messages more consistentRoland Scheidegger
2009-11-13i965: Remove an unused cache_item field.Eric Anholt
2009-10-27intel: minor clean-up, commentsBrian Paul
2009-10-27intel: use _mesa_get_current_tex_unit() helperBrian Paul
2009-10-27intel: fix src offset bug in do_copy_texsubimage()Brian Paul
Use src->draw_offset intead of zero. Zero usually worked, except when the src renderbuffer is actually a texture mipmap level higher than zero. Fixes progs/test/blitfb.c test.
2009-10-23Merge remote branch 'origin/mesa_7_6_branch'Eric Anholt
Conflicts: src/mesa/drivers/dri/intel/intel_fbo.c src/mesa/drivers/dri/intel/intel_mipmap_tree.c src/mesa/drivers/dri/intel/intel_mipmap_tree.h src/mesa/drivers/dri/intel/intel_tex_copy.c src/mesa/drivers/dri/intel/intel_tex_image.c
2009-10-23intel: Keep track of x,y offsets in miptrees and use them for blitting.Eric Anholt
By just using offsets, we confused the hardware's tiling calculations, resulting in failures in miptree validation and blit clears. Fixes piglit fbo-clearmipmap. Bug #23552. (automatic mipmap generation)
2009-10-12intel: pass zslice to intel_miptree_image_offset()Brian Paul
This lets us get rid of intel_miptree_depth_offsets() and simplify all of the calling code.
2009-10-05Merge branch 'mesa_7_6_branch'Brian Paul
Conflicts: src/gallium/auxiliary/util/u_cpu_detect.c
2009-10-05intel: use driReadDrawable in do_copy_texsubimage()Brian Paul
2009-09-28Merge branch 'mesa_7_6_branch'Brian Paul
2009-09-25intel: Handle GL_RGB8 for glCopyTex(Sub)Image.Michel Dänzer
Avoids an unnecessary fallback.
2009-09-19intel: use new _mesa_meta_CopyTex[Sub]Image() functionsBrian Paul
2009-09-15mesa: move generate mipmap callsBrian Paul
Per the suggestion in the Intel driver, move the calls to ctx->Driver.GenerateMipmap() into core Mesa so that drivers don't have to worry about it.
2009-07-13intel: Partially fix fallback detection for glCopyTexSubImage.Eric Anholt
Really, we should be checking that the MesaTexFormat for the read buffer and the texture match, but the previous code wasn't even doing that, so matching the cpp should be an improvement (and potentially fix some hangs!). The previous code also rejected GL_RGB even though blitting the alpha channel to the ignored channel of an x8r8g8b8 texture should be fine, which tripped up compiz's blur plugin.
2009-06-23intel: Avoid trying to do blits to Y tiled regions.Eric Anholt
This is somewhat nasty, but we need to do Y-tiled depth for FBO support. May help with corruption and hangs since enabling texture tiling, and since switching depth textures to Y tiled. Fixes piglit depthtex.c on 965.
2009-06-23intel: Fix some potential writes to zero-copy PBOs when used as regions.Eric Anholt
I was in the midst of fixing some blitting-with-Y-tiled issues when I noticed this. Hopefully PBO usage will be a little more robust, as a result.
2009-06-09intel: make a bunch of glTexImage-related functions staticBrian Paul
2009-06-09intel: whitespace clean-upsBrian Paul
2009-06-04intel: Add support for tiled textures.Eric Anholt
This is about a 30% performance win in OA with high settings on my GM45, and experiments with 915GM indicate that it'll be around a 20% win there. Currently, 915-class hardware is seriously hurt by the fact that we use fence regs to control the tiling even for 3D instructions that could live without them, so we spend a bunch of time waiting on previous rendering in order to pull fences off. Thus, the texture_tiling driconf option defaults off there for now.
2009-06-02intel: Clip to window after calling Driver.TexImage2DIan Romanick
This prevents the width / height from being clipped to the window size before the texture is allocated. This matches intelCopyTexImage1D. This should fix bug #21227 Signed-off-by: Ian Romanick <ian.romanick@intel.com>
2009-05-08intel: Add a metaops version of glGenerateMipmapEXT/SGIS_generate_mipmaps.Eric Anholt
In addition to being HW accelerated, it avoids the incorrect (black) rendering of the mipmaps that SW was doing in fbo-generatemipmap. Improves the performance of the mipmap generation and drawing in fbo-generatemipmap by 30%.
2008-12-18intel: Move copyteximage source clipping out of copytexsubimage.Eric Anholt
glCopyTexSubImage already gets the (correct) clipping for us, so it doesn't need the path. While moving the clipping out, replace the code with the mesa path to do the same job.
2008-12-06intel: Fix crash in automatic mipmap generation for glCopyTex{Sub,}Image.Eric Anholt
The images aren't mapped at this point, so we want the generic Mesa path for GenerateMipmapEXT that does the mapping/unmapping for us. Ideally Mesa would just call it for us.