Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
4997bee1
Commit
4997bee1
authored
Dec 09, 2008
by
Henri Verbeet
Committed by
Alexandre Julliard
Dec 09, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add functions to initialize and free shader buffers.
parent
acbdd807
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
33 deletions
+30
-33
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+8
-14
baseshader.c
dlls/wined3d/baseshader.c
+14
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+2
-5
pixelshader.c
dlls/wined3d/pixelshader.c
+2
-7
vertexshader.c
dlls/wined3d/vertexshader.c
+2
-7
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/arb_program_shader.c
View file @
4997bee1
...
...
@@ -2694,10 +2694,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
}
/* Shader header */
buffer
.
bsize
=
0
;
buffer
.
lineNo
=
0
;
buffer
.
newline
=
TRUE
;
buffer
.
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
SHADER_PGMSIZE
);
shader_buffer_init
(
&
buffer
);
shader_addline
(
&
buffer
,
"!!ARBfp1.0
\n
"
);
...
...
@@ -2888,7 +2885,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
FIXME
(
"Fragment program error at position %d: %s
\n
"
,
pos
,
debugstr_a
((
const
char
*
)
glGetString
(
GL_PROGRAM_ERROR_STRING_ARB
)));
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
ret
;
}
...
...
@@ -3426,10 +3423,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
struct
arbfp_blit_priv
*
priv
=
(
struct
arbfp_blit_priv
*
)
device
->
blit_priv
;
/* Shader header */
buffer
.
bsize
=
0
;
buffer
.
lineNo
=
0
;
buffer
.
newline
=
TRUE
;
buffer
.
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
SHADER_PGMSIZE
);
shader_buffer_init
(
&
buffer
);
ENTER_GL
();
GL_EXTCALL
(
glGenProgramsARB
(
1
,
&
shader
));
...
...
@@ -3438,7 +3432,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
checkGLcall
(
"glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)"
);
LEAVE_GL
();
if
(
!
shader
)
{
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
0
;
}
...
...
@@ -3493,7 +3487,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
case
YUV_FIXUP_YUY2
:
if
(
!
gen_planar_yuv_read
(
&
buffer
,
yuv_fixup
,
textype
,
&
luminance_component
))
{
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
0
;
}
break
;
...
...
@@ -3501,14 +3495,14 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
case
YUV_FIXUP_YV12
:
if
(
!
gen_yv12_read
(
&
buffer
,
textype
,
&
luminance_component
))
{
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
0
;
}
break
;
default:
FIXME
(
"Unsupported YUV fixup %#x
\n
"
,
yuv_fixup
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
0
;
}
...
...
@@ -3533,7 +3527,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
FIXME
(
"Fragment program error at position %d: %s
\n
"
,
pos
,
debugstr_a
((
const
char
*
)
glGetString
(
GL_PROGRAM_ERROR_STRING_ARB
)));
}
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
LEAVE_GL
();
switch
(
yuv_fixup
)
...
...
dlls/wined3d/baseshader.c
View file @
4997bee1
...
...
@@ -40,6 +40,20 @@ static inline BOOL shader_is_version_token(DWORD token) {
shader_is_vshader_version
(
token
);
}
void
shader_buffer_init
(
struct
SHADER_BUFFER
*
buffer
)
{
buffer
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
SHADER_PGMSIZE
);
buffer
->
buffer
[
0
]
=
'\0'
;
buffer
->
bsize
=
0
;
buffer
->
lineNo
=
0
;
buffer
->
newline
=
TRUE
;
}
void
shader_buffer_free
(
struct
SHADER_BUFFER
*
buffer
)
{
HeapFree
(
GetProcessHeap
(),
0
,
buffer
->
buffer
);
}
int
shader_addline
(
SHADER_BUFFER
*
buffer
,
const
char
*
format
,
...)
{
...
...
dlls/wined3d/glsl_shader.c
View file @
4997bee1
...
...
@@ -2958,10 +2958,7 @@ static GLhandleARB generate_param_reorder_function(IWineD3DVertexShader *vertexs
char
reg_mask
[
6
];
const
struct
semantic
*
semantics_out
,
*
semantics_in
;
buffer
.
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
SHADER_PGMSIZE
);
buffer
.
bsize
=
0
;
buffer
.
lineNo
=
0
;
buffer
.
newline
=
TRUE
;
shader_buffer_init
(
&
buffer
);
shader_addline
(
&
buffer
,
"#version 120
\n
"
);
...
...
@@ -3093,7 +3090,7 @@ static GLhandleARB generate_param_reorder_function(IWineD3DVertexShader *vertexs
GL_EXTCALL
(
glCompileShaderARB
(
ret
));
checkGLcall
(
"glCompileShaderARB(ret)"
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
ret
;
}
...
...
dlls/wined3d/pixelshader.c
View file @
4997bee1
...
...
@@ -277,14 +277,9 @@ static inline GLuint IWineD3DPixelShaderImpl_GenerateShader(
SHADER_BUFFER
buffer
;
GLuint
shader
;
buffer
.
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
SHADER_PGMSIZE
);
buffer
.
bsize
=
0
;
buffer
.
lineNo
=
0
;
buffer
.
newline
=
TRUE
;
shader_buffer_init
(
&
buffer
);
shader
=
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
)
->
shader_backend
->
shader_generate_pshader
((
IWineD3DPixelShader
*
)
This
,
&
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
return
shader
;
}
...
...
dlls/wined3d/vertexshader.c
View file @
4997bee1
...
...
@@ -325,14 +325,9 @@ static void IWineD3DVertexShaderImpl_GenerateShader(IWineD3DVertexShader *iface,
find_swizzled_attribs
(
decl
,
This
);
buffer
.
buffer
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
SHADER_PGMSIZE
);
buffer
.
bsize
=
0
;
buffer
.
lineNo
=
0
;
buffer
.
newline
=
TRUE
;
shader_buffer_init
(
&
buffer
);
((
IWineD3DDeviceImpl
*
)
This
->
baseShader
.
device
)
->
shader_backend
->
shader_generate_vshader
(
iface
,
&
buffer
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
.
buffer
);
shader_buffer_free
(
&
buffer
);
}
/* *******************************************
...
...
dlls/wined3d/wined3d_private.h
View file @
4997bee1
...
...
@@ -2229,6 +2229,8 @@ typedef struct IWineD3DBaseShaderImpl {
HRESULT
WINAPI
IWineD3DBaseShaderImpl_QueryInterface
(
IWineD3DBaseShader
*
iface
,
REFIID
riid
,
LPVOID
*
ppobj
);
ULONG
WINAPI
IWineD3DBaseShaderImpl_AddRef
(
IWineD3DBaseShader
*
iface
);
ULONG
WINAPI
IWineD3DBaseShaderImpl_Release
(
IWineD3DBaseShader
*
iface
);
void
shader_buffer_init
(
struct
SHADER_BUFFER
*
buffer
);
void
shader_buffer_free
(
struct
SHADER_BUFFER
*
buffer
);
extern
HRESULT
shader_get_registers_used
(
IWineD3DBaseShader
*
iface
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment