Commit Graph

47827 Commits

Author SHA1 Message Date
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
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 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
Jordan Justen 31c03f2f8c glapi: alias ProgramParameteriARB to ProgramParameteri
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 1c3a64793a 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>
2012-11-03 10:54:41 -07:00
Jordan Justen dd6660038e glapi: alias FramebufferTextureARB to FramebufferTexture
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
2012-11-03 10:54:40 -07:00
Jordan Justen 9e036966bb 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>
2012-11-03 10:54:40 -07:00
Jordan Justen 5ae8c9c0ca 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>
2012-11-03 10:54:40 -07:00
Jordan Justen 86d5c28580 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>
2012-11-03 10:54:40 -07:00
Vincent Lejeune 84b4372132 r600g: make tgsi-to-llvm generates store.pixel* intrinsic for fs
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-11-02 23:19:11 +01:00
Thierry Reding c0def90ede 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>
2012-11-02 10:37:03 -07:00
Michel Dänzer c5c3d2f933 radeonsi: Implement support for vertex shader samplers.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-11-02 18:27:18 +01:00
Johannes Obermayr ebf0a96250 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
2012-11-02 08:53:31 -07:00
José Fonseca 8ac4b82699 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..
2012-11-02 09:43:42 +00:00
Thierry Reding 9948a33653 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>
2012-11-01 18:18:21 -07:00
Brian Paul 8d3fb1be6b 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.
2012-11-01 17:38:42 -06:00
Kenneth Graunke df8a4001f5 i965: Remove unused variables after removing the old VS backend.
Fixes compiler warnings about unused variables.
2012-11-01 16:13:16 -07:00
Kenneth Graunke 60c008dde6 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>
2012-11-01 14:29:36 -07:00
Kenneth Graunke 109a97dbd2 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>
2012-11-01 14:29:34 -07:00
Kenneth Graunke 31c1ea5ed4 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>
2012-11-01 14:29:32 -07:00
Kenneth Graunke b68e662e61 i965/vs: Remove brw_vs_compile::constant_map.
It was only used for the old backend.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:30 -07:00
Kenneth Graunke ab973403e4 i965/vs: Remove support for the old parameter layout.
Only the old backend used it.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:29 -07:00
Kenneth Graunke 4b2457b548 i965/vs: Delete the old vertex shader backend.
It's no longer used for anything.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:26 -07:00
Kenneth Graunke 66c8473e02 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>
2012-11-01 14:29:23 -07:00
Kenneth Graunke 1f0093720d 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>
2012-11-01 14:29:21 -07:00
Kenneth Graunke fd8655aa7a i965/vs: Add support for emitting DPH opcodes.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-11-01 14:29:19 -07:00
Kenneth Graunke 6bc021bc78 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>
2012-11-01 14:29:12 -07:00
Paul Berry a8ab7e335d 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>
2012-11-01 11:26:30 -07:00
Paul Berry 8386088e3d 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.
2012-11-01 11:26:07 -07:00
Paul Berry a21116f87e 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>
2012-11-01 11:25:27 -07:00
Paul Berry 5a1b40acf5 dispatch: Make a header to go along with querymatrix.c.
This patch creates a header querymatrix.h, to allow functions defined
in querymatrix.c to be used from other .c files.  It also switches
from the nonstandard GL_APIENTRY to GLAPIENTRY.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Don't declare _mesa_Get{Integer,Float}v in querymatrix.c.
Instead, just include main/get.h.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:25:14 -07:00
Paul Berry b60244cfb9 dispatch: Add standard boilerplate and GL_APIENTRY to es1_conversion.h.
This patch adds the usual boilerplate (copyright notice and guards
against redundant inclusion) to es1_conversion.h.  It also moves the
definition of GL_APIENTRY from es1_conversion.c.

This allows es1_conversion.h to be safely included from other .c files.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Use copyright notice from src/mesa/main/es_generator.py (the
script that used to generate this file).
2012-11-01 11:24:57 -07:00
Paul Berry dd3218d73b dispatch: Include GLES1-only functions in dispatch table.
Previously dispatch table-related code was generated from gl_API.xml,
so it did not include slots for GLES1-only functions (such as those
taking fixed-point arguments).

This patch generates dispatch table-related code from
gl_and_es_API.xml, so that GLES1-only functions are included.  This
paves the way for future patches that will unify the GLES1 dispatch
table with the dispatch tables for the other APIs.

The following generated files are affected:
- glapi_x86.S
- glapi_x86-64.S
- glapi_sparc.S
- glprocs.h
- glapitemp.h
- glapitable.h
- glapi_gentable.c
- dispatch.h
- remap_helper.h

