From: Ilia Mirkin Date: Mon, 2 Mar 2020 03:08:20 +0000 (-0500) Subject: nvc0: enable EXT_texture_shadow_lod X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bdf20d324bfec6a6cbabf7492cb4b19f7d9de5ad;p=mesa.git nvc0: enable EXT_texture_shadow_lod This passes all the CTS tests for this extension. Signed-off-by: Ilia Mirkin Tested-by: Marge Bot Part-of: --- 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: