Run format_all.sh.

This commit is contained in:
Hans-Kristian Arntzen 2018-02-21 13:46:16 +01:00
parent 1a2e4de7a5
commit 47b37423a2
2 changed files with 15 additions and 10 deletions

View File

@ -2846,7 +2846,8 @@ bool Compiler::DummySamplerForCombinedImageHandler::handle(Op opcode, const uint
uint32_t result_type = args[0];
auto &type = compiler.get<SPIRType>(result_type);
bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer;
bool separate_image =
type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer;
// If not separate image, don't bother.
if (!separate_image)
@ -2880,7 +2881,8 @@ bool Compiler::DummySamplerForCombinedImageHandler::handle(Op opcode, const uint
return false;
auto &type = compiler.get<SPIRType>(args[0]);
bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer;
bool separate_image =
type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer;
if (separate_image)
SPIRV_CROSS_THROW("Attempting to use arrays or structs of separate images. This is not possible to "
"statically remap to plain GLSL.");
@ -2959,7 +2961,8 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar
if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer)
{
if (compiler.dummy_sampler_id == 0)
SPIRV_CROSS_THROW("texelFetch without sampler was found, but no dummy sampler has been created with build_dummy_sampler_for_combined_images().");
SPIRV_CROSS_THROW("texelFetch without sampler was found, but no dummy sampler has been created with "
"build_dummy_sampler_for_combined_images().");
// Do it outside.
is_fetch = true;

View File

@ -3485,10 +3485,10 @@ string CompilerGLSL::to_function_name(uint32_t, const SPIRType &imgtype, bool is
}
// 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, bool is_proj, uint32_t coord,
uint32_t coord_components, uint32_t dref, uint32_t grad_x, uint32_t grad_y,
uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias, uint32_t comp,
uint32_t sample, bool *p_forward)
string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool, bool is_proj,
uint32_t coord, uint32_t coord_components, uint32_t dref, uint32_t grad_x,
uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias,
uint32_t comp, uint32_t sample, bool *p_forward)
{
string farg_str = to_expression(img);
@ -3503,13 +3503,15 @@ string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, boo
if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer)
{
if (!dummy_sampler_id)
SPIRV_CROSS_THROW("Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?");
SPIRV_CROSS_THROW(
"Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?");
if (options.vulkan_semantics)
{
auto sampled_type = imgtype;
sampled_type.basetype = SPIRType::SampledImage;
farg_str = join(type_to_glsl(sampled_type), "(", to_expression(img), ", ", to_expression(dummy_sampler_id), ")");
farg_str = join(type_to_glsl(sampled_type), "(", to_expression(img), ", ",
to_expression(dummy_sampler_id), ")");
}
else
farg_str = to_combined_image_sampler(img, dummy_sampler_id);