Skip to content
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

Video decoder #57

Merged
merged 59 commits into from
Dec 14, 2023
Merged

Video decoder #57

merged 59 commits into from
Dec 14, 2023

Conversation

tgfrerer
Copy link
Owner

do not merge - this is just so that we can get an idea of whether anything video-related breaks the build...

+ add a command to commandbuffer encoder that allows the backend to call
a callback giving the currently mapped vulkan command buffer and a
closure as parameters

We can probably find a nicer way to do this, but for now, this should
allow us to execute raw vulkan commands without completely foregoing the
context of the rendergraph.

Note that we do *copy the contents* of the closure into the command
stream, this may not be what you expect when passing user_data, although
having to provide a byte count for user_data should be a big hint that
some copying is going on
return type is the type of the function pointer passed as argument
add a mechanism so that users of the rendergraph can register callbacks
which they want to be triggered once the frame that the rendergraph
describes has completed. (i.e. once the backend clears this frame).

we can use this to manage lifetimes for objects which have objects
currently owned by a backend frame.

for the video decoder, we use an intrusive pointer mechanism for example
so that as long as the video encoder is in use in any frame that frame
has part-ownership of the video encoder and the encoder cannot be
destroyed.

instead, whenever either the frame or another part-owner of the video
decoder relinquishes ownership, we decrement a reference counter in the
video decoder (intrusive smart pointer pattern) until the reference
count has dropped to zero, upon which we can finally really destroy and
deallocate the video decoder, as we know that no more objects depend on
it.
rename get_requested_physical_device_features_chain ->
physical_device_features_chain

+ additionally make the elements in the chain writeable via the
backend::settings interface. we probably want to find a better way to do
this in the future, but this should work for now.
change signature for functions used to resolve resource ids to vulkan
objects so that these may become part of the public api. this means
changing const& into pointer accesses.

i'm not 100% sold on how this looks right now, this probably needs bo be
cleaned up a bit later.
expose frame_data_get_image_from_le_resource_id to private backend api
so that external command buffer processors see le_video_decoder may
resolve available resources on their side.
... in CommandVideoDecoderExecuteCallback
if an unnamed handle is created, create a debug name from the handle's
address. this way we may track unnamed handles in debug printouts, and
.dot files
only show enum values for decode and encode if beta extensions are
available
fix an issue where resource queue family ownership would be forgotten
for resources that were not referenced with the current frame.

a resource belongs to a queue family for as long as it exists - we must
track each resource until it is freed.
add a global VkSamplerYcbcrConversion that gets generated with the
backend, enable VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME by
default, this should be available generally with vulkan 1.1
if you annotate a texture name with "__ycbcr__" in shader code, Island
will understand that this texture is a yuv texture. Instead of using a
default sampler for this texture it will generate a sampler using the
backend's ycbcr conversion sampler. image views generated while binding
this image will also automatically be created using this conversion
sampler info.
if a resource is used with transfer_write access, make sure that an
implicit syc is issued
for some reason we were missing to include <string>
set queueFamilyIndexGraphics to -1 to signal that a graphics queue has
not yet been detected when enumerating possible graphics queues
* add better doc comments to header file
* rename Tick -> le::Ticks
* expose le::Ticks as a private shared type via a private header
remove vk sync commands from write to image implementation, use
rendergraph to resolve sync for image resources.
rename add_on_clear_callback -> add_on_clear_callbacks
if project generator gives template name, make sure that template name
has no trailing path separator
fix handling of trailing slashes in template_name - you must not use
dirname (as this will result in an empty string if there is no trailing
slash), but use rstrip.
since errors cause a breakpoint, we don't want to log shader compiler
errors as errors.
add a debug hint if a resource is found with conflicting definitions.
remove unnecessary static assert
test for video player existence before accessing its pause state
interpret ',' characters if these are inside a value parenthesis as
plain characters
allow to draw 2d primitives using a custom pipeline, if requested
move le_tweakable to its own module - this is much cleaner, and allows
us to treat it just like any other module (in terms of dependencies,
etc.)
LE_SETTING_SHOULD_USE_QUERIES ->
LE_SETTING_SHOULD_USE_VIDEO_STATUS_QUERIES
@tgfrerer tgfrerer merged commit 40d0a14 into wip Dec 14, 2023
3 checks passed
@tgfrerer tgfrerer deleted the video_decoder branch February 2, 2024 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant