mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
vk/meta: Use glsl_scraper for our GLSL source
We are not yet using SPIR-V for meta but this is a first step.
This commit is contained in:
parent
b13c0f469b
commit
f17e835c26
3 changed files with 13 additions and 4 deletions
|
|
@ -70,7 +70,10 @@ libvulkan_la_SOURCES = \
|
|||
formats.c \
|
||||
compiler.cpp
|
||||
|
||||
BUILT_SOURCES = entrypoints.h entrypoints.c
|
||||
BUILT_SOURCES = \
|
||||
entrypoints.h \
|
||||
entrypoints.c \
|
||||
meta-spirv.h
|
||||
|
||||
entrypoints.h : vk_gen.py $(vulkan_include_HEADERS)
|
||||
$(AM_V_GEN)cat $(vulkan_include_HEADERS) | $(PYTHON2) $< header > $@
|
||||
|
|
@ -78,6 +81,9 @@ entrypoints.h : vk_gen.py $(vulkan_include_HEADERS)
|
|||
entrypoints.c : vk_gen.py $(vulkan_include_HEADERS)
|
||||
$(AM_V_GEN)cat $(vulkan_include_HEADERS) | $(PYTHON2) $< code > $@
|
||||
|
||||
%-spirv.h: %.c glsl_scraper.py
|
||||
$(AM_V_GEN) $(PYTHON2) $(srcdir)/glsl_scraper.py --glsl-only -o $@ $<
|
||||
|
||||
CLEANFILES = entrypoints.h entrypoints.c
|
||||
|
||||
bin_PROGRAMS = vk
|
||||
|
|
|
|||
|
|
@ -23,13 +23,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define _GLSL_SRC_VAR2(_line) _glsl_helpers_shader ## _line ## _glsl_src
|
||||
#define _GLSL_SRC_VAR(_line) _GLSL_SRC_VAR2(_line)
|
||||
|
||||
#define GLSL_VK_SHADER(device, stage, ...) ({ \
|
||||
VkShader __shader; \
|
||||
const char __src[] = "#version 330\n" #__VA_ARGS__; \
|
||||
VkShaderCreateInfo __shader_create_info = { \
|
||||
.sType = VK_STRUCTURE_TYPE_SHADER_CREATE_INFO, \
|
||||
.codeSize = sizeof(__src), \
|
||||
.pCode = __src, \
|
||||
.codeSize = sizeof(_GLSL_SRC_VAR(__LINE__)), \
|
||||
.pCode = _GLSL_SRC_VAR(__LINE__), \
|
||||
.flags = (1 << 31) /* GLSL back-door hack */ \
|
||||
}; \
|
||||
anv_CreateShader((VkDevice) device, &__shader_create_info, &__shader); \
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "private.h"
|
||||
#include "glsl_helpers.h"
|
||||
#include "meta-spirv.h"
|
||||
|
||||
static void
|
||||
anv_device_init_meta_clear_state(struct anv_device *device)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue