Skip to content

Commit

Permalink
Ignore OpSamplerImageAddressingModeNV pending manual implementation
Browse files Browse the repository at this point in the history
This op is not a normal instruction nor does it fit any of the other
categories such as a constant or type.  Ignore it for now and allow
someone to make a custom implementation down the line.

gfx-rs#226 (comment)
  • Loading branch information
MarijnS95 committed Feb 1, 2022
1 parent 1ade716 commit f5e910b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
8 changes: 6 additions & 2 deletions autogen/src/dr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,11 @@ pub fn gen_dr_builder_types(grammar: &structs::Grammar) -> TokenStream {
let kinds = &grammar.operand_kinds;
// Generate build methods for all types.
let elements = grammar.instructions.iter().filter(|inst| {
inst.class == Some(structs::Class::Type) && inst.opname != "OpTypeForwardPointer" &&
inst.opname != "OpTypePointer" && inst.opname != "OpTypeOpaque"
inst.class == Some(structs::Class::Type)
&& !matches!(
inst.opname.as_str(),
"OpTypeForwardPointer" | "OpTypePointer" | "OpTypeOpaque"
)
}).map(|inst| {
// Parameter list for this build method.
let param_list = get_param_list(&inst.operands, false, kinds);
Expand Down Expand Up @@ -785,6 +788,7 @@ pub fn gen_dr_builder_normal_insts(grammar: &structs::Grammar) -> TokenStream {
| "OpTypeOpaque"
| "OpUndef"
| "OpVariable"
| "OpSamplerImageAddressingModeNV" // https://github.com/gfx-rs/rspirv/pull/226#issuecomment-979469790
) || (inst.class == Some(FunctionStruct) && inst.opname != "OpFunctionCall")
|| is_terminator_instruction(inst)
|| inst.opname.starts_with("OpType");
Expand Down
28 changes: 0 additions & 28 deletions rspirv/dr/build/autogen_norm_insts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14541,34 +14541,6 @@ impl Builder {
self.insert_into_block(insert_point, inst)?;
Ok(_id)
}
#[doc = "Appends an OpSamplerImageAddressingModeNV instruction to the current block."]
pub fn sampler_image_addressing_mode_nv(&mut self, bit_width: u32) -> BuildResult<()> {
#[allow(unused_mut)]
let mut inst = dr::Instruction::new(
spirv::Op::SamplerImageAddressingModeNV,
None,
None,
vec![dr::Operand::LiteralInt32(bit_width)],
);
self.insert_into_block(InsertPoint::End, inst)?;
Ok(())
}
#[doc = "Appends an OpSamplerImageAddressingModeNV instruction to the current block."]
pub fn insert_sampler_image_addressing_mode_nv(
&mut self,
insert_point: InsertPoint,
bit_width: u32,
) -> BuildResult<()> {
#[allow(unused_mut)]
let mut inst = dr::Instruction::new(
spirv::Op::SamplerImageAddressingModeNV,
None,
None,
vec![dr::Operand::LiteralInt32(bit_width)],
);
self.insert_into_block(insert_point, inst)?;
Ok(())
}
#[doc = "Appends an OpSubgroupShuffleINTEL instruction to the current block."]
pub fn subgroup_shuffle_intel(
&mut self,
Expand Down

0 comments on commit f5e910b

Please sign in to comment.