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
4d39cb56
Commit
4d39cb56
authored
Oct 02, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Oct 03, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Handle WINED3DSPR_CONSTBUFFER registers in the GLSL shader backend.
parent
e55416a1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+20
-1
shader.c
dlls/wined3d/shader.c
+8
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+2
-0
No files found.
dlls/wined3d/glsl_shader.c
View file @
4d39cb56
...
...
@@ -994,6 +994,12 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
if
(
shader
->
limits
.
constant_bool
>
0
&&
reg_maps
->
boolean_constants
)
shader_addline
(
buffer
,
"uniform bool %s_b[%u];
\n
"
,
prefix
,
shader
->
limits
.
constant_bool
);
for
(
i
=
0
;
i
<
WINED3D_MAX_CBS
;
++
i
)
{
if
(
reg_maps
->
cb_sizes
[
i
])
shader_addline
(
buffer
,
"uniform vec4 %s_cb%u[%u];
\n
"
,
prefix
,
i
,
reg_maps
->
cb_sizes
[
i
]);
}
if
(
!
pshader
)
{
shader_addline
(
buffer
,
"uniform vec4 posFixup;
\n
"
);
...
...
@@ -1530,8 +1536,21 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
}
break
;
case
WINED3DSPR_CONSTBUFFER
:
if
(
reg
->
rel_addr
)
{
struct
glsl_src_param
rel_param
;
shader_glsl_add_src_param
(
ins
,
reg
->
rel_addr
,
WINED3DSP_WRITEMASK_0
,
&
rel_param
);
sprintf
(
register_name
,
"%s_cb%u[%s + %u]"
,
prefix
,
reg
->
idx
,
rel_param
.
param_str
,
reg
->
array_idx
);
}
else
{
sprintf
(
register_name
,
"%s_cb%u[%u]"
,
prefix
,
reg
->
idx
,
reg
->
array_idx
);
}
break
;
default:
FIXME
(
"Unhandled register
name Type(%d)
\n
"
,
reg
->
type
);
FIXME
(
"Unhandled register
type %#x.
\n
"
,
reg
->
type
);
sprintf
(
register_name
,
"unrecognized_register"
);
break
;
}
...
...
dlls/wined3d/shader.c
View file @
4d39cb56
...
...
@@ -533,6 +533,14 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st
break
;
}
}
else
if
(
ins
.
handler_idx
==
WINED3DSIH_DCL_CONSTANT_BUFFER
)
{
struct
wined3d_shader_register
*
reg
=
&
ins
.
declaration
.
src
.
reg
;
if
(
reg
->
idx
>=
WINED3D_MAX_CBS
)
ERR
(
"Invalid CB index %u.
\n
"
,
reg
->
idx
);
else
reg_maps
->
cb_sizes
[
reg
->
idx
]
=
reg
->
array_idx
;
}
else
if
(
ins
.
handler_idx
==
WINED3DSIH_DEF
)
{
struct
wined3d_shader_lconst
*
lconst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
lconst
));
...
...
dlls/wined3d/wined3d_private.h
View file @
4d39cb56
...
...
@@ -409,6 +409,7 @@ enum wined3d_shader_rel_op
#define MAX_REG_OUTPUT 32
#define MAX_CONST_I 16
#define MAX_CONST_B 16
#define WINED3D_MAX_CBS 15
/* FIXME: This needs to go up to 2048 for
* Shader model 3 according to msdn (and for software shaders) */
...
...
@@ -571,6 +572,7 @@ struct wined3d_shader_reg_maps
WORD
boolean_constants
;
/* MAX_CONST_B, 16 */
WORD
local_int_consts
;
/* MAX_CONST_I, 16 */
WORD
local_bool_consts
;
/* MAX_CONST_B, 16 */
UINT
cb_sizes
[
WINED3D_MAX_CBS
];
enum
wined3d_sampler_texture_type
sampler_type
[
max
(
MAX_FRAGMENT_SAMPLERS
,
MAX_VERTEX_SAMPLERS
)];
BYTE
bumpmat
;
/* MAX_TEXTURES, 8 */
...
...
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