History log of /external/mesa3d/src/mesa/main/api_validate.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
27a3fe0008e95f1dadccd1bf6cb70796b1f4b28b 22-Feb-2017 Nicolai Hähnle <nicolai.haehnle@amd.com> mesa/main: fix MultiDrawElements[BaseVertex] validation of primcount

primcount must be a GLsizei as in the signature for MultiDrawElements
or bad things can happen.

Furthermore, an error should be flagged when primcount is negative.

Curiously, this code used to work somewhat correctly even when primcount
was negative, because the loop that checks count[i] would iterate out of
bounds and almost certainly hit a negative value at some point.

Found by an ASAN error in
GL45-CTS.gtf32.GL3Tests.draw_elements_base_vertex.draw_elements_base_vertex_primcount

Note that the OpenGL spec seems to have s/primcount/drawcount/ at some
point, and the code still reflects the old language.

v2: provide the correct spec quotes (pointed out by Ian)

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit c11dcfb5e9b051b9036949b3e40a9dc15138bd97)
/external/mesa3d/src/mesa/main/api_validate.c
84a2f46cacfab79bc38f1b1212425f14228e94a3 11-Feb-2017 Kenneth Graunke <kenneth@whitecape.org> mesa: Do (TCS && !TES) draw time validation in ES as well.

Now that we have OES_tessellation_shader, the same situation can occur
in ES too, not just GL core profile.

Having a TCS but no TES may confuse drivers - i965 crashes, for example.

This prevents regressions in
ES31-CTS.core.tessellation_shader.single.xfb_captures_data_from_correct_stage
with some SSO pipeline validation changes I'm making.

v2: Add an ES spec citation (suggested by Alejandro)

Cc: "17.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
(cherry picked from commit 05a56893aa2570cb1f6e61e3c9cf365266ea1d3a)
/external/mesa3d/src/mesa/main/api_validate.c
c46a630000a2539e38a448f24a456397ce201a2e 03-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa: make _CurrentFragmentProgram a gl_program struct pointer

Making this point to a gl_program struct rather than a gl_shader_program
struct will allow use to later also make the CurrentProgram array hold
gl_program structs which in turn will allow for code simpilifcation.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
8417bf528eb155028d56acaa4cbe05eb3536093b 04-Nov-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa/glsl: move BlendSupport bitfield to gl_program

This will let us to make _CurrentFragmentProgram a gl_program pointer
allowing for simpilifications to be made.

We also need to add a field to gl_shader to hold it during parsing.

In gl_program we put it inside a union in anticipation of moving
more fields here that can be only fs or vertex stage fields.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
29d70f5de966c18d563475bc5f60f252e9a900a3 31-Oct-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa: move _Used to gl_program

We no longer need to initialise it because gl_program is never reused.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
9ea513e22698fba429b8f3f2a9a0ccdbcc73d4a2 31-Oct-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa: pass gl_program to _mesa_append_uniforms_to_file()

This now contains everything we need.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
039d836d6ea5621ede88ff3504be841a6dd865c6 30-Nov-2016 Lionel Landwerlin <lionel.g.landwerlin@intel.com> mesa: add support for GL_INTEL_conservative_rasterization

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
/external/mesa3d/src/mesa/main/api_validate.c
7c16552f8dcc869b14cf7ef443a1b5de83b07973 30-Nov-2016 Ilia Mirkin <imirkin@alum.mit.edu> mesa: only verify that enabled arrays have backing buffers

We were previously also verifying that no backing buffers were available
when an array wasn't enabled. This is has no basis in the spec, and it
causes GLupeN64 to fail as a result.

Fixes: c2e146f487 ("mesa: error out in indirect draw when vertex bindings mismatch")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
ff00ab745c9a9d6ef35239ea656a5db0c76de52d 10-Oct-2016 Brian Paul <brianp@vmware.com> mesa: replace gl_framebuffer::_IntegerColor wih _IntegerBuffers

Use a bitmask to indicate which color buffers are integer-valued, rather
than a bool. Also, the old field was mis-computed. If an integer buffer
was followed by a non-integer buffer, the _IntegerColor field was wrongly
set to false.

This fixes the new piglit gl-3.1-mixed-int-float-fbo test.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
/external/mesa3d/src/mesa/main/api_validate.c
45ab63c0cb274b20a7ae1f390b123e13a5b46c98 07-Sep-2016 Samuel Pitoiset <samuel.pitoiset@gmail.com> mesa/main: add support for ARB_compute_variable_groups_size

v5: - replace fixed_local_size by !LocalSizeVariable (Nicolai)
v4: - slightly indent spec quotes (Nicolai)
- drop useless _mesa_has_compute_shaders() check (Nicolai)
- move the fixed local size outside of the loop (Nicolai)
- add missing check for invalid use of work group count
v2: - update formatting spec quotations (Ian)
- move the total_invocations check outside of the loop (Ian)

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/external/mesa3d/src/mesa/main/api_validate.c
951bf44a56d3236550d4d910741c10d5e0d1311b 30-Sep-2016 Brian Paul <brianp@vmware.com> mesa: move _mesa_valid_to_render() to api_validate.c

Almost all of the other drawing validation code is in api_validate.c
so put this function there as well.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/main/api_validate.c
eaacb278128ca64b170285feae58c89d16bff8a1 15-Sep-2016 Kenneth Graunke <kenneth@whitecape.org> mesa: Move buffers-unmapped earlier in check_valid_to_render().

This needs to be above the switch on API, as that can return true
(valid to render) before this error check even had a chance to run.

Fixes ESEXT-CTS.draw_elements_base_vertex_tests.invalid_mapped_bos,
which worked before commit 72f1566f90c434c7752d8405193eec68d6743246.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
/external/mesa3d/src/mesa/main/api_validate.c
658e90f9a8c0c68e0bee5007cf3f654cc95188b6 24-May-2016 Ian Romanick <ian.d.romanick@intel.com> mesa: Document reasons for allowing XFB drawing modes in GLES 3.1 w/GL_OES_geometry_shader

Originally this patch added the checks to allow the draw calls with XFB,
but commit 2dabd497 beat me to it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
312ece9cd773553a8a45a5d81edc7c09032ff4f1 14-Aug-2016 Mathias Fröhlich <mathias.froehlich@web.de> mesa: Remove duplicate include.

In api_validate.c stdbool.h was included twice.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
72f1566f90c434c7752d8405193eec68d6743246 14-Aug-2016 Mathias Fröhlich <mathias.froehlich@web.de> mesa: Move check for vbo mapping into api_validate.c.

Instead of checking for mapped buffers in vbo_bind_arrays
do this check in api_validate.c. This additionally
enables printing the draw calls name into the error
string.

Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
7314007925a25f65d178345dfc6d086c82e9a71e 29-Oct-2015 Kenneth Graunke <kenneth@whitecape.org> mesa: Skip ES 3.0/3.1 transform feedback primitive counting error.

This error condition is not implementable when using tessellation or
geometry shaders. The text was also removed from the ES 3.2 spec.
I believe the intended behavior is to remove the error condition
when either OES_geometry_shader or OES_tessellation_shader are
exposed.

v2: Quote a better part of issue 13 (suggested by Ian).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
23b2bcd460c5e91b528913526f16b8e5fd7d4278 09-Jul-2016 Kenneth Graunke <kenneth@whitecape.org> mesa: Share code between _mesa_validate_DrawArrays[_Instanced].

Mostly, I want to share the GLES 3 transform feedback handling,
though most of the rest of the code is identical as well.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
1591e668e162daf4057a0d44df4e70f19b94fc76 30-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl/mesa: move duplicate shader fields into new struct gl_shader_info

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/mesa/main/api_validate.c
1fb8c6df884c2a17cf980c4ea32db4c214903b55 30-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl/mesa: split gl_shader in two

There are two distinctly different uses of this struct. The first
is to store GL shader objects. The second is to store information
about a shader stage thats been linked.

The two uses actually share few fields and there is clearly confusion
about their use. For example the linked shaders map one to one with
a program so can simply be destroyed along with the program. However
previously we were calling reference counting on the linked shaders.

We were also creating linked shaders with a name even though it
is always 0 and called the driver version of the _mesa_new_shader()
function unnecessarily for GL shader objects.

Acked-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/mesa/main/api_validate.c
ab99196b6bc5b0170db20db6cc3837ce7642d22a 21-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl/mesa: stop duplicating geom and tcs layout values

We already store these in gl_shader and gl_program here we
remove it from gl_shader_program and just use the values
from gl_shader.

This will allow us to keep the shader cache restore code as
simple as it can be while making it somewhat clearer where these
values originate from.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/mesa/main/api_validate.c
24b3be093870a9a77325ac33c8fce97fae143e8e 21-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> glsl/mesa: stop duplicating tes layout values

We already store this in gl_shader and gl_program here we
remove it from gl_shader_program and just use the values
from gl_shader.

This will allow us to keep the shader cache restore code as
simple as it can be while making it somewhat clearer where these
values originate from.

