Commit Graph

110 Commits

Author SHA1 Message Date
Chad Versace
1a1411e09b intel: Allocate region for separate stencil buffer
... in intel_alloc_renderbuffer_storage().  The stencil buffer has quirky
pitch requirements, so its region allocation is a special case.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-05-25 07:41:32 -07:00
Eric Anholt
cd3568c329 intel: Use _mesa_base_tex_format for FBO texture attachments.
The _mesa_base_fbo_format variant doesn't handle some texture
internalformats, such as "3".

Fixes:
fbo-blending-formats.
fbo-alphatest-formats
EXT_texture_sRGB/fbo-alphatest-formats

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-04-18 11:19:53 -07:00
Neil Roberts
c0ad70ae31 intel: Try using glCopyTexSubImage2D in _mesa_meta_BlitFramebuffer
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>
2011-02-24 16:43:39 +00:00
Chris Wilson
8d68a90e22 intel: use pwrite for batch
It's faster. Not only is the memcpy more efficiently performed in the
kernel (making up for the system call overhead), but by not using mmap
we remove the greater overhead of tracking the vma of every batch.

And it means we can read back from the batch buffer without incurring
the cost of a uncached read through the GTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-02-21 12:59:35 +00:00
Eric Anholt
d53c8380bf i915: Fix compiler warning from sw fallback removal change. 2011-01-14 13:57:14 -08:00
Eric Anholt
c0cdae0368 i965: Use a new miptree to avoid software fallbacks due to drawing offset.
When attaching a small mipmap level to an FBO, the original gen4
didn't have the bits to support rendering to it.  Instead of falling
back, just blit it to a new little miptree just for it, and let it get
revalidated into the stack later just like any other new teximage.

Bug #30365.
2011-01-10 17:21:54 -08:00
Vinson Lee
45a56e4730 intel: Include mfeatures.h in files that perform feature tests. 2011-01-09 01:25:54 -08:00
Eric Anholt
29c4f95cbc intel: Make renderbuffer tiling choice match texture tiling choice.
There really shouldn't be any difference between the two for us.
Fixes a bug where Z16 renderbuffers would be untiled on gen6, likely
leading to hangs.
2011-01-07 18:25:54 -08:00
Eric Anholt
8f593597fc intel: Use the _BaseFormat from MESA_FORMAT_* in renderbuffer setup. 2011-01-07 18:25:54 -08:00
Eric Anholt
a7bf723056 intel: Add a vtbl hook for determining if a format is renderable.
By relying on just intel_span_supports_format, some formats that
aren't supported pre-gen4 were not reporting FBO incomplete.  And we
also complained in stderr when it happened on i915 because draw_region
gets called before framebuffer completeness validation.
2011-01-07 17:49:03 -08:00
Eric Anholt
5dbb856e96 intel: Merge our choosetexformat fallbacks into core.
We now share the type/format -> MESA_FORMAT_* mappings with software
mesa, and the core supports most of the fallbacks hardware drivers
will want.
2011-01-04 14:42:54 -08:00
Eric Anholt
b7b2791c6b intel: When validating an FBO's combined depth/stencil, use the given FBO.
We were looking at the current draw buffer instead to see whether the
depth/stencil combination matched.  So you'd get told your framebuffer
was complete, until you bound it and went to draw and we decided that
it was incomplete.
2011-01-04 10:04:19 -08:00
Eric Anholt
0ea49380e2 intel: Fix segfaults from trying to use _ColorDrawBuffers in FBO validation.
The _ColorDrawBuffers is a piece of computed state that gets for the
current draw/read buffers at _mesa_update_state time.  However, this
function actually gets used for non-current draw/read buffers when
checking if an FBO is complete from the driver's perspective.  So,
instead of trying to just look at the attachment points that are
currently referenced by glDrawBuffers, look at all attachment points
to see if they're driver-supported formats.  This appears to actually
be more in line with the intent of the spec, too.

Fixes a segfault in my upcoming fbo-clear-formats piglit test, and
hopefully bug #30278
2011-01-04 10:04:15 -08:00
Chris Wilson
8b9570e685 intel: Check for unsupported texture when finishing using as a render target
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=32541
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2010-12-21 11:58:35 +00:00
Eric Anholt
be72efb4f2 intel: Just use ChooseTextureFormat for renderbuffer format choice.
One less place to forget to put your new MESA_FORMAT support in.
2010-12-10 16:16:13 -08:00
Eric Anholt
e339b669a1 intel: Add a couple of helper functions to reduce rb code duplication. 2010-12-10 15:37:16 -08:00
Ian Romanick
78a340fd48 i915: Disallow alpha, red, RG, and sRGB as render targets
Fixes bugzilla #31832

NOTE: This is a candidate for the 7.9 branch.
2010-11-23 18:42:04 -08:00
Kristian Høgsberg
f9995b3075 Drop GLcontext typedef and use struct gl_context instead 2010-10-13 09:43:25 -04:00
Ian Romanick
c77cd9ec10 i965: Enable GL_ARB_texture_rg 2010-10-01 15:49:13 -07:00
Zhenyu Wang
72b368ae69 i965: always set tiling for fbo depth buffer on sandybridge
Sandybridge requires depth buffer must be tiling.

Fix 'fbo_firecube' demo.
2010-09-30 10:51:26 +08:00
Eric Anholt
934fde4f5a intel: Fix segfault on INTEL_DEBUG=fbo with unsupported framebuffers. 2010-09-24 18:03:28 -07:00
Eric Anholt
1946b81e70 i965: Add support for rendering to SARGB8 FBOs.
Tested with fbo-generatemipmap-formats GL_EXT_texture_srgb.  The test
still fails on SLA8, though.
2010-09-24 16:12:50 -07:00
Eric Anholt
836803df79 intel: Corresponding FinishRenderTexture debug to BeginRenderTexture. 2010-09-24 16:12:50 -07:00
Kristian Høgsberg
17eace581d dri: Pass the __DRIscreen and the __DRIscreen private back to image lookup
We will typically have a current context when we need to lookup the image,
but the lookup implementation don't need it so drop it.
2010-09-22 22:02:05 -04:00
Nick Bowler
bda941e1b8 intel: Merge identical cases in switch statement.
Signed-off-by: Nick Bowler <nbowler@draconx.ca>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-08-26 08:19:35 -06:00
Kristian Høgsberg
9087ba1280 intel: Take an intel_screen pointer in intel_alloc_region_* functions 2010-08-25 09:17:48 -04:00
Vinson Lee
84178547df intel: Remove unnecessary headers. 2010-06-16 17:44:26 -07:00
Eric Anholt
178414eba4 i965: Remove caching of surface state objects.
It turns out that computing a 56 byte key to look up a 20-byte object
out of a hash table was some sort of a bad idea.  Whoops.

