On Wed, Mar 25, 2020 at 1:19 AM Zebediah Figura z.figura12@gmail.com wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
v2: fix some version checks
dlls/d3dcompiler_43/bytecodewriter.c | 30 ++++++++++++++--------- dlls/d3dcompiler_43/d3dcompiler_private.h | 3 +-- 2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/dlls/d3dcompiler_43/bytecodewriter.c b/dlls/d3dcompiler_43/bytecodewriter.c index 8b016cd6201..35bd6669ef9 100644 --- a/dlls/d3dcompiler_43/bytecodewriter.c +++ b/dlls/d3dcompiler_43/bytecodewriter.c @@ -939,7 +939,8 @@ static void vs_12_dstreg(struct bc_writer *This, const struct shader_reg *reg, break;
case BWRITERSPR_PREDICATE:
if(This->version != BWRITERVS_VERSION(2, 1)){
if (This->shader->major_version != 2 || This->shader->minor_version != 1)
{ WARN("Predicate register is allowed only in vs_2_x\n"); This->state = E_INVALIDARG; return;
@@ -1634,7 +1635,8 @@ static void vs_2_srcreg(struct bc_writer *This, break;
case BWRITERSPR_PREDICATE:
if(This->version != BWRITERVS_VERSION(2, 1)){
if (This->shader->major_version != 2 || This->shader->minor_version != 1)
{ WARN("Predicate register is allowed only in vs_2_x\n"); This->state = E_INVALIDARG; return;
For this one the major version check should be unnecessary since it's only used for vs_2_0 and vs_2_x. It's okay though. Also nice that you simplified most of the checks below.