-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Using GraphicsPipelineAbstract for ShaderCache makes vertex_buffer break #1082
Comments
Just for the record, I also tried
|
You can work around the issue by wrapping your buffer in a vec!()
Needing to wrap the buffer in a vec is definitely a bug.
Very confused as to why it was initially implemented as a vec. From the TODO comment, it looks like it might have been implemented as a vec instead of a struct, as a hacky quick implementation? weird. Edit: I dont think that specific line is actually the issue, but its certainly related. |
@rukai thanks, but sadly this isn't enough, because now I get:
|
Hmmm, before seeing this issue I hadn't gotten this working before, so I tried again on my projects and this time I could resolve the issue (I had more practice at resolving rust compiler errors I guess) Maybe take a look at what I did? rukai/incipisphere_renderer@de41a06 |
Thanks a lot, for the inspiration in form of the link and your time! I checked your example and couldn't find a real difference between your approach and mine. So I tried again, this time exactly as you answered:
and then did:
which led to said error. If I do it inline, like suggested by you, it works. I am not sure why I trigger that particular error in case I assign it before, but whatever. Anyway, thanks a lot for your help and your time! I wish you a wonderful Sunday! |
Awesome, no worries. I'll keep the issue open to track the fact that you need a vec, as that sounds like a bug to me. |
Found a relevent issue #709 |
|
Hello!
In regards to: #676
I tried to refactor my rendering pipeline a bit and for that I introduced a ShaderCache. In order to be able to put in the various different types of shaders, I went with
GraphicsPipelineAbstract
, like so:(I tried to leave out unnecessary details, as it wouldn't render without a lot more files anyway)
Before my refactoring attempt the
pipeline_id
was apipeline
of typepub type ChunkShaderPipeline = GraphicsPipeline<SingleBufferDefinition<CubeVoxelVertex>, Box<PipelineLayoutAbstract + Send + Sync>, Arc<RenderPassAbstract + Send + Sync>>;
My
vertex_buffer
is of type:Arc<CpuAccessibleBuffer<[CubeVoxelVertex]>>
.And I imagined rendering to work like this:
But since my change I get:
My first assumption was, that this happens because in
draw_indexed
theVertexSource<V>
was different to thevertices: V
and this is because I lose type-info when casting asGraphicsPipelineAbstract
, so I tried to fiddle with https://docs.rs/vulkano/0.10.0/vulkano/pipeline/trait.GraphicsPipelineAbstract.html#tymethod.inner, but alas this one is not public.I tried a few more things to no avail and now here I am, bothering you, for which I truly am sorry! Maybe someone can enlighten me, because my mistake is probably obvious and really dumb.
The text was updated successfully, but these errors were encountered: