Commit Graph

44719 Commits

Author SHA1 Message Date
Brian Paul 42e7a13e7b Revert "Fix 24bpp software rendering"
This reverts commit c0c0bb6cb1.
2011-06-25 06:17:01 -06:00
Chia-I Wu 8ea5330200 egl: fix EGL_MATCH_NATIVE_PIXMAP
EGL_MATCH_NATIVE_PIXMAP is valid for eglChooseConfig, but invalid for
eglGetConfigAttrib.
2011-06-25 18:51:11 +09:00
Chia-I Wu a0ad339915 st/egl: add get_pixmap_format callback to native_display
And use it for EGL_MATCH_NATIVE_PIXMAP.  Remove is_pixmap_supported
meanwhile.
2011-06-25 18:50:53 +09:00
Chia-I Wu 31520548b7 egl: make implementing eglChooseConfig easier
Add a new helper function, _eglFilterConfigArray, for drivers and hide
_eglSortConfigs.
2011-06-25 18:17:38 +09:00
Chia-I Wu 1e9f0b1736 targets/egl-static: do not use DRI_LIB_DEPS
It brings in libraries that are not necessarily needed.
2011-06-25 18:17:38 +09:00
Chia-I Wu 53d354b224 st/egl: add a fast path for ximage eglCopyBuffers 2011-06-25 16:23:21 +09:00
Chia-I Wu 7c4e9dcdce st/egl: clean up eglCopyBuffers
Add copy_to_pixmap method to native_display and use it for
eglCopyBuffers.
2011-06-25 16:23:21 +09:00
Chia-I Wu 73df31eedd st/egl: reorganize backend initialization
Remove set_event_handler() and pass the event handler with
native_get_XXX_platform().  Add init_screen() so that the pipe screen is
created later.  This way we don't need to pass user_data to
create_display().
2011-06-25 16:23:20 +09:00
Stéphane Marchesin ac8f59b23e i915g: always upload the vs constants.
This fixes a crash in llvm draw.
2011-06-24 19:59:17 -07:00
Eric Anholt 773556e0f5 i965/gen5: Fix grf_used calculation for 16-wide.
If we happened to allocate a texture result (or other vector) to the
highest hardware register slot, and we were in 16-wide, we would
under-count the registers used and potentially wrap around to g0 if
that allocation crossed a 16-register block boundary.  Bad rendering
and hangs ensued.

Tested-by: Ian Romanick <idr@freedesktop.org>
2011-06-24 17:57:53 -07:00
Stéphane Marchesin 7b44830ef4 i915g: add fake occlusion queries.
Those always return 0, but at least we don't crash when exposing GL 2.0.
2011-06-24 17:28:54 -07:00
Stéphane Marchesin 3a7953910a i915g: Don't do shader fixup if no surface is bound. 2011-06-24 16:43:58 -07:00
Stéphane Marchesin 1a69b50b3b i915g: Fix point sprites. 2011-06-24 16:30:19 -07:00
Brian Paul 6b28b44d45 indices: fix conversion of PIPE_PRIM_POLYGON to lines
When the fill mode is PIPE_POLYGON_MODE_LINE we were basically
converting the polygon into triangles, then drawing the outline of all
the triangles.  But we really only want to draw the lines around the
perimeter of the polygon, not the interior lines.

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 16:44:43 -06:00
Paul Berry 95c2e0b601 i965: fix mask used to write to clip distance registers when gen>6
In gen6 and above, clip distances 0-3 are written to message register
3's xyzw components, and 4-7 to message register 4's xyzw components.
Therefore when when writing the clip distances we need to examine the
lower 2 bits of the clip distance index to see which component to
write to.

emit_vertex_write() was examining the lower 3 bits, causing clip
distances 4-7 not to be written correctly.

