Skip to content

[spirv] PR #2773 prevents usage of discard without SPV_EXT_demote_to_helper_invocation #2823

@awefers

Description

@awefers

PR #2773 (commit f6057fb) did add support for SPV_EXT_demote_to_helper_invocation. The side effect of this change is that usage of the discard keyword now requires the availability of the extension VK_EXT_shader_demote_to_helper_invocation. This breaks shaders that are using discard on devices that do not support this extension, like for example Android devices that cannot add retroactively support for this new SPIRV opcode/extension. As a work-around, can the requirement for SPV_EXT_demote_to_helper_invocation be relaxed so that it is optional instead of mandatory? Ie. only emit OpDemoteToHelperInvocationEXT if "-fspv-extension=SPV_EXT_demote_to_helper_invocation" is passed as compiler option. If it it is not specified, emit OpKill like in the past and do not throw the compiler error "error: SPIR-V extension "SPV_EXT_demote_to_helper_invocation" required for discard but not permitted to use"?

Metadata

Metadata

Assignees

Labels

spirvWork related to SPIR-V

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions