Commit Graph

53655 Commits

Author SHA1 Message Date
Paul Berry e70b1a1379 glapi: Use GL_ or GLX_ prefix for all category names.
This patch standardizes the category names used in the glapi XML files
to begin each extension name with the prefix "GL_" or "GLX_".  There
is no functional change, because these category names are not used in
the generated code.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:40 -08:00
Paul Berry 5708e27113 dispatch: Remove a few FEATURE_ES1 conditionals.
This allows the GLES1.1 dispatch sanity test to be run on all builds,
even builds that do not include GLES1 support.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2012-11-06 12:57:39 -08:00
Brian Paul 0d61f879a1 mesa: assert that key->fragprog_inputs_read value isn't too large
fragprog_inputs_read is a 12-bit bitfield so check the assigned value.
MSVC warns on the assignment.  Not easy to fix but let's do a sanity check.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 406df38a66 mesa: fix MSVC signed/unsigned warnings in context.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 27d70b7266 mesa: fix MSVC signed/unsigned warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 085d81c370 swrast: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul cb5fb15578 tnl: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 5c05d28a43 mesa: silence MSVC signed/unsigned warning in texgetmage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 0dddf592ed mesa: silence MSVC signed/unsigned warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 15cb1a9029 vbo: use GLuint for numInstances to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 859c387603 mesa: fix signed/unsigned MSVC warnings in fbobject.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul d4e18764c6 mesa: s/GLint/GLuint/ in matrix.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 49cea4d40c mesa: s/int/GLuint/ in get.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul cc6c887cca mesa: fix assorted MSVC conversion warnings in format_pack.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 75f2ccf3a2 st/mesa: change glsl_to_tgsi_visitor from class to struct
To match the declaration in the .h file and silence an MSVC warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 80b3dfa704 st/mesa: add int cast to silence warning
MSVC warns that negating an unsigned value yields an unsigned value.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul ab8c5347f1 glsl: fix signed/unsigned comparision warnings on MSVC
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul 78d3cfb5b4 glsl: remove incorrect 'struct' keyword
ir_variable is a class, not a struct.  Fixes an MSVC warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul e9dd5895dd glsl: add 'f' suffix to floats to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Brian Paul c3466315c0 glsl: change int->unsigned to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-11-06 07:42:37 -07:00
Vinson Lee e87a57843c scons: Require libdrm_radeon 2.4.40.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2012-11-05 22:00:01 -08:00
Marek Olšák 428e37c2da r600g: add in-place DB decompression and texturing with DB tiling
The decompression is done in-place and only the compressed tiles are
decompressed. Note: R6xx-R7xx can do that only with Z16 and Z32F.

The texture unit is programmed to use non-displayable tiling and depth
ordering of samples, so that it can fetch the texture in the native DB format.

The latest version of the libdrm surface allocator is required for stencil
texturing to work. The old one didn't create the mipmap tree correctly.
We need a separate mipmap tree for stencil, because the stencil mipmap
offsets are not really depth offsets/4.

There are still some known bugs, but this should save some memory and it also
improves performance a little bit in Lightsmark (especially with low
resolutions; tested with Radeon HD 5000).

The DB->CB copy is still used for transfers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-11-06 02:54:16 +01:00
Marek Olšák c80ceded6f configure.ac: require libdrm_radeon 2.4.40 2012-11-06 02:36:12 +01:00
Marek Olšák acf438f537 vbo: fix glVertexAttribI* functions
The functions were broken, because they converted ints to floats.
Now we can finally advertise OpenGL 3.0. ;)

In this commit, the vbo module also tracks the type for each attrib
in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT.

The little ugliness is the vertex attribs are declared as floats even though
there may be integer values. The code just copies integer values into them
without any conversion.

This implementation passes the glVertexAttribI piglit test which I am going
to commit in piglit soon. The test covers vertex arrays, immediate mode and
display lists.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: cosmetic changes as suggested by Brian
2012-11-06 01:13:48 +01:00
Anuj Phogat a196f43596 meta: Remove redundant code in _mesa_meta_GenerateMipmap
Integer textures generate invalid operation in glGenerateMipmap.
So, the code related to integer textures is now redundant.

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-05 10:17:48 -08:00
Anuj Phogat c0a78d7d7b mesa: Generate invalid operation in glGenerateMipMap for integer textures
Khronos has reached a conclusion and disallowed following texture formats in
glGenerateMipMap():
 (a) ASTC textures
 (b) integer internal formats (e.g., RGBA8UI, RG16I)
 (c) textures with stencil formats (e.g., STENCIL_INDEX8)
 (d) textures with packed depth/stencil formats (e.g, DEPTH24_STENCIL8)

https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9471

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-11-05 10:17:48 -08:00
José Fonseca 3700bd1158 trace: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
2012-11-05 11:18:07 +00:00
José Fonseca 99c45c5aa4 galahad: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
2012-11-05 11:05:34 +00:00
José Fonseca f1034e944b util: Make u_framebuffer.h C++ safe. 2012-11-05 10:39:42 +00:00
Eric Anholt ccbfe3dde9 mesa: Use "non-gen name" more consistently as an error message in GL core.
I used this to help verify that my test was actually testing the paths I
wanted to.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:46 -08:00
Eric Anholt 4fce0230fc mesa: Fix core GL genned-name handling for glBeginQuery().
Fixes piglit gl-3.1/genned-names.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:36 -08:00
Eric Anholt 947d8ff4a7 mesa: Fix the core GL genned-name handling for glBindBufferBase()/Range().
This is part of fixing gl-3.1/genned-names.

