mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-28 18:31:40 +00:00
Implement OpDot
This commit is contained in:
@@ -1168,6 +1168,25 @@ void ThreadState::StepNext(ShaderDebugState *state,
|
||||
SetDst(state, math.result, var);
|
||||
break;
|
||||
}
|
||||
case Op::Dot:
|
||||
{
|
||||
OpDot dot(it);
|
||||
|
||||
ShaderVariable var = GetSrc(dot.vector1);
|
||||
ShaderVariable b = GetSrc(dot.vector2);
|
||||
|
||||
RDCASSERTEQUAL(var.columns, b.columns);
|
||||
|
||||
float ret = 0;
|
||||
for(uint8_t c = 0; c < var.columns; c++)
|
||||
ret += var.value.fv[c] * b.value.fv[c];
|
||||
|
||||
var.columns = 1;
|
||||
var.value.f.x = ret;
|
||||
|
||||
SetDst(state, dot.result, var);
|
||||
break;
|
||||
}
|
||||
case Op::VectorTimesScalar:
|
||||
{
|
||||
OpVectorTimesScalar mul(it);
|
||||
|
||||
@@ -264,6 +264,13 @@ void main()
|
||||
Color = vec4(cross(a, b), 1.0f);
|
||||
break;
|
||||
}
|
||||
case 25:
|
||||
{
|
||||
vec4 a = vec4(posone*2.5f, negone*1.8f, posone*8.5f, posone*3.9f);
|
||||
vec4 b = vec4(negone*6.3f, posone*3.2f, negone*0.4f, zerof);
|
||||
Color = vec4(dot(a.xyz, b.xyz), dot(a.w, b.w), dot(a, b), dot(a.wz, b.ww));
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user