V2: remove unnecessary NULL check

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Iago Toral <itoral@igalia.com>
/external/mesa3d/src/mesa/main/api_validate.c
481e924951067ebc909fc2eaf986bedc9e441648 17-Jun-2016 Timothy Arceri <timothy.arceri@collabora.com> mesa: remove remaining tabs in api_validate.c

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
/external/mesa3d/src/mesa/main/api_validate.c
2dabd4970477e956dd353be1a24e81aa1f0c5901 22-May-2016 Ilia Mirkin <imirkin@alum.mit.edu> mesa: allow xfb to be active in GLES when geometry shader is enabled.

OES_geometry_shader has wording to allow xfb when using Draw*Indirect
and DrawElements.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
/external/mesa3d/src/mesa/main/api_validate.c
bbc6a275901b69ea2804f374cc03c2c2448d8e55 09-May-2016 Dave Airlie <airlied@redhat.com> mesa: don't use genned but unnamed xfb objects.

If we try to draw or query an XFB object that hasn't been bound,
we shouldn't return any information.

This fixes a couple if cases in:
GL33-CTS.transform_feedback.api_errors_test

The ObjectLabel test is inspired by another test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/main/api_validate.c
2e2aa992ffefa56013554c36d8ddcb53879bf661 05-May-2016 Jordan Justen <jordan.l.justen@intel.com> mesa/compute: Fix indirect dispatch buffer size check on 32-bit systems

2655265fcba9017e793026c76e490e04db088c8f, but for compute.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
/external/mesa3d/src/mesa/main/api_validate.c
2dd3fc3cac020237ae0dd924941dcfaf1c11da0b 05-May-2016 Dave Airlie <airlied@redhat.com> mesa/compute: drop pointless casts.

We already are a GLintptr, casting won't help.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
/external/mesa3d/src/mesa/main/api_validate.c
2655265fcba9017e793026c76e490e04db088c8f 26-Apr-2016 Kenneth Graunke <kenneth@whitecape.org> mesa: Fix indirect draw buffer size check on 32-bit systems.

Fixes dEQP-GLES31.functional subtests:
draw_indirect.negative.command_offset_not_in_buffer_signed32_wrap
draw_indirect.negative.command_offset_not_in_buffer_unsigned32_wrap

These tests use really large values that overflow GLsizeiptr, at
which point the buffer size isn't less than "end".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95138
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
e1eab5a76f20061c005c8254b11ca1611ebda8f7 31-Dec-2015 Ilia Mirkin <imirkin@alum.mit.edu> mesa: add support for ARB_indirect_parameters draw functions

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
/external/mesa3d/src/mesa/main/api_validate.c
63b49e1711382c263acdcbe2d58c28ef64164059 25-Nov-2015 Marta Lofstedt <marta.lofstedt@intel.com> mesa: remove ARB_geometry_shader4

No drivers currently implement ARB_geometry_shader4, nor are there
any plans to implement it. We only support the version of geometry
shaders that was incorporated into OpenGL 3.2 / GLSL 1.50.

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
c2e146f4879b806e7178b8145645268c1ce0b4cd 13-Nov-2015 Tapani Pälli <tapani.palli@intel.com> mesa: error out in indirect draw when vertex bindings mismatch

Patch adds additional mask for tracking which vertex arrays have
associated vertex buffer binding set. This array can be directly
compared to which vertex arrays are enabled and should match when
drawing.

Fixes following CTS tests:

ES31-CTS.draw_indirect.negative-noVBO-arrays
ES31-CTS.draw_indirect.negative-noVBO-elements

v2: update mask in vertex_array_attrib_binding
v3: rename mask and make it track _BoundArrays which matches what
was actually originally wanted (Fredrik Höglund)
v4: code cleanup, check for GLES 3.1 (Fredrik Höglund)

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
/external/mesa3d/src/mesa/main/api_validate.c
55365a7ad50c2e4547f58995a8e3411d8f2b00a2 14-Oct-2015 Jordan Justen <jordan.l.justen@intel.com> mesa: Add spec citations for DispatchCompute*

Note: The OpenGL 4.3 - 4.5 specification language for DispatchCompute
appears to have an error regarding the max allowed values. When adding
the specification citation, we note why the code does not match the
specification language.

v2:
* Updates based on review from Iago

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Iago Toral Quiroga <itoral@igalia.com>
Cc: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
44c399f20af49607c799326ad4dd0f74c5214d4c 14-Oct-2015 Jordan Justen <jordan.l.justen@intel.com> mesa: Update DispatchComputeIndirect errors for indirect parameter

There is some discrepancy between the return values for some error
cases for the DispatchComputeIndirect call in the ARB_compute_shader
specification. Regarding the indirect parameter, in one place the
extension spec lists that the error returned for invalid values should
be INVALID_OPERATION, while later it specifies INVALID_VALUE.

The OpenGL 4.3 and OpenGLES 3.1 specifications appear to be consistent
in requiring the INVALID_VALUE error return in this case.

Here we update the code to match the main specifications, and update
the citations use the main specification rather than the extension
specification.

v2:
* Updates based on review from Iago

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: Iago Toral Quiroga <itoral@igalia.com>
Cc: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
39bb59a56610e67c26df6f92d2c844b2a6f04082 17-Oct-2015 Jordan Justen <jordan.l.justen@intel.com> mesa/sso: Add compute shader support

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
[itoral@igalia.com: Reviewed-by for all except the ctx->_Shader change]
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
/external/mesa3d/src/mesa/main/api_validate.c
16c49da63a72aa4b1dce5c90397ee4af2f6a8f9d 26-Oct-2015 Marta Lofstedt <marta.lofstedt@intel.com> mesa: Draw indirect is not allowed if the default VAO is bound.

From OpenGL ES 3.1 specification, section 10.5:
"DrawArraysIndirect requires that all data sourced for the
command, including the DrawArraysIndirectCommand
structure, be in buffer objects, and may not be called when
the default vertex array object is bound."

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
3daa7e5147f164e822269f13c3bcccfa6446fa83 26-Oct-2015 Marta Lofstedt <marta.lofstedt@intel.com> mesa: Draw indirect is not allowed when xfb is active and unpaused

OpenGL ES 3.1 specification, section 10.5:
"An INVALID_OPERATION error is generated if
transform feedback is active and not paused."

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
2c91e086563541271668f9ea6ca58689c0c97d44 26-Oct-2015 Marta Lofstedt <marta.lofstedt@intel.com> mesa: Draw Indirect return wrong error code on unalinged

From OpenGL 4.4 specification, section 10.4 and
Open GL Es 3.1 section 10.5:
"An INVALID_VALUE error is generated if indirect is not a multiple
of the size, in basic machine units, of uint."

However, the current code follow the ARB_draw_indirect:
https://www.opengl.org/registry/specs/ARB/draw_indirect.txt
"INVALID_OPERATION is generated by DrawArraysIndirect and
DrawElementsIndirect if commands source data beyond the end
of a buffer object or if <indirect> is not word aligned."

V2: After discussions on the list, it was suggested to
only keep the INVALID_VALUE error.

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
/external/mesa3d/src/mesa/main/api_validate.c
d11d018ce38b76a580242d64e61e8e30dad035e8 17-Sep-2015 Jordan Justen <jordan.l.justen@intel.com> mesa/cs: Implement glDispatchComputeIndirect

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
/external/mesa3d/src/mesa/main/api_validate.c
4a1ba7e6bd3ddcab4647a1382d14165a08c0d3b0 17-Sep-2015 Jordan Justen <jordan.l.justen@intel.com> mesa/cs: Add _mesa_validate_DispatchCompute

Move API validation to _mesa_validate_DispatchCompute in
api_validate.c.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
/external/mesa3d/src/mesa/main/api_validate.c
206af9d049cab6e794db5abf63e3d11281343423 28-May-2015 Marek Olšák <marek.olsak@amd.com> mesa: don't allow drawing with tess ctrl shader and without tess eval shader

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
5852b5d2fa02d7716c2fbf859d058a2881416e9c 13-Jun-2015 Marek Olšák <marek.olsak@amd.com> mesa: take tessellation into account when validating GS input primitive mode

I've reported the bug in the Khronos bugzilla.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
8e758c3a74a35f8ee6c5969d5bb5f788b4ef4337 20-Sep-2014 Chris Forbes <chrisf@ijw.co.nz> mesa: allow drawing of patch primitives

Cosmetic changes and fixes by Marek.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
2f11e92cef51c88a09bc778e2ceca4ab50cf0017 18-Jul-2015 Kenneth Graunke <kenneth@whitecape.org> mesa: Rename _mesa_lookup_enum_by_nr() to _mesa_enum_to_string().

Generated by sed; no manual changes.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
0a0d2c944372590721f5accc74d03789c1fa6098 07-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Micro-optimize _mesa_is_valid_prim_mode

You would not believe the mess GCC 4.8.3 generated for the old
switch-statement.

