summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* anv: Add device-level helpers for searching for and uploading kernelsJason Ekstrand2018-07-023-79/+98
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* anv/pipeline: Stop optimizing for not having a cacheJason Ekstrand2018-07-021-34/+31
| | | | | | | | | | Before, we were only hashing the shader if we had a shader cache to cache things in. This means that if we ever get it wrong, we could end up trying to cache a shader with an undefined hash. Since not having a shader cache is an extremely uncommon case, let's optimize for code clarity and obvious correctness over avoiding a hash operation. Reviewed-by: Timothy Arceri <[email protected]>
* anv: Use a default pipeline cache if none is specifiedJason Ekstrand2018-07-025-18/+25
| | | | | | | | If a client is dumb enough to not specify a pipeline cache, give it a default. We have to create one anyway for blorp so we may as well let the client cache shaders in it. Reviewed-by: Timothy Arceri <[email protected]>
* anv: Be more careful about hashing pipeline layoutsJason Ekstrand2018-07-021-3/+38
| | | | | | | | | | | Previously, we just hashed the entire descriptor set layout verbatim. This meant that a bunch of extra stuff such as pointers and reference counts made its way into the cache. It also meant that we weren't properly hashing in the Y'CbCr conversion information information from bound immutable samplers. Cc: [email protected] Reviewed-by: Timothy Arceri <[email protected]>
* anv,intel: Enable nir_opt_large_constants for VulkanJason Ekstrand2018-07-023-0/+14
| | | | | | | | | | | | According to RenderDoc, this shaves 99.6% of the run time off of the ambient occlusion pass in Skyrim Special Edition when running under DXVK and shaves 92% off the runtime for a reasonably representative frame. When running the actual game, Skyrim goes from being a slide-show to a very stable and playable framerate on my SKL GT4e machine. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Add state setup support for shader constantsJason Ekstrand2018-07-023-19/+101
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Add support for shader constant data to the pipeline cacheJason Ekstrand2018-07-024-0/+50
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Add a large constants optimization passJason Ekstrand2018-07-024-0/+311
| | | | | | | | | | | | | | | | This pass searches for reasonably large local variables which can be statically proven to be constant and moves them into shader constant data. This is especially useful when large tables are baked into the shader source code because they can be moved into a UBO by the driver to reduce register pressure and make indirect access cheaper. v2 (Jason Ekstrand): - Use a size/align function to ensure we get the right alignments - Use the newly added deref offset helpers Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Add a concept of constant data associated with a shaderJason Ekstrand2018-07-025-0/+30
| | | | | | | | | | | | | | | | | | | This commit adds a concept to NIR of having a blob of constant data associated with a shader. Instead of being a UBO or uniform that can be manipulated by the client, this constant data considered part of the shader and remains constant across all invocations of the given shader until the end of time. To access this constant data from the shader, we add a new load_constant intrinsic. The intention is that drivers will eventually lower load_constant intrinsics to load_ubo, load_uniform, or something similar. Constant data will be used by the optimization pass in the next commit but this concept may also be useful for OpenCL. v2 (Jason Ekstrand): - Rename num_constants to constant_data_size (anholt) Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir/deref: Add helpers for getting offsetsJason Ekstrand2018-07-022-0/+95
| | | | | | | | | | | | | These are very similar to the related function in nir_lower_io except that they don't handle per-vertex or packed things (that could be added, in theory) and they take a more detailed size/align function pointer. One day, we should consider switching nir_lower_io over to using the more detailed size/align functions and then we could make it use these helpers instead of having its own. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir/types: Add a natural size and alignment helperJason Ekstrand2018-07-022-0/+62
| | | | | | | | | | The size and alignment are "natural" in the sense that everything is aligned to a scalar. This is a bit tighter than std430 where vec3s are required to be aligned to a vec4. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir: Add a deref_instr_has_indirect helperJason Ekstrand2018-07-022-0/+20
| | | | | | Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* util/macros: Import ALIGN_POT from ralloc.cJason Ekstrand2018-07-024-10/+8
| | | | | | | | | | | v2 (Jason Ekstrand): - Rename y to pot_align (Brian) - Also use ALIGN_POT in build_id.c and slab.c (Brian) Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* v3d: Claim PIPE_CAP_TGSI_CAN_READ_OUTPUTS.Eric Anholt2018-07-021-0/+1
| | | | | | Fixes warning at screen creation. We store our outputs in normal temps and just emit them to shader I/O at the end, due to our I/O ordering requirements, so reading "outputs" in NIR is fine.
* ac: move all LLVM module initialization into ac_create_moduleMarek Olšák2018-07-026-27/+17
| | | | | | This removes some ugly code around module initialization. Reviewed-by: Dave Airlie <[email protected]>
* v3d: Emit a TF flush after each draw using TF.Eric Anholt2018-07-022-0/+9
| | | | | This fixes GPU hangs on 7278 in transform feedback tests such as GTF-GLES3.gtf.GL3Tests.transform_feedback2.transform_feedback2_basic
* nv50/ir: handle clipvertex for geom and tess shaders as wellKarol Herbst2018-07-021-1/+6
| | | | | | | | | this will be needed for compatibility profiles v2: handle tess shaders Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Karol Herbst <[email protected]>
* gallium/u_vbuf: drop min/max-scanning for empty indirect drawsErik Faye-Lund2018-07-021-0/+3
| | | | | | | | | | | | | | | | | | | When building with asserts enabled, we'll end up triggering an assert in pipe_buffer_map_range down this code-path, due to trying to map an empty range. Even if we avoid that, we'll trigger another assert a bit later, because u_vbuf_get_minmax_index returns a min-index of -1 here, which gets promoted to an unsigned value, and gives us an out-of-bounds buffer-mapping offset. Since we can't really have a well-defined min/max range here when the range is empty anyway, we should just drop this dance in the first place. After all, no rendering is going to be produced. This fixes a crash in dEQP-GLES31.functional.draw_indirect.random.0 on VirGL for me. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* radv: reset the image's predicate after a color decompression passSamuel Pitoiset2018-07-021-0/+5
| | | | | | | | | | | After performing a fast-clear eliminate, a FMASK decompress, or a DCC decompress, we can reset the predicate to FALSE. With that, the GPU should be able to skip unnecessary color decompression passes. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: enable/disable predication for the DCC decompression passSamuel Pitoiset2018-07-021-2/+2
| | | | | | | | Performing a DCC decompression pass is currently pretty rare, but using predication allows the GPU to skip unnecessary passes. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* radv: add padding for the UMR disassemblerSamuel Pitoiset2018-07-021-2/+18
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* virgl: Add support for glGetMultisampleGert Wollny2018-07-022-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use caps to obtain the multisample sample positions for up to 16 positions and implement the according Gallium interface. This implemenation (plus its counterpart in virglrenderer) assume that the fixed sample position are always the same for a given number of samples over the whole live time of a qemu session. It also assumes that sample series are only given for 2, 4, 8, and 16 samples, and for intermediate numbers N of samples the next higher supported set from above list is picked and the sample positions for the first N samples are returned accordingly. Fixes (when run on GL host): dEQP-GLES31.functional.texture.multisample.samples_1.sample_position dEQP-GLES31.functional.texture.multisample.samples_2.sample_position dEQP-GLES31.functional.texture.multisample.samples_3.sample_position dEQP-GLES31.functional.texture.multisample.samples_4.sample_position dEQP-GLES31.functional.texture.multisample.samples_8.sample_position dEQP-GLES31.functional.texture.multisample.samples_10.sample_position dEQP-GLES31.functional.texture.multisample.samples_12.sample_position dEQP-GLES31.functional.texture.multisample.samples_13.sample_position dEQP-GLES31.functional.texture.multisample.samples_16.sample_position v2: remove unrelated chunk (thanks Ilia Mirkin) v3: - also return positions for intermediate sample counts - fix unused varible warning - update description v4: explain better what this patch assumes and how it handles sample numbers that are not directly advertised (thanks go to Erik Faye-Lund for making me aware that this should be documented) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]>
* st/mesa: Also check for PIPE_FORMAT_A8R8G8B8_SRGB for texture_sRGBTomeu Vizoso2018-07-021-1/+3
| | | | | | | | | | | | | and PIPE_FORMAT_R8G8B8A8_SRGB, as well. The reason for this is that when Virgl runs with GLES on the host, it cannot directly upload textures in BGRA. So to avoid a conversion step, consider the RGB sRGB formats as well for this extension. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Fall back to R8G8B8A8_SRGB for ETC2Tomeu Vizoso2018-07-021-3/+12
| | | | | | | | | | | | | | | | | If the driver doesn't support PIPE_FORMAT_B8G8R8A8_SRGB, fall back to PIPE_FORMAT_R8G8B8A8_SRGB. Drivers such as Virgl will have a hard time supporting PIPE_FORMAT_B8G8R8A8_SRGB when the host runs GLES, as GL_BGRA isn't as well suported there. So go with PIPE_FORMAT_R8G8B8A8_SRGB so these drivers can avoid a conversion copy. v2: Fix typo in commit message Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* st/mesa/i965: Allow decompressing ETC2 to GL_RGBATomeu Vizoso2018-07-024-25/+40
| | | | | | | | | | | | | | | | | | | | | When Mesa itself implements ETC2 decompression, it currently decompresses to formats in the GL_BGRA component order. That can be problematic for drivers which cannot upload the texture data as GL_BGRA, such as Virgl when it's backed by GLES on the host. So this commit adds a flag to _mesa_unpack_etc2_format so callers can specify the optimal component order. In Gallium's case, it will be requested if the format isn't in PIPE_FORMAT_B8G8R8A8_SRGB format. For i965, it will remain GL_BGRA, as before. v2: * Remove unnecesary include (Emil Velikov) Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* anv/cmd_buffer: make descriptors dirty when emitting base state addressIago Toral Quiroga2018-07-021-0/+5
| | | | | | | | | | Every time we emit a new state base address we will need to re-emit our binding tables, since they might have been emitted with a different base state adress. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> CC: <[email protected]>
* anv/cmd_buffer: clean dirty push constants flag after emitting push constantsIago Toral Quiroga2018-07-021-0/+2
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> CC: <[email protected]>
* anv/cmd_buffer: never shrink the push constant buffer sizeIago Toral Quiroga2018-07-021-1/+16
| | | | | | | | | If we have to re-emit push constant data, we need to re-emit all of it. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> CC: <[email protected]>
* gallium/llvmpipe: Enable support bptc format.Denis Pauk2018-07-012-4/+2
| | | | | | | | | | | v2: none v3: none Signed-off-by: Denis Pauk <[email protected]> CC: Marek Olšák <[email protected]> CC: Rhys Perry <[email protected]> CC: Matt Turner <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium/softpipe: Enable support bptc format.Denis Pauk2018-07-011-2/+1
| | | | | | | | | | v2: none v3: none Signed-off-by: Denis Pauk <[email protected]> CC: Marek Olšák <[email protected]> CC: Rhys Perry <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* gallium/auxiliary: Add helper support for bptc format compress/decompressDenis Pauk2018-07-016-1/+408
| | | | | | | | | | | | | | Reuse code shared with mesa/main/texcompress_bptc. v2: Use block decompress function v3: Include static bptc code from texcompress_bptc_tmp.h Suggested-by: Marek Olšák <[email protected]> Signed-off-by: Denis Pauk <[email protected]> CC: Nicolai Hähnle <[email protected]> CC: Marek Olšák <[email protected]> CC: Gert Wollny <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add header for share bptc decompress functionsDenis Pauk2018-07-013-1434/+1761
| | | | | | | | | | | | | | | | | | | | | | Move shared bptc functions to texcompress_bptc_tmp.h: * fetch_rgba_unorm_from_block * fetch_rgb_float_from_block * compress_rgba_unorm * compress_rgb_float Create decompress functions: * decompress_rgba_unorm * decompress_rgb_float Functions will be reused in gallium/auxiliary code. v2: Add block decompress function v3: Move all shared code to header Suggested-by: Marek Olšák <[email protected]> Signed-off-by: Denis Pauk <[email protected]> CC: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* glsl/cache: save and restore ExternalSamplersUsedMarek Olšák2018-06-301-0/+2
| | | | | | | | Shaders that need special code for external samplers were broken if they were loaded from the cache. Cc: 18.1 <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* nir: fix selection of loop terminator when two or more have the same limitTimothy Arceri2018-06-302-4/+4
| | | | | | | | | | | | | | | | | We need to add loop terminators to the list in the order we come across them otherwise if two or more have the same exit condition we will select that last one rather than the first one even though its unreachable. This fix is for simple unrolls where we only have a single exit point. When unrolling these type of loops the unreachable terminators and their unreachable branch are removed prior to unrolling. Because of the logic change we also switch some list access in the complex unrolling logic to avoid breakage. Fixes: 6772a17acc8e ("nir: Add a loop analysis pass") Reviewed-by: Jason Ekstrand <[email protected]>
* radeonsi: enable OpenGL 4.4 compat profileTimothy Arceri2018-06-301-4/+3
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable ARB_vertex_attrib_64bit in compat profileTimothy Arceri2018-06-304-23/+24
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add outstanding ARB_vertex_attrib_64bit dlist supportTimothy Arceri2018-06-301-0/+178
| | | | Reviewed-by: Marek Olšák <[email protected]>
* vbo_save: add support for doubles to display list codeDave Airlie2018-06-304-12/+29
| | | | | | Required for ARB_vertex_attrib_64bit compat profile support. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add compat profile support for ARB_multi_draw_indirectTimothy Arceri2018-06-302-3/+76
| | | | | | v2: add missing ARB_base_instance support Reviewed-by: Marek Olšák <[email protected]>
* mesa: make valid_draw_indirect_multi() accessible externallyTimothy Arceri2018-06-302-12/+15
| | | | | | | We will use this to add compat support to ARB_multi_draw_indirect in the following patch. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_draw_indirect support to compat profileTimothy Arceri2018-06-303-4/+72
| | | | | | v2: add missing ARB_base_instance support Reviewed-by: Marek Olšák <[email protected]>
* mesa: generate GL_INVALID_OPERATION using draw indirect in dlistTimothy Arceri2018-06-301-0/+47
| | | | | | | | The spec doesn't explicitly say to generate an error but since DrawArraysInstanced* and DrawElementsInstanced* do, it makes sense to do it for these functions also. Reviewed-by: Marek Olšák <[email protected]>
* mesa: add missing display list support for ARB_compute_shaderTimothy Arceri2018-06-301-0/+39
| | | | | | | | | | | The extension is enabled for compat profile but there is currently no display list support. I filed a spec bug and it has been agreed that glDispatchComputeIndirect should generate an INVALID_OPERATION error when called during display list compilation. Reviewed-by: Marek Olšák <[email protected]>
* mesa: expose some ARB_viewport_array dependent extensions in compatTimothy Arceri2018-06-301-2/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable ARB_viewport_array in compat profileTimothy Arceri2018-06-303-17/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add ARB_viewport_array display list supportTimothy Arceri2018-06-301-0/+211
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable ARB_shader_subroutine in compat profileTimothy Arceri2018-06-303-19/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: add glUniformSubroutinesuiv() display list supportTimothy Arceri2018-06-301-0/+34
| | | | Reviewed-by: Marek Olšák <[email protected]>
* mesa: stop hiding remaining query parameters from OpenGL compatTimothy Arceri2018-06-301-5/+1
| | | | | | I managed to miss these two in my last pass at this. Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable ARB_gpu_shader_fp64 in compat profileTimothy Arceri2018-06-302-20/+20
| | | | Reviewed-by: Marek Olšák <[email protected]>