Commit Graph

47891 Commits

Author SHA1 Message Date
Brian Paul
ba3b9fad60 i965: remove #include of api_noop.h 2011-11-11 07:23:45 -07:00
Brian Paul
6e9b1d5d0d xlib: set alpha to 0xff when mapping RGB pixmaps
Fixes a bunch of conform regressions.
2011-11-11 07:13:00 -07:00
Brian Paul
16bff7e2ce swrast: avoid calling _mesa_get_srgb_format_linear() inside a loop 2011-11-11 07:12:59 -07:00
Brian Paul
0f3f6cf02b swrast: remove bogus assertion
It would fail for images that were never allocated (and wouldn't be
used during rendering).
2011-11-11 07:12:55 -07:00
Brian Paul
871dc64869 svga: don't crash/assert if we fail to allocate a vertex buffer
v2: check if pipe_buffer_map() returns NULL, and return NULL from
svga_vbuf_render_map_vertices().  Per Jose's suggestion.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
2011-11-11 07:10:56 -07:00
Brian Paul
aa66130682 draw: handle out of memory conditions
If the vbuf backend fails to allocate a vertex buffer, don't crash
or assert.
2011-11-11 07:10:56 -07:00
Brian Paul
7288bfb2a4 util: check for null vertex buffer object in blit code
Don't crash if we fail to allocate a vertex buffer.
2011-11-11 07:10:56 -07:00
Brian Paul
2551ff5900 st/mesa: fix OOM failure in bitmap code 2011-11-11 07:10:56 -07:00
Brian Paul
97dedfda5f vbo: better handling of VBO allocation failures
Previously, if we failed to allocate a VBO (either for display list
compilation or immediate mode rendering) we'd eventually segfault
when trying to map the non-existant buffer or in a glVertex/Color/etc
call when we hit a null pointer.

Now we don't try to map non-existant buffers and if we do fail to
allocate a VBO we plug in no-op functions for glVertex/Color/etc
so we don't segfault.
2011-11-11 07:10:56 -07:00
Brian Paul
e6c4159372 mesa: replace api_noop.[ch] with vbo_noop.[ch]
None of the code in api_noop.c was used anymore.  The new vbo_noop.c
functions are true no-ops.  They'll be used to no-op glBegin/End functions
when we run out of VBO memory.
2011-11-11 07:10:56 -07:00
Brian Paul
cd30c28e3b vbo: pull some code from api_noop.c into vbo module
Only a handful of functions from api_noop.c are actually used by
the VBO module.  Move them to the VBO module.  With this change,
none of the code in api_noop.c is actually used anymore.
2011-11-11 07:10:56 -07:00
Brian Paul
6ba0ba09b4 mesa: remove ancient, unused gl_free_control_points prototoype 2011-11-11 07:10:55 -07:00
Brian Paul
9c0d7828d2 docs: add another viewperf issue 2011-11-11 07:10:55 -07:00
Kenneth Graunke
9ae10e9cbd i965: Make Gen6+ renderbuffer surface updates not depend on NEW_COLOR.
NEW_COLOR is only needed on Gen4-5 as brw_update_renderbuffer_surfaces
only uses ctx->Color when intel->gen < 6.

This should reduce unnecessary state updates.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
d46dfed958 i965: Reorder state atom lists so all the surface state is together.
Not strictly necessary, but seems like a good idea.

Suggested-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
a17a78a212 glsl: Handle constant expressions involving ir_binop_equal/nequal.
Constant expressions which called GLSL's equal() and notEqual()
built-ins on bvecs would hit an assertion failure; we simply forgot to
implement them for booleans.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2011-11-10 22:51:20 -08:00
Kenneth Graunke
83d0514f1f glsl: Remove textureGradOffset built-ins taking samplerCube parameters.
These simply don't exist in the 1.30 specification---none of the Offset
variants allow samplerCube.  This must have been a cut and paste error
from textureGrad, which /does/ allow cubemaps.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
6a77f36ad9 glsl: Fix misnamed textureProjOffset prototypes in built-in profiles.
Due to a cut and paste error, these were accidentally misnamed
textureProj() rather than textureProjOffset().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
2eb43bbb77 glsl: Remove texture built-ins with 'bias' from 1.30 VS profile.
From the GLSL 1.30 spec, section 8.7 "Texture Lookup Functions":
"In all functions below, the bias parameter is optional for fragment
 shaders.  The bias parameter is not accepted in a vertex shader."