Fixes piglit test vs-clip-vertex-01.shader_test
2011-06-24 15:35:49 -07:00
Alex Deucher 3acae45915 r600g: limit fs_write_all shader rebuild to eg+
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:27:39 -04:00
Alex Deucher feec48114b r600g: eg+ support for FS_COLOR0_WRITES_ALL_CBUFS
Evergreen+ don't support multi-writes so we need to emulate
it in the shader. Fixes the following piglit tests:
fbo-drawbuffers-fragcolor
ati_draw_buffers-arbfp-no-option

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
2011-06-24 18:22:47 -04:00
Chad Versace 6062692cc6 intel: Fix workaround for _mesa_update_framebuffer
In intel_draw_buffer, there exists a workaround to prevent
_mesa_update_framebuffer from creating a swrast depth wrapper when
using separate stencil. This commit fixes the workaround, which was
incomplete for s8z24 texture renderbuffers.

Fixes fbo-blit-d24s8 on gen5 with separate stencil manually enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace 97f263c229 intel: Change framebuffer validation criteria
Since all infrastructure is now in place to support packed
depth/stencil renderbuffers when using separate stencil, there is no
need for special cases when separate stencil is enabled.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:21 -07:00
Chad Versace e357ae9494 intel: In intel_update_wrapper, support s8z24 textures when using separate stencil
Also, in order to coerce intel_update_tex_wrapper_regions() to
allocate the hiz region, alter intel_update_tex_wrapper_regions() to
examine the renderbuffer format instead of the texture image format.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace bffae4c9cd intel: Factor region updates out of intel_update_wrapper
... and into new function intel_update_tex_wrapper_regions.

This prevents code duplication in the next commit.

Also add a note explaining that the hiz region is broken for mipmapped
depth textures.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace d09704b4e9 intel: During glTexImage, allocate renderbuffers for faking s8z24 textures
... when using separate stencil.

Define function intel_tex_image_x8z24_create_renderbuffers and call it
in intelTexImage after the miptree has been created and filled with data.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace 5cd4d85517 intel: Declare some functions in intel_fbo.c as non-static
... because they will be needed by intel_tex_image_s8z24_create_renderbuffers.

Redeclared functions are:
    intel_alloc_renderbuffer_storage
    intel_renderbuffer_set_draw_offsets

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace 8869a26237 intel: Change signature of intel_create_wrapped_renderbuffer
Redeclare as non-static because
intel_tex_image_s8z24_create_renderbuffers will use it.

Remove the 'wrapper' parameter, because there is no wrapper for
intel_texture_image.depth_rb and stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:20 -07:00
Chad Versace 951b75808e intel: Perform gather on s8z24 texture images during glGetTexImage
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace 01e493980c intel: Define functions intel_texture_s8z24_scatter/gather
... which copy the stencil bits between intel_image->depth_rb and
intel_image->stencil_rb.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Chad Versace 1a062dfc6f intel: Add fields to intel_texture for faking s8z24 with separate stencil
Add the fields depth_rb and stencil_rb, and put hooks in place to
release the renderbuffers in intelFreeTextureImageData and
intelTexImage.

Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-06-24 14:47:19 -07:00
Stéphane Marchesin 407832b0d2 st/mesa: add PIPE_FORMAT_R8G8B8A8_UNORM as the first RGBA format.
Otherwise we can end up creating RGBA render targets (which are BGRA on the
hardware), and then we bind them as RGBA textures (which are RGBA on the
hardware). This generates software fallbacks every time we bind the frame as
a texture.
2011-06-24 14:32:48 -07:00
Marek Olšák 100a37587f mesa: don't allocate memory in _mesa_unpack_depth_span if we don't need it
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák 12c105b5de mesa: fix a memory leak in _mesa_unpack_depth_span
NOTE: This is a candidate for the 7.10 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Marek Olšák e41a91cea7 mesa: fix texstore of DEPTH24_STENCIL8 if srcFormat is STENCIL_INDEX
NOTE: This is a candidate for the 7.10 branch.
2011-06-24 22:09:27 +02:00
Marek Olšák 2b41399bb4 mesa: remove unused function _mesa_new_depthstencil_renderbuffer
Reviewed-by: Brian Paul <brianp@vmware.com>
2011-06-24 22:09:27 +02:00
Brian Paul 09e71cf722 st/mesa: fix pipe_get_transfer() call in fallback_copy_texsubimage()
Commit 1a339b6c71 caused us to take
a different path through the glCopyTexSubImage() code.  The
pipe_get_transfer() call neglected to pass the texture's level, face
and slice info.  So we were always transferring from the 0th mipmap
level even when the source renderbuffer was a non-zero mipmap level
in a texture.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38649

