Commit Graph

48 Commits

Author SHA1 Message Date
Brian Paul
3e34a2a2b9 drivers: don't include texformat.h
And remove other unneeded #includes while we're at it.
2009-10-05 18:11:37 -06:00
Brian Paul
1f7c914ad0 mesa: replace gl_texture_format with gl_format
Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum.
ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x.
gl_texture_format will go away next.
2009-09-30 20:28:45 -06:00
Brian Paul
ddffe4546a drivers: use more mesa format functions 2009-09-27 20:40:35 -06:00
Brian Paul
4de8e2123e mesa: rename functions to be more consistant with rest of mesa 2009-09-19 17:06:15 -06:00
Brian Paul
8cb389ce35 intel: use new _mesa_meta_blit_framebuffer() function
The previous version of framebuffer blit was a quick hack.  The new meta
version works pretty well.
2009-08-10 13:55:32 -06:00
Jakob Bornecrantz
862488075c Merge branch 'mesa_7_5_branch'
Conflicts:
	src/mesa/main/dlist.c
	src/mesa/vbo/vbo_save_api.c
2009-07-03 18:53:58 +02:00
Michel Dänzer
94e1117c9b intel: Also update stencil bits in intel_update_wrapper().
Fixes assertion failure when binding depth/stencil texture to FBO stencil
attachment.
2009-07-03 17:54:34 +02:00
Eric Anholt
1ba96651e1 intel: Add support for tiled textures.
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-04 14:00:43 +00:00
Eric Anholt
e78a6aa2b9 intel: Fall back on any rendering to texture with no miptree.
Fixes segfault on an fbo.c negative test for FBO with texture width/height
of 0.  Previously we just tested for border != 0 to work around this
segfault.
2009-05-21 10:40:11 -07:00
Eric Anholt
8bba183b9e intel: Mark the FBO as incomplete if there's no intel_renderbuffer for it.
This happens to rendering with textures with a border, which had resulted
in a segfault on dereferencing the irb.
2009-05-21 10:40:11 -07:00
Eric Anholt
2c30fd84df intel: Add support for argb1555, argb4444 FBOs and fix rgb565 fbo readpixels.
Also enable them all regardless of screen bpp, as 32 bpp what I've been
testing against, and haven't been able to detect any screen bpp-specific
troubles with them.
2009-04-16 12:04:30 -07:00
Brian Paul
ee41bb2ed0 i965: fix screen depth test in intel_validate_framebuffer)_
front_region may be null.
2009-03-05 17:25:25 -07:00
Brian Paul
4f8ed56d16 intel: no-op the intel_finish_render_texture() function
It doesn't have to do anything.  See comments for more details.
2009-02-26 18:48:36 -07:00
Brian Paul
f77b720cde intel: check texture formats in intel_validate_framebuffer()
We can't render into any texture format; only certain formats.
Check that render-to-texture's format is renderable in the
intel_validate_framebuffer()

There seems to be a bug somewhere that causes rendering to rgb565 textures
to be corrupted so disallow that for now.  This will be revisted.
2009-02-26 18:48:36 -07:00
Eric Anholt
119f34e2a5 intel: Fix up x8r8g8b8 renderbuffer format so that alpha=1 spans code happens.
I was lured into a false sense of security by the fact that the spans code was
already there, and a bunch of tests didn't catch the problem.  oglconform's
mask.c did, though.

Bug #19970.
2009-02-25 23:01:57 -08:00
Eric Anholt
40dd024be6 intel: tell libdrm whether we want a cpu-ready or gpu-ready BO for regions.
This lets us avoid allocing new buffers for renderbuffers, finalized miptrees,
and PBO-uploaded textures when there's an unreferenced but still active one
cached, while also avoiding CPU waits for batchbuffers and CPU-uploaded
textures.  The size of BOs allocated for a desktop running current GL
cairogears on i915 is cut in half with this.

Note that this means we require libdrm 2.4.5.
2009-02-21 10:53:41 -08:00
Brian Paul
bd944ef783 intel: remove unused RenderToTexture field 2009-01-30 16:03:32 -07:00
Brian Paul
d332a74e77 intel: remove unused #includes 2009-01-29 15:06:55 -07:00
Brian Paul
5c38801f8e intel: formatting clean-ups 2009-01-29 14:57:31 -07:00
Eric Anholt
65d39a9eed intel: clean up more pf mess. 2009-01-27 12:05:47 -08:00
Brian Paul
6d2e1f6a2c intel: add GL_EXT_framebuffer blit extension
This functionality is required by GL_ARB_framebuffer_object.
For now, implement it in terms of glCopyPixels().  This will need to be
revisted though.
2009-01-22 15:43:40 -07:00
Brian Paul
f8a7e497ac intel: remove/disable the "paired depth/stencil" code
We only allow combined depth+stencil renderbuffers so the complicated code
for splitting and combining separate depth and stencil buffers is no longer
needed.
2009-01-22 15:34:16 -07:00
Brian Paul
3abf67c6b1 intel: remove unneeded call to ctx->Driver.DepthRange()
The preceeding call to intel_draw_buffer() does that.
2009-01-22 15:32:52 -07:00
Brian Paul
71b78149bd i965: disallow separate depth/stencil renderbuffers
Take advantage of the GL_FRAMEBUFFER_UNSUPPORTED feature to disallow separate
depth and stencil renderbuffers; only allow combined depth/stencil buffers.

Next up: remove/simplify a bunch of the depth/stencil renderbuffer code.

Also: restore the previously disabled GL_DEPTH_COMPONENT16 case
2009-01-22 15:32:38 -07:00
Brian Paul
3c98d3cf32 intel: plug in stub intel_validate_framebuffer() function 2009-01-22 15:31:20 -07:00
Brian Paul
f8b00806d8 intel: inline some renderbuffer functions 2009-01-22 15:30:57 -07:00
Owain G. Ainsworth
b5da7feee0 Remove intel pageflipping support in its entirety.
It's been broken and deprecated for a while, so it's time to die. This has the
wonderful benefit of cleaning up the code a fair amount; making it marginally
less twisty.

I'm unsure if the for loops in IntelWindowMoved are still needed.
2009-01-20 11:52:32 -05:00
Brian Paul
947d1c5b2a i965: asst. fixes, work-arounds for FBOs and render to texture
OpenGL allows mixing and matching depth and stencil renderbuffers in
framebuffer objects while the hardware really only supports interleaved
depth/stencil buffers.  This makes for some tricky buffer management.

An extra wrinkle is the situation where the user allocates a 16bpp depth
texture or renderbuffer then tries to render to it along with a stencil
buffer.  We'd have to promote the 16bpp Z values to 24-bit Z values and
mix in the stencil values to setup the depth/stencil renderbuffer.

There's no support for that now, so always allocate 32bpp depth textures/
renderbuffers for now.
2009-01-14 16:49:24 -07:00
Brian Paul
c7f43543af i965: fix incorrect renderbuffer DataType assignment 2009-01-14 16:49:24 -07:00
Eric Anholt
8b661a5d33 intel: Fall back on rendering to a texture attachment with a border.
Fixes a segfault in oglconform fbo.c test.
2008-12-06 22:41:52 -08:00
Eric Anholt
c5945c2d17 intel: Fix clears to depth_stencil texture attachments.
Broken by 0adfd10210, showed up as an assertion
failure in a software fallback in the shadowtex demo when we failed to
recognize the texture format.
2008-09-24 15:13:19 -07:00
Brian Paul
ecadb51bbc mesa: added "main/" prefix to includes, remove some -I paths from Makefile.template 2008-09-18 15:17:05 -06:00
Eric Anholt
8db761409d intel: Add a width field to regions, and use it for making miptrees in TFP.
Otherwise, we would use the pitch as width of the texture, and compiz would
render the pitch padding on the right hand side.
2008-09-12 15:48:13 -07:00
Dave Airlie
f75843a517 Revert "Revert "Merge branch 'drm-gem'""
This reverts commit 7c81124d7c.
2008-08-24 17:59:10 +10:00
Dave Airlie
7c81124d7c Revert "Merge branch 'drm-gem'"
This reverts commit 53675e5c05.