This was a cut and paste mistake.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
51b1d412ec i965: Put a proper sampler count in 3DSTATE_VS.
See similar code for 3DSTATE_WM.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
29fc0d8c8a i965: Upload SAMPLER_STATE pointers for the VS on Ivybridge.
See similar code in gen7_wm_state.c.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
32dfa6e5ef i965: Move and rename "wm sampler" fields to just "sampler".
brw_wm_samplers actually enables any active samplers regardless of what
pipeline stage is using them, so it doesn't make much sense for it to be
WM-specific.  So, rename it to "brw_samplers."

To properly generalize it, move sampler_count and sampler_offset from
brw_context::wm to a new brw_context::sampler that can be shared without
looking strange.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
91043c21f9 i965: Clean up code for VS pull constant surface creation.
Like for the WM pull constants, we can merge the former prepare/emit
stages into one tracked state atom.  Furthermore, the code that used to
handle the binding table was removed in the last commit, leaving some
rather silly looking short functions that can easily be folded in.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
e7c29c5de8 i965: Use a single binding table for all pipeline stages.
Although the hardware supports separate binding tables for each pipeline
stage, we don't see much advantage over a single shared table.

Consider the contents of the binding table:
- Textures (16)
- Draw buffers (8)
- Pull constant buffers (1 for VS, 1 for WM)

OpenGL's texture bindings are global: the same set of textures is
available to all shader targets.  So our binding table entries for
textures would be exactly the same in every table.

There are only two pull constant buffers (not many), and although draw
buffers aren't interesting to the VS, it shouldn't hurt to have them in
the table.  The hardware supports up to 254 binding table entries, and
we currently only use 26.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
4a42bd3931 i965: Split brw_wm_surfaces state into renderbuffer and texture atoms.
First, the texturing setup code is relevant for all pipeline stages,
while renderbuffer surfaces are only used by the WM.

Secondly, renderbuffer and texture setup depends on a different set of
dirty bits.  There's no reason to walk the array of textures when
changing draw buffers, or vice-versa.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
a7d0fa209b i965: Combine the two WM pull constant tracked state atoms.
These were only split for historical reasons: brw_wm_constants used to
be the "prepare" step, while brw_wm_constant_surface was "emit".  Now
that both happen at emit time, it makes sense to combine them.

Call the newly combined state atom "brw_wm_pull_constants" to indicate
help distinguish it from the Gen6+ atoms that handle push constants.

Finally, remove the BRW_NEW_WM_CONSTBUF dirty bit entirely now that it's
never flagged nor used.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
f3e9ccb3bc i965: Rename gen6_*_constants tracked state atoms to "push_constants".
When reading the "brw_wm_constants" and "gen6_wm_constants" atoms
side-by-side, I initially failed to notice the crucial difference:
the Gen6 atoms are for Push Constants, while brw_wm_constants handles
Pull Constants.  (Gen4/5 Push Constants are handled by "brw_curbe.")

Renaming these should clarify the code and save me from constant
confusion over the fact that "gen6_wm_constants" isn't just a newer
version of "brw_wm_constants."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
e4b1c9b4be i965: Remove nr_surfaces computation from brw_update_wm_surfaces.
This code is fairly fragile, as it depends on the ordering of the
entries in the binding table, which will change soon.

Also, stop listening on the BRW_NEW_WM_CONSTBUF dirty bit as it's no
longer required.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
6ba9090ea0 i965: Use 0 for the number of binding table entries in 3DSTATE_(VS|WM).
These fields control how many entries the hardware prefetches into the
state cache, so they only impact performance, not correctness.  However,
it's not clear how to use this in a way that's beneficial.

According to the documentation, kernels "using a large number" of
entries may wish to program this to zero to avoid thrashing the cache;
it's unclear how many is too many.  Also, Ironlake's WM was missing this
feature entirely---the count had to be zero.

The dirty bit tracking to handle this complicates the surface state
and binding table setup; removing it should simplify things and make
future refactoring easier.  So just set 0 for the number of entries
rather than trying to compute and track it.

Appears to have no impact on Nexuiz and OpenArena on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
0983c6869b i965: Remove outdated comment about CACHE_NEW_SURF_BIND dirty bit.
The comment states that brw_update_vs_constant_surface produces a
CACHE_NEW_SURF_BIND dirty bit, but it doesn't.   In fact, that bit
no longer even exists.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
d1d86dc55c i965: Remove BRW_NEW_NR_VS_SURFACES dirty bit from brw_vs_surfaces.
brw_vs_surfaces _produces_ the BRW_NEW_NR_VS_SURFACES dirty bit, so it
makes no sense for it to subscribe to it.

Fixes an assertion failure in many piglit tests when INTEL_DEBUG is set:
  brw_state_upload.c:484: void brw_upload_state(struct brw_context *):
  Assertion `!check_state(&examined, &generated)' failed.

One such piglit test is vs-uniform-array-mat2-col-rd.shader_test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:19 -08:00
Kenneth Graunke
7c057f2360 i965: Add missing CACHE_NEW_WM_PROG dirty bit to WM pull constants.
Comparing brw_upload_vs_pull_constants and brw_upload_wm_pull_constants,
it became evident that something was amiss: the VS code had both
CACHE_NEW_VS_PROG and BRW_NEW_VERTEX_PROGRAM, while the WM code was
missing the CACHE_NEW_WM_PROG flag.

Not observed to fix anything, but likely necessary.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2011-11-10 22:51:18 -08:00
Kenneth Graunke
c3e3903a90 i965: Use new vtable entries for surface state updating functions.
Now that we have vtable entries in place, we should use them.  This
allows us to drop the cut and pasted Gen7 brw_tracked_state atoms as
they now do exactly the same thing as their brw_wm_surface_state
counterparts.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:18 -08:00
Kenneth Graunke
5d448b42b7 i965: Add new vtable entries for surface state updating functions.
Gen7+ SURFACE_STATE is different from Gen4-6, so we need separate
per-generation functions for creating and updating it.  However, the
usage is the same, and callers just want to utilize the appropriate
functions with minimal pain.  So, put them in the vtable.

Since these take a brw_context pointer and are only used on Gen4, just
add a forward declaration.  This is the simplest (if not cleanest)
solution.  It would be nicer to have a i965-specific vtable, but that's
a refactor for another day.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2011-11-10 22:51:18 -08:00
Marek Olšák
b8428e6335 r600g: don't set the query result to 0 after a call to get_query_result
get_query_result doesn't reset the result. Only begin_query does.
2011-11-11 00:08:01 +01:00
Marek Olšák
72c1658554 r600g: the type of OCCLUSION_PREDICATE result should be boolean 2011-11-11 00:03:52 +01:00
Brian Paul
3800fe800b mesa: silence uninitialized var warning 2011-11-10 16:00:46 -07:00
Brian Paul
3da5196263 radeon: silence initializer warnings 2011-11-10 16:00:46 -07:00
Brian Paul
1462114475 draw/llvm: silence uninitialized variable warnings 2011-11-10 16:00:46 -07:00
Brian Paul
fe5ba5da7e radeon: silence unused var warnings 2011-11-10 16:00:46 -07:00
Brian Paul
2e15f0c860 egl: silence unused var warning 2011-11-10 16:00:46 -07:00
Wayne E. Robertz
beef101eb3 mklib: fix static lib building by filtering out -L, -l options
Signed-off-by: Brian Paul <brianp@vmware.com>
2011-11-10 16:00:46 -07:00
Marek Olšák
b999be8374 r600g: implement PIPE_QUERY_OCCLUSION_PREDICATE 2011-11-10 23:11:57 +01:00
Marek Olšák
083482d493 r300g: fix query result of GPU_FINISHED 2011-11-10 22:58:34 +01:00
Marek Olšák
c5ae81652d r300g: implement PIPE_QUERY_GPU_FINISHED 2011-11-10 22:53:54 +01:00
Marek Olšák
014b3aa07d r300g: implement PIPE_QUERY_OCCLUSION_PREDICATE 2011-11-10 22:53:54 +01:00
Dave Airlie
4fd485666a llvmpipe/u_format: add support for EXT_texture_shared_exponent + EXT_packed_float
These two are fairly unique types so add specific cases for decoding them.

Passes piglit fbo-clear-format and fbo-generatemipmap-format tests for these
two extensions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 20:37:55 +00:00
Dave Airlie
ab14915dce llvmpipe: add NV_conditional_render support.
This ports the softpipe NV_conditional_render support to llvmpipe.

This passes the nv_conditional_render-* piglit tests.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-11-10 20:32:13 +00:00
Marek Olšák
dbd24b5df6 r600g: remove useless texture barrier 2011-11-10 18:49:26 +01:00
Marek Olšák
ec3d2c7f08 r600g: flush the whole context when CS is full, not just hw_context
Because we disable render condition in r600_flush, but not in r600_context_flush.
2011-11-10 18:48:23 +01:00