Commit Graph

55135 Commits

Author SHA1 Message Date
Paul Berry d5948f2f5e glsl: Allow default precision qualifiers to be set for sampler types.
From GLSL ES 3.00 section 4.5.4 ("Default Precision Qualifiers"):

    "The precision statement

        precision precision-qualifier type;

    can be used to establish a default precision qualifier. The type
    field can be either int or float or any of the sampler types, and
    the precision-qualifier can be lowp, mediump, or highp."

GLSL ES 1.00 has similar language.  GLSL 1.30 doesn't allow precision
qualifiers on sampler types, but this seems like an oversight (since
the intention of including these in GLSL 1.30 is to allow
compatibility with ES shaders).

Previously, Mesa followed GLSL 1.30 and only allowed default precision
qualifiers to be set for float and int.  This patch makes it follow
GLSL ES rules in all cases.

Fixes Piglit tests default-precision-sampler.{vert,frag}.

Partially addresses https://bugs.freedesktop.org/show_bug.cgi?id=60737.

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-13 07:57:58 -08:00
Marek Olšák 60aa5f360a st/mesa: fix texture buffer objects
Broken by 624528834f.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-13 16:38:19 +01:00
Kenneth Graunke 8cabe26f5d i965: Use derived state for Haswell's 3DSTATE_VF packet.
Otherwise, we fail to correctly handle GL_PRIMITIVE_RESTART_FIXED_INDEX.

Fixes gles3conform's primitive_restart_mode test.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-12 20:24:28 -08:00
Marek Olšák ea63491629 st/mesa: accelerate glGetTexImage for all formats using a blit
This commit allows using glGetTexImage during rendering and still
maintain interactive framerates.

This improves performance of WarCraft 3 under Wine. The framerate is improved
from 25 fps to 39 fps in the main menu, and from 0.5 fps to 32 fps in the game.

v2: fix choosing the format for decompression
2013-02-13 02:13:10 +01:00
Marek Olšák cd41833b44 gallium: add red-alpha texture formats and a couple of util functions
This is for glGetTexImage and it will be used for samplers only (which some
drivers already implement by reading util_format_description).

v2: incorporate Brian's suggestion

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-13 02:13:10 +01:00
Jerome Glisse 974b482aca r600g: fix lockup when hyperz & alpha test are enabled together. v3
Seems that alpha test being enabled confuse the GPU on the order in
which it should perform the Z testing. So force the order programmed
throught db shader control.

v2: Only force z order when alpha test is enabled
v3: Update db shader when binding new dsa + spelling fix

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
2013-02-12 17:03:56 -05:00
Jordan Justen 496928a442 CopyTexImage: Don't check sRGB vs LINEAR for desktop GL
In OpenGL 4.3, new language was added that would require
this check. But, if this check results in broken applications
then perhaps it will be reversed.

For now, remove this check and re-evaluate when
desktop GL 4.3 is closer.

NOTE: This is a candidate for the 9.1 branch.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2013-02-12 11:22:49 -08:00
Christian König 8c80894fb3 radeonsi: remove constant index limitation v3
With the llvm patches, fixing 14 piglit tests in total.

v2: increase the const limit
v3: document the const limit

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-12 18:57:12 +01:00
Christian König 8514f5ac01 radeonsi: support constants as TEX coordinates
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-12 18:57:12 +01:00
Paul Berry f8426eea35 glsl: Fix unsupported version error for GLSL ES 3.00, future proof for 3.30.
When the user specifies an unsupported GLSL version,
_mesa_glsl_parse_state::process_version_directive() nicely gives them
an error message telling them which GLSL versions are supported.
Previous to this patch, the logic for determining whether a given
language version was supported was independent from the logic to
generate this error message string; as a result, we had a bug where
GLSL 3.00 would never be listed in the error message as an available
language version, even if it was really available.

To make matters worse, the code for generating the error message
string assumed that desktop GL versions were always separated by 0.10,
an assumption that will be wrong as soon as we support GLSL 3.30.

This patch fixes both problems by adding a table of supported GLSL
versions to _mesa_glsl_parse_state; this table is used both to
generate the error message and to check whether a given version is
supported.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-02-12 08:06:35 -08:00
Roland Scheidegger 9870459522 gallium/docs: fix typos in sample opcode descriptions 2013-02-12 16:51:11 +01:00
Roland Scheidegger 2947f00bc4 nv50: fix bogus parameters when processing sample instructions
Discovered accidentally when changing SAMPLE_L definition.
Turns out the lod arguments were already correct for the new definition
but the compare and derivs were not.

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
2013-02-12 16:51:11 +01:00
Roland Scheidegger 427d36a227 gallium: fix tgsi SAMPLE_L opcode to use separate source for explicit lod
It looks like using coord.w as explicit lod value is a mistake, most likely
because some dx10 docs had it specified that way. Seems this was changed though:
http://msdn.microsoft.com/en-us/library/windows/desktop/hh447229%28v=vs.85%29.aspx
- let's just hope it doesn't depend on runtime build version or something.
Not only would this need translation (so go against the stated goal these
opcodes should be close to dx10 semantics) but it would prevent usage of this
opcode with cube arrays, which is apparently possible:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb509699%28v=vs.85%29.aspx
(Note not only does this show cube arrays using explicit lod, but also the
confusion with this opcode: it lists an explicit lod parameter value, but then
states last component of location is used as lod).
(For "true" hw drivers, only nv50 had code to handle it, and it appears the
code was already right for the new semantics, though fix up the seemingly
wrong c/d arguments while there.)

