oizma / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Particle system sample regression #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It looks like the particle_system sample has regressed. I'm trying to run it 
with r498 and it crashes here:

    ntdll.dll!_DbgBreakPoint@0()    
    d3d9d.dll!CD3DBase::DrawPrimitive()  + 0x3d8 bytes  
>   libGLESv2.dll!gl::Context::drawArrays(unsigned int mode=0, int first=0, int 
count=1000)  Line 2652 + 0x1d bytes C++
    libGLESv2.dll!glDrawArrays(unsigned int mode=0, int first=0, int count=1000)  Line 1743 C++
    particle_system.exe!Draw(ESContext * esContext=0x0042fd3c)  Line 255 + 0x11 bytes   C
    particle_system.exe!ESWindowProc(HWND__ * hWnd=0x000a09be, unsigned int uMsg=15, unsigned int wParam=0, long lParam=0)  Line 58 + 0xe bytes C

I'm using the debug D3D runtime and it is asserting with this error:

The current pixel shader expects input semantic 'texcoord0' including 
component(s): 'xy', however the current vertex shader does not output 
'texcoord0' at all.

The generated HLSL vertex shader does not output anything in TEXCOORD0:

struct VS_INPUT
{
    float3 _a_endPosition : TEXCOORD0;
    float _a_lifetime : TEXCOORD1;
    float3 _a_startPosition : TEXCOORD2;
};

struct VS_OUTPUT
{
    float4 gl_Position : POSITION;
    float1 v0 : COLOR0;
    float gl_PointSize : PSIZE;
};

VS_OUTPUT main(VS_INPUT input)
{
    _a_endPosition = (input._a_endPosition);
    _a_lifetime = (input._a_lifetime);
    _a_startPosition = (input._a_startPosition);

    gl_main();

    VS_OUTPUT output;
    output.gl_Position.x = gl_Position.x - dx_HalfPixelSize.x * gl_Position.w;
    output.gl_Position.y = -(gl_Position.y - dx_HalfPixelSize.y * gl_Position.w);
    output.gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;
    output.gl_Position.w = gl_Position.w;
    output.gl_PointSize = clamp(gl_PointSize, 1.0, 64);
    output.v0 = _v_lifetime;

    return output;
}

The generated HLSL pixel shader expects something to be in TEXCOORD0:

struct PS_INPUT
{
    float4 v0 : COLOR0;
    float2 gl_PointCoord : TEXCOORD0;
};

struct PS_OUTPUT
{
    float4 gl_Color[1] : COLOR;
};

PS_OUTPUT main(PS_INPUT input)
{
    gl_PointCoord = float2(input.gl_PointCoord.x, 1.0 - input.gl_PointCoord.y);
    _v_lifetime = input.v0;

    gl_main();

    PS_OUTPUT output;
    output.gl_Color[0] = gl_Color[0];

    return output;
}

Original issue reported on code.google.com by apatr...@chromium.org on 2 Dec 2010 at 10:44

GoogleCodeExporter commented 9 years ago
I think this might actually be a bug in the debug D3D runtime. The vertex 
shader shouldn't output anything in TEXCOORD0 because this sample is rendering 
point sprites. I'll double check...

Original comment by apatr...@chromium.org on 2 Dec 2010 at 11:19

GoogleCodeExporter commented 9 years ago

Original comment by kbr@chromium.org on 2 Dec 2010 at 11:22

GoogleCodeExporter commented 9 years ago
I'm confident this is just the debug D3D being a little over-zealous with its 
parameter validation. It applies the same validation to point sprite pixel 
shader inputs as regular primitives and incorrectly reports an error in the 
former case. Closing.

Original comment by apatr...@chromium.org on 7 Feb 2011 at 11:23