dawn-cmake/src/transform
Antonio Maiorano d733fdb85c HLSL: work around FXC failures when dynamically indexing arrays in structs
FXC fails to compile code that assigns to dynamically-indexed fixed-size
arrays in structs on internal shader variables with:

error X3500: array reference cannot be used as an l-value; not natively
addressable

This CL detects this case, and transforms such assignments into copying
out the array to a local variable, assigning to that local, and then
copying the array back.

Also manually regenerate SKIPs for HLSL/FXC after this change, which
fixes 30 tests. Also exposes some "compilation aborted unexpectedly" now
that  "array reference cannot be used as an l-value" has been fixed. For
tests that fail for both DXC and FXC, updating SKIPs to the DXC one to
help distinguish actual FXC bugs from valid errors.

Bug: tint:998
Bug: tint:1206
Change-Id: I09204d8d81ab27d1c257538ad702414ccc386543
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/71620
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
2021-12-13 15:55:11 +00:00
..
add_empty_entry_point.cc transform: Add transform to add empty entry point 2021-09-07 18:59:21 +00:00
add_empty_entry_point.h transform: Add transform to add empty entry point 2021-09-07 18:59:21 +00:00
add_empty_entry_point_test.cc transform: Add transform to add empty entry point 2021-09-07 18:59:21 +00:00
add_spirv_block_decoration.cc spirv: Add block decorations with a transform 2021-12-09 15:45:03 +00:00
add_spirv_block_decoration.h spirv: Add block decorations with a transform 2021-12-09 15:45:03 +00:00
add_spirv_block_decoration_test.cc spirv: Add block decorations with a transform 2021-12-09 15:45:03 +00:00
array_length_from_uniform.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
array_length_from_uniform.h transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
array_length_from_uniform_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
binding_remapper.cc sem: Rename Function methods 2021-11-04 22:29:22 +00:00
binding_remapper.h Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
binding_remapper_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
calculate_array_length.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
calculate_array_length.h Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
calculate_array_length_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
canonicalize_entry_point_io.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
canonicalize_entry_point_io.h Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
canonicalize_entry_point_io_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
decompose_memory_access.cc utils: Add Lookup() 2021-11-23 18:37:37 +00:00
decompose_memory_access.h Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
decompose_memory_access_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
decompose_strided_matrix.cc transform: Combine InlinePointerLets and Simplify 2021-11-23 20:45:51 +00:00
decompose_strided_matrix.h reader/spirv: Handle the MatrixStride decoration 2021-07-27 08:17:29 +00:00
decompose_strided_matrix_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
external_texture_transform.cc ast: Remove TypeConstructorExpression 2021-11-15 20:45:50 +00:00
external_texture_transform.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
external_texture_transform_test.cc Remove texture_external overload for textureSample and add textureSampleLevel 2021-05-12 10:37:03 +00:00
first_index_offset.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
first_index_offset.h transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
first_index_offset_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
fold_constants.cc ast: Remove TypeConstructorExpression 2021-11-15 20:45:50 +00:00
fold_constants.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
fold_constants_test.cc Implement a FoldConstants transform that currently folds scalar and vector conversions 2021-06-18 14:59:51 +00:00
fold_trivial_single_use_lets.cc ast: Add 'Expression' suffix to literals (2/2) 2021-11-10 19:23:07 +00:00
fold_trivial_single_use_lets.h transform: Add FoldTrivialSingleUseLets 2021-07-02 21:15:44 +00:00
fold_trivial_single_use_lets_test.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
for_loop_to_loop.cc Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
for_loop_to_loop.h [transform] Add ForLoopToLoop 2021-07-08 10:00:17 +00:00
for_loop_to_loop_test.cc [transform] Add ForLoopToLoop 2021-07-08 10:00:17 +00:00
glsl.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
glsl.h GLSL writer: validate all entry points with glslang. 2021-10-14 14:39:36 +00:00
glsl_test.cc Implement GLSL writer backend. 2021-10-06 18:55:10 +00:00
localize_struct_array_assignment.cc HLSL: work around FXC failures when dynamically indexing arrays in structs 2021-12-13 15:55:11 +00:00
localize_struct_array_assignment.h HLSL: work around FXC failures when dynamically indexing arrays in structs 2021-12-13 15:55:11 +00:00
localize_struct_array_assignment_test.cc HLSL: work around FXC failures when dynamically indexing arrays in structs 2021-12-13 15:55:11 +00:00
loop_to_for_loop.cc Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
loop_to_for_loop.h [transform] Add ForLoopToLoop 2021-07-08 10:00:17 +00:00
loop_to_for_loop_test.cc transform: LoopToForLoop - fix bad emission 2021-07-29 18:05:19 +00:00
manager.cc resolver: Add dependency-graph analysis 2021-11-22 11:44:57 +00:00
manager.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
module_scope_var_to_entry_point_param.cc ast: Remove TypeConstructorExpression 2021-11-15 20:45:50 +00:00
module_scope_var_to_entry_point_param.h transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
module_scope_var_to_entry_point_param_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
multiplanar_external_texture.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
multiplanar_external_texture.h Transform texture_externals used in a user-defined function 2021-12-02 15:21:31 +00:00
multiplanar_external_texture_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
num_workgroups_from_uniform.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
num_workgroups_from_uniform.h transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
num_workgroups_from_uniform_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
pad_array_elements.cc utils: Add Lookup() 2021-11-23 18:37:37 +00:00
pad_array_elements.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
pad_array_elements_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
promote_initializers_to_const_var.cc ast: Remove TypeConstructorExpression 2021-11-15 20:45:50 +00:00
promote_initializers_to_const_var.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
promote_initializers_to_const_var_test.cc ast: Remove TypeConstructorExpression 2021-11-15 20:45:50 +00:00
remove_phonies.cc transform: Don't consider type-ctor/casts as having side-effects 2021-11-25 16:10:28 +00:00
remove_phonies.h Implement phony assignment 2021-10-21 23:04:44 +00:00
remove_phonies_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
remove_unreachable_statements.cc resolver: Migrate validation to behavior analysis 2021-12-03 17:51:48 +00:00
remove_unreachable_statements.h resolver: Migrate validation to behavior analysis 2021-12-03 17:51:48 +00:00
remove_unreachable_statements_test.cc resolver: Migrate validation to behavior analysis 2021-12-03 17:51:48 +00:00
renamer.cc GLSL: rename all identifiers prefixed with gl_. 2021-11-16 19:13:36 +00:00
renamer.h Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
renamer_test.cc ast: Rename ArrayAccessorExpression to IndexAccessorExpression 2021-11-09 09:35:00 +00:00
robustness.cc ast: Rename 'array accessor' to 'index accessor' 2021-11-10 19:23:07 +00:00
robustness.h ast: Rename ArrayAccessorExpression to IndexAccessorExpression 2021-11-09 09:35:00 +00:00
robustness_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
simplify_pointers.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
simplify_pointers.h resolver: Support shadowing 2021-11-23 20:45:51 +00:00
simplify_pointers_test.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
single_entry_point.cc single_entry_point: Retain applied transforms 2021-12-09 09:18:44 +00:00
single_entry_point.h Program: Track what transforms have been applied 2021-06-25 10:26:26 +00:00
single_entry_point_test.cc resolver: Track global uses in function decorations 2021-11-23 21:46:48 +00:00
test_helper.h reader/spirv: Handle the MatrixStride decoration 2021-07-27 08:17:29 +00:00
transform.cc Implement phony assignment 2021-10-21 23:04:44 +00:00
transform.h Implement phony assignment 2021-10-21 23:04:44 +00:00
transform_test.cc ast: Add 'Expression' suffix to literals (2/2) 2021-11-10 19:23:07 +00:00
unshadow.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
unshadow.h resolver: Support shadowing 2021-11-23 20:45:51 +00:00
unshadow_test.cc resolver: Support shadowing 2021-11-23 20:45:51 +00:00
vectorize_scalar_matrix_constructors.cc ast: Remove TypeConstructorExpression 2021-11-15 20:45:50 +00:00
vectorize_scalar_matrix_constructors.h Add support for matrix construction from scalars 2021-10-25 19:20:31 +00:00
vectorize_scalar_matrix_constructors_test.cc Add support for matrix construction from scalars 2021-10-25 19:20:31 +00:00
vertex_pulling.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
vertex_pulling.h Remove InputStepMode (it was deprecated in favor of VertexStepMode) 2021-07-27 07:33:19 +00:00
vertex_pulling_test.cc transform: Do not generate block attributes 2021-12-09 15:45:03 +00:00
wrap_arrays_in_structs.cc utils: Add Lookup() 2021-11-23 18:37:37 +00:00
wrap_arrays_in_structs.h Make all ast and sem pointers const 2021-10-19 18:38:54 +00:00
wrap_arrays_in_structs_test.cc Allow array size to be a module-scope constant 2021-09-02 13:49:59 +00:00
zero_init_workgroup_memory.cc utils: Add Lookup() 2021-11-23 18:37:37 +00:00
zero_init_workgroup_memory.h transform: Optimize ZeroInitWorkgroupMemory for arrays 2021-07-30 14:08:06 +00:00
zero_init_workgroup_memory_test.cc transform: Optimize ZeroInitWorkgroupMemory for arrays 2021-07-30 14:08:06 +00:00