Run format_all.sh.

This commit is contained in:
Hans-Kristian Arntzen 2018-04-30 12:46:21 +02:00
parent 47081f810a
commit 7e23e69f2a

View File

@ -3922,14 +3922,14 @@ std::string CompilerGLSL::convert_separate_image_to_combined(uint32_t id)
{ {
if (!dummy_sampler_id) if (!dummy_sampler_id)
SPIRV_CROSS_THROW( SPIRV_CROSS_THROW(
"Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?"); "Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?");
if (options.vulkan_semantics) if (options.vulkan_semantics)
{ {
auto sampled_type = imgtype; auto sampled_type = imgtype;
sampled_type.basetype = SPIRType::SampledImage; sampled_type.basetype = SPIRType::SampledImage;
return join(type_to_glsl(sampled_type), "(", to_expression(id), ", ", return join(type_to_glsl(sampled_type), "(", to_expression(id), ", ", to_expression(dummy_sampler_id),
to_expression(dummy_sampler_id), ")"); ")");
} }
else else
return to_combined_image_sampler(id, dummy_sampler_id); return to_combined_image_sampler(id, dummy_sampler_id);
@ -3940,10 +3940,10 @@ std::string CompilerGLSL::convert_separate_image_to_combined(uint32_t id)
} }
// Returns the function args for a texture sampling function for the specified image and sampling characteristics. // Returns the function args for a texture sampling function for the specified image and sampling characteristics.
string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather, bool is_proj, string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather,
uint32_t coord, uint32_t coord_components, uint32_t dref, uint32_t grad_x, bool is_proj, uint32_t coord, uint32_t coord_components, uint32_t dref,
uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias, uint32_t grad_x, uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset,
uint32_t comp, uint32_t sample, bool *p_forward) uint32_t bias, uint32_t comp, uint32_t sample, bool *p_forward)
{ {
string farg_str; string farg_str;
if (is_fetch) if (is_fetch)
@ -7279,7 +7279,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
uint32_t result_type = ops[0]; uint32_t result_type = ops[0];
uint32_t id = ops[1]; uint32_t id = ops[1];
auto expr = join("textureSize(", convert_separate_image_to_combined(ops[2]), ", ", bitcast_expression(SPIRType::Int, ops[3]), ")"); auto expr = join("textureSize(", convert_separate_image_to_combined(ops[2]), ", ",
bitcast_expression(SPIRType::Int, ops[3]), ")");
auto &restype = get<SPIRType>(ops[0]); auto &restype = get<SPIRType>(ops[0]);
expr = bitcast_expression(restype, SPIRType::Int, expr); expr = bitcast_expression(restype, SPIRType::Int, expr);
emit_op(result_type, id, expr, true); emit_op(result_type, id, expr, true);