summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Port errors.c to util/list.h instead of simple_list.Kenneth Graunke2019-07-121-31/+18
| | | | | | | There is widespread consensus that simple_list should go away. This patch converts one more use to the modern kernel-style list. Reviewed-by: Kristian H. Kristensen <[email protected]>
* intel: Run the optimization loop before and after lowering int64Jason Ekstrand2019-07-131-1/+3
| | | | | | | | | | | | | | For bindless SSBO access, we have to do 64-bit address calculations. On ICL and above, we don't have 64-bit integer support so we have to lower the address calculations to 32-bit arithmetic. If we don't run the optimization loop before lowering, we won't fold any of the address chain calculations before lowering 64-bit arithmetic and they aren't really foldable afterwards. This cuts the size of the generated code in the compute shader in dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 by around 30%. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* panfrost/decode: Drop _replay prefixAlyssa Rosenzweig2019-07-124-72/+72
| | | | | | | We don't even support replay anymore; this is just wasting characters and adding clutter. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Drop _name suffixesAlyssa Rosenzweig2019-07-123-28/+28
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Add MEMORY_PROP_DIR variantAlyssa Rosenzweig2019-07-121-4/+12
| | | | | | | This allows dumping memory properties directly without dereferencing an address, allowing us to fix more -Waddress-of-packed-member warnings. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Copy embedded structs before usingAlyssa Rosenzweig2019-07-121-4/+8
| | | | | | Fixes some, but not all, warnings from -Waddress-of-packed-member Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/decode: Remove pandecode_decode_fbd_typeAlyssa Rosenzweig2019-07-121-8/+0
| | | | | | It is unused. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Use generic outmod typeAlyssa Rosenzweig2019-07-121-1/+1
| | | | | | | It could be midgard_outmod_float or midgard_outmod_int; don't assume it's one or the other. Fixes -Wenum-conversion warnings. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Precompute scoreboard dependentsAlyssa Rosenzweig2019-07-121-4/+54
| | | | | | | | | | Mali job dependency graphs, at least for GLES3.0, have the special property that a given node will only have at most a single dependent. This allows us to efficiently precompute the dependent array and replace an inner loop's O(N) search with an O(1) lookup, bringing the algorithmic complexity of scoreboarding from O(N^2) to O(N). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove transient pool abstractionAlyssa Rosenzweig2019-07-122-54/+0
| | | | | | | Now that it has been totally replaced by the borrow mechanism, it is now unused code. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Subdivide fixed-size transient slabsAlyssa Rosenzweig2019-07-123-5/+21
| | | | | | | The whole purpose of the transient memory model is to make subdivision stupidly easy, so let's handle that. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Recycle fixed-size transient BOsAlyssa Rosenzweig2019-07-122-3/+26
| | | | | | The usual case. We use the bitset to mark freedom and seize it. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Bookkeep transient indicesAlyssa Rosenzweig2019-07-123-2/+16
| | | | | | | The batch now temporarily possesses the transient buffer, so it'll need to remember that to free it later. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Rewrite allocate_transient with new abstractionAlyssa Rosenzweig2019-07-121-29/+20
| | | | | | | | | We use a fixed size slab if we can, otherwise we create a dedicated ("oversized") BO and add that to the job. In the latter case we'll get reference counting for free so we can forget about this corner case for the rest of the series. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add pan_bo_for_screen helperAlyssa Rosenzweig2019-07-121-0/+10
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add panfrost_transient_bo arrayAlyssa Rosenzweig2019-07-123-0/+47
| | | | | | | We would like transient allocations to occur on the screen (borrowed by the batch) rather than on the context. Add fields to track this. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't upload vertex/tiler twiceAlyssa Rosenzweig2019-07-121-5/+15
| | | | | | | | The latter upload is correct, but the former upload is unassociated with any particular FBO and therefore becomes orphaned. We do have to upload at draw-time at the latest, if we haven't by then. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/drm: Check allocation size is positiveAlyssa Rosenzweig2019-07-121-0/+4
| | | | | | | Zero-sized allocations will fail with an unhelpful errno from the kernel; check size explicitly in userspace before it gets that far. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* mesa/glspirv: Validate that compute shaders are not linked with other stagesNeil Roberts2019-07-121-0/+10
| | | | | | | | | | The test is based on link_shaders(). For example, it allows the following test (when run on SPIR-V mode) to pass: spec/arb_compute_shader/linker/mix_compute_and_non_compute.shader_test Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/glspirv: Validate that there is a VS when there is a TCS, TES or GSNeil Roberts2019-07-121-0/+25
| | | | | | | | | | | | | The shader combination tests are copied from link_shaders(). For example, it allows the following tests (when run on SPIR-V mode) to pass: spec/arb_tessellation_shader/linker/no-vs spec/arb_tessellation_shader/linker/tcs-no-vs spec/arb_tessellation_shader/linker/tes-no-vs spec/glsl-1.50/linker/gs-without-vs Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* i965: don't use disk cache with SPIR-V shadersAlejandro Piñeiro2019-07-121-2/+16
| | | | | | | | Right now we don't support disk cache for SPIR-V shaders (from ARB_gl_spirv), so let's avoid writing the program data to or reading it from the disk if any in-use shaders use SPIR-V. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* glsl/shader_cache: handle SPIR-V shadersAlejandro Piñeiro2019-07-121-5/+5
| | | | | | | | | Right now we don't have cache support for SPIR-V shaders (from ARB_gl_spirv). Right now they are properly skipped because they fall on the ff shader code path (no key, no name), but it would be better to update current comments, and add some guards. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/linker: Initialize UniformDataDefaults when using SPIR-VArcady Goldmints-Orlov2019-07-122-0/+7
| | | | | | | | | | | | | Allocate UniformDataDefaults and fill in the data defaults when linking a SPIR-V program. Among other things, this allows program serialization to work. It allows the following piglit test (when run on SPIR-V mode) to pass: spec/arb_get_program_binary/execution/uniform-after-restore.shader_test v2: use memcpy to initialize UniformDataDefaults Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* glsl/serialize: Update write_program_resource_data() to handle NULL input ↵Arcady Goldmints-Orlov2019-07-121-1/+5
| | | | | | and output variable names Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* glsl/serialize: Handle NULL uniform name in write_uniforms()Arcady Goldmints-Orlov2019-07-121-1/+5
| | | | Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/main: Fix UBO/SSBO ACTIVE_VARIABLES query (ARB_gl_spirv)Antia Puentes2019-07-123-15/+149
| | | | | | | | | | | | | | | | | | | | | | | | | When querying MAX_NUM_ACTIVE_VARIABLES, NUM_ACTIVE_VARIABLES and ACTIVE_VARIABLES over SSBO and UBO interfaces, we filter the variables which are active using the variable's name and looking for it in the program resource list. If it is in the program resource list, the variable will be considered active. However due to ARB_gl_spirv where name reflection information is not mandatory, we can use the UBO/SSBO binding and variable offset to filter which variables which are active. v2: use RESOURCE_UBO/UNI macros instead of direct castings, update comment (Alejandro) v3: Change signature of _mesa_program_resource_find_active_variable to simplify calling it. Also, squash the fix for find_binding_offset for arrays of blocks (Arcady) Signed-off-by: Antia Puentes <[email protected]> Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/shader_query: Fix LOCATION_INDEX query (ARB_gl_spirv)Antia Puentes2019-07-121-12/+17
| | | | | | | | | When querying GL_LOCATION_INDEX using glGetProgramResourceiv we already know the index of the resource, we do not need to find it using the name, which is convenient for shaders coming from SPIR-V binaries where names are optional. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/shaderapi: Fix TRANSFORM_FEEDBACK_VARYING program queryAntia Puentes2019-07-121-5/+34
| | | | | | | | | | | | | | | | | | | Fixes the program queries API (glGetProgramiv): TRANSFORM_FEEDBACK_VARYINGS and TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH in two cases: 1. ARB_enhaced_layouts: The queries were not working for GLSL shaders which specify the varyings using enhanced layouts. We were returning the info as if the varyings could only be specified using the API. 2. ARB_gl_spirv: TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH should return 1 if there is no name reflection information available. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/uniforms: Fix GetUniformLocation (ARB_gl_spirv)Antia Puentes2019-07-121-1/+1
| | | | | | | From the ARB_gl_spirv specification, glGetUniformLocation should return -1 when no name reflection is available. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa/shader_query: Fix NAME_LENGTH queries (ARB_gl_spirv)Antia Puentes2019-07-121-2/+14
| | | | | | | | | | | | | | | For shaders constructed from SPIR-V binaries, it is possible that no name reflection information is available. In that case, - glGetProgramInterfaceiv(.., pname=MAX_NAME_LENGTH, ..) - gletProgramResourceiv(.., props=NAME_LENGTH, ..) should return 1. Signed-off-by: Antia Puentes <[email protected]> Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* mesa: Fix ACTIVE_*_MAX_LENGTH program queries (ARB_gl_spirv)Alejandro Piñeiro2019-07-122-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since ARB_gl_spirv it is possible to miss a lot of name reflection information, so it is needed to add NULL name checks for several queries, and return a specific value on those cases. This commit add them for ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, ACTIVE_ATTRIBUTE_MAX_LENGTH and ACTIVE_UNIFORM_MAX_LENGTH. From ARB_gl_spirv spec: "If pname is ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH, the length of the longest active uniform block name, including the null terminator, is returned. If no active uniform blocks exist, zero is returned. If no name reflection information is available, one is returned. If pname is ACTIVE_ATTRIBUTE_MAX_LENGTH, the length of the longest active attribute name, including a null terminator, is returned. If no active attributes exist, zero is returned. If no name reflection information is available, one is returned. If pname is ACTIVE_UNIFORM_MAX_LENGTH, the length of the longest active uniform name, including a null terminator, is returned. If no active uniforms exist, zero is returned. If no name reflection information is available, one is returned." Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/types: Add glsl_type_is_unsized_array helperAntia Puentes2019-07-122-0/+7
| | | | Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/linker: Fill TOP_LEVEL_ARRAY_SIZE and STRIDEAntia Puentes2019-07-121-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | From the ARB_program_interface_query specification: "For the property TOP_LEVEL_ARRAY_SIZE, a single integer identifying the number of active array elements of the top-level shader storage block member containing to the active variable is written to <params>. If the top-level block member is not declared as an array, the value one is written to <params>. If the top-level block member is an array with no declared size, the value zero is written to <params>." "For the property TOP_LEVEL_ARRAY_STRIDE, a single integer identifying the stride between array elements of the top-level shader storage block member containing the active variable is written to <params>. For top-level block members declared as arrays, the value written is the difference, in basic machine units, between the offsets of the active variable for consecutive elements in the top-level array. For top-level block members not declared as an array, zero is written to <params>." v2: move top_level_array_size and stride into nir_link_uniforms_state Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/linker: Compute the offset for non-trivial uniform types.Antia Puentes2019-07-121-10/+23
| | | | | | | | | | | | | | | | | | | | ARB_gl_spirv points that the offset must be explicit, however this is true for 'root' types. For complex types, like struct members or arrays of arraya, it needs to be computed. We are not using the offset stored in the gl_buffer_variables during the uniform blocks linking because currently we do not have a way to relate a gl_buffer_variable with its corresponding gl_uniform_storage. The GLSL path uses the name for that, but we can not rely on that because names are optional in SPIR-V. Notice that uniforms non-backed by a buffer object will have an offset equal to -1, like in the GLSL path. v2: add offset and var_is_in_block as per-variable state in nir_link_uniforms_state (Arcady) Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/linker: Add atomic counters to the program resource listAntia Puentes2019-07-121-0/+7
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* nir/linker: Add XFB resources to the program resource listAntia Puentes2019-07-121-0/+27
| | | | Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/linker: Add BUFFER_VARIABLEs to the prog resource listAntia Puentes2019-07-121-1/+31
| | | | | | | v2: use link_util_should_add_buffer_variable() (Arcady) Signed-off-by: Arcady Goldmints-Orlov <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* nir/linker: Add inputs/outputs to the program resource listAntia Puentes2019-07-121-0/+108
| | | | | | | | | v2: added TODO comment hinting possible future refactoring of nir_build_program_resource_list and build_program_resource_list, to avoid code duplication (Alejandro, to explicitly reflect a valid concern from Timothy during the review). Reviewed-by: Timothy Arceri <[email protected]>
* nir/linker: add ubo/ssbo to the program resource listAlejandro Piñeiro2019-07-121-0/+14
| | | | | | | | v2: "nir/linker: Use the stageref when adding UBO/SSBO resources" squashed on this one (Timothy) Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* nir/linker: Fill the uniform's BLOCK_INDEXAntia Puentes2019-07-121-1/+22
| | | | | | | | | | | Binding comparison is used to determine the block the uniform is part of. Note that to do the binding comparison we need the information in UniformBlocks[] and ShaderStorageBlocks[] to be available, so we have to call gl_nir_link_uniform_blocks() before linking the uniforms. v2: add missing break (Timothy) Reviewed-by: Timothy Arceri <[email protected]>
* radv/gfx10: enable 1D texturesSamuel Pitoiset2019-07-123-11/+13
| | | | | | | Mirror RadeonSI. This also fixes crashes in addrlib. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* intel/compiler: remove abandoned commentsAndres Gomez2019-07-121-3/+0
| | | | | | | | | c8665005: ("intel/compiler: Don't always require precise lowering of flrp") forgot to remove some comments that didn't apply any more after the change. Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* nir/compiler: keep same bit size when lowering with flrpAndres Gomez2019-07-121-2/+2
| | | | | | | | | | | | | | | | This was probably not caught before because no supported test was exercising the flrp lowering with other bit size different than 32. With the arrival of VK_KHR_shader_float_controls we will have some of those and, unless we keep the bit size, we will end with something like: ../src/compiler/nir/nir_builder.h:420: nir_builder_alu_instr_finish_and_insert: Assertion `src_bit_size == bit_size' failed. Fixes: 158370ed2a0 ("nir/flrp: Add new lowering pass for flrp instructions") Fixes: ae02622d8fd ("nir/flrp: Lower flrp(a, b, c) differently if another flrp(_, b, c) exists") Signed-off-by: Andres Gomez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Properly compute image usage in CreateImageViewJason Ekstrand2019-07-121-2/+9
| | | | | | | | With separate stencil usage, we can't just grab the usage from the image directly and have to consider the per-aspect usage instead. Fixes: 1be38f9178 "anv:Use VK_EXT_separate_stencil_usage to avoid..." Reviewed-by: Lionel Landwerlin <[email protected]>
* radv/gfx10: emit DISABLE_CONSERVATIVE_ZPASS_COUNTSSamuel Pitoiset2019-07-121-0/+2
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/gfx10: init more registers in the graphics preambleSamuel Pitoiset2019-07-121-0/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/gfx10: set HS/GS/CS.WGP_MODESamuel Pitoiset2019-07-121-4/+8
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/gfx10: emit GE_PC_ALLOCSamuel Pitoiset2019-07-121-0/+17
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/gfx10: enable vertex shaders without export parametersSamuel Pitoiset2019-07-121-3/+15
| | | | | | | GFX10 allows this. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/gfx10: launch 2 compute waves per CU before going onto the next CUSamuel Pitoiset2019-07-121-4/+9
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>