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
0b4ad32c
Commit
0b4ad32c
authored
Oct 27, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Move sampler_texdim() and texture_activate_dimensions() to ffp_gl.c.
parent
4a30ab29
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
115 additions
and
112 deletions
+115
-112
ffp_gl.c
dlls/wined3d/ffp_gl.c
+115
-0
utils.c
dlls/wined3d/utils.c
+0
-112
No files found.
dlls/wined3d/ffp_gl.c
View file @
0b4ad32c
...
...
@@ -1314,6 +1314,121 @@ void state_fogdensity(struct wined3d_context *context, const struct wined3d_stat
checkGLcall
(
"glFogf(GL_FOG_DENSITY, (float) Value)"
);
}
/* Activates the texture dimension according to the bound D3D texture. Does
* not care for the colorop or correct gl texture unit (when using nvrc).
* Requires the caller to activate the correct unit. */
/* Context activation is done by the caller (state handler). */
void
texture_activate_dimensions
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
{
if
(
texture
)
{
switch
(
wined3d_texture_gl
(
texture
)
->
target
)
{
case
GL_TEXTURE_2D
:
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glEnable(GL_TEXTURE_2D)"
);
break
;
case
GL_TEXTURE_RECTANGLE_ARB
:
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glEnable(GL_TEXTURE_RECTANGLE_ARB)"
);
break
;
case
GL_TEXTURE_3D
:
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glEnable(GL_TEXTURE_3D)"
);
break
;
case
GL_TEXTURE_CUBE_MAP_ARB
:
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glEnable(GL_TEXTURE_CUBE_MAP_ARB)"
);
break
;
}
}
else
{
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glEnable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
/* Binding textures is done by samplers. A dummy texture will be bound. */
}
}
/* Context activation is done by the caller (state handler). */
void
sampler_texdim
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
unsigned
int
sampler
=
state_id
-
STATE_SAMPLER
(
0
);
unsigned
int
mapped_stage
;
/* No need to enable / disable anything here for unused samplers. The
* tex_colorop handler takes care. Also no action is needed with pixel
* shaders, or if tex_colorop will take care of this business. */
mapped_stage
=
context_gl
->
tex_unit_map
[
sampler
];
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
||
mapped_stage
>=
context_gl
->
gl_info
->
limits
.
ffp_textures
)
return
;
if
(
sampler
>=
context
->
lowest_disabled_stage
)
return
;
if
(
isStateDirty
(
context
,
STATE_TEXTURESTAGE
(
sampler
,
WINED3D_TSS_COLOR_OP
)))
return
;
wined3d_context_gl_active_texture
(
context_gl
,
context_gl
->
gl_info
,
sampler
);
texture_activate_dimensions
(
wined3d_state_get_ffp_texture
(
state
,
sampler
),
context_gl
->
gl_info
);
}
static
void
state_colormat
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
...
...
dlls/wined3d/utils.c
View file @
0b4ad32c
...
...
@@ -6680,118 +6680,6 @@ void add_ffp_frag_shader(struct wine_rb_tree *shaders, struct ffp_frag_desc *des
}
}
/* Activates the texture dimension according to the bound D3D texture. Does
* not care for the colorop or correct gl texture unit (when using nvrc).
* Requires the caller to activate the correct unit. */
/* Context activation is done by the caller (state handler). */
void
texture_activate_dimensions
(
struct
wined3d_texture
*
texture
,
const
struct
wined3d_gl_info
*
gl_info
)
{
if
(
texture
)
{
switch
(
wined3d_texture_gl
(
texture
)
->
target
)
{
case
GL_TEXTURE_2D
:
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glEnable(GL_TEXTURE_2D)"
);
break
;
case
GL_TEXTURE_RECTANGLE_ARB
:
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glEnable(GL_TEXTURE_RECTANGLE_ARB)"
);
break
;
case
GL_TEXTURE_3D
:
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glEnable(GL_TEXTURE_3D)"
);
break
;
case
GL_TEXTURE_CUBE_MAP_ARB
:
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glDisable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glEnable(GL_TEXTURE_CUBE_MAP_ARB)"
);
break
;
}
}
else
{
gl_info
->
gl_ops
.
gl
.
p_glEnable
(
GL_TEXTURE_2D
);
checkGLcall
(
"glEnable(GL_TEXTURE_2D)"
);
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_3D
);
checkGLcall
(
"glDisable(GL_TEXTURE_3D)"
);
if
(
gl_info
->
supported
[
ARB_TEXTURE_CUBE_MAP
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_CUBE_MAP_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_CUBE_MAP_ARB)"
);
}
if
(
gl_info
->
supported
[
ARB_TEXTURE_RECTANGLE
])
{
gl_info
->
gl_ops
.
gl
.
p_glDisable
(
GL_TEXTURE_RECTANGLE_ARB
);
checkGLcall
(
"glDisable(GL_TEXTURE_RECTANGLE_ARB)"
);
}
/* Binding textures is done by samplers. A dummy texture will be bound */
}
}
/* Context activation is done by the caller (state handler). */
void
sampler_texdim
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
struct
wined3d_context_gl
*
context_gl
=
wined3d_context_gl
(
context
);
unsigned
int
sampler
=
state_id
-
STATE_SAMPLER
(
0
);
unsigned
int
mapped_stage
;
/* No need to enable / disable anything here for unused samplers. The
* tex_colorop handler takes care. Also no action is needed with pixel
* shaders, or if tex_colorop will take care of this business. */
mapped_stage
=
context_gl
->
tex_unit_map
[
sampler
];
if
(
mapped_stage
==
WINED3D_UNMAPPED_STAGE
||
mapped_stage
>=
context_gl
->
gl_info
->
limits
.
ffp_textures
)
return
;
if
(
sampler
>=
context
->
lowest_disabled_stage
)
return
;
if
(
isStateDirty
(
context
,
STATE_TEXTURESTAGE
(
sampler
,
WINED3D_TSS_COLOR_OP
)))
return
;
wined3d_context_gl_active_texture
(
context_gl
,
context_gl
->
gl_info
,
sampler
);
texture_activate_dimensions
(
wined3d_state_get_ffp_texture
(
state
,
sampler
),
context_gl
->
gl_info
);
}
int
wined3d_ffp_frag_program_key_compare
(
const
void
*
key
,
const
struct
wine_rb_entry
*
entry
)
{
const
struct
ffp_frag_settings
*
ka
=
key
;
...
...
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