Since this change affects makefiles, a full rebuild is required.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

v2: Adjust dependencies to ensure that generated files will be rebuilt
whenever any ES-related XML source files are changed.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:23:22 -07:00
Paul Berry 571d5c353a dispatch: properly handle parameter name mismatches in glapitemp.h.
Previously, when code-generating aliased functions in glapitemp.h, we
weren't consistent about which function alias we used to obtain the
parameter names, with the risk that we would generate incorrect code
like this:

  KEYWORD1 void KEYWORD2 NAME(Foo)(GLint x)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFoo(%d);\n", x));
  }
  KEYWORD1 void KEYWORD2 NAME(FooEXT)(GLint y)
  {
    (void) x;
    DISPATCH(Foo, (x), (F, "glFooEXT(%d);\n", x));
  }

At the moment there are no aliased functions with mismatched parameter
names, so this isn't the problem.  But when we introduce GLES1
functions into the dispatch table, there will be
(MapBufferRange/MapBufferRangeEXT).  This patch paves the way for that
by fixing the code generation script to handle the mismatch correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:49 -07:00
Paul Berry 33e0004720 dispatch: Include glheader.h in dispatch-related files.
This ensures that GLES1-only typedefs are available in these files.
In a future patch, this will allow us to expand the dispatch table to
include GLES1-only functions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:24 -07:00
Paul Berry 47deaf6175 dispatch: Update check_table.cpp to reflect recent aliasing changes.
In commits bad96f6 and e7dd2e5 I added the following aliases:
- ClampColor -> ClampColorARB
- VertexAttribDivisor -> VertexAttribDivisorARB

But I neglected to update check_table.cpp, causing "make check" to
fail for non-shared-glapi builds.

This patch removes the functions that are now aliased from
check_table.cpp, so that "make check" works correctly again.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-11-01 11:22:09 -07:00
Eric Anholt 56f8ed4c35 i965/gen4: Fix assertion failures in depthstencil piglit tests.
Don't forget to set depth_mt even if !hiz_mt.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-11-01 09:22:09 -07:00
Kenneth Graunke b57d2dfbf6 i965: Add "alpha to coverage" to performance debug recompile messages.
This was missing and got labeled "Something else".

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-31 19:54:36 -07:00
Kenneth Graunke 369419e847 i965: Don't replicate data for zero-stride arrays when copying to VBOs.
When copy_array_to_vbo_array encountered an array with src_stride == 0
and dst_stride != 0, we would replicate out the single element to the
whole size (max - min + 1).  This is unnecessary: we can simply upload
one copy and set the buffer's stride to 0.

Decreases vertex upload overhead in an upcoming Steam for Linux title.
Prior to this patch, copy_array_to_vbo_array appeared very high in the
profile (Eric quoted 20%).  After the patch, it disappeared completely.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 19:54:36 -07:00
Kenneth Graunke 3d2b4291c2 i965: Don't bother trying to extend the current vertex buffers.
This essentially reverts the following:

  commit c625aa19cb
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Fri Feb 18 10:37:43 2011 +0000

      intel: extend current vertex buffers

While working on optimizing an upcoming Steam title, I broke this code.
Eric expressed his doubts about this optimization, and noted that the
original commit offered no performance data.

I ran before and after benchmarks on Xonotic and Citybench, and found
that this code made no difference.  So, remove it to reduce complexity
and make future work simpler.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-31 19:54:36 -07:00
Marek Olšák 1eedebc65b r600g: re-enable handling of DISCARD_RANGE, improving performance
It seems to work for me now. Even the graphics corruption is gone.

This also boosts performance in Reaction Quake.
2012-11-01 03:17:58 +01:00
Marek Olšák fa58644855 r600g: fix abysmal performance in Reaction Quake
The problem was we set VRAM|GTT for relocations of STATIC resources.
Setting just VRAM increases the framerate 4 times on my machine.

I rewrote the switch statement and adjusted the domains for window
framebuffers too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
2012-11-01 03:17:58 +01:00
Marek Olšák 4cf6acc3d0 gallium/u_vbuf: document how it works 2012-11-01 03:17:58 +01:00
Marek Olšák 46b0893fb9 gallium/u_vbuf: optimize looping over the list of buffers to upload 2012-11-01 03:17:58 +01:00
Marek Olšák a97b053fdd gallium/u_vbuf: skip processing of buffers unused by the vertex element state 2012-11-01 03:17:58 +01:00
Brian Paul fc2cf14038 swrast: remove explicit size from texfetch_funcs array
By removing the array size, the static assertion to check for missing
elements can do its job properly.  This will catch cases where a new
Mesa format is added but the swrast texfetch code isn't updated.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 13:37:11 -06:00
José Fonseca f69fc36127 llvmpipe: Obey back writemask.
Tested with a modified glean tstencil2 test.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 16:50:40 +00:00
Jerome Glisse 470952f751 r600g: avoid shader needing too many gpr to lockup the gpu v2
On r6xx/r7xx shader resource management need to make sure that the
shader does not goes over the gpr register limit. Each specific
asic has a maxmimum register that can be split btw shader stage.
For each stage the shader must not use more register than the
limit programmed.

