Commit ae415a7d authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

d3dcompiler: Unconditionally report special (pixel shader output) sysvals based…

d3dcompiler: Unconditionally report special (pixel shader output) sysvals based on the semantic name. That is, do not check that the shader is a pixel shader and that the signature is an output signature. These semantic names can only be generated in such conditions; using the name for any other stage is invalid. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarMatteo Bruni <mbruni@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 172048e3
...@@ -1608,7 +1608,7 @@ err_out: ...@@ -1608,7 +1608,7 @@ err_out:
return hr; return hr;
} }
static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, struct dxbc_section *section, DWORD target) static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *s, struct dxbc_section *section)
{ {
D3D11_SIGNATURE_PARAMETER_DESC *d; D3D11_SIGNATURE_PARAMETER_DESC *d;
unsigned int string_data_offset; unsigned int string_data_offset;
...@@ -1690,27 +1690,16 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature * ...@@ -1690,27 +1690,16 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *
d[i].ReadWriteMask = (mask >> 8) & 0xff; d[i].ReadWriteMask = (mask >> 8) & 0xff;
d[i].Mask = mask & 0xff; d[i].Mask = mask & 0xff;
/* pixel shaders have a special handling for SystemValueType in the output signature */ if (!stricmp(d[i].SemanticName, "sv_depth"))
if (((target & D3DCOMPILER_SHADER_TARGET_SHADERTYPE_MASK) == 0xffff0000) && (section->tag == TAG_OSG5 || section->tag == TAG_OSGN)) d[i].SystemValueType = D3D_NAME_DEPTH;
{ else if (!stricmp(d[i].SemanticName, "sv_coverage"))
TRACE("Pixelshader output signature fixup.\n"); d[i].SystemValueType = D3D_NAME_COVERAGE;
else if (!stricmp(d[i].SemanticName, "sv_depthgreaterequal"))
if (d[i].Register == 0xffffffff) d[i].SystemValueType = D3D_NAME_DEPTH_GREATER_EQUAL;
{ else if (!stricmp(d[i].SemanticName, "sv_depthlessequal"))
if (!stricmp(d[i].SemanticName, "sv_depth")) d[i].SystemValueType = D3D_NAME_DEPTH_LESS_EQUAL;
d[i].SystemValueType = D3D_NAME_DEPTH; else if (!stricmp(d[i].SemanticName, "sv_target"))
else if (!stricmp(d[i].SemanticName, "sv_coverage")) d[i].SystemValueType = D3D_NAME_TARGET;
d[i].SystemValueType = D3D_NAME_COVERAGE;
else if (!stricmp(d[i].SemanticName, "sv_depthgreaterequal"))
d[i].SystemValueType = D3D_NAME_DEPTH_GREATER_EQUAL;
else if (!stricmp(d[i].SemanticName, "sv_depthlessequal"))
d[i].SystemValueType = D3D_NAME_DEPTH_LESS_EQUAL;
}
else
{
d[i].SystemValueType = D3D_NAME_TARGET;
}
}
TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, " TRACE("semantic: %s, semantic idx: %u, sysval_semantic %#x, "
"type %u, register idx: %u, use_mask %#x, input_mask %#x, stream %u\n", "type %u, register idx: %u, use_mask %#x, input_mask %#x, stream %u\n",
...@@ -1777,7 +1766,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl ...@@ -1777,7 +1766,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
goto err_out; goto err_out;
} }
hr = d3dcompiler_parse_signature(reflection->isgn, section, reflection->target); hr = d3dcompiler_parse_signature(reflection->isgn, section);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to parse section ISGN.\n"); WARN("Failed to parse section ISGN.\n");
...@@ -1795,7 +1784,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl ...@@ -1795,7 +1784,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
goto err_out; goto err_out;
} }
hr = d3dcompiler_parse_signature(reflection->osgn, section, reflection->target); hr = d3dcompiler_parse_signature(reflection->osgn, section);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to parse section OSGN.\n"); WARN("Failed to parse section OSGN.\n");
...@@ -1812,7 +1801,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl ...@@ -1812,7 +1801,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
goto err_out; goto err_out;
} }
hr = d3dcompiler_parse_signature(reflection->pcsg, section, reflection->target); hr = d3dcompiler_parse_signature(reflection->pcsg, section);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to parse section PCSG.\n"); WARN("Failed to parse section PCSG.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment