microsoft / microsoft/DirectXShaderCompiler

The -MD -MF options will generate **circular** dependency when specifying -Fh without -Fo

Open
#7,062 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
The -MD -MF options generate circular dependency when specifying -Fh without -Fo

Steps to Reproduce

Here is my compile command to generate the dependency file

"dxc" -Od -Zi -Qembed_debug -T vs_6_8 -MD -MF "_internal_full_screen_transfer_vertex.d" -Fh "_internal_full_screen_transfer_vertex.inl" -Vn "full_screen_transfer_vertex_shader_module_code" "full_screen_transfer_vertex.sl"

And I have the following generated dependency file

full_screen_transfer_vertex.sl: full_screen_transfer_vertex.sl full_screen_transfer_pipeline_layout.sli brx_define.sli

The make error output

make: Circular full_screen_transfer_vertex.sl <- full_screen_transfer_vertex.sl dependency dropped.

But if I change my command to -Fo instead of -Fh

"dxc" -Od -Zi -Qembed_debug -T vs_6_8 -MD -MF "_internal_full_screen_transfer_vertex.d" -Fo "_internal_full_screen_transfer_vertex.inl" "full_screen_transfer_vertex.sl"

I get the correct dependency file

full_screen_transfer_vertex.inl: full_screen_transfer_vertex.sl full_screen_transfer_pipeline_layout.sli brx_define.sli

Actual Behavior

The make error output

make: Circular full_screen_transfer_vertex.sl <- full_screen_transfer_vertex.sl dependency dropped.

Environment

  • DXC version: dxcompiler.dll: 1.8 - 1.8.2405.15 (fd7e54bcd); dxil.dll: 1.8(101.8.2405.17)
  • Host Operating System: Windows 10 Pro 22H2 19045.5247

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 by reproducing the shown dxc command with -MD -MF -Fh and compare its dependency output with the -Fo case. Trace the dependency-generation path handling the -Fh and -Fo output options. Done means the generated dependency target names the header output rather than the input .sl file, without introducing a circular dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.