v2: Print an error message when discarding draw. Don't add another
    boolean to context structure, but rather propagate the discard
    boolean through the call chain.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2012-10-31 10:49:15 -04:00
Marek Olšák 183e122bdf draw: fix assertion failure in draw_emit_vertex_attr
This is a regression since b3921e1f53.

The array stores VS outputs, not FS inputs.
Now llvmpipe can do 32 varyings too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 02:06:11 +01:00
Marek Olšák 91107a3522 r600g: use SQ_VTX_SEMANTIC_CLEAR to clear the semantic registers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-10-31 02:06:11 +01:00
Marek Olšák d6600f9d39 mesa: remove NV_read_buffer extension enable flag
It's been enabled by default, so the flag isn't really useful.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-31 02:05:12 +01:00
Marek Olšák b8380e54b8 mesa: remove SGIS_texture_lod extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:05:11 +01:00
Marek Olšák 01f0bedc2d mesa: remove NV_texgen_reflection extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák 7857dbeb17 mesa: remove NV_light_max_exponent extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák cc07149276 mesa: remove IBM_rasterpos_clip extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák f5543d6eb2 mesa: remove IBM_multimode_draw_arrays extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák 271b6aeccd mesa: remove APPLE_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák 55bf57dbb4 mesa: don't always enable OES_standard_derivatives
For Intel, expose it only if gen >= 4.
For Gallium, expose it only if PIPE_CAP_SM3 is advertised.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 02:04:54 +01:00
Marek Olšák b6f5c37ac3 mesa: move EXT_texture3D enabling to _mesa_init_extensions 2012-10-31 02:04:16 +01:00
Marek Olšák 2266b1df23 mesa: remove EXT_separate_specular_color extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:26 +01:00
Marek Olšák 39a0223a87 mesa: remove EXT_rescale_normal extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:23 +01:00
Marek Olšák 6f5fc612f3 mesa: remove EXT_packed_pixels extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:21 +01:00
Marek Olšák 57b00c85b1 mesa: remove EXT_draw_range_elements extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:19 +01:00
Marek Olšák cf9acc3833 mesa: remove EXT_compiled_vertex_array extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:17 +01:00
Marek Olšák 1301f91b31 mesa: remove ARB_window_pos extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:15 +01:00
Marek Olšák d012e6d8fe mesa: remove ARB_transpose_matrix extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:58:12 +01:00
Marek Olšák 3bba7c5ab4 mesa: remove ARB_copy_buffer extension enable flag
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2012-10-31 01:57:25 +01:00
Marek Olšák c9f2af3df7 gallium: expose ARB_map_buffer_alignment on Radeon
Reviewed-by: Brian Paul <brianp@vmware.com>

v2: update relnotes-9.1
v3: use align_malloc and align_free for malloced buffers in r300g
v4: document the new CAP in the docs
2012-10-31 01:53:50 +01:00
Marek Olšák f2f782d50f mesa: implement ARB_map_buffer_alignment
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:48:40 +01:00
Marek Olšák 0ebd0b78c6 st/mesa: don't use _NEW_PROGRAM where ST_NEW_xxx_PROGRAM is sufficient
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 01:44:58 +01:00
Marek Olšák c0c26ddaef r600g: use better sample positions for 8x MSAA
Taken from the intel driver. The sample positions are actually a solution
to the 8 queens puzzle.  It gives more accurate and smoother AA.
2012-10-31 00:55:23 +01:00
Marek Olšák e73bf3b805 gallium: add start_slot parameter to set_vertex_buffers
This allows updating only a subrange of buffer bindings.

set_vertex_buffers(pipe, start_slot, count, NULL) unbinds buffers in that
range. Binding NULL resources unbinds buffers too (both buffer and user_buffer
must be NULL).

The meta ops are adapted to only save, change, and restore the single slot
they use. The cso_context can save and restore only one vertex buffer slot.
The clients can query which one it is using cso_get_aux_vertex_buffer_slot.
It's currently set to 0. (the Draw module breaks if it's set to non-zero)

