Commit Graph

52346 Commits

Author SHA1 Message Date
Jakob Bornecrantz 6bb71b8cbe dri: Remove image write function
Since its not used by anything anymore and no release has gone out
where it was being used.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:41 +02:00
Jakob Bornecrantz a669a5055e gbm: Use libkms to replace DRI cursor images
Uses libkms instead of dri image cursor. Since this is the only user of the
DRI cursor and write interface we can remove cursor surfaces entirely from
the DRI interface and as a consequence also from the Gallium interface as
well. Tho to make everybody happy with this it would probably should add a
kms_bo_write function, but that is probably wise in anyways.

The only downside is that it adds a dependancy on libkms, this could how ever
be replaced with the dumb_bo drm ioctl interface.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
2012-08-26 15:39:23 +02:00
Kenneth Graunke a3685544e1 i965: Don't set iz_lookup the FS precompile's program key on Gen6+.
We already changed the actual program key builder to only set these bits
on gen < 6; this patch just brings the precompile state back in line so
it doesn't mismatch every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 23:05:35 -07:00
Kenneth Graunke 98211d5af7 i965/fs: Fix INTEL_DEBUG=perf program key printing.
When dumping differences in program keys, it printed messages of the
format:

   [Name of thing that changed]  [new]->[old]

This was terribly confusing: the right arrow implies "the value changed
from this to that", when in fact the message conveyed the opposite.

Except that some of the time, it didn't, since we accidentally swapped
the arguments to brw_debug_recompile_sampler_key.  With two swaps, it
would often come out in the expected format.

This patch fixes it to properly print:

   [Name of thing that changed]  [old]->[new]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-25 23:01:50 -07:00
Kenneth Graunke 174d44a9c4 mesa: Use a new, more specific hook for shader uniform changes.
Gallium drivers and i965 don't require special notification when
sampler uniforms change.  They simply see the _NEW_TEXTURE and adjust
their indirection tables.  These drivers don't want ProgramStringNotify:
it simply causes pointless recompiles.

Unfortunately, i915 still requires shader recompiles and needs
ProgramStringNotify.  Rather than trying to fix that, simply change the
hook to a new, more specific one: ShaderUniformChange.  On i915, this
translates to ProgramStringNotify; others simply ignore it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke 85e8e9e000 i965: Use linker-assigned sampler IDs in instruction encoding.
When assigning uniform locations, the linker assigns each sampler
uniform a sequential numerical ID.  gl_shader_program::SamplerUnits maps
these sampler variable IDs to the actual texture units they reference
(specified via glUniform1i).

Previously, we encoded this mapping in the SEND instruction encoding:
the "sampler" was the texture unit number, and the binding table index
was SURF_INDEX_TEXTURE(the texture unit number).  This unfortunately
meant that whenever the application changed the value of a sampler
uniform, we had to recompile the shader to change the SEND instructions.

This was horrible for the game Cogs, which repeatedly switches between
using texture unit 0 and 1.  It also made fragment shader precompiles
useless: we'd do the precompile at glLinkShader() time, before the
application called glUniform1i to set the sampler values.  As soon as
it did that, we'd have to recompile, wasting time and space in the
program cache.

This patch encodes the SamplerUnits indirection in the binding table,
sampler state, and sampler default color tables.  Instead of baking the
texture unit number into the shader, we bake in the sampler variable ID
assigned by the linker.  Since those never change, we don't need to
recompile programs on uniform changes.

This does mean that the tables now depend on the linked shader program
being used for rendering, rather than simply representing all available
texture units.  This could cause an increase in state emission.

Another plus is that the sampler state and sampler default color tables
are now compact: we only emit as many entries as there are sampler
uniforms, with no holes in the table since the new sampler IDs are
sequential.  Previously we had to emit a full 16 entries every time,
since the tables tracked the state of all active texture units.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke 2faa592e7f i965: Add a "sampler state index" parameter to update_sampler_state().
This represents the index into the sampler state table or sampler
default color table (the two are identical).

