ReactOS  0.4.13-dev-249-gcba1a2f
shader_sm4.c File Reference
#include "config.h"
#include "wine/port.h"
#include "wined3d_private.h"
Include dependency graph for shader_sm4.c:

Go to the source code of this file.

Classes

struct  wined3d_shader_src_param_entry
 
struct  wined3d_sm4_data
 
struct  wined3d_sm4_opcode_info
 

Macros

#define WINED3D_SM4_INSTRUCTION_MODIFIER   (0x1u << 31)
 
#define WINED3D_SM4_MODIFIER_AOFFIMMI   0x1
 
#define WINED3D_SM4_AOFFIMMI_U_SHIFT   9
 
#define WINED3D_SM4_AOFFIMMI_U_MASK   (0xfu << WINED3D_SM4_AOFFIMMI_U_SHIFT)
 
#define WINED3D_SM4_AOFFIMMI_V_SHIFT   13
 
#define WINED3D_SM4_AOFFIMMI_V_MASK   (0xfu << WINED3D_SM4_AOFFIMMI_V_SHIFT)
 
#define WINED3D_SM4_AOFFIMMI_W_SHIFT   17
 
#define WINED3D_SM4_AOFFIMMI_W_MASK   (0xfu << WINED3D_SM4_AOFFIMMI_W_SHIFT)
 
#define WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT   24
 
#define WINED3D_SM4_INSTRUCTION_LENGTH_MASK   (0x1fu << WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT)
 
#define WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT   11
 
#define WINED3D_SM4_INSTRUCTION_FLAGS_MASK   (0x7u << WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT)
 
#define WINED3D_SM4_RESOURCE_TYPE_SHIFT   11
 
#define WINED3D_SM4_RESOURCE_TYPE_MASK   (0xfu << WINED3D_SM4_RESOURCE_TYPE_SHIFT)
 
#define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT   11
 
#define WINED3D_SM4_PRIMITIVE_TYPE_MASK   (0x3fu << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT)
 
#define WINED3D_SM4_INDEX_TYPE_SHIFT   11
 
#define WINED3D_SM4_INDEX_TYPE_MASK   (0x1u << WINED3D_SM4_INDEX_TYPE_SHIFT)
 
#define WINED3D_SM4_SAMPLER_MODE_SHIFT   11
 
#define WINED3D_SM4_SAMPLER_MODE_MASK   (0xfu << WINED3D_SM4_SAMPLER_MODE_SHIFT)
 
#define WINED3D_SM4_SHADER_DATA_TYPE_SHIFT   11
 
#define WINED3D_SM4_SHADER_DATA_TYPE_MASK   (0xfu << WINED3D_SM4_SHADER_DATA_TYPE_SHIFT)
 
#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT   11
 
#define WINED3D_SM4_INTERPOLATION_MODE_MASK   (0xfu << WINED3D_SM4_INTERPOLATION_MODE_SHIFT)
 
#define WINED3D_SM4_GLOBAL_FLAGS_SHIFT   11
 
#define WINED3D_SM4_GLOBAL_FLAGS_MASK   (0xffu << WINED3D_SM4_GLOBAL_FLAGS_SHIFT)
 
#define WINED3D_SM5_PRECISE_SHIFT   19
 
#define WINED3D_SM5_PRECISE_MASK   (0xfu << WINED3D_SM5_PRECISE_SHIFT)
 
#define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT   11
 
#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK   (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT)
 
#define WINED3D_SM5_FP_ARRAY_SIZE_SHIFT   16
 
#define WINED3D_SM5_FP_TABLE_COUNT_MASK   0xffffu
 
#define WINED3D_SM5_UAV_FLAGS_SHIFT   15
 
#define WINED3D_SM5_UAV_FLAGS_MASK   (0x1ffu << WINED3D_SM5_UAV_FLAGS_SHIFT)
 
#define WINED3D_SM5_SYNC_FLAGS_SHIFT   11
 
#define WINED3D_SM5_SYNC_FLAGS_MASK   (0xffu << WINED3D_SM5_SYNC_FLAGS_SHIFT)
 
#define WINED3D_SM5_TESSELLATOR_SHIFT   11
 
#define WINED3D_SM5_TESSELLATOR_MASK   (0xfu << WINED3D_SM5_TESSELLATOR_SHIFT)
 
#define WINED3D_SM4_OPCODE_MASK   0xff
 
#define WINED3D_SM4_REGISTER_MODIFIER   (0x1u << 31)
 
#define WINED3D_SM4_ADDRESSING_SHIFT1   25
 
#define WINED3D_SM4_ADDRESSING_MASK1   (0x3u << WINED3D_SM4_ADDRESSING_SHIFT1)
 
#define WINED3D_SM4_ADDRESSING_SHIFT0   22
 
#define WINED3D_SM4_ADDRESSING_MASK0   (0x3u << WINED3D_SM4_ADDRESSING_SHIFT0)
 
#define WINED3D_SM4_REGISTER_ORDER_SHIFT   20
 
#define WINED3D_SM4_REGISTER_ORDER_MASK   (0x3u << WINED3D_SM4_REGISTER_ORDER_SHIFT)
 
#define WINED3D_SM4_REGISTER_TYPE_SHIFT   12
 
#define WINED3D_SM4_REGISTER_TYPE_MASK   (0xffu << WINED3D_SM4_REGISTER_TYPE_SHIFT)
 
#define WINED3D_SM4_SWIZZLE_TYPE_SHIFT   2
 
#define WINED3D_SM4_SWIZZLE_TYPE_MASK   (0x3u << WINED3D_SM4_SWIZZLE_TYPE_SHIFT)
 
#define WINED3D_SM4_IMMCONST_TYPE_SHIFT   0
 
#define WINED3D_SM4_IMMCONST_TYPE_MASK   (0x3u << WINED3D_SM4_IMMCONST_TYPE_SHIFT)
 
#define WINED3D_SM4_WRITEMASK_SHIFT   4
 
#define WINED3D_SM4_WRITEMASK_MASK   (0xfu << WINED3D_SM4_WRITEMASK_SHIFT)
 
#define WINED3D_SM4_SWIZZLE_SHIFT   4
 
#define WINED3D_SM4_SWIZZLE_MASK   (0xffu << WINED3D_SM4_SWIZZLE_SHIFT)
 
#define WINED3D_SM4_VERSION_MAJOR(version)   (((version) >> 4) & 0xf)
 
#define WINED3D_SM4_VERSION_MINOR(version)   (((version) >> 0) & 0xf)
 
#define WINED3D_SM4_ADDRESSING_RELATIVE   0x2
 
#define WINED3D_SM4_ADDRESSING_OFFSET   0x1
 
#define WINED3D_SM4_INSTRUCTION_FLAG_SATURATE   0x4
 
#define WINED3D_SM4_CONDITIONAL_NZ   (0x1u << 18)
 

Enumerations

enum  wined3d_sm4_opcode {
  WINED3D_SM4_OP_ADD = 0x00, WINED3D_SM4_OP_AND = 0x01, WINED3D_SM4_OP_BREAK = 0x02, WINED3D_SM4_OP_BREAKC = 0x03,
  WINED3D_SM4_OP_CASE = 0x06, WINED3D_SM4_OP_CONTINUE = 0x07, WINED3D_SM4_OP_CONTINUEC = 0x08, WINED3D_SM4_OP_CUT = 0x09,
  WINED3D_SM4_OP_DEFAULT = 0x0a, WINED3D_SM4_OP_DERIV_RTX = 0x0b, WINED3D_SM4_OP_DERIV_RTY = 0x0c, WINED3D_SM4_OP_DISCARD = 0x0d,
  WINED3D_SM4_OP_DIV = 0x0e, WINED3D_SM4_OP_DP2 = 0x0f, WINED3D_SM4_OP_DP3 = 0x10, WINED3D_SM4_OP_DP4 = 0x11,
  WINED3D_SM4_OP_ELSE = 0x12, WINED3D_SM4_OP_EMIT = 0x13, WINED3D_SM4_OP_ENDIF = 0x15, WINED3D_SM4_OP_ENDLOOP = 0x16,
  WINED3D_SM4_OP_ENDSWITCH = 0x17, WINED3D_SM4_OP_EQ = 0x18, WINED3D_SM4_OP_EXP = 0x19, WINED3D_SM4_OP_FRC = 0x1a,
  WINED3D_SM4_OP_FTOI = 0x1b, WINED3D_SM4_OP_FTOU = 0x1c, WINED3D_SM4_OP_GE = 0x1d, WINED3D_SM4_OP_IADD = 0x1e,
  WINED3D_SM4_OP_IF = 0x1f, WINED3D_SM4_OP_IEQ = 0x20, WINED3D_SM4_OP_IGE = 0x21, WINED3D_SM4_OP_ILT = 0x22,
  WINED3D_SM4_OP_IMAD = 0x23, WINED3D_SM4_OP_IMAX = 0x24, WINED3D_SM4_OP_IMIN = 0x25, WINED3D_SM4_OP_IMUL = 0x26,
  WINED3D_SM4_OP_INE = 0x27, WINED3D_SM4_OP_INEG = 0x28, WINED3D_SM4_OP_ISHL = 0x29, WINED3D_SM4_OP_ISHR = 0x2a,
  WINED3D_SM4_OP_ITOF = 0x2b, WINED3D_SM4_OP_LABEL = 0x2c, WINED3D_SM4_OP_LD = 0x2d, WINED3D_SM4_OP_LD2DMS = 0x2e,
  WINED3D_SM4_OP_LOG = 0x2f, WINED3D_SM4_OP_LOOP = 0x30, WINED3D_SM4_OP_LT = 0x31, WINED3D_SM4_OP_MAD = 0x32,
  WINED3D_SM4_OP_MIN = 0x33, WINED3D_SM4_OP_MAX = 0x34, WINED3D_SM4_OP_SHADER_DATA = 0x35, WINED3D_SM4_OP_MOV = 0x36,
  WINED3D_SM4_OP_MOVC = 0x37, WINED3D_SM4_OP_MUL = 0x38, WINED3D_SM4_OP_NE = 0x39, WINED3D_SM4_OP_NOP = 0x3a,
  WINED3D_SM4_OP_NOT = 0x3b, WINED3D_SM4_OP_OR = 0x3c, WINED3D_SM4_OP_RESINFO = 0x3d, WINED3D_SM4_OP_RET = 0x3e,
  WINED3D_SM4_OP_RETC = 0x3f, WINED3D_SM4_OP_ROUND_NE = 0x40, WINED3D_SM4_OP_ROUND_NI = 0x41, WINED3D_SM4_OP_ROUND_PI = 0x42,
  WINED3D_SM4_OP_ROUND_Z = 0x43, WINED3D_SM4_OP_RSQ = 0x44, WINED3D_SM4_OP_SAMPLE = 0x45, WINED3D_SM4_OP_SAMPLE_C = 0x46,
  WINED3D_SM4_OP_SAMPLE_C_LZ = 0x47, WINED3D_SM4_OP_SAMPLE_LOD = 0x48, WINED3D_SM4_OP_SAMPLE_GRAD = 0x49, WINED3D_SM4_OP_SAMPLE_B = 0x4a,
  WINED3D_SM4_OP_SQRT = 0x4b, WINED3D_SM4_OP_SWITCH = 0x4c, WINED3D_SM4_OP_SINCOS = 0x4d, WINED3D_SM4_OP_UDIV = 0x4e,
  WINED3D_SM4_OP_ULT = 0x4f, WINED3D_SM4_OP_UGE = 0x50, WINED3D_SM4_OP_UMUL = 0x51, WINED3D_SM4_OP_UMAX = 0x53,
  WINED3D_SM4_OP_UMIN = 0x54, WINED3D_SM4_OP_USHR = 0x55, WINED3D_SM4_OP_UTOF = 0x56, WINED3D_SM4_OP_XOR = 0x57,
  WINED3D_SM4_OP_DCL_RESOURCE = 0x58, WINED3D_SM4_OP_DCL_CONSTANT_BUFFER = 0x59, WINED3D_SM4_OP_DCL_SAMPLER = 0x5a, WINED3D_SM4_OP_DCL_INDEX_RANGE = 0x5b,
  WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY = 0x5c, WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE = 0x5d, WINED3D_SM4_OP_DCL_VERTICES_OUT = 0x5e, WINED3D_SM4_OP_DCL_INPUT = 0x5f,
  WINED3D_SM4_OP_DCL_INPUT_SGV = 0x60, WINED3D_SM4_OP_DCL_INPUT_SIV = 0x61, WINED3D_SM4_OP_DCL_INPUT_PS = 0x62, WINED3D_SM4_OP_DCL_INPUT_PS_SGV = 0x63,
  WINED3D_SM4_OP_DCL_INPUT_PS_SIV = 0x64, WINED3D_SM4_OP_DCL_OUTPUT = 0x65, WINED3D_SM4_OP_DCL_OUTPUT_SIV = 0x67, WINED3D_SM4_OP_DCL_TEMPS = 0x68,
  WINED3D_SM4_OP_DCL_INDEXABLE_TEMP = 0x69, WINED3D_SM4_OP_DCL_GLOBAL_FLAGS = 0x6a, WINED3D_SM4_OP_LOD = 0x6c, WINED3D_SM4_OP_GATHER4 = 0x6d,
  WINED3D_SM4_OP_SAMPLE_POS = 0x6e, WINED3D_SM4_OP_SAMPLE_INFO = 0x6f, WINED3D_SM5_OP_HS_DECLS = 0x71, WINED3D_SM5_OP_HS_CONTROL_POINT_PHASE = 0x72,
  WINED3D_SM5_OP_HS_FORK_PHASE = 0x73, WINED3D_SM5_OP_HS_JOIN_PHASE = 0x74, WINED3D_SM5_OP_EMIT_STREAM = 0x75, WINED3D_SM5_OP_CUT_STREAM = 0x76,
  WINED3D_SM5_OP_FCALL = 0x78, WINED3D_SM5_OP_BUFINFO = 0x79, WINED3D_SM5_OP_DERIV_RTX_COARSE = 0x7a, WINED3D_SM5_OP_DERIV_RTX_FINE = 0x7b,
  WINED3D_SM5_OP_DERIV_RTY_COARSE = 0x7c, WINED3D_SM5_OP_DERIV_RTY_FINE = 0x7d, WINED3D_SM5_OP_GATHER4_C = 0x7e, WINED3D_SM5_OP_GATHER4_PO = 0x7f,
  WINED3D_SM5_OP_GATHER4_PO_C = 0x80, WINED3D_SM5_OP_RCP = 0x81, WINED3D_SM5_OP_F32TOF16 = 0x82, WINED3D_SM5_OP_F16TOF32 = 0x83,
  WINED3D_SM5_OP_COUNTBITS = 0x86, WINED3D_SM5_OP_FIRSTBIT_HI = 0x87, WINED3D_SM5_OP_FIRSTBIT_LO = 0x88, WINED3D_SM5_OP_FIRSTBIT_SHI = 0x89,
  WINED3D_SM5_OP_UBFE = 0x8a, WINED3D_SM5_OP_IBFE = 0x8b, WINED3D_SM5_OP_BFI = 0x8c, WINED3D_SM5_OP_BFREV = 0x8d,
  WINED3D_SM5_OP_SWAPC = 0x8e, WINED3D_SM5_OP_DCL_STREAM = 0x8f, WINED3D_SM5_OP_DCL_FUNCTION_BODY = 0x90, WINED3D_SM5_OP_DCL_FUNCTION_TABLE = 0x91,
  WINED3D_SM5_OP_DCL_INTERFACE = 0x92, WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT = 0x93, WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT = 0x94, WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN = 0x95,
  WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING = 0x96, WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE = 0x97, WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR = 0x98, WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT = 0x99,
  WINED3D_SM5_OP_DCL_HS_JOIN_PHASE_INSTANCE_COUNT = 0x9a, WINED3D_SM5_OP_DCL_THREAD_GROUP = 0x9b, WINED3D_SM5_OP_DCL_UAV_TYPED = 0x9c, WINED3D_SM5_OP_DCL_UAV_RAW = 0x9d,
  WINED3D_SM5_OP_DCL_UAV_STRUCTURED = 0x9e, WINED3D_SM5_OP_DCL_TGSM_RAW = 0x9f, WINED3D_SM5_OP_DCL_TGSM_STRUCTURED = 0xa0, WINED3D_SM5_OP_DCL_RESOURCE_RAW = 0xa1,
  WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED = 0xa2, WINED3D_SM5_OP_LD_UAV_TYPED = 0xa3, WINED3D_SM5_OP_STORE_UAV_TYPED = 0xa4, WINED3D_SM5_OP_LD_RAW = 0xa5,
  WINED3D_SM5_OP_STORE_RAW = 0xa6, WINED3D_SM5_OP_LD_STRUCTURED = 0xa7, WINED3D_SM5_OP_STORE_STRUCTURED = 0xa8, WINED3D_SM5_OP_ATOMIC_AND = 0xa9,
  WINED3D_SM5_OP_ATOMIC_OR = 0xaa, WINED3D_SM5_OP_ATOMIC_XOR = 0xab, WINED3D_SM5_OP_ATOMIC_CMP_STORE = 0xac, WINED3D_SM5_OP_ATOMIC_IADD = 0xad,
  WINED3D_SM5_OP_ATOMIC_IMAX = 0xae, WINED3D_SM5_OP_ATOMIC_IMIN = 0xaf, WINED3D_SM5_OP_ATOMIC_UMAX = 0xb0, WINED3D_SM5_OP_ATOMIC_UMIN = 0xb1,
  WINED3D_SM5_OP_IMM_ATOMIC_ALLOC = 0xb2, WINED3D_SM5_OP_IMM_ATOMIC_CONSUME = 0xb3, WINED3D_SM5_OP_IMM_ATOMIC_IADD = 0xb4, WINED3D_SM5_OP_IMM_ATOMIC_AND = 0xb5,
  WINED3D_SM5_OP_IMM_ATOMIC_OR = 0xb6, WINED3D_SM5_OP_IMM_ATOMIC_XOR = 0xb7, WINED3D_SM5_OP_IMM_ATOMIC_EXCH = 0xb8, WINED3D_SM5_OP_IMM_ATOMIC_CMP_EXCH = 0xb9,
  WINED3D_SM5_OP_IMM_ATOMIC_IMAX = 0xba, WINED3D_SM5_OP_IMM_ATOMIC_IMIN = 0xbb, WINED3D_SM5_OP_IMM_ATOMIC_UMAX = 0xbc, WINED3D_SM5_OP_IMM_ATOMIC_UMIN = 0xbd,
  WINED3D_SM5_OP_SYNC = 0xbe, WINED3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, WINED3D_SM5_OP_DCL_GS_INSTANCES = 0xce
}
 
