aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa: fix debug/error messages in glColorMaski()Samuel Pitoiset2017-08-241-4/+4
| | | | | | | Trivial. While we are at it, adjust indentation. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* i965: Stop using wm_prog_data->binding_table.render_target_start.Kenneth Graunke2017-08-231-7/+3
| | | | | | | | | | | | | Render target surfaces always start at binding table index 0. This is required for us to use headerless FB writes, which we really want to do. So, we'll never change that. Given that, it's not necessary to look up a wm_prog_data field which we already know contains 0. We can drop the dependency in brw_renderbuffer_surfaces (Gen4-5)...which was already confusingly missing from gen6_renderbuffer_surfaces. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Add a brw_wm_prog_data::has_render_target_reads field.Kenneth Graunke2017-08-231-4/+2
| | | | | | | State upload code should use prog_data rather than poking at shader_info directly. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Inline brw_update_renderbuffer_surfaces().Kenneth Graunke2017-08-232-38/+20
| | | | | | Less baklava layers. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Pass fb into emit_null_surface instead of dimensions.Kenneth Graunke2017-08-231-16/+12
| | | | | | | We either want the framebuffer dimensions or 1x1x1. Passing fb and falling back to 1x1x1 lets us shorten some calls. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Devirtualize update_renderbuffer_surface.Kenneth Graunke2017-08-234-30/+5
| | | | | | Replace piles of my own boilerplate with 1-2 lines of code. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Delete update_renderbuffer_surface flags.Kenneth Graunke2017-08-232-21/+5
| | | | | | | | | We don't need yet another set of flags. The function already has access to both brw and the unit, so it can check brw->draw_aux_buffer_disabled itself in one line of code. The layered flag was only used to assert that Gen4-5 doesn't do layered rendering, which isn't that useful. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Make brw_update_renderbuffer_surface static.Kenneth Graunke2017-08-232-11/+6
| | | | | | | | Also rename it to gen6_update_renderbuffer_surface, as this is the function for Gen6+. Having functions named "brw_*" and "gen4_*" is confusing...if we're using gens, let's stick with those. Reviewed-by: Topi Pohjolainen <[email protected]>
* i965: Drop BRW_NEW_BLORP from SURFACE_STATE setup code.Kenneth Graunke2017-08-235-29/+1
| | | | | | | BLORP invalidates the binding tables, but it doesn't destroy any of the existing SURFACE_STATE entries in the statebuffer. We can reuse those. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Make a BRW_NEW_FAST_CLEAR_COLOR dirty bit.Kenneth Graunke2017-08-238-5/+25
| | | | | | | | | | | | | | | | | | | When changing fast clear colors, we need to emit new SURFACE_STATE with the updated color at the next draw call. Most things work today because the atoms that handle SURFACE_STATE for images (mutable images, textures, render targets) also listen to BRW_NEW_BLORP, causing us to re-emit these on every BLORP operation. However, this is overkill - most BLORP operations don't require us to re-emit SURFACE_STATE. One case where this is broken today is a fast clear to a different color followed by a non-coherent framebuffer fetch. The renderbuffer read atom doesn't listen to BRW_NEW_BLORP, and would not get the new fast clear color. Cc: [email protected] Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Drop Gen7+ nonsense from brw_ff_gs.c.Kenneth Graunke2017-08-231-4/+3
| | | | | | | | | | brw_ff_gs.c is about using the geometry shader to implement things that the fixed function ought to do, but doesn't on old hardware. Gen7+ does not need this. We should drop the misleading comment about Gen7 not using geometry shaders. Reviewed-by: Timothy Arceri <[email protected]>
* i965: Only set key->flat_shade if COL0/COL1 are written.Kenneth Graunke2017-08-231-1/+3
| | | | | | This may reduce some recompiles. Reviewed-by: Timothy Arceri <[email protected]>
* i965: Clean up brwNewProgram().Kenneth Graunke2017-08-231-28/+5
| | | | | | | | | | All shader stages do the exact same thing, so we don't need the switch statement, or the redundant FS case. I believe these used to be different before Tim eliminated the (e.g.) brw_vertex_program subclasses. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium: remove TGSI opcode SCSMarek Olšák2017-08-222-12/+4
| | | | | | | use COS+SIN instead. Reviewed-by: Roland Scheidegger <[email protected]> Acked-by: Jose Fonseca <[email protected]>
* st/glsl_to_tgsi: fix getting the image type for array of structs (again)Samuel Pitoiset2017-08-221-5/+3
| | | | | | | | | | | We want the type of the field, not of the struct. This fixes a regression in the following piglit test: arb_bindless_texture/compiler/images/arrays-of-struct.frag Fixes: 49d9286a3f ("glsl: stop copying struct and interface member names") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium: remove TGSI opcode XPDMarek Olšák2017-08-221-7/+11
| | | | | | use MUL+MAD+MOV instead. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: remove TGSI opcode DPHMarek Olšák2017-08-221-2/+11
| | | | | | use DP4 or DP3 + ADD. Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: remove TGSI opcode DP2AMarek Olšák2017-08-221-1/+0
| | | | | | use DP3 instead. Reviewed-by: Roland Scheidegger <[email protected]>
* glsl_to_tgsi: clean up opcode translationMarek Olšák2017-08-221-62/+30
| | | | | | An island of beauty in the middle of chaos. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: pass ctx to add_uniform_to_shader constructorTimothy Arceri2017-08-224-7/+10
| | | | | | Fixes: 4c2422067b5c ("glsl: pass UseSTD430AsDefaultPacking to where it will be used") Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: only expose EXT_memory_object functions if the ext is supportedSamuel Pitoiset2017-08-223-7/+75
| | | | | | | | | They should not be exposed when the extension is unsupported. Note that ARB_direct_state_access is always exposed and EXT_semaphore is not supported at all. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only expose glImportMemoryFdEXT if the ext is supportedSamuel Pitoiset2017-08-221-0/+6
| | | | | | | | | | | | | | | From the EXT_external_objects_fd spec: "If the GL_EXT_memory_object_fd string is reported, the following commands are added: void ImportMemoryFdEXT(uint memory, uint64 size, enum handleType, int fd);" Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965/clear: Quantize the depth clear value based on the formatJason Ekstrand2017-08-211-2/+12
| | | | | | | | | | | | | | | | | | In f9fd976e8adba733b08d we changed the clear value to be stored as an isl_color_value. This had the side-effect same clear value check is now happening directly between the f32[0] field of the isl_color_value and ctx->Depth.Clear. This isn't what we want for two reasons. One is that the comparison happens in floating point even for Z16 and Z24 formats. Worse than that, ctx->Depth.Clear is a double so, even for 32-bit float formats, we were comparing as doubles and not floats. This means that the test basically always fails for anything other than 0.0f and 1.0f. This caused a slight performance regression in Lightsmark 2008 because it was using a depth clear value of 0.999 which can't be stored in a 32-bit float so we were doing unneeded resolves. Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/101678 Cc: "17.2" <[email protected]>
* mesa/st: simplify some UBO index logicTimothy Arceri2017-08-221-3/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* i965: enable STD430 packing by default on IVB+Timothy Arceri2017-08-221-0/+16
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: pass UseSTD430AsDefaultPacking to where it will be usedTimothy Arceri2017-08-221-2/+4
| | | | | | | Here we also make use of the UseSTD430AsDefaultPacking constant and call the new get_internal_ifc_packing() helper. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add UseSTD430AsDefaultPacking constantTimothy Arceri2017-08-221-0/+9
| | | | | | | This will be used to enable the STD430 layout as the default for UBOs and SSBOs with layouts of shared/packed rather than STD140. Reviewed-by: Marek Olšák <[email protected]>
* mesa: optimize _mesa_attr_zero_aliases_vertex()Brian Paul2017-08-213-12/+22
| | | | | | | | | | | After the context is initialized, the API and context flags won't change. So, we can compute whether vertex attribute 0 aliases vertex position just once. This should make the glVertexAttrib*() functions a little quicker. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* vbo: use new _is_vertex_position() helper in vbo_attrib_tmp.hBrian Paul2017-08-211-36/+46
| | | | | | | Makes the code a bit more understandable. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* vbo: make vbo_bind_arrays() staticBrian Paul2017-08-212-3/+1
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: formatting clean-up in syncobj.cBrian Paul2017-08-211-10/+13
| | | | Line wrap to 78 columns, etc. Trivial.
* mesa: fix ES only draw if we have vertex positionsTimothy Arceri2017-08-221-2/+2
| | | | | | | | | | | | This code was separated from the validation code so it could use used with KHR_no_error paths. The return values were inverted to reflect the name of the helper, but here the condtion was mistakenly inverted rather than the return value. Fixes: 4df2931a87fe (mesa/vbo: move some Draw checks out of validation) Reported-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl: Remove unused private fieldsMatt Turner2017-08-211-2/+1
| | | | Reviewed-by: Jordan Justen <[email protected]>
* mesa: Don't compare unsigned for < 0Matt Turner2017-08-211-1/+1
| | | | | | | | | | | | | The INTEL_performance_query spec says "Performance counter id 0 is reserved as an invalid counter." GLuint counterid_to_index(GLuint counterid) just returns counterid - 1, so with unsigned overflow rules, it will generate 0xFFFFFFFF given an input of 0. 0xFFFFFFFF will trigger the counterIndex >= queryNumCounters check, so the code worked as is. It just contained a useless comparison. Reviewed-by: Jordan Justen <[email protected]>
* i965/bufmgr: s/BO_ALLOC_FOR_RENDER/BO_ALLOC_BUSY/Jason Ekstrand2017-08-204-19/+18
| | | | | | | | | | "Alloc for render" is a terrible name for a flag because it means basically nothing. What the flag really does is allocate a busy BO which someone theorized at one point in time would be more efficient if you're planning to immediately render to it. If the flag really means "alloc a busy BO" we should just call it that. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/tex: Change the flags type on create_for_teximageJason Ekstrand2017-08-201-1/+1
| | | | | | This matches the actual function declaration. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: only copy requested compressed teximage cubemap facesChristoph Haag2017-08-201-2/+2
| | | | | | | | | This is analogous to commit 2259b11 which only fixed the regular case Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102308 Signed-off-by: Christoph Haag <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* i965/tex: Don't pass samples to miptree_create_for_teximageJason Ekstrand2017-08-191-1/+1
| | | | | | | | | | | | | | | | | In 76e2f390f9863a35, when Topi switched num_samples from 0 to 1 for single-sampled, he accidentally switched the last parameter in the call to miptree_create_for_teximage from 0 to 1 thinking it was num_samples when it was actually layout_flags. Switching from 0 to 1 added the MIPTREE_LAYOUT_ACCELERATED_UPLOAD flag which causes us to allocate a busy BO instead of an idle one. This caused the subsequent CPU upload to consistently stall. The end result was a 15% performance drop in the SynMark v7 DrvRes microbenchmark. This restores the old behavior and fixes the performance regression. Reviewed-by: Topi Pohjolainen <[email protected]> Fixes: 76e2f390f9863a356d1419982dec705260d67eff Bugzilla: https://bugs.freedesktop.org/102260 Cc: [email protected]
* i965: Use ISL for emitting null surface states.Kenneth Graunke2017-08-197-351/+49
| | | | | | | We handle the Sandybridge multisampled 2D surface hack here, rather than in ISL, because it requires allocating a BO, and is kind of messy. Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Remove tabs in intel_batchbuffer.c.Kenneth Graunke2017-08-181-7/+7
| | | | | | | Our coding style is to use spaces. Some of this was also messed up during my bufmgr import series. (Trivial, just whitespace changes.)
* i965/miptree: Return NONE from texture_aux_usage when fully resolvedJason Ekstrand2017-08-181-1/+14
| | | | | | | | | | | This little optimization improves the performance of SynMark v7 TexFilterTri by almost 10% on Sky Lake GT4 among other improvements. We've been doing it for some time but somehow it got dropped during the miptree refactoring. Reviewed-by: Kenneth Graunke <[email protected]> Bugzilla: https://bugs.freedesktop.org/102258 Cc: "17.2" <[email protected]>
* i965: Stop looking at NewDriverState when emitting 3DSTATE_URBJason Ekstrand2017-08-183-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Looking at NewDriverState is not safe in general. The state atom system is set up to ensure that new bits that get added to NewDriverState get accumulated into the set of bits used when emitting atoms but it doesn't go the other way. If we read NewDriverState, we may not get the full picture because the per-pipeline state (3D or compute) does not get added to NewDriverState before state emit is done. It's especially dangerous to do this from BLORP (either explicitly or implicitly when BLORP calls gen7_upload_urb) because that does not happen during one of the normal state upload paths. This commit solves the problem by whacking all of the per-shader-stage URB sizes to zero whenever we change the total URB size. We still have to flag BRW_NEW_URB_SIZE to ensure that the gen7_urb atom triggers but the actual decision in gen7_upload_urb can now be based entirely on URB sizes rather than on state atoms. This also makes BLORP correct because it just asks for a new URB config whenever the vsize is too small and so any change to the total URB size will trigger blorp to re-emit as well because 0 < vs_entry_size. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Bugzilla: https://bugs.freedesktop.org/102289 Cc: [email protected]
* i965: Mark all EGLimages as non-coherent.Kenneth Graunke2017-08-181-5/+3
| | | | | | | | | | | | | | | | EGLimages are shared with external users, and we don't know what they're going to do with them. They might scan them out. They might access them in a way that doesn't work with our explicit clflushing. It's safest to simply mark them non-coherent. Chris Wilson caught this problem and wrote a similar (though less aggressive) patch to solve it; the miptree code has since undergone a lot of refactoring so I had to rewrite it. Cc: "17.2" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chris Wilson <[email protected]>
* i965: Fix missing newlines in perf_debug messages.Kenneth Graunke2017-08-172-3/+3
| | | | perf_debug() doesn't append a newline for you.
* st/mesa: remove Windows hack for glFinishBrian Paul2017-08-161-12/+0
| | | | | | | | | | | | | | I see no evidence that opengl32.dll's wglSwapBuffers calls glFinish. It looks like Jose removed that dependency years ago, but this hack remained. Removing this code also fixes the Piglit sync_api test since commit eceb6710024716. No piglit regressions. No glretrace regressions, per Charmaine. Fixes VMware bug 1937990. Reviewed-by: Charmaine Lee <[email protected]>
* st/mesa: fix a null pointer accessFrank Richter2017-08-161-1/+1
| | | | | | | | Fixes crash with llvmpipe on Windows. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102148 Cc: [email protected] Reviewed-by: Brian Paul <[email protected]>
* i965: Alphabetize TCS image dirty bitsKenneth Graunke2017-08-161-1/+1
| | | | Trivial.
* i965: Always allow CPU readback of the scanout on LLC platformsChris Wilson2017-08-161-1/+15
| | | | | | | | | LLC platforms are magic in that reads from the CPU are always cache coherent, or rather GPU writes that bypass LLC do still invalidate the appropriate cache line. Cc: "17.2" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: make sure check_and_emit_atom gets inlinedTapani Pälli2017-08-161-1/+1
| | | | | | | | | | | | | | Improves performance of 3DMark "Ice Storm Unlimited" benchmark by 1-2% on Apollolake (on Android-IA using clang 3.8.256229). Change is based on the performance profiling work and results by Aravindan Muthukumar and Yogesh Marathe. Signed-off-by: Tapani Pälli <[email protected]> Signed-off-by: Aravindan Muthukumar <[email protected]> Signed-off-by: Yogesh Marathe <[email protected]> Reviewed-by: Scott D Phillips <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: count uniform against storage when its bindlessTimothy Arceri2017-08-151-5/+13
| | | | | | | | | Gallium drivers use this code path so we need to account for bindless after all. Fixes: 365d34540f33 ("mesa: correctly calculate the storage offset for i915") Reviewed-by: Marek Olšák <[email protected]>