On Bay Trail-D using Fedora 20 compile flags (-m64 -O2 -mtune=generic
for 64-bit and -m32 -march=i686 -mtune=atom for 32-bit), affects
Gl32Batch7:

32-bit: Difference at 95.0% confidence -0.37374% +/- 0.184057% (n=40)
64-bit: Difference at 95.0% confidence 0.966722% +/- 0.338442% (n=40)

The regression on 32-bit is odd. Callgrind says the caller,
_mesa_is_valid_prim_mode is faster. Before it says 2,293,760
cycles, and after it says 917,504.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
ead200d156c887bed77645ecba7f36ba0be14b8c 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Check for vertex program the same way in desktop GL and ES

On Bay Trail-D using Fedora 20 compile flags (-m64 -O2 -mtune=generic
for 64-bit and -m32 -march=i686 -mtune=atom for 32-bit), affects
Gl32Multithread:

32-bit: Difference at 95.0% confidence 0.416027% +/- 0.163529% (n=40)
64-bit: Difference at 95.0% confidence 0.494771% +/- 0.259985% (n=40)

Gl32Batch7 had no difference proven at 95.0% confidence (n=120) on
32-bit or 64-bit.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
d5f936367ffbec5833e5eb7cf22666e38c8e3821 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Drop index buffer bounds check

The previous check was insufficient (as it did not take 'indices' into
consideration), and DX10 hardware does not need this check anyway.

Since index_bytes is no longer used, remove it.

On Bay Trail-D using Fedora 20 compile flags (-m64 -O2 -mtune=generic
for 64-bit and -m32 -march=i686 -mtune=atom for 32-bit), affects
Gl32Batch7:

32-bit: Difference at 95.0% confidence 1.66929% +/- 0.230107% (n=40)
64-bit: Difference at 95.0% confidence -1.40848% +/- 0.288038% (n=40)

The regression on 64-bit is odd. Callgrind says the caller,
validate_DrawElements_common is faster. Before it says 10,321,920
cycles, and after it says 8,945,664.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
a4aeb534ea8a21770b28cdf1f66cff4afe123009 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Only check for a current vertex shader in core profile

This doesn't affect performance, but it feels more correct.

On Bay Trail-D using Fedora 20 compile flags (-m64 -O2 -mtune=generic
for 64-bit and -m32 -march=i686 -mtune=atom for 32-bit), affects
Gl32Batch7:

32-bit: No difference proven at 95.0% confidence (n=120)
64-bit: No difference proven at 95.0% confidence (n=120)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
9fd398215d4baf70a316d8f7a938a99ed48668c9 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Use current Mesa coding style in check_valid_to_render

This makes some others patches (still in my local tree) a bit cleaner.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
331b0120d16445dd8d5b8d049946ae7845fb714b 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Use unreachable instead of assert in check_valid_to_render

This is generally the prefered style these days.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
304c466bd87abb5a29d4d5a6cba35faaafdeab3b 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Silence unused parameter warnings in _mesa_validate_Draw functions

../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawElements':
../../src/mesa/main/api_validate.c:376:37: warning: unused parameter 'basevertex' [-Wunused-parameter]
../../src/mesa/main/api_validate.c: In function '_mesa_validate_MultiDrawElements':
../../src/mesa/main/api_validate.c:394:65: warning: unused parameter 'basevertex' [-Wunused-parameter]
../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawRangeElements':
../../src/mesa/main/api_validate.c:452:35: warning: unused parameter 'basevertex' [-Wunused-parameter]
../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawArrays':
../../src/mesa/main/api_validate.c:473:25: warning: unused parameter 'start' [-Wunused-parameter]
../../src/mesa/main/api_validate.c: In function '_mesa_validate_DrawElementsInstanced':
../../src/mesa/main/api_validate.c:590:44: warning: unused parameter 'basevertex' [-Wunused-parameter]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
5e72886db0a170d8862f3fc5d8f546fa75b20b2b 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Refactor common validation code to validate_DrawElements_common

Most of the code in _mesa_validate_DrawElements,
_mesa_validate_DrawRangeElements, and
_mesa_validate_DrawElementsInstanced was the same. Refactor this out to
common code.

As a side-effect, a bug in _mesa_validate_DrawElementsInstanced was
fixed. Previously this function would not generate an error when
check_valid_to_render failed if numInstances was 0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
b93dcb0e718a0a177370f2c7851223350d3b7bc7 11-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Generate GL_INVALID_OPERATION when drawing w/o a VAO in core profile

GL 3-ish versions of the spec are less clear that an error should be
generated here, so Ken (and I during review) just missed it in 1afe335.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
46a2323c3fd5fa6027427005c6cbc5c3be9beb24 07-Nov-2014 Ian Romanick <ian.d.romanick@intel.com> mesa: Remove _mesa_max_buffer_index

It appears to be completely unused since f9be8543 (February 2012).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
0d5f4960a468947f9862bf5de2a71fce63b50cf7 18-Oct-2014 Chris Forbes <chrisf@ijw.co.nz> mesa: Fix order of errors for glDrawTransformFeedbackStream

The OpenGL 4.0 core profile specification, section 2.17.3
Transform Feedback Draw Operations says:

"The error INVALID_VALUE is generated if <stream> is greater
than or equal to the value of MAX_VERTEX_STREAMS.
...
The error INVALID_OPERATION
is generated if EndTransformFeedback has never been called
while the object named by id was bound."

Fixes the piglit test:
ARB_transform_feedback3/arb_transform_feedback3-draw_using_invalid_stream_index
(with the test itself fixed to eliminate an unrelated failure)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
f4b4ae8c241943b8ca65e7a00f272fe23ed73727 30-Sep-2014 Tapani Pälli <tapani.palli@intel.com> mesa: relax draw api validation on ES2

Patch fixes failing test in WebGL conformance test
'point-no-attributes' when running Chrome on OpenGL ES.
(Shader program may draw points using constant data in shader.)

No Piglit regressions.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
26ee6f23a9aec6b1f392baa0e3f1f2c62c038a57 15-Sep-2014 Kenneth Graunke <kenneth@whitecape.org> mesa: Delete VAO _MaxElement code and index buffer bounds checking.

Fredrik's implementation of ARB_vertex_attrib_binding introduced new
gl_vertex_attrib_array and gl_vertex_buffer_binding structures, and
converted Mesa's older gl_client_array to be derived state. Ultimately,
we'd like to drop gl_client_array and use those structures directly.

One hitch is that gl_client_array::_MaxElement doesn't correspond to
either structure (unlike every other field), so we'd have to figure out
where to store it. The _MaxElement computation uses values from both
structures, so it doesn't really belong in either place. We could put
it in the VAO, but we'd have to pass it around everywhere.

It turns out that it's only used when ctx->Const.CheckArrayBounds is
set, which is only set by the (rarely used) classic swrast driver.
It appears that drivers/x11 used to set it as well, which was intended
to avoid segmentation faults on out-of-bounds memory access in the X
server (probably for indirect GLX clients). However, ajax deleted that
code in 2010 (commit 1ccef926be46dce3b6b5c76e812e2fae4e205ce7).

The bounds checking apparently doesn't actually work, either. Non-VBO
attributes arbitrarily set _MaxElement to 2 * 1000 * 1000 * 1000.
vbo_save_draw and vbo_exec_draw remark /* ??? */ when setting it, and
the i965 code contains a comment noting that _MaxElement is often bogus.

Given that the code is complex, rarely used, and dubiously functional,
it doesn't seem worth maintaining going forward. This patch drops it.

This will probably mean the classic swrast driver may begin crashing on
out of bounds vertex buffer access in some cases, but I believe that is
allowed by OpenGL (and probably happened for non-VBO accesses anyway).
There do not appear to be any Piglit regressions, either.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Roland Scheidegger <sroland@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
1afe3359258a9e89b62c8638761f52d78f6d1cbc 20-Mar-2014 Kenneth Graunke <kenneth@whitecape.org> mesa: In core profile, refuse to draw unless a VAO is bound.

Core profile requires a non-default VAO to be bound. Currently, calls
to glVertexAttribPointer raise INVALID_OPERATION unless a VAO is bound,
and we never actually get any vertex data set. Trying to draw without
any vertex data can only cause problems. In i965, it causes a crash.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76400
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
/external/mesa3d/src/mesa/main/api_validate.c
c03477050a6f51e601f75cb3c061a3e16a5b7171 03-May-2013 Gregory Hainaut <gregory.hainaut@gmail.com> mesa/sso: rename Shader to the pointer _Shader

Basically a sed but shaderapi.c and get.c.
get.c => GL_CURRENT_PROGAM always refer to the "old" UseProgram behavior
shaderapi.c => the old api stil update the Shader object directly

V2: formatting improvement

V3 (idr):
* Rebase fixes after a block of code was moved from ir_to_mesa.cpp to
shaderapi.c.
* Trivial reformatting.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
dca350201e00c7cf1cfb009158f4abf27fbc96d2 06-Feb-2014 Marek Olšák <marek.olsak@amd.com> mesa: allow buffers to be mapped multiple times

OpenGL allows a buffer to be mapped only once, but we also map buffers
internally, e.g. in the software primitive restart fallback, for PBOs,
vbo_get_minmax_index, etc. This has always been a problem, but it will
be a bigger problem with persistent buffer mappings, which will prevent
all Mesa functions from mapping buffers for internal purposes.

This adds a driver interface to core Mesa which supports multiple buffer
mappings and allows 2 mappings: one for the GL user and one for Mesa.

Note that Gallium supports an unlimited number of buffer and texture
mappings, so it's not really an issue for Gallium.

v2: fix unmapping in xm_dd.c, remove the GL errors there
v3: fix the intel driver (by Fredrik)

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
/external/mesa3d/src/mesa/main/api_validate.c
d26a065b7496ef69754fde6e4d0006ccb76f7f3a 27-Jan-2014 Marek Olšák <marek.olsak@amd.com> mesa: allow buffers mapped with the persistent flag to be used by the GPU

v2: also fixed InvalidateBufferData, added citations from the 4.4 spec

Reviewed-by: Fredrik Höglund <fredrik@kde.org>
/external/mesa3d/src/mesa/main/api_validate.c
e1b1f2a687c219021f65219df59f412bc86daadd 02-Feb-2014 Kenneth Graunke <kenneth@whitecape.org> mesa: Rename ElementArrayBufferObj to IndexBufferObj.

DirectX and most hardware documentation use the term "Index Buffer" to
refer to a buffer containing indexes into arrays of vertex data, which
allows random access to vertex data, rather than sequential access.

OpenGL uses a different term for this concept: "Element Array Buffer".
However, "Index Buffer" has become much more widespread. A quick
Google search shows 29,300 hits for "Element Array Buffer" vs.
82,300 hits for "Index Buffer."

Arguably, "Index Buffer" is clearer: an "element of an array" (or list)
usually refers to an actual item stored in the array, not the index used
to refer to it.

The terminology is also already used in Mesa: some VBO module code for
dealing with ElementArrayBufferObj names local variables "ib".

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
's/ElementArrayBufferObj/IndexBufferObj/g'

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
0dfe50f1a6cc5e1f979ac65cca4ed9359d18869d 02-Feb-2014 Kenneth Graunke <kenneth@whitecape.org> mesa: Rename ArrayObj to VAO and DefaultArrayObj to DefaultVAO.

When reading through the Mesa drawing code, it's not immediately obvious
to me that "ArrayObj" (gl_array_object) is the Vertex Array Object (VAO)
state. The comment above the structure explains this, but readers still
have to remember this and translate accordingly.

Out of context, "array object" is a fairly vague. Even in context,
"array" has a lot of meanings: glDrawArrays, vertex data stored in user
arrays, gl_client_arrays, gl_vertex_attrib_arrays, and so on.

Using the term "VAO" immediately associates these fields with the OpenGL
concept, clarifying the situation and aiding programmer sanity.

Completely generated by:
$ find . -type f -print0 | xargs -0 sed -i \
-e 's/ArrayObj;/VAO;/g' \
-e 's/->ArrayObj/->VAO/g' \
-e 's/Array\.ArrayObj/Array.VAO/g' \
-e 's/Array\.DefaultArrayObj/Array.DefaultVAO/g'

v2: Rerun command to resolve conflicts with Ian's meta patches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
3b22146dc714b6090f7423abbc4df53d7d1fdaa9 09-Jan-2014 Paul Berry <stereotype441@gmail.com> mesa: Replace ctx->Shader.Current{Vertex,Fragment,Geometry}Program with an array.

These are replaced with
ctx->Shader.CurrentProgram[MESA_SHADER_{VERTEX,FRAGMENT,GEOMETRY}].
In patches to follow, this will allow us to replace a lot of ad-hoc
logic with a variable index into the array.

With the exception of the changes to mtypes.h, this patch was
generated entirely by the command:

find src -type f '(' -iname '*.c' -o -iname '*.cpp' ')' \
-print0 | xargs -0 sed -i \
-e 's/\.CurrentVertexProgram/.CurrentProgram[MESA_SHADER_VERTEX]/g' \
-e 's/\.CurrentGeometryProgram/.CurrentProgram[MESA_SHADER_GEOMETRY]/g' \
-e 's/\.CurrentFragmentProgram/.CurrentProgram[MESA_SHADER_FRAGMENT]/g'

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
36046ae2789f74c04e6b62fa5250d81e8d1160eb 06-Nov-2013 Chris Forbes <chrisf@ijw.co.nz> mesa: Add validation helpers for new indirect draws

Based on part of Patch 2 of Christoph Bumiller's ARB_draw_indirect series.

V3: - Disallow primcount==0 for DrawMulti*Indirect. The spec is unclear
on this, but it's silly. We might go back on this later if it
turns out to be a problem.

- Make it clear that the caller has dealt with stride==0

V4: - Allow primcount==0 again.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
59b01ca252bd6706f08cd80a864819d71dfe741c 09-Apr-2013 Fredrik Höglund <fredrik@kde.org> mesa: Add ARB_vertex_attrib_binding

update_array() and update_array_format() are changed to update the new
attrib and binding states, and the client arrays become derived state.

Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
12cbe995edbbf2791459579918486413965d4bf0 03-Apr-2013 Fredrik Höglund <fredrik@kde.org> mesa: Rename gl_array_object::VertexAttrib to _VertexAttrib

This will become derived state as part of the ARB_vertex_attrib_binding
support.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
467e3aa3de0e1f5b357975d35c1312f7566af577 16-Apr-2013 Bryan Cain <bryancain3@gmail.com> mesa: fix transform feedback when a geometry shader is active.

When a geometry shader is active, the transform feedback primitive
type ("mode") needs to be validated against the geometry shader output
primitive type, not the primitive type passed to the glDraw*()
function.

Fixes the following piglit tests:
- glsl-1.50-geometry-primitive-types GL_LINES
- glsl-1.50-geometry-primitive-types GL_LINES_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_LINE_STRIP
- glsl-1.50-geometry-primitive-types GL_LINE_STRIP_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_TRIANGLES
- glsl-1.50-geometry-primitive-types GL_TRIANGLES_ADJACENCY
- glsl-1.50-geometry-primitive-types GL_TRIANGLE_FAN

Exposes previously hidden failures in the following piglit tests:
- glsl-1.50-geometry-primitive-id-restart GL_LINES other
- glsl-1.50-geometry-primitive-id-restart GL_LINES_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_LOOP ffs
- glsl-1.50-geometry-primitive-id-restart GL_LINE_LOOP other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_STRIP other
- glsl-1.50-geometry-primitive-id-restart GL_LINE_STRIP_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLES other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLES_ADJACENCY other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_FAN ffs
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_FAN other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_STRIP other
- glsl-1.50-geometry-primitive-id-restart GL_TRIANGLE_STRIP_ADJACENCY other

(These failures were previously hidden due to a flaw in the test: it
doesn't check for GL errors. I'll fix the test shortly).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
cd18269705c948f5141478a48cf82a1fddd06b83 25-May-2013 Fabian Bieler <fabianbieler@fastmail.fm> mesa/main: Check for 0 size draws after validation.

When validating draw parameters move check for 0 draw count last
(drawing with count 0 is not an error), so that other parameters (e.g.: the
primitive type) are validated and the correct errors (if applicable) are
generated.

>From the OpenGL 3.3 spec page 33 (page 48 of the PDF):
"[Regarding DrawArraysOneInstance, in terms of which other draw operations
are defined:]
If count is negative, an INVALID_VALUE error is generated."

This patch also changes the bahavior of MultiDrawElements to perform the draw
operation if some primitive's index counts are zero.

Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
/external/mesa3d/src/mesa/main/api_validate.c
8cdbe8394e01964a362649d0aa69ce7d48124373 25-May-2013 Fabian Bieler <fabianbieler@fastmail.fm> mesa: Validate the drawing primitive against the geometry shader input primitive type.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
b272a01879d6d5e952b37f574fa85ed7f785abc5 28-Jul-2013 Paul Berry <stereotype441@gmail.com> main: Allow for the possibility of GL 3.2 without ARB_geometry_shader4.

Previously, we assumed that the only way Mesa would expose geometry
shader support was via the ARB_geometry_shader4 extension. But this
extension has some extra complications over GL 3.2 (interactions with
compatibility-only features, and link-time initialization of the
constant gl_VerticesIn). So we want to allow for the possibility of
supporting GL 3.2 (with GLSL 1.50 style geometry shaders) even if
ctx->Extensions.ARB_geometry_shader4 is false.

This patch adds a new function, _mesa_has_geometry_shaders(), which
returns true if either ARB_geometry_shader4 is supported or the GL
version is at least 3.2 desktop. Since compute_version() only enables
GL 3.2 functionality when GLSL 1.50 support is present, a sufficient
way for a back-end to advertise geometry shader support is to set
ctx->Const.GLSLVersion >= 150.

