aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* st-api: Have context_create explain why creation failedIan Romanick2011-12-234-5/+36
| | | | | | | | | | This won't be used in the client-side libGL, but the xserver has to generate a different protocol error depending on the reason context creation failed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* st-api: Clean-up OpenGL profile handlingIan Romanick2011-12-233-19/+44
| | | | | | | | | | | | | | | | There seems to have been two different ways to communicate the profile. There were flags and there were profiles. I've opted to remove the profile flags and use ST_PROFILE_DEFAULT (compatibility profile) and ST_PROFILE_OPENGL_CORE (core profile) consistently instead. Also change the values of the ST_CONTEXT_FLAG_DEBUG and ST_CONTEXT_FLAG_FORWARD_COMPATIBLE flags to match the WGL and GLX values. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Chia-I Wu <[email protected]>
* glx: Propagate the glXIsDirect protocol error back to the applicationIan Romanick2011-12-231-3/+26
| | | | | | | | | | | | If the server returned BadContext, the error would just get droped on the floor. Fixes the piglit test glx-import-context-single-process NOTE: This is a candidate for the 7.11 branch, but it also requires the previous patch. Signed-off-by: Ian Romanick <[email protected]>
* glx: Deliver an xlib style error to the application from an XCB errorIan Romanick2011-12-232-0/+23
| | | | Signed-off-by: Ian Romanick <[email protected]>
* vl: improve vlc functions and handlingMaarten Lankhorst2011-12-232-59/+156
| | | | | | | | | | | | | | Only initialize vlc in MPEG2 decoding once for all slices, add more sanity checks to vlc decoding functions, support multiple vlc input buffer, improve documentation of the vlc functions. v2: also implement multiple inputs for the vlc functions v3: some bug fixes for buffer size and alignment corner cases v4: rework of the patch, some more improvements Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Christian König <[email protected]>
* nouveau: Fix bugs in nouveau_video_bufferMaarten Lankhorst2011-12-232-4/+3
| | | | | | | Double free and array overflow, even if only 2 members are used the last one needs to be set to NULL explicitly. Signed-off-by: Maarten Lankhorst <[email protected]
* gallivm: Close a memory leakLauri Kasanen2011-12-221-0/+1
| | | | | | | | | | | | | | | | Hi all This fixes a memory leak of 32 bytes on exit. From 924f8fdccb41b011f372bc57252005bcdb096105 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <[email protected]> Date: Thu, 22 Dec 2011 21:28:33 +0200 Subject: [PATCH] gallivm: Close a memory leak As reported by "valgrind --leak-check=full glxgears". Signed-off-by: Lauri Kasanen <[email protected]> Signed-off-by: José Fonseca <[email protected]>
* softpipe: try and use back color for a slot if color fails.Dave Airlie2011-12-221-0/+5
| | | | | | | | | | | | | | In the case where a front and back output are specified, the draw code will copy the back output into the front color slot and everything is happy. However if no front is specified then the draw code will do a bad copy (separate patch), but also the frag shader won't pick up the color as there there is no write to COLOR from the vertex shader just BCOLOR. This patch fixes that problem so if it can't find a vertex shader output for the front color slot, it will go and lookup and use one for the back color slot. Signed-off-by: Dave Airlie <[email protected]>
* format_unpack: add 8/16 rgba/rgb types.Dave Airlie2011-12-221-0/+134
| | | | | | | | | | fixing these makes piglit fbo-integer pass on softpipe. modified to re-order things, haven't addressed Eric's concerns, can't find anything in spec that mentions sign extensions, it does say integers aren't clamped or modified. Signed-off-by: Dave Airlie <[email protected]>
* i965: Don't make consumers of brw_CONT/brw_WHILE track if depth in loop.Eric Anholt2011-12-216-58/+25
| | | | | | | The codegen backends all had this same tracking, so just do it at the EU level. Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Don't make consumers of brw_WHILE do pre-gen6 BREAK/CONT patching.Eric Anholt2011-12-214-86/+45
| | | | | | | The EU code itself can just do this work, since all the consumers were duplicating it. Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Don't make consumers of brw_DO()/brw_WHILE() track loop start.Eric Anholt2011-12-219-28/+58
| | | | | | | This is a similar cleanup to what we did for brw_IF(), brw_ELSE(), brw_ENDIF() handling. Reviewed-by: Yuanhan Liu <[email protected]>
* i965: Drop unused do_insn argument from gen6_CONT().Eric Anholt2011-12-215-7/+5
| | | | | | The branch distances get patched up later at the WHILE instruction. Reviewed-by: Yuanhan Liu <[email protected]>
* mesa: Add _NEW_RASTERIZER_DISCARD as synonym for _NEW_TRANSFORM.Paul Berry2011-12-214-5/+12
| | | | | | | | | | This makes it easier to keep track of which dirty bits correspond to which pieces of context, since it makes _NEW_RASTERIZER_DISCARD correspond with ctx->RasterDiscard. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Move RasterDiscard to toplevel of gl_context.Paul Berry2011-12-218-19/+19
| | | | | | | | | | | | | | | | | | | | Previously we were storing the RasterDiscard flag (for GL_RASTERIZER_DISCARD) in gl_context::TransformFeedback. This was confusing, because we use the _NEW_TRANSFORM flag (not _NEW_TRANSFORM_FEEDBACK) to track state updates to it, and because rasterizer discard has effects even when transform feedback is not in use. This patch makes RasterDiscard a toplevel element in gl_context rather than a subfield of gl_context::TransformFeedback. Note: We can't put RasterDiscard inside gl_context::Transform, since all items inside gl_context::Transform need to be pieces of state that are saved and restored using PushAttrib and PopAttrib. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl/x11: Merge the right version of Frederiks changeKristian Høgsberg2011-12-211-21/+8
| | | | | Argh, I merged an older broken version of the swapbuffer change instead of Frederiks fixed version. This diffs gets us back to the right version.
* egl_dri2/x11: Add support for the DRI2 SwapBuffers requestFredrik Höglund2011-12-202-21/+81
|
* egl_dri2/x11: Add support for eglSwapIntervalFredrik Höglund2011-12-203-1/+36
|
* i965 gen6: Turn on transform feedback extension unconditionally.Paul Berry2011-12-201-1/+1
| | | | | | | | | | | | Previously, we only enabled transform feedback when MESA_GL_VERSION_OVERRIDE was 3.0 or greater, since transform feedback support was not completely finished, so it didn't make sense to advertise support for it unless absolutely necessary. Now that transform feedback is fully implemented on gen6, we can enable this extension unconditionally. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Implement transform feedback queries.Paul Berry2011-12-203-0/+54
| | | | | | | | | | | | | | | | | | | | This patch adds software-based PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries that work by keeping track of the number of primitives that are sent down the pipeline, and adjusting as necessary to account for the way each primitive type is tessellated. In the long run we'll want to replace this with a hardware-based implementation, because the software approach won't work with geometry shaders or primitive restart. However, at the moment, we don't have the necessary kernel support to implement a hardware-based query (we would need the kernel to save GPU registers when context switching, so that drawing performed by another process doesn't get counted). Fixes Piglit tests EXT_transform_feedback/query-primitives_generated-* and EXT_transform_feedback/query-primitives-written-*. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Convert if/else to switch statements in brw_queryobj.cPaul Berry2011-12-201-6/+30
| | | | | | | | | | | | | Previously, i965 only supported two query types: GL_TIME_ELAPSED_EXT and GL_SAMPLES_PASSED_ARB, and it distinguished between the two using if/else statements that compared query->Base.Target to GL_TIME_ELAPSED_EXT. This patch changes the if/else statements to switch statements so that we can add more query types without having to have a chain of else-ifs. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Ensure correct transform feedback indices on new batch.Paul Berry2011-12-205-8/+72
| | | | | | | | | | | | | | | | We don't currently have kernel support for saving GPU registers on a context switch, so if multiple processes are performing transform feedback at the same time, their SVBI registers will interfere with each other. To avoid this situation, we keep a software shadow of the state of the SVBI 0 register (which is the only register we use), and re-upload it on every new batch. The function that updates the shadow state of SVBI 0 is called brw_update_primitive_count, since it will also be used to update the counters for the PRIMITIVES_GENERATED and TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN queries. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add a function to query whether a meta-op is in progress.Paul Berry2011-12-202-0/+13
| | | | | | | This is needed by i965 to ensure that transform feedback counters are not incremented during meta-ops. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add count_tessellated_primitives() function.Paul Berry2011-12-202-0/+51
| | | | | | | | | | | This function computes the number of primitives that will be generated when the given drawing operation is performed. It accounts for the tessellation that is performed on line strips, line loops, triangle strips, triangle fans, quads, quad strips, and polygons, so it is suitable for implementing the primitive counters needed by transform feedback. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove unnecessary FLUSH_VERTICES in bind_buffer_rangePaul Berry2011-12-201-1/+5
| | | | | | | | | | It isn't necessary to call FLUSH_VERTICES from bind_buffer_range, because transform feedback buffers are not allowed to be changed when transform feedback is active. Thanks to Marek Olšák for pointing out this bug. Reviewed-by: Marek Olšák <[email protected]>
* i965 gen6: Implement rasterizer discard.Paul Berry2011-12-203-0/+37
| | | | | | | | | | | | | | | | | | | This patch enables rasterizer discard functionality (a part of transform feedback) in Gen6, by generating an alternate GS program when rasterizer discard is active. Instead of forwarding vertices down the pipeline, the alternate GS program uses a URB Write message to deallocate the URB entry that was allocated by FF sync and terminate the thread. Note: parts of the Sandy Bridge PRM seem to imply that we could do this more efficiently, by clearing the GEN6_GS_RENDERING_ENABLE bit, and not allocating a URB entry at all. However, it's not clear how we are supposed to terminate the thread if we do that. Volume 2 part 1, section 4.5.4, says "GS threads must terminate by sending a URB_WRITE message with the EOT and Complete bits set.", and my experiments so far confirm that. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Implement bounds checking for transform feedback output.Kenneth Graunke2011-12-204-0/+52
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: Flush pipeline on EndTransformFeedback.Paul Berry2011-12-203-0/+22
| | | | | | | | | | | | | | | | | | | | | | | A common use case for transform feedback is to perform one draw operation that writes transform feedback output to a buffer, followed by a second draw operation that consumes that buffer as vertex input. Since vertex input is consumed at an earlier pipeline stage than writing transform feedback output, we need to flush the pipeline to ensure that the transform feedback output is completely written before the data is consumed. In an ideal world, we would do some dependency tracking, so that we would only flush the pipeline if the next draw call was about to consume data generated by a previous draw call in the same batch. However, since we don't have that sort of dependency tracking infrastructure right now, we just unconditionally flush the buffer every time glEndTransformFeedback() is called. This will cause a performance hit compared to the ideal case (since we will sometimes flush the pipeline unnecessarily), but fortunately the performance hit will be confined to circumstances where transform feedback is in use. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965 gen6+: Make intel_batchbuffer_emit_mi_flush() actually flush.Paul Berry2011-12-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous to this patch, the function intel_batchbuffer_emit_mi_flush() was a bit of a misnomer. On Gen4+, when not using the blit engine, it didn't actually flush the pipeline--it simply generated a PIPE_CONTROL command with the necessary bits set to flush GPU caches. This was usually sufficient, since in most situations where intel_batchbuffer_emit_mi_flush() was called, all we really care about was ensuring cache coherency. However, with the advent of OpenGL 3.0, there are two cases in which data output by one stage of the pipeline might be consumed, in a later draw operation, by an earlier stage of the pipeline: (a) When using textures in the vertex shader. (b) When using drawing with a vertex buffer that was previously generated using transform feedback. This patch addresses case (a) by changing intel_batchbuffer_emit_mi_flush() so that on Gen6+, it sets the PIPE_CONTROL_CS_STALL bit (this forces the pipeline to actually flush). (Case (b) will be addressed by the next patch in the series). This is not an ideal solution--in a perfect world, the driver would have some buffer dependency tracking so that we would only have to flush the pipeline in the two cases above. Until that dependency tracking is implemented, however, it seems prudent to have intel_batchbuffer_emit_mi_flush() actually flush the pipeline, so that we get correct rendering, at the expense of a (hopefully small) performance hit. The change is only applied to Gen6+, since at the moment only Gen6+ supports the OpenGL 3.0 features that make a full pipeline flush necessary. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965 gen6: Turn on transform feedback extension.Paul Berry2011-12-201-0/+3
| | | | | | | | | | | | This patch advertises support for EXT_transform_feedback on Intel Gen6. Since transform feedback support is not completely finished yet, for now we only advertise support for it when MESA_GL_VERSION_OVERRIDE is 3.0 or greater (since transform feedback is required by GL version 3.0). Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6: Initial implementation of transform feedback.Paul Berry2011-12-2015-10/+417
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds basic transform feedback capability for Gen6 hardware. This consists of several related pieces of functionality: (1) In gen6_sol.c, we set up binding table entries for use by transform feedback. We use one binding table entry per transform feedback varying (this allows us to avoid doing pointer arithmetic in the shader, since we can set up the binding table entries with the appropriate offsets and surface pitches to place each varying at the correct address). (2) In brw_context.c, we advertise the hardware capabilities, which are as follows: MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 64 MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 4 MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 16 OpenGL 3.0 requires these values to be at least 64, 4, and 4, respectively. The reason we advertise a larger value than required for MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS is that we have already set aside 64 binding table entries, so we might as well make them all available in both separate attribs and interleaved modes. (3) We set aside a single SVBI ("streamed vertex buffer index") for use by transform feedback. The hardware supports four independent SVBI's, but we only need one, since vertices are added to all transform feedback buffers at the same rate. Note: at the moment this index is reset to 0 only when the driver is initialized. It needs to be reset to 0 whenever BeginTransformFeedback() is called, and otherwise preserved. (4) In brw_gs_emit.c and brw_gs.c, we modify the geometry shader program to output transform feedback data as a side effect. (5) In gen6_gs_state.c, we configure the geometry shader stage to handle the SVBI pointer correctly. Note: ordering of vertices is not yet correct for triangle strips (alternate triangles are improperly oriented). This will be addressed in a future patch. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* i965 gs: Move vue_map to brw_gs_compile.Paul Berry2011-12-202-3/+4
| | | | | | | | | | | | This patch stores the geometry shader VUE map from a local variable in compile_gs_prog() to a field in the brw_gs_compile struct, so that it will be available while compiling the geometry shader. This is necessary in order to support transform feedback on Gen6, because the Gen6 geometry shader code that supports transform feedback needs to be able to inspect the VUE map in order to find the correct vertex data to output. Reviewed-by: Kenneth Graunke <[email protected]>
* i965 gen6+: Use 1-wide null operands for IF instructionsPaul Berry2011-12-201-4/+4
| | | | | | | | | | | | | | The Sandy Bridge PRM, volume 4, part 2, section 5.3.10 ("5.3.10 Register Region Restrictions") contains the following restriction on the execution size and operand width of instructions: "3. ExecSize must be equal to or greater than Width." When emitting an IF instruction in single program flow mode on Gen6+, we use an ExecSize of 1, therefore the Width of each operand must also be 1. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Fix off-by-one error in transform feedback size check.Paul Berry2011-12-201-1/+1
| | | | | | | | | | | In _mesa_BindBufferRange(), we need to verify that the offset and size specified by the client do not exceed the size of the underlying buffer. We were accidentally doing this check using ">=" rather than ">", so we were generating a bogus error if the client specified an offset and size that fit exactly in the underlying buffer. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Record transform feedback strides/offsets in linker output.Paul Berry2011-12-202-1/+14
| | | | | | | | | | | | | | | | | | | | | | This patch adds two new fields to the gl_transform_feedback_info struct: - BufferStride records the total number of components (per vertex) that transform feedback is being instructed to store in each buffer. - Outputs[i].DstOffset records the offset within the interleaved structure of each transform feedback output. These values are needed by the i965 gen6 and r600g back-ends, so it seems better to have the linker provide them rather than force each back-end to compute them independently. Also, DstOffset helps pave the way for supporting ARB_transform_feedback3, which allows the transform feedback output to contain holes between attributes by specifying gl_SkipComponents{1,2,3,4} as the varying name. Reviewed-by: Marek Olšák <[email protected]>
* Fix compilation on cygwin after commit 762c9766c93697af8d7fbaa729aed118789dbe8eJon TURNEY2011-12-201-1/+1
| | | | | | | | | | | | | Fix compilation on cygwin after commit 762c9766c93697af8d7fbaa729aed118789dbe8e "Use VERT_ATTRIB_* indexed array in gl_array_object" added the first non-driver use of ffsll(), which exposes the fact that this isn't provided on cygwin. Found by tinderbox, see [1] [1] http://tinderbox.freedesktop.org/builds/2011-11-30-0017/logs/libGL/#build Signed-off-by: Jon TURNEY <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* xvmc: Remove unused variableMaarten Lankhorst2011-12-201-3/+0
| | | | | Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Christian König <[email protected]>
* vl: Remove unused declarationMaarten Lankhorst2011-12-201-1/+1
| | | | | | | csc is not used for rgba and gives a warning. Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Christian König <[email protected]>
* vl: Use pipe clear_render_target instead of util_clear_render_targetMaarten Lankhorst2011-12-201-2/+2
| | | | | | | Mapping to software and uploading again clearing is killing performance. Signed-off-by: Maarten Lankhorst <[email protected]> Signed-off-by: Christian König <[email protected]>
* mesa: fix a leak in _mesa_delete_texture_image()Pekka Paalanen2011-12-201-0/+1
| | | | | | | | | | | | | Valgrind complains about a definitely lost block allocated in intelNewTextureImage(). This leak was apparently created by 6e0f9001fe3fb191c2928bd09aa9e9d05ddf4ea9, "mesa: move gl_texture_image::Data, RowStride, ImageOffsets to swrast", as it removes the free() from _mesa_delete_texture_image(). Put the free() back, fixes a Valgrind error. Signed-off-by: Pekka Paalanen <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/egl: error check and clamp coordinates in eglPostSubBufferNVChia-I Wu2011-12-201-8/+21
| | | | EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
* egl_dri2/x11: error check coordinates in eglPostSubBufferNVChia-I Wu2011-12-201-5/+5
| | | | EGL_BAD_PARAMETER should be returned when any of the coordinates is negative.
* st/egl: Add support for EGL_NV_post_sub_bufferFredrik Höglund2011-12-202-2/+24
| | | | | | Signed-off-by: Fredrik Höglund <[email protected]> [olv: remove #ifdef checks]
* egl_dri2/x11: Add support for EGL_NV_post_sub_bufferFredrik Höglund2011-12-201-0/+17
| | | | Signed-off-by: Fredrik Höglund <[email protected]>
* egl: add EGL_NV_post_sub_bufferFredrik Höglund2011-12-206-0/+48
| | | | | | | | | v2: Handle EGL_POST_SUB_BUFFER_SUPPORTED_NV in _eglParseSurfaceAttribList() Signed-off-by: Fredrik Höglund <[email protected]> [olv: remove #ifdef checks]
* egl: KHR_reusable_sync entrypoints are missing from eglGetProcAddressChia-I Wu2011-12-201-0/+5
|
* egl: remove #ifdef's for official extensionsChia-I Wu2011-12-2011-84/+0
| | | | | | | There is no point in having them when we distribute eglext.h. As for unofficial extensions, there is a chance that we might remove some of them evetually. Keeping the #ifdef's for now should make that easier.
* egl: remove EGL_ANDROID_swap_rectangleChia-I Wu2011-12-205-43/+0
| | | | | We never support this unofficial extension, and it has been removed from Android recently. There is no point in keeping it.
* egl: update headersChia-I Wu2011-12-203-24/+73
| | | | | | | | | | | | | | | | | Update to revision 15052. EGL_MESA_drm_image is now official. But apparently we have our own extension to it and we need this in eglmesaext.h: #ifdef EGL_MESA_drm_image /* Mesa's extension to EGL_MESA_drm_image... */ #ifndef EGL_DRM_BUFFER_USE_CURSOR_MESA #define EGL_DRM_BUFFER_USE_CURSOR_MESA 0x0004 #endif #endif Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* egl: move unofficial extensions to eglmesaext.hChia-I Wu2011-12-202-136/+176
| | | | | | | | | | | | | As suggested by Ian in http://lists.freedesktop.org/archives/mesa-dev/2011-December/016035.html Note that eglext.h has to include eglmesaext.h at the end instead of the beginning because some extensions in eglmesaext.h depend on the official extensions. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>