Right now, this is still the texture unit, but that will change shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke 28fab4295e i965: Un-hardcode WM binding table from update_texture_surface.
Currently, we mirror the VS and WM binding tables' texture entries.
That may not continue to be true, so in preparation, pass in the binding
table and surface index as arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:10 -07:00
Kenneth Graunke 96a22f3583 i965/vs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke 0ad2dce24a i965/fs: Rename "sampler" to "texunit" in texturing code.
The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms.  Calling it
"texunit" clarifies this slightly.

Don't bother renaming fs_instruction::sampler.  Although it's currently
the texture unit, this series will change that.  No need for the churn.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke bf0308d8d6 i965/fs: Remove unused 'sampler' parameter in emit_texture_genX().
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke 76d1301e8e i965: Set SWIZZLE_NOOP for unused texture units in the program keys.
Previously, we left the swizzle key field as zero for unused texture
units.  The precompile sets all of them to SWIZZLE_NOOP, which meant
that we mismatched almost every time.

Since either works equally well, change it to SWIZZLE_NOOP to match
the precompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke f510dd5d60 i965: Remove four and a half year old TODO comments about samplers.
I can't actually understand what these mean, and they seem to
essentially say "we should simplify things", which is a nice goal but
not very specific.

Presumably things got cleaned up at some point.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Kenneth Graunke d1447f5bc9 i965: Fix brw_link_shader to return false rather than NULL.
Fixes brw_shader.cpp:101:9: warning: converting to non-pointer type
'GLboolean {aka unsigned char}' from NULL [-Wconversion-null]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-with-great-enthusiasm-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by Eric Anholt <eric@anholt.net>
2012-08-25 12:01:09 -07:00
Ian Romanick f9767dac9a mesa/es: Validate glGetBufferParameteriv pname in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:15:20 -07:00
Ian Romanick 93d109645a mesa/es: Validate glMapBuffer access in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

v3: *Really* add proper core-profile and GLES3 filtering based on review
feedback from Eric Anholt.  It looks like previously there was some
rebase / merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick bd4e5dd355 mesa/es: Validate glBufferData usage in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering based on review feedback
from Eric Anholt.  It looks like previously there was some rebase /
merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick b0b6b76d52 mesa/es: Validate buffer object targets in Mesa code rather than the ES wrapper
v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 19:13:18 -07:00
Ian Romanick e2cf14d7b2 mesa/es: Validate VertexPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick ef723ecce4 mesa/es: Remove redundant vertex pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick a8f475d8f6 mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick c3e9a207d0 mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick e5ef0cbe0e mesa/es: Validate NormalPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:18 -07:00
Ian Romanick fb8218508a mesa/es: Validate ColorPointer size in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick 07ccfef8d1 mesa/es: Validate ColorPointer types in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick 28ee443d7b mesa/es: Remove redundant vertex attrib pointer type validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick ae633d0b2e mesa/es: Remove redundant vertex attrib pointer size validation
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick 946ddec163 mesa/es: Disallow BGRA vertex arrays in ES or ES2 contexts
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 19:13:17 -07:00
Ian Romanick bbceed268e mesa: Rearrange array type checking, filter more types in ES
v2: Fix handling of GL_INT and GL_UNSIGNED_INT types pre-ES3.0, and fix
handling of GL_INT_2_10_10_10_REV and GL_UNSIGNED_INT_2_10_10_10_REV in
ES3.0.  Based on review comments by Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-08-24 19:13:17 -07:00
Ian Romanick a33f360e8f mesa: Refactor element type checking into its own function
This consolidates the tests and makes the emitted error message
consistent.

v2: Rename _mesa_valid_element_type to valid_elements_type.  Log the
enum string instead of the hex value in error messages.  Based on review
comments from Brian Paul and Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-08-24 19:13:12 -07:00
Brian Paul 229868edf7 wgl: update some comments 2012-08-24 14:09:03 -06:00
Brian Paul 4b7c0938e4 st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures
As with the previous commit for core Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul a3af27e993 mesa: add generic compressed -> uncompressed format helper
_mesa_generic_compressed_format_to_uncompressed_format() probably wins the
prize for longest function name in Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul 13d0bb21a9 mesa: don't try (generic) compression of 1D and 1D_ARRAY textures
See comments in the code for details.

