summaryrefslogtreecommitdiffstats
path: root/src/gallium
Commit message (Collapse)AuthorAgeFilesLines
* r300g/compiler/tests: Fix segfaultTom Stellard2013-08-073-4/+4
| | | | CC: "9.2" <[email protected]>
* gallium-egl: Commit the rest of the native_wayland_drm_bufmgr_helper v2 patchKristian Høgsberg2013-08-073-7/+4
| | | | | | | | I missed Anders v2 on the list which fixed non-wayland compilation: http://lists.freedesktop.org/archives/mesa-dev/2013-July/042062.html Signed-off-by: Kristian Høgsberg <[email protected]>
* egl: Update to Wayland 1.2 server APIAnder Conselvan de Oliveira2013-08-074-15/+22
| | | | | | | | | | Since Wayland 1.2, struct wl_buffer and a few functions are deprecated. References to wl_buffer are replaced with wl_resource and some getter functions and calls to deprecated functions are replaced with the proper new API. The latter changes are related to resource versioning. Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
* gallium-egl: Don't add a listener for wl_drm twice in wayland platformAnder Conselvan de Oliveira2013-08-071-1/+0
| | | | | | | A listener is added just after the interface is bound, in registry_handle_global(). Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
* gallium-egl: Simplify native_wayland_drm_bufmgr_helper interfaceAnder Conselvan de Oliveira2013-08-079-308/+276
| | | | | | | | | | | | | | | | | | | | | The helper provides a series of functions to easy the implementation of the WL_bind_wayland_display extension on different platforms. But even with the helpers there was still a bit of duplicated code between platforms, with the drm authentication being the only part that differs. This patch changes the bufmgr interface to provide a self contained object with a create function that takes a drm authentication callback as an argument. That way all the helper functions are made static and the "_helper" suffix was removed from the sources file name. This change also removes the mix of Wayland client and server code in the wayland drm platform source file. All the uses of libwayland-server are now contained in native_wayland_drm_bufmgr.c. Changes to the drm platform are only compile tested. Signed-off-by: Ander Conselvan de Oliveira <[email protected]>
* ilo: speed up 3DSTATE_VERTEX_BUFFERS emission a bitChia-I Wu2013-08-073-26/+12
| | | | Ignore vbuffer_mask which does not gain us anything.
* ilo: skip state emission when reducing sampler countChia-I Wu2013-08-071-19/+29
| | | | | When the number of sampler states bound is reduced, we are good to keep referencing the old SAMPLER_STATE array and skip emitting a new one.
* ilo: simplify setting of shader samplers and viewsChia-I Wu2013-08-071-44/+33
| | | | | Remove the special path that unbinds all samplers/views not in the range. Just make another call to unbind them.
* ilo: correctly check for stencil ref changeChia-I Wu2013-08-071-1/+1
| | | | I intended to do a memcmp(), not a memcpy()...
* draw: fix slot detectionZack Rusin2013-08-062-2/+1
| | | | | | | | | | | | Nowadays -1 for slots means that the semantic is not present, so we need to store it in a signed variables, otherwise <0 comparisons are pointless. Fixes http://bugzilla.eng.vmware.com/show_bug.cgi?id=67811 (at least with softpipe, edgeflags don't work wit llvmpipe) Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallivm: Fix build - Remove TargetOptions.RealignStack for llvm>=3.4Laurent Carlier2013-08-061-0/+2
| | | | | | | | | | Since llvm -3.4svn r187618, TargetOptions doesn't provide RealignStack, so only enable it with llvm<3.4 This option must now be specified using function attributes, see LLVM commit r187618 Reviewed-by: Tom Stellard <[email protected]>
* nvc0: don't access array out of bounds on unexpected sample countChristoph Bumiller2013-08-061-2/+1
|
* nv50: handle pure integer vertex attributesEmil Velikov2013-08-062-2/+14
| | | | | | | | And as a side effect fix a crash in the following piglit test: general/attribs GL3 Signed-off-by: Emil Velikov <[email protected]> Cc: "9.2 and 9.1" [email protected]
* nvc0: implement MP performance counters for nvc0:nvd9Samuel Pitoiset2013-08-062-93/+370
|
* nvc0: implement compute support for nvc0Samuel Pitoiset2013-08-069-32/+706
| | | | Tested on nvc0, nvc1, nvcf and nvd9.
* nvc0: add more MP counters for nve4Samuel Pitoiset2013-08-063-14/+47
|
* radeonsi: Number of SGPRs retrieved from LLVM already includes VCCMichel Dänzer2013-08-061-8/+8
| | | | | | | | Fixes spurious 'Assertion `num_sgprs <= 104' failed.' with shaders using all 104 SGPRs. Cc: [email protected] Reviewed-by: Christian König <[email protected]>
* llvmpipe: Do not need to free anything if there is no geometry shader.Vinson Lee2013-08-051-2/+5
| | | | | | | | | | If gs is null, then freeing state->shader.tokens would result in a null dereference. Fixes "Dereference after null check" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nvc0: Initialize ptr for unexpected sample_count on release builds.Vinson Lee2013-08-051-0/+1
| | | | | | | Fixes "Uninitialized pointer read" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: Change slot from unsigned to int.Vinson Lee2013-08-051-1/+1
| | | | | | | | | unfilled_stage::face_slot is of type int. Fixes "Unsigned compared against 0" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* postprocess: Check ppq is null before calling pp_free_bos.Vinson Lee2013-08-051-1/+3
| | | | | | | | | pp_free_bos dereferences ppq without a null check. Fixes "Dereference before null check" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: add back separate input assemblerZack Rusin2013-08-036-4/+351
| | | | | | | | | | | the issue is that stream output is run before the pipeline, which means that unless we decompose the primitives before the so then things crash. we could convert the entire stream output code into a pipeline stage but it will take a bit, so for now fix the crashes by simply re-adding the old input assembler which is run before the SO. Signed-off-by: Zack Rusin <[email protected]>
* draw: implement proper primitive assembler as a pipeline stageZack Rusin2013-08-0312-352/+280
| | | | | | | | | | | | | we used to have a face primitive assembler that we ran after if the gs was missing but we had adjacency primitives in the pipeline, lets convert it to a pipeline stage, which allows us to use it to inject outputs (primitive id) into the vertices. it's also a lot cleaner because the decomposition is already handled for us. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: fix front face injectionZack Rusin2013-08-031-9/+15
| | | | | | | | | | | | | Inject front face only if the fragment shader uses it and propagate through all channels because otherwise we'll need to figure out the exact swizzle that the fs expects and it's just simpler to make sure all the components within the front face register are correctly set. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* tgsi: remove unneeded File == TGSI_FILE_INPUT testBrian Paul2013-08-051-1/+0
| | | | We're already in an "if (File == TGSI_FILE_INPUT)" block at that point.
* tgsi: clean up tgsi_scan_shader() functionBrian Paul2013-08-051-41/+42
| | | | | | | | | Replace "fulldecl->Semantic.Name/Index" with semName/semIndex. Simplify if/else logic for TGSI_FILE_OUTPUT code. Remove old comment. Fix indentation. Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: fix frontface behavior againZack Rusin2013-08-021-3/+11
| | | | | | | Lets make sure the frontface is 1 for front and -1 for back. Discussed with Roland and Jose. Signed-off-by: Zack Rusin <[email protected]>
* r600g/sb: Dump correct value for CND.Vinson Lee2013-08-041-1/+1
| | | | | | | Fixes "Copy-paste error" reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Vadim Girlin <[email protected]>
* nv50: fix some h264 interlaced decoding on vp2Ilia Mirkin2013-08-032-7/+8
| | | | | | | | | | Some videos specify mb_adaptive_frame_field_flag instead of field_pic_flag. This implies that the pic height needs to be halved, and this field needs to be passed to the VP engine. Cc: "9.2" [email protected] Signed-off-by: Ilia Mirkin <[email protected]>
* llvmpipe: don't interpolate front face or prim idZack Rusin2013-08-021-15/+13
| | | | | | | | | | | | | | The loop was iterating over all the fs inputs and setting them to perspective interpolation, then after the loop we were creating extra output slots with the correct interpolation. Instead of injecting bogus extra outputs, just set the interpolation on front face and prim id correctly when doing the initial scan of fs inputs. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: make sure clipping works with injected outputsZack Rusin2013-08-021-35/+54
| | | | | | | | | | | | | clipping would drop the extra outputs because it always used the number of standard vertex shader outputs, without geometry shader or extra outputs. The commit makes sure that clipping with geometry shaders which have more outputs than the current vertex shader and with extra outputs correctly propagates the entire vertex. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw: inject frontface info into wireframe outputsZack Rusin2013-08-0214-4/+146
| | | | | | | | | | | | | | Draw module can decompose primitives into wireframe models, which is a fancy word for 'lines', unfortunately that decomposition means that we weren't able to preserve the original front-face info which could be derived from the original primitives (lines don't have a 'face'). To fix it allow draw module to inject a fake face semantic into outputs from which the backends can figure out the original frontfacing info of the primitives. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw: stop crashing with extra shader outputsZack Rusin2013-08-029-15/+52
| | | | | | | | | | | | | | | | | | Draw sometimes injects extra shader outputs (aa points, lines or front face), unfortunately most of the pipeline and llvm code didn't handle them at all. It only worked if number of inputs happened to be bigger or equal to the number of shader outputs plus the extra injected outputs. In particular when running the pipeline which depends on the vertex_id in the vertex_header things were completely broken. The patch adjust the code to correctly use the total number of shader outputs (the standard ones plus the injected ones) to make it all stop crashing and work. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* draw: use the vertex sizeZack Rusin2013-08-021-1/+1
| | | | | | | | | | Instead of using the magical 4 use the above computed vertex size. Doesn't change the behavior, just makes the code a bit cleaner. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* draw/llvm: add some extra debugging outputZack Rusin2013-08-021-0/+6
| | | | | | | | | | when dumping shader outputs it's nice to have the integer values of the outputs, in particular because some values are integers. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: detect prim id and front face usage in fsZack Rusin2013-08-022-2/+8
| | | | | | | | | Adding code to detect the usage of prim id and front face semantics in fragment shaders. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: add ucmp to the list of opcodesZack Rusin2013-08-021-0/+1
| | | | | | | | | we forgot to add ucmp to the list of opcodes, so it was never generated for ureg. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* llvmpipe: make the front-face behavior match the gallium specZack Rusin2013-08-021-1/+4
| | | | | | | | | | | | The spec says that front-face is true if the value is >0 and false if it's <0. To make sure that we follow the spec, lets just subtract 0.5 from our value (llvmpipe did 1 for frontface and 0 otherwise), which will get us a positive num for frontface and negative for backface. Signed-off-by: Zack Rusin <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* r600g: honour semantic index in fragment color exportsChristoph Bumiller2013-08-021-5/+5
| | | | Signed-off-by: Marek Olšák <[email protected]>
* gallivm: obey clarified shift behaviorRoland Scheidegger2013-08-022-8/+24
| | | | | | | | | | | | | | | llvm shifts are undefined for shift counts exceeding (or matching) bit width, so need to apply a mask for the tgsi shift instructions. v2: only use mask for the tgsi shift instructions, not for the build shift helpers. None of the internal callers need this behavior, and while llvm can optimize away the masking for constants there are legitimate cases where it might not be able to do so even if we know that shift count must be smaller than type width (currently all such callers do not use the build shift helpers). Reviewed-by: Zack Rusin <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: obey clarified shift behaviorRoland Scheidegger2013-08-021-12/+27
| | | | | | | | | c shifts are undefined for shift counts exceeding (or matching) bit width, so need to apply a mask (on x86 it actually would usually probably work as shifts do masking on int domain shifts - unless some auto-vectorizer would come along at last as simd domain does not mask the shift count). Reviewed-by: Jose Fonseca <[email protected]>
* gallium: clarify shift behavior with shift count >= 32Roland Scheidegger2013-08-021-12/+18
| | | | | | | | | | | | | | | | | | Previously, nothing was said what happens with shift counts exceeding bit width of the values to shift. In theory 3 behaviors are possible: 1) undefined (classic c definition) 2) just shift out all bits (so result is zero, or -1 potentially for ashr) 3) mask the shift count to bit width - 1 API's either require 3) or are ok with 1). In particular, GLSL (as well as a couple uninteresting legacy GL extensions) is happy with undefined, whereas both OpenCL and d3d10 require 3). Consequently, most hw also implements 3). So, for simplicity we just specify that 3) is required rather than saying undefined and then needing state trackers to work around it. Also while here specify shift count as a vector, not scalar. As far as I can tell this was a doc bug, neither state trackers nor drivers used scalar shift count. Reviewed-by: Jose Fonseca <[email protected]>
* nvc0: properly align NVE4_COMPUTE_MP_TEMP_SIZESamuel Pitoiset2013-07-312-2/+3
| | | | | | | | | MP_TEMP_SIZE must be aligned to 0x8000, while TEMP_SIZE on NVE4_3D must be aligned to 0x20000, so perform both alignments to be sure we allocate enough space (actually the bo will most likely use 128 KiB pages and not aligning to that would be a waste anyway). Cc: "9.2" [email protected]
* gallivm: use nearest rounding for float->unorm24 conversionRoland Scheidegger2013-07-311-4/+6
| | | | | | | | | | | | | Previously we were using truncation, which gives the correct result only for numbers in [0.5-1.0] range (because there's no mantissa bits to do any rounding there). This is frequently hit (and probably only used there) when converting fragment depth to depth format (d24s8 etc.) or otherwise dealing with depth format. v2: as spotted by Jose, get rid of extra type (src_type is already unsigned). Reviewed-by: Jose Fonseca <[email protected]>
* gallium/util: reformat, comment util_get_offset()Brian Paul2013-07-311-3/+7
| | | | Reviewed-by: Roland Scheidegger <[email protected]>
* gallium/util: comments, var renaming in u_inlines.hBrian Paul2013-07-311-13/+48
| | | | | | | | | | | | The variable 'usage' was being used for two different things. Sometimes for PIPE_USAGE_x and other times for PIPE_TRANSFER_x. This renames usage to access when we're talking about PIPE_TRANSFER_x flags. Plus, add a bunch of comments to remind us what's going on. Also, use unsigned for PIPE_TRANSFER_x bitmask to be consistent with other places. And add a missing const qualifier. Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: use new softpipe_resource_data() accessorBrian Paul2013-07-313-4/+20
| | | | | | | | | We should probably be using map()/unmap() when accessing resource data, but this is a little better. v2: assert that the resource is not a display target, per Jose. Reviewed-by: José Fonseca <[email protected]>
* softpipe: don't ignore pipe_constant_buffer::buffer_offsetBrian Paul2013-07-311-3/+5
| | | | | | | | | | | | | This was never a problem since the Mesa state tracker always gives us a user-space constant buffer with buffer_offset=0. But if another state tracker ever gave us a "HW" constant buffer with non-zero buffer_offset we'd mis-render. Also, use the correct buffer size. And move an assertion to the top of the function. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* gallium/docs: clarify definition of PIPE_CAP_USER_CONSTANT_BUFFERS, etcBrian Paul2013-07-311-5/+8
| | | | | | | | | | | The cap means _can_ accept user-space constant buffers; it doesn't mean _only_ accepts user-space constant buffers. v2: also update the PIPE_CAP_USER_VERTEX_BUFFERS and PIPE_CAP_USER_INDEX_BUFFERS descriptions as well. Per Jose. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* st/dri: add a new driconf option disable_shader_bit_encoding for UnigineMarek Olšák2013-07-304-1/+6
| | | | | | | Now Unigine Heaven 3.0 finally works with r600g. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]>