I am trying to program the "Graphic Hello World Program" in Vulkan which has the goal to draw a Triangle on the screen.
I am following this Tutorial.
I am getting two types of Errors.
The first Error is:
validation layer: loaderAddLayerProperties: C:\VulkanSDK\1.2.198.1\Bin\VkLayer_api_dump.json invalid layer manifest file version 1.2.0. May cause errors.
validation layer: loaderAddLayerProperties: C:\VulkanSDK\1.2.198.1\Bin\VkLayer_device_simulation.json invalid layer manifest file version 1.2.0. May cause errors.
validation layer: loaderAddLayerProperties: C:\VulkanSDK\1.2.198.1\Bin\VkLayer_gfxreconstruct.json invalid layer manifest file version 1.2.0. May cause errors.
validation layer: loaderAddLayerProperties: C:\VulkanSDK\1.2.198.1\Bin\VkLayer_khronos_synchronization2.json invalid layer manifest file version 1.2.0. May cause errors.
validation layer: loaderAddLayerProperties: C:\VulkanSDK\1.2.198.1\Bin\VkLayer_khronos_validation.json invalid layer manifest file version 1.2.0. May cause errors.
validation layer: loaderAddLayerProperties: C:\VulkanSDK\1.2.198.1\Bin\VkLayer_screenshot.json invalid layer manifest file version 1.2.0. May cause errors.
which I could find in a post on stackoverflow here
but I checked everything the solution is suggesting and the Error is still there.
The second Error is:
validation layer: Validation Error: [ UNASSIGNED-GeneralParameterError-UnrecognizedValue ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xbe6eff91 | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].blendEnable (-858993460) is neither VK_TRUE nor VK_FALSE. Applications MUST not pass any other values than VK_TRUE or VK_FALSE into a Vulkan implementation where a VkBool32 is expected.
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xeb9e690 | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].srcColorBlendFactor (-858993460) does not fall within the begin..end range of the core VkBlendFactor enumeration tokens and is not an extension added token. The Vulkan spec states: srcColorBlendFactor must be a valid VkBlendFactor value (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-srcColorBlendFactor-parameter)
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x8db942fe | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].dstColorBlendFactor (-858993460) does not fall within the begin..end range of the core VkBlendFactor enumeration tokens and is not an extension added token. The Vulkan spec states: dstColorBlendFactor must be a valid VkBlendFactor value (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-dstColorBlendFactor-parameter)
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x7978ef4f | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].colorBlendOp (-858993460) does not fall within the begin..end range of the core VkBlendOp enumeration tokens and is not an extension added token. The Vulkan spec states: colorBlendOp must be a valid VkBlendOp value (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-colorBlendOp-parameter)
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x4a7f8ed8 | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].srcAlphaBlendFactor (-453845144) does not fall within the begin..end range of the core VkBlendFactor enumeration tokens and is not an extension added token. The Vulkan spec states: srcAlphaBlendFactor must be a valid VkBlendFactor value (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-srcAlphaBlendFactor-parameter)
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x53ab1c8f | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].dstAlphaBlendFactor (569) does not fall within the begin..end range of the core VkBlendFactor enumeration tokens and is not an extension added token. The Vulkan spec states: dstAlphaBlendFactor must be a valid VkBlendFactor value (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-dstAlphaBlendFactor-parameter)
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-alphaBlendOp-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x48f9f9b | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].alphaBlendOp (-1467165950) does not fall within the begin..end range of the core VkBlendOp enumeration tokens and is not an extension added token. The Vulkan spec states: alphaBlendOp must be a valid VkBlendOp value (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-alphaBlendOp-parameter)
validation layer: Validation Error: [ VUID-VkPipelineColorBlendAttachmentState-colorWriteMask-parameter ] Object 0: handle = 0x239e0488218, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xb8f9c032 | vkCreateGraphicsPipelines: value of pCreateInfos[0].pColorBlendState->pAttachments[0].colorWriteMask contains flag bits that are not recognized members of VkColorComponentFlagBits The Vulkan spec states: colorWriteMask must be a valid combination of VkColorComponentFlagBits values (https://vulkan.lunarg.com/doc/view/1.2.198.1/windows/1.2-extensions/vkspec.html#VUID-VkPipelineColorBlendAttachmentState-colorWriteMask-parameter)
failed to submit draw command buffer!
I found a post on reddit which describes a similar problem here but the post isnt solved.
The failed to submit draw command buffer! message is thrown by a std::runtime_error caused by a false returnvalue of
vkQueueSubmit(device.graphicsQueue(), 1, &submitInfo, inFlightFences[currentFrame])
Some additional information which my program prints out between this two Error Messages:
available extensions:
VK_KHR_device_group_creation
VK_KHR_external_fence_capabilities
VK_KHR_external_memory_capabilities
VK_KHR_external_semaphore_capabilities
VK_KHR_get_physical_device_properties2
VK_KHR_get_surface_capabilities2
VK_KHR_surface
VK_KHR_surface_protected_capabilities
VK_KHR_win32_surface
VK_EXT_debug_report
VK_EXT_debug_utils
VK_EXT_swapchain_colorspace
VK_NV_external_memory_capabilities
required extensions:
VK_KHR_surface
VK_KHR_win32_surface
VK_EXT_debug_utils
Device count: 1
physical device: GeForce RTX 2060 SUPER
Present mode: Mailbox
I am using Windows 10.
First error(s) is normal if your driver's Loader is old. It should be benign. See "Known Issues" in the documentation.
The second error(s) seems to be caused by pCreateInfos[0].pColorBlendState->pAttachments[0] member not existing in your code or being uninitialized.
The third error is probably a result of the second error (failing to create or creating an invalid Pipeline).
Related
I am working on a IPP-FAX client.
I am using the ippserver stuff from: https://github.com/istopwg/ippsample.git
I have a small configuration that provides two printers.
However, when I use the fax-job.test from the library, my client receives the phone number: IPP_DESTINATION_URIS='{destination-uri=tel:4055551212},{destination-uri=ipp://11.22.33.44/ipp/print print-quality=high media=na_letter_8.5x11in}'
As expected.
But: when I use the same ipp-device as a fax from apple's printer menues, the pages are sent, but the destination-uri are not send (not included in the IPP transmission).
I am using the following in the service:
[root#Comp ~/Printing/ippsample3]# perl -ne 's/#.*//; print unless /^\s*$/' t2/print/faxout.conf
MAKE "thilo"
MODEL "(GPL Ghostscript)"
DeviceURI ipp://Comp.local/ipp/print
Attr textWithoutLanguage printer-device-id "MFG:XSimulated;MDL:Fax;CMD:URF;URF:W8,SRGB24,CP255,PQ4,RS200-300-600,V1.4;MINSIZE:1x5in;MAXSIZE:8.5x14in;TEST-MARGINS:0 0 0 0;TEST-NO-PNG:1;TEST-NO-PDF:1;TEST-FAX:1;"
Command /root/Printing/ippsample3/hell.sh
ATTR keyword urf-supported "W8","SRGB24","ADOBERGB24-48","DM3","CP255","OFU0","IS1-4-5-7","IFU0","MT1-2-3-7-8-9-10-11-12","OB9","PQ3-4-5","RS300-600","V1.4"
ATTR keyword job-creation-attributes-supported "copies","confirmation-sheet-print","cover-sheet-info","destination-uris","media","media-col","multiple-document-handling","number-of-retries","page-ranges","print-quality","printer-resolution","retry-interval","retry-time-out"
ATTR uriScheme destination-uri-schemes-supported "tel"
ATTR boolean ipp-attribute-fidelity true
ATTR boolean confirmation-sheet-print-default false
ATTR integer number-of-retries-default 1
ATTR integer retry-interval-default 15
ATTR keyword cover-sheet-info-supported "date-time","from-name","subject","to-name","message"
ATTR no-value cover-sheet-info-default
ATTR rangeOfInteger number-of-retries-supported 0-1
ATTR rangeOfInteger retry-interval-supported 15-60
ATTR uri printer-icons "http://Comp.local:8632/icons/fax.png","http://Comp.local:8632/icons/large/fax.png"
ATTR uri printer-more-info "http://Comp.local:8632/"
ATTR uri printer-supply-info-uri "http://Comp.local:8632/"
ATTR uri printer-uuid "urn:uuid:3f63711e-bcc3-3570-707e-cc14008da4b6"
ATTR keyword uri-authentication-supported "none","none"
ATTR keyword uri-security-supported "tls","tls"
ATTR uri printer-geo-location "geo:37.33182,122.03118"
ATTR uri device-uri "urf:///1+1"
from reading http://ftp.pwg.org/pub/pwg/candidates/cs-ippfaxout10-20140618-5100.15.pdf . I understand that the destination-uris would be mandatory in the job descriptor.
I either fail to teach the IPP-server to require if from the client, or I fail to configure the client correctly.
From: https://github.com/michaelrsweet/libcups/raw/f06f42779f98073e2ba782a7a73ebf54636b60d0/examples/fax-job.test
GROUP job-attributes-tag
ATTR collection destination-uris {
MEMBER uri destination-uri tel:4055551212
},{
MEMBER uri destination-uri ipp://11.22.33.44/ipp/print
MEMBER enum print-quality 5
MEMBER keyword media na_letter_8.5x11in
}
Any hints how the service should be configured to make apple printer also send this scheme?
It seems, that once the faxout uri is changed in the server sources to use '/ipp/faxout' instead of the (I think also standard compliant) /ipp/print/faxout, Apple is sending the destination-uri
and the script gets the environment variable: IPP_DESTINATION_URIS='{destination-uri=tel:1234567890123456}
as expected.
When I run this code:
$client->evaluate('
box.session.settings.error_marshaling_enabled = false
box.error{code = 42, reason = "Foobar", type = "MyError"}
');
regardless of the value of error_marshaling_enabled I always get a response with a new (extended) error format:
[
49 => 'Foobar',
82 => [
0 => [
0 => [
0 => 'CustomError',
2 => 3,
1 => 'eval',
3 => 'Foobar',
4 => 0,
5 => 42,
6 => [
'custom_type' => 'MyError',
],
],
],
],
],
Why is that?
Short answer.
error_marshaling_enabled option affects only how error objects are encoded in response body (48, IPROTO_DATA). It does not affect how they are returned as exceptions, in the response header (82, IPROTO_ERROR).
Long answer.
In Tarantool an error object can be returned in 2 ways: as an exception and as an object. For example, this is how to throw an error as exception:
function throw_error()
box.error({code = 1000, reason = "Error message"})
-- Or
error('Some error string')
end
This is how to return it as an object:
function return_error()
return box.error.new({code = 1000, reason = "Error message"})
end
If the function was called remotely, using IPROTO protocol via a connector like netbox, or PHP connector, or any other one, the error return way affects how it is encoded into MessagePack response packet. When the function throws, and the error reaches the top stack frame without being caught, it is encoded as IPROTO_ERROR (82) and IPROTO_ERROR_24 (49).
When the error object is returned as a regular value, not as an exception, it is encoded also as a regular value, inside IPROTO_DATA (48). Just like a string, a number, a tuple, etc.
With encoding as IPROTO_ERROR/IPROTO_ERROR_24 there is no much of a configuration space. Format of these values can't be changed. IPROTO_ERROR is always returned as a MessagePack map, with a stack of errors in it. IPROTO_ERROR_24 is always an error message. The IPROTO_ERROR_24 field is kept for compatibility with connectors to Tarantool versions < 2.4.1.
With encoding as a part of IPROTO_DATA you can choose serialization way using error_marshaling_enabled option. When it is true, errors are encoded as MessagePack extension type MP_EXT, and contain the whole error stack, encoded exactly like IPROTO_ERROR value. When the option is false (default behaviour in 2.4.1), the error is encoded as a string, MP_STR, which is the error's message. If there is a stack of errors, only the newest error is encoded.
error_marshaling_enabled option exists for backward compatibility, in case your application on Tarantool wants to be compatible with old connectors, which don't support MP_EXT encoded errors.
In Tarantool < 2.4.1 errors were encoded into result MessagePack as a string with error message, and error stacks didn't exist at all. So when the new format and the error stacks feature were introduced, making the new format default would be a too radical change breaking the old connectors.
Consider these examples of how error marshaling affects results. I use Tarantool 2.4.1 console here, and built-in netbox connector. The code below can be copy pasted into the console.
First instance:
box.cfg{listen = 3313}
box.schema.user.grant('guest', 'super')
function throw_error()
box.error({code = 1000, reason = "Error message"})
end
function return_error()
return box.error.new({code = 1000, reason = "Error message"})
end
Second instance:
netbox = require('net.box')
c = netbox.connect(3313)
Now I try to call the function on the second instance:
tarantool> c:call('throw_error')
---
- error: Error message
...
The c:call('throw_error') threw an exception. If I catch it using pcall() Lua function, I will see the error object.
tarantool> ok, err = pcall(c.call, c, 'throw_error')
tarantool> err:unpack()
---
- code: 1000
base_type: ClientError
type: ClientError
message: Error message
trace:
- file: '[string "function throw_error()..."]'
line: 2
...
As you can see, I didn't set error_marshaling_enabled, but got the full error. Now I will call the other function, without exceptions. But the error object won't be full.
tarantool> err = c:call('return_error')
tarantool> err
---
- Error message
...
tarantool> err:unpack()
---
- error: '[string "return err:unpack()"]:1: attempt to call method ''unpack'' (a nil
value)'
...
The error was returned as a mere string, error message. Not as an error object. Now I will turn on the marshaling:
tarantool> c:eval('box.session.settings.error_marshaling_enabled = true')
---
...
tarantool> err = c:call('return_error')
---
...
tarantool> err:unpack()
---
- code: 1000
base_type: ClientError
type: ClientError
message: Error message
trace:
- file: '[C]'
line: 4294967295
...
Now the same function returned the error in the new format, more featured.
On the summary: error_marshaling_enabled affects only returned errors. Not thrown errors.
the drf_yasg swagger generator doesnt take TYPE_ARRAY as a valid parameter type.
the implementation is as follows
from drf_yasg import openapi
param1 = openapi.Parameter('param_name',
in_=openapi.IN_QUERY,
description='description of param',
type=openapi.TYPE_ARRAY,
required=True
)
whereas the documentation of drf_yasg suggests that it takes openapi.TYPE_ARRAY as valid type.
the error that the generators throws is
File "/usr/local/lib/python3.6/dist-packages/drf_yasg/codecs.py", line 73, in encode
raise SwaggerValidationError("spec validation failed", errors, spec, self)
drf_yasg.errors.SwaggerValidationError: spec validation failed
is there some configuration that i am missing or something because TYPE_STRING,TYPE_NUMBER works perfectly fine.
A Parameter of TYPE_ARRAY requires the items key:
param1 = openapi.Parameter('param_name',
in_=openapi.IN_QUERY,
description='description of param',
type=openapi.TYPE_ARRAY,
items=openapi.Items(type=openapi.TYPE_STRING) # <------
required=True
)
See the OpenAPI 2.0 specification for more details.
I am using a combination of API Blueprint and Dredd to test an API my application is dependent on. I am using attributes in API blueprint to define the structure of the response's body.
Apparently I'm missing something though because the tests always pass even though I've purposefully defined a fake "required" parameter that I know is missing from the API's response. It seems that Dredd is only testing whether the type of the response body (array) rather than the type and the parameters within it.
My API Blueprint file:
FORMAT: 1A
HOST: http://somehost.net
# API Title
## Endpoints [GET /endpoint/{date}]
+ Parameters
+ date: `2016-09-01` (string, required) - Date
+ Response 200 (application/json; charset=utf-8)
+ Attributes (array[Data])
## Data Structures
### Data
- realParameter: 2432432 (number)
- realParameter2: `some string` (string, required)
- realParameter3: `Something else` (string, required)
- realParameter4: 1 (number, required)
- fakeParam: 1 (number, required)
The response body:
[
{
"realParameter": 31,
"realParameter2": "some value",
"realParameter3": "another value",
"realParameter4": 8908
},
{
"realParameter": 54,
"realParameter2": "something here",
"realParameter3": "and here too",
"realParameter4": 6589
}
]
And my Dredd config file:
reporter: apiary
custom:
apiaryApiKey: somekey
apiaryApiName: somename
dry-run: null
hookfiles: null
language: nodejs
sandbox: false
server: null
server-wait: 3
init: false
names: false
only: []
output: []
header: []
sorted: false
user: null
inline-errors: false
details: false
method: []
color: true
level: info
timestamp: false
silent: false
path: []
blueprint: myApiBlueprintFile.apib
endpoint: 'http://ahost.com'
Does anyone have any idea why Dredd ignores the fact that "fakeParameter" doesn't actually show up in the response body and still allows the test to pass?
You've run into a limitation of MSON, the language API Blueprint uses for describing attributes. In many cases, MSON describes what MAY be present in the data structure rather than what MUST exactly be present.
The most prominent case are arrays, where basically any content of the array is optional and thus the underlying generated JSON Schema doesn't put any constraints on array contents. Dredd just respects that, so indirectly it becomes a Dredd issue too, however there's not much Dredd can do about it.
There's an issue for the problem: apiaryio/mson#66 You can follow and comment under the issue to get updated about this. Dredd is usually very prompt in getting the latest API Blueprint parser, so once it's implemented in the language itself, it won't take long to appear in Dredd.
Obvious (but tedious) workaround is to specify your own JSON Schema with stricter rules using the + Schema section alongside the + Attributes section.
When I invoke
App.store.createRecord(App.User, { name: this.get("name") });
App.store.commit();
how do I know if its successful and how to wait for the asyn message?
Very limited error handling was recently added to DS.RESTAdapter in ember-data master.
When creating or updating records (with bulk commit disabled) and a status code between 400 and 599 is returned, the following will happen:
A 422 Unprocessable Entity will transition the record to the "invalid" state and will add any errors returned from the server to the record's errors property.
The adapter assumes the server will respond with JSON in the following format:
{
errors: {
name: ["can't be blank"],
password: ["must be at least 8 characters", "must contain a number"]
{
}
(The error messages themselves could be arrays of strings or just strings. ember-data doesn't currently care which.)
To detect this state:
record.get('isValid') === false
All other status codes will transition the record to the "error" state.
To detect this state, use:
record.get('isError') === true
More cases may eventually be handled by ember-data out of the box, but for the moment if you need something specific, you'll have to extend DS.RESTAdapter, customizing its didError function to add it in yourself.