HLSL query lod cleanups.

This commit is contained in:
Hans-Kristian Arntzen 2019-07-24 11:34:28 +02:00
parent 461f1506e7
commit 4bc8729c0e
5 changed files with 9 additions and 6 deletions

View File

@ -28,7 +28,7 @@ void frag_main()
float4 _47 = ddy_fine(vInput);
float4 _50 = fwidth(vInput);
float _56_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vInput.zw);
float2 _56 = float2(_56_tmp, _56_tmp);
float2 _56 = _56_tmp.xx;
if (vInput.y > 10.0f)
{
FragColor += _23;

View File

@ -17,7 +17,8 @@ struct SPIRV_Cross_Output
void frag_main()
{
float _19_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vTexCoord);
FragColor = float2(_19_tmp, _19_tmp).xyxy;
float2 _19 = _19_tmp.xx;
FragColor = _19.xyxy;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -28,7 +28,8 @@ void frag_main()
float4 d7 = ddy_fine(vInput);
float4 d8 = fwidth(vInput);
float _56_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vInput.zw);
float2 lod = float2(_56_tmp, _56_tmp);
float2 _56 = _56_tmp.xx;
float2 lod = _56;
if (vInput.y > 10.0f)
{
FragColor += t;

View File

@ -17,7 +17,8 @@ struct SPIRV_Cross_Output
void frag_main()
{
float _19_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vTexCoord);
FragColor = float2(_19_tmp, _19_tmp).xyxy;
float2 _19 = _19_tmp.xx;
FragColor = _19.xyxy;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -2881,7 +2881,8 @@ void CompilerHLSL::emit_texture_op(const Instruction &i)
// according to GLSL spec, and it depends on the sampler itself.
// Just assume X == Y, so we will need to splat the result to a float2.
statement("float _", id, "_tmp = ", expr, ";");
emit_op(result_type, id, join("float2(_", id, "_tmp, _", id, "_tmp)"), true, true);
statement("float2 _", id, " = _", id, "_tmp.xx;");
set<SPIRExpression>(id, join("_", id), result_type, true);
}
else
{
@ -2897,7 +2898,6 @@ void CompilerHLSL::emit_texture_op(const Instruction &i)
case OpImageSampleImplicitLod:
case OpImageSampleProjImplicitLod:
case OpImageSampleProjDrefImplicitLod:
case OpImageQueryLod:
register_control_dependent_expression(id);
break;