Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/glsl_shader.c | 116 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 109 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index a99762b151f..bc714f8de78 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -7613,6 +7613,53 @@ static void shader_glsl_enable_extensions(struct wined3d_string_buffer *buffer, shader_addline(buffer, "#extension GL_EXT_texture_array : enable\n"); }
+static void shader_glsl_generate_color_output(struct wined3d_string_buffer *buffer, + const struct wined3d_gl_info *gl_info, const struct wined3d_shader *shader) +{ + const struct wined3d_shader_signature *output_signature = &shader->output_signature; + unsigned int i; + + if (output_signature->element_count) + { + for (i = 0; i < output_signature->element_count; ++i) + { + const struct wined3d_shader_signature_element *output = &output_signature->elements[i]; + + if (strncasecmp(output->semantic_name, "SV_Target", sizeof("SV_Target"))) + continue; + switch (output->component_type) + { + case WINED3D_TYPE_UINT: + shader_addline(buffer, "color_out%u = floatBitsToUint(ps_out[%u]);\n", + output->semantic_idx, output->semantic_idx); + break; + case WINED3D_TYPE_INT: + shader_addline(buffer, "color_out%u = floatBitsToInt(ps_out[%u]);\n", + output->semantic_idx, output->semantic_idx); + break; + + default: + FIXME("Unhandled type %#x.\n", output->component_type); + /* Fall through. */ + case WINED3D_TYPE_UNKNOWN: + case WINED3D_TYPE_FLOAT: + shader_addline(buffer, "color_out%u = ps_out[%u];\n", + output->semantic_idx, output->semantic_idx); + } + } + } + else + { + DWORD mask = shader->reg_maps.rt_mask; + + while (mask) + { + i = wined3d_bit_scan(&mask); + shader_addline(buffer, "color_out%u = ps_out[%u];\n", i, i); + } + } +} + static void shader_glsl_generate_ps_epilogue(const struct wined3d_gl_info *gl_info, struct wined3d_string_buffer *buffer, const struct wined3d_shader *shader, const struct ps_compile_args *args) @@ -7634,6 +7681,26 @@ 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 (!needs_legacy_glsl_syntax(gl_info)) + shader_glsl_generate_color_output(buffer, gl_info, shader); +} + +static const char *shader_glsl_get_ps_output_format(enum wined3d_component_type component_type) +{ + static const char formats[][6] = + { + "", /* WINED3D_TYPE_UNKNOWN */ + "uvec4", /* WINED3D_TYPE_UINT */ + "ivec4", /* WINED3D_TYPE_INT */ + "vec4", /* WINED3D_TYPE_FLOAT */ + }; + if (component_type < WINED3D_TYPE_UNKNOWN || component_type > WINED3D_TYPE_FLOAT) + { + WARN("Unexpected component_type %#x.\n", component_type); + return formats[WINED3D_TYPE_FLOAT]; + } + return formats[component_type]; }
/* Context activation is done by the caller. */ @@ -7816,9 +7883,35 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
if (!needs_legacy_glsl_syntax(gl_info)) { - if (shader_glsl_use_explicit_attrib_location(gl_info)) - shader_addline(buffer, "layout(location = 0) "); - shader_addline(buffer, "out vec4 ps_out[%u];\n", gl_info->limits.buffers); + const struct wined3d_shader_signature *output_signature = &shader->output_signature; + + shader_addline(buffer, "vec4 ps_out[%u];\n", gl_info->limits.buffers); + if (output_signature->element_count) + { + for (i = 0; i < output_signature->element_count; ++i) + { + const struct wined3d_shader_signature_element *output = &output_signature->elements[i]; + + if (strncasecmp(output->semantic_name, "SV_Target", sizeof("SV_Target"))) + continue; + if (shader_glsl_use_explicit_attrib_location(gl_info)) + shader_addline(buffer, "layout(location = %u) ", output->semantic_idx); + shader_addline(buffer, "out %s color_out%u;\n", + shader_glsl_get_ps_output_format(output->component_type), output->semantic_idx); + } + } + else + { + DWORD mask = reg_maps->rt_mask; + + while (mask) + { + i = wined3d_bit_scan(&mask); + if (shader_glsl_use_explicit_attrib_location(gl_info)) + shader_addline(buffer, "layout(location = %u) ", i); + shader_addline(buffer, "out vec4 color_out%u;\n", i); + } + } }
if (shader->limits->constant_float + extra_constants_needed >= gl_info->limits.glsl_ps_float_constants) @@ -9536,9 +9629,10 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv *
if (!needs_legacy_glsl_syntax(gl_info)) { + shader_addline(buffer, "vec4 ps_out[1];\n"); if (shader_glsl_use_explicit_attrib_location(gl_info)) shader_addline(buffer, "layout(location = 0) "); - shader_addline(buffer, "out vec4 ps_out[1];\n"); + shader_addline(buffer, "out vec4 color_out0;\n"); }
shader_addline(buffer, "vec4 tmp0, tmp1;\n"); @@ -9878,6 +9972,8 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct shader_glsl_priv * shader_glsl_generate_fog_code(buffer, gl_info, settings->fog);
shader_glsl_generate_alpha_test(buffer, gl_info, alpha_test_func); + if (!needs_legacy_glsl_syntax(gl_info)) + shader_addline(buffer, "color_out0 = ps_out[0];\n");
shader_addline(buffer, "}\n");
@@ -10419,13 +10515,17 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const } } checkGLcall("glBindAttribLocation"); - string_buffer_release(&priv->string_buffers, tmp_name);
if (!needs_legacy_glsl_syntax(gl_info)) { - GL_EXTCALL(glBindFragDataLocation(program_id, 0, "ps_out")); - checkGLcall("glBindFragDataLocation"); + for (i = 0; i < MAX_RENDER_TARGET_VIEWS; ++i) + { + string_buffer_sprintf(tmp_name, "color_out%u", i); + GL_EXTCALL(glBindFragDataLocation(program_id, i, tmp_name->buffer)); + checkGLcall("glBindFragDataLocation"); + } } + string_buffer_release(&priv->string_buffers, tmp_name); }
if (hshader) @@ -12793,6 +12893,8 @@ static GLuint glsl_blitter_generate_program(struct wined3d_glsl_blitter *blitter shader_glsl_add_version_declaration(buffer, gl_info); shader_addline(buffer, "uniform sampler%s sampler;\n", tex_type); declare_in_varying(gl_info, buffer, FALSE, "vec3 out_texcoord;\n"); + /* TODO: Declare the out variable with the correct type (and put it in the + * blitter args). */ if (!needs_legacy_glsl_syntax(gl_info)) shader_addline(buffer, "out vec4 ps_out[1];\n");
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d9/tests/device.c | 38 +++++++++++++++++++++++++++++++++----- dlls/d3d9/tests/visual.c | 8 ++++++++ 2 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index bd1890f45c5..b71058de486 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -2861,10 +2861,11 @@ static void test_draw_primitive(void) D3DDECL_END() };
+ IDirect3DVertexBuffer9 *vertex_buffer, *current_vb; + IDirect3DIndexBuffer9 *index_buffer, *current_ib; IDirect3DVertexDeclaration9 *vertex_declaration; - IDirect3DVertexBuffer9 *vertex_buffer; - IDirect3DIndexBuffer9 *index_buffer; IDirect3DDevice9 *device; + UINT offset, stride; IDirect3D9 *d3d9; ULONG refcount; HWND window; @@ -2918,16 +2919,31 @@ static void test_draw_primitive(void) hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLELIST, 0, 2); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetStreamSource(device, 0, ¤t_vb, &offset, &stride); + ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); + ok(current_vb == vertex_buffer, "Unexpected vb %p.\n", current_vb); + ok(!offset, "Unexpected offset %u.\n", offset); + ok(stride == sizeof(*quad), "Unexpected stride %u.\n", stride); + IDirect3DVertexBuffer9_Release(current_vb); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad)); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetStreamSource(device, 0, ¤t_vb, &offset, &stride); + ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); + todo_wine ok(!current_vb, "Unexpected vb %p.\n", current_vb); + ok(!offset, "Unexpected offset %u.\n", offset); + ok(stride == sizeof(*quad), "Unexpected stride %u.\n", stride); + if (current_vb) + IDirect3DVertexBuffer9_Release(current_vb); + hr = IDirect3DDevice9_SetIndices(device, NULL); ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, 0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
- /* Valid index buffer, NULL vertex declaration. Should fail */ + /* Valid index buffer, NULL vertex declaration. */ hr = IDirect3DDevice9_SetIndices(device, index_buffer); ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, @@ -2938,6 +2954,12 @@ static void test_draw_primitive(void) indices, D3DFMT_INDEX16, quad, sizeof(*quad)); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
+ hr = IDirect3DDevice9_GetIndices(device, ¤t_ib); + ok(SUCCEEDED(hr), "GetIndices failed, hr %#x.\n", hr); + todo_wine ok(!current_ib, "Unexpected index buffer %p.\n", current_vb); + if (current_ib) + IDirect3DIndexBuffer9_Release(current_ib); + hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr);
@@ -2947,14 +2969,20 @@ static void test_draw_primitive(void) hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 2, quad, sizeof(*quad)); ok(SUCCEEDED(hr), "DrawPrimitiveUP failed, hr %#x.\n", hr);
- /* NULL index buffer, valid vertex vertex declaration. Should succeed */ + hr = IDirect3DDevice9_GetStreamSource(device, 0, ¤t_vb, &offset, &stride); + ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); + ok(!current_vb, "Unexpected vb %p.\n", current_vb); + ok(!offset, "Unexpected offset %u.\n", offset); + todo_wine ok(!stride, "Unexpected stride %u.\n", stride); + + /* NULL index buffer, valid vertex declaration, NULL stream source. */ hr = IDirect3DDevice9_SetIndices(device, NULL); ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, 0 /* MinIndex */, 4 /* NumVerts */, 0 /* StartIndex */, 2 /*PrimCount */); todo_wine ok(SUCCEEDED(hr), "DrawIndexedPrimitive failed, hr %#x.\n", hr);
- /* Valid index buffer and vertex declaration. Should succeed */ + /* Valid index buffer and vertex declaration, NULL stream source. */ hr = IDirect3DDevice9_SetIndices(device, index_buffer); ok(SUCCEEDED(hr), "SetIndices failed, hr %#x.\n", hr); hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0 /* BaseVertexIndex */, diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 835c8377e47..1e213abeb18 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -23078,7 +23078,9 @@ static void test_drawindexedprimitiveup(void) {{ 1.0f, 1.0f, 0.1f}, 0xff00ff00}, }; static const unsigned short indices[] = {0, 1, 2, 3, 4, 5, 6, 7}; + IDirect3DVertexBuffer9 *vb; IDirect3DDevice9 *device; + UINT offset, stride; IDirect3D9 *d3d; ULONG refcount; D3DCOLOR color; @@ -23126,6 +23128,12 @@ static void test_drawindexedprimitiveup(void) color = getPixelColor(device, 480, 360); ok(color_match(color, 0x00bf4000, 1), "Got unexpected color 0x%08x.\n", color);
+ hr = IDirect3DDevice9_GetStreamSource(device, 0, &vb, &offset, &stride); + ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); + ok(!vb, "Unexpected vb %p.\n", vb); + ok(!offset, "Unexpected offset %u.\n", offset); + todo_wine ok(!stride, "Unexpected stride %u.\n", stride); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/d3d8/device.c | 8 ++++++++ dlls/d3d9/device.c | 8 ++++++++ dlls/d3d9/tests/device.c | 2 +- dlls/d3d9/tests/visual.c | 2 +- dlls/wined3d/device.c | 6 ++---- 5 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 616886bcafa..e4869c2618e 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3102,6 +3102,14 @@ static HRESULT WINAPI d3d8_device_SetStreamSource(IDirect3DDevice8 *iface, iface, stream_idx, buffer, stride);
wined3d_mutex_lock(); + if (!stride) + { + struct wined3d_buffer *wined3d_buffer; + unsigned int cur_offset; + + hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, + &cur_offset, &stride); + } hr = wined3d_device_set_stream_source(device->wined3d_device, stream_idx, buffer_impl ? buffer_impl->wined3d_buffer : NULL, 0, stride); wined3d_mutex_unlock(); diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2f3ad2880d6..4016b0ccaa2 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -3349,6 +3349,14 @@ static HRESULT WINAPI d3d9_device_SetStreamSource(IDirect3DDevice9Ex *iface, iface, stream_idx, buffer, offset, stride);
wined3d_mutex_lock(); + if (!stride) + { + struct wined3d_buffer *wined3d_buffer; + unsigned int cur_offset; + + hr = wined3d_device_get_stream_source(device->wined3d_device, stream_idx, &wined3d_buffer, + &cur_offset, &stride); + } hr = wined3d_device_set_stream_source(device->wined3d_device, stream_idx, buffer_impl ? buffer_impl->wined3d_buffer : NULL, offset, stride); wined3d_mutex_unlock(); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index b71058de486..66bf5b00c50 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -2973,7 +2973,7 @@ static void test_draw_primitive(void) ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); ok(!current_vb, "Unexpected vb %p.\n", current_vb); ok(!offset, "Unexpected offset %u.\n", offset); - todo_wine ok(!stride, "Unexpected stride %u.\n", stride); + ok(!stride, "Unexpected stride %u.\n", stride);
/* NULL index buffer, valid vertex declaration, NULL stream source. */ hr = IDirect3DDevice9_SetIndices(device, NULL); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 1e213abeb18..95982e05155 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -23132,7 +23132,7 @@ static void test_drawindexedprimitiveup(void) ok(SUCCEEDED(hr), "GetStreamSource failed, hr %#x.\n", hr); ok(!vb, "Unexpected vb %p.\n", vb); ok(!offset, "Unexpected offset %u.\n", offset); - todo_wine ok(!stride, "Unexpected stride %u.\n", stride); + ok(!stride, "Unexpected stride %u.\n", stride);
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 8ef74b6ef0f..6776c5c5e0c 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1389,12 +1389,10 @@ HRESULT CDECL wined3d_device_set_stream_source(struct wined3d_device *device, UI }
stream->buffer = buffer; + stream->stride = stride; + stream->offset = offset; if (buffer) - { - stream->stride = stride; - stream->offset = offset; wined3d_buffer_incref(buffer); - }
if (!device->recording) wined3d_cs_emit_set_stream_source(device->cs, stream_idx, buffer, offset, stride);
On 6 June 2018 at 00:32, Matteo Bruni mbruni@codeweavers.com wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
dlls/d3d8/device.c | 8 ++++++++ dlls/d3d9/device.c | 8 ++++++++ dlls/d3d9/tests/device.c | 2 +- dlls/d3d9/tests/visual.c | 2 +- dlls/wined3d/device.c | 6 ++---- 5 files changed, 20 insertions(+), 6 deletions(-)
This introduces test failures:
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d10core.dll -p d3d10core_test.exe.so device && touch device.ok device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 0. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 0. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 1. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 1. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 2. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 2. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 3. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 3. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 4. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 4. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 5. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 5. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 6. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 6. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 7. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 7. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 8. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 8. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 9. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 9. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 10. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 10. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 11. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 11. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 12. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 12. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 13. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 13. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 14. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 14. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 15. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 15.
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d11.dll -p d3d11_test.exe.so d3d11 && touch d3d11.ok d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 0. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 0. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 1. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 1. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 2. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 2. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 3. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 3. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 4. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 4. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 5. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 5. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 6. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 6. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 7. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 7. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 8. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 8. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 9. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 9. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 10. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 10. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 11. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 11. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 12. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 12. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 13. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 13. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 14. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 14. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 15. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 15. d3d11.c:20644: Tests skipped: Raw buffers are not supported. d3d11.c:20644: Tests skipped: Raw buffers are not supported.
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3dx10_43.dll -p d3dx10_43_test.exe.so d3dx10 && touch d3dx10.ok d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 0. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 0. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 1. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 1. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 2. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 2. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 3. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 3. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 4. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 4. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 5. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 5. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 6. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 6. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 7. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 7. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 8. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 8. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 9. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 9. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 10. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 10. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 11. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 11. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 12. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 12. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 13. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 13. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 14. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 14. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 15. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 15.
2018-06-06 18:35 GMT+02:00 Henri Verbeet hverbeet@gmail.com:
On 6 June 2018 at 00:32, Matteo Bruni mbruni@codeweavers.com wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
dlls/d3d8/device.c | 8 ++++++++ dlls/d3d9/device.c | 8 ++++++++ dlls/d3d9/tests/device.c | 2 +- dlls/d3d9/tests/visual.c | 2 +- dlls/wined3d/device.c | 6 ++---- 5 files changed, 20 insertions(+), 6 deletions(-)
This introduces test failures:
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d10core.dll -p d3d10core_test.exe.so device && touch device.ok device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 0. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 0. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 1. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 1. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 2. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 2. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 3. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 3. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 4. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 4. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 5. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 5. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 6. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 6. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 7. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 7. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 8. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 8. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 9. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 9. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 10. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 10. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 11. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 11. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 12. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 12. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 13. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 13. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 14. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 14. device.c:5496: Test succeeded inside todo block: Got unexpected stride 0 in slot 15. device.c:5497: Test succeeded inside todo block: Got unexpected offset 0 in slot 15.
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d11.dll -p d3d11_test.exe.so d3d11 && touch d3d11.ok d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 0. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 0. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 1. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 1. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 2. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 2. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 3. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 3. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 4. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 4. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 5. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 5. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 6. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 6. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 7. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 7. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 8. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 8. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 9. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 9. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 10. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 10. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 11. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 11. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 12. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 12. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 13. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 13. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 14. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 14. d3d11.c:10652: Test succeeded inside todo block: Got unexpected stride 0 in slot 15. d3d11.c:10653: Test succeeded inside todo block: Got unexpected offset 0 in slot 15. d3d11.c:20644: Tests skipped: Raw buffers are not supported. d3d11.c:20644: Tests skipped: Raw buffers are not supported.
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3dx10_43.dll -p d3dx10_43_test.exe.so d3dx10 && touch d3dx10.ok d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 0. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 0. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 1. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 1. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 2. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 2. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 3. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 3. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 4. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 4. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 5. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 5. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 6. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 6. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 7. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 7. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 8. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 8. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 9. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 9. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 10. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 10. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 11. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 11. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 12. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 12. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 13. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 13. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 14. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 14. d3dx10.c:483: Test succeeded inside todo block: Got unexpected stride 0 in slot 15. d3dx10.c:484: Test succeeded inside todo block: Got unexpected offset 0 in slot 15.
Urgh, not sure how I missed these...
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- It will be set again before calling the next draw_primitive() and AFAICS can't be accessed in the meantime.
dlls/d3d9/device.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 4016b0ccaa2..e32bc14af5b 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2946,7 +2946,6 @@ static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *ifa
wined3d_device_set_stream_source(device->wined3d_device, 0, NULL, 0, 0); wined3d_device_set_index_buffer(device->wined3d_device, NULL, WINED3DFMT_UNKNOWN, 0); - wined3d_device_set_base_vertex_index(device->wined3d_device, 0);
if (SUCCEEDED(hr)) d3d9_rts_flag_auto_gen_mipmap(device);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
From: Józef Kucia jkucia@codeweavers.com
Signed-off-by: Józef Kucia jkucia@codeweavers.com Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- I haven't tested it but I suspect https://lists.freedesktop.org/archives/mesa-dev/2018-June/196667.html fixes this test on Intel.
dlls/d3d11/tests/d3d11.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+)
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 1043722eb58..c641372bc8e 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -24602,6 +24602,57 @@ static void test_fractional_viewports(void) release_test_context(&test_context); }
+static void test_negative_viewports(const D3D_FEATURE_LEVEL feature_level) +{ + struct d3d11_test_context test_context; + ID3D11DeviceContext *context; + BOOL quirk; + RECT rect; + + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const struct vec4 green = {0.0f, 1.0f, 0.0f, 1.0f}; + + if (!init_test_context(&test_context, &feature_level)) + return; + context = test_context.immediate_context; + + set_viewport(context, 0.0f, 0.0f, 640.0f, 480.0f, 0.0f, 1.0f); + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, white); + draw_color_quad(&test_context, &green); + check_texture_color(test_context.backbuffer, 0xff00ff00, 0); + + set_viewport(context, -0.0f, -0.0f, 640.0f, 480.0f, 0.0f, 1.0f); + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, white); + draw_color_quad(&test_context, &green); + check_texture_color(test_context.backbuffer, 0xff00ff00, 0); + + /* For feature levels greater than or equal to 11_0, a negative top left + * corner shifts the bottom right corner by a whole integer. It seems that + * floor() is used to round viewport corners to integers. + */ + quirk = feature_level >= D3D_FEATURE_LEVEL_11_0; + + set_viewport(context, -0.4f, -0.4f, 640.0f, 480.0f, 0.0f, 1.0f); + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, white); + draw_color_quad(&test_context, &green); + SetRect(&rect, 0, 0, 639, 479); + check_texture_sub_resource_color(test_context.backbuffer, 0, &rect, 0xff00ff00, 1); + SetRect(&rect, 639, 479, 640, 480); + todo_wine_if(quirk) + check_texture_sub_resource_color(test_context.backbuffer, 0, &rect, quirk ? 0xffffffff : 0xff00ff00, 1); + + set_viewport(context, -1.0f / 128.0f, -1.0 / 128.0f, 640.0f, 480.0f, 0.0f, 1.0f); + ID3D11DeviceContext_ClearRenderTargetView(context, test_context.backbuffer_rtv, white); + draw_color_quad(&test_context, &green); + SetRect(&rect, 0, 0, 639, 479); + check_texture_sub_resource_color(test_context.backbuffer, 0, &rect, 0xff00ff00, 1); + SetRect(&rect, 639, 479, 640, 480); + todo_wine_if(quirk) + check_texture_sub_resource_color(test_context.backbuffer, 0, &rect, quirk ? 0xffffffff : 0xff00ff00, 1); + + release_test_context(&test_context); +} + static void test_early_depth_stencil(void) { ID3D11DepthStencilState *depth_stencil_state; @@ -27669,6 +27720,7 @@ START_TEST(d3d11) test_gather_c(); test_depth_bias(); test_fractional_viewports(); + run_for_each_feature_level_in_range(D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_11_0, test_negative_viewports); test_early_depth_stencil(); test_conservative_depth_output(); test_format_compatibility();
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=39001
Your paranoid android.
=== build (build) === Could not determine the test executable's base name
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Hi Matteo,
On 06/06/18 08:32, Matteo Bruni wrote:
Signed-of {
GL_EXTCALL(glBindFragDataLocation(program_id, 0, "ps_out"));
checkGLcall("glBindFragDataLocation");
for (i = 0; i < MAX_RENDER_TARGET_VIEWS; ++i)
Is there a reason why MAX_RENDER_TARGET_VIEWS is used instead of "gl_info->limits.buffers"?
Regards Alistair.
2018-06-06 3:32 GMT+02:00 Alistair Leslie-Hughes leslie_alistair@hotmail.com:
Hi Matteo,
On 06/06/18 08:32, Matteo Bruni wrote:
{
GL_EXTCALL(glBindFragDataLocation(program_id, 0, "ps_out"));
checkGLcall("glBindFragDataLocation");
for (i = 0; i < MAX_RENDER_TARGET_VIEWS; ++i)
Is there a reason why MAX_RENDER_TARGET_VIEWS is used instead of "gl_info->limits.buffers"?
Hmm, it was intentional but it looks like it doesn't matter in practice. We only execute that if (!needs_legacy_glsl_syntax()), which means GLSL 1.30+ and thus OpenGL 3.0+. That requires that GL_MAX_DRAW_BUFFERS is >= 8. OpenGL ES apparently only mandates 4 draw buffers so things would be a bit more murky there, except that there is no glBindFragDataLocation() in ES at all (you're supposed to use layout qualifiers in the fragment shader instead - I guess I'll have to rework it again to handle that).
Anyway, I can switch to gl_info->limits.buffers, it shouldn't hurt and I have to resend it anyway...
On 6 June 2018 at 18:25, Matteo Bruni matteo.mystral@gmail.com wrote:
Hmm, it was intentional but it looks like it doesn't matter in practice. We only execute that if (!needs_legacy_glsl_syntax()), which means GLSL 1.30+ and thus OpenGL 3.0+. That requires that GL_MAX_DRAW_BUFFERS is >= 8. OpenGL ES apparently only mandates 4 draw buffers so things would be a bit more murky there, except that there is no glBindFragDataLocation() in ES at all (you're supposed to use layout qualifiers in the fragment shader instead - I guess I'll have to rework it again to handle that).
Anyway, I can switch to gl_info->limits.buffers, it shouldn't hurt and I have to resend it anyway...
I don't think it (currently) happens in practice, but gl_info->limits.buffers can potentially be larger than MAX_RENDER_TARGET_VIEWS.
2018-06-06 18:30 GMT+02:00 Henri Verbeet hverbeet@gmail.com:
On 6 June 2018 at 18:25, Matteo Bruni matteo.mystral@gmail.com wrote:
Hmm, it was intentional but it looks like it doesn't matter in practice. We only execute that if (!needs_legacy_glsl_syntax()), which means GLSL 1.30+ and thus OpenGL 3.0+. That requires that GL_MAX_DRAW_BUFFERS is >= 8. OpenGL ES apparently only mandates 4 draw buffers so things would be a bit more murky there, except that there is no glBindFragDataLocation() in ES at all (you're supposed to use layout qualifiers in the fragment shader instead - I guess I'll have to rework it again to handle that).
Anyway, I can switch to gl_info->limits.buffers, it shouldn't hurt and I have to resend it anyway...
I don't think it (currently) happens in practice, but gl_info->limits.buffers can potentially be larger than MAX_RENDER_TARGET_VIEWS.
Yeah, it's currently clamped to MAX_RENDER_TARGET_VIEWS.
I can also leave this as-is :)
On 6 June 2018 at 00:32, Matteo Bruni mbruni@codeweavers.com wrote:
+static void shader_glsl_generate_color_output(struct wined3d_string_buffer *buffer,
const struct wined3d_gl_info *gl_info, const struct wined3d_shader *shader)
+{
- const struct wined3d_shader_signature *output_signature = &shader->output_signature;
- unsigned int i;
- if (output_signature->element_count)
- {
for (i = 0; i < output_signature->element_count; ++i)
{
const struct wined3d_shader_signature_element *output = &output_signature->elements[i];
if (strncasecmp(output->semantic_name, "SV_Target", sizeof("SV_Target")))
continue;
Should this really match against the "semantic_name" string, or does the "sysval_semantic" field also contain that information?
switch (output->component_type)
{
case WINED3D_TYPE_UINT:
shader_addline(buffer, "color_out%u = floatBitsToUint(ps_out[%u]);\n",
output->semantic_idx, output->semantic_idx);
break;
case WINED3D_TYPE_INT:
shader_addline(buffer, "color_out%u = floatBitsToInt(ps_out[%u]);\n",
output->semantic_idx, output->semantic_idx);
break;
default:
FIXME("Unhandled type %#x.\n", output->component_type);
/* Fall through. */
case WINED3D_TYPE_UNKNOWN:
case WINED3D_TYPE_FLOAT:
shader_addline(buffer, "color_out%u = ps_out[%u];\n",
output->semantic_idx, output->semantic_idx);
}
I think shader_glsl_sprintf_cast() with appropriate arguments could also handle this.
On 6 June 2018 at 00:32, Matteo Bruni mbruni@codeweavers.com wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
dlls/wined3d/glsl_shader.c | 116 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 109 insertions(+), 7 deletions(-)
This fails the tests here:
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d10core.dll -p d3d10core_test.exe.so device && touch device.ok device.c:11300: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0), sub-resource 0. device.c:11307: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0), sub-resource 0.
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d11.dll -p d3d11_test.exe.so d3d11 && touch d3d11.ok d3d11.c:14777: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0, 0), sub-resource 0. d3d11.c:14784: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0, 0), sub-resource 0. d3d11.c:20644: Tests skipped: Raw buffers are not supported. d3d11.c:20644: Tests skipped: Raw buffers are not supported.
2018-06-07 17:07 GMT+02:00 Henri Verbeet hverbeet@gmail.com:
On 6 June 2018 at 00:32, Matteo Bruni mbruni@codeweavers.com wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
dlls/wined3d/glsl_shader.c | 116 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 109 insertions(+), 7 deletions(-)
This fails the tests here:
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d10core.dll -p d3d10core_test.exe.so device && touch device.ok device.c:11300: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0), sub-resource 0. device.c:11307: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0), sub-resource 0.
../../../../../src/wine-git/tools/runtest -q -P wine -T ../../.. -M d3d11.dll -p d3d11_test.exe.so d3d11 && touch d3d11.ok d3d11.c:14777: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0, 0), sub-resource 0. d3d11.c:14784: Test failed: Got 0xff0000ff, expected 0xff00ff00 at (0, 0, 0), sub-resource 0. d3d11.c:20644: Tests skipped: Raw buffers are not supported. d3d11.c:20644: Tests skipped: Raw buffers are not supported.
:/
This time I know why I missed these (didn't notice them in the midst of other test failures), still not great... I have a fix coming.