v2: Fix a missing return value.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-11-04 12:28:03 -08:00
Vandrus Zoltán 5ac46da588 i965: Fix oversized initial allocation of the state cache table pointers.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55030
2012-11-04 12:24:13 -08:00
Eric Anholt 3a937daf3f i965: Force border color A to 1 when it's not present in the GL format.
It's usually forced to 1 by the surface format, but sometimes we actually have
alpha present because it's the only format available.

Fixes piglit texwrap bordercolor tests for OpenGL 1.1, GL_EXT_texture_sRGB and
GL_ARB_texture_float.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 12:23:59 -08:00
Eric Anholt 1e08d5452e i965: Fix uploading user vertex arrays with basevertex set.
If the index buffer is full of values like "0 1 2 3", but basevertex is 4, we
need to upload at least vertex data for elements 4 5 6 7.  Whether we also
upload 0 1 2 3 is a question of whether there are VBOs present or not -- see
the code setting start_vertex_bias in brw_draw_upload.c.

Fixes piglit draw-elements*base-vertex user_varrays

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt 29a6307e12 i965: Set dirty state for brw_draw_upload.c when num_instances changes.
Otherwise, if we had a set of prims passed in with a num_instances varying
between them, we wouldn't upload enough (or too much!) from user vertex
arrays.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt 13170321f6 i965: Remove the vbo_rebase_prims() path.
The brw_draw_upload.c start_vertex_bias code has support for doing the rebase
without rewriting the index buffer by applying a basevertex.  It looks like
vbo_rebase_prims() is not equipped to handle basevertex.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt 9864a5b098 i965/fs: Fix a comment in copy propagation.
We haven't been only tracking raw GRF-GRF moves since the constant propagation
merge, and also the extension for source modifiers and uniforms.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt 545b59b62a i965/fs: Allow copy-propagation on pull constant load values.
Given that we handle similarly-regioned GRFs registers for our copy
propagation from our UNIFORM file, there's no reason not to allow it.

The shader-db impact is negligible -- +90 instructions total, 2 shaders helped
and 7 hurt (slightly increased register pressure increased spilling), but this
is to prevent regression in other shaders when fixing copy_propagation to
reduce register pressure in the shaders that are hurt here.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Eric Anholt cf26b4569a i965/fs: Do dead code elimination just after copy propagation.
If we put the register coalescing in between the two, then we end up with code
sequences involving dead writes that the dead code elimination doesn't know
how to remove.  In place of making dead code elimination smart (which we
should do, too), make it less important for the moment.

shader-db results:

total instructions in shared programs: 722240 -> 721275 (-0.13%)
instructions in affected programs:     50573 -> 49608 (-1.91%)

(no shaders regressed).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-04 11:15:44 -08:00
Lucas Stach d8988f048f nv50,nvc0: expose ARB_map_buffer_alignment
All HW buffers (also suballocated ones) are already aligned.
Just make sure that also the initial sysram buffers have proper
alignment.
2012-11-04 12:33:38 +01:00
Kenneth Graunke 05882b0d3b i965/fs: Compact the virtual GRF arrays.
During code generation, we create tons of temporary variables, many of
which get immediately killed and are never used.  Later optimization and
analysis passes, such as compute_live_intervals, loop over all the
virtual GRFs.  By compacting them, we can save a lot of overhead.

Reduces compilation time in L4D2's largest fragment shader from 10.2
seconds to 5.2 seconds (50%).  Drops compute_live_variables() from
10-12% of another game's startup time to 8%.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-03 20:28:57 -07:00
Jordan Justen e3542ea51b dispatch_sanity test: add GL CORE 3.1 test
The function list was generated from glcorearb.h for GL 4.3.

Note that many GL 4.X functions are commented out, and indicate
that they need to be added to Mesa's XML.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen 3b64f4b4fb dispatch_sanity test: create common context creation function
We also no longer call _swrast_CreateContext, _tnl_CreateContext
or _swsetup_CreateContext when creating the context.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen 83b6a7cdaa dispatch_sanity test: allow newer functions to be set to NOP
If a GL function was introduced in a later GL version than the
context we are testing, then it is okay if it is set to the
_mesa_generic_nop function.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen 7e64fe583f dispatch_sanity test: pass ctx to validate_functions/nops
This will allow validate_functions to access ctx->Version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen 2ad1b13508 dispatch_sanity test: add version to function list
This will be used by GL CORE contexts to differentiate functions that
can be set to nop from functions that are required for a particular
context version.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen 4d62cb64a5 mesa: remove unimplemented FramebufferTextureFaceARB
This function can be re-added with an actual implementation
when ARB_geometry_shader4 is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen f625cb580a mesa: remove unimplemented FramebufferTextureARB
This function can be re-added with an actual implementation
when ARB_geometry_shader4 is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00
Jordan Justen f862be0d7c mesa: disable ProgramParameteri until it is needed
ProgramParameteri will be required for ARB_geometry_shader4
or GLES3. Don't enable this function until either of those
is supported.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:41 -07:00