mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-05 17:01:11 +00:00
[qfcc] Emit base vulkan capabilities
I probably missed some, and I should make the emission more selective, but my vertex shaders all pass spirv-val (probably don't work, though).
This commit is contained in:
parent
1f0d7f249c
commit
5248e5a4ed
2 changed files with 20 additions and 5 deletions
|
@ -1306,6 +1306,21 @@ bool allInvocations(bool value)
|
|||
bool allInvocationsEqual(bool value)
|
||||
#endif
|
||||
|
||||
static SpvCapability glsl_base_capabilities[] = {
|
||||
SpvCapabilityMatrix,
|
||||
SpvCapabilityShader,
|
||||
SpvCapabilityInputAttachment,
|
||||
SpvCapabilitySampled1D,
|
||||
SpvCapabilityImage1D,
|
||||
SpvCapabilitySampledBuffer,
|
||||
SpvCapabilityImageBuffer,
|
||||
SpvCapabilityImageQuery,
|
||||
SpvCapabilityDerivativeControl,
|
||||
SpvCapabilityStorageImageExtendedFormats,
|
||||
SpvCapabilityDeviceGroup,
|
||||
SpvCapabilityShaderNonUniform,
|
||||
};
|
||||
|
||||
void
|
||||
glsl_multiview (int behavior, void *scanner)
|
||||
{
|
||||
|
@ -1374,6 +1389,11 @@ glsl_init_common (rua_ctx_t *ctx)
|
|||
qc_parse_string (glsl_atomic_functions, &rua_ctx);
|
||||
qc_parse_string (glsl_image_functions, &rua_ctx);
|
||||
glsl_parse_vars (glsl_system_constants, ctx);
|
||||
|
||||
for (size_t i = 0; i < countof (glsl_base_capabilities); i++) {
|
||||
auto cap = glsl_base_capabilities[i];
|
||||
spirv_add_capability (pr.module, cap);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1381,8 +1401,6 @@ glsl_init_comp (rua_ctx_t *ctx)
|
|||
{
|
||||
glsl_init_common (ctx);
|
||||
glsl_parse_vars (glsl_compute_vars, ctx);
|
||||
|
||||
spirv_add_capability (pr.module, SpvCapabilityShader);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1393,7 +1411,6 @@ glsl_init_vert (rua_ctx_t *ctx)
|
|||
rua_ctx_t rua_ctx = { .language = &lang_ruamoko };
|
||||
qc_parse_string (glsl_other_texture_functions, &rua_ctx);
|
||||
|
||||
spirv_add_capability (pr.module, SpvCapabilityShader);
|
||||
pr.module->default_model = SpvExecutionModelVertex;
|
||||
}
|
||||
|
||||
|
@ -1443,6 +1460,5 @@ glsl_init_frag (rua_ctx_t *ctx)
|
|||
qc_parse_string (glsl_fragment_functions, &rua_ctx);
|
||||
qc_parse_string (glsl_frag_texture_functions, &rua_ctx);
|
||||
|
||||
spirv_add_capability (pr.module, SpvCapabilityShader);
|
||||
pr.module->default_model = SpvExecutionModelFragment;
|
||||
}
|
||||
|
|
|
@ -3278,7 +3278,6 @@ rua_init (rua_ctx_t *ctx)
|
|||
static module_t module; //FIXME probably not what I want
|
||||
pr.module = &module;
|
||||
|
||||
spirv_add_capability (pr.module, SpvCapabilityShader);
|
||||
//FIXME unhardcode
|
||||
spirv_add_extension (pr.module, "SPV_KHR_multiview");
|
||||
spirv_add_extinst_import (pr.module, "GLSL.std.450");
|
||||
|
|
Loading…
Reference in a new issue