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

New spirv introspection #677

Closed
wants to merge 0 commits into from
Closed

New spirv introspection #677

wants to merge 0 commits into from

Conversation

Przemog1
Copy link
Contributor

No description provided.

outBinding.type = binding.type;
outBinding.stageFlags = binding.stageMask;
outBinding.createFlags = ICPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_NONE;
// TODO: outBinding.samplers

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you cannot use immutable samplers, because HLSL doesn't give you any info about what such a sampler should be.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SPIR-V in general doesn't

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the TODO and correct the comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done?

}
else
{
getTypeStore()->typeName = addString("TODO");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could actually find the name of a type because whenever one defines a type in SPIR-V they use OpType... which gives them a result ID (integer)

in vec4 color1;
in vec4 multiplier;
noperspective in vec4 color2;
out vec4 color;

struct S {
    bool b;
    vec4 v[5];
    int i;
};

uniform blockName {
    S s;
    bool cond;
};

this is the SPIR-V that generates them

          %6 = OpTypeFloat 32                         ; 32-bit float
          %7 = OpTypeVector %6 4                      ; vec4

         %10 = OpConstant %6 1
         %11 = OpConstant %6 2

         %13 = OpTypeInt 32 0                         ; 32-bit int, sign-less
         %14 = OpConstant %13 5
         %15 = OpTypeArray %7 %14
         %16 = OpTypeInt 32 1
         %17 = OpTypeStruct %13 %15 %16
         %18 = OpTypeStruct %17 %13

and in the debug info you'll have

               OpName %17 "S"
               OpMemberName %17 0 "b"
               OpMemberName %17 1 "v"
               OpMemberName %17 2 "i"
               OpName %18 "blockName"
               OpMemberName %18 0 "s"
               OpMemberName %18 1 "cond"

Note that depending on the compiler, anything thats an OpTypeFloat, OpTypeInt, OpTypeVector or OpTypeArray might not get debug names so we should probably build outselves.

You don't need to do all this right now, because I want you to progress to other tasks, but would be good to write it up here and open a GH issue about it for later fixing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this as a block comment on this line

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add the concents of the first comment as block comment on this line

<< "id: " << specConstant.id << " byte size: " << "TODO: specConstant.defaultValue" << '\n';
}
{
// TODO: it gives weird errors, debug

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe doesn't have \0 at end of span OR it was forgotten about during the mutable->imutable conversion from based_span to regular span

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed?

Copy link
Contributor Author

@Przemog1 Przemog1 May 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, will commit soon

Comment on lines 1 to 30
{
"cmake" :
{
"buildModes" : [],
"configurations" : [ "Release", "Debug", "RelWithDebInfo" ],
"requiredOptions" : []
},
"enableParallelBuild" : true,
"input" :
{
"data" :
[
{
"command" : "../bin/nsc.exe",
"dependencies" : []
}
],
"dependencies" : []
},
"isExecuted" : true,
"profile" :
{
"backend" : "vulkan",
"buildModes" : [],
"gpuArchitectures" : [],
"platform" : "windows",
"runConfiguration" : "Release"
},
"scriptPath" : "../test/test.py",
"threadsPerBuildProcess" : 2

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove these files, they're temp

@devshgraphicsprogramming
Copy link
Member

you've accidentally added the OpenSSL module back

@Przemog1 Przemog1 closed this May 24, 2024
@devshgraphicsprogramming devshgraphicsprogramming deleted the new_spirv_introspectionn branch May 24, 2024 19:22
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.

None yet

2 participants