30 #define D3DXERR_INVALIDDATA 0x88760b59 32 #define BUFFER_INITIAL_CAPACITY 256 45 #define INCLUDES_INITIAL_CAPACITY 4 81 0, 0, { (
DWORD_PTR)(__FILE__
": wpp_mutex") }
110 if(newbuffer ==
NULL)
112 ERR(
"Error reallocating memory for parser messages\n");
139 wpp_write_message_var(
"%s:%d:%d: %s: ",
143 wpp_write_message_var(
"\n");
153 wpp_write_message_var(
"%s:%d:%d: %s: ",
157 wpp_write_message_var(
"\n");
184 ERR(
"Parent include %s missing.\n",
debugstr_a(parent_name));
227 ERR(
"Error allocating memory for the loaded includes structure\n");
237 if(newincludes ==
NULL)
239 ERR(
"Error reallocating memory for the loaded includes structure\n");
267 ERR(
"current_include == NULL, desc == %p, buffer = %s\n",
286 char *new_wpp_output;
306 ERR(
"Error allocating memory\n");
319 if(!new_wpp_output)
return 0;
391 def->
value = new_value;
516 TRACE(
"Error during shader preprocessing\n");
567 TRACE(
"Assembler messages:\n");
570 TRACE(
"Shader source:\n");
585 pos = ID3D10Blob_GetBufferPointer(
buffer);
586 if (preproc_messages)
601 ERR(
"Asm reading failed\n");
609 ERR(
"SlWriteBytecode failed with 0x%08x\n",
hr);
636 TRACE(
"data %p, datasize %lu, filename %s, defines %p, include %p, sflags %#x, " 637 "shader %p, error_messages %p.\n",
794 TRACE(
"Compiler messages:\n");
797 TRACE(
"Shader source:\n");
812 pos = ID3D10Blob_GetBufferPointer(
buffer);
813 if (preproc_messages)
828 ERR(
"HLSL shader parsing failed.\n");
836 ERR(
"SlWriteBytecode failed with error 0x%08x.\n",
hr);
865 TRACE(
"data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, " 866 "target %s, sflags %#x, eflags %#x, secondary_flags %#x, secondary_data %p, " 867 "secondary_data_size %lu, shader %p, error_messages %p.\n",
873 FIXME(
"secondary data not implemented yet\n");
893 TRACE(
"data %p, data_size %lu, filename %s, defines %p, include %p, entrypoint %s, " 894 "target %s, sflags %#x, eflags %#x, shader %p, error_messages %p.\n",
909 TRACE(
"data %p, size %lu, filename %s, defines %p, include %p, shader %p, error_messages %p\n",
944 FIXME(
"data %p, size %lu, flags %#x, comments %p, disassembly %p stub!\n",
952 FIXME(
"filename %s, defines %p, includes %p, entrypoint %s, target %s, flags1 %x, flags2 %x, code %p, errors %p\n",
static void add_special_defines(void)
int WINAPIV ppy_error(const char *msg,...)
int pp_get_if_depth(void)
static static const char __ms_va_list
ACPI_SIZE strlen(const char *String)
static ID3DInclude * current_include
static int wpp_output_size
HRESULT WINAPI D3DCompileFromFile(const WCHAR *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *includes, const char *entrypoint, const char *target, UINT flags1, UINT flags2, ID3DBlob **code, ID3DBlob **errors)
#define D3DXERR_INVALIDDATA
GLsizei const GLchar ** path
static char * wpp_messages
#define D3DERR_INVALIDCALL
static CRITICAL_SECTION wpp_mutex
static void WINAPIV PRINTF_ATTR(1, 2)
static void add_cmdline_defines(void)
HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **shader, ID3DBlob **error_messages)
static HRESULT compile_shader(const char *preproc_shader, const char *target, const char *entrypoint, ID3DBlob **shader_blob, ID3DBlob **error_messages)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static void wpp_write_message(const char *fmt, __ms_va_list args)
void WINAPIV pp_writestring(const char *format,...) __attribute__((format(printf
static struct define * cmdline_defines
static struct mem_file_desc current_shader
static int wpp_close_output(void)
HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, UINT flags, ID3DBlob **shader, ID3DBlob **error_messages)
GLenum GLuint GLenum GLsizei const GLchar * buf
void WINAPIV int ppy_parse(void)
int wpp_parse(const char *input, FILE *output)
#define MESSAGEBUFFER_INITIAL_SIZE
static const WCHAR desc[]
static HRESULT assemble_shader(const char *preproc_shader, ID3DBlob **shader_blob, ID3DBlob **error_messages)
static struct _test_info info[]
struct bwriter_shader * SlAssembleShader(const char *text, char **messages) DECLSPEC_HIDDEN
void wpp_write(const char *buffer, unsigned int len)
size_t CDECL strftime(char *str, size_t max, const char *format, const struct tm *mstm)
static struct loaded_include * includes
char * pp_xstrdup(const char *str)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude * include
HRESULT SlWriteBytecode(const struct bwriter_shader *shader, int dxversion, DWORD **result, DWORD *size)
void * wpp_open(const char *filename, int type)
static int wpp_messages_capacity
HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, ID3DBlob **shader, ID3DBlob **error_messages)
static SIZE_T const char const D3D_SHADER_MACRO ID3DInclude UINT ID3DBlob ID3DBlob ** error_messages
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static const char * initial_filename
#define BUFFER_INITIAL_CAPACITY
HRESULT WINAPI D3DDisassemble(const void *data, SIZE_T size, UINT flags, const char *comments, ID3DBlob **disassembly)
int wpp_add_define(const char *name, const char *value)
char * wpp_lookup(const char *filename, int type, const char *parent_name)
static HRESULT preprocess_shader(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, ID3DBlob **error_messages)
static __inline const char * debugstr_an(const char *s, int n)
WINE_DEFAULT_DEBUG_CHANNEL(d3dcompiler)
void pp_del_define(const char *name)
void wpp_close(void *file)
pp_entry_t * pp_add_define(const char *def, const char *text)
#define memcpy(s1, s2, n)
void SlDeleteShader(struct bwriter_shader *shader)
_CRTIMP struct tm *__cdecl localtime(const time_t *_Time)
LIST_ENTRY ProcessLocksList
static const char * parent_include
void wpp_del_define(const char *name)
int WINAPIV ppy_warning(const char *msg,...)
GLenum GLenum GLenum input
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
static const struct target_info * get_target_info(const char *target)
#define __ms_va_end(list)
static const struct target_info targets_info[]
#define __ms_va_start(list, arg)
static SIZE_T const char const D3D_SHADER_MACRO * defines
void int int ULONGLONG int va_list * ap
static int wpp_output_capacity
void * pp_xmalloc(size_t size)
int strcmp(const char *String1, const char *String2)
int pp_push_define_state(void)
static int wpp_messages_size
char * cleanup(char *str)
int wpp_read(void *file, char *buffer, unsigned int len)
static void del_cmdline_defines(void)
HRESULT WINAPI D3DCreateBlob(SIZE_T data_size, ID3DBlob **blob)
#define INCLUDES_INITIAL_CAPACITY
static int includes_capacity
GLuint GLuint GLsizei GLenum type
struct bwriter_shader * parse_hlsl_shader(const char *text, enum shader_type type, DWORD major, DWORD minor, const char *entrypoint, char **messages) DECLSPEC_HIDDEN
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
HRESULT WINAPI D3DCompile2(const void *data, SIZE_T data_size, const char *filename, const D3D_SHADER_MACRO *defines, ID3DInclude *include, const char *entrypoint, const char *target, UINT sflags, UINT eflags, UINT secondary_flags, const void *secondary_data, SIZE_T secondary_data_size, ID3DBlob **shader, ID3DBlob **error_messages)
HRESULT WINAPI D3DLoadModule(const void *data, SIZE_T size, ID3D11Module **module)
void pp_pop_define_state(void)
pp_if_state_t pp_pop_if(void)
#define HeapFree(x, y, z)
static void del_special_defines(void)
static CRITICAL_SECTION_DEBUG wpp_mutex_debug