From d62b0a9e2941eb9d43e84ee40fe1531c2dc92eea Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 29 Jan 2019 04:31:40 -0300 Subject: shader_ir: Clean texture management code Previous code relied on GLSL parameter order (something that's always ill-formed on an IR design). This approach passes spatial coordiantes through operation nodes and array and depth compare values in the the texture metadata. It still contains an "extra" vector containing generic nodes for bias and component index (for example) which is still a bit ill-formed but it should be better than the previous approach. --- src/video_core/shader/shader_ir.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/video_core/shader/shader_ir.h') diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 1d4fbef53..0c3d9c61e 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h @@ -288,9 +288,10 @@ struct MetaHalfArithmetic { struct MetaTexture { const Sampler& sampler; + Node array{}; + Node depth_compare{}; + std::vector extras; u32 element{}; - u32 coords_count{}; - std::optional array_index; }; constexpr MetaArithmetic PRECISE = {true}; @@ -754,9 +755,8 @@ private: bool lod_bias_enabled, std::size_t max_coords, std::size_t max_inputs); Node4 GetTextureCode(Tegra::Shader::Instruction instr, Tegra::Shader::TextureType texture_type, - Tegra::Shader::TextureProcessMode process_mode, bool depth_compare, - bool is_array, std::size_t array_offset, std::size_t bias_offset, - std::vector&& coords); + Tegra::Shader::TextureProcessMode process_mode, std::vector coords, + Node array, Node depth_compare, u32 bias_offset); Node GetVideoOperand(Node op, bool is_chunk, bool is_signed, Tegra::Shader::VideoType type, u64 byte_height); -- cgit v1.2.3