Commit graph

40817 commits

Author SHA1 Message Date
Stéphane Marchesin
dd691032c8 i915g: Update the TODO with another idea. 2011-06-28 20:42:38 -07:00
Paul Berry
3097715d41 glsl: Rewrote _mesa_glsl_process_extension to use table-driven logic.
Instead of using a chain of manually maintained if/else blocks to
handle "#extension" directives, we now consult a table that specifies,
for each extension, the circumstances under which it is available, and
what flags in _mesa_glsl_parse_state need to be set in order to
activate it.

This makes it easier to add new GLSL extensions in the future, and
fixes the following bugs:

- Previously, _mesa_glsl_process_extension would sometimes set the
  "_enable" and "_warn" flags for an extension before checking whether
  the extension was supported by the driver; as a result, specifying
  "enable" behavior for an unsupported extension would sometimes cause
  front-end support for that extension to be switched on in spite of
  the fact that back-end support was not available, leading to strange
  failures, such as those in
  https://bugs.freedesktop.org/show_bug.cgi?id=38015.

- "#extension all: warn" and "#extension all: disable" had no effect.

Notes:

- All extensions are currently marked as unavailable in geometry
  shaders.  This should not have any adverse effects since geometry
  shaders aren't supported yet.  When we return to working on geometry
  shader support, we'll need to update the table for those extensions
  that are available in geometry shaders.

- Previous to this commit, if a shader mentioned
  ARB_shader_texture_lod, extension ARB_texture_rectangle would be
  automatically turned on in order to ensure that the types
  sampler2DRect and sampler2DRectShadow would be defined.  This was
  unnecessary, because (a) ARB_shader_texture_lod works perfectly well
  without those types provided that the builtin functions that
  reference them are not called, and (b) ARB_texture_rectangle is
  enabled by default in non-ES contexts anyway.  I eliminated this
  unnecessary behavior in order to make the behavior of all extensions
  consistent.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 14:00:20 -07:00
Paul Berry
9c4445de6e glsl: Changed extension enable bits to bools.
These were previously 1-bit-wide bitfields.  Changing them to bools
has a negligible performance impact, and allows them to be accessed by
offset as well as by direct structure access.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-06-28 13:57:03 -07:00
Paul Berry
b078aad8ab glsl: permit explicit locations on fragment shader outputs, not inputs
From the OpenGL docs for GL_ARB_explicit_attrib_location:

    This extension provides a method to pre-assign attribute locations to
    named vertex shader inputs and color numbers to named fragment shader
    outputs.

This was accidentally implemented for fragment shader inputs.  This
patch fixes it to apply to fragment shader outputs.

Fixes piglit tests
spec/ARB_explicit_attrib_location/1.{10,20}/compiler/layout-{01,03,06,07,08,09,10}.frag

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=38624
2011-06-28 13:49:11 -07:00
Stéphane Marchesin
fe36bc0c41 i915g: Fix comment about sin/cos constants. 2011-06-28 12:07:11 -07:00
Stéphane Marchesin
bd1ee76442 i915g: Fix staging texture uploads a bit.
They still look corrupted, but at least now they don't look tiled any more.
2011-06-28 12:05:28 -07:00
Eric Anholt
a09c5c2e30 i965: Reissue PIPELINE_POINTERS and BINDING_TABLE_POINTERS on SBA change.
This was a requirement we didn't run into until we started using
STATE_BASE_ADDRESS for instruction data.
2011-06-28 10:17:39 -07:00
Eric Anholt
cd7bfd5d44 i965/gen6: Fix scissors using invalid STATE_BASE_ADDRESS.
The scissor state was incorrectly in a .prepare function instead of
.emit, so the packet would end up in the batch before the
STATE_BASE_ADDRESS.  It appears that this doesn't actually hurt, as
the scissor address gets dereferenced according to the current SBA at
draw time.
2011-06-28 10:17:39 -07:00
Stéphane Marchesin
de33b0dd23 i915g: Add a debug_printf when we get the Abs flag. 2011-06-28 02:14:43 -07:00
Stéphane Marchesin
2e481e5fc4 i915g: Support PIPE_FORMAT_B10G10R10A2_UNORM. 2011-06-28 01:41:57 -07:00
Stéphane Marchesin
062a1e291f i915g: Improve SIN/COS a bit. 2011-06-28 00:59:41 -07:00
Stéphane Marchesin
77896b256a i915g: When emulating LUMINANCE8 and INTENSITY8 texutres, route alpha properly.
That fixes some formats in fbo-alphatest-formats.
2011-06-28 00:59:40 -07:00
Stéphane Marchesin
6f62a25448 i915g: fix shadow compare.
"Works" as well as i915c now.
2011-06-28 00:59:40 -07:00
Chia-I Wu
24137afb31 targets/egl-static: fix library search order
Use

  $(MKLIB) -ldflags '-L$(TOP)/$(LIB_DIR)'

instead of

  $(MKLIB) -L$(TOP)/$(LIB_DIR)