Note: we only need to special-case the generic compressed formats since
specific texture formats are error-checked earlier to see if the compression
format is compatible with the texture type.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2012-08-24 14:09:03 -06:00
Brian Paul d47a6ada9c mesa: add texture target field to ChooseTextureFormat() driver hook
This will let us choose the actual hardware format depending on the
type of texture.

v2: fixup radeon, nouveau, intel and swrast drivers too

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-08-24 14:08:57 -06:00
Brian Paul ba7218061b xlib: remove texture compression hackery
I think this was left-over debug code from long ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 13:15:27 -06:00
Brian Paul 09fafd3b85 st/mesa: clean up use of 'target' variable in st_context_teximage()
'target' was used both as a parameter of type st_texture_type and then
re-used for GL_TEXTURE_x targets.  Rename the function parameter and
add a new local 'GLenum target'.

And remove an extraneous break statement.
2012-08-24 13:15:27 -06:00
Matt Turner 261719b21c automake: convert vgapi 2012-08-24 11:08:19 -07:00
Matt Turner ba4a36d8cd build: Check for bison-generated file before bailing because of no bison
.y/.c was a typo.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner 179d8aa331 Move _mesa_dl* functions into dlopen.h and inline them
No point in having an extra function call for inlinable functions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Tapani Pälli 57c57df7b4 mesa/dlopen: use HAVE_DLOPEN instead of _GNU_SOURCE
Patches changes mesa to use 'HAVE_DLOPEN' defined by configure and Android.mk
instead of _GNU_SOURCE for detecting dlopen capability. This makes dlopen to
work also on Android where _GNU_SOURCE is not defined.

[mattst88] v2: HAVE_DLOPEN is sufficient for including dlfcn.h, remove
	       mingw/blrts checks around dlfcn.h inclusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
2012-08-24 11:08:19 -07:00
Matt Turner df4dccc7a9 build: Only add links to .so files if we're building them
Xlib-GLX and OSMesa support static building.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53962
2012-08-24 11:08:19 -07:00
Matt Turner c56b57f4a1 build: Add libOSMesa.so.$(VERSION) link to libdir 2012-08-24 11:08:19 -07:00
Matt Turner a8fd8cb9e7 build: Replace OSMESA_VERSION with generic VERSION_NUMBER
Can be used by other modules.
2012-08-24 11:08:19 -07:00
Matt Turner 383a70bf9a build: Order AC_CONFIG_FILES list
Makefiles before .pc files before directories. Alphabetize files of the
same type.
2012-08-24 11:08:19 -07:00
Matt Turner 8cdce6c136 build: Only build libmesa.la when needed
Namely, for Xlib-GLX, OSMesa, or test programs.
2012-08-24 11:08:19 -07:00
Matt Turner 00f3d9b11a build: Remove duplicate DRI automake conditionals 2012-08-24 11:08:19 -07:00
Matt Turner d23b1b7977 build: Remove GLU_DIRS 2012-08-24 11:08:19 -07:00
Matt Turner 0abb26ebff build: Only generate dispatch assembly code that will be built 2012-08-24 11:08:19 -07:00
Paul Berry 5133bd6585 i965: don't clear resolve map when doing fast depth clears.
Previously, when performing a fast depth clear, we would also clear
the miptree's resolve map.  This destroyed important information,
since the resolve map contains information about needed resolves for
all levels and layers of the miptree, whereas a depth clear only
applies to a single level/layer combination at a time.  As a result,
resolves would sometimes fail to occur, leading to incorrect
rendering.

Fixes rendering artifacts with shadow maps in Unigine Heaven and
Unigine Sanctuary.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50270

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-08-24 09:59:27 -07:00