summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* intel_fbo: remove unused intel_renderbuffer hiz functionsJordan Justen2013-08-042-26/+0
| | | | | | | | | We are now using functions that operate on the renderbuffer attachment to handle layered rendering. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965 clear/draw: set renderbuffer attachment as needing depth resolveJordan Justen2013-08-042-2/+4
| | | | | | | | | | | Previously we would mark a renderbuffer as needing a depth resolve. But, to support layered rendering, we need to look at the attachment instead, since the attachment knows if layered rendering is being used. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: add intel_renderbuffer_att_set_needs_depth_resolveJordan Justen2013-08-042-0/+18
| | | | | | | | | | This function is needed to support layered rendering. With layered rendering, the attachment stores the state of whether layered rendering is being used. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965: add intel_miptree_set_all_slices_need_depth_resolveJordan Justen2013-08-042-0/+16
| | | | | | | | | This function marks all slices of a renderbuffer at a particular level as needing a depth resolve. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* i965 gen7: don't set FORCE_ZERO_RTAINDEX for layered renderingJordan Justen2013-08-041-1/+1
| | | | | | | | | When layered rendering is being used, we should not set FORCE_ZERO_RTAINDEX in the clip state to allow render target array values other than zero to be used. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* hsw hiz: Remove x/y offset restriction for hizJordan Justen2013-08-041-24/+0
| | | | | | | | | This restriction was related to programming the offset fields of the depth buffer packet. We are now setting these offsets to 0 now, so this restriction should no longer be required. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surfaceJordan Justen2013-08-044-66/+45
| | | | | | | | | | | | | | | | | | | | | Previously we would always find the 2D sub-surface of interest, and then program the surface to this location. Now we always program the 3DSTATE_DEPTH_BUFFER at the start of the surface. To select the lod/slice, we utilize the lod & minimum array element fields. As part of this change, we must revert 1f112ccf: Revert "i965/gen7: Align all depth miplevels to 8 in the X direction." We also must disable brw_workaround_depthstencil_alignment for gen >= 7. Now the hardware will handle alignment when rendering to additional slices/LODs. v2: * Merge with recent MOCS changes Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 fbo: make unmatched depth/stencil configs return unsupportedJordan Justen2013-08-041-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | For gen >= 7, we will use the lod/minimum-array-element fields to support layered rendering. This means that we must restrict the depth & stencil attachments to match in various more retrictive ways. (Now the width, height, depth, LOD and layer must match) The reason width, height, and depth must match is that the hardware has a single set of width, height, and depth settings (in 3DSTATE_DEPTH_BUFFER) that affect both the depth and stencil buffers. Since these controls determine the miptree layout, they need to be set correctly in order for lod and minimum-array-element to work properly. So the only way rendering can work is if the width, height, and depth match. In the future, if this restriction proves to be a problem (say because some crucial client application relies on rendering to different levels/layers of stencil and depth buffers), then we can always work around the restriction by copying depth and/or stencil data to a temporary buffer prior to rendering (much in the same way that brw_workaround_depthstencil_alignment() does today for gen < 7), but hopefully that won't be necessary. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* hsw hiz: Add new size restrictions for miplevels > 0Jordan Justen2013-08-041-3/+13
| | | | | | | | | | | When performing hiz ops, we must ensure that the region sizes have an 8 aligned width and 4 aligned height. We can tweak the size for blorp hiz operations at LOD 0, but for the others we can't. Therefore, we disable hiz for these miplevels if they don't meet the size alignment requirements. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 blorp depth: calculate base surface width/heightJordan Justen2013-08-041-0/+13
| | | | | | | This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 depth surface: calculate minimum array element being renderedJordan Justen2013-08-042-0/+17
| | | | | | | | In layered rendering this will be 0. Otherwise it will be the selected slice. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 depth surface: calculate LOD being rendered toJordan Justen2013-08-042-0/+6
| | | | | | | This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 depth surface: calculate depth (array size) for depth surfaceJordan Justen2013-08-042-0/+5
| | | | | | | | | | This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Note: Cube maps are treated as 2D arrays with 6 times as many array elements as the cube map array would have. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* gen7 depth surface: calculate more specific surface typeJordan Justen2013-08-042-0/+47
| | | | | | | | | | This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Note: Cube maps are treated as 2D arrays with 6 times as many array elements as the cube map array would have. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* i965: init global state first in brw_workaround_depthstencil_alignmentJordan Justen2013-08-041-5/+14
| | | | | | | | In a future pass this will allow us to exit-early from this routine to disable it for gen >= 7. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Paul Berry <[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]>
* mesa: Use MIN3 instead of two MIN2s.Matt Turner2013-08-021-4/+5
|
* mesa: Update comments to match newer specs.Matt Turner2013-08-022-2/+2
| | | | | Old GL 1.x specs used 'b' but newer specs use 'p'. The line immediately above the second hunk also uses 'p'.
* i965: Initialize the maximum number of GS threads on Haswell.Kenneth Graunke2013-08-021-0/+3
| | | | | | | | We'll need proper values for max_gs_threads when we eventually support geometry shaders. Also, we initialize it for every other platform. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Disallow interpolation qualifiers on non-input/output variables.Kenneth Graunke2013-08-021-7/+18
| | | | | | | | | | | | | Commit 2548092ad8015 switched the sense of interpolation qualifier checks in order to permit them on geometry shader in/out variables. In doing so, it accidentally allowed interpolation qualifiers to be applied to ordinary variables and function parameters. Fixes a regression in Piglit's local-smooth-01.frag. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Fix NULL pointer dereferences when linking fails.Kenneth Graunke2013-08-021-8/+5
| | | | | | | | | | | | | | | Commit 7cfefe6965d50 introduced a check for whether linked->Type equals GL_GEOMETRY_SHADER. However, linked may be NULL due to an earlier error condition. Since the entire function after the error path is (or should be) guarded by linked != NULL checks, we may as well just return early and remove the checks. Fixes crashes in 9 Piglit tests. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* r600g: honour semantic index in fragment color exportsChristoph Bumiller2013-08-021-5/+5
| | | | Signed-off-by: Marek Olšák <[email protected]>
* i965: enable image external sampling for imported dma-buffersTopi Pohjolainen2013-08-022-0/+8
| | | | | Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl/dri2: support for creating images out of dma buffersTopi Pohjolainen2013-08-021-0/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v2: - upon success close the given file descriptors v3: - use specific entry for dma buffers instead of the basic for primes, and enable the extension based on the availability of the hook v4 (Chad): - use ARRAY_SIZE - improve the comment about the number of file descriptors - in case of invalid format report EGL_BAD_ATTRIBUTE instead of EGL_BAD_MATCH - take into account specific error set by the driver. v5: - fix error handling v6 (Chad): - fix invalid plane count checking v7 (Chad): - fix indentation and reset loop counter before checking for excess attributes Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: restrict dma-buf-import images to external sampling onlyTopi Pohjolainen2013-08-024-1/+27
| | | | | | | | | | | | | Memory originating outside mesa stack is meant to be for reading only. In addition, the restrictions imposed by the image external extension should apply. For example, users shouldn't be allowed to generare mip-trees based on these images. v2 (Chad): document using full extension names, fix the comment style itself and emit description of error Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: definitions for EXT_image_dma_buf_importTopi Pohjolainen2013-08-025-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As specified in: http://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt Checking for the valid fourcc values is left for drivers avoiding dependency to drm header files here. v2: enforce EGL_NO_CONTEXT v3: declare the extension as EGL (not GLES) v4: do not update eglext.h manually but rely on update from Khronos instead v5: (Eric) report invalid context as EGL_BAD_PARAMETER instead of as EGL_BAD_CONTEXT v6: (Chad) fix the checking for valid hints. Before all values were rejected. v7: (Chad) comment style change from /** * Multi- * line into /* Multi- * line Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* dri: propagate extra dma_buf import attributes to the driversTopi Pohjolainen2013-08-022-2/+53
| | | | | | | | | | | | | | | | | | | | | v2: do not break ABI, but instead introduce new entry point for dma buffers and bump up the dri-interface version to eight v3 (Chad): allow the hook to specify an error originating from the driver. For now only unsupported format is considered. I thought about rejecting the hints also as they are addressing only YUV sampling which is not supported at the moment but then thought against it as the spec is not saying one way or the other. v4 (Eric, Chad): restrict to rgb formatted only v5: rebased on top of i915/i965 split v6 (Chad): document using full extension name Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: set dri image dimensions even when creating out of primesTopi Pohjolainen2013-08-021-0/+2
| | | | | | | | | Otherwise 'intel_set_texture_image_region()' won't have enough details to work with. Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: refactor planar format lookupTopi Pohjolainen2013-08-021-13/+18
| | | | | | | | | | v2 (Eric): refactor both occurences, not just one v3 (Chad): replace 0 by NULL Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: do not create renderbuffers out of planar imagesTopi Pohjolainen2013-08-021-0/+7
| | | | | | | | v2 (Chad): emit 'GL_INVALID_OPERATION' and description of error Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* intel: allow packed prime buffers to be treated normallyTopi Pohjolainen2013-08-021-1/+5
| | | | | | | | | | v2: - fix earlier rebase error breaking bisect (loaderPriv -> loaderPrivate) Signed-off-by: Topi Pohjolainen <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* main: Warn that geometry shader support is experimental.Paul Berry2013-08-011-0/+6
| | | | | | | | | | | | | | | | | | | Geometry shader support in the Mesa front end is still fairly preliminary. Many features are untested, and the following things are known not to work: - The gl_in interface block - The gl_ClipDistance input - Transform feedback of geometry shader outputs - Constants that are new in GLSL 1.50 (e.g. gl_MaxGeometryInputComponents) This isn't a problem, since no back-end drivers currently enable geometry shaders. However, to make sure no one gets the wrong impression, emit a nasty warning to let the user know that geometry shader support isn't complete. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Implement rules for geometry shader input sizes.Paul Berry2013-08-013-0/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec contains some tricky rules for how the sizes of geometry shader input arrays are related to the input layout specification. In essence, those rules boil down to the following: - If an input array declaration does not specify a size, and it follows an input layout declaration, it is sized according to the input layout. - If an input layout declaration follows an input array declaration that didn't specify a size, the input array declaration is given a size at the time the input layout declaration appears. - All input layout declarations and input array sizes must ultimately match. Inconsistencies are reported as soon as they are detected, at compile time if the inconsistency is within one compilation unit, otherwise at link time. - At least one compilation unit must contain an input layout declaration. (Note: the geom_array_resize_visitor class was contributed by Bryan Cain <[email protected]>.) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Allow geometry shader input instance arrays to be unsized.Paul Berry2013-08-013-17/+49
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Permit non-ubo input interface arrays to use non-const indexing.Paul Berry2013-08-011-1/+2
| | | | | | | | | | | | | | | | | | | From the GLSL ES 3.00 spec: "All indexes used to index a uniform block array must be constant integral expressions." Similar text exists in GLSL specs since 1.50. When we implemented this, the only type of interface block supported by Mesa was uniform blocks, so we required all indexes used to index any interface block to be constant integral expressions. Now that we are adding interface block support for GLSL 1.50, we need a more specific check. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Cross-validate GS layout qualifiers while intrastage linking.Eric Anholt2013-08-011-0/+96
| | | | | | | | | | | This gets piglit's geometry-basic test running. TODO: Still need to validate that the GS layout qualifiers don't get used in places they shouldn't (like an interface block, or a particular shader input or output) Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Export the compiler's GS layout qualifiers to the gl_shader.Eric Anholt2013-08-012-0/+49
| | | | | | | | | | | | | | | | Next step is to validate them at link time. v2 (Paul Berry <[email protected]>): Don't attempt to export the layout qualifiers in the event of a compile error, since some of them are set up by ast_to_hir(), and ast_to_hir() isn't guaranteed to have run in the event of a compile error. Reviewed-by: Kenneth Graunke <[email protected]> v3 (Paul Berry <[email protected]>): Use PRIM_UNKNOWN to represent "not set in this shader". Reviewed-by: Ian Romanick <[email protected]>
* glsl: Parse the GLSL 1.50 GS layout qualifiers.Eric Anholt2013-08-016-1/+177
| | | | | | | | | | | | | | | Limited semantic checking (compatibility between declarations, checking that they're in the right shader target, etc.) is done. v2: Remove stray debug printfs. v3 (Paul Berry <[email protected]>): Process input layout qualifiers at ast_to_hir time rather than at parse time, since certain error conditions depend on the relative ordering between input layout qualifiers, declarations, and calls to .length(). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Make sure that we don't put too many bitfields in ast_type_qualifier.Eric Anholt2013-08-011-0/+2
| | | | | | | | | We do some tests of qualifiers using a union containing an int and the struct full of bitfields, so make sure the bitfields don't spill outside the int. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>