HLSL: Fix unary and binary operator type conversion issues
This fixes defects as follows: 1. handleLvalue could be called on a non-L-value, and it shouldn't be. 2. HLSL allows unary negation on non-bool values. TUnaryOperator::promote can now promote other types (e.g, int, float) to bool for this op. 3. HLSL allows binary logical operations (&&, ||) on arbitrary types, similar (2). 4. HLSL allows mod operation on arbitrary types, which will be promoted. E.g, int % float -> float % float.
This commit is contained in:
@@ -142,6 +142,8 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"hlsl.load.rwtexture.array.dx10.frag", "main"},
|
||||
{"hlsl.load.offset.dx10.frag", "main"},
|
||||
{"hlsl.load.offsetarray.dx10.frag", "main"},
|
||||
{"hlsl.logical.unary.frag", "main"},
|
||||
{"hlsl.logical.binary.frag", "main"},
|
||||
{"hlsl.multiEntry.vert", "RealEntrypoint"},
|
||||
{"hlsl.multiReturn.frag", "main"},
|
||||
{"hlsl.matrixindex.frag", "main"},
|
||||
@@ -149,6 +151,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"hlsl.overload.frag", "PixelShaderFunction"},
|
||||
{"hlsl.pp.line.frag", "main"},
|
||||
{"hlsl.precise.frag", "main"},
|
||||
{"hlsl.promote.binary.frag", "main"},
|
||||
{"hlsl.promotions.frag", "main"},
|
||||
{"hlsl.rw.bracket.frag", "main"},
|
||||
{"hlsl.rw.scalar.bracket.frag", "main"},
|
||||
@@ -179,7 +182,7 @@ INSTANTIATE_TEST_CASE_P(
|
||||
{"hlsl.samplelevel.basic.dx10.vert", "main"},
|
||||
{"hlsl.samplelevel.offset.dx10.frag", "main"},
|
||||
{"hlsl.samplelevel.offsetarray.dx10.frag", "main"},
|
||||
{ "hlsl.sample.sub-vec4.dx10.frag", "main"},
|
||||
{"hlsl.sample.sub-vec4.dx10.frag", "main"},
|
||||
{"hlsl.semicolons.frag", "main"},
|
||||
{"hlsl.shapeConv.frag", "main"},
|
||||
{"hlsl.shapeConvRet.frag", "main"},
|
||||
|
||||
Reference in New Issue
Block a user