You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using SV_Target and SV_Target0 in the same PS fails validation instead of printing an error
Minimal repro steps
Compile the following pixel shader with dxc.exe -T ps_6_0 -E PSMain -spirv repro_shader.hlsl
struct PSInput
{
float4 color : COLOR;
};
void PSMain(PSInput input,
out float4 out_ : SV_Target,
out float4 out_0 : SV_Target0,
out float4 out_1 : SV_Target1)
{
out_ = input.color;
out_0 = input.color;
out_1 = input.color;
}
Expected result
An error is printed e.g. like the one with the DXIL backend: "Function: PSMain: error: Parameter with semantic SV_Target has overlapping semantic index at 0. Use /Zi for source location." or similar.
Actual result
a validation error is printed, which asks to report a bug:
fatal error: generated SPIR-V is invalid: Entry-point has conflicting output location assignment at location 0, component 0
OpEntryPoint Fragment %PSMain "PSMain" %in_var_COLOR %out_var_SV_Target %out_var_SV_Target0 %out_var_SV_Target1
note: please file a bug report on https://github.com/Microsoft/DirectXShaderCompiler/issues with source code if possible
The text was updated successfully, but these errors were encountered:
```
void main(PSInput input,
out float4 x : SV_Target,
out float4 y : SV_Target0,
out float4 z : SV_Target1)
```
x and y are both output stage variables with the same location.
This commit reports the duplication.
Fixesmicrosoft#3178
```
void main(PSInput input,
out float4 x : SV_Target,
out float4 y : SV_Target0,
out float4 z : SV_Target1)
```
x and y are both output stage variables with the same location.
This commit reports the duplication.
Fixes#3178
Title
Using SV_Target and SV_Target0 in the same PS fails validation instead of printing an error
Minimal repro steps
dxc.exe -T ps_6_0 -E PSMain -spirv repro_shader.hlsl
Expected result
An error is printed e.g. like the one with the DXIL backend: "Function: PSMain: error: Parameter with semantic SV_Target has overlapping semantic index at 0. Use /Zi for source location." or similar.
Actual result
a validation error is printed, which asks to report a bug:
The text was updated successfully, but these errors were encountered: