summaryrefslogtreecommitdiff
path: root/src/mesa
AgeCommit message (Collapse)AuthorFilesLines
2013-08-12i965/fs: Explicitly disallow CSE on predicated instructions.Kenneth Graunke1-1/+3
The existing inst->is_partial_write() already disallows predicated instructions, so this has no functional change. However, it's worth doing explicitly since the CSE pass does not consider the flag register. This means it could blindly factor out operations that use the same sources, but which have different condition codes set. This prevents a regression in the next commit. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-12i965/fs: Log a performance warning if skipping 16-wide due to pulls.Kenneth Graunke1-7/+11
Usually, the driver creates both 8-wide and 16-wide variants of every fragment shader. When 16-wide compilation fails, it logs a performance warning explaining why only an 8-wide program exists. However, when there are pull parameters, the driver won't even bother trying the 16-wide compile (since it would fail). In this case, it failed to emit a performance warning, leaving no explanation for the missing 16-wide program. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
2013-08-10i965: add missing BRW_NEW_INTERPOLATION_MAP to state dumpChris Forbes1-0/+1
Makes this flag appear in the output for INTEL_DEBUG=state Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-10i965: Add a new debug mode for the VUE mapChris Forbes3-0/+29
INTEL_DEBUG=vue now emits a listing of each slot in the VUE map, and the corresponding interpolation mode. V2: Fix whitespace issues. Signed-off-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-09main: Fix deprecation of glLineWidth()Paul Berry1-1/+2
From section E.1 (Profiles and Deprecated Features of OpenGL 3.0) of the OpenGL 3.0 spec: "LineWidth is not deprecated, but values greater than 1.0 will generate an INVALID VALUE error" From context it is clear that values greater than 1.0 should only generate an INVALID VALUE error in a forward-compatible context. The code was correctly quoting this spec text, but it was disallowing all line widths in forward-compatible contexts, instead of just widths greater than 1.0. This patch introduces the correct check, so that setting a line width of 1.0 or less is permitted. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-08i965: Remember to call intel_prepare_render() before blitting.Kenneth Graunke1-0/+5
Otherwise, blits to the window system buffer may cause crashes, since dst_irb->mt may be NULL. This code is lifted straight out of brw_blorp_framebuffer()'s try_blorp_blit() helper. Fixes crashes in Piglit's fbo-sys-blit on systems without BLORP. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65919 Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <idr@freedesktop.org> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Cc: "9.2" <mesa-stable@lists.freedesktop.org>
2013-08-06i965: Add #defines for the MI_LOAD_REGISTER_MEM command.Kenneth Graunke1-0/+4
This command reads a value from memory and writes it to a register (the opposite of MI_STORE_REGISTER_MEM). It's only available on Gen7+. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06i965: Initialize the intel_context::bufmgr pointer earlier.Kenneth Graunke1-2/+1
This prevents a crash in a future patch. _mesa_initialize_context() creates a default transform feedback object by calling the NewTransformFeedbackObject() driver hook. Eventually, we'll want to subclass that and allocate a buffer object. This means passing brw->bufmgr to drm_intel_alloc_bo(), and crashing if it isn't initialized yet. The buffer manager is actually already initialized; we just hadn't copied the pointer from intel_screen to intel_context quite early enough. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06i965: Tidy preprocessor macros for SO_PRIM_STORAGE_NEEDED registers.Kenneth Graunke1-5/+2
Gen7+ supports four transform feedback streams. Using a function-like macro makes it easy to access them by stream number or loop over them. "GEN7_" prefixes are more common than "_IVB" suffixes, so use that. Gen6 only supports a single stream, so the single #define should be fine. However, SO_NUM_PRIM_STORAGE_NEEDED was a poor name. For one, the word "NUM" doesn't appear in the actual name of the register. It's also confusingly generic, as it doesn't exist on Gen7+. Add a "GEN6_" prefix for clarity. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06i965: Tidy preprocessor macros for SO_NUM_PRIMS_WRITTEN registers.Kenneth Graunke2-7/+4
Gen7+ supports four transform feedback streams. Using a function-like macro makes it easy to access them by stream number or loop over them. "GEN7_" prefixes are more common than "_IVB" suffixes, so we use that. Gen6 only supports a single stream, so the single #define should be fine. However, SO_NUM_PRIMS_WRITTEN was confusingly generic, as it doesn't exist on Gen7+. Add a "GEN6_" prefix for clarity. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-06mesa: Generate a renderbuffer wrapper even if the texture has no imageIan Romanick1-2/+3
This prevents a segfault in check_begin_texture_render when an FBO is rebound while in this state. This fixes the piglit test fbo-incomplete-invalid-texture. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06mesa: Validate the layer selection of an array texture tooIan Romanick1-4/+30
Previously only the slice of a 3D texture was validated in the FBO completeness check. This fixes the failure in the 'invalid layer of an array texture' subtest of piglit's fbo-incomplete test. v2: 1D_ARRAY textures have Depth == 1. Instead, compare against Height. v3: Handle CUBE_MAP_ARRAY textures too. Noticed by Marek. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06mesa: Don't call driver RenderTexture for invalid zoffsetIan Romanick1-0/+6
This fixes the segfault in the 'invalid slice of 3D texture' and 'invalid layer of an array texture' subtests of piglit's fbo-incomplete test. The 'invalid layer of an array texture' subtest still fails. v2: Fix off-by-one comparison error noticed by Chris Forbes. Also, 1D_ARRAY textures have Depth == 1. Instead, compare against Height. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1] Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06mesa: Don't call driver RenderTexture for really broken texturesIan Romanick1-2/+20
This fixes the segfault in the '0x0 texture' subtest of piglit's fbo-incomplete test. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06mesa: Remove stray debug printfs in attachment completeness codeIan Romanick1-2/+0
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
2013-08-06mesa: Treat glBindFramebuffer and glBindFramebufferEXT more correctlyIan Romanick2-11/+19
Allow user-generated names for glBindFramebufferEXT on desktop GL. Disallow its use altogether for core profiles. Names bound with glBindFramebuffer in desktop OpenGL are still (incorrectly) shared across the share group instead of being per-context. This gets us a bit closer to being strictly conformant. v2: Disallow glBindFramebufferEXT in 3.1 by not installing it in the dispatch table. Suggested by Jordan. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1] Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1] Cc: mesa-stable@lists.freedesktop.org
2013-08-06mesa: Treat glBindRenderbuffer and glBindRenderbufferEXT correctlyIan Romanick2-7/+18
Allow user-generated names for glBindRenderbufferEXT on desktop GL. Disallow its use altogether for core profiles. v2: Disallow glBindRenderbufferEXT in 3.1 by not installing it in the dispatch table. Suggested by Jordan. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1] Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1] Cc: mesa-stable@lists.freedesktop.org
2013-08-06i965: Don't allocate curbe buffers on Gen6+.Kenneth Graunke1-2/+4
These are only used on Gen4-5. Why waste the 8kB of space? Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
2013-08-04intel_fbo: remove unused intel_renderbuffer hiz functionsJordan Justen2-26/+0
We are now using functions that operate on the renderbuffer attachment to handle layered rendering. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04i965 clear/draw: set renderbuffer attachment as needing depth resolveJordan Justen2-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04i965: add intel_renderbuffer_att_set_needs_depth_resolveJordan Justen2-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04i965: add intel_miptree_set_all_slices_need_depth_resolveJordan Justen2-0/+16
This function marks all slices of a renderbuffer at a particular level as needing a depth resolve. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-04i965 gen7: don't set FORCE_ZERO_RTAINDEX for layered renderingJordan Justen1-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04hsw hiz: Remove x/y offset restriction for hizJordan Justen1-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 depth surface: program 3DSTATE_DEPTH_BUFFER to top of surfaceJordan Justen4-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 fbo: make unmatched depth/stencil configs return unsupportedJordan Justen1-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04hsw hiz: Add new size restrictions for miplevels > 0Jordan Justen1-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 blorp depth: calculate base surface width/heightJordan Justen1-0/+13
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 depth surface: calculate minimum array element being renderedJordan Justen2-0/+17
In layered rendering this will be 0. Otherwise it will be the selected slice. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 depth surface: calculate LOD being rendered toJordan Justen2-0/+6
This will be used in 3DSTATE_DEPTH_BUFFER in a later patch. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 depth surface: calculate depth (array size) for depth surfaceJordan Justen2-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04gen7 depth surface: calculate more specific surface typeJordan Justen2-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-04i965: init global state first in brw_workaround_depthstencil_alignmentJordan Justen1-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 <jordan.l.justen@intel.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-02mesa: Use MIN3 instead of two MIN2s.Matt Turner1-4/+5
2013-08-02mesa: Update comments to match newer specs.Matt Turner2-2/+2
Old GL 1.x specs used 'b' but newer specs use 'p'. The line immediately above the second hunk also uses 'p'.
2013-08-02i965: Initialize the maximum number of GS threads on Haswell.Kenneth Graunke1-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 <kenneth@whitecape.org> Reviewed-by: Paul Berry <stereotype441@gmail.com>
2013-08-02i965: enable image external sampling for imported dma-buffersTopi Pohjolainen2-0/+8
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02intel: restrict dma-buf-import images to external sampling onlyTopi Pohjolainen4-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 <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02dri: propagate extra dma_buf import attributes to the driversTopi Pohjolainen2-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 <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
2013-08-02intel: set dri image dimensions even when creating out of primesTopi Pohjolainen1-0/+2
Otherwise 'intel_set_texture_image_region()' won't have enough details to work with. Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02intel: refactor planar format lookupTopi Pohjolainen1-13/+18
v2 (Eric): refactor both occurences, not just one v3 (Chad): replace 0 by NULL Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02intel: do not create renderbuffers out of planar imagesTopi Pohjolainen1-0/+7
v2 (Chad): emit 'GL_INVALID_OPERATION' and description of error Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-02intel: allow packed prime buffers to be treated normallyTopi Pohjolainen1-1/+5
v2: - fix earlier rebase error breaking bisect (loaderPriv -> loaderPrivate) Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com> Reviewed-by: Chad Versace <chad.versace@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01main: Warn that geometry shader support is experimental.Paul Berry1-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 <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01glsl: Export the compiler's GS layout qualifiers to the gl_shader.Eric Anholt1-0/+18
Next step is to validate them at link time. v2 (Paul Berry <stereotype441@gmail.com>): 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 <kenneth@whitecape.org> v3 (Paul Berry <stereotype441@gmail.com>): Use PRIM_UNKNOWN to represent "not set in this shader". Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-08-01main: Fix delete_shader_cb() for geometry shadersPaul Berry1-1/+2
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01mesa: Validate the drawing primitive against the geometry shader input ↵Fabian Bieler1-0/+68
primitive type. Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01mesa/shaderapi: Allow 0 GEOMETRY_VERTICES_OUT.Fabian Bieler1-1/+1
ARB_geometry_shader4 spec Errors: "The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is GEOMETRY_VERTICES_OUT_ARB and <value> is negative." Reviewed-by: Paul Berry <stereotype441@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01mesa: Copy linked program data for GS.Paul Berry2-1/+12
The documentation for gl_shader_program.Geom and gl_geometry_program says that the former is copied to the latter at link time, but this wasn't happening. This patch causes _mesa_ir_link_shader() to perform the copy, and updates comment accordingly. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2013-08-01mesa: Refactor copying of linked program data.Paul Berry5-10/+35
This patch creates a single function to copy the the UsesClipDistance flag from gl_shader_program.Vert to gl_vertex_program. Previously this logic was duplicated in the i965-specific function brw_link_shader() and the core mesa function _mesa_ir_link_shader(). This logic will have to be expanded to support geometry shaders, and I don't want to have to update it in two separate places. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>