to make sure the local library path appears before system's.
2011-06-28 15:25:00 +09:00
Chia-I Wu
aa281dd392 st/egl: update fbdev backend
Considering fbdev as an in-kernel window system,

 - opening a device opens a connection
 - there is only one window: the framebuffer
 - fb_var_screeninfo decides window position, size, and even color format
 - there is no pixmap

Now EGL is built on top of this window system.  So we should have

 - the fd as the handle of the native display
 - reject all but one native window: NULL
 - no pixmap support

modeset support is still around, but it should be removed soon.
2011-06-28 15:07:30 +09:00
Stéphane Marchesin
a2537bbc95 i915g: Enable GL_ARB_instanced_arrays. 2011-06-27 19:27:58 -07:00
Stéphane Marchesin
8dd1e3670f i915g: Fix a bug in facing.
However doesn't work because of limitations in the draw module.
2011-06-27 18:29:50 -07:00
Ben Widawsky
6750226e6d i965: step message register allocation
The system routine requires m0 be reserved for saving off architectural
state. Moved the allocation to start at 2 instead of 0.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-06-27 14:21:22 -07:00
Ian Romanick
d2c6cef18a glsl: Fix depth unbalancing problem in if-statement flattening
Previously, if max_depth were 1, the following code would see the
first if-statement (correctly) not get flattened, but the second
if-statement would (incorrectly) get flattened:

void main()
{
    if (a)
        gl_Position = vec4(0);

    if (b)
        gl_Position = vec4(1);
}

This is because the visit_leave(ir_if*) method would not decrement the
depth before returning on the first if-statement.

NOTE: This is a candidate for the 7.10 and 7.11 branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-06-27 14:00:14 -07:00
Stéphane Marchesin
c191c87c81 i915g: Remove unused cbuf_dirty. 2011-06-27 02:08:44 -07:00
Stéphane Marchesin
e2422f77a2 i915g: Add a comment about a bug. 2011-06-27 02:06:00 -07:00
Stéphane Marchesin
ef3dac2aff i915g: initial support for SEMANTIC_FACE.
Doesn't work yet, see TODO.
2011-06-27 02:06:00 -07:00
Stéphane Marchesin
4887e1c31a i915g: update TODO. 2011-06-27 02:06:00 -07:00
Stéphane Marchesin
9d29d48bb0 i915g: Return the max result for the fake occlusion queries. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
b13865e694 i915g: Fix depth texture formats.
Depth compare still looks broken though.
2011-06-27 02:05:59 -07:00
Stéphane Marchesin
a8ebc5400e i915g: Fix u_blitter comment. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
811963a7ae i915g: Implement fake DDX/DDY. 2011-06-27 02:05:59 -07:00
Stéphane Marchesin
d2f05283d2 i915g: Fix gl_FragCoord. 2011-06-27 02:05:58 -07:00
Benjamin Franzke
992680c8b4 egl: Fix Terminate with shared gbm screens
NOTE: This is a candidate for the 7.11 branch.
2011-06-27 10:25:12 +02:00
Thomas Hellstrom
69140b719b st/xa: Update README.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:23:37 +02:00
Thomas Hellstrom
9a0c5b4634 st/xa: Add a function to check for supported formats
Typically this was done by having a surface creation function fail if
the format was not supported.
However, in some situations when changing hardware surface formats,
it's desirable to do this check before attempting costly readback operations.

Also updated the surface_redefine interface.

Bump minor.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:14:39 +02:00
Thomas Hellstrom
ab3587f70d st/xa: Various fixes for composite.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
2011-06-27 10:14:34 +02:00
Chia-I Wu
3a07d9594a st/d3d1x: fix for st/egl native.h interface change
The interface was changed in 73df31eedd.
2011-06-27 12:20:52 +09:00
Chia-I Wu
a1cadf2b5c targets/egl-static: fix building without libudev
Thanks to José for pointing out.
2011-06-26 18:04:42 +09:00
Chia-I Wu
450f486276 targets/egl-static: refactor drm_fd_get_screen_name
Add drm_fd_get_pci_id to get the PCI ID.  Fix a leak with udev on error.
2011-06-26 08:17:52 +09:00
Chia-I Wu
ed47d65c7c st/egl: fix a compile error
It is triggered when --with-driver=xlib is specified.
2011-06-26 08:16:59 +09:00
Chia-I Wu
56ec8e17d3 targets/gbm: attemp to fix unresolved symbols
Move system libraries (usually .so) out of --start-group / --end-group
pair.  Add possiblly missing archives, defines, and shared libraries.
2011-06-26 07:42:04 +09:00
Marek Olšák
bc517d64da r300g: drop support for ARGB, ABGR, XRGB, XBGR render targets
Blending and maybe even alpha-test don't work with those formats.

Only supporting RGBA, BGRA, RGBX, BGRX.

NOTE: This is a candidate for the 7.10 and 7.11 branches.
2011-06-25 18:34:09 +02:00
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