summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* gallium: comment that INSTANCEID doesn't include start_instanceMarek Olšák2013-09-131-1/+1
| | | | Reviewed-by: Christian König <[email protected]>
* radeonsi: enable streamout AKA transform feedback for SIMarek Olšák2013-09-131-10/+4
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: implement streamout shader supportMarek Olšák2013-09-133-15/+276
| | | | | | | | | | | The shader is responsible for writing to streamout buffers using the TBUFFER_STORE_FORMAT_* instructions. The locations of some input SGPRs and VGPRs are assigned dynamically, because the input SGPRs controlling streamout are not declared if they are not needed, decreasing the indices of all following inputs. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: implement glDrawTransformFeedback functionalityMarek Olšák2013-09-133-0/+30
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: fix streamout queriesMarek Olšák2013-09-131-4/+5
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: implement streamout flush properlyMarek Olšák2013-09-131-1/+7
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: bind streamout buffers to VGT and the vertex shaderMarek Olšák2013-09-134-8/+81
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: handle rasterizer_discard and set GS_OUT_PRIM_TYPEMarek Olšák2013-09-133-1/+31
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: initialize the first CS like any otherMarek Olšák2013-09-135-5/+15
| | | | | | | | | So that the "init" state is always emitted first and not later in draw_vbo. This fixes streamout where the "init" state, which disables streamout, was emitted in draw_vbo after streamout was enabled. Reviewed-by: Michel Dänzer <[email protected]>
* radeonsi: integrate shared streamout stateMarek Olšák2013-09-137-38/+20
| | | | Reviewed-by: Michel Dänzer <[email protected]>
* radeon: don't emit streamout state if there are no streamout buffersMarek Olšák2013-09-131-0/+2
| | | | | | | This could happen if set_stream_output_targets is called twice in a row without a draw call in between. Reviewed-by: Michel Dänzer <[email protected]>
* radeon: don't emit VGT_STRMOUT_BUFFER_BASE on SIMarek Olšák2013-09-131-31/+54
| | | | | | The register doesn't exist on SI. Reviewed-by: Michel Dänzer <[email protected]>
* mesa: Disallow relinking if a program is used by an active XFB object.Kenneth Graunke2013-09-123-7/+47
| | | | | | | | | | | | | | | | | Paused transform feedback objects may refer to a program other than the current program. If any active objects refer to a program, LinkProgram must reject the request to relink. The code to detect this is ugly since _mesa_HashWalk is awkward to use, but unfortunately we can't use hash_table_foreach since there's no way to get at the underlying struct hash_table (and even then, we'd need to handle locking somehow). Fixes the last subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Reject ResumeTransformFeedback if the wrong program is bound.Kenneth Graunke2013-09-121-0/+11
| | | | | | | | | | | This is actually a pretty important error condition: otherwise, you could set up transform feedback with one program, and resume it with a program that generates a completely different set of outputs. Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Track the vertex program active at BeginTransformFeedback() time.Kenneth Graunke2013-09-122-0/+8
| | | | | | | | | | The next few patches will use this for API error checking. All of the drivers appear to CALLOC_STRUCT transform feedback objects, so this should be properly NULL initialized on creation. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Disallow TransformFeedbackVaryings when active.Kenneth Graunke2013-09-121-0/+10
| | | | | | | Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radeon/uvd: move more logic into the common filesChristian König2013-09-126-40/+23
| | | | | | | | Move the code back into the common UVD files since we now have base structures for R600 and radeonsi. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* radeon/uvd: use more sane defaults for bitstream buffer sizeChristian König2013-09-121-1/+3
| | | | | Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]>
* os: First check for __GLIBC__ and then for PIPE_OS_BSDAndreas Boll2013-09-121-4/+4
| | | | | | | | | | | | | Fixes FTBFS on kfreebsd-* Debian GNU/kFreeBSD doesn't provide getprogname() since it uses stdlib.h from glibc. Instead it provides program_invocation_short_name from glibc. You can find the same order in src/mesa/drivers/dri/common/xmlconfig.c Cc: "9.2" <[email protected]> Tested-by: Julien Cristau <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* llvmpipe: Remove the special path for TGSI_OPCODE_EXP.José Fonseca2013-09-123-72/+30
| | | | | | It was wrong for EXP.y, as we clamped the source before computing the fractional part, and this opcode should be rarely used, so it's not worth the hassle.
* trace: Several enhancements to dump_state.pyJosé Fonseca2013-09-121-18/+112
| | | | | | - Handle more calls - Handle more state - Try to normalize the output a bit, to eliminate spurious differences
* trace: Support bigger TGSI shaders.José Fonseca2013-09-121-1/+1
| | | | Trivial.
* glsl: Use sampler_coordinate_components instead of passing it by hand.Kenneth Graunke2013-09-111-450/+450
| | | | | | | | | | | We used to pass the number of components actually used for the coordinate (rather than padding, shadow comparitors, and projectors) by hand, specifying it on every _texture() call. The new helper function can just compute this, eliminating a lot of potential mistakes. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: Add a new glsl_type::sampler_coordinate_components() function.Kenneth Graunke2013-09-112-0/+47
| | | | | | | This computes the number of components necessary to address a sampler based on its dimensionality. It will be useful for texturing built-ins. Signed-off-by: Kenneth Graunke <[email protected]>
* Move nv30, nv50 and nvc0 to nouveau.Johannes Obermayr2013-09-11167-660/+431
| | | | | | | | | | | | | | | | It is planned to ship openSUSE 13.1 with -shared libs. nouveau.la, nv30.la, nv50.la and nvc0.la are currently LIBADDs in all nouveau related targets. This change makes it possible to easily build one shared libnouveau.so which is then LIBADDed. Also dlopen will be faster for one library instead of three and build time on -jX will be reduced. Whitespace fixes were requested by 'git am'. Signed-off-by: Johannes Obermayr <[email protected]> Acked-by: Christoph Bumiller <[email protected]> Acked-by: Ian Romanick <[email protected]>
* i965/gs: implement EndPrimitive() functionality in the visitor.Paul Berry2013-09-112-1/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to GLSL, the shader may call EndPrimitive() at any point during its execution, causing the line or triangle strip currently being output to be terminated and a new strip to be begun. This is implemented in gen7 hardware by using one control data bit per vertex, to indicate whether EndPrimitive() was called after that vertex was emitted. In order to make this work without sacrificing too much efficiency, we accumulate 32 control data bits at a time in a GRF. When we have accumulated 32 bits (or when the shader terminates), we output them to the appropriate DWORD in the control data header and reset the accumulator to 0. We have to take special care to make sure that EndPrimitive() calls that occur prior to the first vertex have no effect. Since geometry shaders that output a large number of vertices are likely to be rare, an optimization kicks in if max_vertices <= 32. In this case, we know that we can wait until the end of shader execution before any control data bits need to be output. I've tried to write the code in such a way that in the future, we can easily adapt it to output stream ID bits (which are two bits/vertex instead of one). Fixes piglit tests "spec/glsl-1.50/glsl-1.50-geometry-end-primitive *". Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Add the ability to emit opcodes with just a dst register.Paul Berry2013-09-112-0/+8
| | | | | | | This is needed for GS_OPCODE_PREPARE_CHANNEL_MASKS. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gs: Add opcodes needed for EndPrimitive().Paul Berry2013-09-114-0/+120
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen7: Add the ability to send URB_WRITE_OWORD messages.Paul Berry2013-09-113-2/+16
| | | | | | | | | | | | | | | Previously, brw_urb_WRITE() would always generate a URB_WRITE_HWORD message, we always wanted to write data to the URB in pairs of varying slots or larger (an HWORD is 32 bytes, which is 2 varying slots). In order to support geometry shader EndPrimitive functionality, we'll need the ability to write to just a single OWORD (16 byte) slot, since we'll only be outputting 32 of the control data bits at a time. So this patch adds a flag that will cause brw_urb_WRITE to generate a URB_WRITE_OWORD message. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen7: Allow URB_WRITE channel masks to be used.Paul Berry2013-09-112-1/+7
| | | | | | | | | | | | | | Previously, brw_urb_WRITE() would unconditionally override the channel masks in the URB_WRITE message to 0xff (indicating that all channels should be written to the URB). In order to support geometry shader EndPrimitive functionality, we'll need the ability to set the channel masks programatically, so that we can output just 32 of the control data bits at a time. So this patch adds a flag that will prevent brw_urb_WRITE() from overriding them. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gs: Set control data header size/format appropriately for EndPrimitive().Paul Berry2013-09-117-15/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The gen7 geometry shader uses a "control data header" at the beginning of the output URB entry to store either (a) flag bits (1 bit/vertex) indicating whether EndPrimitive() was called after each vertex, or (b) stream ID bits (2 bits/vertex) indicating which stream each vertex should be sent to (when multiple transform feedback streams are in use). Fortunately, OpenGL only requires separate streams to be supported when the output type is points, and EndPrimitive() only has an effect when the output type is line_strip or triangle_strip, so it's not a problem that these two uses of the control data header are mutually exclusive. This patch modifies do_vec4_gs_prog() to determine the correct hardware settings for configuring the control data header, and modifies upload_gs_state() to propagate these settings to the hardware. In addition, it modifies do_vec4_gs_prog() to ensure that the output URB entry is large enough to contain both the output vertices *and* the control data header. Finally, it modifies vec4_gs_visitor so that it accounts for the size of the control data header when computing the offset within the URB where output vertex data should be stored. Reviewed-by: Ian Romanick <[email protected]> v2: Fixed incorrect handling of IVB/HSW differences. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: During linking, record whether a GS uses EndPrimitive().Paul Berry2013-09-113-0/+34
| | | | | | | | | This information will be useful in the i965 back end, since we can save some compilation effort if we know from the outset that the shader never calls EndPrimitive(). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gs: Add a state atom to set up geometry shader state.Paul Berry2013-09-116-33/+156
| | | | | | | | | | | | v2: Do not attempt to share the code that uploads 3DSTATE_BINDING_TABLE_POINTERS_GS, 3DSTATE_SAMPLER_STATE_POINTERS_GS, or 3DSTATE_GS with VS. Reviewed-by: Ian Romanick <[email protected]> v3: Add _NEW_TRANSFORM to gen7_gs_state. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/gen7: Extract a function for setting up a shader stage's constants.Paul Berry2013-09-112-25/+42
| | | | | | | | This will allow us to reuse some code when setting up the geometry shader stage. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* wayland-egl.pc requires wayland-client.pc.Torsten Duwe2013-09-111-0/+1
| | | | | | | | | Mesa provides the wayland-egl libs and the pkgconfig file, but the headers originate from the wayland package. Ensure everything matches, by requiring application builds to look at the wayland headers as well. Signed-off-by: Torsten Duwe <[email protected]> Signed-off-by: Johannes Obermayr <[email protected]>
* st/gbm: Add $(WAYLAND_CFLAGS) for HAVE_EGL_PLATFORM_WAYLAND.Johannes Obermayr2013-09-111-0/+1
|
* st/dri: do not create a new context for msaa copyMaarten Lankhorst2013-09-1112-33/+34
| | | | | | | | | | | | | | | | Commit b77316ad7594f st/dri: always copy new DRI front and back buffers to corresponding MSAA buffers introduced creating a pipe_context for every call to validate, which is not required because the callers have a context anyway. Only exception is egl_g3d_create_pbuffer_from_client_buffer, can someone test if it still works with NULL passed as context for validate? From examining the code I believe it does, but I didn't thoroughly test it. Signed-off-by: Maarten Lankhorst <[email protected]> Cc: 9.2 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965: Add an assertion that writemask != NULL for non-ARFs.Kenneth Graunke2013-09-101-0/+2
| | | | | | | | | | | | | | | | We've observed GPU hangs on Ivybridge from the following instruction: mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q }; There should be no reason to ever set the writemask on a destination register to zero, except for perhaps the ARF NULL register. This patch adds an assertion to enforce this for non-ARF registers. Excluding ARFs is conservative yet should still catch the majority of mistakes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* i965/vec4: Only zero out unused message components when there are any.Kenneth Graunke2013-09-101-2/+4
| | | | | | | | | | | | | | | | Otherwise, coordinates with four components would result in a MOV with a destination writemask that has no channels enabled: mov(8) g115<1>.F 0D { align16 WE_normal NoDDChk 1Q }; At best, this is stupid: we emit code that shouldn't do anything. Worse, it apparently causes GPU hangs (observable with Chris's textureGather test on CubeArrays.) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: [email protected]
* i965/vec4: Simplify the computation of coord_mask and zero_mask.Kenneth Graunke2013-09-101-5/+2
| | | | | | | | | We can easily compute these without loops, resulting in simpler and shorter code. Signed-off-by: Kenneth Graunke <[email protected]> Suggested-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: Properly set the fog scale (gl_Fog.scale) to +INF when fog start and ↵Henri Verbeet2013-09-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | end are equal. This was originally introduced by commit ba47aabc9868b410cdfe3bc8b6d25a44a598cba2, but unfortunately the commit message doesn't go into much detail about why +INF would be a problem here. A similar issue exists for STATE_FOG_PARAMS_OPTIMIZED, but allowing infinity there would potentially introduce NaNs where they shouldn't exist, depending on the values of fog end and the fog coord. Since STATE_FOG_PARAMS_OPTIMIZED is only used for fixed function (including ARB_fragment_program with fog option), and the calculation there probably isn't very stable to begin with when fog start and end are close together, it seems best to just leave it alone. This fixes piglit glsl-fs-fogscale, and a couple of Wine D3D tests. No piglit regressions on Cayman. Signed-off-by: Henri Verbeet <[email protected]> Tested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Use correct enum conversion function.Vinson Lee2013-09-101-1/+1
| | | | | | | Fixes "Mixing enum types" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Ensure gl_sync_object is fully initialized.Vinson Lee2013-09-101-1/+1
| | | | | | | | | | | | 278372b47e4db8a022d57f60302eec74819e9341 added the uninitialized pointer field gl_sync_object:Label. A free of this pointer, added in commit 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77, resulted in a crash. This patch fixes piglit ARB_sync regressions with swrast introduced by 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* radeonsi: Add parentheses around '|' operands.Vinson Lee2013-09-101-1/+1
| | | | | | | | | | | | | | Fixes GCC parentheses warning. r600_texture.c: In function 'si_texture_create': r600_texture.c:518:20: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] !(templ->bind & PIPE_BIND_CURSOR | PIPE_BIND_LINEAR)) { ^ Fixes "Wrong operator used" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* util: Fix unmatched parenthesis.Vinson Lee2013-09-101-1/+1
| | | | | | | | | Fixes MSVC build error introduced with commit 923d3467147dd301d94ed3e6b41295fb2bcd6f47. src\gallium\auxiliary\util\u_cpu_detect.c(286) : fatal error C1012: unmatched parenthesis : missing '(' Signed-off-by: Vinson Lee <[email protected]>
* util: don't use _fxsave() with MSVC 2010 or olderBrian Paul2013-09-102-1/+8
| | | | | | And update _MSC_VER comments in p_config.h Reviewed-by: Roland Scheidegger <[email protected]>
* glsl: Add missing va_end in builtin_builder::add_function.Vinson Lee2013-09-101-0/+1
| | | | | | | Fixes "Missing varargs init or cleanup" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Initialize builtin_builder member variables.Vinson Lee2013-09-101-0/+3
| | | | | | | Fixes "Uninitialized pointer field" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: fix variadic macro for MSVCBrian Paul2013-09-091-2/+2
| | | | | | MSVC doesn't accept the rest... syntax. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: remove struct keyword from ir_variable declarationsBrian Paul2013-09-091-4/+4
| | | | | | To silence MSVC warnings. Reviewed-by: Kenneth Graunke <[email protected]>