v2: Remove unnecessary ctx->Const.GeometryShaders150 constant.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
3998cfa933dcd9134b75d9f0ae2c9cfcd6f2ee45 05-Jun-2013 Rico Schüller <kgbricola@web.de> mesa: remove outdated version lines in comments

Signed-off-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
bb459f6295736d55ab5855d7b19e5e49aaf9af41 02-May-2013 Brian Paul <brianp@vmware.com> mesa: refactor _mesa_valid_prim_mode()

...in terms of new _mesa_is_valid_prim_mode(). We need a mode validater
function that doesn't depend on current state for the display list code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
3d8d5b298a268b119d840bc9bae0ee9e0c9244a9 21-Apr-2013 Kenneth Graunke <kenneth@whitecape.org> mesa: Restore 78-column wrapping of license text in C-style comments.

The previous commit introduced extra words, breaking the formatting.

This text transformation was done automatically via the following shell
command:
$ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript

where 'vimscript' is a file containing:
/THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * '
:wq

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
96ff2edc73ccf11d4d198ba3665507f73ae4a9f7 21-Apr-2013 Kenneth Graunke <kenneth@whitecape.org> mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.

This brings the license text in line with the MIT License as published
on the Open Source Initiative website:

http://opensource.org/licenses/mit-license.php

Generated automatically be the following shell command:
$ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {}

This introduces some wrapping issues, to be fixed in the next commit.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
dd404bc94f78a1766527becee03f8ef6ae3a799b 21-Apr-2013 Kenneth Graunke <kenneth@whitecape.org> mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.

Generated automatically be the following shell command:
$ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \
sed -i 's/BRIAN PAUL/THE AUTHORS/' {}

The intention here is to protect all authors, not just Brian Paul. I
believe that was already the sensible interpretation, but spelling it
out is probably better.

More practically, it also prevents people from accidentally copy &
pasting the license into a new file which says Brian is not liable when
he isn't even one of the authors.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
b76f6d9557ff27140e18cf8aa2b57db8876d5d4d 17-Apr-2013 Brian Paul <brianp@vmware.com> mesa: remove #include "mfeatures.h" from numerous source files

None of the remaining FEATURE_x symbols in mfeatures.h are used anymore.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
a9754793dab4b24c09cae21c29f902ce0e53319a 17-Jan-2013 Eric Anholt <eric@anholt.net> mesa: Drop manual checks for outside begin/end.

We now have a separate dispatch table for begin/end that prevent these
functions from being entered during that time. The
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVALs are left because I don't want to
change any return values or introduce new error-only stubs at this
point.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
5b7099c74d7774dc59895536bad53bd1196e398c 15-Dec-2012 Paul Berry <stereotype441@gmail.com> mesa: Make a function is_transform_feedback_active_and_unpaused.

The rather unweildy logic for determining this condition was repeated
in a large number of places. This patch consolidates it to a single
inline function.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
b87e65c3b61caeaa4f97a34d62e148e59a0dd5b8 13-Dec-2012 Paul Berry <stereotype441@gmail.com> mesa/gles3: Generate error on draw call if transform feedback would overflow.

In desktop GL, if a draw call would cause transform feedback buffers
to overflow, the draw call should succeed, and the extra primitives
should simply not be recorded in the transform feedback buffers.

In GLES3, however, if a draw call would cause transform feedback
buffers to overflow, the draw call is supposed to produce an
INVALID_OPERATION error and no drawing should occur.

This patch implements the GLES3-required behaviour.

Fixes GLES3 conformance test "transform_feedback_overflow.test".

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
febc237141ab06a478d05752dedc858c2b4b8599 14-Dec-2012 Paul Berry <stereotype441@gmail.com> mesa/gles3: Generate error on DrawElements* calls if transform feedback active.

In GLES3, only glDrawArrays() and glDrawArraysInstanced() calls are
allowed when transform feedback is active.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
dbd6135bc1ba285128ab991c03c4df6fbd6fefe8 27-Nov-2012 Paul Berry <stereotype441@gmail.com> mesa: Rename API_OPENGL to API_OPENGL_COMPAT.

This should help avoid confusion now that we're using the gl_api enum
to distinguishing between core and compatibility API's. The
corresponding enum value for core API's is API_OPENGL_CORE.

Acked-by: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
198fa6452bf4cb7e5468263af5447932537c5314 23-Sep-2012 Brian Paul <brianp@vmware.com> mesa: remove ASSERT_NO_FEATURE macro

Was only used in one place.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
dda982f1a7f1b8f525894e01975e69b262696153 11-Sep-2012 Oliver McFadden <oliver.mcfadden@linux.intel.com> mesa: remove FEATURE_EXT_transform_feedback define.

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
009250a096cdf2babc8d87defa05309e96b8bba2 11-Sep-2012 Oliver McFadden <oliver.mcfadden@linux.intel.com> mesa: remove FEATURE_es2_glsl and related defines.

Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
6a9b8f897a8b59fae03c73e05203bc708fb17793 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
72e076cb17e47c608fa6534641653cdc6133fb27 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Refactor _mesa_valid_prim_mode to use a switch-statement

This makes the next change a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
a33f360e8f8138c5b37b5e33324283e764d0750c 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Refactor element type checking into its own function

This consolidates the tests and makes the emitted error message
consistent.

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

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
09714c09a40501d82823e42f7461d7b8d7bf11c0 19-Jul-2012 Jordan Justen <jordan.l.justen@intel.com> mesa: add support for using API_OPENGL_CORE

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
db7404defd47aa22082b52a6a31a08fb39fab626 18-Dec-2011 Marek Olšák <maraeo@gmail.com> mesa: implement new DrawTransformFeedback functions

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
9f0f2f9512c3c9dcf875efa490b587f010b260c1 02-Jul-2012 Marek Olšák <maraeo@gmail.com> mesa: use FLUSH_CURRENT and not FLUSH_VERTICES in _mesa_validate_*

ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL calls FLUSH_VERTICES, which
is not what we want.

This fixes a breakage in classic drivers, introduced in:

62b971673950148eb949ba23d7fdc47debea16f0
vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around

It should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=51629
https://bugs.freedesktop.org/show_bug.cgi?id=51642

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
fcebb157f0eb6c2f374dee609a01b0b14856e7fc 27-Jun-2012 Marek Olšák <maraeo@gmail.com> vbo: optimize validation for glMultiDrawElements

Some parameters need to be checked only once.
check_valid_to_render needs to be called only once.

The validate function is based on the one for DrawElements.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
62b971673950148eb949ba23d7fdc47debea16f0 27-Jun-2012 Marek Olšák <maraeo@gmail.com> vbo: first ASSERT_OUTSIDE_BEGIN_END then FLUSH, not the other way around

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
56118ef9292caa947216d6b0a75c6ae588419556 14-Mar-2012 Eric Anholt <eric@anholt.net> mesa: Validate the drawing primitive against the transform feedback mode.

Fixes piglit GL_EXT_transform_feedback/negative-prims.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
7ca4f07b5b77ccac0a9b60dc5ac9082906b5947e 14-Mar-2012 Eric Anholt <eric@anholt.net> mesa: Fold error generation into _mesa_valid_prim_mode().

We want to start emitting an INVALID_OPERATION from here for transform
feedback. Note that this forced dlist.c to almost not use this
function, since it wants different behavior during dlist compile.
Just pull the non-TF, non-GS test out for compile, because:

1) TF doesn't matter in that case because there's no drawing.
2) I don't think we're going to see GSes and display lists in the same
context, if we don't do GL_ARB_compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
767ba60831657a684e3852c398a0d13d1201158f 28-Feb-2012 Eric Anholt <eric@anholt.net> mesa: Add missing error check for first < 0 in glDrawArraysInstanced().

Fixes piglit GL_ARB_draw_instanced/negative-arrays-first-negative.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
3c69a18b6a9f292542672c58bb324a69b750a208 28-Feb-2012 Eric Anholt <eric@anholt.net> mesa: Fix display list handling for GL_ARB_draw_instanced.

When you called them in a display list compile before, you would just
end up calling through NULL.

Fixes piglit GL_ARB_draw_instanced/dlist.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
1f4a853b1e4691400ab832c589b044b659c20c06 06-Feb-2012 Roland Scheidegger <sroland@vmware.com> mesa: check_index_bounds off-by-one fix

in check_index_bounds the comparison needs to be "greater equal" since
contrary to the name _MaxElement is the count of the array (this matches
similar code in vbo_exec_DrawRangeElementsBaseVertex).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
/external/mesa3d/src/mesa/main/api_validate.c
42d4972bf0b147b0241c2be7e6579fd64cf2c216 31-Dec-2011 Yuanhan Liu <yuanhan.liu@linux.intel.com> vbo: introduce vbo_get_minmax_indices function

