Vinson Lee [Wed, 7 Nov 2012 07:37:20 +0000 (23:37 -0800)]
i965: Fix assertion in brw_alu3.
Fixes side effect in assertion defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Jonas Ådahl [Sat, 27 Oct 2012 22:50:12 +0000 (00:50 +0200)]
wayland: Destroy frame callback when destroying surface
If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.
This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().
Note: This is a candidate for stable branches.
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Alex Deucher [Wed, 7 Nov 2012 16:30:45 +0000 (11:30 -0500)]
r600g/compute: fix call to r600_bytecode_init
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Kenneth Graunke [Tue, 16 Oct 2012 18:45:00 +0000 (11:45 -0700)]
mesa: Remove PROG_EMIT_VERTEX and PROG_END_PRIMITIVE opcodes.
These were only used for geometry shader support back in the days before
the new GLSL compiler. Future geometry shader support will not use
these.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Vinson Lee [Tue, 6 Nov 2012 06:27:41 +0000 (22:27 -0800)]
svga: Ensure vb_transfer in svga_swtnl_draw_vbo in initialized.
Fixes a uninitialized pointer read defect reported by Coverity.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Vinson Lee [Wed, 7 Nov 2012 07:16:29 +0000 (23:16 -0800)]
scons: Build src/mesa/main/es1_conversion.c for all builds.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Fredrik Höglund [Tue, 6 Nov 2012 16:36:34 +0000 (17:36 +0100)]
egl_dri2/x11: Fix eglPostSubBufferNV()
This got broken in commit
0a523a8820e8a2549ac1c7887eb1892b228af44b.
NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
Paul Berry [Wed, 31 Oct 2012 21:13:16 +0000 (14:13 -0700)]
dispatch: Delete unused init_dispatch functions.
The new code-generated version of _mesa_create_exec_table() populates
the entire dispatch table (except for dynamic functions) by itself; it
no longer calls separate functions to initialize parts of the dispatch
table. This patch removes those no-longer-needed functions.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Wed, 31 Oct 2012 17:42:08 +0000 (10:42 -0700)]
dispatch: Code generate api_exec.c.
This patch adjusts makefiles to cause src/mesa/main/api_exec.c to be
generated using src/mapi/glapi/gen/gl_genexec.py. There should be no
functional change.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 23:21:18 +0000 (16:21 -0700)]
glapi/gen: Add code generation script for _mesa_create_exec_table().
This script generates the file api_exec.c, which contains just the
function _mesa_create_exec_table(), based on the XML files in
src/mapi/glapi/gen.
The following XML attributes, in particular, are used:
- "es1" indicates functions that should be available in ES1 contexts.
- "es2" indicates functions that should be available in ES2/ES3
contexts.
- "exec" indicates which Mesa function should be dispatched to. E.g.
if the GL function is glFoo(), then:
- exec="mesa" (the default) dispatches to _mesa_Foo().
- exec="check" dispatches to _check_Foo().
- exec="es" dispatches to _es_Foo().
- exec="loopback" dispatches to loopback_Foo().
- exec="skip" or exec="dynamic" causes this function to be skipped;
either it is not yet supported ("skip"), or its dispatch table
entry will be dynamically populated based on GL state ("dynamic").
- "desktop" indicates functions that should be available in desktop GL
(non-ES) contexts.
- "deprecated" indicates functions that should not be available in
core contexts.
- "mesa_name" indicates functions whose implementation in Mesa has a
different suffix than the corresponding GL function name.
The generated code looks roughly like this (showing just a single
statement in each block for brevity):
struct _glapi_table *
_mesa_create_exec_table(struct gl_context *ctx)
{
struct _glapi_table *exec;
exec = _mesa_alloc_dispatch_table(_gloffset_COUNT);
if (exec == NULL)
return NULL;
if (_mesa_is_desktop_gl(ctx)) {
SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_BeginQueryARB(exec, _mesa_BeginQueryARB);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES) {
SET_GetPointerv(exec, _mesa_GetPointerv);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) {
SET_ActiveTextureARB(exec, _mesa_ActiveTextureARB);
/* other functions not shown */
}
if (_mesa_is_desktop_gl(ctx) || ctx->API == API_OPENGLES2) {
SET_AttachShader(exec, _mesa_AttachShader);
/* other functions not shown */
}
if (ctx->API == API_OPENGL) {
SET_Accum(exec, _mesa_Accum);
/* other functions not shown */
}
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
SET_AlphaFunc(exec, _mesa_AlphaFunc);
/* other functions not shown */
}
if (ctx->API == API_OPENGLES) {
SET_AlphaFuncxOES(exec, _es_AlphaFuncx);
/* other functions not shown */
}
return exec;
}
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 23:21:18 +0000 (16:21 -0700)]
glapi/gen: handle new XML attributes.
This patch updates gl_XML.py to parse the new XML attributes "exec",
"desktop", "deprecated", and "mesa_name", which will be needed to code
generate _mesa_create_exec_table().
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Tue, 30 Oct 2012 23:21:18 +0000 (16:21 -0700)]
glapi/gen: Gather API version info across aliased functions.
gl_XML.py's gl_function class keeps track of an entry_point_api_map
property that tracks, for each set of aliased functions, which ES1 or
ES2 version the given function name first appeared in.
This patch aggregates that information together across aliased
functions, into an easier-to-use api_map property.
Future patches will use this information when code generating
_mesa_create_exec_table(), to determine which set of dispatch table
entries should be populated based on the API.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Wed, 31 Oct 2012 17:20:58 +0000 (10:20 -0700)]
glapi/gen: Comment fix.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 16:47:11 +0000 (09:47 -0700)]
dispatch: Make all API functions non-static.
Some of the functions that we store in the dispatch table are declared
as non-static in their .c files and are inserted into the dispatch
table directly by _mesa_create_exec_table(). Other functions are
declared as static, and are inserted into the dispatch table by a
dedicated function that lives in the same .c file
(e.g. _mesa_loopback_init_api_table() in api_loopback.c).
This patch makes all of these functions non-static, and creates
appropriate prototypes for them, so that in future patches we can
populate the entire dispatch table using a single code-generated
function.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 05:12:18 +0000 (22:12 -0700)]
glapi: Annotate XML with function name suffix anomalies.
When the XML lists one or more GL api functions as aliases for another
GL function, the mesa function that implements the functionality is
usually named after the canonical version of the function (the one
that is the target of the aliases). For example, FogCoordd is listed
as an alias of FogCoorddEXT, and the Mesa function implementing the
functionality is called loopback_FogCoorddEXT.
However, there are exceptions. For example, Enablei is listed as an
alias of EnableIndexedEXT, but the Mesa function implementing the
functionality is called _mesa_EnableIndexed.
To account for these anomalies, this patch annotates the XML with
"mesa_name" attributes, which describe how to adjust the function name
to find the corresponding Mesa function.
For example:
<function name="EnableIndexedEXT" mesa_name="-EXT">...</function>
<function name="IsProgramNV" mesa_name="-NV+ARB">...</function>
means that EnableIndexedEXT is implemented by a Mesa function called
_mesa_EnableIndexed, and IsProgramNV is implemented by a Mesa function
called _mesa_IsProgramARB.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine the name of the Mesa function
that should be stored in each dispatch table entry.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 04:00:25 +0000 (21:00 -0700)]
glapi: Annotate XML with desktop="false" for GLES-only functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped when the API is desktop GL.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Mon, 22 Oct 2012 23:49:24 +0000 (16:49 -0700)]
glapi: Annotate XML with exec="{es,check}" for special GLES1 functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to ES-specific implementations. exec="es" indicates that
the ES-specific implementation has a name beginning with "_es_"
(e.g. _es_QueryMatrixxOES), and exec="check" indicates that the
ES-specific implementation has a name beginning with "_check_"
(e.g. _check_GetTexGenxvOES).
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 05:13:14 +0000 (22:13 -0700)]
glapi: Annotate XML with exec="loopback" for loopback functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
dispatched to functions in api_loopback.c.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 03:58:29 +0000 (20:58 -0700)]
glapi: Annotate XML with exec="dynamic" for dynamic functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because Mesa dispatches them differently depending on GL
state.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 03:53:11 +0000 (20:53 -0700)]
glapi: Annotate XML with exec="skip" for unimplemented functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped because they aren't implemented by Mesa.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Mon, 15 Oct 2012 17:52:13 +0000 (10:52 -0700)]
glapi: Annotate XML with deprecated="3.1" for deprecated functions.
Future patches will use this annotation when code generating
_mesa_create_exec_table(), to determine which functions should be
skipped in core contexts.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Fri, 19 Oct 2012 04:00:50 +0000 (21:00 -0700)]
glapi: Mark GLX extensions as window_system="glX".
We were already doing this for some GLX extensions, but not others.
This patch makes our use of window_system="glX" consistent.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Paul Berry [Wed, 17 Oct 2012 20:24:37 +0000 (13:24 -0700)]
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>
Paul Berry [Tue, 30 Oct 2012 21:03:28 +0000 (14:03 -0700)]
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>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
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>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix MSVC signed/unsigned warnings in context.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix MSVC signed/unsigned warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
swrast: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
tnl: fix MSVC signed/unsigned warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: silence MSVC signed/unsigned warning in texgetmage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: silence MSVC signed/unsigned warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
vbo: use GLuint for numInstances to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix signed/unsigned MSVC warnings in fbobject.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: s/GLint/GLuint/ in matrix.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: s/int/GLuint/ in get.c to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
mesa: fix assorted MSVC conversion warnings in format_pack.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
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>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
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>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: fix signed/unsigned comparision warnings on MSVC
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: remove incorrect 'struct' keyword
ir_variable is a class, not a struct. Fixes an MSVC warning.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: add 'f' suffix to floats to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Brian Paul [Sun, 4 Nov 2012 23:43:44 +0000 (16:43 -0700)]
glsl: change int->unsigned to silence MSVC warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Vinson Lee [Tue, 6 Nov 2012 06:00:01 +0000 (22:00 -0800)]
scons: Require libdrm_radeon 2.4.40.
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Marek Olšák [Tue, 2 Oct 2012 20:02:54 +0000 (22:02 +0200)]
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>
Marek Olšák [Tue, 6 Nov 2012 01:35:35 +0000 (02:35 +0100)]
configure.ac: require libdrm_radeon 2.4.40
Marek Olšák [Tue, 30 Oct 2012 13:44:22 +0000 (14:44 +0100)]
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
Anuj Phogat [Fri, 2 Nov 2012 18:18:16 +0000 (11:18 -0700)]
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>
Anuj Phogat [Fri, 2 Nov 2012 17:47:33 +0000 (10:47 -0700)]
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>
José Fonseca [Mon, 5 Nov 2012 11:18:07 +0000 (11:18 +0000)]
trace: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
José Fonseca [Mon, 5 Nov 2012 11:05:34 +0000 (11:05 +0000)]
galahad: Prevent segfault when passing NULL to set_vertex_buffers.
State tracker now passes NULL buffer array to unbind buffers.
José Fonseca [Fri, 2 Nov 2012 16:56:30 +0000 (16:56 +0000)]
util: Make u_framebuffer.h C++ safe.
Eric Anholt [Wed, 31 Oct 2012 22:37:59 +0000 (15:37 -0700)]
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>
Eric Anholt [Wed, 31 Oct 2012 22:36:27 +0000 (15:36 -0700)]
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>
Eric Anholt [Wed, 31 Oct 2012 22:33:41 +0000 (15:33 -0700)]
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>
Vandrus Zoltán [Wed, 31 Oct 2012 20:11:45 +0000 (13:11 -0700)]
i965: Fix oversized initial allocation of the state cache table pointers.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55030
Eric Anholt [Thu, 1 Nov 2012 17:37:56 +0000 (10:37 -0700)]
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>
Eric Anholt [Wed, 31 Oct 2012 20:39:26 +0000 (13:39 -0700)]
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>
Eric Anholt [Wed, 31 Oct 2012 20:36:16 +0000 (13:36 -0700)]
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>
Eric Anholt [Wed, 31 Oct 2012 20:56:56 +0000 (13:56 -0700)]
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>
Eric Anholt [Tue, 30 Oct 2012 22:02:23 +0000 (15:02 -0700)]
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>
Eric Anholt [Tue, 30 Oct 2012 21:38:41 +0000 (14:38 -0700)]
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>
Eric Anholt [Tue, 30 Oct 2012 23:10:14 +0000 (16:10 -0700)]
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>
Lucas Stach [Wed, 31 Oct 2012 15:31:12 +0000 (16:31 +0100)]
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.
Kenneth Graunke [Fri, 2 Nov 2012 05:04:50 +0000 (22:04 -0700)]
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>
Jordan Justen [Wed, 24 Oct 2012 16:25:52 +0000 (09:25 -0700)]
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>
Jordan Justen [Mon, 29 Oct 2012 23:06:03 +0000 (16:06 -0700)]
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>
Jordan Justen [Wed, 24 Oct 2012 01:00:11 +0000 (18:00 -0700)]
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>
Jordan Justen [Wed, 17 Oct 2012 03:50:03 +0000 (20:50 -0700)]
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>
Jordan Justen [Wed, 17 Oct 2012 03:44:40 +0000 (20:44 -0700)]
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>
Jordan Justen [Mon, 29 Oct 2012 17:47:19 +0000 (10:47 -0700)]
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>
Jordan Justen [Mon, 29 Oct 2012 17:45:44 +0000 (10:45 -0700)]
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>
Jordan Justen [Mon, 29 Oct 2012 17:37:50 +0000 (10:37 -0700)]
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>
Jordan Justen [Fri, 26 Oct 2012 22:38:23 +0000 (15:38 -0700)]
glapi: alias ProgramParameteriARB to ProgramParameteri
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Jordan Justen [Fri, 26 Oct 2012 22:36:45 +0000 (15:36 -0700)]
glapi: move include for ARB_get_program_binary.xml to gl_API.xml
These functions are part in GL 4.3. Moving this will allow
ProgramParameteriARB to alias ProgramParameteri.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Jordan Justen [Fri, 26 Oct 2012 22:33:13 +0000 (15:33 -0700)]
glapi: alias FramebufferTextureARB to FramebufferTexture
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Jordan Justen [Wed, 24 Oct 2012 01:13:32 +0000 (18:13 -0700)]
mesa shaderapi: don't enable various functions for GL CORE
These EXT_separate_shader_objects function will no longer be
enabled for CORE profiles:
* UseShaderProgramEXT
* ActiveProgramEXT
* CreateShaderProgramEXT
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Jordan Justen [Fri, 2 Nov 2012 23:05:25 +0000 (16:05 -0700)]
mesa api_exec: disable StencilFuncSeparateATI for API_OPENGL_CORE
This was mistakenly enabled in
a21116f.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Jordan Justen [Wed, 24 Oct 2012 16:19:56 +0000 (09:19 -0700)]
mesa api_exec: add comment regarding GetPointerv & CORE profiles
GetPointerv was de-deprecated in 893ddb.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Vincent Lejeune [Sat, 29 Sep 2012 14:49:13 +0000 (16:49 +0200)]
r600g: make tgsi-to-llvm generates store.pixel* intrinsic for fs
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Vincent Lejeune [Wed, 31 Oct 2012 20:02:29 +0000 (21:02 +0100)]
configure.ac: Prevent build of radeon llvm backend with llvm < 3.2
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
Thierry Reding [Fri, 2 Nov 2012 11:34:24 +0000 (12:34 +0100)]
android: Update for builtin_stubs.cpp move
This fixes the Android build after the move of builtin_stubs.cpp into
the builtin_compiler subdirectory. This patch is untested.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Michel Dänzer [Fri, 2 Nov 2012 16:11:27 +0000 (17:11 +0100)]
radeonsi: Implement support for vertex shader samplers.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Johannes Obermayr [Fri, 2 Nov 2012 11:30:22 +0000 (12:30 +0100)]
glsl: Fix builtin_compiler build by -I $(top_srcdir)/include.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56664
José Fonseca [Fri, 2 Nov 2012 09:42:13 +0000 (09:42 +0000)]
scons: Update for builtin_stubs.cpp
Note this by itself is not enough to fix scons build -- it will fail
until you remove:
rm -rf build/*/glsl/builtin_compiler
because that node was a filei before, but it will be now a directory.
This also means that bisecting across this change will require wiping
the build directory..
Thierry Reding [Fri, 19 Oct 2012 12:03:01 +0000 (14:03 +0200)]
build: Don't cross-compile GLSL builtin compiler
The builtin_compiler binary is used during the build process to generate
code for the builtin GLSL functions. Since this binary needs to be run
on the build host, it must not be cross-compiled.
This patch fixes the build system to compile a second version of the
source files and the builtin_compiler binary itself for the build
system. It does so by defining the CC_FOR_BUILD and CXX_FOR_BUILD
variables, which are searched for by the configure script and point to
the location of native C and C++ compilers.
In order for this to work properly, builtin_function.cpp is removed
from BUILT_SOURCES, otherwise the build system would try to generate it
before having had a chance to descend into the builtin_compiler
subdirectory. With the builtin_compiler and glsl_compiler now being
generated at different stages, the build instructions for glsl_compiler
can be simplified a bit.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Brian Paul [Thu, 1 Nov 2012 23:38:40 +0000 (17:38 -0600)]
libgl-xlib: include glheader.h instead of GL/gl.h to fix build
GL/gl.h doesn't define GLfixed but glapitable.h uses it.
Kenneth Graunke [Thu, 1 Nov 2012 23:12:56 +0000 (16:12 -0700)]
i965: Remove unused variables after removing the old VS backend.
Fixes compiler warnings about unused variables.
Kenneth Graunke [Fri, 26 Oct 2012 18:52:23 +0000 (11:52 -0700)]
i965: Remove unnecessary walk through Mesa IR in ProgramStringNotify().
Variable indexing of non-uniform arrays only exists in GLSL. Likewise,
OPCODE_CAL/OPCODE_RET only existed to try and support GLSL's function
calls. We don't use Mesa IR for GLSL, and these features are explicitly
disallowed by ARB_vertex_program/ARB_fragment_program and never
generated by ffvertex_prog.c.
Since they'll never happen, there's no need to check for them, which
saves us from walking through all the Mesa IR instructions.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 26 Oct 2012 18:15:07 +0000 (11:15 -0700)]
i965: Remove VS constant buffer read support from brw_eu_emit.c.
brw_vec4_emit.cpp implements this directly; only the old backend used
the brw_eu_emit.c code.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 26 Oct 2012 18:01:57 +0000 (11:01 -0700)]
i965: Update comment about clipper constants.
The old VS backend doesn't exist, but I believe these still need to be
delivered to the clipper thread.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 26 Oct 2012 17:58:04 +0000 (10:58 -0700)]
i965/vs: Remove brw_vs_compile::constant_map.
It was only used for the old backend.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 26 Oct 2012 17:51:02 +0000 (10:51 -0700)]
i965/vs: Remove support for the old parameter layout.
Only the old backend used it.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Fri, 26 Oct 2012 17:45:31 +0000 (10:45 -0700)]
i965/vs: Delete the old vertex shader backend.
It's no longer used for anything.
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Mon, 8 Oct 2012 17:21:30 +0000 (10:21 -0700)]
i965/vs: Replace brw_vs_emit.c with dumping code into the vec4_visitor.
Rather than having two separate backends, just create a small layer that
translates the subset of Mesa IR used for ARB_vertex_program and fixed
function programs to the Vec4 IR. This allows us to use the same
optimization passes, code generator, register allocator as for GLSL.
v2: Incorporate Eric's review comments.
- Fix use of uninitialized src_swiz[] values in the SWIZZLE_ZERO/ONE
case: just initialize it to 0 (.x) since the value doesn't matter
(those channels get writemasked out anyway).
- Properly reswizzle source register's swizzles, rather than overwriting
the swizzle.
- Port the old brw_vs_emit code for computing .x of the EXP2 opcode.
- Update comments, removing mention of NV_vertex_program, etc.
- Delete remaining #warning lines and debug comments.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Mon, 8 Oct 2012 17:45:08 +0000 (10:45 -0700)]
i965/vs: Refactor min/max handling to share code.
v2: Properly use "conditionalmod" pre-Gen6, rather than the incorrectly
copy-and-pasted "BRW_CONDITIONAL_G".
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Mon, 8 Oct 2012 17:26:13 +0000 (10:26 -0700)]
i965/vs: Add support for emitting DPH opcodes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Kenneth Graunke [Tue, 9 Oct 2012 17:19:16 +0000 (10:19 -0700)]
i965/vs: Only do INTEL_DEBUG=perf when there's a GLSL shader.
This will become necessary once we start supporting ARB programs and
fixed function in this backend.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Paul Berry [Tue, 23 Oct 2012 20:24:17 +0000 (13:24 -0700)]
dispatch: stop generating separate GLES1 API code.
This patch removes the generated files api_exec_es1.c,
api_exec_es1_dispatch.h, and api_exec_es1_remap_helper.h (and the
source files and build rules used to generate them), since they are no
longer used. GLES1 now uses the same dispatch table layout as all the
other APIs.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Paul Berry [Tue, 23 Oct 2012 21:48:39 +0000 (14:48 -0700)]
dispatch: stop using _mesa_create_exec_table_es1() for GLES1.
This patch modifies context creation code for GLES1 to use
_mesa_create_exec_table() (which is used for all other APIs) instead
of the GLES1-specific _mesa_create_exec_table_es1().
There is a slight change in functionality. As a result of a mistake
in the code generation of _mesa_create_exec_table_es1(), it does not
include glFlushMappedBufferRangeEXT or glMapBufferRangeEXT (this is
because when support for those two functions was added in commit
762d9ac, src/mesa/main/APIspec.xml wasn't updated). With this patch,
glFlushMappedBufferRangeEXT and glMapBufferRangeEXT are properly
included in the dispatch table. Accordingly, dispatch_sanity.cpp is
modified to expect these two functions to be present.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
v2: Leave GLES1.1 dispatch sanity test disabled when not building
GLES1 support.
Paul Berry [Fri, 19 Oct 2012 13:31:49 +0000 (06:31 -0700)]
dispatch: GLES1 fixes for _mesa_create_exec_table().
Currently, _mesa_create_exec_table() (in api_exec.c) is used for all
APIs except GLES1. In GLES1, _mesa_create_exec_table_es1() (a code
generated function) is used instead.
In principle, this shouldn't be necessary. It should be possible for
api_exec.c to contain the logic for populating the dispatch table for
all API's.
This patch paves the way for using _mesa_create_exec_table() instead
of _mesa_create_exec_table_es1(), by making _mesa_create_exec_table()
(and the functions it calls) expose the correct subset of desktop GL
functions for GLES1.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>