Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2d802af4
Commit
2d802af4
authored
Oct 07, 2009
by
Stefan Dösinger
Committed by
Alexandre Julliard
Oct 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Make shader specific constants accessible via GL_LIMITS.
parent
afcd2c53
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
53 deletions
+53
-53
arb_program_shader.c
dlls/wined3d/arb_program_shader.c
+1
-1
directx.c
dlls/wined3d/directx.c
+41
-41
glsl_shader.c
dlls/wined3d/glsl_shader.c
+2
-2
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+9
-9
No files found.
dlls/wined3d/arb_program_shader.c
View file @
2d802af4
...
...
@@ -3481,7 +3481,7 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct
struct
arb_ps_np2fixup_info
*
const
fixup
=
priv_ctx
.
cur_np2fixup_info
;
const
WORD
map
=
priv_ctx
.
cur_ps_args
->
super
.
np2_fixup
;
const
UINT
max_lconsts
=
gl_info
->
ps_arb_max_local_constants
;
const
UINT
max_lconsts
=
GL_LIMITS
(
ps_arb_local_constants
)
;
fixup
->
offset
=
next_local
;
fixup
->
super
.
active
=
0
;
...
...
dlls/wined3d/directx.c
View file @
2d802af4
...
...
@@ -417,10 +417,10 @@ static void select_shader_max_constants(int ps_selected_mode, int vs_selected_mo
{
switch
(
vs_selected_mode
)
{
case
SHADER_GLSL
:
gl_info
->
max_vshader_constantsF
=
gl_info
->
vs_glsl_constantsF
;
gl_info
->
max_vshader_constantsF
=
gl_info
->
max_
vs_glsl_constantsF
;
break
;
case
SHADER_ARB
:
gl_info
->
max_vshader_constantsF
=
gl_info
->
vs_arb_constantsF
;
gl_info
->
max_vshader_constantsF
=
gl_info
->
max_
vs_arb_constantsF
;
break
;
default
:
gl_info
->
max_vshader_constantsF
=
0
;
...
...
@@ -429,10 +429,10 @@ static void select_shader_max_constants(int ps_selected_mode, int vs_selected_mo
switch
(
ps_selected_mode
)
{
case
SHADER_GLSL
:
gl_info
->
max_pshader_constantsF
=
gl_info
->
ps_glsl_constantsF
;
gl_info
->
max_pshader_constantsF
=
gl_info
->
max_
ps_glsl_constantsF
;
break
;
case
SHADER_ARB
:
gl_info
->
max_pshader_constantsF
=
gl_info
->
ps_arb_constantsF
;
gl_info
->
max_pshader_constantsF
=
gl_info
->
max_
ps_arb_constantsF
;
break
;
default
:
gl_info
->
max_pshader_constantsF
=
0
;
...
...
@@ -720,10 +720,10 @@ static BOOL match_broken_nv_clip(const struct wined3d_gl_info *gl_info, const ch
static
void
quirk_arb_constants
(
struct
wined3d_gl_info
*
gl_info
)
{
TRACE_
(
d3d_caps
)(
"Using ARB vs constant limit(=%u) for GLSL.
\n
"
,
gl_info
->
vs_arb_constantsF
);
gl_info
->
vs_glsl_constantsF
=
gl_info
->
vs_arb_constantsF
;
TRACE_
(
d3d_caps
)(
"Using ARB ps constant limit(=%u) for GLSL.
\n
"
,
gl_info
->
ps_arb_constantsF
);
gl_info
->
ps_glsl_constantsF
=
gl_info
->
ps_arb_constantsF
;
TRACE_
(
d3d_caps
)(
"Using ARB vs constant limit(=%u) for GLSL.
\n
"
,
gl_info
->
max_
vs_arb_constantsF
);
gl_info
->
max_vs_glsl_constantsF
=
gl_info
->
max_
vs_arb_constantsF
;
TRACE_
(
d3d_caps
)(
"Using ARB ps constant limit(=%u) for GLSL.
\n
"
,
gl_info
->
max_
ps_arb_constantsF
);
gl_info
->
max_ps_glsl_constantsF
=
gl_info
->
max_
ps_arb_constantsF
;
}
static
void
quirk_apple_glsl_constants
(
struct
wined3d_gl_info
*
gl_info
)
...
...
@@ -1611,15 +1611,15 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
gl_info
->
max_vertex_samplers
=
0
;
gl_info
->
max_combined_samplers
=
gl_info
->
max_fragment_samplers
+
gl_info
->
max_vertex_samplers
;
gl_info
->
max_sampler_stages
=
1
;
gl_info
->
ps_arb_max
_temps
=
0
;
gl_info
->
ps_arb_max
_instructions
=
0
;
gl_info
->
vs_arb_max
_temps
=
0
;
gl_info
->
vs_arb_max
_instructions
=
0
;
gl_info
->
vs_glsl_constantsF
=
0
;
gl_info
->
ps_glsl_constantsF
=
0
;
gl_info
->
vs_arb_constantsF
=
0
;
gl_info
->
ps_arb_constantsF
=
0
;
gl_info
->
ps_arb_max
_local_constants
=
0
;
gl_info
->
max_ps_arb
_temps
=
0
;
gl_info
->
max_ps_arb
_instructions
=
0
;
gl_info
->
max_vs_arb
_temps
=
0
;
gl_info
->
max_vs_arb
_instructions
=
0
;
gl_info
->
max_
vs_glsl_constantsF
=
0
;
gl_info
->
max_
ps_glsl_constantsF
=
0
;
gl_info
->
max_
vs_arb_constantsF
=
0
;
gl_info
->
max_
ps_arb_constantsF
=
0
;
gl_info
->
max_ps_arb
_local_constants
=
0
;
/* Retrieve opengl defaults */
glGetIntegerv
(
GL_MAX_CLIP_PLANES
,
&
gl_max
);
...
...
@@ -1860,43 +1860,43 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
if
(
gl_info
->
supported
[
ARB_FRAGMENT_PROGRAM
])
{
GL_EXTCALL
(
glGetProgramivARB
(
GL_FRAGMENT_PROGRAM_ARB
,
GL_MAX_PROGRAM_ENV_PARAMETERS_ARB
,
&
gl_max
));
gl_info
->
ps_arb_constantsF
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM float constants: %d.
\n
"
,
gl_info
->
ps_arb_constantsF
);
gl_info
->
max_
ps_arb_constantsF
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM float constants: %d.
\n
"
,
gl_info
->
max_
ps_arb_constantsF
);
GL_EXTCALL
(
glGetProgramivARB
(
GL_FRAGMENT_PROGRAM_ARB
,
GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB
,
&
gl_max
));
gl_info
->
ps_arb_max
_temps
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM native temporaries: %d.
\n
"
,
gl_info
->
ps_arb_max
_temps
);
gl_info
->
max_ps_arb
_temps
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM native temporaries: %d.
\n
"
,
gl_info
->
max_ps_arb
_temps
);
GL_EXTCALL
(
glGetProgramivARB
(
GL_FRAGMENT_PROGRAM_ARB
,
GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB
,
&
gl_max
));
gl_info
->
ps_arb_max
_instructions
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM native instructions: %d.
\n
"
,
gl_info
->
ps_arb_max
_instructions
);
gl_info
->
max_ps_arb
_instructions
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM native instructions: %d.
\n
"
,
gl_info
->
max_ps_arb
_instructions
);
GL_EXTCALL
(
glGetProgramivARB
(
GL_FRAGMENT_PROGRAM_ARB
,
GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB
,
&
gl_max
));
gl_info
->
ps_arb_max
_local_constants
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM local parameters: %d.
\n
"
,
gl_info
->
ps_arb_max
_instructions
);
gl_info
->
max_ps_arb
_local_constants
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_PROGRAM local parameters: %d.
\n
"
,
gl_info
->
max_ps_arb
_instructions
);
}
if
(
gl_info
->
supported
[
ARB_VERTEX_PROGRAM
])
{
GL_EXTCALL
(
glGetProgramivARB
(
GL_VERTEX_PROGRAM_ARB
,
GL_MAX_PROGRAM_ENV_PARAMETERS_ARB
,
&
gl_max
));
gl_info
->
vs_arb_constantsF
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_PROGRAM float constants: %d.
\n
"
,
gl_info
->
vs_arb_constantsF
);
gl_info
->
max_
vs_arb_constantsF
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_PROGRAM float constants: %d.
\n
"
,
gl_info
->
max_
vs_arb_constantsF
);
GL_EXTCALL
(
glGetProgramivARB
(
GL_VERTEX_PROGRAM_ARB
,
GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB
,
&
gl_max
));
gl_info
->
vs_arb_max
_temps
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_PROGRAM native temporaries: %d.
\n
"
,
gl_info
->
vs_arb_max
_temps
);
gl_info
->
max_vs_arb
_temps
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_PROGRAM native temporaries: %d.
\n
"
,
gl_info
->
max_vs_arb
_temps
);
GL_EXTCALL
(
glGetProgramivARB
(
GL_VERTEX_PROGRAM_ARB
,
GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB
,
&
gl_max
));
gl_info
->
vs_arb_max
_instructions
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_PROGRAM native instructions: %d.
\n
"
,
gl_info
->
vs_arb_max
_instructions
);
gl_info
->
max_vs_arb
_instructions
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_PROGRAM native instructions: %d.
\n
"
,
gl_info
->
max_vs_arb
_instructions
);
if
(
test_arb_vs_offset_limit
(
gl_info
))
gl_info
->
quirks
|=
WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT
;
}
if
(
gl_info
->
supported
[
ARB_VERTEX_SHADER
])
{
glGetIntegerv
(
GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
,
&
gl_max
);
gl_info
->
vs_glsl_constantsF
=
gl_max
/
4
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_SHADER float constants: %u.
\n
"
,
gl_info
->
vs_glsl_constantsF
);
gl_info
->
max_
vs_glsl_constantsF
=
gl_max
/
4
;
TRACE_
(
d3d_caps
)(
"Max ARB_VERTEX_SHADER float constants: %u.
\n
"
,
gl_info
->
max_
vs_glsl_constantsF
);
}
if
(
gl_info
->
supported
[
ARB_FRAGMENT_SHADER
])
{
glGetIntegerv
(
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
,
&
gl_max
);
gl_info
->
ps_glsl_constantsF
=
gl_max
/
4
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_SHADER float constants: %u.
\n
"
,
gl_info
->
ps_glsl_constantsF
);
gl_info
->
max_
ps_glsl_constantsF
=
gl_max
/
4
;
TRACE_
(
d3d_caps
)(
"Max ARB_FRAGMENT_SHADER float constants: %u.
\n
"
,
gl_info
->
max_
ps_glsl_constantsF
);
glGetIntegerv
(
GL_MAX_VARYING_FLOATS_ARB
,
&
gl_max
);
gl_info
->
max_glsl_varyings
=
gl_max
;
TRACE_
(
d3d_caps
)(
"Max GLSL varyings: %u (%u 4 component varyings).
\n
"
,
gl_max
,
gl_max
/
4
);
...
...
@@ -4186,15 +4186,15 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
use the VS 3.0 from MSDN or else if there's OpenGL spec use a hardcoded value minimum VS3.0 value. */
pCaps
->
VS20Caps
.
Caps
=
WINED3DVS20CAPS_PREDICATION
;
pCaps
->
VS20Caps
.
DynamicFlowControlDepth
=
WINED3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH
;
/* VS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
pCaps
->
VS20Caps
.
NumTemps
=
max
(
32
,
adapter
->
gl_info
.
vs_arb_max
_temps
);
pCaps
->
VS20Caps
.
NumTemps
=
max
(
32
,
adapter
->
gl_info
.
max_vs_arb
_temps
);
pCaps
->
VS20Caps
.
StaticFlowControlDepth
=
WINED3DVS20_MAX_STATICFLOWCONTROLDEPTH
;
/* level of nesting in loops / if-statements; VS 3.0 requires MAX (4) */
pCaps
->
MaxVShaderInstructionsExecuted
=
65535
;
/* VS 3.0 needs at least 65535, some cards even use 2^32-1 */
pCaps
->
MaxVertexShader30InstructionSlots
=
max
(
512
,
adapter
->
gl_info
.
vs_arb_max
_instructions
);
pCaps
->
MaxVertexShader30InstructionSlots
=
max
(
512
,
adapter
->
gl_info
.
max_vs_arb
_instructions
);
}
else
if
(
pCaps
->
VertexShaderVersion
==
WINED3DVS_VERSION
(
2
,
0
))
{
pCaps
->
VS20Caps
.
Caps
=
0
;
pCaps
->
VS20Caps
.
DynamicFlowControlDepth
=
WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH
;
pCaps
->
VS20Caps
.
NumTemps
=
max
(
12
,
adapter
->
gl_info
.
vs_arb_max
_temps
);
pCaps
->
VS20Caps
.
NumTemps
=
max
(
12
,
adapter
->
gl_info
.
max_vs_arb
_temps
);
pCaps
->
VS20Caps
.
StaticFlowControlDepth
=
1
;
pCaps
->
MaxVShaderInstructionsExecuted
=
65535
;
...
...
@@ -4220,17 +4220,17 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
WINED3DPS20CAPS_NODEPENDENTREADLIMIT
|
WINED3DPS20CAPS_NOTEXINSTRUCTIONLIMIT
;
pCaps
->
PS20Caps
.
DynamicFlowControlDepth
=
WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH
;
/* PS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
pCaps
->
PS20Caps
.
NumTemps
=
max
(
32
,
adapter
->
gl_info
.
ps_arb_max
_temps
);
pCaps
->
PS20Caps
.
NumTemps
=
max
(
32
,
adapter
->
gl_info
.
max_ps_arb
_temps
);
pCaps
->
PS20Caps
.
StaticFlowControlDepth
=
WINED3DPS20_MAX_STATICFLOWCONTROLDEPTH
;
/* PS 3.0 requires MAX_STATICFLOWCONTROLDEPTH (4) */
pCaps
->
PS20Caps
.
NumInstructionSlots
=
WINED3DPS20_MAX_NUMINSTRUCTIONSLOTS
;
/* PS 3.0 requires MAX_NUMINSTRUCTIONSLOTS (512) */
pCaps
->
MaxPShaderInstructionsExecuted
=
65535
;
pCaps
->
MaxPixelShader30InstructionSlots
=
max
(
WINED3DMIN30SHADERINSTRUCTIONS
,
adapter
->
gl_info
.
ps_arb_max
_instructions
);
pCaps
->
MaxPixelShader30InstructionSlots
=
max
(
WINED3DMIN30SHADERINSTRUCTIONS
,
adapter
->
gl_info
.
max_ps_arb
_instructions
);
}
else
if
(
pCaps
->
PixelShaderVersion
==
WINED3DPS_VERSION
(
2
,
0
))
{
/* Below we assume PS2.0 specs, not extended 2.0a(GeforceFX)/2.0b(Radeon R3xx) ones */
pCaps
->
PS20Caps
.
Caps
=
0
;
pCaps
->
PS20Caps
.
DynamicFlowControlDepth
=
0
;
/* WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0 */
pCaps
->
PS20Caps
.
NumTemps
=
max
(
12
,
adapter
->
gl_info
.
ps_arb_max
_temps
);
pCaps
->
PS20Caps
.
NumTemps
=
max
(
12
,
adapter
->
gl_info
.
max_ps_arb
_temps
);
pCaps
->
PS20Caps
.
StaticFlowControlDepth
=
WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH
;
/* Minimum: 1 */
pCaps
->
PS20Caps
.
NumInstructionSlots
=
WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS
;
/* Minimum number (64 ALU + 32 Texture), a GeforceFX uses 512 */
...
...
dlls/wined3d/glsl_shader.c
View file @
2d802af4
...
...
@@ -4611,7 +4611,7 @@ static void shader_glsl_get_caps(WINED3DDEVTYPE devtype,
* of native instructions, so use that here. For more info see the pixel shader versioning code below.
*/
if
((
gl_info
->
supported
[
NV_VERTEX_PROGRAM2
]
&&
!
gl_info
->
supported
[
NV_VERTEX_PROGRAM3
])
||
gl_info
->
ps_arb_max
_instructions
<=
512
)
||
gl_info
->
max_ps_arb
_instructions
<=
512
)
pCaps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
2
,
0
);
else
pCaps
->
VertexShaderVersion
=
WINED3DVS_VERSION
(
3
,
0
);
...
...
@@ -4630,7 +4630,7 @@ static void shader_glsl_get_caps(WINED3DDEVTYPE devtype,
* NOTE: ps3.0 hardware requires 512 or more instructions but ati and nvidia offer 'enough' (1024 vs 4096) on their most basic ps3.0 hardware.
*/
if
((
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM
]
&&
!
gl_info
->
supported
[
NV_FRAGMENT_PROGRAM2
])
||
(
gl_info
->
ps_arb_max
_instructions
<=
512
))
||
(
gl_info
->
max_ps_arb
_instructions
<=
512
))
pCaps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
2
,
0
);
else
pCaps
->
PixelShaderVersion
=
WINED3DPS_VERSION
(
3
,
0
);
...
...
dlls/wined3d/wined3d_gl.h
View file @
2d802af4
...
...
@@ -4166,15 +4166,15 @@ struct wined3d_gl_info
unsigned
int
max_vshader_constantsF
;
unsigned
int
max_pshader_constantsF
;
unsigned
int
vs_arb_constantsF
;
unsigned
int
vs_arb_max
_instructions
;
unsigned
int
vs_arb_max
_temps
;
unsigned
int
ps_arb_constantsF
;
unsigned
int
ps_arb_max
_local_constants
;
unsigned
int
ps_arb_max
_instructions
;
unsigned
int
ps_arb_max
_temps
;
unsigned
int
vs_glsl_constantsF
;
unsigned
int
ps_glsl_constantsF
;
unsigned
int
max_
vs_arb_constantsF
;
unsigned
int
max_vs_arb
_instructions
;
unsigned
int
max_vs_arb
_temps
;
unsigned
int
max_
ps_arb_constantsF
;
unsigned
int
max_ps_arb
_local_constants
;
unsigned
int
max_ps_arb
_instructions
;
unsigned
int
max_ps_arb
_temps
;
unsigned
int
max_
vs_glsl_constantsF
;
unsigned
int
max_
ps_glsl_constantsF
;
DWORD
reserved_glsl_constants
;
...
...
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