Introduce vbo_get_minmax_indices() function to handle the min/max index
computation for nr_prims(>= 1). The old code just compute the first
prim's min/max index; this would results an error rendering if user
called functions like glMultiDrawElements(). This patch servers as
fixing this issue.

As when nr_prims = 1, we can pass 1 to paramter nr_prims, thus I made
vbo_get_minmax_index() static.

v2: per Roland's suggestion, put the indices address compuation into
vbo_get_minmax_index() instead.

Also do comination if possible to reduce map/unmap count

v3: per Brian's suggestion, use a pointer for start_prim to avoid
structure copy per loop.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
14bb957b996dcc5392b8fa589bd3ffa5c55cb6b4 09-Dec-2011 Marek Olšák <maraeo@gmail.com> mesa: implement DrawTransformFeedback from ARB_transform_feedback2

It's like DrawArrays, but the count is taken from a transform feedback
object.

This removes DrawTransformFeedback from dd_function_table and adds the same
function to GLvertexformat (with the function parameters matching GL).

The vbo_draw_func callback has a new parameter
"struct gl_transform_feedback_object *tfb_vertcount".

The rest of the code just validates states and forwards the transform
feedback object into vbo_draw_func.
/external/mesa3d/src/mesa/main/api_validate.c
762c9766c93697af8d7fbaa729aed118789dbe8e 31-Oct-2011 Mathias Fröhlich <Mathias.Froehlich@web.de> mesa: Use VERT_ATTRIB_* indexed array in gl_array_object.

Replace the distinct struct gl_client_array members in gl_array_object by
an array of gl_client_arrays indexed by VERT_ATTRIB_*.
Renumber the vertex attributes slightly to keep the old semantics of the
distinct array members. Make use of the upper 32 bits in VERT_BIT_*.
Update all occurances of the distinct struct members with the array
equivalents.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
a0a5bd4bb30a73c10b02c3c3b914940a03f9b790 23-Nov-2011 Yuanhan Liu <yuanhan.liu@linux.intel.com> mesa: move ElementArrayBufferObj to gl_array_object

According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
page 515, the element buffer object is listed in vertex array object.

So, move the ElementArrayBufferObj inside gl_array_object to make
element buffer object per-vao.

This would fix most of(3 left) intel oglc vao test fail

NOTE: this is a candidate for the 7.11 branch.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
0e6646db3248057b7750031d825535cd7a0e5aec 21-Sep-2011 Brian Paul <brianp@vmware.com> mesa: check glBegin()/glDrawArrays()/etc mode with _mesa_valid_prim_mode()

We now raise an GL_INVALID_ENUM in glBegin() if mode is illegal, as was
done in Yuanhan Liu's original patch.

Take geometry shaders support into account too.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
/external/mesa3d/src/mesa/main/api_validate.c
28249bd260f4c52badf3eb61ade2744604b21bca 22-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Eliminate dd_function_table::MapBuffer

Replace all calls to dd_function_table::MapBuffer with appropriate
calls to dd_function_table::MapBufferRange, then remove all the cruft.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
12d924c5ae14a1c6a05a3dcae29b77e7668e227d 22-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Remove target parameter from dd_function_table::MapBuffer

No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
56f0c00f125ee75caeadc1c9e8cab8a488635e5e 22-Aug-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Remove target parameter from dd_function_table::UnmapBuffer

No driver used that parameter, and most drivers ended up with a bunch
of unused-parameter warnings because it was there.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
/external/mesa3d/src/mesa/main/api_validate.c
09201cc7a0c4c50871bb8aa5d00ac70aa4e9e670 31-May-2011 Pierre-Eric Pelloux-Prayer <pelloux@gmail.com> mesa: add implementation of glDrawElementsInstancedBaseVertex

Signed-off-by: Brian Paul <brianp@vmware.com>
/external/mesa3d/src/mesa/main/api_validate.c
43bdabd47d98975b56a759954fb5f37d2942c101 19-May-2011 Brian Paul <brianp@vmware.com> mesa: fix vertex array enable checking in check_valid_to_render()

In particular, this fixes the case where a vertex shader only uses
generic vertex attributes (non-0th). Before, we were no-op'ing the
glDrawArrays/Elements().

This fixes the new piglit pos-array test.

NOTE: This is a candidate for the 7.10 branch.
/external/mesa3d/src/mesa/main/api_validate.c
72f2551017e03f888d63fa9040120740c6d40620 17-Jan-2011 Brian Paul <brianp@vmware.com> mesa: s/primcount/numInstances/

primcount is also a parameter to glMultiDrawElements(). Use numInstances
to avoid confusion between these things.
/external/mesa3d/src/mesa/main/api_validate.c
6bf0ac0916bf09e049b378d94478035072efed53 07-Nov-2010 Vinson Lee <vlee@vmware.com> mesa: Include mfeatures.h in api_validate.c for FEATURE_* symbols.
/external/mesa3d/src/mesa/main/api_validate.c
f9995b30756140724f41daf963fa06167912be7f 12-Oct-2010 Kristian Høgsberg <krh@bitplanet.net> Drop GLcontext typedef and use struct gl_context instead
/external/mesa3d/src/mesa/main/api_validate.c
df0831f3750918ce3cd9cc1f5610bafc8b87c8e4 11-Jul-2010 Zack Rusin <zackr@vmware.com> mesa: GL_TRIANGLE_STRIP_ADJACENCY_ARB is the last valid primitive
/external/mesa3d/src/mesa/main/api_validate.c
f67b020a942911f80b7b774c6d64701d1981c608 24-May-2010 Kristian Høgsberg <krh@bitplanet.net> mesa: Handle FEATURE_es2_glsl differences at runtime too

Now that we can support different APIs at runtime, we need to check the
context for the API we're currently providing as well.

https://bugs.freedesktop.org/show_bug.cgi?id=28194
/external/mesa3d/src/mesa/main/api_validate.c
cf3193ad1cd75b847c5d626def701a4bb012d080 05-Apr-2010 Brian Paul <brianp@vmware.com> mesa: new validation functions for GL_ARB_draw_instanced
/external/mesa3d/src/mesa/main/api_validate.c
e9968ebfa40b4740601c1596950ebd3f168664b0 05-Mar-2010 Brian Paul <brianp@vmware.com> mesa: minor reformatting, new comments
/external/mesa3d/src/mesa/main/api_validate.c
391b396f3fb300a912e6d9bfbf26f49cc30e52df 05-Mar-2010 Michel Dänzer <daenzer@vmware.com> Fix comparison of unsigned value against < 0.
/external/mesa3d/src/mesa/main/api_validate.c
34b2cec95c9e7781f4d32deed9980f05ee553d1d 04-Mar-2010 Vinson Lee <vlee@vmware.com> Revert "mesa: Fix unsigned comparison."

This reverts commit f9504e75f02586a8561733e0e2711c65efa2979d.

This patch is incorrect.
/external/mesa3d/src/mesa/main/api_validate.c
f9504e75f02586a8561733e0e2711c65efa2979d 04-Mar-2010 Vinson Lee <vlee@vmware.com> mesa: Fix unsigned comparison.
/external/mesa3d/src/mesa/main/api_validate.c
980fa564e4c01c7b95099a13fb2d8926c510da01 31-Jan-2010 Vinson Lee <vlee@vmware.com> mesa: Remove unnecessary headers.
/external/mesa3d/src/mesa/main/api_validate.c
a38859569dca1d8b139c4c451499bf6e328379e9 29-Jan-2010 Brian Paul <brianp@vmware.com> mesa: do state validation in _mesa_valid_to_render()

...rather than checking/validating before all the calls to
_mesa_valid_to_render() and valid_to_render().

The next patch will actually fix some bugs...

(cherry picked from commit 23eda89ec89e2bd5bc26077bd56e8d6b5d4040d4)
/external/mesa3d/src/mesa/main/api_validate.c
e5d29ebb5e5dd923c9c60972170d072120007aab 21-Sep-2009 Brian Paul <brianp@vmware.com> mesa: make max_buffer_index() a non-static function
/external/mesa3d/src/mesa/main/api_validate.c
92d7ed8a20d4a018ce5324e6537ae7b478b9e5bf 27-Aug-2009 Eric Anholt <eric@anholt.net> mesa: Add support for ARB_draw_elements_base_vertex.
/external/mesa3d/src/mesa/main/api_validate.c
b6e5600bd460245afef605dbfbcf6650ff677dcb 14-Aug-2009 Brian Paul <brianp@vmware.com> mesa: call _mesa_valid_to_render()
/external/mesa3d/src/mesa/main/api_validate.c
a48b0a5ce7fc17eab4daa375fb95768fa2f50825 14-Aug-2009 Brian Paul <brianp@vmware.com> mesa: minor error string changes
/external/mesa3d/src/mesa/main/api_validate.c
434ec3ada841915a00ffc23f699401eb3e7b37ee 12-Aug-2009 Brian Paul <brianp@vmware.com> mesa: use _mesa_is_bufferobj()
/external/mesa3d/src/mesa/main/api_validate.c
8d482227915552c414e13743652e6794c4313ae2 17-Jun-2009 Brian Paul <brianp@vmware.com> Merge branch 'mesa_7_5_branch'

