Skip to content

Commit 9fb2c77

Browse files
committed
oiio3
Signed-off-by: Larry Gritz <[email protected]>
1 parent fd8de3c commit 9fb2c77

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/liboslexec/batched_llvm_gen.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,6 +4426,27 @@ llvm_batched_texture_options(BatchedBackendLLVM& rop, int opnum,
44264426
continue; \
44274427
}
44284428

4429+
#define PARAM_UNIFORM_STRING_INT_CODE(paramname, decoder, llvm_decoder, \
4430+
fieldname) \
4431+
if (name == Strings::paramname && valtype == TypeDesc::STRING) { \
4432+
if (valIsVarying) { \
4433+
is_##fieldname##_uniform = false; \
4434+
continue; \
4435+
} \
4436+
llvm::Value* val = nullptr; \
4437+
if (Val.is_constant()) { \
4438+
int mode = int(decoder(Val.get_string())); \
4439+
val = rop.ll.constant(mode); \
4440+
} else { \
4441+
val = rop.llvm_load_value(Val); \
4442+
llvm::Value* scalar_value_uh \
4443+
= rop.ll.call_function("osl_gen_ustringhash_pod", val); \
4444+
val = rop.ll.call_function(#llvm_decoder, scalar_value_uh); \
4445+
} \
4446+
fieldname = val; \
4447+
continue; \
4448+
}
4449+
44294450
if (name == Strings::wrap && valtype == TypeDesc::STRING) {
44304451
if (valIsVarying) {
44314452
is_swrap_uniform = false;

0 commit comments

Comments
 (0)