NOTE: This is a candidate for the 7.10 branch.
2011-06-24 14:03:40 -06:00
Benjamin Franzke 629c15aaac egl_dri2: Build drm platform only if enabled 2011-06-24 22:00:45 +02:00
Vadim Girlin eafd331cf3 r600g: implement fragment and vertex color clamp
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38440

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:41 -04:00
Vadim Girlin d81126b714 r600g: optimize spi update
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:38 -04:00
Vadim Girlin 8567e02dca r600g: LIT: fix x&y slots order
Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
2011-06-24 15:23:35 -04:00
Eric Anholt 0c27dcb75c i965: Make the brw_format_for_mesa_format table static const.
Once again, assuming the compiler is clever works out so poorly.  The
generated code initialized the structure on the stack, then did a
lookup into it.  This was a performance regression from
70c6cd39bd.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:22 -07:00
Eric Anholt 3541cc0d40 i965: Don't bother telling swrast_setup about state updates until fallback.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:18 -07:00
Eric Anholt 6cf3d1cace i965: Don't bother telling tnl about state updates unless we fall back.
This was sucking up 1% of the CPU on 3DMMES.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:37:15 -07:00
Eric Anholt 18d4a44bdc i965: Reuse existing program data when a new compiled program matches.
It's common in applications just before the advent of
EXT_separate_shader_objects to have multiple linked shaders with the
same VS or FS.  While we aren't detecting those at the Mesa level, we
can detect when our compiled output happens to match an existing
compiled program.

This patch was created after noting the incredible amount of compiled
program data generated by Heroes of Newerth.  It reduces the program
data in use at the start menu (replayed by apitrace) from 828kb to
632kb, and reduces CACHE_NEW_WM_PROG state flagging by 3/4.  It
doesn't impact our rate of hardware state changes yet, because things
depending on CACHE_NEW_WM_PROG also depend on BRW_NEW_FRAGMENT_PROGRAM
which is still being flagged.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-24 10:36:49 -07:00
Brian Paul d91dc4a356 st/mesa: fix all_varyings_in_vbos() regression
Fixes regression from d631c19db4.
See http://bugs.freedesktop.org/show_bug.cgi?id=38626
2011-06-24 10:41:44 -06:00
Marc Pignat c0c0bb6cb1 Fix 24bpp software rendering
This patch add the support for 24bpp in the dri/swrast implementation.

Signed-off-by: Marc Pignat <marc@pignat.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 09:38:24 -06:00
Brian Paul 08183357c0 gallium/tests/trivial: update comment 2011-06-24 09:02:57 -06:00
Brian Paul b663292ae9 gallium/tests/trivial: use CXX to do final link 2011-06-24 09:02:47 -06:00
Alon Levy c9760c5c89 gallium/tests/trivial: make it build
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-06-24 08:59:42 -06:00
Chia-I Wu febf5e4147 st/egl: make native_buffer interface typed
Use a typed struct to describe the native buffer and let the backends
map the native buffer to winsys_handle for
resource_from_handle/resource_to_handle.
2011-06-24 16:49:27 +09:00
Chia-I Wu 875a1f8960 targets/egl: removed
Not used.
2011-06-24 16:49:27 +09:00
Chia-I Wu b8f097f7a0 targets/egl-static: replace targets/egl
Build egl_gallium from targets/egl-static intead of targets/egl.  The
latter exposes (unversioned) gallium interfaces and is frowned upon.
2011-06-24 16:49:27 +09:00
Chia-I Wu 7451bffad4 targets/egl-static: allow st/mesa to be dynamically loaded
When shared glapi is not enabled, there are two glapi providers and we
cannot decide which one to link to at build time.  It results in
unresolved symbols in st/mesa.  This commit makes st/mesa a loadable
module when shared glapi is not enabled, and hopes that the apps will
link to one of the glapi providers (GL or GLES).
2011-06-24 16:43:03 +09:00