Skip to content

Commit

Permalink
Revert Default Enum Value to None
Browse files Browse the repository at this point in the history
  • Loading branch information
jjfumero committed Dec 17, 2021
1 parent c177ded commit ef7523f
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SPIRVOperandMapper {
}
<#elseif operand.category == "BitEnum">
String[] values = tokens.next().value.split("\\|");
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.Init();
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.None();
for (String value : values) {
switch (value) {
<#list operand.enumerants as enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public class SPIRVOperandMapper {

<#macro bitenum operand>
int value = operands.next();
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.Init();
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.None();
<#list operand.enumerants as enum>
if ((value & ${enum.value}) != 0) {
<#if enum.parameters ??><#list enum.parameters as param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ public class SPIRV${kind} extends SPIRVEnum {
}
</#if>

// We need to provide a default one only for initialization.
public static SPIRV${kind} Init() {
List<SPIRVOperand> params = new ArrayList<>(0);
return new SPIRV${kind}(0x0000, "Default", params);
}

<#list enumerants as enum>
public static SPIRV${kind} ${enum.name}(<#if enum.parameters??><#list enum.parameters as param>SPIRV${param.kind} ${param.name}<#sep>, </#sep></#list></#if>) {
List<SPIRVOperand> params = new ArrayList<>(<#if enum.parameters??>${enum.parameters?size}<#else>0</#if>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SPIRVOperandMapper {
}
<#elseif operand.category == "BitEnum">
String[] values = tokens.next().value.split("\\|");
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.Init();
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.None();
for (String value : values) {
switch (value) {
<#list operand.enumerants as enum>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public class SPIRVOperandMapper {

<#macro bitenum operand>
int value = operands.next();
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.Init();
SPIRV${operand.kind} retVal = SPIRV${operand.kind}.None();
<#list operand.enumerants as enum>
if ((value & ${enum.value}) != 0) {
<#if enum.parameters ??><#list enum.parameters as param>
Expand Down
6 changes: 0 additions & 6 deletions generator/src/main/resources/templates/jdk8/operand-enum.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ public class SPIRV${kind} extends SPIRVEnum {
}
</#if>

// We need to provide a default one only for initialization.
public static SPIRV${kind} Init() {
List<SPIRVOperand> params = new ArrayList<>(0);
return new SPIRV${kind}(0x0000, "Default", params);
}

<#list enumerants as enum>
public static SPIRV${kind} ${enum.name}(<#if enum.parameters??><#list enum.parameters as param>SPIRV${param.kind} ${param.name}<#sep>, </#sep></#list></#if>) {
List<SPIRVOperand> params = new ArrayList<>(<#if enum.parameters??>${enum.parameters?size}<#else>0</#if>);
Expand Down

0 comments on commit ef7523f

Please sign in to comment.