Use of EGL_IMAGE_PRESERVED_KHR attribute - graphics

What is the use of EGL_IMAGE_PRESERVED_KHR attribute in eglCreateImageKHR(EGLDisplay dpy,EGLContext ctx,EGLenum target,EGLClientBuffer buffer,const EGLint *attrib_list)
function? Does it mean that the egl image is double buffered and we can reuse the pixel data for some post processing?

As per the spec:
If the value of attribute EGL_IMAGE_PRESERVED_KHR is EGL_FALSE (the default), then all pixel data values associated with will be undefined after eglCreateImageKHR returns.
If the value of attribute EGL_IMAGE_PRESERVED_KHR is EGL_TRUE, then all pixel data values associated with are preserved."
In other words, if you want to be sure that the content of the original image to be preserved once the eglImage has been created, you need to set this flag to TRUE (else an implementation is free to discard the original content).

Related

Is it able to call multiple drawcalls of vkCmdDrawIndexed in one render pass containing one pipeline?

I have two meshes, containing same material template but with different paramters. I want to draw these two meshes one by one. For example, the pseudocode likes
BeginRenderPass
BindPipeline
for(auto& mesh : meshes)
{
BindVertexBuffers(mesh.vertexBuffer)
AddUniformBufferDescriptorSet(mesh.material)
UpdateDescriptorSets
BindIndexBuffer(mesh.indexBuffer)
DrawIndexed(mesh.indexCount, 1, 0, 0, 0)
}
vkCmdEndRenderPass
I bind vertex buffers of all mesh to same binding index, and use same descriptor set for all uniform object. There are some validation errors:
validation layer: Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidCommandBuffer-VkDescriptorSet ] Object 0: handle = 0x40b43c0000000049, type = VK_OBJECT_TYPE_DESCRIPTOR_SET; Object 1: handle = 0x1c40e53df48, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0xe8616bf2 | You are adding vkCmdBindVertexBuffers() to VkCommandBuffer 0x1c40e53df48[] that is invalid because bound VkDescriptorSet 0x40b43c0000000049[] was destroyed or updated.
How can I implement the above pseudocode ?
There is my finding(WRONG). ~~First, the conclusion is I can not implment mulitple draw calls like the above pseudocode.~~ Because, according to vkUpdateDescriptorSets , it will invalid the command buffer used to bind the descriptor sets, which will disenable record next call. Therefore, the validation error appears.
What I can implement to draw multiple meshes with seperate material parameters.
There are two ways:
Use push_constant in shader to config material parameters, and set the corresponding parameter values by vkCmdPushConstants before draw call.
Use uniform buffer array in shader, where each element is a set of material parameters. Add an additional input attribute named “material id” to index the corresponding uniform buffer. Then update the uniform buffer array in one call of vkUpdateDescriptorSets. The current command buffer still can record next draw call command.
The first way is inspired by Sascha_Willems, the second way is what I have successfully implemented.
Supplement(CORRECTION)
I also try to update and bind the corresponding descriptor set before each of two draw calls insider one render pass. Finally, it works. Note that two seperate descriptor sets with same layout bindings need to be created, but the graphics pipeline need to be decleared to contain only one descriptor set.

Azure datafactory "Set_Variabe" array and "FOR_EACH" exe_pipelines activities

as you can see in the following images, the matrix reaches the activity (Exe_pipeline) completely, but it does not allow separating the values ​​for the different parameters. try a (Split), but it doesn't work.
*img1 activity (for_each) receives array string correctly *Img_2 evidences that it sends the array correctly, but indicating the value to each parameter does not work. example: #item().FileJson *img_3 if I send only #item () if it presents the whole array.
Can someone tell me how to separate the information that comes in item (). other than #item. ???

get default value from Default Value control in Maximo autoscript