v2: fix comment, separate out other changes.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-12 16:51:11 +01:00
Brian Paul 4bfdef87e6 util: fix incorrect Z bit masking in util_clear_depth_stencil()
For PIPE_FORMAT_Z24_UNORM_S8_UINT, the Z bits are in the 24
least significant bits.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=60527
and http://bugs.freedesktop.org/show_bug.cgi?id=60524
and http://bugs.freedesktop.org/show_bug.cgi?id=60047

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2013-02-12 08:11:05 -07:00
Matt Turner a79ce0c925 radeon: Remove dead STANDALONE_MMIO defines
These were, at some point in the past, used to request that Xorg's
compiler.h export a static inline xf86ReadMmio32 instead of a function
pointer. compiler.h only has this option for DEC Alpha.

But Xorg's compiler.h isn't being included by either of these two files
and the radeon driver still works on Alpha, so the definitions are dead
and not needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-11 23:18:11 -08:00
Roland Scheidegger 8b8bca06df llvmpipe: implement dual source blending
link up the fs outputs and blend inputs, and make sure the second blend source
is correctly loaded and converted (which is quite complex).
There's a slight refactoring of the monster generate_unswizzled_blend()
function where it makes sense to factor out alpha conversion (which needs
to run twice for dual source blend).
This passes piglit arb_blend_func_extended tests.

v2: remove new but ultimately not used function...

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-12 03:41:48 +01:00
Kenneth Graunke a73181be6d docs: Mark a few things done in GL3.txt. 2013-02-11 15:55:29 -08:00
Kenneth Graunke 3d7c09e8b0 i965: Add missing dirty bits to INTEL_DEBUG=state arrays.
These are more recent additions, and no one remembered to update the
INTEL_DEBUG=state code.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-11 15:54:10 -08:00
Kenneth Graunke b9c5997bb3 i965: Reorganize brw_bits to match the order in brw_context.h.
This reorders the "brw_bits" array in brw_state_upload.c to match the
order of the #defines in brw_context.h.

