-
Notifications
You must be signed in to change notification settings - Fork 67
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
Image buffers #757
Image buffers #757
Conversation
@@ -137,18 +137,38 @@ END | |||
BUFFER {name} DATA_TYPE {type} {STD140 | STD430} SIZE _size_in_items_ \ | |||
{initializer} | |||
|
|||
# Defines a buffer with width and height and filled by data as specified by the |
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.
Thinking about this, I think we should leave this here and just add a # Deprecated use IMAGE tag
docs/amber_script.md
Outdated
|
||
```groovy | ||
# Specify an image buffer with a format. HEIGHT is necessary for DIM_2D and | ||
DIM_3D. DEPTH is necessary for DIM_3D. |
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.
nit: add # at start of line
docs/amber_script.md
Outdated
{initializer} | ||
|
||
# Specify an image buffer with a data type. HEIGHT is necessary for DIM_2D and | ||
DIM_3D. DEPTH is necessary for DIM_3D. |
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.
ditto
|
||
# Specify an image buffer with a data type. HEIGHT is necessary for DIM_2D and | ||
DIM_3D. DEPTH is necessary for DIM_3D. | ||
IMAGE {name} DATA_TYPE {type} {dimensionality} \ |
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.
Does this accept MIP_LEVELS?
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.
Not currently.
src/amberscript/parser.cc
Outdated
if (!token->IsString()) | ||
return Result("invalid IMAGE command provided"); | ||
|
||
std::unique_ptr<Buffer> buffer; |
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.
Could probably just do:
auto buffer = MakeUnique<Buffer>();
we'd waste the allocation in case of error, but otherwise we always make the buffer this way.
src/amberscript/parser.cc
Outdated
|
||
fmt = MakeUnique<Format>(new_type.get()); | ||
buffer->SetFormat(fmt.get()); | ||
type = new_type.get(); |
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.
Never used?
src/amberscript/parser.cc
Outdated
} else { | ||
return Result("unknown IMAGE command provided: " + cmd); | ||
} | ||
buffer->SetName(name); |
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.
This could then move up with the buffer creation
Contributes to #747
Add support for specifying buffers as images via a new command.
Generalize image support to support 1D and 3D images.
Add some examples of the new functionality.