Commit graph

41495 commits

Author SHA1 Message Date
Chad Versace
f378e8fea0 i965: Change type of brw_context.primitive from GLenum to hardware primitive
For example, GL_TRIANLGES is converted to _3DPRIM_TRILIST.

The conversion is necessary because HiZ and MSAA resolve operations emit
a 3DPRIM_RECTLIST, which cannot be conveyed by GLenum.

As a consequence, brw_gs_prog_key.primitive is also converted.

v2
----
- [anholt] Split brw_set_prim into brw/gen6 variants in previous commit,
  since not much code is really shared between the two.
- [anholt] Replace switch statements with table lookups, since this is
  a hot path.

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:24:11 -07:00
Chad Versace
9559ca600d i965: Split brw_set_prim into brw/gen6 variants
The "slight optimization to avoid the GS program" in brw_set_prim() is not
used by Gen 6, since Gen 6 doesn't use a GS program. Also, Gen 6 doesn't use
reduced primitives.

Also, document that intel_context.reduced_primitive is only used for Gen < 6

Reviewed-by: Eric Anholt <eric@anho.net>
Signed-off-by: Chad Versace <chad@chad-versace.us>
2011-10-10 13:23:41 -07:00
Dave Airlie
95fd5e5aba r600g: drop force int type workaround
now that we have integer texture types I can drop this workaround so that
copies of values is done properly (as floats would fail on some corner cases).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:53:26 +01:00
Dave Airlie
8d3e505ed6 r600g: add integer texture/render integer formats for r600/700.
with these I can drop the force int type hack.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 20:52:35 +01:00
Eric Anholt
d950a778b7 mesa: Prevent repeated glDeleteProgram() from blowing away our refcounts.
glDeleteProgram should only be able to remove the one refcount for the
user's reference to the program from the hash table (even though that
ref does live on in the hash table until the last other ref is
removed).

Fixes piglit ARB_shader_objects/delete-repeat.

Reviewed-by: Chad Versace <chad@chad-versace.us>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 11:38:52 -07:00
Zou Nan hai
7457da5edd i965: Fix timer query on gen6+
PIPE_CONTROL reported time stamp are 64 bits value incrementing every
80 ns, and only the low 32 bits are active (high 32 are always 0).

v2: Cleaned up whitespace, function arguments (anholt).

Fixes piglit EXT_timer_query/time-elapsed

Signed-off-by: Zou Nan hai <nanhai.zou@intel.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
2011-10-10 11:38:52 -07:00
Ian Romanick
9f0e98d1df linker: Fix a slightly incorrect comment
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:23:53 -07:00
Ian Romanick
f3650b05cf hash_table: Make string_to_uint_map make a copy of the name
The hash table needs a copy of the key that it can keep for
comparisons during searches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41499
Cc: Stéphane Marchesin <stephane.marchesin@gmail.com>
Tested-by: Luzipher <luziphermcleod@yahoo.ie>
Tested-by: Michał Lipski <tallica@o2.pl>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-10 10:21:20 -07:00
Dave Airlie
9e66b25880 u_blitter: clean up velem setup
as per Brian's suggestion, drop the pointless loops.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 17:22:17 +01:00
Stéphane Marchesin
6bf8c7c010 i915g: Update the TODO with another idea. 2011-10-10 00:15:06 -07:00
Stéphane Marchesin
9977fb42ac i915g: Enable instanced drawing. 2011-10-10 00:15:05 -07:00
Stéphane Marchesin
ddba509c16 mesa/st: Check for a NULL _LinkedShader[i] before using it.
The rest of the linker/glsl translation code checks for NULL, so I suppose we should check here too. Fixes crash on exit with i915g instanced drawing.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2011-10-10 00:15:05 -07:00
Marek Olšák
0f55f133f1 u_blitter: query vertex shader caps instead of geometry for int vertices 2011-10-09 18:19:58 +02:00
Dave Airlie
9b34cea7e9 r600g: uarl fixes.
Not 100% sure these are correct yet
2011-10-09 16:48:45 +01:00
Dave Airlie
ddcdd6137b r600g: enable integer shader cap for evergreen.
Will get to adding r600/r700/cayman support, have it mostly written on
another PC.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:48:45 +01:00
Dave Airlie
dd20256a1c u_blitter: don't create integer vertex elements unless shader supports them
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=41613

We don't want to create these vertex elements unless the pipe driver
vertex stage can handle integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 16:36:41 +01:00
José Fonseca
ee1487953b st/glx/xlib: Advertise GLX_ARB_create_context(_profile)
They were already implemented, but not advertised.
2011-10-09 16:11:26 +01:00
Marcin Slusarz
90dcd6c89a nouveau: hide some debugging messages behind environment variable
They spam console, but are not very useful - hide them behind
NOUVEAU_MESA_DEBUG environment variable.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
f03810fbdd nv50,nvc0: avoid unnecessary flushes
Relocations don't consume pushbuffer space, so there is no need to
ensure there is any space in pushbuffer.
2011-10-09 14:49:30 +02:00
Marcin Slusarz
9849f366cb nouveau: fix fence hang
If there is not enough space in pushbuffer for fence emission
(nouveau_fence_emit -> nv50_screen_fence_emit -> MARK_RING),
the pushbuffer is flushed, which through flush_notify ->
nv50_default_flush_notify -> nouveau_fence_update marks currently
emitting fence as flushed. But actual emission is done after this mark.
So later when there is a need to wait on this fence and pushbuffer
was not flushed in between, fence wait will never finish causing
application to hang.

To fix this, introduce new fence state between AVAILABLE and EMITTED,
set it before emission and handle it everywhere.

Additionally obtain fence sequence numbers after possible flush in
MARK_RING, because we want to emit fences in correct order.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>

