summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Introduce .editorconfigEric Engestrom2016-08-3128-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | A few weeks ago, Jose Fonseca suggested [0] we use .editorconfig files to try and enforce the formatting of the code, to which Michel Dänzer suggested [1] we start by importing the existing .dir-locals.el settings. The first draft was discussed in the RFC [2]. These .editorconfig are a first step, one that has the advantage of requiring little to no intervention from the devs once the settings files are in place, but the settings are very limited. This does have the advantage of applying while the code is being written. This doesn't replace the need for more comprehensive formatting tools such as clang-format & clang-tidy, but those reformat the code after the fact. [0] https://lists.freedesktop.org/archives/mesa-dev/2016-June/121545.html [1] https://lists.freedesktop.org/archives/mesa-dev/2016-June/121639.html [2] https://lists.freedesktop.org/archives/mesa-dev/2016-July/123431.html Acked-by: Nicolai Hähnle <[email protected]> Acked-by: Eric Anholt <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* vc4: Add missing break statement.Eric Anholt2016-08-311-0/+1
| | | | | This opcode isn't used yet, so it didn't affect anything. Caught by Coverity, reported to me by imirkin.
* gallium/docs: clarify render_condition_enabled parameter to clear functionsBrian Paul2016-08-311-0/+4
| | | | | | If false, it means do the clear unconditionally. Reviewed-by: Marek Olšák <[email protected]>
* mesa: Add some more .gitignoreJason Ekstrand2016-08-312-0/+2
|
* i965: Pass start_offset to brw_set_uip_jip().Matt Turner2016-08-314-14/+6
| | | | | | | | | | | | Without this, we would pass over the instructions in the SIMD8 program (which is located earlier in the buffer) when brw_set_uip_jip() is called to handle the SIMD16 program. The assertion about compacted control flow was bogus: halt, cont, break cannot be compacted because they have both JIP and UIP. Instead, we should never see a compacted instruction in this code at all. Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Merge gen7_clip_state atom into gen6_clip_state atom.Kenneth Graunke2016-08-313-20/+1
| | | | | | | | | | | | | | | | | The original motivation was that gen6_clip_state ignored _NEW_POLYGON as it didn't care about early culling. The only other change was that Gen6 ignored BRW_NEW_TES_PROG_DATA as it doesn't have tessellation shaders, but listening to this is harmless as it'll never be signalled. Now that we've added _NEW_POLYGON for is_drawing_lines/points, we can merge the two as the distinction is meaningless. This actually fixes a bug, though: Gen8+ was using the gen6_clip_state atom because it doesn't care about early culling, but it also needs BRW_NEW_TES_PROG_DATA, which was missing. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Use gs_prog_data in is_drawing_points/lines().Kenneth Graunke2016-08-314-17/+19
| | | | | | | | State upload code should use prog_data rather than poking at core Mesa shader data structures wherever possible. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Fix missing dirty bits related to is_drawing_points/lines.Kenneth Graunke2016-08-313-5/+23
| | | | | | | | | | calculate_attr_overrides() uses is_drawing_points(), which depends on tessellation and geometry program state, as well as polygon state. v2: Add missing _NEW_POLYGON as well. Caught by Iago Toral. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* nvc0: remove an attempt at uploading all IMMD into a CBSamuel Pitoiset2016-08-313-40/+0
| | | | | | | | | | | This has never been used because info->immd.bufSize is always 0 and anyways this is an experimental code which has never been completed. This gets rid of some unused code in the program validation process. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv50: remove unused nv50_program::immd_size fieldSamuel Pitoiset2016-08-311-1/+0
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* nv30: set usage to staging so that the buffer is allocated in GARTIlia Mirkin2016-08-311-1/+2
| | | | | | | | | | The code a few lines below expects to migrate the bo in question to VRAM. Since we're filling the initial data via CPU, it's more efficient to create the temporary buffer in GART. There is no "push" method implemented, otherwise we'd use that instead. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* egl/x11_dri3: provide an authentication functionFrank Binns2016-08-311-1/+18
| | | | | | | | | | | To support WL_bind_wayland_display an authentication function needs to be provided but this was not being done for this platform as it's not strictly necessary. However, as this isn't an optional function there's the potential for a segfault to occur if authentication is mistakenly performed. Protect against this by providing a function that prints an error. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* egl/x11_dri3: disable WL_bind_wayland_display for devices without render nodesFrank Binns2016-08-312-29/+7
| | | | | | | | | | | | | | | | | Up until now, DRI3 was only used for devices that have render nodes, unless overridden via an environment variable, with it falling back to DRI2 otherwise. This limitation was there in order to support WL_bind_wayland_display as it requires client opened device node fds to be authenticated, which isn't possible when using DRI3. This is an unfortunate compromise as DRI3 provides security benefits over DRI2. Instead, allow DRI3 to be used for devices without render nodes but don't advertise WL_bind_wayland_display in this case. Applications that need this extension can still be run by disabling DRI3 support via the LIBGL_DRI3_DISABLE environment variable. Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Axel Davy <[email protected]>
* scons: Fix MinGW cross compilation.Jose Fonseca2016-08-311-21/+25
| | | | | | | The generated GLSL header files were only being built for the host platform, and not the target platform. Trivial.
* nv30: only bail on color/depth bpp mismatch when surfaces are swizzledIlia Mirkin2016-08-311-2/+3
| | | | | | | | | | | The actual restriction is a little weaker than I originally thought. See https://bugs.freedesktop.org/show_bug.cgi?id=92306#c17 for the suggestion. This also explain why things weren't *always* failing before, only sometimes. We will allocate a non-swizzled depth buffer for NPOT winsys buffer sizes, which they almost always are. Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* glsl: Handle patch qualifier on interface blocks.Kenneth Graunke2016-08-303-0/+16
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: enable OES_primitive_bounding_box with the no-op implementationIlia Mirkin2016-08-304-2/+6
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* st/mesa: provide the null implementation of bounding box outputs in tcsIlia Mirkin2016-08-303-1/+5
| | | | | | | | | Until hardware appears (in a gallium driver) that can make use of the TCS-outputted gl_BoundingBox, we just request that the variable gets assigned as a regular patch variable. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: add gl_BoundingBox and associated varying slotsIlia Mirkin2016-08-306-1/+30
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add support for GL_PRIMITIVE_BOUNDING_BOX storage and queryIlia Mirkin2016-08-304-0/+57
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add scaffolding for OES/EXT_primitive_bounding_boxIlia Mirkin2016-08-3012-1/+153
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* docs: add GL_OES_viewport_array to featuresIlia Mirkin2016-08-301-0/+1
| | | | Signed-off-by: Ilia Mirkin <[email protected]>
* aubinator: fix if indentation and add brackets to multiline bodyTimothy Arceri2016-08-311-3/+4
| | | | | | Fixes misleading indentation warning in gcc. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Assert that the number of color targets is one when dual-source ↵Francisco Jerez2016-08-301-0/+1
| | | | | | | | | blend is enabled. Requested by Anuj during review of 4a87e4ade778e56d43333c65a58752b15a00ce69, adding as follow-up since it led to assertion failures due to various GLSL bugs that should be fixed now.
* glsl: Fix gl_program::OutputsWritten computation for dual-source blending.Francisco Jerez2016-08-302-4/+2
| | | | | | | | | | | | | | | | | | | | In the fragment shader OutputsWritten is a bitset of FRAG_RESULT_* enumerants, which represent the location of each color output written by the shader. The secondary and primary color outputs of a given render target using dual-source blending have the same location, so the 'idx' computation below will give the wrong bit as result if the 'var->data.index' term is non-zero -- E.g. if the shader writes the primary and secondary colors of the FRAG_RESULT_COLOR output, ir_set_program_inouts will think that the shader writes both FRAG_RESULT_COLOR and FRAG_RESULT_SAMPLE_MASK, which is just bogus. That would cause the brw_wm_prog_key::nr_color_regions computation done in the i965 driver during fragment shader precompilation to be wrong, which currently leads to unnecessary recompilation of shaders that use dual-source blending, and triggers an assertion failure in fs_visitor::emit_fb_writes() on my i965-fb-fetch branch. Reviewed-by: Ilia Mirkin <[email protected]>
* glsl: Fix incorrect hard-coded location of the gl_SecondaryFragColorEXT ↵Francisco Jerez2016-08-301-7/+2
| | | | | | | | | | | | | | | | | | | built-in. gl_SecondaryFragColorEXT should have the same location as gl_FragColor for the secondary fragment color to be replicated to all fragment outputs. The incorrect location of gl_SecondaryFragColorEXT would cause the linker to mark both FRAG_RESULT_COLOR and FRAG_RESULT_DATA0 as being written to, which isn't allowed by the spec and would ultimately lead to an assertion failure in fs_visitor::emit_fb_writes() on my i965-fb-fetch branch. This should also fix the code below for multiple dual-source-blended render targets, which no driver currently supports but we have plans to enable eventually in the i965 driver (the comment saying that no hardware will ever support it seems rather hilarious). Reviewed-by: Ilia Mirkin <[email protected]>
* st/glsl_to_tgsi: Use SecondaryOutputsWritten to determine dual-source ↵Francisco Jerez2016-08-302-8/+15
| | | | | | | | | | | | | | | | | | | fragment outputs. Currently the mesa state tracker relies on there being two bits set per dual-source output in the gl_program::OutputsWritten bitset, but that only worked due to a GLSL front-end bug that caused it to set the OutputsWritten bit for both location and location+1 even though at the GLSL level the primary and secondary color outputs used for dual-source blending have the same location. Fix it by extending outputMapping[] to 2*FRAG_RESULT_MAX elements in order to represent a mapping from a (location, index) pair to its TGSI output, which should also make it slightly easier to add support for dual-source blending in combination with multiple render targets in the long run. No Piglit regressions on llvmpipe. Reviewed-by: Ilia Mirkin <[email protected]>
* glsl: Calculate bitset of secondary outputs written in ir_set_program_inouts.Francisco Jerez2016-08-302-2/+8
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* glsl: Fix typo in commentIan Romanick2016-08-301-1/+1
| | | | | | Trivial. Signed-off-by: Ian Romanick <[email protected]>
* glsl: Replace most assertions with unreachable()Ian Romanick2016-08-301-10/+9
| | | | | | | | | | | | | | text data bss dec hex filename 7669233 277176 28624 7975033 79b079 i965_dri.so before generated code 7647081 277176 28624 7952881 7959f1 i965_dri.so before this commit 7669289 277176 28624 7975089 79b0b1 i965_dri.so with this commit Looking at the generated assembly, it appears that some of changes made in the generated code prevent some loops from being unrolled. Removing the default cases (via unreachable()) allows these loops to unroll again. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Refactor handling of horizontal operationsIan Romanick2016-08-301-8/+7
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Use constant_template_horizontal instead of ↵Ian Romanick2016-08-301-1/+1
| | | | | | | | | | | constant_template_horizontal_single_implementation for unops This changes the "shape" of all the pack and unpack operators, but they should function the same. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Eliminate constant_template2Ian Romanick2016-08-301-11/+0
| | | | | | | | | constant_template_common can now handle the case where the result type is different from the input type by using type_signature_iter. This changes the "shape" of all the cast-style operators, but they should function the same. Signed-off-by: Ian Romanick <[email protected]>
* glsl: Eliminate constant_template5Ian Romanick2016-08-301-22/+1
| | | | | | | | constant_template_common can now handle the case where the result type is different from the input type by using type_signature_iter. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Eliminate constant_template0Ian Romanick2016-08-301-34/+4
| | | | | | | | | This template is mostly an artefact of the development of the original patch series and to minimize the differences between the original code and the generated code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Eliminate one of the templates for simpler operationsIan Romanick2016-08-301-21/+3
| | | | | | | | | | The difference between these two templates were mostly an artefact of the development of the original patch series and to minimize the differences between the original code and the generated code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Use the generated constant expression codeIan Romanick2016-08-304-1109/+14
| | | | | | | | | | | | | | Immediately previous to this patch, diff -wud src/glsl/ir_constant_expression.cpp \ src/glsl/ir_expression_operation_constant.h should be "minimal." v3: With much help from José Fonseca, fix the SCons build. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Generate code for constant ir_triop_csel expressionsIan Romanick2016-08-301-1/+23
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_triop_lrp expressionsIan Romanick2016-08-301-1/+28
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_quadop_vector expressionsIan Romanick2016-08-301-2/+20
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_quadop_bitfield_insert expressionsIan Romanick2016-08-301-4/+21
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_triop_vector_insert expressionsIan Romanick2016-08-301-2/+25
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_vector_extract expressionsIan Romanick2016-08-301-1/+21
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_mul expressionsIan Romanick2016-08-301-2/+54
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_triop_fma and ir_triop_bitfield_extract ↵Ian Romanick2016-08-301-5/+13
| | | | | | | | | | | | expressions ir_triop_bitfield_extract is a little weird because the second and third operand and aways int, so they may differ in type from the first operand. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_dot expressionsIan Romanick2016-08-301-1/+18
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_lshift and ir_binop_rshift expressionsIan Romanick2016-08-301-2/+13
| | | | | | | | | | | | | | | | The code generated is quite different from what was previously used. I believe that it is still correct by the GLSL spec, and I believe, due to C rules about shifts, the behavior will be the same. Section 5.9 (Expressions) of the GLSL 4.50 spec says: The result is undefined if the right operand is negative, or greater than or equal to the number of bits in the left expression's base type. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_ldexp expressionsIan Romanick2016-08-301-4/+19
| | | | | | | | | | | | ldexp is weird because its two operands have different types. Add support for directly specifying the exact signatures of all the possible variations of an operation. v2: Use tuple() instead of () for clarity. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant unary expressions that don't assign the ↵Ian Romanick2016-08-301-8/+18
| | | | | | | | | | | | | | destination These are operations like the pack functions that have separate functions that assign multiple outputs from a single input. v2: Correct the source and destination types. They were previously transposed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for some constant binary expression that are horizontalIan Romanick2016-08-301-3/+7
| | | | | | | | | | Only operations where the implementation is identical code regardless of type. The only such operations are ir_binop_all_equal and ir_binop_any_nequal. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>