Otherwise, it's really hard to see if any are missing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-11 15:54:07 -08:00
Kenneth Graunke 0ac6d5a7fb i965: Use BRW_NEW_CONTEXT for gen7_disable rather than BRW_NEW_BATCH.
These don't need to be re-disabled on every batch if we're using
hardware contexts.  (If we're not, this is equivalent.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2013-02-11 15:54:01 -08:00
Jerome Glisse 323a448825 r600g: make sure async blit is done 8 * pitch at a time v2
The blit must be aligned on 8 horizontal block.

v2: no need to align the reminder

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2013-02-11 18:44:18 -05:00
Martin Andersson a37835c8ed winsys/radeon: fix bo with virtual address referencing mismatch
If the same context try to flink and open the object, use the
same bo struct instead of opening a new gem handle for the object.
This way we avoid avoid having 2 different handle pointing to the
same kernel object which can latter lead to trouble with virtual
address.

Fix:
https://bugs.freedesktop.org/show_bug.cgi?id=60200

Signed-off-by: Martin Andersson <g02maran@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2013-02-11 18:38:00 -05:00
Eric Anholt e776b632c0 vbo: Merge GL_QUADS drawing requests in display lists.
minecraft apparently has its piles of display lists each contain 6
instances of glBegin(GL_QUADS)/verts/glEnd(), which appear in the
compiled list as 6 prims of 4 verts each in one draw call.  We can
reduce driver overhead even more by making that one prim of 24 verts.

Improves minecraft performance by 1.6% +/- .25% (n=446)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-02-11 13:14:52 -08:00
Eric Anholt 50202f0961 vbo: Print display list debug using printf() like dlist.c does.
Otherwise, the stderr and stdout debug end up interleaved wrong
when I pipe them to a file.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2013-02-11 13:14:51 -08:00
Eric Anholt b9a66da258 i965: Remove some stale comments about the brw_constant_buffer atom.
These have been wrong since f428255bde
back in 2009!

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-11 13:14:51 -08:00
Eric Anholt e07457d0ae i965: Simplify VS push constant upload code since removal of old path.
We used to have clip planes optionally included in the push constants,
resulting in a variable amount of data uploaded, but no more.  This also
means less wasted space in the batch for our push constants.

v2: Update _NEW_TRANSFORM state bit information.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
2013-02-11 13:14:51 -08:00
Eric Anholt 11766b1bbb i965: Add perf debug for a corner case.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-11 13:14:51 -08:00
Eric Anholt 936a3ca6fd i965: Fix access mode of index buffer rebase.
It doesn't matter with our current implementation of MapBufferRange,
but it was wrong -- the result pointer is read by intel_upload_data().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-11 13:14:51 -08:00
Eric Anholt 016928b163 i965: Fix indentation of index buffer rebase code.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-11 13:14:51 -08:00
Marek Olšák cb6470775c mesa: fix GetTexImage if mesa format and internal format don't match
Tested with softpipe only exposing RGBA formats.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Marek Olšák c8379204ab mesa: don't use memcpy fast path for GetTexImage if base format is different
The Mesa format can be RGBA8888_REV, the format/type can be
GL_RGBA/GL_UNSIGNED_BYTE, but the actual texture internal format can be
LUMINANCE_ALPHA, INTENSITY, etc. Therefore we should look at the base
internal format as well.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Marek Olšák 09a99867ab mesa: don't use _mesa_base_tex_format for format parameter of GetTexImage
_mesa_base_tex_format doesn't accept GL_BGR and GL_ABGR_EXT, etc.

v2: add a (now hopefully complete) helper function to deal with this

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Marek Olšák 5587c8619a mesa: adjust usage of swapBytes/littleEndian in format_matches_format_and_type
- swapBytes has no effect on 8-bit single-component formats
- GL_SHORT is in host byte order, so checking for littleEndian is unnecessary,
  I decided to make the change for single-component formats only

Based on suggestions from Michel Dänzer.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-11 19:43:01 +01:00
Marek Olšák dcdffaaf43 mesa: remove per-format memcpy codepaths from texstore functions
It's obsoleted by the common function _mesa_texstore_memcpy.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Marek Olšák 4bf27ed7ed mesa: implement common texstore memcpy function for all formats
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Marek Olšák 967b21df6a mesa: fill in Z32_FLOAT_X24S8 in _mesa_format_matches_format_and_type
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Marek Olšák a0510fa773 mesa: fill in signed cases and RGBA16 in _mesa_format_matches_format_and_type
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-11 19:43:01 +01:00
Marek Olšák a0fb71888f mesa: fill in INT/UINT format cases in _mesa_format_matches_format_and_type
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-11 19:43:01 +01:00
Marek Olšák 43395da55a mesa: fill in YCBCR cases in _mesa_format_matches_format_and_type
based on the texstore code

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
2013-02-11 19:43:01 +01:00
Marek Olšák 87f94e6f80 mesa: fill in SRGB cases in _mesa_format_matches_format_and_type
Texstore takes the same codepath as the corresponding linear formats.

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 19:43:01 +01:00
Adhemerval Zanella 1ab2c55bf4 llvmpipe: fix vertex_header mask store in big-endian
This patch fixes the vertex_header mask bitfield store in big-endian
architectures by bit-swap the fields accordingly.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-02-11 13:41:28 -05:00
Adhemerval Zanella a8016b2f60 llvmpipe: remove lp_swizzled_cbuf
Ununsed since 75da95c5.

Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-02-11 13:41:28 -05:00
Andreas Boll 44a5d7371c docs: document removal of makedepend build dependency
Build dependency removed with
424f200881

Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-02-11 18:11:20 +01:00
Andreas Boll d59bd61445 docs: update making a new mesa release info
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 10:58:33 +01:00
Andreas Boll ab10d2d8a5 docs: use proper title for index.html
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 10:58:33 +01:00
Andreas Boll bf9e19d308 docs: mention some other supported APIs
v2: add ES3

Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
2013-02-11 10:58:33 +01:00
Andreas Boll babc638c72 docs: update sourcetree
glsl directory is located in src and not in src/egl

v2: remove ppc, move glapi from src/mesa to src/mapi

Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 10:58:33 +01:00
Andreas Boll dbbe108951 docs: replace CVS with git
Reviewed-by: Brian Paul <brianp@vmware.com>
2013-02-11 10:58:33 +01:00
Vinson Lee 990bd49fba configure.ac: Do not check for rt on Mac OS X.
There is no rt library on Mac OS X.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58872
Acked-by: Matt Turner <mattst88@gmail.com>
2013-02-09 15:21:08 -08:00
Ian Romanick 0e2f26d5ea intel: Do not expose OES_compressed_ETC1_RGB8_texture or ARB_texture_rgb10_a2ui pre-GEN4
Older hardware cannot do ARB_texture_rgb10_a2ui, and the translation
code for OES_compressed_ETC1_RGB8_texture was never implemented in the
i915 driver.

NOTE: This is a candidate for all stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-02-08 19:28:53 -08:00