-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pr/batched test shade #1298
Merged
lgritz
merged 17 commits into
AcademySoftwareFoundation:master
from
AlexMWells:PR/BatchedTestShade
Nov 16, 2020
Merged
Pr/batched test shade #1298
lgritz
merged 17 commits into
AcademySoftwareFoundation:master
from
AlexMWells:PR/BatchedTestShade
Nov 16, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Conflicts: src/include/OSL/mask.h
to store upto WidthT instances of ShaderGlobal data. The data for a batch is broken into underlying uniform and varying data structures. Uniform contains a fixed set of shader global values that are shared between all instances. Varying has Block<DataT, WidthT> members so each instance can hold a different value. The Block data structure is specialized to hold the underlying data type in a SIMD friendly Structure of Arrays (SOA) data layout but provides an array subscript interface to a proxy that can import/export the DataT in its orignal data layout. Introduce template<int WidthT> class ShadingSystem::BatchedExecutor as an interface to execute batches of shader globals through a shader network. BatchedExecutor provides similar execute methods that accept a BatchedShaderGlobals and batchSize instead of individual ShaderGlobal(s). This is just the interface, batched backend implemention to follow in subsequent pull requests. Introduce template<typename DataT, int WidthT> Wide to hold a reference to Block<DataT, WidthT> and provide access to the underlying SOA data layout. Wide can handle array types and const correctness. The Wide adapter is lightweight and can be copied by value, used as function parameter. Once batched execution finishes, the resulting symbol address can be passed to a Wide<DataT, Width> to access the resulting data in a type safe manner. Updated testshade with command line option "--batched" causing batched execution of 16 or 8 instances through the shader network and to extract the results. A later pull request will add batched interface to renderer services.
…ich has no overload for double
… during SIMD execution, BatchedTextureOptions, Masked<typename DataT, int WidthT>
Conflicts: src/include/OSL/wide.h
Conflicts: src/include/OSL/oslexec.h src/include/OSL/wide.h
…ions is_overriden_*(). Improved some comments for BatchedRendererServices.h Workaround some QT macro issues.
…its methods are never directly called. Fixed up issues with OSL_USING_DATA_WIDTH(WIDTH) macro.
…and ::first_on() Moved documentation for Wide, Masked, and other classes in wide.h from top overview to be near class definition. Fixed some typos.
lgritz
approved these changes
Nov 16, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement BatchedSimpleRenderer for TestShade.
Derives from BatchedRendererServices and make use of
Masked<typename DataT, int WidthT>
wrappers andMaskedData<WidthT>
andRefData
wrappers for variant data. Provides examples usages of these encapsulations, intent is actual data served up through the BatchedSimpleRenderer matches that of SimpleRenderer so the same unit tests could eventually work in -batched mode. This means any changes made in SimpleRenderer shoud be mimicked in BatchedSimpleRenderer. The BatchedSimpleRenderer does pull its values from the SimpleRenderer instance and adapts them to varying or uniform parameters of its methods.A conscious decision was made to duplicate some code vs. refactoring SimpleRenderer to share.