aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_formats.c
Commit message (Collapse)AuthorAgeFilesLines
* gallium: change comments to remove 'state tracker'Marek Olšák2020-05-131-1/+1
| | | | | | | Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
* iris: handle the failure of converting unsupported yuv formats to islJames Xiong2020-02-061-1/+5
| | | | | | Signed-off-by: James Xiong <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3527>
* intel/isl: Move iris's pipe-to-isl format function to isl.Eric Anholt2020-02-051-300/+2
| | | | | | | | | | This will get reused in the shader compiler once we switch it over to pipe formats instead of GL enums. We can't easily deduplicate i965's mesa-to-isl mapping because of cases like A32_FLOAT that are mapped differently. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3355>
* iris: Disable ASTC 5x5 support on Gen9 for now.Kenneth Graunke2020-01-031-0/+8
| | | | | | | | | | | | | | | Intel Gen9 hardware has some nasty restrictions where ASTC 5x5 formats and color compression can't both live in the sampler cache at the same time. To properly support it, we have to track which of those exist in the cache and flush ASTC out or resolve away compression. As far as I'm aware, very little uses ASTC 5x5 textures, so instead of replicating all that for iris, we simply turn it off and rely on the Gallium fallback mechanism to fake it via uncompressed RGBA. This should avoid GPU hangs any time people use ASTC 5x5 with CCS. Reviewed-by: Tapani Pälli <[email protected]>
* iris: Map FXT1 texture formatsKenneth Graunke2019-12-011-0/+2
| | | | | | | | | This exposes GL_TDFX_texture_compression_FXT1 support. It's ancient, only Intel GPUs appear to support it, and I seriously doubt anybody uses it. But i965 supports it, and it's trivial to do, so we may as well support it in the new iris driver as well. Reviewed-by: Eric Anholt <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-141-1/+1
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* iris: Update comment about 3-component formats and buffer texturesKenneth Graunke2019-10-071-5/+7
| | | | | You can't render to PIPE_BUFFER so there's no reason to prefer RGBX. PBO upload would like to use proper RGB textures as source data.
* iris: Allow packed RGB pbo uploadsChris Wilson2019-10-071-2/+2
| | | | | | | | Hitting any fallback path on Broxton as we require clflushing the whole buffer even for an upload of a subtexture. However, since gallium provides a pbo upload path, allow it to sample packed RGB if supported. Reviewed-by: Kenneth Graunke <[email protected]>
* gallium: switch boolean -> bool at the interface definitionsIlia Mirkin2019-07-221-1/+1
| | | | | | | | | | | | | | | | | | This is a relatively minimal change to adjust all the gallium interfaces to use bool instead of boolean. I tried to avoid making unrelated changes inside of drivers to flip boolean -> bool to reduce the risk of regressions (the compiler will much more easily allow "dirty" values inside a char-based boolean than a C99 _Bool). This has been build-tested on amd64 with: Gallium drivers: nouveau r300 r600 radeonsi freedreno swrast etnaviv v3d vc4 i915 svga virgl swr panfrost iris lima kmsro Gallium st: mesa xa xvmc xvmc vdpau va Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* iris: Support storage images that have matching typed formats for readsKenneth Graunke2019-07-221-3/+2
| | | | | Even if we don't directly support typed reads on a format, we can often translate them to a reasonable matching format. Advertise those too.
* iris: Stop advertising MSAA storage images by mistakeKenneth Graunke2019-07-221-1/+1
| | | | | | | | | | | | | | | | | | st_extensions.c sets const->MaxImageSamples (GL_MAX_IMAGE_SAMPLES) by looping over [16, 15, .. 1x] MSAA modes, and RGBA/BGRA/ARGB/ABGR 8888 color formats, calling pipe->is_format_supported() for each, with the usage set to PIPE_BIND_SHADER_IMAGE. If any are supported, it selects that number of samples. We were checking if sample_count <= 1, which meant that we were getting a value of 1x MSAA, rather than the expected 0x (feature doesn't exist). But, only on Icelake because Gen11 adds support for typed read messages for R8G8B8A8_UNORM. The lack of typed read messages for these formats was tricking the check on Gen9 to say no correctly. This caused some Icelake conformance failures, because we don't implement this feature. Just check for sample_count == 0 instead.
* iris: Minor tidyingKenneth Graunke2019-07-031-35/+3
|
* iris: Support more RGBX pipe formats.Kenneth Graunke2019-06-171-2/+13
| | | | | | | | Without them, the state tracker falls back to an RGBA format, but it doesn't always manage to override the swizzle for us. So we lose the information that the API expects an X channel, where alpha is garbage and reads back as 1. We have no equivalent ISL RGBX format for these, so we just use RGBA directly and override the swizzle in all cases.
* iris: Fix imageBuffer and PBO download.Kenneth Graunke2019-05-011-2/+2
| | | | | | | | | Recently we added checks to try and deny multisampled shader images. Unfortunately, this messed up imageBuffers, which have sample_count = 0, which are also used in PBO download, causing us hit CPU map fallbacks. Fixes: b15f5cfd20c iris: Do not advertise multisampled image load/store. Reviewed-by: Rafael Antognolli <[email protected]>
* iris: Do not advertise multisampled image load/store.Rafael Antognolli2019-04-291-0/+5
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* iris: Advertise EXT_texture_sRGB_R8 supportKenneth Graunke2019-04-241-0/+1
| | | | Using the luminance format, like both brw and anv do.
* iris: Convert RGBX to RGBA always.Rafael Antognolli2019-03-131-14/+27
| | | | | | | | | | | In i965, we disable the use of RGBX formats, so the higher layers of Mesa choose the equivalent RGBA format, and swizzle the alpha channel to 1.0. However, Gallium won't do that. We need to explicitly convert it to RGBA. Reviewed-by: Kenneth Graunke <[email protected]>
* iris: Properly support alpha and luminance-alpha formatsKenneth Graunke2019-03-071-77/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | For texturing, we map alpha formats to the corresponding red format, as many alpha formats are outright missing, and red is more efficient when sampling anyway. When rendering to A8_UNORM, we use that format directly, so the image gets the shader output's .a/.w channel, rather than the .r/.x channel. All other A* formats are non-renderable, so we can't do much and just mark them as unsupported for rendering. Fortunately, GL only requires rendering to A8_UNORM, so that works out. According to Andre Heider and Timur Kristóf, this fixes font rendering in Witcher 1 (via nine). Andre also reported that it fixes Unigine Heaven (presumably via nine). v2: Use the same swizzle for both sampler views and "render targets". BLORP expects the read swizzle, and will take the inverse when setting up the destination swizzle (and actually applying it in the shaders). We ignore the format swizzle when setting up normal rendering SURFACE_STATEs, which is necessary because it would be an illegal shader channel select combination. Thanks to Jason Ekstrand for pointing out that BLORP took an inverse swizzle. Tested-by: Timur Kristóf <[email protected]> Tested-by: Andre Heider <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* iris: Properly allow rendering to RGBX formats.Kenneth Graunke2019-02-251-2/+9
| | | | | | | | | | | | I was converting them at pipe_surface creation time, but not when answering queries about whether formats support rendering. This caused a lot of FBO incomplete errors for formats that ought to be supported. Fixes "Child of Light", which uses PIPE_FORMAT_R8G8B8X8_UNORM_SRGB. Also fixes Witcher 1 using wined3d (GL) according to Timur Kristóf. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109738
* iris: Drop RGBX -> RGBA for storage image usagesKenneth Graunke2019-02-251-6/+3
| | | | GLSL doesn't expose RGB/RGBX image formats, so this isn't needed.
* iris: limit gen8 to 8 samplesDave Airlie2019-02-211-1/+2
|
* iris: fix alpha channel for RGB BC1 formatsKenneth Graunke2019-02-211-8/+13
|
* iris: Drop B5G5R5X1 supportKenneth Graunke2019-02-211-1/+0
| | | | | This is oddly renderable but not supported for sampling, which is the opposite of other X formats. Just skip it and fall back to BGRA.
* iris: Enable A8/A16_UNORM in an inefficient mannerKenneth Graunke2019-02-211-6/+7
| | | | | These are currently just use the 'A' hardware formats, rather than the faster 'R' formats. glBitmap handling needs these, it seems. :(
* iris: drop dead format //'sKenneth Graunke2019-02-211-56/+0
| | | | these just aren't supported
* iris: X32_S8X24 :/Kenneth Graunke2019-02-211-5/+1
| | | | | | | | This can happen when faking Z32_S8X24 and setting StencilSampling = true I guess we'll just turn it into S8_UINT... Fixes KHR-GL45.texture_swizzle.functional
* iris: enable I/L formatsKenneth Graunke2019-02-211-81/+67
|
* iris: Use R/RG instead of I/L/A when samplingKenneth Graunke2019-02-211-0/+31
|
* iris: rework format translation apisKenneth Graunke2019-02-211-6/+8
|
* iris: stencil texturingKenneth Graunke2019-02-211-0/+1
|
* iris: fix Z32_S8 depth samplingKenneth Graunke2019-02-211-4/+6
| | | | | | | We were accidentally using the ISL_FORMAT_R32_FLOAT_X8X24_TYPELESS format, which is NOT what we use. We just store R32_FLOAT depth. fixes Piglit's texwrap GL_ARB_depth_buffer_float
* iris: reenable R32G32B32 texture buffersKenneth Graunke2019-02-211-1/+4
| | | | | This dropped us from GL 4.2 to GL 3.3 by mistake. Thanks to Dave for catching this!
* iris: use consistent copyright formattingKenneth Graunke2019-02-211-7/+6
| | | | | | some of them had typos, didn't say 'authors or copyright holders', or other mistakes. This is now https://opensource.org/licenses/MIT text, formatted consistently.
* iris: disallow RGB32 formats tooKenneth Graunke2019-02-211-2/+2
|
* iris: Convert RGBX to RGBA for rendering.Kenneth Graunke2019-02-211-0/+20
| | | | Fixes a bunch of RGB bugs.
* iris: say no to more formatsKenneth Graunke2019-02-211-2/+17
| | | | copied from brw_surface_formats.c
* iris: allow S8 as a stencil formatKenneth Graunke2019-02-211-1/+2
|
* iris: comment everythingKenneth Graunke2019-02-211-0/+13
| | | | | | 1. Write the code 2. Add comments 3. PROFIT (or just avoid cost of explaining or relearning things...)
* iris: fix Z24Kenneth Graunke2019-02-211-2/+2
| | | | | | This was backwards. thanks to Jason Ekstrand for realizing that I was seeing the wrong bits.
* iris: disable 6x MSAA supportKenneth Graunke2019-02-211-2/+3
|
* iris: comment out l/a/i/laKenneth Graunke2019-02-211-27/+29
| | | | in hopes of r/rg fallbacks
* iris: properly reject formats, fixes RGB32 rendering with texture floatKenneth Graunke2019-02-211-1/+1
|
* iris: bump GL version to 4.2Kenneth Graunke2019-02-211-3/+9
|
* iris: some depth stuff :(Kenneth Graunke2019-02-211-3/+4
|
* iris: enable a few more formatsKenneth Graunke2019-02-211-2/+2
|
* iris: Initial commit of a new 'iris' driver for Intel Gen8+ GPUs.Kenneth Graunke2019-02-211-0/+474
This commit introduces a new Gallium driver for Intel Gen8+ GPUs, named 'iris_dri.so' after the hardware. Developed by: - Kenneth Graunke (overall driver) - Dave Airlie (shaders, conditional render, overflow query, Gen8 port) - Chris Wilson (fencing, pinned memory, ...) - Jordan Justen (compute shaders) - Jason Ekstrand (image load store) - Caio Marcelo de Oliveira Filho (tessellation control passthrough) - Rafael Antognolli (auxiliary buffer fixes) - The rest of the i965 contributors and the Mesa community