It should decrease the CPU overhead when using a lot of meta ops, but
the drivers must be able to treat each vertex buffer slot as a separate
state (only r600g does so at the moment).

I can imagine this also being useful for optimizing some OpenGL use cases.

Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-31 00:55:13 +01:00
Marvin Schmidt a7c5be098a st/xorg: Remove superfluous miInitializeBackingStore() call
It was defined as an empty function since Nov 2010 and was ultimately
removed completely.

See xserver commit 1cb0261

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
2012-10-30 11:36:31 +01:00
Vinson Lee 0a66ced8f8 xlib: Do not undefine _R, _G, and _B.
Fixes build error on Cygwin and Solaris. _R, _G, and _B are used in
ctype.h on those platforms.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
2012-10-29 22:25:56 -07:00
Brian Paul aab0ea9352 mesa: remove array size so the static assert can work
With the explit NUM_TEXTURE_TARGETS array size, the assertion that
Elements(targets) == NUM_TEXTURE_TARGETS would pass even if elements
were missing.

Reviewed-by: Eric Anholt <eric@anholt.net>
2012-10-29 17:56:05 -06:00
Brian Paul 1e46d810c8 mesa: use GLuint for more gl_constants fields
To silence assorted MSVC warnings.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul ec5341800b vbo: silence MSVC double/float conversion warnings
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul f6c83e1661 mesa: silence some MSVC conversion warnings in get.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:05 -06:00
Brian Paul 06bb81f01d mesa: silence MSVC signed/unsigned comparision warnings in hash_table.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul 8e45e38512 mesa: silence MSVC signed/unsigned comparision warnings in transformfeedback.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul 03503daa21 mesa: silence MSVC signed/unsigned comparision warnings in accum.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul db0136ae3e mesa: silence MSVC signed/unsigned comparison warning in texstorage.c
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Brian Paul 298d7a20e1 mesa: silence MSVC double/float assignment warnings in pixel unpack code
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2012-10-29 17:56:04 -06:00
Vincent Lejeune 5ab82e0ccf r600g: tgsi-to-llvm emits right input intrinsics
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
2012-10-30 00:28:42 +01:00
Tapani Pälli e4e3b07181 intel: support for 16 bit config with 24 depth and 8 stencil
Patch adds additional singlesample config with 565 color buffer,
24 bit depth and 8 bit stencil buffer. This makes Quadrant benchmark
work on Android. Tested with Sandybridge and Ivybridge machines.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 11:58:47 -07:00
Ian Romanick e8f2bec25e dri: Support MESA_FORMAT_SARGB8 in driCreateConfigs
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:56 -07:00
Ian Romanick 749ac8b73a intel: If the visual is sRGB, use an sRGB internal format
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:53 -07:00
Ian Romanick 1f6e10f67b dri: Convert driCreateConfigs to use a gl_format enum
This is instead of the pair of GLenums for format and type that were
previously used.  This is necessary for the Intel drivers to expose sRGB
framebuffer formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2012-10-29 09:55:42 -07:00
Ian Romanick 43d6fe156b dri_util: Elminiate the bytes_per_pixel table
With fewer formats to support, it's kind of useless.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:38 -07:00
Ian Romanick bda208a4d4 dri_util: Remove support for RGB332 framebuffers
None of the remaining DRI drivers in Mesa use this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:32 -07:00
Ian Romanick 0398a26097 swrast: Remove the 2_3_3_REV framebuffer format
There is no gl_format in Mesa that corresponds to this arrangement, so I
have a very hard time believing that this works.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 09:55:27 -07:00
Ian Romanick 386282b5c2 glx: Add the extension string for GLX_ARB_framebuffer_sRGB
From the GLX perspective, the ARB and EXT extensions are identical.  Use
a single bit for both.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:23 -07:00
Ian Romanick 7b0f912e70 glx: Set sRGBCapable to a default value
Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1).  Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
2012-10-29 09:55:15 -07:00
Bryan Cain 170f0459a2 glsl_to_tgsi: set correct register type for array and structure elements
This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure.  Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
2012-10-29 15:49:00 +01:00
Marek Olšák 96ed6c90ef r600g: implement texturing with 8x MSAA compressed surfaces for Evergreen
The 2x and 4x MSAA cases are completely broken. The lfdptr instruction returns
garbage there.

The 8x MSAA case is broken on Cayman, though at least the result looks somewhat
correct.

Only the 8x MSAA case works on Evergreen and is enabled.
2012-10-29 12:51:41 +01:00
Marek Olšák b3921e1f53 mesa: bump MAX_VARYING to 32
We're starting to get apps utilizing more than 16 varyings and
most current hardware supports 32 anyway.

