diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 1c7a2627..db9c212d 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -1503,6 +1503,7 @@ enum state_property_component_type FX_DS, FX_HS, FX_CS, + FX_TEXTURE, }; static inline bool is_object_fx_type(enum state_property_component_type type) @@ -1514,6 +1515,7 @@ static inline bool is_object_fx_type(enum state_property_component_type type) case FX_DS: case FX_HS: case FX_CS: + case FX_TEXTURE: return true; default: return false; @@ -1534,6 +1536,8 @@ static inline enum hlsl_type_class hlsl_type_class_from_fx_type(enum state_prope return HLSL_CLASS_HULL_SHADER; case FX_CS: return HLSL_CLASS_COMPUTE_SHADER; + case FX_TEXTURE: + return HLSL_CLASS_TEXTURE; default: vkd3d_unreachable(); } @@ -1704,7 +1708,7 @@ static void resolve_fx_4_state_block_values(struct hlsl_ir_var *var, struct hlsl { "BorderColor", HLSL_CLASS_SAMPLER, HLSL_CLASS_VECTOR, FX_FLOAT, 4, 52 }, { "MinLOD", HLSL_CLASS_SAMPLER, HLSL_CLASS_SCALAR, FX_FLOAT, 1, 53 }, { "MaxLOD", HLSL_CLASS_SAMPLER, HLSL_CLASS_SCALAR, FX_FLOAT, 1, 54 }, - /* TODO: "Texture" field */ + { "Texture", HLSL_CLASS_SAMPLER, HLSL_CLASS_SCALAR, FX_TEXTURE, 1, 55 }, { "HullShader", HLSL_CLASS_PASS, HLSL_CLASS_SCALAR, FX_HS, 1, 56 }, { "DomainShader", HLSL_CLASS_PASS, HLSL_CLASS_SCALAR, FX_DS, 1, 57 }, diff --git a/tests/hlsl/effect-variables-fx_4.shader_test b/tests/hlsl/effect-variables-fx_4.shader_test index 85bbcffd..16a04210 100644 --- a/tests/hlsl/effect-variables-fx_4.shader_test +++ b/tests/hlsl/effect-variables-fx_4.shader_test @@ -17,3 +17,26 @@ struct s }; s var; + +[effect] +Texture t1; +Texture1D t2; +Texture1DArray t3; +Texture2D t4; +Texture2DArray t5; +Texture2DMS t6; +Texture2DMSArray t7; +Texture3D t8; +TextureCube t9; +TextureCubeArray t10; + +SamplerState sampler1 { Texture = t1; }; +SamplerState sampler2 { Texture = t2; }; +SamplerState sampler3 { Texture = t3; }; +SamplerState sampler4 { Texture = t4; }; +SamplerState sampler5 { Texture = t5; }; +SamplerState sampler6 { Texture = t6; }; +SamplerState sampler7 { Texture = t7; }; +SamplerState sampler8 { Texture = t8; }; +SamplerState sampler9 { Texture = t9; }; +SamplerState sampler10 { Texture = t10; }; diff --git a/tests/hlsl/effect-variables-fx_5.shader_test b/tests/hlsl/effect-variables-fx_5.shader_test index 0860638e..b815e157 100644 --- a/tests/hlsl/effect-variables-fx_5.shader_test +++ b/tests/hlsl/effect-variables-fx_5.shader_test @@ -17,3 +17,26 @@ struct s }; s var; + +[effect] +Texture t1; +Texture1D t2; +Texture1DArray t3; +Texture2D t4; +Texture2DArray t5; +Texture2DMS t6; +Texture2DMSArray t7; +Texture3D t8; +TextureCube t9; +TextureCubeArray t10; + +SamplerState sampler1 { Texture = t1; }; +SamplerState sampler2 { Texture = t2; }; +SamplerState sampler3 { Texture = t3; }; +SamplerState sampler4 { Texture = t4; }; +SamplerState sampler5 { Texture = t5; }; +SamplerState sampler6 { Texture = t6; }; +SamplerState sampler7 { Texture = t7; }; +SamplerState sampler8 { Texture = t8; }; +SamplerState sampler9 { Texture = t9; }; +SamplerState sampler10 { Texture = t10; };