Fixes from code review of adding writable images to iOS Tier2 argument buffers.

This commit is contained in:
Bill Hollings 2023-01-08 21:22:23 -05:00
parent 643b7be196
commit 284ccf5d2d
3 changed files with 3 additions and 4 deletions

View File

@ -1194,7 +1194,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_opts.pad_fragment_output_components = args.msl_pad_fragment_output; msl_opts.pad_fragment_output_components = args.msl_pad_fragment_output;
msl_opts.tess_domain_origin_lower_left = args.msl_domain_lower_left; msl_opts.tess_domain_origin_lower_left = args.msl_domain_lower_left;
msl_opts.argument_buffers = args.msl_argument_buffers; msl_opts.argument_buffers = args.msl_argument_buffers;
msl_opts.argument_buffers_tier = (CompilerMSL::Options::ArgumentBuffersTier)args.msl_argument_buffers_tier; msl_opts.argument_buffers_tier = static_cast<CompilerMSL::Options::ArgumentBuffersTier>(args.msl_argument_buffers_tier);
msl_opts.texture_buffer_native = args.msl_texture_buffer_native; msl_opts.texture_buffer_native = args.msl_texture_buffer_native;
msl_opts.multiview = args.msl_multiview; msl_opts.multiview = args.msl_multiview;
msl_opts.multiview_layered_rendering = args.msl_multiview_layered_rendering; msl_opts.multiview_layered_rendering = args.msl_multiview_layered_rendering;

View File

@ -736,7 +736,7 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c
break; break;
case SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER: case SPVC_COMPILER_OPTION_MSL_ARGUMENT_BUFFERS_TIER:
options->msl.argument_buffers_tier = (CompilerMSL::Options::ArgumentBuffersTier)value; options->msl.argument_buffers_tier = static_cast<CompilerMSL::Options::ArgumentBuffersTier>(value);
break; break;
#endif #endif

View File

@ -11612,11 +11612,10 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_
if (physical_type.basetype == SPIRType::Image && if (physical_type.basetype == SPIRType::Image &&
physical_type.image.sampled == 2 && physical_type.image.sampled == 2 &&
msl_options.is_ios() && msl_options.is_ios() &&
msl_options.argument_buffers &&
msl_options.argument_buffers_tier <= Options::ArgumentBuffersTier::Tier1 && msl_options.argument_buffers_tier <= Options::ArgumentBuffersTier::Tier1 &&
!has_decoration(orig_id, DecorationNonWritable)) !has_decoration(orig_id, DecorationNonWritable))
{ {
SPIRV_CROSS_THROW("Writable images are not allowed on Tier1 argument buffers on iOS."); SPIRV_CROSS_THROW("Writable images are not allowed on Tier1 argument buffers on iOS.");
} }
// Array information is baked into these types. // Array information is baked into these types.