summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa/fbobject: propogate Layered when reusing attachments.Dave Airlie2016-03-011-0/+1
| | | | | | | | | | | | When reusing a depth attachment as a stencil, we need to propogate the layered bit, otherwise we fail to complete the framebuffer. discovered running ./bin/fbo-depth-array depth-layered-clear on virgl on haswell. Reviewed-by: Marek Olšák <[email protected]> Cc: "11.1 11.2" <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Android: clean-up and fix DRI module path handlingRob Herring2016-02-293-5/+2
| | | | | | | | | | | | | | | MESA_DRI_MODULE_PATH is only getting set for classic DRI drivers and may or may not be set correctly for gallium_dri.so depending on the makefile include ordering. For Android 6 and earlier it is fine, but with build system changes in AOSP master, it is not. Move the path variables to a single place at the top level and introduce MESA_DRI_MODULE_REL_PATH for Android 5 and later which require relative paths. With this, there is a single variable to change. Cc: "11.1 11.2" <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Android: remove dependence on .SECONDEXPANSIONRob Herring2016-02-291-9/+13
| | | | | | | | | | With the Android build system changes to ninja/kati, the use of .SECONDEXPANSION is no longer supported. Fix this by avoiding rule specific variables and using $(transform-generated-source). Cc: "11.1 11.2" <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* Android: fix build break from nir/glsl move to compiler/Rob Herring2016-02-298-10/+10
| | | | | | | | | | | | | | | | Commits a39a8fbbaa12 ("nir: move to compiler/") and eb63640c1d38 ("glsl: move to compiler/") broke Android builds. Fix them. There is also a missing dependency between generated NIR headers and several libraries. This isn't a new issue, but seems to have been exposed by the NIR move. Built with i915, i965, freedreno, r300g, r600g, vc4, and virgl enabled. Cc: "11.2" <[email protected]> Cc: Mauro Rossi <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: add GL_OES_gpu_shader5 and GL_EXT_gpu_shader5 supportIlia Mirkin2016-02-271-0/+2
| | | | | | | | | | | The two extensions are identical, and are largely taking bits of already existing desktop functionality. We continue to do a poor job of supporting the 'precise' keyword, just like we do on desktop. This passes the relevant dEQP tests that I could find. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: expose GL_EXT_texture_sRGB_decode on GLES 3.0+Ilia Mirkin2016-02-262-3/+2
| | | | | | | | Could be exposed on earlier GLES versions if we supported EXT_sRGB, but we don't, for now. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* i965/cfg: Fix comment list punctuationIan Romanick2016-02-261-1/+1
| | | | | | Trivial Signed-off-by: Ian Romanick <[email protected]>
* i965/cfg: Split out dead control flow paths to simplify both pathsIan Romanick2016-02-261-55/+38
| | | | | | | v2: Fix some bad indentation. Suggested by Curro. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965/cfg: Don't handle fully empty if/else/endifIan Romanick2016-02-261-10/+4
| | | | | | | | | | This will now never occur. The empty if-else part would have already been removed leaving an empty if-endif part. No shader-db changes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965/cfg: Eliminate an empty then-branch of an if/else/endifIan Romanick2016-02-261-0/+14
| | | | | | | | | | | | | | | | On BDW, total instructions in shared programs: 8448571 -> 8448367 (-0.00%) instructions in affected programs: 21000 -> 20796 (-0.97%) helped: 116 HURT: 0 v2: Remove spurious attempt to combine the if_block with the (removed!) else_block. Suggested by Matt and Curro. Correct the comment describing what the new pass does. Suggested by Matt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965/cfg: Track prev_block and prev_inst explicitly in the whole functionIan Romanick2016-02-261-5/+7
| | | | | | | | This provides a trivial simplification now, and it makes some future changes more straight forward. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965/cfg: Slightly rearrange dead_control_flow_eliminateIan Romanick2016-02-261-56/+57
| | | | | | | | | 'git diff -w' is a bit more illustrative. A couple declarations were moved, the continue was removed, and the code was reindented. This will simplify future changes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965: Simplify brw_nir_lower_vue_inputs() slightly.Kenneth Graunke2016-02-261-11/+6
| | | | | | | The same code appeared in both branches; pull it above the if statement. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Avoid recalculating the normal VUE map for IO lowering.Kenneth Graunke2016-02-264-51/+30
| | | | | | | | The caller already computes it. Now that we have stage specific functions, it's really easy to pass this in. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Avoid recalculating the tessellation VUE map for IO lowering.Kenneth Graunke2016-02-264-26/+25
| | | | | | | | The caller already computes it. Now that we have stage specific functions, it's really easy to pass this in. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Eliminate brw_nir_lower_{inputs,outputs,io} functions.Kenneth Graunke2016-02-267-93/+33
| | | | | | | | | | | | Now that each stage is directly calling brw_nir_lower_io(), and we have per-stage helper functions, it makes sense to just call the relevant one directly, rather than going through multiple switch statements. This also eliminates stupid function parameters, such as the two that only apply to vertex attributes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Split brw_nir_lower_inputs/outputs into per-stage functions.Kenneth Graunke2016-02-261-130/+174
| | | | | | | | These functions are both giant switch statements where most cases don't overlap at all. Let's put the bulk of the work in per-stage helpers. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Remove catch-all nir_lower_io call with specific cases.Kenneth Graunke2016-02-261-1/+4
| | | | | | | | | Most cases already call nir_lower_io explicitly for input and output lowering. This catch all isn't very useful anymore - we can just add it to the remaining cases. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Move optimizations from brw_nir_lower_io to brw_postprocess_nir.Kenneth Graunke2016-02-261-1/+3
| | | | | | | | | | This simplifies things. Every caller of brw_nir_lower_io() immediately calls brw_postprocess_nir(). The only real change this will have is that we get an extra brw_nir_optimize() call when compiling compute shaders, but that seems fine. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Always do NIR IO lowering at specialization time.Kenneth Graunke2016-02-262-8/+1
| | | | | | | | | | | | | | We've now hit literally every case other than geometry shaders (and compute shaders, but those are a no-op). So, let's just move geometry shaders over too and be done with it. The only advantage to doing this at link time was to save the expense of running the pass on recompiles. But we're already running a lot of passes, and the extra code complexity isn't worth it. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Make an is_scalar boolean in brw_compile_gs().Kenneth Graunke2016-02-261-4/+4
| | | | | | | | | Shorter than compiler->scalar_stage[MESA_SHADER_GEOMETRY], which can help with line-wrapping. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965/nir: Do lower_io late for fragment shadersJason Ekstrand2016-02-262-1/+3
| | | | | | | | | | | | The Vulkan driver wants to be able to delete fragment outputs that are beyond key.nr_color_regions; this is a lot easier if we lower outputs at specialization time rather than link time. (Rationale added to commit message by Ken) Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]>
* i965: Set dest type to UW for several send messagesJordan Justen2016-02-262-2/+5
| | | | | | | | | | | | | | Without this, on SIMD 16 the send instruction destination will appear to write more than one destination register, causing the simulator to report an error. Of course, the send instruction can actually write more than one destination register regardless of the type set for the destination, so this is a bit strange. Suggested-by: Kenneth Graunke <[email protected]> Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* program: Remove extra reference_program()Miklós Máté2016-02-251-2/+0
| | | | | | It was already done in get_mesa_program() Signed-off-by: Marek Olšák <[email protected]>
* i965/fs: Allow saturate propagation to propagate negations into MADs.Matt Turner2016-02-251-0/+4
| | | | | | | | | | | | | | | | Allows us to transform mad res src0 src1 src2 mov.sat dst -res into mad.sat dst -src0 -src1 src2 instructions in affected programs: 3712 -> 3688 (-0.65%) helped: 24 Reviewed-by: Ian Romanick <[email protected]>
* i965/fs: Allow saturate propagation to propagate negations into ADDs.Matt Turner2016-02-252-4/+52
| | | | | | | | | | | | | | | Allows us to transform add res src0 src1 mov.sat dst -res into add.sat dst -src0 -src1 No shader-db changes. Reviewed-by: Ian Romanick <[email protected]>
* i965/fs: Allow saturate propagation to propagate negations into MULs.Matt Turner2016-02-252-3/+137
| | | | | | | | | | | | | | | | Allows us to transform mul res src0 src1 mov.sat dst -res into mul.sat dst src0 -src1 instructions in affected programs: 45246 -> 45054 (-0.42%) helped: 162 Reviewed-by: Ian Romanick <[email protected]>
* i965/fs: Don't CSE negated multiplies with saturation.Matt Turner2016-02-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | It's not correct to CSE these multiplies mul.sat dst1, -a, b mul.sat dst2, a, b by emitting a negated MOV from dst1 to dst2: mul.sat dst1, -a, b mov dst2, -dst1 Take 2.0*2.0 for example. The first multiply would produce 0.0 and the second would produce 1.0. Fixes bad generated code in 18 to 22 shaders: instructions in affected programs: 432 -> 464 (7.41%) helped: 4 HURT: 18 Cc: [email protected] Reviewed-by: Ian Romanick <[email protected]>
* i965: Enable tiled mem_copy with sRGB-formatted resourcesNanley Chery2016-02-241-2/+6
| | | | | | | | | | | RGBA8 and BGRA8 unorm formats are compatible with the various mem_copy functions. Their sRGB counterparts are also compatible because they're also color-renderable (of importance when the specified resource is a readbuffer) and they share the same physical layout. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: replace for loop with bitshifting in supported_buffer_bitmask()Brian Paul2016-02-241-4/+1
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: updates some comments in buffers.cBrian Paul2016-02-241-3/+6
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: make _mesa_draw_buffers() staticBrian Paul2016-02-242-11/+7
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: make _mesa_draw_buffer() staticBrian Paul2016-02-242-9/+6
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: make _mesa_read_buffer() staticBrian Paul2016-02-242-10/+7
| | | | | | | Not called from any other file. Remove _mesa_ prefix and update comments. Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: move declaration of buffer var in handle_first_current()Brian Paul2016-02-241-2/+4
| | | | | | | Declare the var in the scopes where it's used. Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: use gl_buffer_index in a few placesBrian Paul2016-02-243-5/+6
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: remove useless break statementBrian Paul2016-02-241-1/+0
| | | | | Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: rename st_readpixels to st_ReadPixelsBrian Paul2016-02-241-2/+2
| | | | | | | To match the convention of other device driver functions. Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* st/mesa: fix frontbuffer glReadPixels regressionsBrian Paul2016-02-241-2/+11
| | | | | | | | | | | | | | | | | | | | | The change "mesa/readpix: Don't clip in _mesa_readpixels()" caused a few piglit regressions. The failing tests use glReadPixels to read from the front color buffer. The problem is we were trying to read from a non-existant front color buffer. The front color buffer is created on demand in st/mesa. Since the missing buffer bounds were effectively 0 x 0 the glReadPixels was totally clipped and returned early. The fix involves creating the real front color buffer when we're about to try reading from it. Tested with llvmpipe and VMware driver on Linux, Windows. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94253 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94254 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94257 Cc: [email protected] Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: use sizeof on the correct typeThomas Hindoe Paaboel Andersen2016-02-231-1/+1
| | | | | | | | Before the luminance stride was based on the size of GL_FLOAT which is just the type constant (0x1406). Change it to use the size of GLfloat. Reviewed-by: Brian Paul <[email protected]>
* i965/fs: Return result of image atomic in a register of the expected type.Francisco Jerez2016-02-221-1/+1
| | | | | | | | So the result is of float type if we're implementing the float overload of imageAtomicExchange. This is the only back-end change required to support OES_shader_image_atomic AFAICT. Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Add extension table entry for OES_shader_image_atomic.Francisco Jerez2016-02-221-0/+1
| | | | | | v2: No need for extension enable bits (Ilia). Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add GL_EXT_texture_border_clamp supportIlia Mirkin2016-02-221-0/+1
| | | | | | | | This extension is identical to GL_OES_texture_border_clamp. But dEQP has tests that want the EXT variant. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: add GL_OES_texture_border_clamp supportIlia Mirkin2016-02-224-6/+22
| | | | | | | Only minor differences to the existing ARB_texture_border_clamp support. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* st/mesa: force depth mode to GL_RED for sized depth/stencil formatsIlia Mirkin2016-02-191-9/+25
| | | | | | | | | | | See commit 9db2098d for the i965 version of this. This fixes depth in a bunch of dEQP EXT_texture_border_clamp tests. And probably other ones as well. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* meta/copy_image: use precomputed dst_internal_format to avoid segfaultIlia Mirkin2016-02-191-1/+1
| | | | | | | | | If the destination is a renderbuffer, dst_tex_image will be NULL. This fixes the *to_renderbuffer dEQP copy image tests. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: [email protected]
* mesa: add GL_OES_texture_stencil8 supportIlia Mirkin2016-02-193-0/+11
| | | | | | | | | It's basically the same thing as GL_ARB_texture_stencil8 except that glCopyTexImage isn't supported, so add STENCIL_INDEX to the list of invalid GLES formats for glCopyTexImage. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* st/mesa: fix pbo uploadsIlia Mirkin2016-02-191-10/+18
| | | | | | | | | | | - LOD must be provided in .w for TXF (even for buffer textures) - User buffer must be valid at draw time - Must have a sampler associated with the sampler view This makes PBO uploads work again on nouveau. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: check fbo completeness based on internal format, not driver formatIlia Mirkin2016-02-191-3/+2
| | | | | | | | | | | | The base format is a function of the user-requested format, while the driver format is not. So we should use the base format instead. The driver format can be anything. Specifically in the stencil-only case, it might be a depth/stencil format. However we still want to refuse such an attachment when bound to GL_DEPTH. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: small optimization of _mesa_expand_bitmap()Brian Paul2016-02-191-7/+4
| | | | | | Avoid a per-pixel multiply. Reviewed-by: Kenneth Graunke <[email protected]>