From 947f7010c7b3be3855c857b8f9f9041eff0976d5 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Sun, 7 May 2017 13:28:08 +0200 Subject: [PATCH] HLSL: Use emit_sampled_image_op instead. --- spirv_hlsl.cpp | 15 +++++---------- spirv_hlsl.hpp | 1 + 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/spirv_hlsl.cpp b/spirv_hlsl.cpp index 6d711e8..7cf3726 100644 --- a/spirv_hlsl.cpp +++ b/spirv_hlsl.cpp @@ -897,6 +897,11 @@ string CompilerHLSL::to_sampler_expression(uint32_t id) return join("_", to_expression(id), "_sampler"); } +void CompilerHLSL::emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) +{ + set(result_id, result_type, image_id, samp_id); +} + string CompilerHLSL::to_func_call_arg(uint32_t id) { string arg_str = CompilerGLSL::to_func_call_arg(id); @@ -1714,16 +1719,6 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) break; } - case OpSampledImage: - { - uint32_t result_type = ops[0]; - uint32_t id = ops[1]; - uint32_t image = ops[2]; - uint32_t sampler = ops[3]; - set(id, result_type, image, sampler); - break; - } - case OpDPdx: UFOP(ddx); break; diff --git a/spirv_hlsl.hpp b/spirv_hlsl.hpp index 6ff56ff..92859ae 100644 --- a/spirv_hlsl.hpp +++ b/spirv_hlsl.hpp @@ -85,6 +85,7 @@ private: std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override; std::string to_func_call_arg(uint32_t id) override; std::string to_sampler_expression(uint32_t id); + void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) override; const char *to_storage_qualifiers_glsl(const SPIRVariable &var) override;