wined3d: Implement the "precise" flag in the GLSL shader backend.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7e4f254bbd
commit
7a54209d4b
|
@ -2540,6 +2540,10 @@ static void shader_generate_glsl_declarations(const struct wined3d_context_gl *c
|
|||
/* Temporary variables for matrix operations */
|
||||
shader_addline(buffer, "vec4 tmp0;\n");
|
||||
shader_addline(buffer, "vec4 tmp1;\n");
|
||||
if (gl_info->supported[ARB_GPU_SHADER5])
|
||||
shader_addline(buffer, "precise vec4 tmp_precise;\n");
|
||||
else
|
||||
shader_addline(buffer, "/* precise */ vec4 tmp_precise;\n");
|
||||
|
||||
if (!shader->load_local_constsF)
|
||||
{
|
||||
|
@ -3273,6 +3277,9 @@ static DWORD shader_glsl_append_dst_ext(struct wined3d_string_buffer *buffer,
|
|||
|
||||
if ((mask = shader_glsl_add_dst_param(ins, dst, &glsl_dst)))
|
||||
{
|
||||
if (ins->flags & WINED3DSI_PRECISE_XYZW)
|
||||
sprintf(glsl_dst.reg_name, "tmp_precise");
|
||||
|
||||
switch (data_type)
|
||||
{
|
||||
case WINED3D_DATA_FLOAT:
|
||||
|
@ -3316,6 +3323,13 @@ static void shader_glsl_add_instruction_modifiers(const struct wined3d_shader_in
|
|||
|
||||
if (!ins->dst_count) return;
|
||||
|
||||
if (ins->flags & WINED3DSI_PRECISE_XYZW)
|
||||
{
|
||||
shader_glsl_add_dst_param(ins, &ins->dst[0], &dst_param);
|
||||
shader_addline(ins->ctx->buffer, "%s%s = tmp_precise%s;\n",
|
||||
dst_param.reg_name, dst_param.mask_str, dst_param.mask_str);
|
||||
}
|
||||
|
||||
modifiers = ins->dst[0].modifiers;
|
||||
if (!modifiers) return;
|
||||
|
||||
|
|
Loading…
Reference in New Issue