diff options
author | Ilia Mirkin <[email protected]> | 2020-03-01 22:08:20 -0500 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2020-03-02 20:01:13 -0500 |
commit | bdf20d324bfec6a6cbabf7492cb4b19f7d9de5ad (patch) | |
tree | 6473a915ecd572e25086c336215d088a8c32b858 /src/gallium | |
parent | 11a06dfd4ba4351848422eba357a8b41dd3b78df (diff) |
nvc0: enable EXT_texture_shadow_lod
This passes all the CTS tests for this extension.
Signed-off-by: Ilia Mirkin <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4014>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4014>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 12 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp index da9df42e232..3375c599e75 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp @@ -2315,9 +2315,15 @@ Converter::handleTEX(Value *dst[4], int R, int S, int L, int C, int Dx, int Dy) if (C == 0x0f) C = 0x00 | MAX2(tgt.getArgCount(), 2); // guess DC src - if (tgsi.getOpcode() == TGSI_OPCODE_TG4 && - tgt == TEX_TARGET_CUBE_ARRAY_SHADOW) - shd = fetchSrc(1, 0); + if (tgt == TEX_TARGET_CUBE_ARRAY_SHADOW) { + switch (tgsi.getOpcode()) { + case TGSI_OPCODE_TG4: shd = fetchSrc(1, 0); break; + case TGSI_OPCODE_TEX2: shd = fetchSrc(1, 0); break; + case TGSI_OPCODE_TXB2: shd = fetchSrc(1, 1); break; + case TGSI_OPCODE_TXL2: shd = fetchSrc(1, 1); break; + default: assert(!"unexpected opcode with cube array shadow"); break; + } + } else if (tgt.isShadow()) shd = fetchSrc(C >> 4, C & 3); diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c index c2bdb2e8058..80af8f0d52c 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c @@ -292,6 +292,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_POINT_SIZE_FIXED: case PIPE_CAP_TWO_SIDED_COLOR: case PIPE_CAP_CLIP_PLANES: + case PIPE_CAP_TEXTURE_SHADOW_LOD: return 1; case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER: return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? 1 : 0; @@ -382,7 +383,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param) case PIPE_CAP_FRONTEND_NOOP: case PIPE_CAP_GL_SPIRV: case PIPE_CAP_SHADER_SAMPLES_IDENTICAL: - case PIPE_CAP_TEXTURE_SHADOW_LOD: /* should be possible */ return 0; case PIPE_CAP_VENDOR_ID: |