Merged
Conversation
Collaborator
Author
|
@hevrard I think this should work .... |
dneto0
requested changes
Feb 20, 2019
Collaborator
dneto0
left a comment
There was a problem hiding this comment.
Seems like a buffer overrun?
Less seriously: can do the vector-to-string conversion more efficiently, with less code.
samples/amber.cc
Outdated
| if (!options.image_filename.empty()) { | ||
| std::string image; | ||
| bool usePNG = options.image_filename.compare( | ||
| options.image_filename.length() - 5, options.image_filename.length(), |
Collaborator
There was a problem hiding this comment.
What if the string is very short, e.g. length is 2, then 2-5 is large negative that is then converted to unsigned.... out of bounds?
|
|
||
| namespace { | ||
|
|
||
| unsigned char byte0(uint32_t word) { |
Collaborator
There was a problem hiding this comment.
Normally I'd ask for uint8_t here. But lodepng wants a vector of unsigned char. So I'll let this pass.
samples/png.cc
Outdated
| nullptr); | ||
| } | ||
|
|
||
| std::string image; |
Collaborator
There was a problem hiding this comment.
Would recommend this instead:
std::string image(png.data(), png.size())
Collaborator
Author
There was a problem hiding this comment.
std::string(png.begin(), png.end()) works
dneto0
approved these changes
Feb 20, 2019
Closed
dneto0
added a commit
to dneto0/amber
that referenced
this pull request
Dec 8, 2022
KhronosGroup/SPIRV-Headers@0bcc624...1d31a10 $ git log 0bcc62492..1d31a1004 --date=short --no-merges --format='%ad %ae %s' 2022-12-01 admin Update spir-v.xml 2022-12-01 admin Update spir-v.xml 2022-11-25 stephen.clarke Update spir-v.xml 2022-11-17 admin Register Taichi as SPIR-V generator 2022-11-16 dmitry.sidorov Remove unnecessary extensions addition 2022-11-14 alele Remove extension 2022-11-07 alele Fix typo. 2022-11-07 alele Review feedback 1. 2022-11-04 dneto Revert "Merge pull request google#301 from alan-baker/hpp1" (google#302) 2022-11-03 alanbaker Add spirv.hpp11 to BUILD.gn 2022-10-05 alele Add headers for SPV_NV_shader_invocation_reorder. 2022-10-17 dmitry.sidorov Add SPV_INTEL_runtime_aligned 2022-10-17 dmitry.sidorov Add SPV_INTEL_fpga_dsp_control 2022-10-17 dmitry.sidorov Add SPV_INTEL_fpga_invocation_pipelining_attributes 2022-10-17 dmitry.sidorov Update SPV_INTEL_fpga_loop_controls to rev I 2022-10-05 dkoch Fix extension for RayTracingOpacityMicromapEXT 2022-10-04 kpet Add support for texel buffers to clspv non-semantic instruction set 2022-10-04 hugo registered ID for Shady 2022-08-23 ewerness VK_EXT_opacity_micromap 2021-11-29 kevin.petit Add definitions for SPV_ARM_core_builtins 2021-08-23 pmistry Implement headers definitions for SPV_EXT_mesh_shader. 2022-07-27 jeremy Remove custom target if skipping install Created with: roll-dep third_party/spirv-headers
dneto0
added a commit
to dneto0/amber
that referenced
this pull request
Dec 9, 2022
KhronosGroup/SPIRV-Headers@0bcc624...1d31a10 $ git log 0bcc62492..1d31a1004 --date=short --no-merges --format='%ad %ae %s' 2022-12-01 admin Update spir-v.xml 2022-12-01 admin Update spir-v.xml 2022-11-25 stephen.clarke Update spir-v.xml 2022-11-17 admin Register Taichi as SPIR-V generator 2022-11-16 dmitry.sidorov Remove unnecessary extensions addition 2022-11-14 alele Remove extension 2022-11-07 alele Fix typo. 2022-11-07 alele Review feedback 1. 2022-11-04 dneto Revert "Merge pull request google#301 from alan-baker/hpp1" (google#302) 2022-11-03 alanbaker Add spirv.hpp11 to BUILD.gn 2022-10-05 alele Add headers for SPV_NV_shader_invocation_reorder. 2022-10-17 dmitry.sidorov Add SPV_INTEL_runtime_aligned 2022-10-17 dmitry.sidorov Add SPV_INTEL_fpga_dsp_control 2022-10-17 dmitry.sidorov Add SPV_INTEL_fpga_invocation_pipelining_attributes 2022-10-17 dmitry.sidorov Update SPV_INTEL_fpga_loop_controls to rev I 2022-10-05 dkoch Fix extension for RayTracingOpacityMicromapEXT 2022-10-04 kpet Add support for texel buffers to clspv non-semantic instruction set 2022-10-04 hugo registered ID for Shady 2022-08-23 ewerness VK_EXT_opacity_micromap 2021-11-29 kevin.petit Add definitions for SPV_ARM_core_builtins 2021-08-23 pmistry Implement headers definitions for SPV_EXT_mesh_shader. 2022-07-27 jeremy Remove custom target if skipping install Created with: roll-dep third_party/spirv-headers
dneto0
added a commit
to dneto0/amber
that referenced
this pull request
Dec 10, 2022
KhronosGroup/SPIRV-Headers@0bcc624...1d31a10 $ git log 0bcc62492..1d31a1004 --date=short --no-merges --format='%ad %ae %s' 2022-12-01 admin Update spir-v.xml 2022-12-01 admin Update spir-v.xml 2022-11-25 stephen.clarke Update spir-v.xml 2022-11-17 admin Register Taichi as SPIR-V generator 2022-11-16 dmitry.sidorov Remove unnecessary extensions addition 2022-11-14 alele Remove extension 2022-11-07 alele Fix typo. 2022-11-07 alele Review feedback 1. 2022-11-04 dneto Revert "Merge pull request google#301 from alan-baker/hpp1" (google#302) 2022-11-03 alanbaker Add spirv.hpp11 to BUILD.gn 2022-10-05 alele Add headers for SPV_NV_shader_invocation_reorder. 2022-10-17 dmitry.sidorov Add SPV_INTEL_runtime_aligned 2022-10-17 dmitry.sidorov Add SPV_INTEL_fpga_dsp_control 2022-10-17 dmitry.sidorov Add SPV_INTEL_fpga_invocation_pipelining_attributes 2022-10-17 dmitry.sidorov Update SPV_INTEL_fpga_loop_controls to rev I 2022-10-05 dkoch Fix extension for RayTracingOpacityMicromapEXT 2022-10-04 kpet Add support for texel buffers to clspv non-semantic instruction set 2022-10-04 hugo registered ID for Shady 2022-08-23 ewerness VK_EXT_opacity_micromap 2021-11-29 kevin.petit Add definitions for SPV_ARM_core_builtins 2021-08-23 pmistry Implement headers definitions for SPV_EXT_mesh_shader. 2022-07-27 jeremy Remove custom target if skipping install Created with: roll-dep third_party/spirv-headers
This file contains hidden or 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
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.
This change adds support to dump image to PNG format, it relies on the
third party 'lodepng' library (zlib license).
This CL is based on Pull #301 by @hevrard.