mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-06 01:11:59 +00:00
[qfcc] Emit the MultiView capability when enabled
Yet another validation error bites the dust.
This commit is contained in:
parent
0f34e69aeb
commit
1e58ca394b
5 changed files with 15 additions and 6 deletions
|
@ -37,6 +37,7 @@ typedef struct specifier_s specifier_t;
|
|||
typedef struct rua_ctx_s rua_ctx_t;
|
||||
|
||||
typedef struct {
|
||||
void (*init) (void);
|
||||
bool (*value_too_large) (const type_t *val_type);
|
||||
void (*build_scope) (symbol_t *fsym);
|
||||
void (*build_code) (function_t *func, const expr_t *statements);
|
||||
|
|
|
@ -1405,6 +1405,7 @@ void
|
|||
glsl_multiview (int behavior, void *scanner)
|
||||
{
|
||||
if (behavior) {
|
||||
spirv_add_capability (pr.module, SpvCapabilityMultiView);
|
||||
rua_parse_define ("GL_EXT_multiview 1\n");
|
||||
} else {
|
||||
rua_undefine ("GL_EXT_multiview", scanner);
|
||||
|
@ -1441,9 +1442,6 @@ glsl_parse_vars (const char *var_src, rua_ctx_t *ctx)
|
|||
static void
|
||||
glsl_init_common (rua_ctx_t *ctx)
|
||||
{
|
||||
static module_t module; //FIXME probably not what I want
|
||||
pr.module = &module;
|
||||
|
||||
spirv_set_addressing_model (pr.module, SpvAddressingModelLogical);
|
||||
spirv_set_memory_model (pr.module, SpvMemoryModelGLSL450);
|
||||
|
||||
|
|
|
@ -3281,9 +3281,6 @@ rua_init (rua_ctx_t *ctx)
|
|||
{
|
||||
ctx->language->initialized = true;
|
||||
if (options.code.spirv && !pr.module) {
|
||||
static module_t module; //FIXME probably not what I want
|
||||
pr.module = &module;
|
||||
|
||||
//FIXME unhardcode
|
||||
spirv_add_extension (pr.module, "SPV_KHR_multiview");
|
||||
spirv_add_extinst_import (pr.module, "GLSL.std.450");
|
||||
|
|
|
@ -90,6 +90,7 @@
|
|||
#include "tools/qfcc/include/strpool.h"
|
||||
#include "tools/qfcc/include/struct.h"
|
||||
#include "tools/qfcc/include/symtab.h"
|
||||
#include "tools/qfcc/include/target.h"
|
||||
#include "tools/qfcc/include/type.h"
|
||||
#include "tools/qfcc/include/value.h"
|
||||
|
||||
|
@ -194,6 +195,10 @@ InitData (void)
|
|||
clear_classes ();
|
||||
clear_immediates ();
|
||||
clear_selectors ();
|
||||
|
||||
if (current_target.init) {
|
||||
current_target.init ();
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -2422,7 +2422,15 @@ spirv_shift_op (int op, const expr_t *e1, const expr_t *e2)
|
|||
return fold_constants (e);
|
||||
}
|
||||
|
||||
static void
|
||||
spirv_init (void)
|
||||
{
|
||||
static module_t module; //FIXME probably not what I want
|
||||
pr.module = &module;
|
||||
}
|
||||
|
||||
target_t spirv_target = {
|
||||
.init = spirv_init,
|
||||
.value_too_large = spirv_value_too_large,
|
||||
.build_scope = spirv_build_scope,
|
||||
.build_code = spirv_build_code,
|
||||
|
|
Loading…
Reference in a new issue