summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* i965/nir: Inline remap_inputs_with_vue_mapJason Ekstrand2017-05-091-27/+22
| | | | | Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Use NIR remapping for VS attributesJason Ekstrand2017-05-096-121/+34
| | | | | | | | | | | | | The NIR pass already handles remapping system values to attributes for us so we delete the system value code as part of the conversion. We also change nir_lower_vs_inputs to take an explicit inputs_read bitmask and pass in the inputs_read from prog_data instead from pulling it out of NIR. This is because the version in prog_data may get EDGEFLAG added to it on some old platforms. Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/compiler/vs: Move inputs_read handling to generic codeJason Ekstrand2017-05-093-5/+3
| | | | | Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vec4: Set VERT_BIT_EDGEFLAG based on the VUE mapJason Ekstrand2017-05-092-4/+11
| | | | | | | We also add a nice little comment to make it more clear exactly what happens with the edge flag copy. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Lower gl_VertexID and friends to inputs at the NIR levelJason Ekstrand2017-05-094-70/+74
| | | | | | | | | NIR calls these system values but they come in from the VF unit as vertex data. It's terribly convenient to just be able to treat them as such in the back-end. Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/vs: Set uses_vertexid and friends from brw_compile_vsJason Ekstrand2017-05-093-11/+17
| | | | | Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965: Move multiply by 4 for VS ATTR setup into the scalar backend.Jason Ekstrand2017-05-092-2/+2
| | | | | | | | | | The vec4 backend will want to count in units of vec4s, not scalar components. The simplest solution is to move the multiplication by 4 into the scalar backend. This also improves consistency with how we count varyings. Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965/nir: Inline remap_vs_attrsJason Ekstrand2017-05-091-30/+26
| | | | | | | | | | Now that we have nice block iterators, there's no good reason for this to be off on it's own. While we're here, we convert to using the NIR const index getters/setters instead of whacking const_index values directly. Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Embed the shader_info in the nir_shader againJason Ekstrand2017-05-0956-421/+410
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e1af20f18a86f52a9640faf2d4ff8a71b0a4fa9b changed the shader_info from being embedded into being just a pointer. The idea was that sharing the shader_info between NIR and GLSL would be easier if it were a pointer pointing to the same shader_info struct. This, however, has caused a few problems: 1) There are many things which generate NIR without GLSL. This means we have to support both NIR shaders which come from GLSL and ones that don't and need to have an info elsewhere. 2) The solution to (1) raises all sorts of ownership issues which have to be resolved with ralloc_parent checks. 3) Ever since 00620782c92100d77c660f9783504c6d80fa1d58, we've been using nir_gather_info to fill out the final shader_info. Thanks to cloning and the above ownership issues, the nir_shader::info may not point back to the gl_shader anymore and so we have to do a copy of the shader_info from NIR back to GLSL anyway. All of these issues go away if we just embed the shader_info in the nir_shader. There's a little downside of having to copy it back after calling nir_gather_info but, as explained above, we have to do that anyway. Acked-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Make _mesa_primitive_restart_index a static inline in the header.Kenneth Graunke2017-05-092-20/+15
| | | | | | | | | | It's now basically a single expression, so it probably makes sense to have it inlined into the callers. Suggested by Marek. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* freedreno: fix clang error in fd_get_compute_paramRob Herring2017-05-091-1/+1
| | | | | | | | | | | | With commit 10c17f23b752 ("freedreno: core compute state support"), Android builds fail with the following error: external/mesa3d/src/gallium/drivers/freedreno/freedreno_screen.c:610:17: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] sprintf(ret, ir); ^~ Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Rob Clark <[email protected]>
* mesa/vbo: fix invalid min/max indexesRob Clark2017-05-091-6/+16
| | | | | | | Fixes: c3f37e9b ("st/mesa: use min_index and max_index directly from vbo") Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* intel: compiler: prevent integer overflowLionel Landwerlin2017-05-091-2/+2
| | | | | | | CID: 1399477, 1399478 (Integer handling issues) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: compiler: remove duplicated codeLionel Landwerlin2017-05-091-12/+0
| | | | | | | CID: 1399470: (Control flow issues) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel: gen decoder: don't check for size_t negative valuesLionel Landwerlin2017-05-091-1/+1
| | | | | | | | | We should get either 0 or 1 here. CID: 1373562 (Control flow issues) Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Matt Turner <[email protected]>
* android: i965: add per-gen libmesa_i965_gen{4,45,5} staticMauro Rossi2017-05-091-0/+66
| | | | | | | | | | | | | Needed to fix android building errors: external/mesa/src/mesa/drivers/dri/i965/brw_state_upload.c:148: error: undefined reference to 'gen5_init_atoms' external/mesa/src/mesa/drivers/dri/i965/brw_state_upload.c:150: error: undefined reference to 'gen45_init_atoms' external/mesa/src/mesa/drivers/dri/i965/brw_state_upload.c:152: error: undefined reference to 'gen4_init_atoms' clang++: error: linker command failed with exit code 1 (use -v to see invocation) Fixes: 5a19d0b ("i965: Get real per-gen atom lists") Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* swr: fix polygonmode for front==backGeorge Kyriazis2017-05-082-1/+27
| | | | | | | | | | | | | | | | | | | | Rasterizer core only supports polygonmode front==back. Add logic for populating fillMode for the rasterizer only for that case correctly. Provide enum conversion between mesa enums and core enums. The core renders lines/points as tris. Previously, code would enable stipple for polygonmode != FILL. Modify stipple enable logic so that this works correctly. No regressions in vtk tests. Fixes the following piglit tests: pointsprite gl-1.0-edgeflag-const v2: remove cc stable, and remove "not implemented" assert v3: modified commit message Reviewed-by: Bruce Cherniak <[email protected]>
* swr/rast: support polygonmode pointGeorge Kyriazis2017-05-081-52/+116
| | | | | | | | | | | | | | | Add support for polygonmode point in the binner. This is done by splitting BinPostSetupPoints from BinPoints, so the earlier call can be called from BinTriangles. Setup has already been done at the time BinPostSetupPoints needs to be called. This checkin just adds support in the rasterizer. A separate checkin will add the appropriate driver support. v2: remove cc stable v3: modified commit message and subject line Reviewed-by: Bruce Cherniak <[email protected]>
* util: move ALWAYS_INLINE macro to util/macro.hTimothy Arceri2017-05-092-11/+11
| | | | | | | | Also added clang check. macro.h is include by p_compiler.h so no other change is needed. Reviewed-by: Nicolai Hähnle <[email protected]>
* swr: move msaa resolve to generalized StoreTileBruce Cherniak2017-05-083-80/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | v3: list piglit tests fixed by this patch. Fixed typo Tim pointed out. v2: Reword commit message to more closely adhere to community guidelines. This patch moves msaa resolve down into core/StoreTiles where the surface format conversion routines are available. The previous "experimental" resolve was limited to 8-bit unsigned render targets. This fixes a number of piglit msaa tests by adding resolve support for all the render target formats we support. Specifically: layered-rendering/gl-layer-render: fail->pass layered-rendering/gl-layer-render-storage: fail->pass multisample-formats *[2,4,8,16] gl_arb_texture_rg: crash->pass multisample-formats *[2,4,8,16] gl_ext_texture_snorm: crash->pass multisample-formats *[2,4,8,16] gl_arb_texture_float: fail->pass multisample-formats *[2,4,8,16] gl_arb_texture_rg-float: fail->pass MSAA is still disabled by default, but can be enabled with "export SWR_MSAA_MAX_COUNT=4" (1,2,4,8,16 are options) The default is 0, which is disabled. This patch improves the number of multisample-formats supported by swr, and fixes several crashes currently in the 17.1 branch. Therefore, it should be considered for inclusion in the 17.1 stable release. Being disabled by default, it poses no risk to most users of swr. Reviewed-by: Tim Rowley <[email protected]> cc: [email protected]
* glsl: Don't allow redefining builtin functions on GLSL 1.00.Eric Anholt2017-05-081-2/+13
| | | | | | | | | | The spec text cited above says you can't, but only the GLSL 3.00 (redefine or overload) case was implemented. Fixes dEQP scoping.invalid.redefine_builtin_fragment/vertex. Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Matt Turner <[email protected]>
* glsl: Restrict func redeclarations (not just redefinitions) on GLSL 1.00.Eric Anholt2017-05-081-0/+10
| | | | | | | | | Fixes DEQP's scoping.invalid.redeclare_function_fragment/vertex. v2: Fix accidental rejection of prototype+decl. Reviewed-by: Samuel Pitoiset <[email protected]> (v1) Tested-by: Matt Turner <[email protected]>
* glsl: Ban #undefining __LINE__ and friends on GLES2.Eric Anholt2017-05-081-5/+2
| | | | | | | Fixes deqp_gles2 undefine_invalid_object_* failures. Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Matt Turner <[email protected]>
* glsl: Restrict functions to not return arrays or SOAs in GLSL 1.00.Eric Anholt2017-05-083-0/+31
| | | | | | | | | | | | | | | From the spec, Arrays are allowed as arguments, but not as the return type. [...] The return type can also be a structure if the structure does not contain an array. Fixes DEQP shaders.functions.invalid.return_array_in_struct_fragment. v2: Spec cite wording change Reviewed-by: Samuel Pitoiset <[email protected]> Tested-by: Matt Turner <[email protected]>
* nir: fix (hopefully) windows buildRob Clark2017-05-082-4/+4
| | | | | Fixes: 53aa109b ("nir: add pass to lower atomic counters to SSBO") Signed-off-by: Rob Clark <[email protected]>
* radeonsi: rename si_eliminate_const_vs_outputs -> si_optimize_vs_outputsMarek Olšák2017-05-081-2/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* ac: fix broken elimination of duplicated VS exportsMarek Olšák2017-05-081-14/+14
| | | | | | | | | | | | | | The renumbering code didn't take into account that multiple VS exports can have the same PARAM index. This also significantly simplifies the renumbering. Thankfully, we have piglits for this: spec@arb_gpu_shader5@arb_gpu_shader5-interpolateatcentroid-packing [email protected]@execution@interface-blocks-complex-vs-fs Reported by Michel Dänzer. Fixes: b08715499e61 ("ac: eliminate duplicated VS exports") Reviewed-by: Nicolai Hähnle <[email protected]>
* egl: Fix -Wint-to-pointer-castChad Versace2017-05-081-1/+1
| | | | | | | | | | | | | main/egldisplay.c: In function '_eglParseX11DisplayAttribList': main/egldisplay.c:491:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] display->Options.Platform = (void *)value; The fix: cast to uinptr_t before void*. ^ Fixes: ddb99127 egl/x11: Honor the EGL_PLATFORM_X11_SCREEN_EXT attribute Cc: Adam Jackson <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* st/mesa: remove unused st parameter in init_velement_loweredMarek Olšák2017-05-081-4/+3
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: use PIPE_MAX_ATTRIBS as the max number of vertex buffersMarek Olšák2017-05-081-1/+1
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify code due to unification to st_common_programMarek Olšák2017-05-084-99/+35
| | | | | | | | v2: use the st_common_program() helper Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: simplify update_constants functionsMarek Olšák2017-05-084-38/+17
| | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: unify TCS, TES, GS st_*_program structuresMarek Olšák2017-05-0810-160/+94
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: decrease the size of remaining st_translate_program array paramsMarek Olšák2017-05-087-11/+11
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove unused outputSlotToAttrMarek Olšák2017-05-083-11/+0
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove st_context::vertex_result_to_slotMarek Olšák2017-05-084-8/+4
| | | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: decrease the size of st_vertex_programMarek Olšák2017-05-0810-36/+36
| | | | | Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: remove struct st_tracked_stateMarek Olšák2017-05-0822-398/+118
| | | | | | | | | It contains only one member: the update function. Let's use the update function directly. Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: split per-patch from per-vertex indicesNicolai Hähnle2017-05-083-21/+42
| | | | | | | Make it a bit clearer that the index spaces are logically seperate by having them defined in different functions. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: clarify documentation of existing SI workaroundNicolai Hähnle2017-05-081-1/+3
| | | | | | | Limiting LS-HS to a single wave is required on all SI chips due to an issue with a power management feature. Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: fix gl_PrimitiveID in tessellation with instanced draws on SINicolai Hähnle2017-05-081-0/+14
| | | | | Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: load patch_id for TES-as-ES when exporting for PSNicolai Hähnle2017-05-081-2/+2
| | | | | | | For some reason, this change is only necessary on SI. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: fix primitive ID in fragment shader when using tessellationNicolai Hähnle2017-05-081-10/+17
| | | | | | | | | | | In a VS->TCS->TES->PS pipeline, the primitive ID is read from TES exports, so it is as if TES were using the primitive ID. Specifically, this fixes a bug where the primitive ID is not reset at the start of a new instance. Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* radeonsi: mark fast-cleared textures as compressed when dirtyingNicolai Hähnle2017-05-081-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | There are a bunch of piglit fast clear tests that regressed on SI, for example ./bin/ext_framebuffer_multisample-fast-clear single-sample. The problem is that a texture is bound as a framebuffer, cleared, and then rendered from in a loop that loops through different clear colors. The texture is never rebound during all this, so the change to tex->dirty_level_mask during fast clear was not taken into account when checking for compressed textures. I have considered simply reverting the problematic commit. However, I think this solution is better. It does require looping through all bound textures after a fast clear, but the alternative would require visiting more textures needless on every draw. Draws are much more common than clears. Note that the rendering feedback loop rules do not apply here, because the framebuffer binding is changed between the glClear and the draw that samples from the texture that was cleared. Fixes: bdd644976952 ("radeonsi: don't mark non-dirty textures with CMASK as compressed") Cc: 17.1 <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* egl: use designated initializersEmil Velikov2017-05-081-8/+7
| | | | | | | | All the compilers used to build Mesa support them. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: drop unneeded sentinel from level_strings[]Emil Velikov2017-05-081-2/+2
| | | | | | | | | | The array is local so we already know its size. v2: Correct loop condition (Bartosz) Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: remove suprous header eglcompiler.hEmil Velikov2017-05-087-52/+4
| | | | | | | | | The header is used only to provide STATIC_ASSERT. The latter is already available in utils/macros.h so use that instead and kill of the header. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: remove unneeded else statement in _eglInitLoggerEmil Velikov2017-05-081-3/+0
| | | | | | | | | The variable level is already initialized to -1 which is already interpreted as FALLBACK_LOG_LEVEL. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: remove no longer needed logger infraEmil Velikov2017-05-082-49/+6
| | | | | | | | | | As of last commit nobody requires anything else but the _eglDefaultLogger(). As such use it directly and simplify the implementation. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* egl: fold Android logger into main/Emil Velikov2017-05-083-35/+36
| | | | | | | | Will allow us to greatly simplify a lot of the code in egllog.c Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Chad Versace <[email protected]>