Conflicts:

src/mesa/main/api_validate.c
37f2117cd132527ebf89f9294b2f35db87326460 15-Jun-2009 José Fonseca <jfonseca@vmware.com> mesa: Use integer type with appropriate sign.
/external/mesa3d/src/mesa/main/api_validate.c
a185bcbdec856cc98c26098e4e447a683eed14d1 14-May-2009 Brian Paul <brianp@vmware.com> mesa: move gl_array_attrib::_MaxElement to gl_array_object::_MaxElement

This value is per array object.
/external/mesa3d/src/mesa/main/api_validate.c
87fbc9a14ed2bdd24d84c38431abbf7b0c275998 08-May-2009 Brian Paul <brianp@vmware.com> mesa: issue warning for out of bounds array indexes
/external/mesa3d/src/mesa/main/api_validate.c
58544a28ad561d7d9e16deb048443c2d2b5c12d8 06-May-2009 Brian Paul <brianp@vmware.com> mesa: remove unnecessary buffer size check
/external/mesa3d/src/mesa/main/api_validate.c
bb1fb2a5444c6b7d83ccb47949f60ed9fb4f0f93 06-May-2009 Brian Paul <brianp@vmware.com> mesa: code consolidation in glDraw[Range]Elements() validation
/external/mesa3d/src/mesa/main/api_validate.c
88af3f8783452dcf50a9e2e82076f52b2044f643 06-May-2009 Brian Paul <brianp@vmware.com> mesa: new comments, minor reformatting
/external/mesa3d/src/mesa/main/api_validate.c
a13df193c23f9202ade6f16643e3ef529cff772b 06-May-2009 Brian Paul <brianp@vmware.com> mesa: use elementBuf local var instead of ctx->Array.ElementArrayBufferObj

Makes no real difference, but more consistant.
/external/mesa3d/src/mesa/main/api_validate.c
97dd2ddbd97ba95e8bc8ab572ec05e8081556e1e 02-Mar-2009 Brian Paul <brianp@vmware.com> mesa: don't draw arrays if vertex position array is not enabled

For regular GL, we must have vertex positions in order to draw. But ES2
doesn't have that requirement (positions can be computed from any array
of data).

See bug 19911.
/external/mesa3d/src/mesa/main/api_validate.c
263b96e160606975285154c4b8b610fcb8f4c930 15-Jan-2009 Alan Hourihane <alanh@vmware.com> mesa: check frambuffer complete status before rendering
/external/mesa3d/src/mesa/main/api_validate.c
0397b2bb41b0f337af2949a15bcd7d0e7e8a7dc1 11-Sep-2008 Keith Whitwell <keith@tungstengraphics.com> Merge branch 'gallium-0.1' into gallium-0.2

A first attempt at moving gallium onto a branch directly off master...

It will be interesting to see how much work this takes to get running.

Have resolved the conflicts semi-arbitarily, not compiled or tested.

Conflicts:

.gitignore
Makefile
configs/config.mgw
configs/darwin
configs/darwin-x86ppc
configs/default
configs/freebsd-dri
configs/linux-dri
configs/linux-dri-xcb
configs/linux-fbdev
configs/linux-static
configs/linux-x86-64-static
configs/linux-x86-static
doxygen/Makefile
include/GL/gl.h
progs/demos/Makefile
progs/demos/descrip.mms
progs/demos/texenv.c
progs/egl/.gitignore
progs/egl/Makefile
progs/glsl/.gitignore
progs/glsl/Makefile
progs/glsl/convolutions.c
progs/samples/Makefile.mgw
progs/tests/.gitignore
progs/trivial/.gitignore
progs/trivial/point-param.c
progs/trivial/tri.c
progs/xdemos/.gitignore
progs/xdemos/glthreads.c
src/egl/drivers/demo/Makefile
src/egl/drivers/dri/Makefile
src/egl/main/Makefile
src/glu/Makefile
src/glu/sgi/Makefile
src/glu/sgi/Makefile.mgw
src/glut/glx/Makefile.mgw
src/glut/os2/WarpWin.cpp
src/glut/os2/glut_cindex.cpp
src/glut/os2/glut_gamemode.cpp
src/glut/os2/glut_win.cpp
src/glut/os2/glut_winmisc.cpp
src/glut/os2/os2_glx.cpp
src/glut/os2/os2_menu.cpp
src/glut/os2/os2_winproc.cpp
src/glw/Makefile
src/glx/x11/dri_glx.c
src/glx/x11/glxext.c
src/mesa/Makefile
src/mesa/Makefile.mgw
src/mesa/descrip.mms
src/mesa/drivers/beos/Makefile
src/mesa/drivers/common/descrip.mms
src/mesa/drivers/common/driverfuncs.c
src/mesa/drivers/directfb/Makefile
src/mesa/drivers/dri/Makefile.template
src/mesa/drivers/dri/common/dri_bufmgr.c
src/mesa/drivers/dri/common/dri_bufmgr.h
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/extension_helper.h
src/mesa/drivers/dri/common/mmio.h
src/mesa/drivers/dri/common/utils.c
src/mesa/drivers/dri/common/utils.h
src/mesa/drivers/dri/glcore/Makefile
src/mesa/drivers/dri/i810/i810screen.c
src/mesa/drivers/dri/i915/intel_ioctl.c
src/mesa/drivers/dri/i915/intel_ioctl.h
src/mesa/drivers/dri/i915/intel_screen.c
src/mesa/drivers/dri/i915/server/i830_common.h
src/mesa/drivers/dri/i915/server/i830_dri.h
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/server/i830_common.h
src/mesa/drivers/dri/i965/server/i830_dri.h
src/mesa/drivers/dri/mach64/mach64_screen.c
src/mesa/drivers/dri/nouveau/nouveau_context.h
src/mesa/drivers/dri/nouveau/nouveau_fifo.c
src/mesa/drivers/dri/nouveau/nouveau_fifo.h
src/mesa/drivers/dri/nouveau/nouveau_screen.c
src/mesa/drivers/dri/nouveau/nouveau_screen.h
src/mesa/drivers/dri/r128/r128_tex.h
src/mesa/drivers/dri/savage/savageioctl.h
src/mesa/drivers/fbdev/Makefile
src/mesa/drivers/osmesa/Makefile
src/mesa/drivers/osmesa/descrip.mms
src/mesa/drivers/x11/Makefile
src/mesa/drivers/x11/descrip.mms
src/mesa/drivers/x11/xm_dd.c
src/mesa/glapi/glapi.c
src/mesa/glapi/glthread.c
src/mesa/main/api_validate.c
src/mesa/main/attrib.c
src/mesa/main/bufferobj.c
src/mesa/main/bufferobj.h
src/mesa/main/buffers.c
src/mesa/main/config.h
src/mesa/main/context.c
src/mesa/main/descrip.mms
src/mesa/main/drawpix.c
src/mesa/main/enums.c
src/mesa/main/fbobject.c
src/mesa/main/glheader.h
src/mesa/main/imports.c
src/mesa/main/mipmap.c
src/mesa/main/mm.c
src/mesa/main/mm.h
src/mesa/main/mtypes.h
src/mesa/main/points.c
src/mesa/main/sources
src/mesa/main/state.c
src/mesa/main/texcompress_fxt1.c
src/mesa/main/texenvprogram.c
src/mesa/main/texobj.c
src/mesa/main/texstate.c
src/mesa/main/texstore.c
src/mesa/math/descrip.mms
src/mesa/shader/arbprogram.c
src/mesa/shader/descrip.mms
src/mesa/shader/prog_execute.c
src/mesa/shader/prog_statevars.c
src/mesa/shader/prog_statevars.h
src/mesa/shader/prog_uniform.c
src/mesa/shader/program.c
src/mesa/shader/program.h
src/mesa/shader/shader_api.c
src/mesa/shader/slang/descrip.mms
src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
src/mesa/sources
src/mesa/swrast/descrip.mms
src/mesa/swrast/s_drawpix.c
src/mesa/swrast/s_fragprog.c
src/mesa/swrast/s_readpix.c
src/mesa/swrast/s_span.c
src/mesa/swrast_setup/descrip.mms
src/mesa/tnl/descrip.mms
src/mesa/tnl/t_context.h
src/mesa/tnl/t_vp_build.c
src/mesa/tnl/tnl.h
src/mesa/vbo/descrip.mms
src/mesa/vbo/vbo_context.c
src/mesa/vbo/vbo_exec_array.c
src/mesa/x86-64/xform4.S
src/mesa/x86/rtasm/x86sse.c
src/mesa/x86/rtasm/x86sse.h
windows/VC6/progs/glut/glut.dsp
windows/VC7/mesa/gdi/gdi.vcproj
windows/VC7/mesa/glu/glu.vcproj
windows/VC7/mesa/mesa.sln
windows/VC7/mesa/mesa/mesa.vcproj
windows/VC7/mesa/osmesa/osmesa.vcproj
windows/VC7/progs/glut/glut.vcproj
windows/VC8/mesa/gdi/gdi.vcproj
windows/VC8/mesa/glu/glu.vcproj
windows/VC8/mesa/mesa.sln
windows/VC8/mesa/mesa/mesa.vcproj
windows/VC8/progs/glut/glut.vcproj
1ca23061478868d61b9b2e6a30367e8e1de4a456 03-Jul-2008 Brian Paul <brian.paul@tungstengraphics.com> mesa: fix vertex array validation test for attribute 0 (vert pos)

We don't actually need vertex array[0] enabled when using a vertex
program/shader.

cherry-picked from master
/external/mesa3d/src/mesa/main/api_validate.c
b3e1f9bd521ab25fc1cb313902cd77c6c274a918 03-Jul-2008 Brian Paul <brian.paul@tungstengraphics.com> mesa: fix vertex array validation test for attribute 0 (vert pos)

We don't actually need vertex array[0] enabled when using a vertex
program/shader.
/external/mesa3d/src/mesa/main/api_validate.c
53174afeeb68a79e471185cb463c13ff90af698f 31-May-2008 José Fonseca <jrfonseca@tungstengraphics.com> mesa: Apply MSVC portability fixes from Alan Hourihane.
/external/mesa3d/src/mesa/main/api_validate.c
5cb203433ab5c4e54a7386a816263a237c716aa2 31-Oct-2007 Brian <brian.paul@tungstengraphics.com> check for count==0 in _mesa_validate_DrawArrays()
/external/mesa3d/src/mesa/main/api_validate.c
ef5935bc94a1439eb8f1731732a3eabd0e360407 23-Sep-2007 Brian <brian.paul@tungstengraphics.com> fix DrawRangeElements error msg
/external/mesa3d/src/mesa/main/api_validate.c
730df7662f57a46dee892733afc9a55f37d2ab03 20-Aug-2007 Brian <brian.paul@tungstengraphics.com> don't map element buffer in _mesa_validate_DrawElements() unless necessary
/external/mesa3d/src/mesa/main/api_validate.c
d8c6719f95b1543296ac954f95d13b048ae48634 20-Aug-2007 Brian <brian.paul@tungstengraphics.com> refactor bounds checking code
/external/mesa3d/src/mesa/main/api_validate.c
a3c3bc9ece7e7c55c8832dbc8c50ab1c34f5bfe9 20-Aug-2007 Brian <brian.paul@tungstengraphics.com> don't map buffer in _mesa_validate_DrawElements() unless needed
/external/mesa3d/src/mesa/main/api_validate.c
2394d20dafdfa308d494fc739c63c6a4e91c8185 30-Jul-2007 Xiang, Haihao <haihao.xiang@intel.com> Fix an error in _mesa_validate_DrawElements

The field 'Data' in an obj is NULL in some dri drivers(such
as i965). Use mapped pointer instead.
/external/mesa3d/src/mesa/main/api_validate.c
37ece4df7c654b30b6720044b35a83694d7e5bb3 08-Jul-2007 Brian <brian.paul@tungstengraphics.com> Check if 'indices' parameter is NULL (bug 11314)
/external/mesa3d/src/mesa/main/api_validate.c
ee34e6ef716bb630440299ac1efbc2055ef09ffd 12-Jun-2006 Ian Romanick <idr@us.ibm.com> Add support for GL_APPLE_vertex_array_object. Several test programs
and demos are also added.

Adding basic support to drivers should be as easy as just enabling the
extension, though thorough test would also be required.
/external/mesa3d/src/mesa/main/api_validate.c
6d460af6af77a0d5a5b568bcd6094b98e249ba93 23-Apr-2004 Brian Paul <brian.paul@tungstengraphics.com> Added ctx->Vertex/FragmentProgram._Enable flags. Set when vertex/fragment
program is enabled AND the currently bound program is valid.
Check _Enable instead of Enable to prevent things from blowing up
when someone calls glEnable(GL_VERTEX_PROGRAM_ARB) without actually
defining a program.
/external/mesa3d/src/mesa/main/api_validate.c
ffa7eff9ff459060364f0ed93865351f7fc15035 24-Feb-2004 Brian Paul <brian.paul@tungstengraphics.com> glDrawArrays loop was wrong
/external/mesa3d/src/mesa/main/api_validate.c
03e29a5f77c13b7b888bd8443cb2752850e47d6a 04-Dec-2003 Brian Paul <brian.paul@tungstengraphics.com> Fix some problems with glDrawElements and vertex buffer objects.
/external/mesa3d/src/mesa/main/api_validate.c
2c9f50dd4acc65ddfeb8e3fde98137711167e579 25-Nov-2003 Brian Paul <brian.paul@tungstengraphics.com> casts for g++
/external/mesa3d/src/mesa/main/api_validate.c
a2b9bad251b058f6255fa037b842c5465c0609a2 10-Nov-2003 Brian Paul <brian.paul@tungstengraphics.com> Redo array element checking for vertex array buffers.
Now, compute ctx->Array._MaxElement as the min of enabled array's max element.
Test against ctx->Array._MaxElement in glDrawArrays/Elements.
Note: testing in glArrayElement not done yet.
Only do element checking if ctx->Const.CheckArrayBounds is set.
/external/mesa3d/src/mesa/main/api_validate.c
c5b1e81de48de5d8830bf5d92ff767ad1985e46e 23-Oct-2003 Brian Paul <brian.paul@tungstengraphics.com> Initial work for bounds checking of vertex arrays and vertex buffer objects.
Only glDrawArrays() done so far.
Simplified glVertex/Color/etcPointer functions.
Misc casts added here and there.
/external/mesa3d/src/mesa/main/api_validate.c
9ac51f57efe07ed43a1e4224a7f5daddec401b36 05-Jun-2003 Ian Romanick <idr@us.ibm.com> Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything.
/external/mesa3d/src/mesa/main/api_validate.c
464bc3b6747108dd32e4a9fcfe6549a9d4a52a95 21-Apr-2003 Brian Paul <brian.paul@tungstengraphics.com> remove unneeded unsigned int / zero comparisons
/external/mesa3d/src/mesa/main/api_validate.c
3c63452e64df7e10aa073c6c3b9492b1d7dabbb8 25-Oct-2002 Brian Paul <brian.paul@tungstengraphics.com> Header file clean-up:
1. Remove all.h and PC_HEADER junk.
2. Rolled mem.c and mem.h into imports.c and imports.h
3. Include imports.h instead of mem.h
Restore _mesa_create/initialize_context() to be like they were in 4.0.4
New wrappers for a few std C functions: _mesa_atoi(), _mesa_strstr(), etc.
/external/mesa3d/src/mesa/main/api_validate.c
61bac6014aa15e0bec134e290aebac18f9815299 21-Apr-2002 Brian Paul <brian.paul@tungstengraphics.com> check for vertex program mode
/external/mesa3d/src/mesa/main/api_validate.c
22144ab7552f0799bcfca506bf4ffa7f70a06649 12-Mar-2001 Gareth Hughes <gareth@valinux.com> Consistent copyright info (version number, date) across all files.
/external/mesa3d/src/mesa/main/api_validate.c
08836341788a9f9d638d9dc8328510ccd18ddeb5 03-Mar-2001 Brian Paul <brian.paul@tungstengraphics.com> lots of gl_*() to _mesa_*() namespace clean-up
/external/mesa3d/src/mesa/main/api_validate.c
58e991705392a2e17a1c8b034f4083a0adaf1943 05-Jan-2001 Keith Whitwell <keith@tungstengraphics.com> Remove 'pv' parameter from Line/Tri/Point funcs. The provoking vertex
is always the last vertex parameter.
Modify clipping to preserve pv colors.
Modify swrast and X11 driver to expect the pv in the last vertex
(was looking in the first vertex previously).
Remove all handling of flatshading from swrast_setup.

Allow drivers to override the unclipped render tabs in tnl_render_stage
directly. (Like in 3.4). Removed fxsimplerender stage.

Modified t_vb_rendertmp.h to remove the need for 'parity' arguments
in RENDER_TRI macros.
/external/mesa3d/src/mesa/main/api_validate.c
8446d1bab15ef82b35b8980a0a56072ace6feb04 02-Jan-2001 Brian Paul <brian.paul@tungstengraphics.com> include state.h
/external/mesa3d/src/mesa/main/api_validate.c
cab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290 26-Dec-2000 Keith Whitwell <keith@tungstengraphics.com> Major rework of tnl module
New array_cache module
Support 8 texture units in core mesa (now support 8 everywhere)
Rework core mesa statechange operations to avoid flushing on many
noop statechanges.
/external/mesa3d/src/mesa/main/api_validate.c