Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/osl/services.h
| Show All 16 Lines | |||||
| #include <OSL/rendererservices.h> | #include <OSL/rendererservices.h> | ||||
| #ifdef WITH_PTEX | #ifdef WITH_PTEX | ||||
| class PtexCache; | class PtexCache; | ||||
| #endif | #endif | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class Object; | |||||
| class Scene; | class Scene; | ||||
| class Shader; | |||||
| struct ShaderData; | struct ShaderData; | ||||
| struct float3; | |||||
| struct KernelGlobalsCPU; | struct KernelGlobalsCPU; | ||||
| /* OSL Texture Handle | /* OSL Texture Handle | ||||
| * | * | ||||
| * OSL texture lookups are string based. If those strings are known at compile | * OSL texture lookups are string based. If those strings are known at compile | ||||
| * time, the OSL compiler can cache a texture handle to use instead of a string. | * time, the OSL compiler can cache a texture handle to use instead of a string. | ||||
| * | * | ||||
| * By default it uses TextureSystem::TextureHandle. But since we want to support | * By default it uses TextureSystem::TextureHandle. But since we want to support | ||||
| Show All 30 Lines | typedef OIIO::unordered_map_concurrent<ustring, OSLTextureHandleRef, ustringHash> | ||||
| OSLTextureHandleMap; | OSLTextureHandleMap; | ||||
| /* OSL Render Services | /* OSL Render Services | ||||
| * | * | ||||
| * Interface for OSL to access attributes, textures and other scene data. */ | * Interface for OSL to access attributes, textures and other scene data. */ | ||||
| class OSLRenderServices : public OSL::RendererServices { | class OSLRenderServices : public OSL::RendererServices { | ||||
| public: | public: | ||||
| OSLRenderServices(OSL::TextureSystem *texture_system); | OSLRenderServices(OSL::TextureSystem *texture_system, int device_type); | ||||
| ~OSLRenderServices(); | ~OSLRenderServices(); | ||||
| static void register_closures(OSL::ShadingSystem *ss); | static void register_closures(OSL::ShadingSystem *ss); | ||||
| int supports(string_view feature) const override; | |||||
| bool get_matrix(OSL::ShaderGlobals *sg, | bool get_matrix(OSL::ShaderGlobals *sg, | ||||
| OSL::Matrix44 &result, | OSL::Matrix44 &result, | ||||
| OSL::TransformationPtr xform, | OSL::TransformationPtr xform, | ||||
| float time) override; | float time) override; | ||||
| bool get_inverse_matrix(OSL::ShaderGlobals *sg, | bool get_inverse_matrix(OSL::ShaderGlobals *sg, | ||||
| OSL::Matrix44 &result, | OSL::Matrix44 &result, | ||||
| OSL::TransformationPtr xform, | OSL::TransformationPtr xform, | ||||
| float time) override; | float time) override; | ||||
| ▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | #endif | ||||
| static ustring u_at_bevel; | static ustring u_at_bevel; | ||||
| static ustring u_at_ao; | static ustring u_at_ao; | ||||
| /* Texture system and texture handle map are part of the services instead of | /* Texture system and texture handle map are part of the services instead of | ||||
| * globals to be shared between different render sessions. This saves memory, | * globals to be shared between different render sessions. This saves memory, | ||||
| * and is required because texture handles are cached as part of the shared | * and is required because texture handles are cached as part of the shared | ||||
| * shading system. */ | * shading system. */ | ||||
| OSLTextureHandleMap textures; | OSLTextureHandleMap textures; | ||||
| private: | |||||
| int device_type_; | |||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __OSL_SERVICES_H__ */ | #endif /* __OSL_SERVICES_H__ */ | ||||