Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
natevm authored Sep 15, 2024
1 parent 79d754a commit b5e3ca5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion source/slang/slang-emit-c-like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3810,7 +3810,8 @@ void CLikeSourceEmitter::emitBitfieldExtractImpl(IRInst* inst)
}

String one;
switch(bitWidth) {
switch(bitWidth)
{
case 8: one = "uint8_t(1)"; break;
case 16: one = "uint16_t(1)"; break;
case 32: one = "uint32_t(1)"; break;
Expand Down
6 changes: 4 additions & 2 deletions source/slang/slang-emit-glsl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2449,7 +2449,8 @@ void GLSLSourceEmitter::emitFuncDecorationImpl(IRDecoration* decoration)
}
}

void GLSLSourceEmitter::emitBitfieldExtractImpl(IRInst* inst) {
void GLSLSourceEmitter::emitBitfieldExtractImpl(IRInst* inst)
{
m_writer->emit("bitfieldExtract(");
emitOperand(inst->getOperand(0), getInfo(EmitOp::General));
m_writer->emit(",");
Expand All @@ -2459,7 +2460,8 @@ void GLSLSourceEmitter::emitBitfieldExtractImpl(IRInst* inst) {
m_writer->emit(")");
}

void GLSLSourceEmitter::emitBitfieldInsertImpl(IRInst* inst) {
void GLSLSourceEmitter::emitBitfieldInsertImpl(IRInst* inst)
{
m_writer->emit("bitfieldInsert(");
emitOperand(inst->getOperand(0), getInfo(EmitOp::General));
m_writer->emit(",");
Expand Down
6 changes: 4 additions & 2 deletions source/slang/slang-emit-spirv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5600,7 +5600,8 @@ struct SPIRVEmitContext
return emitInst(parent, inst, SpvOpConvertUToPtr, inst->getFullType(), kResultID, inst->getOperand(0));
}

SpvInst* emitBitfieldExtract(SpvInstParent* parent, IRInst* inst) {
SpvInst* emitBitfieldExtract(SpvInstParent* parent, IRInst* inst)
{
auto dataType = inst->getDataType();
IRVectorType* vectorType = as<IRVectorType>(dataType);
Slang::IRType* elementType = dataType;
Expand All @@ -5617,7 +5618,8 @@ struct SPIRVEmitContext
inst->getOperand(0), inst->getOperand(1), inst->getOperand(2));
}

SpvInst* emitBitfieldInsert(SpvInstParent* parent, IRInst* inst) {
SpvInst* emitBitfieldInsert(SpvInstParent* parent, IRInst* inst)
{
auto dataType = inst->getDataType();
IRVectorType* vectorType = as<IRVectorType>(dataType);
Slang::IRType* elementType = dataType;
Expand Down

0 comments on commit b5e3ca5

Please sign in to comment.