libretro / libretro/RetroArch

D3D11[/D3D12?] Generate mips breaks some shaders

Open
#18,723 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Is there an existing issue for this?
  • This is a bug in RetroArch frontend
  • I have searched the existing issues
Description

@hunterk

Hi Hunter this commit:

"Revision: 66a7657e8b48b6c00ebd70a389156b1b9f461c2a
Author: hunterk hunter_kaller@yahoo.com
Date: 14/12/2025 10:32:09
Message:
fix mipmaps on generated textures in d3d10, d3d11 and d3d12 (#18513)


Modified: gfx/drivers/d3d10.c
Modified: gfx/drivers/d3d11.c
Modified: gfx/drivers/d3d12.c"

and specifically the line 3101:

d3d11->pass[i].rt.desc.MiscFlags = D3D11_RESOURCE_MISC_GENERATE_MIPS;

Is breaking shaders in D3D11, specifically:

shaders_slang\ntsc\ntsc-256px-composite-scanline.slangp

But not limited to as users have seen issues in others.

I dont know if it also affects D3D12 - I've been told it does. Ive also been told it doesn't effect Vulkan but I also haven't verified that myself.

What happens is that mips get generated for a render target after its been written and when that texture that now has mips is used in the next pass the next pass for whatever reason samples out of the lower resolution mip levels producing sampling issues. When you remove the above line everything works fine (or at least that shader does)

Expected behavior

No response

Steps to reproduce the bug

Run the shader

shaders_slang\ntsc\ntsc-256px-composite-scanline.slangp

on latest stable and latest nightly and notice the difference.

Version/Commit

66a7657e8b48b6c00ebd70a389156b1b9f461c2a

Bisect Results

No response

Present in the nightly version

Yes, this is reproduced in the nightly build

Platform & operating system

Windows 11

Affected Cores

No response

Environment information

No response

Relevant log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with gfx/drivers/d3d11.c around line 3101 and compare the related changes in gfx/drivers/d3d10.c and gfx/drivers/d3d12.c. Run shaders_slang\ntsc\ntsc-256px-composite-scanline.slangp on Windows 11 using the reported commit or a current nightly, then inspect the generated-mip behavior across D3D11 and D3D12. Done means the shader no longer shows the reported sampling difference and the affected rendering paths behave correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.