Tested with r600g.
swrast, softpipe and llvmpipe still advertise 16 varyings.

This fixes a WebGL crash after launching this demo:
https://developer.mozilla.org/en-US/demos/detail/falling-cubes

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

NOTE: This is a candidate for the stable branches.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-29 12:51:41 +01:00
Andreas Boll 00e6819e99 Revert "glsl_to_tgsi: set correct register type for array and structure elements"
This reverts commit ebd8df7a31.

accidentally pushed.
2012-10-29 12:21:07 +01:00
Christoph Bumiller 9ae7d8bb79 nv50/ir: restore use of long immediate encodings
NOTE: This is a candidate for the 9.0 branch.
2012-10-28 14:57:20 +01:00
Christoph Bumiller 351d3c59f2 nv50,nvc0: fix 2d engine stencil-only copies 2012-10-28 14:25:56 +01:00
Alexander V. Nikolaev eaa8e56108 gallium/gallivm: code generation options for LLVM 3.1+
LLVM 3.1+ haven't more "extern unsigned llvm::StackAlignmentOverride"
and friends for configuring code generation options, like stack
alignment.

So I restrict assiging of lvm::StackAlignmentOverride and other
variables to LLVM 3.0 only, and wrote similiar code using
TargetOptions.

This patch fix segfaulting of WINE using llvmpipe built with LLVM 3.1

Signed-off-by: Alexander V. Nikolaev <avn@daemon.hole.ru>
Signed-off-by: José Fonseca <jose.r.fonseca@gmail.com>
2012-10-28 10:34:26 +00:00
Eric Anholt 459b28aba7 i965: Merge brw_prepare_query_begin() and brw_emit_query_begin().
This is a leftover from when we had to split those two functions due to
the separate BO validation step.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:54 -07:00
Eric Anholt 99dc870613 i965: Rename misleading "active" field of brw->query.
"Active" is an already-used term for the query being between
glBeginQuery() and glEndQuery(), while this is tracking whether the
start of the packet pair for emitting state has been inserted into the
current batchbuffer.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2012-10-26 12:41:01 -07:00
Marek Olšák b78b62497f r600g: advertise 32 streamout vec4 outputs
to match the varying limit.
2012-10-26 19:01:16 +02:00
Brian Paul 80bc3206aa softpipe: remove extraneous whitespace 2012-10-26 10:59:29 -06:00
Brian Paul 369b5a311c gallivm/llvmpipe: fix 64-bit %ll format compiler warnings for mingw32
Use the PRIx64 and PRIu64 format macros from inttypes.h.  We made a
similar change in prog_print.c in df2d81ea59.
2012-10-26 10:59:29 -06:00
Marek Olšák 8b63512be0 r600g: advertise 32 fragment shaders inputs, not 34 2012-10-26 18:01:14 +02:00
José Fonseca 8eb2b331ef graw/fs-test: Use user constant buffers.
Much simpler. More interesting.
2012-10-26 16:02:59 +01:00
José Fonseca ce10624e9e trace: Flush before drawing. 2012-10-26 16:02:59 +01:00
José Fonseca 91332e455a graw: Ensure new members are zeroed.
Several new state members were added, and they were not being zeroed,
causing random crashes.
2012-10-26 16:02:59 +01:00
José Fonseca 2532f0d063 tests/graw: Update occlusion query example. 2012-10-26 16:02:58 +01:00
Michel Dänzer 97078b198d radeonsi: Handle TGSI_SEMANTIC_FACE.
Fixes two piglit tests using gl_FrontFacing.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:18 +02:00
Michel Dänzer 691f08dbea radeonsi: Handle TGSI_SEMANTIC_BCOLOR.
Put the back face colour right after the front face colour in the LDS parameter
space.

Fixes 18 piglit tests related to two sided lighting.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer 44ef033c25 radeonsi: Don't snoop context state while building shaders.
Let's use the shader key describing the state.

Ported from r600g commit b652180107.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Michel Dänzer f3257d80b0 radeon/llvm: Add intrinsic for reading SI FRONT_FACE VGPR in the pixel shader.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 15:51:17 +02:00
Alex Deucher bd274eb8f4 r600g: split cayman common state out into a shared function
And use it for compute.  This should improve compute support
on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:32 -04:00
Alex Deucher 67c875117c r600g: emit some additional regs on cayman
These are common to both evergreen and cayman, but were
not emitted on cayman.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:33:06 -04:00
Alex Deucher d781f0c73c r600g: there are 16 const buffer size regs for each shader stage
we were previously only setting 8 of them.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2012-10-26 09:32:55 -04:00