Note: This is a candidate for the 7.11 branch.
2011-10-09 14:49:30 +02:00
Dave Airlie
0110aa09e5 r600g/eg: add integer types support
adds handling for int texture/vertices to evergreen.

TODO r600/700 support.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:06:18 +01:00
Dave Airlie
4e28e6f6c7 u_blitter: add integer clear support
We need add a new set of fragment shader variants, along with new vertex
elements for signed and unsigned clears.

The new fragment shader variants are due to the integers values requiring
CONSTANT interpolation. The new vertex element descriptions are for passing
the clear color as an unsigned or signed integer value.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-09 10:01:08 +01:00
Stéphane Marchesin
06415d3fab i915g: Remove another TODO item which was done a while ago. 2011-10-08 23:58:46 -07:00
Stéphane Marchesin
5dfeab71cf i915g: Remove a TODO item. 2011-10-08 23:58:06 -07:00
Stéphane Marchesin
03cd54dc60 i915g: Fix comment. 2011-10-08 23:57:27 -07:00
Stéphane Marchesin
8a22064d31 i915g: Implement vertex textures. 2011-10-08 23:54:53 -07:00
Stéphane Marchesin
e125786be8 i915g: Silence warning. 2011-10-08 20:19:53 -07:00
Stéphane Marchesin
49fea2e039 i915g: Remove old heuristic flusing remains. 2011-10-08 17:42:18 -07:00
Stéphane Marchesin
cd41960e8f i915g: Cleanup caps code a bit. 2011-10-08 17:12:37 -07:00
Marek Olšák
39d7de69b1 pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches.
2011-10-08 18:54:28 +02:00
Dave Airlie
a66a2359d7 st/mesa: add readpixel integer support
This adds support for readpixels integer paths, it deals with the signed/unsigned crossovers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:46:38 +01:00
Dave Airlie
3213d55d99 st/mesa: add support for int type conversion
This adds the various mesa->gallium and gallium->mesa format conversions
along with the GL->gallium texture choosers for integers.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:46:03 +01:00
Dave Airlie
a441feb757 gallium: add initial pure integer support (v2)
This add support for unsigned/signed integer types via adding a 'pure' bit
in the format description table. It adds 4 new u_format get/put hooks,
for get/put uint and get/put sint so that accessors can get native access
to the integer bits. This is used to avoid precision loss via float converting
paths.

It doesn't add any float fetchers for these types at the moment, GL doesn't
require float fetching from these types and I expect we'll introduce a lot
of hidden bugs if we start allowing such conversions without an API mandating
it.

It adds all formats from EXT_texture_integer and EXT_texture_rg.

0 regressions on llvmpipe here with this.

(there is some more follow on code in my gallium-int-work branch, bringing
 softpipe and mesa to a pretty integer clean state)

v2: fixup python generator to get signed->unsigned and unsigned->signed
fetches working.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:59 +01:00
Dave Airlie
c2060c0af7 mesa/texformat: add integer fallbacks to other formats
This fixes up the integer format choosing to pick the closest mesa format
then the most likely fallback.

(the formatting in this file needs cleaning in another patch).

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:59 +01:00
Dave Airlie
8f9edbad6f mesa: add packing for int/uint
This just adds a simple packing for GL_UNSIGNED_INT/GL_INT destination formats.
This is enough for at least the gallium drivers to pack both unsigned and signed types for read pixels.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:58 +01:00
Dave Airlie
61285c6cfa u_format: add inline helper to find first non void channel
This is used in a few places in drivers as well, also the integer support
can use it as well.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-08 17:44:58 +01:00
Kenneth Graunke
b861479f83 i965: Fix inconsistent indentation in brw_eu_emit.c.
Most of these functions used three spaces for the first level of
indentation, but four spaces for the next level.  One used tabs and then
three spaces.  Some used 3/4 in a then block but 3/3 in the else block.

Normally I try to avoid field days like this, but since the functions
were so inconsistent, even internally, it was making it difficult to
edit without introducing spurious whitespace changes.

So, just get it over with.  git diff -b shows 0 lines changed.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 20:23:47 -07:00
Marek Olšák
20788a908b r300g: remove unused r300_resource::tex_offset 2011-10-08 02:21:24 +02:00
Ian Romanick
93c26d8baf glsl: Remove unused method ir_variable::component_slots
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
0c76729f39 mesa: Silence several 'warning: unused parameter' in _mesa_GetnUniformdvARB
This function isn't implemented yet, so none of its parameters are
used yet.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
97a0fe8e93 mesa: Remove unused function _mesa_append_uniform
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
e2bdef5380 mesa: Simplify calling Driver.ProgramStringNotify after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2011-10-07 16:39:51 -07:00
Ian Romanick
77d67a44cc mesa: Simplify destroy_shader_program_variants_cb after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
5a4279f80d mesa: Simplify validate_shader_program after previous refactors
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:51 -07:00
Ian Romanick
de772c4022 mesa: Use gl_shader_program::_LinkedShaders instead of FragmentProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Ian Romanick
39348bf79f mesa: Use gl_shader_program::_LinkedShaders instead of GeometryProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Ian Romanick
010cc547ca mesa: Use gl_shader_program::_LinkedShaders instead of VertexProgram
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2011-10-07 16:39:50 -07:00
Chad Versace
2fae55666e mesa: Close Doxygen group
In dd_function_table, close the Doxygen group beginning with
   \name Support for multiple T&L engines
2011-10-07 15:51:54 -07:00
Marek Olšák
4c417697b6 u_blitter: bind a NULL geometry shader 2011-10-08 00:49:34 +02:00
Marek Olšák
c12c05c198 u_blitter: cleanup checking for and restoring saved states 2011-10-08 00:49:34 +02:00