ReactOS 0.4.17-dev-934-g091855f
vkd3d_shader_utils.h
Go to the documentation of this file.
1/*
2 * Copyright 2023 Conor McCarthy for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifndef __VKD3D_SHADER_UTILS_H
20#define __VKD3D_SHADER_UTILS_H
21
22#include "vkd3d_shader.h"
23
24#define TAG_DXIL VKD3D_MAKE_TAG('D', 'X', 'I', 'L')
25#define TAG_SHDR VKD3D_MAKE_TAG('S', 'H', 'D', 'R')
26#define TAG_SHEX VKD3D_MAKE_TAG('S', 'H', 'E', 'X')
27
30{
32 enum vkd3d_result ret;
33 unsigned int i;
34
36
37 if ((ret = vkd3d_shader_parse_dxbc(dxbc, 0, &desc, messages)) < 0)
38 return ret;
39
40 for (i = 0; i < desc.section_count; ++i)
41 {
42 uint32_t tag = desc.sections[i].tag;
43 if (tag == TAG_SHDR || tag == TAG_SHEX)
44 {
46#ifndef VKD3D_SHADER_UNSUPPORTED_DXIL
47 break;
48#else
49 }
50 else if (tag == TAG_DXIL)
51 {
53 /* Default to DXIL if both are present. */
54 break;
55#endif
56 }
57 }
58
60
63
64 return VKD3D_OK;
65}
66
67#endif /* __VKD3D_SHADER_UTILS_H */
UINT32 uint32_t
Definition: types.h:75
return ret
Definition: mutex.c:147
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
Definition: ecma_167.h:138
vkd3d_shader_source_type
@ VKD3D_SHADER_SOURCE_DXBC_DXIL
@ VKD3D_SHADER_SOURCE_DXBC_TPF
@ VKD3D_SHADER_SOURCE_NONE
VKD3D_SHADER_API void vkd3d_shader_free_dxbc(struct vkd3d_shader_dxbc_desc *dxbc)
Definition: dxbc.c:290
VKD3D_SHADER_API int vkd3d_shader_parse_dxbc(const struct vkd3d_shader_code *dxbc, uint32_t flags, struct vkd3d_shader_dxbc_desc *desc, char **messages)
Definition: dxbc.c:320
static enum vkd3d_result vkd3d_shader_parse_dxbc_source_type(const struct vkd3d_shader_code *dxbc, enum vkd3d_shader_source_type *type, char **messages)
#define TAG_SHEX
#define TAG_SHDR
#define TAG_DXIL
vkd3d_result
Definition: vkd3d_types.h:41
@ VKD3D_ERROR_INVALID_SHADER
Definition: vkd3d_types.h:53
@ VKD3D_OK
Definition: vkd3d_types.h:43