enum  wined3d_sm4_register_type {
  WINED3D_SM4_RT_TEMP = 0x00, WINED3D_SM4_RT_INPUT = 0x01, WINED3D_SM4_RT_OUTPUT = 0x02, WINED3D_SM4_RT_INDEXABLE_TEMP = 0x03,
  WINED3D_SM4_RT_IMMCONST = 0x04, WINED3D_SM4_RT_SAMPLER = 0x06, WINED3D_SM4_RT_RESOURCE = 0x07, WINED3D_SM4_RT_CONSTBUFFER = 0x08,
  WINED3D_SM4_RT_IMMCONSTBUFFER = 0x09, WINED3D_SM4_RT_PRIMID = 0x0b, WINED3D_SM4_RT_DEPTHOUT = 0x0c, WINED3D_SM4_RT_NULL = 0x0d,
  WINED3D_SM4_RT_RASTERIZER = 0x0e, WINED3D_SM4_RT_OMASK = 0x0f, WINED3D_SM5_RT_STREAM = 0x10, WINED3D_SM5_RT_FUNCTION_BODY = 0x11,
  WINED3D_SM5_RT_FUNCTION_POINTER = 0x13, WINED3D_SM5_RT_OUTPUT_CONTROL_POINT_ID = 0x16, WINED3D_SM5_RT_FORK_INSTANCE_ID = 0x17, WINED3D_SM5_RT_JOIN_INSTANCE_ID = 0x18,
  WINED3D_SM5_RT_INPUT_CONTROL_POINT = 0x19, WINED3D_SM5_RT_OUTPUT_CONTROL_POINT = 0x1a, WINED3D_SM5_RT_PATCH_CONSTANT_DATA = 0x1b, WINED3D_SM5_RT_DOMAIN_LOCATION = 0x1c,
  WINED3D_SM5_RT_UAV = 0x1e, WINED3D_SM5_RT_SHARED_MEMORY = 0x1f, WINED3D_SM5_RT_THREAD_ID = 0x20, WINED3D_SM5_RT_THREAD_GROUP_ID = 0x21,
  WINED3D_SM5_RT_LOCAL_THREAD_ID = 0x22, WINED3D_SM5_RT_COVERAGE = 0x23, WINED3D_SM5_RT_LOCAL_THREAD_INDEX = 0x24, WINED3D_SM5_RT_GS_INSTANCE_ID = 0x25,
  WINED3D_SM5_RT_DEPTHOUT_GREATER_EQUAL = 0x26, WINED3D_SM5_RT_DEPTHOUT_LESS_EQUAL = 0x27
}
 
enum  wined3d_sm4_output_primitive_type { WINED3D_SM4_OUTPUT_PT_POINTLIST = 0x1, WINED3D_SM4_OUTPUT_PT_LINESTRIP = 0x3, WINED3D_SM4_OUTPUT_PT_TRIANGLESTRIP = 0x5 }
 
enum  wined3d_sm4_input_primitive_type {
  WINED3D_SM4_INPUT_PT_POINT = 0x01, WINED3D_SM4_INPUT_PT_LINE = 0x02, WINED3D_SM4_INPUT_PT_TRIANGLE = 0x03, WINED3D_SM4_INPUT_PT_LINEADJ = 0x06,
  WINED3D_SM4_INPUT_PT_TRIANGLEADJ = 0x07, WINED3D_SM5_INPUT_PT_PATCH1 = 0x08, WINED3D_SM5_INPUT_PT_PATCH2 = 0x09, WINED3D_SM5_INPUT_PT_PATCH3 = 0x0a,
  WINED3D_SM5_INPUT_PT_PATCH4 = 0x0b, WINED3D_SM5_INPUT_PT_PATCH5 = 0x0c, WINED3D_SM5_INPUT_PT_PATCH6 = 0x0d, WINED3D_SM5_INPUT_PT_PATCH7 = 0x0e,
  WINED3D_SM5_INPUT_PT_PATCH8 = 0x0f, WINED3D_SM5_INPUT_PT_PATCH9 = 0x10, WINED3D_SM5_INPUT_PT_PATCH10 = 0x11, WINED3D_SM5_INPUT_PT_PATCH11 = 0x12,
  WINED3D_SM5_INPUT_PT_PATCH12 = 0x13, WINED3D_SM5_INPUT_PT_PATCH13 = 0x14, WINED3D_SM5_INPUT_PT_PATCH14 = 0x15, WINED3D_SM5_INPUT_PT_PATCH15 = 0x16,
  WINED3D_SM5_INPUT_PT_PATCH16 = 0x17, WINED3D_SM5_INPUT_PT_PATCH17 = 0x18, WINED3D_SM5_INPUT_PT_PATCH18 = 0x19, WINED3D_SM5_INPUT_PT_PATCH19 = 0x1a,
  WINED3D_SM5_INPUT_PT_PATCH20 = 0x1b, WINED3D_SM5_INPUT_PT_PATCH21 = 0x1c, WINED3D_SM5_INPUT_PT_PATCH22 = 0x1d, WINED3D_SM5_INPUT_PT_PATCH23 = 0x1e,
  WINED3D_SM5_INPUT_PT_PATCH24 = 0x1f, WINED3D_SM5_INPUT_PT_PATCH25 = 0x20, WINED3D_SM5_INPUT_PT_PATCH26 = 0x21, WINED3D_SM5_INPUT_PT_PATCH27 = 0x22,
  WINED3D_SM5_INPUT_PT_PATCH28 = 0x23, WINED3D_SM5_INPUT_PT_PATCH29 = 0x24, WINED3D_SM5_INPUT_PT_PATCH30 = 0x25, WINED3D_SM5_INPUT_PT_PATCH31 = 0x26,
  WINED3D_SM5_INPUT_PT_PATCH32 = 0x27
}
 
enum  wined3d_sm4_swizzle_type { WINED3D_SM4_SWIZZLE_NONE = 0x0, WINED3D_SM4_SWIZZLE_VEC4 = 0x1, WINED3D_SM4_SWIZZLE_SCALAR = 0x2 }
 
enum  wined3d_sm4_immconst_type { WINED3D_SM4_IMMCONST_SCALAR = 0x1, WINED3D_SM4_IMMCONST_VEC4 = 0x2 }
 
enum  wined3d_sm4_resource_type {
  WINED3D_SM4_RESOURCE_BUFFER = 0x1, WINED3D_SM4_RESOURCE_TEXTURE_1D = 0x2, WINED3D_SM4_RESOURCE_TEXTURE_2D = 0x3, WINED3D_SM4_RESOURCE_TEXTURE_2DMS = 0x4,
  WINED3D_SM4_RESOURCE_TEXTURE_3D = 0x5, WINED3D_SM4_RESOURCE_TEXTURE_CUBE = 0x6, WINED3D_SM4_RESOURCE_TEXTURE_1DARRAY = 0x7, WINED3D_SM4_RESOURCE_TEXTURE_2DARRAY = 0x8,
  WINED3D_SM4_RESOURCE_TEXTURE_2DMSARRAY = 0x9, WINED3D_SM4_RESOURCE_TEXTURE_CUBEARRAY = 0xa
}
 
enum  wined3d_sm4_data_type {
  WINED3D_SM4_DATA_UNORM = 0x1, WINED3D_SM4_DATA_SNORM = 0x2, WINED3D_SM4_DATA_INT = 0x3, WINED3D_SM4_DATA_UINT = 0x4,
  WINED3D_SM4_DATA_FLOAT = 0x5
}
 
enum  wined3d_sm4_sampler_mode { WINED3D_SM4_SAMPLER_DEFAULT = 0x0, WINED3D_SM4_SAMPLER_COMPARISON = 0x1 }
 
enum  wined3d_sm4_shader_data_type { WINED3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER = 0x3, WINED3D_SM4_SHADER_DATA_MESSAGE = 0x4 }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d_shader)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d_bytecode)
 
static BOOL shader_sm4_read_src_param (struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param)
 
