microsoft / microsoft/DirectXShaderCompiler

Access violation (silent, no error messages generated) when trying to build pixel shader

Open
#3,377 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This is a port of a D3D9 trivial shader that just samples a texture. It successfully compiles on FXC as Pixel Shader 5.0, but fails to build on DXC as Pixel Shader 6.0.

No compile errors are displayed at all. echo %ERRORLEVEL% returns -1073741819 (0xC0000005, Access Violation)

There are probably mistakes in this code, but I have no clue what they are, as no compiler errors are being displayed.

SamplerState PointSampler { Filter = MIN_MAG_MIP_POINT; AddressU = Clamp; AddressV = Clamp; };

void main_vertex
(
	float4 position	: POSITION,
	float4 color	: COLOR,
	float2 texCoord : TEXCOORD0,

	uniform float4x4 modelViewProj,

	out float4 oPosition : POSITION,
	out float4 oColor    : COLOR,
	out float2 otexCoord : TEXCOORD
)
{
	oPosition = mul(modelViewProj, position);
	oColor = color;
	otexCoord = texCoord;
}

float4 main_fragment(float2 texCoord : TEXCOORD0, uniform Texture2D<float4> decal : TEXUNIT0) : SV_Target
{
	return decal.Sample(PointSampler, texCoord);
}

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

Reproduce the failure in DXC using the pixel-shader source shown in the issue, and compare it with the successful FXC compilation. Investigate the access violation rather than the shader's intended behavior; done means DXC no longer terminates silently and reports an appropriate result or diagnostic.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, 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.