Conflicts:

	src/mesa/drivers/dri/i965/brw_wm_surface_state.c
2008-08-24 17:52:40 +10:00
Eric Anholt
902e401a38 intel: Don't return a renderbuffer with alpha when just GL_RGB is requested.
Fixes oglconform rbGetterFuncs testcase.  The span code for this mode hasn't
actually been tested.
2008-07-26 17:39:23 -07:00
Eric Anholt
2e37143800 intel: Add a little span cache to spead up readpixels by cutting syscalls. 2008-07-23 10:21:25 -07:00
Eric Anholt
d2d5abfaeb intel-gem: Use pread/pwrite for span access.
This will avoid clflushing entire buffers for small acesses, such as those
commonly used by regression tests.
2008-07-23 10:21:25 -07:00
Eric Anholt
2e841880cf drm-gem: Use new GEM ioctls for tiling state, and support new swizzle modes. 2008-07-11 18:58:19 -07:00
Eric Anholt
19f585a3cf intel-gem: Fix Y-tiling span setup.
The boolean that the server gives us for whether the region is tiled was
getting used as the enum for what tiling mode.  Instead, guess the correct
tiling in screen setup.

Also, fix the Y-tiling pitch setup.  The pitch to the next tile in Y is
32 scanlines, not 8.
2008-07-02 09:10:21 -07:00
Keith Packard
537bbe6dec [intel-GEM] Add tiling support to swrast.
Accessing tiled surfaces without using the fence registers requires that
software deal with the address swizzling itself.
2008-05-06 10:51:08 -07:00
Xiang, Haihao
f94d317d7a intel: fix abort issue with shadowtex demo when use
DEPTH_STENCIL texture. (bug#14952).
2008-03-14 11:50:11 +08:00
Eric Anholt
c741d287ec [intel] Allow attIndex to be negative to avoid defeating the >= 0 check.
Otherwise, we would go wildly out of bounds if passed -1 (no renderbuffer), such
as while doing LOCK_HARDWARE with glDrawBuffer(GL_NONE).
2008-02-15 13:48:11 -08:00
Kristian Høgsberg
e131c46b20 [intel] Simplify intelCreateBuffer() a bit.
Drop a bunch of unused arguments from intel_create_renderbuffer() and
introduce intel_renderbuffer_set_region() to set the region for
a renderbuffer.
2008-01-09 20:43:18 -05:00
Brian
601a6b872c Replace gl_framebuffer's _ColorDrawBufferMask with _ColorDrawBufferIndexes
Each array element is now a BUFFER_x token rather than a BUFFER_BIT_x bitmask.
The number of active color buffers is specified by _NumColorDrawBuffers.
This builds on the previous DrawBuffer changes and will help with drivers
implementing GL_ARB_draw_buffers.
2008-01-06 18:07:26 -07:00
Eric Anholt
bea6b5fe5a [965] Enable EXT_framebuffer_object.
To do so, merge the remainnig necessary code from the buffers, blit, span, and
screen code to shared, and replace it with those.
2007-12-20 11:32:55 -08:00
Eric Anholt
7c71ef3a3d [intel] Move bufmgr back to context instead of screen, fixing glthreads.
Putting the bufmgr in the screen is not thread-safe since the emit_reloc
changes.  It also led to a significant performance hit from pthread usage
for the attempted thread-safety (up to 12% of a cpu spent on refcounting
protection in single-threaded 965).  The motivation had been to allow
multi-context bufmgr sharing in classic mode, but it wasn't worth the cost.
2007-12-12 11:52:10 -08:00
Eric Anholt
77a5bcaff4 [intel] Move over files that will be shared with 965-fbo work. 2007-11-09 14:27:33 -08:00