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
5efd4b64
Commit
5efd4b64
authored
Mar 20, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jan 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement shader stencil export for GL.
parent
0ef73052
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
1 deletion
+24
-1
adapter_gl.c
dlls/wined3d/adapter_gl.c
+1
-0
glsl_shader.c
dlls/wined3d/glsl_shader.c
+12
-0
shader.c
dlls/wined3d/shader.c
+4
-0
shader_sm4.c
dlls/wined3d/shader_sm4.c
+3
-0
wined3d_gl.h
dlls/wined3d/wined3d_gl.h
+1
-0
wined3d_private.h
dlls/wined3d/wined3d_private.h
+3
-1
No files found.
dlls/wined3d/adapter_gl.c
View file @
5efd4b64
...
...
@@ -115,6 +115,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
{
"GL_ARB_shader_bit_encoding"
,
ARB_SHADER_BIT_ENCODING
},
{
"GL_ARB_shader_image_load_store"
,
ARB_SHADER_IMAGE_LOAD_STORE
},
{
"GL_ARB_shader_image_size"
,
ARB_SHADER_IMAGE_SIZE
},
{
"GL_ARB_shader_stencil_export"
,
ARB_SHADER_STENCIL_EXPORT
},
{
"GL_ARB_shader_storage_buffer_object"
,
ARB_SHADER_STORAGE_BUFFER_OBJECT
},
{
"GL_ARB_shader_texture_image_samples"
,
ARB_SHADER_TEXTURE_IMAGE_SAMPLES
},
{
"GL_ARB_shader_texture_lod"
,
ARB_SHADER_TEXTURE_LOD
},
...
...
dlls/wined3d/glsl_shader.c
View file @
5efd4b64
...
...
@@ -3052,6 +3052,10 @@ static void shader_glsl_get_register_name(const struct wined3d_shader_register *
string_buffer_sprintf
(
register_name
,
"sample_mask"
);
break
;
case
WINED3DSPR_STENCILREF
:
string_buffer_sprintf
(
register_name
,
"stencil_ref"
);
break
;
default:
FIXME
(
"Unhandled register type %#x.
\n
"
,
reg
->
type
);
string_buffer_sprintf
(
register_name
,
"unrecognised_register"
);
...
...
@@ -7554,6 +7558,8 @@ static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer,
shader_addline
(
buffer
,
"#extension GL_ARB_shader_image_load_store : enable
\n
"
);
if
(
gl_info
->
supported
[
ARB_SHADER_IMAGE_SIZE
])
shader_addline
(
buffer
,
"#extension GL_ARB_shader_image_size : enable
\n
"
);
if
(
gl_info
->
supported
[
ARB_SHADER_STENCIL_EXPORT
])
shader_addline
(
buffer
,
"#extension GL_ARB_shader_stencil_export : enable
\n
"
);
if
(
gl_info
->
supported
[
ARB_SHADER_STORAGE_BUFFER_OBJECT
])
shader_addline
(
buffer
,
"#extension GL_ARB_shader_storage_buffer_object : enable
\n
"
);
if
(
gl_info
->
supported
[
ARB_SHADER_TEXTURE_IMAGE_SAMPLES
])
...
...
@@ -7653,6 +7659,9 @@ static void shader_glsl_generate_ps_epilogue(const struct wined3d_gl_info *gl_in
if
(
reg_maps
->
sample_mask
)
shader_addline
(
buffer
,
"gl_SampleMask[0] = floatBitsToInt(sample_mask);
\n
"
);
if
(
reg_maps
->
stencil_ref
)
shader_addline
(
buffer
,
"gl_FragStencilRefARB = floatBitsToInt(stencil_ref);
\n
"
);
if
(
!
use_legacy_fragment_output
(
gl_info
))
shader_glsl_generate_color_output
(
buffer
,
gl_info
,
shader
,
args
,
string_buffers
);
}
...
...
@@ -7899,6 +7908,9 @@ static GLuint shader_glsl_generate_fragment_shader(const struct wined3d_context_
if
(
reg_maps
->
sample_mask
)
shader_addline
(
buffer
,
"float sample_mask = uintBitsToFloat(0xffffffffu);
\n
"
);
if
(
reg_maps
->
stencil_ref
)
shader_addline
(
buffer
,
"float stencil_ref = uintBitsToFloat(0xffffffffu);
\n
"
);
/* Direct3D applications expect integer vPos values, while OpenGL drivers
* add approximately 0.5. This causes off-by-one problems as spotted by
* the vPos d3d9 visual test. Unfortunately ATI cards do not add exactly
...
...
dlls/wined3d/shader.c
View file @
5efd4b64
...
...
@@ -758,6 +758,10 @@ static BOOL shader_record_register_usage(struct wined3d_shader *shader, struct w
reg_maps
->
sample_mask
=
1
;
break
;
case
WINED3DSPR_STENCILREF
:
reg_maps
->
stencil_ref
=
1
;
break
;
default:
TRACE
(
"Not recording register of type %#x and [%#x][%#x].
\n
"
,
reg
->
type
,
reg
->
idx
[
0
].
offset
,
reg
->
idx
[
1
].
offset
);
...
...
dlls/wined3d/shader_sm4.c
View file @
5efd4b64
...
...
@@ -357,6 +357,7 @@ enum wined3d_sm4_register_type
WINED3D_SM5_RT_GS_INSTANCE_ID
=
0x25
,
WINED3D_SM5_RT_DEPTHOUT_GREATER_EQUAL
=
0x26
,
WINED3D_SM5_RT_DEPTHOUT_LESS_EQUAL
=
0x27
,
WINED3D_SM5_RT_OUTPUT_STENCIL_REF
=
0x29
,
};
enum
wined3d_sm4_output_primitive_type
...
...
@@ -1184,6 +1185,8 @@ static const enum wined3d_shader_register_type register_type_table[] =
/* WINED3D_SM5_RT_GS_INSTANCE_ID */
WINED3DSPR_GSINSTID
,
/* WINED3D_SM5_RT_DEPTHOUT_GREATER_EQUAL */
WINED3DSPR_DEPTHOUTGE
,
/* WINED3D_SM5_RT_DEPTHOUT_LESS_EQUAL */
WINED3DSPR_DEPTHOUTLE
,
/* UNKNOWN */
~
0u
,
/* WINED3D_SM5_RT_OUTPUT_STENCIL_REF */
WINED3DSPR_STENCILREF
,
};
static
const
struct
wined3d_sm4_opcode_info
*
get_opcode_info
(
enum
wined3d_sm4_opcode
opcode
)
...
...
dlls/wined3d/wined3d_gl.h
View file @
5efd4b64
...
...
@@ -110,6 +110,7 @@ enum wined3d_gl_extension
ARB_SHADER_BIT_ENCODING
,
ARB_SHADER_IMAGE_LOAD_STORE
,
ARB_SHADER_IMAGE_SIZE
,
ARB_SHADER_STENCIL_EXPORT
,
ARB_SHADER_STORAGE_BUFFER_OBJECT
,
ARB_SHADER_TEXTURE_IMAGE_SAMPLES
,
ARB_SHADER_TEXTURE_LOD
,
...
...
dlls/wined3d/wined3d_private.h
View file @
5efd4b64
...
...
@@ -582,6 +582,7 @@ enum wined3d_shader_register_type
WINED3DSPR_DEPTHOUTGE
,
WINED3DSPR_DEPTHOUTLE
,
WINED3DSPR_RASTERIZER
,
WINED3DSPR_STENCILREF
,
};
enum
wined3d_data_type
...
...
@@ -1156,7 +1157,7 @@ struct wined3d_shader_reg_maps
DWORD
input_rel_addressing
:
1
;
DWORD
viewport_array
:
1
;
DWORD
sample_mask
:
1
;
DWORD
padding
:
14
;
DWORD
stencil_ref
:
1
;
DWORD
rt_mask
;
/* Used render targets, 32 max. */
...
...
@@ -4336,6 +4337,7 @@ static inline BOOL shader_is_scalar(const struct wined3d_shader_register *reg)
case
WINED3DSPR_PRIMID
:
/* primID */
case
WINED3DSPR_COVERAGE
:
/* vCoverage */
case
WINED3DSPR_SAMPLEMASK
:
/* oMask */
case
WINED3DSPR_STENCILREF
:
/* oStencilRef */
return
TRUE
;
case
WINED3DSPR_MISCTYPE
:
...
...
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