In a Maximo 7.6.0 automation script, I can get the default value from the Default Value in Database Configuration with a chain of calls like this:
mbo.getThisMboSet().getMboSetInfo().getMboValueInfo("WONUM").getDefaultValue()
If there is a textbox with inputmode="default", I can get that default value with a chain of calls like this:
mbo.getThisMboSet().getDefaultValue("WONUM")
If there is also a Default Value control in play, what is the chain of calls to get that default value? (The calls above still return the same things.)
It doesn't look like there is an easy way to get this data via some helper method like those. The setAppDefaultValue() method reads these values in and applies them to the MBO at some point during the load or init of the MBO.
According to the JavaDocs for that method (https://developer.ibm.com/static/site-id/155/maximodev/7609/maximocore/businessobjects/psdi/mbo/Mbo.html#setAppDefaultValue()), the data is stored in the appfielddefault table, if you wanted to pursue that route.
Looking through the code of that method, it fetches a few pieces of information and then uses the data dictionary to get all of that default data (via the following line).
/* 7320 */ HashMap defaultAppVal = getMboServer().getMaximoDD().getAppFieldDefaults(appStr.toUpperCase(), getMboSetInfo().getObjectName().toUpperCase(), siteStr, getUserName().toUpperCase(), groupSet);

Get the values form NoUiSlider with two handles

Documentation says to get the current value use slider.noUiSlider.get();. But in case of a slider with two handles (and thus two values), how do I get these two seperate values?
For a slider with two handles, the result of slider.noUiSlider.get() is [firstValue, secondValue]. All events provide this array as a parameter, as well as the handle index (0/1), allowing to map the two.
slider.noUiSlider.on('update', function(values, handle) {
// value for updated handle is in values[handle]
});

Directx 11.2 mipmaps with SharpDX?

I'm using the 11.2 compatible build of SharpDX and have rendering going up well so far, however i'm starting to test things out with large textures and would need mipmaping to avoid the ugly artifacts of higher than screen resolution textures.
From what i understand if i want the full set of mipmap levels i need to set MipLevels to 0 in my texture creation, however, changing the MipLevels parameter from 1 (what it was and works) to 0 (my goal) causes an exception with invalid parameter on the texture instantiation line.
The error has to be at that point or before (crashed before it reaches any rendering and at the step of declaration).
Here's how i'm declaring my texture state :
new SharpDX.Direct3D11.Texture2DDescription()
{
Width = bitmapSource.Size.Width,
Height = bitmapSource.Size.Height,
ArraySize = 1,
BindFlags = SharpDX.Direct3D11.BindFlags.ShaderResource,
Usage = SharpDX.Direct3D11.ResourceUsage.Immutable,
CpuAccessFlags = SharpDX.Direct3D11.CpuAccessFlags.None,
Format = SharpDX.DXGI.Format.R8G8B8A8_UNorm,
MipLevels = 1, // This works, but if i change it to 0, i get an argument invalid exception
OptionFlags = SharpDX.Direct3D11.ResourceOptionFlags.None,
SampleDescription = new SharpDX.DXGI.SampleDescription(1, 0),
}
Since the texture is immutable and being created with a full MIP chain you need to provide initial data for every mip in the chain. I assume you are only providing data for mip 0?
EDIT:
A similar question is asked here: http://www.gamedev.net/topic/605521-mipmap-dx11/
You have a few different options:
1) Generate the mips offline (perhaps store your textures in a DDS, which supports mips) and provide an array of DataRectangles, one for each mip.
2) Remove the Immutable usage flag, use Default instead, don't provide any initial data but instead use something like Map or UpdateSubresource to fill in Mip 0 after it has been created. Once mip 0 is populated, you can call GenerateMips on the DeviceContext so long as the texture was created with the D3D11_RESOURCE_MISC_GENERATE_MIPS MiscFlag, this will populate all other mips with the correct downsampled data.
3) A third approach would be to do something similar to Option 2, but instead you could provide a dummy set of data for all but the first mip and thus avoid the need to call Map or UpdateSubresource. However you will still have to call GenerateMips on the DeviceContext.

Resources