summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Implement proper tracking logic for glGetGraphicsResetStatusARBIan Romanick2013-11-071-4/+43
| | | | | | | Drivers still have to implement dd_function_table::GetGraphicsResetStatus. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add gl_shared_state::ShareGroupReset and gl_context::ShareGroupResetIan Romanick2013-11-072-0/+20
| | | | | | | | | | These will be used to determine whether to signal a GPU reset after another context in the share group has observed a reset. v2: Change ShareGroupReset from GLboolean to bool. Suggested by Brian. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add dd_function_table::GetGraphicsResetStatusIan Romanick2013-11-071-0/+9
| | | | | | | | | | This allows drivers to determine whether a GPU reset has occured. It should return non-zero status if a reset was observed by the specified context. Another mechanism will be used to observe resets occuring in other contexts in the share group. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remove gl_context::ResetStatusIan Romanick2013-11-073-5/+1
| | | | | | | | This isn't going to be used in the actual implemenation of glGetGraphicsResetStatus. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix return statements in varray.cBrian Paul2013-11-071-2/+2
| | | | | | Return false, not GL_FALSE. Add missing return value. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71359
* mesa: Add a streaming load memcpy implementation.Matt Turner2013-11-072-0/+118
| | | | | | | Uses SSE 4.1's MOVNTDQA instruction (streaming load) to read from uncached memory without polluting the cache. Reviewed-by: Chad Versace <[email protected]>
* mesa: Add support to _mesa_bytes_per_vertex_attrib for 10_11_11 format.Chris Forbes2013-11-081-0/+5
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add varray support for UNSIGNED_INT_10F_11F_11F_REV typeChris Forbes2013-11-081-3/+17
| | | | | | | | V2: fix interaction with VertexAttribFormat, since that landed after this was originally written Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Add extension scaffolding for ARB_vertex_type_10f_11f_11f_revChris Forbes2013-11-082-0/+2
| | | | | Signed-off-by: Chris Forbes <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Enable ARB_vertex_attrib_bindingFredrik Höglund2013-11-071-0/+1
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: Optimize rebinding the same VBOFredrik Höglund2013-11-071-2/+5
| | | | | | | Check if the new buffer object has the same name as the current buffer object before looking it up. Reviewed-by: Eric Anholt <[email protected]>
* mesa: Handle zero-stride arrays in _mesa_update_array_max_element()Fredrik Höglund2013-11-071-2/+4
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add Get* support for ARB_vertex_attrib_bindingFredrik Höglund2013-11-073-0/+38
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add ARB_vertex_attrib_bindingFredrik Höglund2013-11-0716-125/+691
| | | | | | | 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 <[email protected]>
* glapi: Add infrastructure for ARB_vertex_attrib_bindingFredrik Höglund2013-11-073-6/+72
| | | | | Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Make handle_bind_buffer_gen() non-staticFredrik Höglund2013-11-072-11/+22
| | | | | | | | | | | | | | ...and rename it to _mesa_bind_buffer_gen(). This is so the function can be called from _mesa_BindVertexBuffer(). This patch also adds a caller parameter so we can report the right entry point in error messages. Based on a patch by Eric Anholt. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Rename gl_array_object::VertexAttrib to _VertexAttribFredrik Höglund2013-11-0712-128/+128
| | | | | | | | This will become derived state as part of the ARB_vertex_attrib_binding support. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Split out the format code from update_array()Fredrik Höglund2013-11-071-57/+93
| | | | | | | | | | Split out the code for updating the array format into a new function called update_array_format(). This function will be called by both update_array() and the new glVertexAttrib*Format() entry points in ARB_vertex_attrib_binding. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Restore gl_array_object::NewArrayFredrik Höglund2013-11-074-0/+10
| | | | | | | | This will be used by the ARB_vertex_attrib_binding implementation. This reverts commit db38e9a0e179441f59274f6f2a751912c29872e2. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add arm64 supportFabio Pedretti2013-11-061-1/+1
| | | | | | | Patch from Ubuntu package Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Andreas Boll <[email protected]>
* mesa: Add unreachable() macro.Matt Turner2013-11-061-0/+15
| | | | | Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: for GLSL_DUMP_ON_ERROR, also dump the info logBrian Paul2013-11-061-0/+2
| | | | | | | Since it's helpful to know why the shader did not compile. Also, call fflush() for Windows. Reviewed-by: José Fonseca <[email protected]>
* mesa: remove __alpha__ && CCPML checkBrian Paul2013-11-041-4/+0
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: remove OPENSTEP stuffBrian Paul2013-11-041-1/+1
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: remove WGLAPI macroBrian Paul2013-11-041-16/+0
| | | | | | WGLAPI was defined in glheader.h but wasn't used anywhere. Reviewed-by: Matt Turner <[email protected]>
* mesa: remove Watcom C supportBrian Paul2013-11-041-35/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove BUILD_FOR_SNAP bitsBrian Paul2013-11-042-7/+5
| | | | Reviewed-by: Eric Anholt <[email protected]>
* glsl: Add new builtins required by GL_ARB_sample_shadingAnuj Phogat2013-11-011-1/+9
| | | | | | | | | | | | | | | | New builtins added by GL_ARB_sample_shading: in vec2 gl_SamplePosition in int gl_SampleID in int gl_NumSamples out int gl_SampleMask[] V2: - Use SWIZZLE_XXXX for STATE_NUM_SAMPLES. - Use "result.samplemask" in arb_output_attrib_string. - Add comment to explain the size of gl_SampleMask[] array. - Make gl_SampleID and gl_SamplePosition system values. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Add new functions and enums required by GL_ARB_sample_shadingAnuj Phogat2013-11-017-2/+53
| | | | | | | | | | | | | | | | | | | | | | New functions added by GL_ARB_sample_shading: glMinSampleShadingARB() New enums: GL_SAMPLE_SHADING_ARB GL_MIN_SAMPLE_SHADING_VALUE_ARB V2: Update comments. Create new GL4x.xml. Remove redundant code in get.c. Update the API_XML list in Makefile.am. Add extra_gl40_ARB_sample_shading predicate to get.c. V3: Fix make check failure. Add checks for desktop GL. Use GLfloat in place of GLclampf in glMinSampleShading(). Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ken Graunke <[email protected]>
* mesa: Add infrastructure for GL_ARB_sample_shadingAnuj Phogat2013-11-012-0/+2
| | | | | | | | | | | This patch implements the common support code required for the GL_ARB_sample_shading extension. V2: Move GL_ARB_sample_shading to ARB extension list. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Ken Graunke <[email protected]>
* mesa: Add a new GetTransformFeedbackVertexCount() driver hook.Kenneth Graunke2013-10-312-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DrawTransformFeedback() needs to obtain the number of vertices written to a particular stream during the last Begin/EndTransformFeedback block. The new driver hook returns exactly that information. Gallium drivers already implement this by passing the transform feedback object to the drawing function, counting the number of vertices written on the GPU, and using draw indirect. This is efficient, but doesn't always work: If vertex data comes from user arrays, then the VBO module needs to know how many vertices to upload, so we need to synchronously count. Gallium drivers are currently broken in this case. It also doesn't work if primitive restart is done in software. For normal drawing, vbo_draw_arrays() performs software primitive restart, splitting the draw call in two. vbo_draw_transform_feedback() currently doesn't because it has no idea how many vertices need to be drawn. The new driver hook gives it that information, allowing us to reuse the existing vbo_draw_arrays() code to do everything right. On Intel hardware (at least Ivybridge), using the draw indirect approach is difficult since the hardware counts primitives, rather than vertices, which requires doing some simple math. So we always use this hook. Gallium drivers will likely want to use this hook in some cases, but want to use the existing draw indirect approach where possible. Hence, I've added a flag to allow drivers to opt-in to this call. v2: Make it possible to implement this hook but only use this path when necessary (suggested by Marek). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Separate transform feedback object initialization from allocation.Kenneth Graunke2013-10-312-5/+18
| | | | | | | | | | | Both Gallium and i965 subclass gl_transform_feedback_object, which requires implementing a custom NewTransformFeedback hook. Creating a helper function to initialize the fields avoids code duplication and divergence. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: fix some MSVC signed/unsigned compiler warningsBrian Paul2013-10-313-6/+8
|
* mesa: Drop unused return value from use_shader_programGregory Hainaut2013-10-301-5/+3
| | | | | | | | | | | | The return value has been unused since commit d348b0c. This was originally included in another patch, but it was split out by Ian Romanick. v2: Drop unnecessary final return. Suggested by Paul. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Eric Anholt <[email protected]>
* mesa: Add support for ARB_shader_atomic_counters.Francisco Jerez2013-10-2910-3/+263
| | | | | | | | | | | | | | | This patch implements the common support code required for the ARB_shader_atomic_counters extension. It defines the necessary data structures for tracking atomic counter buffer objects (from now on "ABOs") associated with some specific context or shader program, it implements support for binding buffers to an ABO binding point and querying the existing atomic counters and buffers declared by GLSL shaders. v2: Fix extension checks. Drop unused MAX_ATOMIC_BUFFERS constant. Acked-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glapi: Add support for ARB_shader_atomic_counters.Francisco Jerez2013-10-293-1/+10
| | | | | | | | Add XML file for the dispatch code generator, update the dispatch_sanity test and add stub definition for the new entry point. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Define introspection macro to determine whether a type is trivially ↵Francisco Jerez2013-10-291-1/+23
| | | | | | | | | | destructible. Only implemented on GCC and Clang for now. Other compilers use a dummy implementation that always returns false, which should be a safe [but slightly inefficient] assumption in all cases. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Generalize MSVC fix for strcasecmp().Paul Berry2013-10-291-0/+1
| | | | | | | | This will let us use strcasecmp() from anywhere inside Mesa without having to worry about the fact that it doesn't exist in MSVC. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* Remove error when calling glGenQueries/glDeleteQueries while a query is activeCarl Worth2013-10-281-15/+10
| | | | | | | | | | | | | | | | There is nothing in the OpenGL specification which prevents the user from calling glGenQueries to generate a new query object while another object is active. Neither is there anything in the Mesa implementation which prevents this. So remove the INVALID_OPERATION errors in this case. Similarly, it is explicitly allowed by the OpenGL specification to delete an active query, so remove the assertion for that case, replacing it with the necesssary state updates to end the query, (clear the bindpt pointer and call into the driver's EndQuery hook). CC: <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* mesa: Remove trailing whitespace in texparam.cRico Schüller2013-10-281-6/+6
| | | | | Signed-off-by: Rico Schüller <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* mesa: use void in _mesa_VDPAUFiniNV() as in the header fileBrian Paul2013-10-281-1/+1
|
* mesa: Add GL_NV_vdpau_interop functions to dispatch_sanity.cpp.Vinson Lee2013-10-261-0/+12
| | | | | | | | Fixes 'make check' failures introduced with commit 80964226e9b8a05c39157f9305c06c0b2861e080. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70900 Signed-off-by: Vinson Lee <[email protected]>
* implement NV_vdpau_interop v7Christian König2013-10-265-0/+521
| | | | | | | | | | | | | | | | | | | v2: Actually implement interop between the gallium state tracker and the VDPAU backend. v3: Make it also available in non legacy contexts, fix video buffer sharing. v4: deny interop if we don't have the same screen object v5: rebased on upstream changes v6: implemented VDPAUGetSurfaceivNV, improved error handling, unregister all surfaces in VDPAUFiniNV v7: squash merge with Mareks changes Signed-off-by: Christian König <[email protected]>
* mesa: Fix geometry shader program queries.Paul Berry2013-10-241-60/+40
| | | | | | | | | | | | | | | | | | | | | | | | The queries GEOMETRY_VERTICES_OUT, GEOMETRY_INPUT_TYPE, and GEOMETRY_OUTPUT_TYPE (defined by GL 3.2) differ from the corresponding queries in ARB_geometry_shader4 in the following ways: - They use different enum values - They can only be queried; they cannot be set. - Attempting to query them yields INVALID_OPERATION if the program is not linked, or lacks a geometry shader. This patch switches us over from the ARB_geometry_shader4 behaviour to the GL 3.2 behaviour. Fixes piglit test query-gs-prim-types. v2: Improve comment above has_core_gs. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Move UsesClipDistance from gl_{vertex,geometry}_program into gl_program.Paul Berry2013-10-242-7/+9
| | | | | | | | | | | | This will make it easier for back-ends to share code between geometry shader and vertex shader compilation. Also, it is renamed to "UsesClipDistanceOut" to clarify that (a) in geometry shaders, it refers to the gl_ClipDistance output rather than the gl_ClipDistance input, and (b) it is irrelevant in fragment shaders. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl/gs: Fix transform feedback of gl_ClipDistance.Paul Berry2013-10-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | Since gl_ClipDistance is lowered from an array of floats to an array of vec4's during compilation, transform feedback has special logic to keep track of the pre-lowered array size so that attempting to perform transform feedback on gl_ClipDistance produces a result with the correct size. Previously, this special logic always consulted the vertex shader's size for gl_ClipDistance. This patch fixes it so that it uses the geometry shader's size for gl_ClipDistance when a geometry shader is in use. Fixes piglit test spec/glsl-1.50/transform-feedback-type-and-size. v2: Change the type of LastClipDistanceArraySize to "unsigned", and clarify the comment above it. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa/tests: Add simple, dumb test for _mesa_program_state_stringIan Romanick2013-10-222-1/+48
| | | | | | | | | | | After some discussions about the correct way to update _mesa_program_state_string, I decided to make a unit test for the function. It turns out that the function didn't work quite the way I thought. The unit test proves that the code was already correct. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: Anuj Phogat <[email protected]>
* mesa: fixes for MSVC 2013Scott Graham2013-10-221-0/+2
| | | | | Cc: "9.2" <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: fix a couple issues with U_FIXED, I_FIXED macrosBrian Paul2013-10-221-3/+3
| | | | | | | | | | Silence a bunch of MSVC type conversion warnings. Changed return type of S_FIXED to int32_t (signed). The result is the same. It just seems more intuitive that a signed conversion function should return a signed value. Reviewed-by: Jose Fonseca <[email protected]>
* mesa: remove remnants of GL_MESA_shader_debugBrian Paul2013-10-221-3/+0
| | | | | | | | This extension never saw any real use so remove it. v2: also update tests/num_strings.cpp for 'make check' Reviewed-by: Ian Romanick <[email protected]>