static BOOL shader_sm4_read_dst_param (struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
 
static void shader_sm4_read_conditional_op (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_shader_data (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_resource (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_constant_buffer (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_sampler (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_index_range (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_output_topology (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_input_primitive (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_declaration_count (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_declaration_dst (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_declaration_register_semantic (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_input_ps (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_input_ps_siv (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_indexable_temp (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_dcl_global_flags (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_fcall (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_function_body (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_function_table (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_interface (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_control_point_count (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_tessellator_domain (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_tessellator_partitioning (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_tessellator_output_primitive (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_hs_max_tessfactor (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_thread_group (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_uav_raw (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_uav_structured (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_tgsm_raw (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_tgsm_structured (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_resource_structured (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_dcl_resource_raw (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static void shader_sm5_read_sync (struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
 
static const struct wined3d_sm4_opcode_infoget_opcode_info (enum wined3d_sm4_opcode opcode)
 
static void map_register (const struct wined3d_sm4_data *priv, struct wined3d_shader_register *reg)
 
static enum wined3d_data_type map_data_type (char t)
 
enum wined3d_shader_type wined3d_get_sm4_shader_type (const DWORD *byte_code, size_t byte_code_size)
 
static voidshader_sm4_init (const DWORD *byte_code, size_t byte_code_size, const struct wined3d_shader_signature *output_signature)
 
static void shader_sm4_free (void *data)
 
static struct wined3d_shader_src_paramget_src_param (struct wined3d_sm4_data *priv)
 
static void shader_sm4_read_header (void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version)
 
static BOOL shader_sm4_read_reg_idx (struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, DWORD addressing, struct wined3d_shader_register_index *reg_idx)
 
static BOOL shader_sm4_read_param (struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_register *param, enum wined3d_shader_src_modifier *modifier)
 
static void shader_sm4_read_instruction_modifier (DWORD modifier, struct wined3d_shader_instruction *ins)
 
static void shader_sm4_read_instruction (void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins)
 
static BOOL shader_sm4_is_end (void *data, const DWORD **ptr)
 

Variables

static enum wined3d_primitive_type output_primitive_type_table []
 
static enum wined3d_primitive_type input_primitive_type_table []
 
static enum wined3d_shader_resource_type resource_type_table []
 
static enum wined3d_data_type data_type_table []
 
static const struct wined3d_sm4_opcode_info opcode_table []
 
static enum wined3d_shader_register_type register_type_table []
 
const struct wined3d_shader_frontend sm4_shader_frontend
 

Macro Definition Documentation

◆ WINED3D_SM4_ADDRESSING_MASK0

#define WINED3D_SM4_ADDRESSING_MASK0   (0x3u << WINED3D_SM4_ADDRESSING_SHIFT0)

Definition at line 90 of file shader_sm4.c.

◆ WINED3D_SM4_ADDRESSING_MASK1

#define WINED3D_SM4_ADDRESSING_MASK1   (0x3u << WINED3D_SM4_ADDRESSING_SHIFT1)

Definition at line 87 of file shader_sm4.c.

◆ WINED3D_SM4_ADDRESSING_OFFSET

#define WINED3D_SM4_ADDRESSING_OFFSET   0x1

Definition at line 114 of file shader_sm4.c.

◆ WINED3D_SM4_ADDRESSING_RELATIVE

#define WINED3D_SM4_ADDRESSING_RELATIVE   0x2

Definition at line 113 of file shader_sm4.c.

◆ WINED3D_SM4_ADDRESSING_SHIFT0

#define WINED3D_SM4_ADDRESSING_SHIFT0   22

Definition at line 89 of file shader_sm4.c.

◆ WINED3D_SM4_ADDRESSING_SHIFT1

#define WINED3D_SM4_ADDRESSING_SHIFT1   25

Definition at line 86 of file shader_sm4.c.

◆ WINED3D_SM4_AOFFIMMI_U_MASK

#define WINED3D_SM4_AOFFIMMI_U_MASK   (0xfu << WINED3D_SM4_AOFFIMMI_U_SHIFT)

Definition at line 31 of file shader_sm4.c.

◆ WINED3D_SM4_AOFFIMMI_U_SHIFT

#define WINED3D_SM4_AOFFIMMI_U_SHIFT   9

Definition at line 30 of file shader_sm4.c.

◆ WINED3D_SM4_AOFFIMMI_V_MASK

#define WINED3D_SM4_AOFFIMMI_V_MASK   (0xfu << WINED3D_SM4_AOFFIMMI_V_SHIFT)

Definition at line 33 of file shader_sm4.c.

◆ WINED3D_SM4_AOFFIMMI_V_SHIFT

#define WINED3D_SM4_AOFFIMMI_V_SHIFT   13

Definition at line 32 of file shader_sm4.c.

◆ WINED3D_SM4_AOFFIMMI_W_MASK

#define WINED3D_SM4_AOFFIMMI_W_MASK   (0xfu << WINED3D_SM4_AOFFIMMI_W_SHIFT)

Definition at line 35 of file shader_sm4.c.

◆ WINED3D_SM4_AOFFIMMI_W_SHIFT

#define WINED3D_SM4_AOFFIMMI_W_SHIFT   17

Definition at line 34 of file shader_sm4.c.

◆ WINED3D_SM4_CONDITIONAL_NZ

#define WINED3D_SM4_CONDITIONAL_NZ   (0x1u << 18)

Definition at line 118 of file shader_sm4.c.

◆ WINED3D_SM4_GLOBAL_FLAGS_MASK

#define WINED3D_SM4_GLOBAL_FLAGS_MASK   (0xffu << WINED3D_SM4_GLOBAL_FLAGS_SHIFT)

Definition at line 62 of file shader_sm4.c.

◆ WINED3D_SM4_GLOBAL_FLAGS_SHIFT

#define WINED3D_SM4_GLOBAL_FLAGS_SHIFT   11

Definition at line 61 of file shader_sm4.c.

◆ WINED3D_SM4_IMMCONST_TYPE_MASK

#define WINED3D_SM4_IMMCONST_TYPE_MASK   (0x3u << WINED3D_SM4_IMMCONST_TYPE_SHIFT)

Definition at line 102 of file shader_sm4.c.

◆ WINED3D_SM4_IMMCONST_TYPE_SHIFT

#define WINED3D_SM4_IMMCONST_TYPE_SHIFT   0

Definition at line 101 of file shader_sm4.c.

◆ WINED3D_SM4_INDEX_TYPE_MASK

#define WINED3D_SM4_INDEX_TYPE_MASK   (0x1u << WINED3D_SM4_INDEX_TYPE_SHIFT)

Definition at line 50 of file shader_sm4.c.

◆ WINED3D_SM4_INDEX_TYPE_SHIFT

#define WINED3D_SM4_INDEX_TYPE_SHIFT   11

Definition at line 49 of file shader_sm4.c.

◆ WINED3D_SM4_INSTRUCTION_FLAG_SATURATE

#define WINED3D_SM4_INSTRUCTION_FLAG_SATURATE   0x4

Definition at line 116 of file shader_sm4.c.

◆ WINED3D_SM4_INSTRUCTION_FLAGS_MASK

#define WINED3D_SM4_INSTRUCTION_FLAGS_MASK   (0x7u << WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT)

Definition at line 41 of file shader_sm4.c.

◆ WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT

#define WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT   11

Definition at line 40 of file shader_sm4.c.

◆ WINED3D_SM4_INSTRUCTION_LENGTH_MASK

#define WINED3D_SM4_INSTRUCTION_LENGTH_MASK   (0x1fu << WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT)

Definition at line 38 of file shader_sm4.c.

◆ WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT

#define WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT   24

Definition at line 37 of file shader_sm4.c.

◆ WINED3D_SM4_INSTRUCTION_MODIFIER

#define WINED3D_SM4_INSTRUCTION_MODIFIER   (0x1u << 31)

Definition at line 27 of file shader_sm4.c.

◆ WINED3D_SM4_INTERPOLATION_MODE_MASK

#define WINED3D_SM4_INTERPOLATION_MODE_MASK   (0xfu << WINED3D_SM4_INTERPOLATION_MODE_SHIFT)

Definition at line 59 of file shader_sm4.c.

◆ WINED3D_SM4_INTERPOLATION_MODE_SHIFT

#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT   11

Definition at line 58 of file shader_sm4.c.

◆ WINED3D_SM4_MODIFIER_AOFFIMMI

#define WINED3D_SM4_MODIFIER_AOFFIMMI   0x1

Definition at line 29 of file shader_sm4.c.

◆ WINED3D_SM4_OPCODE_MASK

#define WINED3D_SM4_OPCODE_MASK   0xff

Definition at line 82 of file shader_sm4.c.

◆ WINED3D_SM4_PRIMITIVE_TYPE_MASK

#define WINED3D_SM4_PRIMITIVE_TYPE_MASK   (0x3fu << WINED3D_SM4_PRIMITIVE_TYPE_SHIFT)

Definition at line 47 of file shader_sm4.c.

◆ WINED3D_SM4_PRIMITIVE_TYPE_SHIFT

#define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT   11

Definition at line 46 of file shader_sm4.c.

◆ WINED3D_SM4_REGISTER_MODIFIER

#define WINED3D_SM4_REGISTER_MODIFIER   (0x1u << 31)

Definition at line 84 of file shader_sm4.c.

◆ WINED3D_SM4_REGISTER_ORDER_MASK

#define WINED3D_SM4_REGISTER_ORDER_MASK   (0x3u << WINED3D_SM4_REGISTER_ORDER_SHIFT)

Definition at line 93 of file shader_sm4.c.

◆ WINED3D_SM4_REGISTER_ORDER_SHIFT

#define WINED3D_SM4_REGISTER_ORDER_SHIFT   20

Definition at line 92 of file shader_sm4.c.

◆ WINED3D_SM4_REGISTER_TYPE_MASK

#define WINED3D_SM4_REGISTER_TYPE_MASK   (0xffu << WINED3D_SM4_REGISTER_TYPE_SHIFT)

Definition at line 96 of file shader_sm4.c.

◆ WINED3D_SM4_REGISTER_TYPE_SHIFT

#define WINED3D_SM4_REGISTER_TYPE_SHIFT   12

Definition at line 95 of file shader_sm4.c.

◆ WINED3D_SM4_RESOURCE_TYPE_MASK

#define WINED3D_SM4_RESOURCE_TYPE_MASK   (0xfu << WINED3D_SM4_RESOURCE_TYPE_SHIFT)

Definition at line 44 of file shader_sm4.c.

◆ WINED3D_SM4_RESOURCE_TYPE_SHIFT

#define WINED3D_SM4_RESOURCE_TYPE_SHIFT   11

Definition at line 43 of file shader_sm4.c.

◆ WINED3D_SM4_SAMPLER_MODE_MASK

#define WINED3D_SM4_SAMPLER_MODE_MASK   (0xfu << WINED3D_SM4_SAMPLER_MODE_SHIFT)

Definition at line 53 of file shader_sm4.c.

◆ WINED3D_SM4_SAMPLER_MODE_SHIFT

#define WINED3D_SM4_SAMPLER_MODE_SHIFT   11

Definition at line 52 of file shader_sm4.c.

◆ WINED3D_SM4_SHADER_DATA_TYPE_MASK

#define WINED3D_SM4_SHADER_DATA_TYPE_MASK   (0xfu << WINED3D_SM4_SHADER_DATA_TYPE_SHIFT)

Definition at line 56 of file shader_sm4.c.

◆ WINED3D_SM4_SHADER_DATA_TYPE_SHIFT

#define WINED3D_SM4_SHADER_DATA_TYPE_SHIFT   11

Definition at line 55 of file shader_sm4.c.

◆ WINED3D_SM4_SWIZZLE_MASK

#define WINED3D_SM4_SWIZZLE_MASK   (0xffu << WINED3D_SM4_SWIZZLE_SHIFT)

Definition at line 108 of file shader_sm4.c.

◆ WINED3D_SM4_SWIZZLE_SHIFT

#define WINED3D_SM4_SWIZZLE_SHIFT   4

Definition at line 107 of file shader_sm4.c.

◆ WINED3D_SM4_SWIZZLE_TYPE_MASK

#define WINED3D_SM4_SWIZZLE_TYPE_MASK   (0x3u << WINED3D_SM4_SWIZZLE_TYPE_SHIFT)

Definition at line 99 of file shader_sm4.c.

◆ WINED3D_SM4_SWIZZLE_TYPE_SHIFT

#define WINED3D_SM4_SWIZZLE_TYPE_SHIFT   2

Definition at line 98 of file shader_sm4.c.

◆ WINED3D_SM4_VERSION_MAJOR

#define WINED3D_SM4_VERSION_MAJOR (   version)    (((version) >> 4) & 0xf)

Definition at line 110 of file shader_sm4.c.

◆ WINED3D_SM4_VERSION_MINOR

#define WINED3D_SM4_VERSION_MINOR (   version)    (((version) >> 0) & 0xf)

Definition at line 111 of file shader_sm4.c.

◆ WINED3D_SM4_WRITEMASK_MASK

#define WINED3D_SM4_WRITEMASK_MASK   (0xfu << WINED3D_SM4_WRITEMASK_SHIFT)

Definition at line 105 of file shader_sm4.c.

◆ WINED3D_SM4_WRITEMASK_SHIFT

#define WINED3D_SM4_WRITEMASK_SHIFT   4

Definition at line 104 of file shader_sm4.c.

◆ WINED3D_SM5_CONTROL_POINT_COUNT_MASK

#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK   (0xffu << WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT)

Definition at line 68 of file shader_sm4.c.

◆ WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT

#define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT   11

Definition at line 67 of file shader_sm4.c.

◆ WINED3D_SM5_FP_ARRAY_SIZE_SHIFT

#define WINED3D_SM5_FP_ARRAY_SIZE_SHIFT   16

Definition at line 70 of file shader_sm4.c.

◆ WINED3D_SM5_FP_TABLE_COUNT_MASK

#define WINED3D_SM5_FP_TABLE_COUNT_MASK   0xffffu

Definition at line 71 of file shader_sm4.c.

◆ WINED3D_SM5_PRECISE_MASK

#define WINED3D_SM5_PRECISE_MASK   (0xfu << WINED3D_SM5_PRECISE_SHIFT)

Definition at line 65 of file shader_sm4.c.

◆ WINED3D_SM5_PRECISE_SHIFT

#define WINED3D_SM5_PRECISE_SHIFT   19

Definition at line 64 of file shader_sm4.c.

◆ WINED3D_SM5_SYNC_FLAGS_MASK

#define WINED3D_SM5_SYNC_FLAGS_MASK   (0xffu << WINED3D_SM5_SYNC_FLAGS_SHIFT)

Definition at line 77 of file shader_sm4.c.

◆ WINED3D_SM5_SYNC_FLAGS_SHIFT

#define WINED3D_SM5_SYNC_FLAGS_SHIFT   11

Definition at line 76 of file shader_sm4.c.

◆ WINED3D_SM5_TESSELLATOR_MASK

#define WINED3D_SM5_TESSELLATOR_MASK   (0xfu << WINED3D_SM5_TESSELLATOR_SHIFT)

Definition at line 80 of file shader_sm4.c.

◆ WINED3D_SM5_TESSELLATOR_SHIFT

#define WINED3D_SM5_TESSELLATOR_SHIFT   11

Definition at line 79 of file shader_sm4.c.

◆ WINED3D_SM5_UAV_FLAGS_MASK

#define WINED3D_SM5_UAV_FLAGS_MASK   (0x1ffu << WINED3D_SM5_UAV_FLAGS_SHIFT)

Definition at line 74 of file shader_sm4.c.

◆ WINED3D_SM5_UAV_FLAGS_SHIFT

#define WINED3D_SM5_UAV_FLAGS_SHIFT   15

Definition at line 73 of file shader_sm4.c.

Enumeration Type Documentation

◆ wined3d_sm4_data_type

Enumerator
WINED3D_SM4_DATA_UNORM 
WINED3D_SM4_DATA_SNORM 
WINED3D_SM4_DATA_INT 
WINED3D_SM4_DATA_UINT 
WINED3D_SM4_DATA_FLOAT 

Definition at line 420 of file shader_sm4.c.

◆ wined3d_sm4_immconst_type

Enumerator
WINED3D_SM4_IMMCONST_SCALAR 
WINED3D_SM4_IMMCONST_VEC4 

Definition at line 400 of file shader_sm4.c.

◆ wined3d_sm4_input_primitive_type

Enumerator
WINED3D_SM4_INPUT_PT_POINT 
WINED3D_SM4_INPUT_PT_LINE 
WINED3D_SM4_INPUT_PT_TRIANGLE 
WINED3D_SM4_INPUT_PT_LINEADJ 
WINED3D_SM4_INPUT_PT_TRIANGLEADJ 
WINED3D_SM5_INPUT_PT_PATCH1 
WINED3D_SM5_INPUT_PT_PATCH2 
WINED3D_SM5_INPUT_PT_PATCH3 
WINED3D_SM5_INPUT_PT_PATCH4 
WINED3D_SM5_INPUT_PT_PATCH5 
WINED3D_SM5_INPUT_PT_PATCH6 
WINED3D_SM5_INPUT_PT_PATCH7 
WINED3D_SM5_INPUT_PT_PATCH8 
WINED3D_SM5_INPUT_PT_PATCH9 
WINED3D_SM5_INPUT_PT_PATCH10 
WINED3D_SM5_INPUT_PT_PATCH11 
WINED3D_SM5_INPUT_PT_PATCH12 
WINED3D_SM5_INPUT_PT_PATCH13 
WINED3D_SM5_INPUT_PT_PATCH14 
WINED3D_SM5_INPUT_PT_PATCH15 
WINED3D_SM5_INPUT_PT_PATCH16 
WINED3D_SM5_INPUT_PT_PATCH17 
WINED3D_SM5_INPUT_PT_PATCH18 
WINED3D_SM5_INPUT_PT_PATCH19 
WINED3D_SM5_INPUT_PT_PATCH20 
WINED3D_SM5_INPUT_PT_PATCH21 
WINED3D_SM5_INPUT_PT_PATCH22 
WINED3D_SM5_INPUT_PT_PATCH23 
WINED3D_SM5_INPUT_PT_PATCH24 
WINED3D_SM5_INPUT_PT_PATCH25 
WINED3D_SM5_INPUT_PT_PATCH26 
WINED3D_SM5_INPUT_PT_PATCH27 
WINED3D_SM5_INPUT_PT_PATCH28 
WINED3D_SM5_INPUT_PT_PATCH29 
WINED3D_SM5_INPUT_PT_PATCH30 
WINED3D_SM5_INPUT_PT_PATCH31 
WINED3D_SM5_INPUT_PT_PATCH32 

Definition at line 352 of file shader_sm4.c.

353 {
391 };

◆ wined3d_sm4_opcode

Enumerator
WINED3D_SM4_OP_ADD 
WINED3D_SM4_OP_AND 
WINED3D_SM4_OP_BREAK 
WINED3D_SM4_OP_BREAKC 
WINED3D_SM4_OP_CASE 
WINED3D_SM4_OP_CONTINUE 
WINED3D_SM4_OP_CONTINUEC 
WINED3D_SM4_OP_CUT 
WINED3D_SM4_OP_DEFAULT 
WINED3D_SM4_OP_DERIV_RTX 
WINED3D_SM4_OP_DERIV_RTY 
WINED3D_SM4_OP_DISCARD 
WINED3D_SM4_OP_DIV 
WINED3D_SM4_OP_DP2 
WINED3D_SM4_OP_DP3 
WINED3D_SM4_OP_DP4 
WINED3D_SM4_OP_ELSE 
WINED3D_SM4_OP_EMIT 
WINED3D_SM4_OP_ENDIF 
WINED3D_SM4_OP_ENDLOOP 
WINED3D_SM4_OP_ENDSWITCH 
WINED3D_SM4_OP_EQ 
WINED3D_SM4_OP_EXP 
WINED3D_SM4_OP_FRC 
WINED3D_SM4_OP_FTOI 
WINED3D_SM4_OP_FTOU 
WINED3D_SM4_OP_GE 
WINED3D_SM4_OP_IADD 
WINED3D_SM4_OP_IF 
WINED3D_SM4_OP_IEQ 
WINED3D_SM4_OP_IGE 
WINED3D_SM4_OP_ILT 
WINED3D_SM4_OP_IMAD 
WINED3D_SM4_OP_IMAX 
WINED3D_SM4_OP_IMIN 
WINED3D_SM4_OP_IMUL 
WINED3D_SM4_OP_INE 
WINED3D_SM4_OP_INEG 
WINED3D_SM4_OP_ISHL 
WINED3D_SM4_OP_ISHR 
WINED3D_SM4_OP_ITOF 
WINED3D_SM4_OP_LABEL 
WINED3D_SM4_OP_LD 
WINED3D_SM4_OP_LD2DMS 
WINED3D_SM4_OP_LOG 
WINED3D_SM4_OP_LOOP 
WINED3D_SM4_OP_LT 
WINED3D_SM4_OP_MAD 
WINED3D_SM4_OP_MIN 
WINED3D_SM4_OP_MAX 
WINED3D_SM4_OP_SHADER_DATA 
WINED3D_SM4_OP_MOV 
WINED3D_SM4_OP_MOVC 
WINED3D_SM4_OP_MUL 
WINED3D_SM4_OP_NE 
WINED3D_SM4_OP_NOP 
WINED3D_SM4_OP_NOT 
WINED3D_SM4_OP_OR 
WINED3D_SM4_OP_RESINFO 
WINED3D_SM4_OP_RET 
WINED3D_SM4_OP_RETC 
WINED3D_SM4_OP_ROUND_NE 
WINED3D_SM4_OP_ROUND_NI 
WINED3D_SM4_OP_ROUND_PI 
WINED3D_SM4_OP_ROUND_Z 
WINED3D_SM4_OP_RSQ 
WINED3D_SM4_OP_SAMPLE 
WINED3D_SM4_OP_SAMPLE_C 
WINED3D_SM4_OP_SAMPLE_C_LZ 
WINED3D_SM4_OP_SAMPLE_LOD 
WINED3D_SM4_OP_SAMPLE_GRAD 
WINED3D_SM4_OP_SAMPLE_B 
WINED3D_SM4_OP_SQRT 
WINED3D_SM4_OP_SWITCH 
WINED3D_SM4_OP_SINCOS 
WINED3D_SM4_OP_UDIV 
WINED3D_SM4_OP_ULT 
WINED3D_SM4_OP_UGE 
WINED3D_SM4_OP_UMUL 
WINED3D_SM4_OP_UMAX 
WINED3D_SM4_OP_UMIN 
WINED3D_SM4_OP_USHR 
WINED3D_SM4_OP_UTOF 
WINED3D_SM4_OP_XOR 
WINED3D_SM4_OP_DCL_RESOURCE 
WINED3D_SM4_OP_DCL_CONSTANT_BUFFER 
WINED3D_SM4_OP_DCL_SAMPLER 
WINED3D_SM4_OP_DCL_INDEX_RANGE 
WINED3D_SM4_OP_DCL_OUTPUT_TOPOLOGY 
WINED3D_SM4_OP_DCL_INPUT_PRIMITIVE 
WINED3D_SM4_OP_DCL_VERTICES_OUT 
WINED3D_SM4_OP_DCL_INPUT 
WINED3D_SM4_OP_DCL_INPUT_SGV 
WINED3D_SM4_OP_DCL_INPUT_SIV 
WINED3D_SM4_OP_DCL_INPUT_PS 
WINED3D_SM4_OP_DCL_INPUT_PS_SGV 
WINED3D_SM4_OP_DCL_INPUT_PS_SIV 
WINED3D_SM4_OP_DCL_OUTPUT 
WINED3D_SM4_OP_DCL_OUTPUT_SIV 
WINED3D_SM4_OP_DCL_TEMPS 
WINED3D_SM4_OP_DCL_INDEXABLE_TEMP 
WINED3D_SM4_OP_DCL_GLOBAL_FLAGS 
WINED3D_SM4_OP_LOD 
WINED3D_SM4_OP_GATHER4 
WINED3D_SM4_OP_SAMPLE_POS 
WINED3D_SM4_OP_SAMPLE_INFO 
WINED3D_SM5_OP_HS_DECLS 
WINED3D_SM5_OP_HS_CONTROL_POINT_PHASE 
WINED3D_SM5_OP_HS_FORK_PHASE 
WINED3D_SM5_OP_HS_JOIN_PHASE 
WINED3D_SM5_OP_EMIT_STREAM 
WINED3D_SM5_OP_CUT_STREAM 
WINED3D_SM5_OP_FCALL 
WINED3D_SM5_OP_BUFINFO 
WINED3D_SM5_OP_DERIV_RTX_COARSE 
WINED3D_SM5_OP_DERIV_RTX_FINE 
WINED3D_SM5_OP_DERIV_RTY_COARSE 
WINED3D_SM5_OP_DERIV_RTY_FINE 
WINED3D_SM5_OP_GATHER4_C 
WINED3D_SM5_OP_GATHER4_PO 
WINED3D_SM5_OP_GATHER4_PO_C 
WINED3D_SM5_OP_RCP 
WINED3D_SM5_OP_F32TOF16 
WINED3D_SM5_OP_F16TOF32 
WINED3D_SM5_OP_COUNTBITS 
WINED3D_SM5_OP_FIRSTBIT_HI 
WINED3D_SM5_OP_FIRSTBIT_LO 
WINED3D_SM5_OP_FIRSTBIT_SHI 
WINED3D_SM5_OP_UBFE 
WINED3D_SM5_OP_IBFE 
WINED3D_SM5_OP_BFI 
WINED3D_SM5_OP_BFREV 
WINED3D_SM5_OP_SWAPC 
WINED3D_SM5_OP_DCL_STREAM 
WINED3D_SM5_OP_DCL_FUNCTION_BODY 
WINED3D_SM5_OP_DCL_FUNCTION_TABLE 
WINED3D_SM5_OP_DCL_INTERFACE 
WINED3D_SM5_OP_DCL_INPUT_CONTROL_POINT_COUNT 
WINED3D_SM5_OP_DCL_OUTPUT_CONTROL_POINT_COUNT 
WINED3D_SM5_OP_DCL_TESSELLATOR_DOMAIN 
WINED3D_SM5_OP_DCL_TESSELLATOR_PARTITIONING 
WINED3D_SM5_OP_DCL_TESSELLATOR_OUTPUT_PRIMITIVE 
WINED3D_SM5_OP_DCL_HS_MAX_TESSFACTOR 
WINED3D_SM5_OP_DCL_HS_FORK_PHASE_INSTANCE_COUNT 
WINED3D_SM5_OP_DCL_HS_JOIN_PHASE_INSTANCE_COUNT 
WINED3D_SM5_OP_DCL_THREAD_GROUP 
WINED3D_SM5_OP_DCL_UAV_TYPED 
WINED3D_SM5_OP_DCL_UAV_RAW 
WINED3D_SM5_OP_DCL_UAV_STRUCTURED 
WINED3D_SM5_OP_DCL_TGSM_RAW 
WINED3D_SM5_OP_DCL_TGSM_STRUCTURED 
WINED3D_SM5_OP_DCL_RESOURCE_RAW 
WINED3D_SM5_OP_DCL_RESOURCE_STRUCTURED 
WINED3D_SM5_OP_LD_UAV_TYPED 
WINED3D_SM5_OP_STORE_UAV_TYPED 
WINED3D_SM5_OP_LD_RAW 
WINED3D_SM5_OP_STORE_RAW 
WINED3D_SM5_OP_LD_STRUCTURED 
WINED3D_SM5_OP_STORE_STRUCTURED 
WINED3D_SM5_OP_ATOMIC_AND 
WINED3D_SM5_OP_ATOMIC_OR 
WINED3D_SM5_OP_ATOMIC_XOR 
WINED3D_SM5_OP_ATOMIC_CMP_STORE 
WINED3D_SM5_OP_ATOMIC_IADD 
WINED3D_SM5_OP_ATOMIC_IMAX 
WINED3D_SM5_OP_ATOMIC_IMIN 
WINED3D_SM5_OP_ATOMIC_UMAX 
WINED3D_SM5_OP_ATOMIC_UMIN 
WINED3D_SM5_OP_IMM_ATOMIC_ALLOC 
WINED3D_SM5_OP_IMM_ATOMIC_CONSUME 
WINED3D_SM5_OP_IMM_ATOMIC_IADD 
WINED3D_SM5_OP_IMM_ATOMIC_AND 
WINED3D_SM5_OP_IMM_ATOMIC_OR 
WINED3D_SM5_OP_IMM_ATOMIC_XOR 
WINED3D_SM5_OP_IMM_ATOMIC_EXCH 
WINED3D_SM5_OP_IMM_ATOMIC_CMP_EXCH 
WINED3D_SM5_OP_IMM_ATOMIC_IMAX 
WINED3D_SM5_OP_IMM_ATOMIC_IMIN 
WINED3D_SM5_OP_IMM_ATOMIC_UMAX 
WINED3D_SM5_OP_IMM_ATOMIC_UMIN 
WINED3D_SM5_OP_SYNC 
WINED3D_SM5_OP_EVAL_SAMPLE_INDEX 
WINED3D_SM5_OP_DCL_GS_INSTANCES 

Definition at line 120 of file shader_sm4.c.

121 {
122  WINED3D_SM4_OP_ADD = 0x00,
123  WINED3D_SM4_OP_AND = 0x01,
124  WINED3D_SM4_OP_BREAK = 0x02,
125  WINED3D_SM4_OP_BREAKC = 0x03,
126  WINED3D_SM4_OP_CASE = 0x06,
129  WINED3D_SM4_OP_CUT = 0x09,
130  WINED3D_SM4_OP_DEFAULT = 0x0a,
133  WINED3D_SM4_OP_DISCARD = 0x0d,
134  WINED3D_SM4_OP_DIV = 0x0e,
135  WINED3D_SM4_OP_DP2 = 0x0f,
136  WINED3D_SM4_OP_DP3 = 0x10,
137  WINED3D_SM4_OP_DP4 = 0x11,
138  WINED3D_SM4_OP_ELSE = 0x12,
139  WINED3D_SM4_OP_EMIT = 0x13,
140  WINED3D_SM4_OP_ENDIF = 0x15,
141  WINED3D_SM4_OP_ENDLOOP = 0x16,
143  WINED3D_SM4_OP_EQ = 0x18,
144  WINED3D_SM4_OP_EXP = 0x19,
145  WINED3D_SM4_OP_FRC = 0x1a,
146  WINED3D_SM4_OP_FTOI = 0x1b,
147  WINED3D_SM4_OP_FTOU = 0x1c,
148  WINED3D_SM4_OP_GE = 0x1d,
149  WINED3D_SM4_OP_IADD = 0x1e,
150  WINED3D_SM4_OP_IF = 0x1f,
151  WINED3D_SM4_OP_IEQ = 0x20,
152  WINED3D_SM4_OP_IGE = 0x21,
153  WINED3D_SM4_OP_ILT = 0x22,
154  WINED3D_SM4_OP_IMAD = 0x23,
155  WINED3D_SM4_OP_IMAX = 0x24,
156  WINED3D_SM4_OP_IMIN = 0x25,
157  WINED3D_SM4_OP_IMUL = 0x26,
158  WINED3D_SM4_OP_INE = 0x27,
159  WINED3D_SM4_OP_INEG = 0x28,
160  WINED3D_SM4_OP_ISHL = 0x29,
161  WINED3D_SM4_OP_ISHR = 0x2a,
162  WINED3D_SM4_OP_ITOF = 0x2b,
163  WINED3D_SM4_OP_LABEL = 0x2c,
164  WINED3D_SM4_OP_LD = 0x2d,
165  WINED3D_SM4_OP_LD2DMS = 0x2e,
166  WINED3D_SM4_OP_LOG = 0x2f,
167  WINED3D_SM4_OP_LOOP = 0x30,
168  WINED3D_SM4_OP_LT = 0x31,
169  WINED3D_SM4_OP_MAD = 0x32,
170  WINED3D_SM4_OP_MIN = 0x33,
171  WINED3D_SM4_OP_MAX = 0x34,
173  WINED3D_SM4_OP_MOV = 0x36,
174  WINED3D_SM4_OP_MOVC = 0x37,
175  WINED3D_SM4_OP_MUL = 0x38,
176  WINED3D_SM4_OP_NE = 0x39,
177  WINED3D_SM4_OP_NOP = 0x3a,
178  WINED3D_SM4_OP_NOT = 0x3b,
179  WINED3D_SM4_OP_OR = 0x3c,
180  WINED3D_SM4_OP_RESINFO = 0x3d,
181  WINED3D_SM4_OP_RET = 0x3e,
182  WINED3D_SM4_OP_RETC = 0x3f,
186  WINED3D_SM4_OP_ROUND_Z = 0x43,
187  WINED3D_SM4_OP_RSQ = 0x44,
188  WINED3D_SM4_OP_SAMPLE = 0x45,
194  WINED3D_SM4_OP_SQRT = 0x4b,
195  WINED3D_SM4_OP_SWITCH = 0x4c,
196  WINED3D_SM4_OP_SINCOS = 0x4d,
197  WINED3D_SM4_OP_UDIV = 0x4e,
198  WINED3D_SM4_OP_ULT = 0x4f,
199  WINED3D_SM4_OP_UGE = 0x50,
200  WINED3D_SM4_OP_UMUL = 0x51,
201  WINED3D_SM4_OP_UMAX = 0x53,
202  WINED3D_SM4_OP_UMIN = 0x54,
203  WINED3D_SM4_OP_USHR = 0x55,
204  WINED3D_SM4_OP_UTOF = 0x56,
205  WINED3D_SM4_OP_XOR = 0x57,
224  WINED3D_SM4_OP_LOD = 0x6c,
225  WINED3D_SM4_OP_GATHER4 = 0x6d,
234  WINED3D_SM5_OP_FCALL = 0x78,
235  WINED3D_SM5_OP_BUFINFO = 0x79,
243  WINED3D_SM5_OP_RCP = 0x81,
250  WINED3D_SM5_OP_UBFE = 0x8a,
251  WINED3D_SM5_OP_IBFE = 0x8b,
252  WINED3D_SM5_OP_BFI = 0x8c,
253  WINED3D_SM5_OP_BFREV = 0x8d,
254  WINED3D_SM5_OP_SWAPC = 0x8e,
277  WINED3D_SM5_OP_LD_RAW = 0xa5,
302  WINED3D_SM5_OP_SYNC = 0xbe,
305 };

◆ wined3d_sm4_output_primitive_type

Enumerator
WINED3D_SM4_OUTPUT_PT_POINTLIST 
WINED3D_SM4_OUTPUT_PT_LINESTRIP 
WINED3D_SM4_OUTPUT_PT_TRIANGLESTRIP 

Definition at line 345 of file shader_sm4.c.

◆ wined3d_sm4_register_type

Enumerator
WINED3D_SM4_RT_TEMP 
WINED3D_SM4_RT_INPUT 
WINED3D_SM4_RT_OUTPUT 
WINED3D_SM4_RT_INDEXABLE_TEMP 
WINED3D_SM4_RT_IMMCONST 
WINED3D_SM4_RT_SAMPLER 
WINED3D_SM4_RT_RESOURCE 
WINED3D_SM4_RT_CONSTBUFFER 
WINED3D_SM4_RT_IMMCONSTBUFFER 
WINED3D_SM4_RT_PRIMID 
WINED3D_SM4_RT_DEPTHOUT 
WINED3D_SM4_RT_NULL 
WINED3D_SM4_RT_RASTERIZER 
WINED3D_SM4_RT_OMASK 
WINED3D_SM5_RT_STREAM 
WINED3D_SM5_RT_FUNCTION_BODY 
WINED3D_SM5_RT_FUNCTION_POINTER 
WINED3D_SM5_RT_OUTPUT_CONTROL_POINT_ID 
WINED3D_SM5_RT_FORK_INSTANCE_ID 
WINED3D_SM5_RT_JOIN_INSTANCE_ID 
WINED3D_SM5_RT_INPUT_CONTROL_POINT 
WINED3D_SM5_RT_OUTPUT_CONTROL_POINT 
WINED3D_SM5_RT_PATCH_CONSTANT_DATA 
WINED3D_SM5_RT_DOMAIN_LOCATION 
WINED3D_SM5_RT_UAV 
WINED3D_SM5_RT_SHARED_MEMORY 
WINED3D_SM5_RT_THREAD_ID 
WINED3D_SM5_RT_THREAD_GROUP_ID 
WINED3D_SM5_RT_LOCAL_THREAD_ID 
WINED3D_SM5_RT_COVERAGE 
WINED3D_SM5_RT_LOCAL_THREAD_INDEX 
WINED3D_SM5_RT_GS_INSTANCE_ID 
WINED3D_SM5_RT_DEPTHOUT_GREATER_EQUAL 
WINED3D_SM5_RT_DEPTHOUT_LESS_EQUAL 

Definition at line 307 of file shader_sm4.c.

308 {
309  WINED3D_SM4_RT_TEMP = 0x00,
310  WINED3D_SM4_RT_INPUT = 0x01,
311  WINED3D_SM4_RT_OUTPUT = 0x02,
314  WINED3D_SM4_RT_SAMPLER = 0x06,
318  WINED3D_SM4_RT_PRIMID = 0x0b,
320  WINED3D_SM4_RT_NULL = 0x0d,
322  WINED3D_SM4_RT_OMASK = 0x0f,
323  WINED3D_SM5_RT_STREAM = 0x10,
333  WINED3D_SM5_RT_UAV = 0x1e,
343 };

◆ wined3d_sm4_resource_type

Enumerator
WINED3D_SM4_RESOURCE_BUFFER 
WINED3D_SM4_RESOURCE_TEXTURE_1D 
WINED3D_SM4_RESOURCE_TEXTURE_2D 
WINED3D_SM4_RESOURCE_TEXTURE_2DMS 
WINED3D_SM4_RESOURCE_TEXTURE_3D 
WINED3D_SM4_RESOURCE_TEXTURE_CUBE 
WINED3D_SM4_RESOURCE_TEXTURE_1DARRAY 
WINED3D_SM4_RESOURCE_TEXTURE_2DARRAY 
WINED3D_SM4_RESOURCE_TEXTURE_2DMSARRAY 
WINED3D_SM4_RESOURCE_TEXTURE_CUBEARRAY 

Definition at line 406 of file shader_sm4.c.

◆ wined3d_sm4_sampler_mode

Enumerator
WINED3D_SM4_SAMPLER_DEFAULT 
WINED3D_SM4_SAMPLER_COMPARISON 

Definition at line 429 of file shader_sm4.c.

◆ wined3d_sm4_shader_data_type

Enumerator
WINED3D_SM4_SHADER_DATA_IMMEDIATE_CONSTANT_BUFFER 
WINED3D_SM4_SHADER_DATA_MESSAGE 

Definition at line 435 of file shader_sm4.c.

◆ wined3d_sm4_swizzle_type

Enumerator
WINED3D_SM4_SWIZZLE_NONE 
WINED3D_SM4_SWIZZLE_VEC4 
WINED3D_SM4_SWIZZLE_SCALAR 

Definition at line 393 of file shader_sm4.c.

Function Documentation

◆ get_opcode_info()

static const struct wined3d_sm4_opcode_info* get_opcode_info ( enum wined3d_sm4_opcode  opcode)
static

Definition at line 1164 of file shader_sm4.c.

1165 {
1166  unsigned int i;
1167 
1168  for (i = 0; i < ARRAY_SIZE(opcode_table); ++i)
1169  {
1170  if (opcode == opcode_table[i].opcode) return &opcode_table[i];
1171  }
1172 
1173  return NULL;
1174 }
static const struct wined3d_sm4_opcode_info opcode_table[]
Definition: shader_sm4.c:887
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by shader_sm4_read_instruction().

◆ get_src_param()

static struct wined3d_shader_src_param* get_src_param ( struct wined3d_sm4_data priv)
static

Definition at line 1338 of file shader_sm4.c.

1339 {
1341  struct list *elem;
1342 
1343  if (!list_empty(&priv->src_free))
1344  {
1345  elem = list_head(&priv->src_free);
1346  list_remove(elem);
1347  }
1348  else
1349  {
1350  if (!(e = heap_alloc(sizeof(*e))))
1351  return NULL;
1352  elem = &e->entry;
1353  }
1354 
1355  list_add_tail(&priv->src, elem);
1357  return &e->param;
1358 }
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
Definition: shader_sm4.c:441
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define e
Definition: ke_i.h:82
static size_t elem
Definition: string.c:68
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
uint32_t entry
Definition: isohybrid.c:63
Definition: _list.h:228
struct list src
Definition: shader_sm4.c:457
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
struct list src_free
Definition: shader_sm4.c:456
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by shader_sm4_read_reg_idx().

◆ map_data_type()

static enum wined3d_data_type map_data_type ( char  t)
static

Definition at line 1201 of file shader_sm4.c.

1202 {
1203  switch (t)
1204  {
1205  case 'f':
1206  return WINED3D_DATA_FLOAT;
1207  case 'i':
1208  return WINED3D_DATA_INT;
1209  case 'u':
1210  return WINED3D_DATA_UINT;
1211  case 'O':
1212  return WINED3D_DATA_OPAQUE;
1213  case 'R':
1214  return WINED3D_DATA_RESOURCE;
1215  case 'S':
1216  return WINED3D_DATA_SAMPLER;
1217  case 'U':
1218  return WINED3D_DATA_UAV;
1219  default:
1220  ERR("Invalid data type '%c'.\n", t);
1221  return WINED3D_DATA_FLOAT;
1222  }
1223 }
GLdouble GLdouble t
Definition: gl.h:2047
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by shader_sm4_read_instruction().

◆ map_register()

static void map_register ( const struct wined3d_sm4_data priv,
struct wined3d_shader_register reg 
)
static

Definition at line 1176 of file shader_sm4.c.

1177 {
1178  switch (priv->shader_version.type)
1179  {
1181  if (reg->type == WINED3DSPR_OUTPUT)
1182  {
1183  unsigned int reg_idx = reg->idx[0].offset;
1184 
1185  if (reg_idx >= ARRAY_SIZE(priv->output_map))
1186  {
1187  ERR("Invalid output index %u.\n", reg_idx);
1188  break;
1189  }
1190 
1191  reg->type = WINED3DSPR_COLOROUT;
1192  reg->idx[0].offset = priv->output_map[reg_idx];
1193  }
1194  break;
1195 
1196  default:
1197  break;
1198  }
1199 }
unsigned int output_map[MAX_REG_OUTPUT]
Definition: shader_sm4.c:452
struct wined3d_shader_version shader_version
Definition: shader_sm4.c:449
#define ERR(fmt,...)
Definition: debug.h:109
#define ARRAY_SIZE(a)
Definition: main.h:24
static int reg
Definition: i386-dis.c:1275

Referenced by shader_sm4_read_param().

◆ shader_sm4_free()

static void shader_sm4_free ( void data)
static

Definition at line 1325 of file shader_sm4.c.

1326 {
1327  struct wined3d_shader_src_param_entry *e1, *e2;
1328  struct wined3d_sm4_data *priv = data;
1329 
1330  list_move_head(&priv->src_free, &priv->src);
1332  {
1333  heap_free(e1);
1334  }
1335  heap_free(priv);
1336 }
Definition: shader_sm4.c:441
__WINE_SERVER_LIST_INLINE void list_move_head(struct list *dst, struct list *src)
Definition: list.h:176
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
uint32_t entry
Definition: isohybrid.c:63
struct list src
Definition: shader_sm4.c:457
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
struct list src_free
Definition: shader_sm4.c:456
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ shader_sm4_init()

static void* shader_sm4_init ( const DWORD byte_code,
size_t  byte_code_size,
const struct wined3d_shader_signature output_signature 
)
static

Definition at line 1262 of file shader_sm4.c.

1264 {
1265  DWORD version_token, token_count;
1266  struct wined3d_sm4_data *priv;
1267  unsigned int i;
1268 
1269  if (byte_code_size / sizeof(*byte_code) < 2)
1270  {
1271  WARN("Invalid byte code size %lu.\n", (long)byte_code_size);
1272  return NULL;
1273  }
1274 
1275  version_token = byte_code[0];
1276  TRACE("Version: 0x%08x.\n", version_token);
1277  token_count = byte_code[1];
1278  TRACE("Token count: %u.\n", token_count);
1279 
1280  if (token_count < 2 || byte_code_size / sizeof(*byte_code) < token_count)
1281  {
1282  WARN("Invalid token count %u.\n", token_count);
1283  return NULL;
1284  }
1285 
1286  if (!(priv = heap_alloc(sizeof(*priv))))
1287  {
1288  ERR("Failed to allocate private data\n");
1289  return NULL;
1290  }
1291 
1292  priv->start = &byte_code[2];
1293  priv->end = &byte_code[token_count];
1294 
1295  priv->shader_version.type = wined3d_get_sm4_shader_type(byte_code, byte_code_size);
1296  if (priv->shader_version.type == WINED3D_SHADER_TYPE_INVALID)
1297  {
1298  heap_free(priv);
1299  return NULL;
1300  }
1301 
1302  priv->shader_version.major = WINED3D_SM4_VERSION_MAJOR(version_token);
1303  priv->shader_version.minor = WINED3D_SM4_VERSION_MINOR(version_token);
1304 
1305  memset(priv->output_map, 0xff, sizeof(priv->output_map));
1306  for (i = 0; i < output_signature->element_count; ++i)
1307  {
1308  struct wined3d_shader_signature_element *e = &output_signature->elements[i];
1309 
1310  if (e->register_idx >= ARRAY_SIZE(priv->output_map))
1311  {
1312  WARN("Invalid output index %u.\n", e->register_idx);
1313  continue;
1314  }
1315 
1316  priv->output_map[e->register_idx] = e->semantic_idx;
1317  }
1318 
1319  list_init(&priv->src_free);
1320  list_init(&priv->src);
1321 
1322  return priv;
1323 }
unsigned int output_map[MAX_REG_OUTPUT]
Definition: shader_sm4.c:452
#define WARN(fmt,...)
Definition: debug.h:111
const DWORD * end
Definition: shader_sm4.c:450
enum wined3d_shader_type wined3d_get_sm4_shader_type(const DWORD *byte_code, size_t byte_code_size)
Definition: shader_sm4.c:1225
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define e
Definition: ke_i.h:82
smooth NULL
Definition: ftsmooth.c:416
#define WINED3D_SM4_VERSION_MINOR(version)
Definition: shader_sm4.c:111
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
struct wined3d_shader_version shader_version
Definition: shader_sm4.c:449
#define ERR(fmt,...)
Definition: debug.h:109
struct list src
Definition: shader_sm4.c:457
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WINED3D_SM4_VERSION_MAJOR(version)
Definition: shader_sm4.c:110
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
const DWORD * start
Definition: shader_sm4.c:450
struct list src_free
Definition: shader_sm4.c:456
#define memset(x, y, z)
Definition: compat.h:39
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
struct wined3d_shader_signature_element * elements
Definition: wined3d.h:2047

◆ shader_sm4_is_end()

static BOOL shader_sm4_is_end ( void data,
const DWORD **  ptr 
)
static

Definition at line 1763 of file shader_sm4.c.

1764 {
1765  struct wined3d_sm4_data *priv = data;
1766  return *ptr == priv->end;
1767 }
const DWORD * end
Definition: shader_sm4.c:450
static PVOID ptr
Definition: dispmode.c:27
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ shader_sm4_read_conditional_op()

static void shader_sm4_read_conditional_op ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 524 of file shader_sm4.c.

527 {
528  shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UINT, &priv->src_param[0]);
529  ins->flags = (opcode_token & WINED3D_SM4_CONDITIONAL_NZ) ?
531 }
struct wined3d_shader_src_param src_param[5]
Definition: shader_sm4.c:454
#define WINED3D_SM4_CONDITIONAL_NZ
Definition: shader_sm4.c:118
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param)
Definition: shader_sm4.c:1528

◆ shader_sm4_read_dcl_constant_buffer()

static void shader_sm4_read_dcl_constant_buffer ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 603 of file shader_sm4.c.

606 {
607  shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.src);
608  if (opcode_token & WINED3D_SM4_INDEX_TYPE_MASK)
610 }
union wined3d_shader_instruction::@266 declaration
const struct wined3d_shader_src_param * src
#define WINED3DSI_INDEXED_DYNAMIC
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param)
Definition: shader_sm4.c:1528
#define WINED3D_SM4_INDEX_TYPE_MASK
Definition: shader_sm4.c:50

◆ shader_sm4_read_dcl_global_flags()

static void shader_sm4_read_dcl_global_flags ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 722 of file shader_sm4.c.

725 {
727 }
#define WINED3D_SM4_GLOBAL_FLAGS_SHIFT
Definition: shader_sm4.c:61
#define WINED3D_SM4_GLOBAL_FLAGS_MASK
Definition: shader_sm4.c:62

◆ shader_sm4_read_dcl_index_range()

static void shader_sm4_read_dcl_index_range ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 622 of file shader_sm4.c.

625 {
626  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_OPAQUE,
627  &ins->declaration.index_range.first_register);
628  ins->declaration.index_range.last_register = *tokens;
629 }
union wined3d_shader_instruction::@266 declaration
struct wined3d_shader_index_range index_range
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579

◆ shader_sm4_read_dcl_indexable_temp()

static void shader_sm4_read_dcl_indexable_temp ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 713 of file shader_sm4.c.

716 {
717  ins->declaration.indexable_temp.register_idx = *tokens++;
718  ins->declaration.indexable_temp.register_size = *tokens++;
719  ins->declaration.indexable_temp.component_count = *tokens;
720 }
union wined3d_shader_instruction::@266 declaration
struct wined3d_shader_indexable_temp indexable_temp

◆ shader_sm4_read_dcl_input_primitive()

static void shader_sm4_read_dcl_input_primitive ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 647 of file shader_sm4.c.

650 {
651  enum wined3d_sm4_input_primitive_type primitive_type;
652 
653  primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT;
654  if (WINED3D_SM5_INPUT_PT_PATCH1 <= primitive_type && primitive_type <= WINED3D_SM5_INPUT_PT_PATCH32)
655  {
657  ins->declaration.primitive_type.patch_vertex_count = primitive_type - WINED3D_SM5_INPUT_PT_PATCH1 + 1;
658  }
659  else if (primitive_type >= ARRAY_SIZE(input_primitive_type_table))
660  {
662  }
663  else
664  {
665  ins->declaration.primitive_type.type = input_primitive_type_table[primitive_type];
666  }
667 
669  FIXME("Unhandled input primitive type %#x.\n", primitive_type);
670 }
#define WINED3D_SM4_PRIMITIVE_TYPE_MASK
Definition: shader_sm4.c:47
#define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT
Definition: shader_sm4.c:46
union wined3d_shader_instruction::@266 declaration
static enum wined3d_primitive_type input_primitive_type_table[]
Definition: shader_sm4.c:482
#define FIXME(fmt,...)
Definition: debug.h:110
#define ARRAY_SIZE(a)
Definition: main.h:24
struct wined3d_shader_primitive_type primitive_type
wined3d_sm4_input_primitive_type
Definition: shader_sm4.c:352

◆ shader_sm4_read_dcl_input_ps()

static void shader_sm4_read_dcl_input_ps ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 695 of file shader_sm4.c.

698 {
700  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.dst);
701 }
union wined3d_shader_instruction::@266 declaration
const struct wined3d_shader_dst_param * dst
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT
Definition: shader_sm4.c:58
#define WINED3D_SM4_INTERPOLATION_MODE_MASK
Definition: shader_sm4.c:59

◆ shader_sm4_read_dcl_input_ps_siv()

static void shader_sm4_read_dcl_input_ps_siv ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 703 of file shader_sm4.c.

706 {
708  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT,
709  &ins->declaration.register_semantic.reg);
710  ins->declaration.register_semantic.sysval_semantic = *tokens;
711 }
union wined3d_shader_instruction::@266 declaration
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
#define WINED3D_SM4_INTERPOLATION_MODE_SHIFT
Definition: shader_sm4.c:58
#define WINED3D_SM4_INTERPOLATION_MODE_MASK
Definition: shader_sm4.c:59
struct wined3d_shader_register_semantic register_semantic

◆ shader_sm4_read_dcl_output_topology()

static void shader_sm4_read_dcl_output_topology ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 631 of file shader_sm4.c.

634 {
635  enum wined3d_sm4_output_primitive_type primitive_type;
636 
637  primitive_type = (opcode_token & WINED3D_SM4_PRIMITIVE_TYPE_MASK) >> WINED3D_SM4_PRIMITIVE_TYPE_SHIFT;
638  if (primitive_type >= ARRAY_SIZE(output_primitive_type_table))
640  else
641  ins->declaration.primitive_type.type = output_primitive_type_table[primitive_type];
642 
644  FIXME("Unhandled output primitive type %#x.\n", primitive_type);
645 }
#define WINED3D_SM4_PRIMITIVE_TYPE_MASK
Definition: shader_sm4.c:47
#define WINED3D_SM4_PRIMITIVE_TYPE_SHIFT
Definition: shader_sm4.c:46
union wined3d_shader_instruction::@266 declaration
wined3d_sm4_output_primitive_type
Definition: shader_sm4.c:345
#define FIXME(fmt,...)
Definition: debug.h:110
if(!(yy_init))
Definition: macro.lex.yy.c:714
static enum wined3d_primitive_type output_primitive_type_table[]
Definition: shader_sm4.c:472
#define ARRAY_SIZE(a)
Definition: main.h:24
struct wined3d_shader_primitive_type primitive_type

◆ shader_sm4_read_dcl_resource()

static void shader_sm4_read_dcl_resource ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 562 of file shader_sm4.c.

565 {
566  enum wined3d_sm4_resource_type resource_type;
567  enum wined3d_sm4_data_type data_type;
568  enum wined3d_data_type reg_data_type;
570 
571  resource_type = (opcode_token & WINED3D_SM4_RESOURCE_TYPE_MASK) >> WINED3D_SM4_RESOURCE_TYPE_SHIFT;
572  if (!resource_type || (resource_type >= ARRAY_SIZE(resource_type_table)))
573  {
574  FIXME("Unhandled resource type %#x.\n", resource_type);
576  }
577  else
578  {
579  ins->declaration.semantic.resource_type = resource_type_table[resource_type];
580  }
582  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], reg_data_type, &ins->declaration.semantic.reg);
583 
584  components = *tokens++;
585  if ((components & 0xfff0) != (components & 0xf) * 0x1110)
586  FIXME("Components (%#x) have different data types.\n", components);
587  data_type = components & 0xf;
588 
589  if (!data_type || (data_type >= ARRAY_SIZE(data_type_table)))
590  {
591  FIXME("Unhandled data type %#x.\n", data_type);
592  ins->declaration.semantic.resource_data_type = WINED3D_DATA_FLOAT;
593  }
594  else
595  {
596  ins->declaration.semantic.resource_data_type = data_type_table[data_type];
597  }
598 
599  if (reg_data_type == WINED3D_DATA_UAV)
601 }
#define WINED3D_SM4_RESOURCE_TYPE_MASK
Definition: shader_sm4.c:44
union wined3d_shader_instruction::@266 declaration
struct wined3d_shader_semantic semantic
wined3d_sm4_resource_type
Definition: shader_sm4.c:406
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
static enum wined3d_data_type data_type_table[]
Definition: shader_sm4.c:509
#define WINED3D_SM5_UAV_FLAGS_MASK
Definition: shader_sm4.c:74
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3D_SM4_RESOURCE_TYPE_SHIFT
Definition: shader_sm4.c:43
GLenum GLenum GLuint components
Definition: glext.h:9620
#define WINED3D_SM5_UAV_FLAGS_SHIFT
Definition: shader_sm4.c:73
static enum wined3d_shader_resource_type resource_type_table[]
Definition: shader_sm4.c:494
#define ARRAY_SIZE(a)
Definition: main.h:24
wined3d_data_type
wined3d_sm4_data_type
Definition: shader_sm4.c:420

◆ shader_sm4_read_dcl_sampler()

static void shader_sm4_read_dcl_sampler ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 612 of file shader_sm4.c.

615 {
618  FIXME("Unhandled sampler mode %#x.\n", ins->flags);
619  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_SAMPLER, &ins->declaration.dst);
620 }
union wined3d_shader_instruction::@266 declaration
const struct wined3d_shader_dst_param * dst
#define WINED3D_SM4_SAMPLER_MODE_SHIFT
Definition: shader_sm4.c:52
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
#define WINED3D_SM4_SAMPLER_MODE_MASK
Definition: shader_sm4.c:53

◆ shader_sm4_read_declaration_count()

static void shader_sm4_read_declaration_count ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 672 of file shader_sm4.c.

675 {
676  ins->declaration.count = *tokens;
677 }
union wined3d_shader_instruction::@266 declaration

◆ shader_sm4_read_declaration_dst()

static void shader_sm4_read_declaration_dst ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 679 of file shader_sm4.c.

682 {
683  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.dst);
684 }
union wined3d_shader_instruction::@266 declaration
const struct wined3d_shader_dst_param * dst
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579

◆ shader_sm4_read_declaration_register_semantic()

static void shader_sm4_read_declaration_register_semantic ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 686 of file shader_sm4.c.

689 {
690  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT,
691  &ins->declaration.register_semantic.reg);
692  ins->declaration.register_semantic.sysval_semantic = *tokens;
693 }
union wined3d_shader_instruction::@266 declaration
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
struct wined3d_shader_register_semantic register_semantic

◆ shader_sm4_read_dst_param()

static BOOL shader_sm4_read_dst_param ( struct wined3d_sm4_data priv,
const DWORD **  ptr,
const DWORD end,
enum wined3d_data_type  data_type,
struct wined3d_shader_dst_param dst_param 
)
static

Definition at line 1579 of file shader_sm4.c.

1581 {
1582  enum wined3d_shader_src_modifier modifier;
1583  DWORD token;
1584 
1585  if (*ptr >= end)
1586  {
1587  WARN("Invalid ptr %p >= end %p.\n", *ptr, end);
1588  return FALSE;
1589  }
1590  token = **ptr;
1591 
1592  if (!shader_sm4_read_param(priv, ptr, end, data_type, &dst_param->reg, &modifier))
1593  {
1594  ERR("Failed to read parameter.\n");
1595  return FALSE;
1596  }
1597 
1598  if (modifier != WINED3DSPSM_NONE)
1599  {
1600  ERR("Invalid source modifier %#x on destination register.\n", modifier);
1601  return FALSE;
1602  }
1603 
1605  dst_param->modifiers = 0;
1606  dst_param->shift = 0;
1607 
1608  return TRUE;
1609 }
struct wined3d_shader_dst_param dst_param[2]
Definition: shader_sm4.c:455
#define TRUE
Definition: types.h:120
#define WINED3D_SM4_WRITEMASK_MASK
Definition: shader_sm4.c:105
#define WARN(fmt,...)
Definition: debug.h:111
static BOOL shader_sm4_read_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_register *param, enum wined3d_shader_src_modifier *modifier)
Definition: shader_sm4.c:1396
GLuint GLuint end
Definition: gl.h:1545
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
static PVOID ptr
Definition: dispmode.c:27
unsigned long DWORD
Definition: ntddk_ex.h:95
wined3d_shader_src_modifier
#define ERR(fmt,...)
Definition: debug.h:109
#define WINED3D_SM4_WRITEMASK_SHIFT
Definition: shader_sm4.c:104

Referenced by shader_sm4_read_dcl_index_range(), shader_sm4_read_dcl_input_ps(), shader_sm4_read_dcl_input_ps_siv(), shader_sm4_read_dcl_resource(), shader_sm4_read_dcl_sampler(), shader_sm4_read_declaration_dst(), shader_sm4_read_declaration_register_semantic(), shader_sm4_read_instruction(), shader_sm5_read_dcl_resource_raw(), shader_sm5_read_dcl_resource_structured(), shader_sm5_read_dcl_tgsm_raw(), shader_sm5_read_dcl_tgsm_structured(), shader_sm5_read_dcl_uav_raw(), and shader_sm5_read_dcl_uav_structured().

◆ shader_sm4_read_header()

static void shader_sm4_read_header ( void data,
const DWORD **  ptr,
struct wined3d_shader_version shader_version 
)
static

Definition at line 1360 of file shader_sm4.c.

1361 {
1362  struct wined3d_sm4_data *priv = data;
1363 
1364  *ptr = priv->start;
1365  *shader_version = priv->shader_version;
1366 }
static PVOID ptr
Definition: dispmode.c:27
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
struct wined3d_shader_version shader_version
Definition: shader_sm4.c:449
const DWORD * start
Definition: shader_sm4.c:450

◆ shader_sm4_read_instruction()

static void shader_sm4_read_instruction ( void data,
const DWORD **  ptr,
struct wined3d_shader_instruction ins 
)
static

Definition at line 1642 of file shader_sm4.c.

1643 {
1644  const struct wined3d_sm4_opcode_info *opcode_info;
1645  DWORD opcode_token, opcode, previous_token;
1646  struct wined3d_sm4_data *priv = data;
1647  unsigned int i, len;
1648  SIZE_T remaining;
1649  const DWORD *p;
1650  DWORD precise;
1651 
1652  list_move_head(&priv->src_free, &priv->src);
1653 
1654  if (*ptr >= priv->end)
1655  {
1656  WARN("End of byte-code, failed to read opcode.\n");
1657  goto fail;
1658  }
1659  remaining = priv->end - *ptr;
1660 
1661  opcode_token = *(*ptr)++;
1662  opcode = opcode_token & WINED3D_SM4_OPCODE_MASK;
1663 
1665  if (!len)
1666  {
1667  if (remaining < 2)
1668  {
1669  WARN("End of byte-code, failed to read length token.\n");
1670  goto fail;
1671  }
1672  len = **ptr;
1673  }
1674  if (!len || remaining < len)
1675  {
1676  WARN("Read invalid length %u (remaining %lu).\n", len, remaining);
1677  goto fail;
1678  }
1679  --len;
1680 
1681  if (TRACE_ON(d3d_bytecode))
1682  {
1683  TRACE_(d3d_bytecode)("[ %08x ", opcode_token);
1684  for (i = 0; i < len; ++i)
1685  {
1686  TRACE_(d3d_bytecode)("%08x ", (*ptr)[i]);
1687  }
1688  TRACE_(d3d_bytecode)("]\n");
1689  }
1690 
1691  if (!(opcode_info = get_opcode_info(opcode)))
1692  {
1693  FIXME("Unrecognized opcode %#x, opcode_token 0x%08x.\n", opcode, opcode_token);
1695  *ptr += len;
1696  return;
1697  }
1698 
1699  ins->handler_idx = opcode_info->handler_idx;
1700  ins->flags = 0;
1701  ins->coissue = 0;
1702  ins->predicate = NULL;
1703  ins->dst_count = strlen(opcode_info->dst_info);
1704  ins->dst = priv->dst_param;
1705  ins->src_count = strlen(opcode_info->src_info);
1706  ins->src = priv->src_param;
1707  memset(&ins->texel_offset, 0, sizeof(ins->texel_offset));
1708 
1709  p = *ptr;
1710  *ptr += len;
1711 
1712  if (opcode_info->read_opcode_func)
1713  {
1714  opcode_info->read_opcode_func(ins, opcode, opcode_token, p, len, priv);
1715  }
1716  else
1717  {
1718  enum wined3d_shader_dst_modifier instruction_dst_modifier = WINED3DSPDM_NONE;
1719 
1720  previous_token = opcode_token;
1721  while (previous_token & WINED3D_SM4_INSTRUCTION_MODIFIER && p != *ptr)
1722  shader_sm4_read_instruction_modifier(previous_token = *p++, ins);
1723 
1726  {
1728  instruction_dst_modifier = WINED3DSPDM_SATURATE;
1729  }
1730  precise = (opcode_token & WINED3D_SM5_PRECISE_MASK) >> WINED3D_SM5_PRECISE_SHIFT;
1731  ins->flags |= precise << WINED3DSI_PRECISE_SHIFT;
1732 
1733  for (i = 0; i < ins->dst_count; ++i)
1734  {
1735  if (!(shader_sm4_read_dst_param(priv, &p, *ptr, map_data_type(opcode_info->dst_info[i]),
1736  &priv->dst_param[i])))
1737  {
1739  return;
1740  }
1741  priv->dst_param[i].modifiers |= instruction_dst_modifier;
1742  }
1743 
1744  for (i = 0; i < ins->src_count; ++i)
1745  {
1746  if (!(shader_sm4_read_src_param(priv, &p, *ptr, map_data_type(opcode_info->src_info[i]),
1747  &priv->src_param[i])))
1748  {
1750  return;
1751  }
1752  }
1753  }
1754 
1755  return;
1756 
1757 fail:
1758  *ptr = priv->end;
1760  return;
1761 }
struct wined3d_shader_dst_param dst_param[2]
Definition: shader_sm4.c:455
#define WINED3D_SM4_INSTRUCTION_MODIFIER
Definition: shader_sm4.c:27
struct wined3d_shader_src_param src_param[5]
Definition: shader_sm4.c:454
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define WINED3D_SM5_PRECISE_MASK
Definition: shader_sm4.c:65
const struct wined3d_shader_dst_param * dst
#define WARN(fmt,...)
Definition: debug.h:111
#define WINED3D_SM4_INSTRUCTION_FLAGS_MASK
Definition: shader_sm4.c:41
const DWORD * end
Definition: shader_sm4.c:450
#define WINED3D_SM4_INSTRUCTION_LENGTH_MASK
Definition: shader_sm4.c:38
wined3d_shader_dst_modifier
void(* read_opcode_func)(struct wined3d_shader_instruction *ins, DWORD opcode, DWORD opcode_token, const DWORD *tokens, unsigned int token_count, struct wined3d_sm4_data *priv)
Definition: shader_sm4.c:467
#define WINED3D_SM4_INSTRUCTION_FLAG_SATURATE
Definition: shader_sm4.c:116
#define WINED3DSI_PRECISE_SHIFT
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const struct wined3d_shader_src_param * src
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
static const struct wined3d_sm4_opcode_info * get_opcode_info(enum wined3d_sm4_opcode opcode)
Definition: shader_sm4.c:1164
smooth NULL
Definition: ftsmooth.c:416
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
#define TRACE_(x)
Definition: compat.h:66
const struct wined3d_shader_src_param * predicate
enum wined3d_sm4_opcode opcode
Definition: shader_sm4.c:463
#define WINED3D_SM4_OPCODE_MASK
Definition: shader_sm4.c:82
static enum wined3d_data_type map_data_type(char t)
Definition: shader_sm4.c:1201
__WINE_SERVER_LIST_INLINE void list_move_head(struct list *dst, struct list *src)
Definition: list.h:176
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define WINED3D_SM4_INSTRUCTION_FLAGS_SHIFT
Definition: shader_sm4.c:40
GLenum GLsizei len
Definition: glext.h:6722
ULONG_PTR SIZE_T
Definition: typedefs.h:78
struct list src
Definition: shader_sm4.c:457
#define WINED3D_SM5_PRECISE_SHIFT
Definition: shader_sm4.c:64
static void shader_sm4_read_instruction_modifier(DWORD modifier, struct wined3d_shader_instruction *ins)
Definition: shader_sm4.c:1611
struct wined3d_shader_texel_offset texel_offset
const char * dst_info
Definition: shader_sm4.c:465
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
Definition: shader_sm4.c:464
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param)
Definition: shader_sm4.c:1528
GLfloat GLfloat p
Definition: glext.h:8902
struct list src_free
Definition: shader_sm4.c:456
#define WINED3D_SM4_INSTRUCTION_LENGTH_SHIFT
Definition: shader_sm4.c:37
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE_ON(x)
Definition: compat.h:65
const char * src_info
Definition: shader_sm4.c:466

◆ shader_sm4_read_instruction_modifier()

static void shader_sm4_read_instruction_modifier ( DWORD  modifier,
struct wined3d_shader_instruction ins 
)
static

Definition at line 1611 of file shader_sm4.c.

1612 {
1613  static const DWORD recognized_bits = WINED3D_SM4_INSTRUCTION_MODIFIER
1618 
1619  if (modifier & ~recognized_bits)
1620  {
1621  FIXME("Unhandled modifier 0x%08x.\n", modifier);
1622  }
1623  else
1624  {
1625  /* Bit fields are used for sign extension */
1626  struct
1627  {
1628  int u : 4;
1629  int v : 4;
1630  int w : 4;
1631  }
1632  aoffimmi;
1633  aoffimmi.u = (modifier & WINED3D_SM4_AOFFIMMI_U_MASK) >> WINED3D_SM4_AOFFIMMI_U_SHIFT;
1634  aoffimmi.v = (modifier & WINED3D_SM4_AOFFIMMI_V_MASK) >> WINED3D_SM4_AOFFIMMI_V_SHIFT;
1635  aoffimmi.w = (modifier & WINED3D_SM4_AOFFIMMI_W_MASK) >> WINED3D_SM4_AOFFIMMI_W_SHIFT;
1636  ins->texel_offset.u = aoffimmi.u;
1637  ins->texel_offset.v = aoffimmi.v;
1638  ins->texel_offset.w = aoffimmi.w;
1639  }
1640 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define WINED3D_SM4_INSTRUCTION_MODIFIER
Definition: shader_sm4.c:27
#define WINED3D_SM4_AOFFIMMI_W_SHIFT
Definition: shader_sm4.c:34
#define WINED3D_SM4_AOFFIMMI_U_MASK
Definition: shader_sm4.c:31
#define WINED3D_SM4_MODIFIER_AOFFIMMI
Definition: shader_sm4.c:29
#define FIXME(fmt,...)
Definition: debug.h:110
#define WINED3D_SM4_AOFFIMMI_U_SHIFT
Definition: shader_sm4.c:30
#define WINED3D_SM4_AOFFIMMI_V_SHIFT
Definition: shader_sm4.c:32
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3D_SM4_AOFFIMMI_V_MASK
Definition: shader_sm4.c:33
#define WINED3D_SM4_AOFFIMMI_W_MASK
Definition: shader_sm4.c:35
const GLdouble * v
Definition: gl.h:2040
struct wined3d_shader_texel_offset texel_offset

Referenced by shader_sm4_read_instruction().

◆ shader_sm4_read_param()

static BOOL shader_sm4_read_param ( struct wined3d_sm4_data priv,
const DWORD **  ptr,
const DWORD end,
enum wined3d_data_type  data_type,
struct wined3d_shader_register param,
enum wined3d_shader_src_modifier modifier 
)
static

Definition at line 1396 of file shader_sm4.c.

1399 {
1400  enum wined3d_sm4_register_type register_type;
1401  DWORD token, order;
1402 
1403  if (*ptr >= end)
1404  {
1405  WARN("Invalid ptr %p >= end %p.\n", *ptr, end);
1406  return FALSE;
1407  }
1408  token = *(*ptr)++;
1409 
1411  if (register_type >= ARRAY_SIZE(register_type_table)
1412  || register_type_table[register_type] == ~0u)
1413  {
1414  FIXME("Unhandled register type %#x.\n", register_type);
1415  param->type = WINED3DSPR_TEMP;
1416  }
1417  else
1418  {
1419  param->type = register_type_table[register_type];
1420  }
1421  param->data_type = data_type;
1422 
1424  {
1425  DWORD m;
1426 
1427  if (*ptr >= end)
1428  {
1429  WARN("Invalid ptr %p >= end %p.\n", *ptr, end);
1430  return FALSE;
1431  }
1432  m = *(*ptr)++;
1433 
1434  switch (m)
1435  {
1436  case 0x41:
1437  *modifier = WINED3DSPSM_NEG;
1438  break;
1439 
1440  case 0x81:
1441  *modifier = WINED3DSPSM_ABS;
1442  break;
1443 
1444  case 0xc1:
1445  *modifier = WINED3DSPSM_ABSNEG;
1446  break;
1447 
1448  default:
1449  FIXME("Skipping modifier 0x%08x.\n", m);
1450  *modifier = WINED3DSPSM_NONE;
1451  break;
1452  }
1453  }
1454  else
1455  {
1456  *modifier = WINED3DSPSM_NONE;
1457  }
1458 
1460 
1461  if (order < 1)
1462  param->idx[0].offset = ~0U;
1463  else
1464  {
1466  if (!(shader_sm4_read_reg_idx(priv, ptr, end, addressing, &param->idx[0])))
1467  {
1468  ERR("Failed to read register index.\n");
1469  return FALSE;
1470  }
1471  }
1472 
1473  if (order < 2)
1474  param->idx[1].offset = ~0U;
1475  else
1476  {
1478  if (!(shader_sm4_read_reg_idx(priv, ptr, end, addressing, &param->idx[1])))
1479  {
1480  ERR("Failed to read register index.\n");
1481  return FALSE;
1482  }
1483  }
1484 
1485  if (order > 2)
1486  FIXME("Unhandled order %u.\n", order);
1487 
1488  if (register_type == WINED3D_SM4_RT_IMMCONST)
1489  {
1490  enum wined3d_sm4_immconst_type immconst_type =
1492 
1493  switch (immconst_type)
1494  {
1496  param->immconst_type = WINED3D_IMMCONST_SCALAR;
1497  if (end - *ptr < 1)
1498  {
1499  WARN("Invalid ptr %p, end %p.\n", *ptr, end);
1500  return FALSE;
1501  }
1502  memcpy(param->u.immconst_data, *ptr, 1 * sizeof(DWORD));
1503  *ptr += 1;
1504  break;
1505 
1507  param->immconst_type = WINED3D_IMMCONST_VEC4;
1508  if (end - *ptr < 4)
1509  {
1510  WARN("Invalid ptr %p, end %p.\n", *ptr, end);
1511  return FALSE;
1512  }
1513  memcpy(param->u.immconst_data, *ptr, 4 * sizeof(DWORD));
1514  *ptr += 4;
1515  break;
1516 
1517  default:
1518  FIXME("Unhandled immediate constant type %#x.\n", immconst_type);
1519  break;
1520  }
1521  }
1522 
1523  map_register(priv, param);
1524 
1525  return TRUE;
1526 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define TRUE
Definition: types.h:120
#define WINED3D_SM4_REGISTER_ORDER_SHIFT
Definition: shader_sm4.c:92
#define WINED3D_SM4_REGISTER_TYPE_SHIFT
Definition: shader_sm4.c:95
#define WINED3D_SM4_ADDRESSING_SHIFT1
Definition: shader_sm4.c:86
#define WARN(fmt,...)
Definition: debug.h:111
#define U(x)
Definition: wordpad.c:44
GLuint GLuint end
Definition: gl.h:1545
const GLfloat * m
Definition: glext.h:10848
wined3d_sm4_register_type
Definition: shader_sm4.c:307
#define WINED3D_SM4_REGISTER_MODIFIER
Definition: shader_sm4.c:84
static BOOL shader_sm4_read_reg_idx(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, DWORD addressing, struct wined3d_shader_register_index *reg_idx)
Definition: shader_sm4.c:1368
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
#define WINED3D_SM4_ADDRESSING_MASK1
Definition: shader_sm4.c:87
wined3d_sm4_immconst_type
Definition: shader_sm4.c:400
#define WINED3D_SM4_IMMCONST_TYPE_SHIFT
Definition: shader_sm4.c:101
GLfloat param
Definition: glext.h:5796
unsigned long DWORD
Definition: ntddk_ex.h:95
static void map_register(const struct wined3d_sm4_data *priv, struct wined3d_shader_register *reg)
Definition: shader_sm4.c:1176
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WINED3D_SM4_ADDRESSING_SHIFT0
Definition: shader_sm4.c:89
#define ERR(fmt,...)
Definition: debug.h:109
static enum wined3d_shader_register_type register_type_table[]
Definition: shader_sm4.c:1120
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WINED3D_SM4_ADDRESSING_MASK0
Definition: shader_sm4.c:90
#define WINED3D_SM4_IMMCONST_TYPE_MASK
Definition: shader_sm4.c:102
#define WINED3D_SM4_REGISTER_TYPE_MASK
Definition: shader_sm4.c:96
#define WINED3D_SM4_REGISTER_ORDER_MASK
Definition: shader_sm4.c:93

Referenced by shader_sm4_read_dst_param(), and shader_sm4_read_src_param().

◆ shader_sm4_read_reg_idx()

static BOOL shader_sm4_read_reg_idx ( struct wined3d_sm4_data priv,
const DWORD **  ptr,
const DWORD end,
DWORD  addressing,
struct wined3d_shader_register_index reg_idx 
)
static

Definition at line 1368 of file shader_sm4.c.

1370 {
1371  if (addressing & WINED3D_SM4_ADDRESSING_RELATIVE)
1372  {
1373  struct wined3d_shader_src_param *rel_addr = get_src_param(priv);
1374 
1375  if (!(reg_idx->rel_addr = rel_addr))
1376  {
1377  ERR("Failed to get src param for relative addressing.\n");
1378  return FALSE;
1379  }
1380 
1381  if (addressing & WINED3D_SM4_ADDRESSING_OFFSET)
1382  reg_idx->offset = *(*ptr)++;
1383  else
1384  reg_idx->offset = 0;
1386  }
1387  else
1388  {
1389  reg_idx->rel_addr = NULL;
1390  reg_idx->offset = *(*ptr)++;
1391  }
1392 
1393  return TRUE;
1394 }
#define TRUE
Definition: types.h:120
GLuint GLuint end
Definition: gl.h:1545
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
#define WINED3D_SM4_ADDRESSING_RELATIVE
Definition: shader_sm4.c:113
#define ERR(fmt,...)
Definition: debug.h:109
const struct wined3d_shader_src_param * rel_addr
static struct wined3d_shader_src_param * get_src_param(struct wined3d_sm4_data *priv)
Definition: shader_sm4.c:1338
#define WINED3D_SM4_ADDRESSING_OFFSET
Definition: shader_sm4.c:114
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param)
Definition: shader_sm4.c:1528

Referenced by shader_sm4_read_param().

◆ shader_sm4_read_shader_data()

static void shader_sm4_read_shader_data ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 533 of file shader_sm4.c.

536 {
538  unsigned int icb_size;
539 
542  {
543  FIXME("Ignoring shader data type %#x.\n", type);
545  return;
546  }
547 
548  ++tokens;
549  icb_size = token_count - 1;
550  if (icb_size % 4 || icb_size > MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE)
551  {
552  FIXME("Unexpected immediate constant buffer size %u.\n", icb_size);
554  return;
555  }
556 
557  priv->icb.vec4_count = icb_size / 4;
558  memcpy(priv->icb.data, tokens, sizeof(*tokens) * icb_size);
559  ins->declaration.icb = &priv->icb;
560 }
const struct wined3d_shader_immediate_constant_buffer * icb
union wined3d_shader_instruction::@266 declaration
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define WINED3D_SM4_SHADER_DATA_TYPE_MASK
Definition: shader_sm4.c:56
struct wined3d_shader_immediate_constant_buffer icb
Definition: shader_sm4.c:458
#define FIXME(fmt,...)
Definition: debug.h:110
enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx
wined3d_sm4_shader_data_type
Definition: shader_sm4.c:435
#define WINED3D_SM4_SHADER_DATA_TYPE_SHIFT
Definition: shader_sm4.c:55
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE

◆ shader_sm4_read_src_param()

static BOOL shader_sm4_read_src_param ( struct wined3d_sm4_data priv,
const DWORD **  ptr,
const DWORD end,
enum wined3d_data_type  data_type,
struct wined3d_shader_src_param src_param 
)
static

Definition at line 1528 of file shader_sm4.c.

1530 {
1531  DWORD token;
1532 
1533  if (*ptr >= end)
1534  {
1535  WARN("Invalid ptr %p >= end %p.\n", *ptr, end);
1536  return FALSE;
1537  }
1538  token = **ptr;
1539 
1540  if (!shader_sm4_read_param(priv, ptr, end, data_type, &src_param->reg, &src_param->modifiers))
1541  {
1542  ERR("Failed to read parameter.\n");
1543  return FALSE;
1544  }
1545 
1546  if (src_param->reg.type == WINED3DSPR_IMMCONST)
1547  {
1548  src_param->swizzle = WINED3DSP_NOSWIZZLE;
1549  }
1550  else
1551  {
1552  enum wined3d_sm4_swizzle_type swizzle_type =
1554 
1555  switch (swizzle_type)
1556  {
1558  src_param->swizzle = WINED3DSP_NOSWIZZLE;
1559  break;
1560 
1563  src_param->swizzle = (src_param->swizzle & 0x3) * 0x55;
1564  break;
1565 
1568  break;
1569 
1570  default:
1571  FIXME("Unhandled swizzle type %#x.\n", swizzle_type);
1572  break;
1573  }
1574  }
1575 
1576  return TRUE;
1577 }
#define WINED3D_SM4_SWIZZLE_MASK
Definition: shader_sm4.c:108
#define TRUE
Definition: types.h:120
#define WARN(fmt,...)
Definition: debug.h:111
static BOOL shader_sm4_read_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_register *param, enum wined3d_shader_src_modifier *modifier)
Definition: shader_sm4.c:1396
GLuint GLuint end
Definition: gl.h:1545
#define WINED3D_SM4_SWIZZLE_SHIFT
Definition: shader_sm4.c:107
enum wined3d_shader_src_modifier modifiers
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
Definition: glfuncs.h:210
#define FIXME(fmt,...)
Definition: debug.h:110
static PVOID ptr
Definition: dispmode.c:27
#define WINED3DSP_NOSWIZZLE
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3D_SM4_SWIZZLE_TYPE_MASK
Definition: shader_sm4.c:99
#define ERR(fmt,...)
Definition: debug.h:109
#define WINED3D_SM4_SWIZZLE_TYPE_SHIFT
Definition: shader_sm4.c:98
struct wined3d_shader_register reg
wined3d_sm4_swizzle_type
Definition: shader_sm4.c:393

Referenced by shader_sm4_read_conditional_op(), shader_sm4_read_dcl_constant_buffer(), shader_sm4_read_instruction(), shader_sm4_read_reg_idx(), and shader_sm5_read_fcall().

◆ shader_sm5_read_control_point_count()

static void shader_sm5_read_control_point_count ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 763 of file shader_sm4.c.

766 {
769 }
union wined3d_shader_instruction::@266 declaration
#define WINED3D_SM5_CONTROL_POINT_COUNT_SHIFT
Definition: shader_sm4.c:67
#define WINED3D_SM5_CONTROL_POINT_COUNT_MASK
Definition: shader_sm4.c:68

◆ shader_sm5_read_dcl_function_body()

static void shader_sm5_read_dcl_function_body ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 737 of file shader_sm4.c.

740 {
741  ins->declaration.index = *tokens;
742 }
union wined3d_shader_instruction::@266 declaration

◆ shader_sm5_read_dcl_function_table()

static void shader_sm5_read_dcl_function_table ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 744 of file shader_sm4.c.

747 {
748  ins->declaration.index = *tokens++;
749  FIXME("Ignoring set of function bodies (count %u).\n", *tokens);
750 }
union wined3d_shader_instruction::@266 declaration
#define FIXME(fmt,...)
Definition: debug.h:110

◆ shader_sm5_read_dcl_hs_max_tessfactor()

static void shader_sm5_read_dcl_hs_max_tessfactor ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 795 of file shader_sm4.c.

798 {
799  ins->declaration.max_tessellation_factor = *(float *)tokens;
800 }
union wined3d_shader_instruction::@266 declaration

◆ shader_sm5_read_dcl_interface()

static void shader_sm5_read_dcl_interface ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 752 of file shader_sm4.c.

755 {
756  ins->declaration.fp.index = *tokens++;
757  ins->declaration.fp.body_count = *tokens++;
758  ins->declaration.fp.array_size = *tokens >> WINED3D_SM5_FP_ARRAY_SIZE_SHIFT;
759  ins->declaration.fp.table_count = *tokens++ & WINED3D_SM5_FP_TABLE_COUNT_MASK;
760  FIXME("Ignoring set of function tables (count %u).\n", ins->declaration.fp.table_count);
761 }
union wined3d_shader_instruction::@266 declaration
#define WINED3D_SM5_FP_ARRAY_SIZE_SHIFT
Definition: shader_sm4.c:70
#define FIXME(fmt,...)
Definition: debug.h:110
#define WINED3D_SM5_FP_TABLE_COUNT_MASK
Definition: shader_sm4.c:71
struct wined3d_shader_function_table_pointer fp

◆ shader_sm5_read_dcl_resource_raw()

static void shader_sm5_read_dcl_resource_raw ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 864 of file shader_sm4.c.

867 {
868  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_RESOURCE, &ins->declaration.dst);
869 }
union wined3d_shader_instruction::@266 declaration
const struct wined3d_shader_dst_param * dst
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579

◆ shader_sm5_read_dcl_resource_structured()

static void shader_sm5_read_dcl_resource_structured ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 853 of file shader_sm4.c.

856 {
857  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_RESOURCE,
858  &ins->declaration.structured_resource.reg);
859  ins->declaration.structured_resource.byte_stride = *tokens;
860  if (ins->declaration.structured_resource.byte_stride % 4)
861  FIXME("Byte stride %u is not multiple of 4.\n", ins->declaration.structured_resource.byte_stride);
862 }
union wined3d_shader_instruction::@266 declaration
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
struct wined3d_shader_structured_resource structured_resource

◆ shader_sm5_read_dcl_tessellator_domain()

static void shader_sm5_read_dcl_tessellator_domain ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 771 of file shader_sm4.c.

774 {
777 }
#define WINED3D_SM5_TESSELLATOR_MASK
Definition: shader_sm4.c:80
union wined3d_shader_instruction::@266 declaration
enum wined3d_tessellator_domain tessellator_domain
#define WINED3D_SM5_TESSELLATOR_SHIFT
Definition: shader_sm4.c:79

◆ shader_sm5_read_dcl_tessellator_output_primitive()

static void shader_sm5_read_dcl_tessellator_output_primitive ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 787 of file shader_sm4.c.

790 {
793 }
#define WINED3D_SM5_TESSELLATOR_MASK
Definition: shader_sm4.c:80
union wined3d_shader_instruction::@266 declaration
#define WINED3D_SM5_TESSELLATOR_SHIFT
Definition: shader_sm4.c:79
enum wined3d_tessellator_output_primitive tessellator_output_primitive

◆ shader_sm5_read_dcl_tessellator_partitioning()

static void shader_sm5_read_dcl_tessellator_partitioning ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 779 of file shader_sm4.c.

782 {
785 }
#define WINED3D_SM5_TESSELLATOR_MASK
Definition: shader_sm4.c:80
union wined3d_shader_instruction::@266 declaration
enum wined3d_tessellator_partitioning tessellator_partitioning
#define WINED3D_SM5_TESSELLATOR_SHIFT
Definition: shader_sm4.c:79

◆ shader_sm5_read_dcl_tgsm_raw()

static void shader_sm5_read_dcl_tgsm_raw ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 831 of file shader_sm4.c.

834 {
835  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT, &ins->declaration.tgsm_raw.reg);
836  ins->declaration.tgsm_raw.byte_count = *tokens;
837  if (ins->declaration.tgsm_raw.byte_count % 4)
838  FIXME("Byte count %u is not multiple of 4.\n", ins->declaration.tgsm_raw.byte_count);
839 }
struct wined3d_shader_tgsm_raw tgsm_raw
union wined3d_shader_instruction::@266 declaration
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579

◆ shader_sm5_read_dcl_tgsm_structured()

static void shader_sm5_read_dcl_tgsm_structured ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 841 of file shader_sm4.c.

844 {
845  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_FLOAT,
846  &ins->declaration.tgsm_structured.reg);
847  ins->declaration.tgsm_structured.byte_stride = *tokens++;
848  ins->declaration.tgsm_structured.structure_count = *tokens;
849  if (ins->declaration.tgsm_structured.byte_stride % 4)
850  FIXME("Byte stride %u is not multiple of 4.\n", ins->declaration.tgsm_structured.byte_stride);
851 }
union wined3d_shader_instruction::@266 declaration
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
struct wined3d_shader_tgsm_structured tgsm_structured

◆ shader_sm5_read_dcl_thread_group()

static void shader_sm5_read_dcl_thread_group ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 802 of file shader_sm4.c.

805 {
806  ins->declaration.thread_group_size.x = *tokens++;
807  ins->declaration.thread_group_size.y = *tokens++;
808  ins->declaration.thread_group_size.z = *tokens++;
809 }
union wined3d_shader_instruction::@266 declaration
struct wined3d_shader_thread_group_size thread_group_size

◆ shader_sm5_read_dcl_uav_raw()

static void shader_sm5_read_dcl_uav_raw ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 811 of file shader_sm4.c.

814 {
815  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UAV, &ins->declaration.dst);
817 }
union wined3d_shader_instruction::@266 declaration
const struct wined3d_shader_dst_param * dst
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
#define WINED3D_SM5_UAV_FLAGS_MASK
Definition: shader_sm4.c:74
#define WINED3D_SM5_UAV_FLAGS_SHIFT
Definition: shader_sm4.c:73

◆ shader_sm5_read_dcl_uav_structured()

static void shader_sm5_read_dcl_uav_structured ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 819 of file shader_sm4.c.

822 {
823  shader_sm4_read_dst_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_UAV,
824  &ins->declaration.structured_resource.reg);
826  ins->declaration.structured_resource.byte_stride = *tokens;
827  if (ins->declaration.structured_resource.byte_stride % 4)
828  FIXME("Byte stride %u is not multiple of 4.\n", ins->declaration.structured_resource.byte_stride);
829 }
union wined3d_shader_instruction::@266 declaration
#define FIXME(fmt,...)
Definition: debug.h:110
static BOOL shader_sm4_read_dst_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_dst_param *dst_param)
Definition: shader_sm4.c:1579
#define WINED3D_SM5_UAV_FLAGS_MASK
Definition: shader_sm4.c:74
#define WINED3D_SM5_UAV_FLAGS_SHIFT
Definition: shader_sm4.c:73
struct wined3d_shader_structured_resource structured_resource

◆ shader_sm5_read_fcall()

static void shader_sm5_read_fcall ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 729 of file shader_sm4.c.

732 {
733  priv->src_param[0].reg.u.fp_body_idx = *tokens++;
734  shader_sm4_read_src_param(priv, &tokens, &tokens[token_count], WINED3D_DATA_OPAQUE, &priv->src_param[0]);
735 }
struct wined3d_shader_src_param src_param[5]
Definition: shader_sm4.c:454
static BOOL shader_sm4_read_src_param(struct wined3d_sm4_data *priv, const DWORD **ptr, const DWORD *end, enum wined3d_data_type data_type, struct wined3d_shader_src_param *src_param)
Definition: shader_sm4.c:1528

◆ shader_sm5_read_sync()

static void shader_sm5_read_sync ( struct wined3d_shader_instruction ins,
DWORD  opcode,
DWORD  opcode_token,
const DWORD tokens,
unsigned int  token_count,
struct wined3d_sm4_data priv 
)
static

Definition at line 871 of file shader_sm4.c.

874 {
876 }
#define WINED3D_SM5_SYNC_FLAGS_SHIFT
Definition: shader_sm4.c:76
#define WINED3D_SM5_SYNC_FLAGS_MASK
Definition: shader_sm4.c:77

◆ WINE_DECLARE_DEBUG_CHANNEL()

WINE_DECLARE_DEBUG_CHANNEL ( d3d_bytecode  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d_shader  )

◆ wined3d_get_sm4_shader_type()

enum wined3d_shader_type wined3d_get_sm4_shader_type ( const DWORD byte_code,
size_t  byte_code_size 
)

Definition at line 1225 of file shader_sm4.c.

1226 {
1228 
1229  if (byte_code_size / sizeof(*byte_code) < 1)
1230  {
1231  WARN("Invalid byte code size %lu.\n", (long)byte_code_size);
1233  }
1234 
1235  shader_type = byte_code[0] >> 16;
1236  switch (shader_type)
1237  {
1238  case WINED3D_SM4_PS:
1240  break;
1241  case WINED3D_SM4_VS:
1243  break;
1244  case WINED3D_SM4_GS:
1246  break;
1247  case WINED3D_SM5_HS:
1248  return WINED3D_SHADER_TYPE_HULL;
1249  break;
1250  case WINED3D_SM5_DS:
1252  break;
1253  case WINED3D_SM5_CS:
1255  break;
1256  default:
1257  FIXME("Unrecognised shader type %#x.\n", shader_type);
1259  }
1260 }
#define WINED3D_SM5_CS
#define WARN(fmt,...)
Definition: debug.h:111
#define WINED3D_SM4_GS
#define WINED3D_SM5_HS
#define FIXME(fmt,...)
Definition: debug.h:110
#define WINED3D_SM5_DS
unsigned long DWORD
Definition: ntddk_ex.h:95
#define WINED3D_SM4_PS
#define WINED3D_SM4_VS

Referenced by shader_get_shader_type(), and shader_sm4_init().

Variable Documentation

◆ data_type_table

◆ input_primitive_type_table

◆ opcode_table

const struct wined3d_sm4_opcode_info opcode_table[]
static

Definition at line 887 of file shader_sm4.c.

Referenced by get_opcode_info(), and shader_get_opcode().

◆ output_primitive_type_table

◆ register_type_table

enum wined3d_shader_register_type register_type_table[]
static

Definition at line 1120 of file shader_sm4.c.

Referenced by shader_sm4_read_param().

◆ resource_type_table

◆ sm4_shader_frontend

const struct wined3d_shader_frontend sm4_shader_frontend
Initial value:
=
{
}
static BOOL shader_sm4_is_end(void *data, const DWORD **ptr)
Definition: shader_sm4.c:1763
static void shader_sm4_free(void *data)
Definition: shader_sm4.c:1325
static void * shader_sm4_init(const DWORD *byte_code, size_t byte_code_size, const struct wined3d_shader_signature *output_signature)
Definition: shader_sm4.c:1262
static void shader_sm4_read_instruction(void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins)
Definition: shader_sm4.c:1642
static void shader_sm4_read_header(void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version)
Definition: shader_sm4.c:1360

Definition at line 1769 of file shader_sm4.c.

Referenced by shader_select_frontend().