before:
[ # ]  backend                         test   min(s) median(s) stddev. count
[  0]       gl            firefox-talos-gfx   37.799   38.203   0.39%    6/6
after:
[  0]       gl            firefox-talos-gfx   34.761   34.784   0.17%    5/6
2010-06-11 00:15:59 -07:00
Eric Anholt
6383428588 i965: Add support for GL_ALPHA framebuffer objects. 2010-06-10 00:40:00 -07:00
Kristian Høgsberg
c4775a27e3 intel: Drop intelFlush()
Now that intel_flush() deosn't use the needs_mi_flush argument, we can
finally drop one of the two flush functions.
2010-05-10 17:48:11 -04:00
Eric Anholt
ce914fff08 i965: When an RB gets a new region, clear the old from the state cache.
This prevents memory usage explosion in blender due to the state cache
hanging on to old fake frontbuffer regions.  Sigh at blender still
using frontbuffer rendering.

Bug #24119.
2010-05-04 22:06:12 -07:00
Eric Anholt
362c1bf75e intel: Replace mt->pitch with mt->region->pitch.
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-03-17 11:24:01 -07:00
Eric Anholt
da011faf48 intel: Rely on allocated region pitch for the miptree pitch.
Bug #26966: 945 miptree pitch disagreement with libdrm.
2010-03-17 11:23:43 -07:00
Eric Anholt
bb35000b4b intel: Remove non-kernel-exec-fencing support.
Shaves 60k off the driver from removing the broken spans code.  This
means we now require 2.6.29, which seems fair given that it's a year
old and we've removed support for non-KMS already in the last release
of 2D.
2010-03-04 16:56:32 -08:00
Kristian Høgsberg
af3f1bb269 intel: Set InternalFormat for renderbuffers created from an EGLImage 2010-03-03 10:47:49 -05:00
Kristian Høgsberg
10e7962741 intel: Implement GL_OES_EGL_image entrypoints 2010-02-24 14:28:42 -05:00
Vinson Lee
b76164dced intel: Silence compiler format warnings. 2010-02-20 01:58:27 -08:00
Kristian Høgsberg
32f2fd1c5d Replace _mesa_malloc, _mesa_calloc and _mesa_free with plain libc versions 2010-02-19 12:03:01 -05:00
Kristian Høgsberg
d282128ff6 intel: Remove struct intel_framebuffer
With the vsync fields no longer relevant and by refactoring the code
to no longer use color_rb[0-1] we can just use struct gl_framebuffer
directly.
2010-01-04 11:48:02 -05:00
Eric Anholt
a099644755 intel: Fix false positives in checking for non-packed depth/stencil RB.
The wine d3d9 visual.c testcase was tripping over this and failing.
Presumably it's binding a packed depth/stencil texture to both
stencil and depth attachment points, and we make a new renderbuffer
wrapper for each in that case.
2009-12-28 19:21:27 -08:00
Eric Anholt
089144e4e5 intel: Allow binding a stencil but not a depth buffer.
Wine's d3d9 visual.c testcase tries this a lot, so I've added some
piglit tests (fbo-nodepth-test, fbo-nostencil-test, fbo-stencil-only)
and enabled it.
2009-12-28 18:52:47 -08:00
Eric Anholt
e4df8d32b5 intel: Improve INTEL_DEBUG=fbo output. 2009-12-28 18:51:18 -08:00
Eric Anholt
5727147f89 intel: Remove unused stored values reported by clang. 2009-12-22 14:20:26 -08:00
Ian Romanick
cbdeb33209 intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. 2009-12-10 15:12:30 -08:00
Ian Romanick
430876cd3a intel: name in intel_create_renderbuffer was always 0, remove 2009-12-10 15:12:30 -08:00
Ian Romanick
0f01674a58 intel: Use texformat accessor to get bytes-per-pixel 2009-12-10 15:12:30 -08:00
Ian Romanick
4eee46efcb intel: softwareBuffer in intel_alloc_renderbuffer_storage was always false, remove 2009-12-10 15:12:30 -08:00
Ian Romanick
3078bd136d intel: Axe intel_renderbuffer::texformat
Since the texformat branch merge, the value of intel_renderbuffer::texformat
is just a copy of gl_renderbuffer::Format.
2009-12-10 15:12:30 -08:00
Eric Anholt
539a14a1dd intel: Flush the render/texture cache when finishing render to texture.
Back when we were flushing the entire batch at BindFramebuffer, the kernel
would notice the domain transition when someone went to texture from it and
flush for us.  We no longer do the batch flushing every time, so we get to
do aggressive flushing until we move batchbuffer handling to libdrm.

Fixes piglit fbo-flushing.  Bug #25377.  No noticeable performance loss
on cairo-gl (so this is better than batch flushing).
2009-12-10 14:47:09 -08:00
Ian Romanick
bb64c9bcdf Revert "intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers."
This reverts commit 4598942b1b.

XRGB8888 doesn't work as intended.  Revert this for now, and we'll revisit it
for 7.8 or something.
2009-12-07 17:06:07 -08:00