spirv: Add support for SpvCapabilityStorageImageWriteWithoutFormat
Allow that capability if the driver indicates that it is supported, and flag whether images are read-only/write-only in the nir_variable (based on the NonReadable and NonWritable decorations), which drivers may need to implement this. Signed-off-by: Alex Smith <asmith@feralinteractive.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:

committed by
Jason Ekstrand

parent
5c6eaa1421
commit
94d48b7f9f
@@ -49,6 +49,7 @@ struct nir_spirv_supported_extensions {
|
|||||||
bool image_ms_array;
|
bool image_ms_array;
|
||||||
bool tessellation;
|
bool tessellation;
|
||||||
bool draw_parameters;
|
bool draw_parameters;
|
||||||
|
bool image_write_without_format;
|
||||||
};
|
};
|
||||||
|
|
||||||
nir_function *spirv_to_nir(const uint32_t *words, size_t word_count,
|
nir_function *spirv_to_nir(const uint32_t *words, size_t word_count,
|
||||||
|
@@ -2664,7 +2664,6 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
|
|||||||
case SpvCapabilityMinLod:
|
case SpvCapabilityMinLod:
|
||||||
case SpvCapabilityTransformFeedback:
|
case SpvCapabilityTransformFeedback:
|
||||||
case SpvCapabilityStorageImageReadWithoutFormat:
|
case SpvCapabilityStorageImageReadWithoutFormat:
|
||||||
case SpvCapabilityStorageImageWriteWithoutFormat:
|
|
||||||
vtn_warn("Unsupported SPIR-V capability: %s",
|
vtn_warn("Unsupported SPIR-V capability: %s",
|
||||||
spirv_capability_to_string(cap));
|
spirv_capability_to_string(cap));
|
||||||
break;
|
break;
|
||||||
@@ -2700,6 +2699,10 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
|
|||||||
spv_check_supported(draw_parameters, cap);
|
spv_check_supported(draw_parameters, cap);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SpvCapabilityStorageImageWriteWithoutFormat:
|
||||||
|
spv_check_supported(image_write_without_format, cap);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
unreachable("Unhandled capability");
|
unreachable("Unhandled capability");
|
||||||
}
|
}
|
||||||
|
@@ -1054,8 +1054,12 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
|
|||||||
assert(nir_var->constant_initializer != NULL);
|
assert(nir_var->constant_initializer != NULL);
|
||||||
nir_var->data.read_only = true;
|
nir_var->data.read_only = true;
|
||||||
break;
|
break;
|
||||||
|
case SpvDecorationNonReadable:
|
||||||
|
nir_var->data.image.write_only = true;
|
||||||
|
break;
|
||||||
case SpvDecorationNonWritable:
|
case SpvDecorationNonWritable:
|
||||||
nir_var->data.read_only = true;
|
nir_var->data.read_only = true;
|
||||||
|
nir_var->data.image.read_only = true;
|
||||||
break;
|
break;
|
||||||
case SpvDecorationComponent:
|
case SpvDecorationComponent:
|
||||||
nir_var->data.location_frac = dec->literals[0];
|
nir_var->data.location_frac = dec->literals[0];
|
||||||
@@ -1107,7 +1111,6 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
|
|||||||
case SpvDecorationAliased:
|
case SpvDecorationAliased:
|
||||||
case SpvDecorationVolatile:
|
case SpvDecorationVolatile:
|
||||||
case SpvDecorationCoherent:
|
case SpvDecorationCoherent:
|
||||||
case SpvDecorationNonReadable:
|
|
||||||
case SpvDecorationUniform:
|
case SpvDecorationUniform:
|
||||||
case SpvDecorationStream:
|
case SpvDecorationStream:
|
||||||
case SpvDecorationOffset:
|
case SpvDecorationOffset:
|
||||||
|
Reference in New Issue
Block a user