aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* glsl: Add structures to track accessed elements of a single arrayIan Romanick2016-12-192-0/+56
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add tracking for elements of an array-of-arrays that have been accessedIan Romanick2016-12-194-1/+177
| | | | | | | | | | | If there's a better way to provide access to ir_array_refcount_entry private members to the test functions, I am very interested to know about it. Signed-off-by: Ian Romanick <[email protected]> Cc: Francisco Jerez <[email protected]> Cc: [email protected] Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Use simpler visitor to determine which UBO and SSBO blocks are usedIan Romanick2016-12-194-5/+171
| | | | | | | | | | | | | | | Very soon this visitor will get more complicated. The users of the existing ir_variable_refcount visitor won't need the coming functionality, and this use doesn't need much of the functionality of ir_variable_refcount. v2: ir_array_refcount_visitor::get_variable_entry cannot return NULL, so don't check it. Suggested by Timothy. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Track the linearized array index for each UBO instance array elementIan Romanick2016-12-192-4/+30
| | | | | | | | | | v2: Set linearizer_array_index in process_block_array_leaf. Suggested by Timothy. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix wonkey indentation left from previous commitIan Romanick2016-12-191-45/+44
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Split process_block_array into two functionsIan Romanick2016-12-191-6/+28
| | | | | | | | | | | | | | One for the array parts and one for the leaf members. This will simplify later changes. The indentation is wonkey after this patch. This was done to make it more obvious that the function is just getting split. The next patch will fix the indentation. Signed-off-by: Ian Romanick <[email protected]> Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Fix program interface queries relating to interface blocks.Kenneth Graunke2016-12-192-113/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes 555 dEQP tests (using the nougat-cts-dev branch), Piglit's arb_program_interface_query/arb_program_interface_query-resource-query, and GL45-CTS.program_interface_query.separate-programs-{tess-control, tess-eval,geometry}. Only one dEQP program interface failure remains. I would have liked to split this up into several distinct changes, but I wasn't sure how to do that given thet tangled nature of these issues. So, the issues: * We need to treat interface blocks declared as an array of instances as a single block - removing the outer array. The resource list entry's name should not include the array length. Properties such as GL_ARRAY_SIZE should refer to the variable inside the block, not the interface block's array properties. * We need to do this prefixing even for structure variables. * We need to do this for built-ins (such as gl_PerVertex.gl_Position). * After interface array unwrapping, any variable which is an array should have [0] appended. It doesn't matter if it's a TCS/TES/GS input or TCS output - that looked like an attempt to unwrap for per-vertex variables, but that didn't consider per-patch variables, and as far as I can tell there's nothing to justify this. Several Mesa developers have suggested that Issue 16 contradicts the main specification, but I believe that it doesn't - the main spec just isn't terribly clear. The main ARB_program_interface query spec says: "* For an active interface block not declared as an array of block instances, a single entry will be generated, using the block name from the shader source. * For an active interface block declared as an array of instances, separate entries will be generated for each active instance. The name of the instance is formed by concatenating the block name, the "[" character, an integer identifying the instance number, and the "]" character." Issue 16 says that built-ins should be named "gl_PerVertex.gl_Position", but several people suggested the second bullet above means that it should be named "gl_PerVertex[array length].gl_Position". There are two important things to note. Those bullet points say "an active interface block", while the others say "variable" or "active shader storage block member". They also don't mention applying the rules recursively (unlike the other bullets). Both suggest that these rules apply to blocks themselves, not members of blocks. In fact, for GL_UNIFORM_BLOCK queries, we do have "block[0]", "block[1]", ... resource list entries - so those rules are real, and actually used. So if they don't apply to block members, then how should members be named? Unfortunately, I don't see any rules outside of issue 16 - where the rationale is very unclear. I hope to clarify the spec in the future. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Drop bogus is_vertex_input from add_shader_variable().Kenneth Graunke2016-12-191-6/+1
| | | | | | | | | | | | stage_mask is a bitmask of shader stages, so the proper comparison would be (1 << MESA_SHADER_VERTEX), not MESA_SHADER_VERTEX itself. But we only care for structure types, and VS inputs cannot be structs. So we can just drop this entirely. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa/get: Convert stencil values to TYPE_UINT.Kenneth Graunke2016-12-191-6/+6
| | | | | | | | | | | | | | | These are listed as Z+ in the GL spec, and often have values of 0xFFFFFFFF. For glGetFloat, we should return 4294967295.0 rather than -1.0. Similarly, for glGetInteger64v, we should return 0xFFFFFFFF, not the sign extended 0xFFFFFFFFFFFFFFFF. Fixes 6 dEQP tests matching the pattern dEQP-GLES3.functional.state_query.integers.stencil*value*mask*getfloat when run in a single process (with state reset code happening between tests, which makes dEQP set the stencil value mask to 0xFFFFFFFF). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/get: Add TYPE_UINT for casting through a GLuint.Kenneth Graunke2016-12-191-0/+80
| | | | | | | | | | | | | | | | | The "State Tables" section of the OpenGL specification lists many values as belonging to Z+ (non-negative integers), not Z (all integers). For ordinary glGetInteger queries, this doesn't matter. However, when accessing Z+ values via glGetFloat or glGetInteger64, we need to treat the source value as an unsigned value. Otherwise, we'll produce a negative number when bit 31 is set. This commit merely adds the plumbing. It doesn't convert any values. v2: Gotta catch 'em all (add missing cases caught by Ilia) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/get: Make GetFloat/GetDouble of TYPE_INT_N not normalize things.Kenneth Graunke2016-12-191-3/+3
| | | | | | | | | | | | | | | | | GetFloat of integer valued things is supposed to perform a simple int -> float conversion. INT_TO_FLOAT is not that. Instead, it converts [-2147483648, 2147483647] to a normalized [-1.0, 1.0] float. This is only used for COMPRESSED_TEXTURE_FORMATS, which nobody in their right mind would try and access via glGetFloat(), but we may as well fix it. Found by inspection. v2: Gotta catch 'em all (fix another case of this caught by Ilia) Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* Revert "cso: don't release sampler states that are bound"Michel Dänzer2016-12-191-3/+1
| | | | | | | This reverts commit 6dc96de303290e8d1fc294da478c4f370be98dea. No longer necessary with the previous change. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Make sanitize_hash safe for samplersMichel Dänzer2016-12-191-1/+43
| | | | | | | | Remove currently bound sampler states from the hash table before pruning entries from the hash table, so they cannot accidentally be deleted by the pruning. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Store hash key in struct cso_samplerMichel Dänzer2016-12-192-0/+2
| | | | | | Preparation for following changes, no functional change intended. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Optimize cso_save/restore_fragment_samplersMichel Dänzer2016-12-191-4/+17
| | | | | | | | | Only copy/memset the pointers that actually need to be. v2: * Cast info->nr_samplers to int for calculating delta (Nicolai) Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Store pointers to struct cso_sampler in struct sampler_infoMichel Dänzer2016-12-191-15/+18
| | | | | | Preparation for following changes, no functional change intended. Reviewed-by: Nicolai Hähnle <[email protected]>
* cso: Don't restore nr_samplers in cso_restore_fragment_samplersMichel Dänzer2016-12-191-1/+0
| | | | | | | | | | If info->nr_samplers > ctx->nr_fragment_samplers_saved, the assignment would prevent cso_single_sampler_done from unbinding the no longer used samplers from the driver, which could result in use-after-free. This is probably unlikely to happen in practice though. Cc: "12.0 13.0" <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* EGL/android: Enhance pbuffer implementationLiu Zhiquan2016-12-191-81/+96
| | | | | | | | | | | | | | | Some dri drivers will pass multiple bits in buffer_mask parameter to droid_image_get_buffer(), more than the actual supported buffer type combination. For such case, will go through all the bits, and will not return error when unsupported buffer is requested, only return error when the allocation for supported buffer failed. v2: coding style and log changes v3: coding style changes and update patch format Signed-off-by: Liu Zhiquan <[email protected]> Signed-off-by: Long, Zhifang <[email protected]> Reviewed-by: Tomasz Figa <[email protected]>
* radv: Use correct workgroup size limits.Bas Nieuwenhuizen2016-12-181-4/+4
| | | | | | | Not sure where the 16k comes from, but pretty sure 2k is the max. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: expose the compute queueDave Airlie2016-12-181-11/+41
| | | | | | | v2: Don't expose the SDMA queue and use the CIK check also in the second if. (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Only emit PFP ME syncs for DMA on the GFX queue.Bas Nieuwenhuizen2016-12-181-2/+2
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Create an empty CS per ring type.Bas Nieuwenhuizen2016-12-182-7/+20
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Don't enable CMASK on compute queues.Bas Nieuwenhuizen2016-12-184-8/+62
| | | | | | | We can't fast clear on compute queues. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Use RELEASE_MEM packet for MEC timestamp query.Bas Nieuwenhuizen2016-12-182-9/+21
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Implement indirect dispatch for the MEC.Bas Nieuwenhuizen2016-12-181-9/+17
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: update vkCmdUpdateBuffer for the MEC.Bas Nieuwenhuizen2016-12-181-1/+3
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Implement cache flushing for the MEC.Bas Nieuwenhuizen2016-12-181-7/+29
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: add semaphore supportDave Airlie2016-12-183-11/+72
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: pass queue index into winsys submissionDave Airlie2016-12-183-5/+13
| | | | | | This is so we can submit on separate queues if needed Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: init compute queue and avoid initing transfer queuesDave Airlie2016-12-183-15/+35
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: Make WaitIdle queue aware.Bas Nieuwenhuizen2016-12-185-21/+38
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv/meta: update header infoDave Airlie2016-12-181-1/+2
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: hook compute clears into clear image api.Dave Airlie2016-12-181-8/+33
| | | | | | | | These aren't used yet but we will want to use them when we implement a separate compute queue. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: clear image implementation for compute queueDave Airlie2016-12-183-9/+272
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/meta: split clear image out into a separate layer clear functionDave Airlie2016-12-181-117/+128
| | | | | | This will make it easier to add support for clears on compute queues. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: implement image->image copies using compute shaderDave Airlie2016-12-184-6/+343
| | | | | | | | | | This is required for having a separate compute queue, we probably can't use this on GFX queue due to DCC. v2: Set coord_components = 2 for itoi texture fetch. (Bas) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add a compute shader implementation for buffer to imageDave Airlie2016-12-183-6/+325
| | | | | | | | | | | This implements the reverse of the current buffer->image path and can be used when we need to do image transfer on compute queues This just adds the code turned off as we don't support separate computes queues yet, and we don't want to use this path on the GFX queues for DCC reasons. Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: Use correct pitch for views with different block size.Bas Nieuwenhuizen2016-12-181-1/+4
| | | | | | | | | Needed when accessing a comrpessed texture as R32G32B32A32 from a shader. This was not encountered previously, as we used the CB for the reinterpretation, which does not use this pitch. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: Store queue family in command buffers.Dave Airlie2016-12-182-2/+35
| | | | | | v2: Added helper (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: start fixing up queue allocate for multiple queuesDave Airlie2016-12-182-15/+53
| | | | | | v2: Fix error handling and zero init the device (Bas) Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: start adding support for DMA/compute queueDave Airlie2016-12-181-5/+20
| | | | Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv/winsys: Expose number of compute/dma rings.Bas Nieuwenhuizen2016-12-182-2/+15
| | | | | Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* freedreno/a5xx: border color supportRob Clark2016-12-181-3/+160
| | | | | | | Not 100% sure it works if you have border color in VS.. but it might be right. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: use MRT0 to import linear zsRob Clark2016-12-181-5/+20
| | | | | | | | | | | A bit of a hack, but we need to do this until we can do tiled zs in sysmem (and associated tile/until blits for transfer_map). Fixes xonotic and glmark2 "refract", when reorder wasn't enabled. (reorder would paper over the issue by avoiding the extra round- trip to system memory and back to gmem. Signed-off-by: Rob Clark <[email protected]>
* freedreno: fdN_gmem_restore_format() is not gen specificRob Clark2016-12-188-50/+25
| | | | | | | | | | Refactor out into a common helper, since this is the same across generations when we need equiv z/s gmem restore format. Next patch needs this in a5xx, rather than creating yet another helper push this into core. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: cargo-cult end-batch sequence more faithfullyRob Clark2016-12-184-4/+39
| | | | | | | Fixes some issues at least with GMEM bypass mode, where we'd sometimes end up with some FS quads not hitting memory. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: misc fixRob Clark2016-12-181-1/+1
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: fix (at least some) vtx formatsRob Clark2016-12-181-1/+1
| | | | | | | | | Swap/component-order doesn't seem to be quite what that is. At least blob was always setting it to XYZW ('11') but we weren't. Causing problems w/ formats like sint16.. Hard-coding this instead at least seems to get glamor working. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: more formatsRob Clark2016-12-181-25/+25
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: fixup capsRob Clark2016-12-182-6/+11
| | | | | | | | | | Might not be 100% accurate, mostly just copy from a4xx to get started. We are defn lying about occlusion query at this point (not implemented yet) but need it to expose anything higher than gl1.4 (glamor needs gl2.1) Signed-off-by: Rob Clark <[email protected]>