summaryrefslogtreecommitdiffstats
path: root/src/vulkan/gen7_pack.h
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2015-06-10 23:11:37 -0700
committerKristian Høgsberg Kristensen <[email protected]>2015-06-11 09:25:04 -0700
commita5b49d2799a5d52c3a86f97efc2dfeecf6c9c8bf (patch)
tree499bc614b2d9827e785281412d379f31d4679049 /src/vulkan/gen7_pack.h
parentea7ef46cf9c91c27e70c837db0d162382efaddcb (diff)
vk: Use generated headers with fixed point support
The generated headers now convert float in the template struct to the correct fixed point format.
Diffstat (limited to 'src/vulkan/gen7_pack.h')
-rw-r--r--src/vulkan/gen7_pack.h112
1 files changed, 56 insertions, 56 deletions
diff --git a/src/vulkan/gen7_pack.h b/src/vulkan/gen7_pack.h
index 5e56ce2d367..09a477bc663 100644
--- a/src/vulkan/gen7_pack.h
+++ b/src/vulkan/gen7_pack.h
@@ -576,10 +576,10 @@ struct GEN7_3DSTATE_AA_LINE_PARAMETERS {
uint32_t _3DCommandOpcode;
uint32_t _3DCommandSubOpcode;
uint32_t DwordLength;
- uint32_t AACoverageBias;
- uint32_t AACoverageSlope;
- uint32_t AACoverageEndCapBias;
- uint32_t AACoverageEndCapSlope;
+ float AACoverageBias;
+ float AACoverageSlope;
+ float AACoverageEndCapBias;
+ float AACoverageEndCapSlope;
};
static inline void
@@ -597,13 +597,13 @@ GEN7_3DSTATE_AA_LINE_PARAMETERS_pack(__gen_user_data *data, void * restrict dst,
0;
dw[1] =
- __gen_field(values->AACoverageBias, 16, 23) |
- __gen_field(values->AACoverageSlope, 0, 7) |
+ __gen_field(values->AACoverageBias * (1 << 8), 16, 23) |
+ __gen_field(values->AACoverageSlope * (1 << 8), 0, 7) |
0;
dw[2] =
- __gen_field(values->AACoverageEndCapBias, 16, 23) |
- __gen_field(values->AACoverageEndCapSlope, 0, 7) |
+ __gen_field(values->AACoverageEndCapBias * (1 << 8), 16, 23) |
+ __gen_field(values->AACoverageEndCapSlope * (1 << 8), 0, 7) |
0;
}
@@ -1014,8 +1014,8 @@ struct GEN7_3DSTATE_CLIP {
#define Vertex1 1
#define Vertex2 2
uint32_t TriangleFanProvokingVertexSelect;
- uint32_t MinimumPointWidth;
- uint32_t MaximumPointWidth;
+ float MinimumPointWidth;
+ float MaximumPointWidth;
uint32_t ForceZeroRTAIndexEnable;
uint32_t MaximumVPIndex;
};
@@ -1059,8 +1059,8 @@ GEN7_3DSTATE_CLIP_pack(__gen_user_data *data, void * restrict dst,
0;
dw[3] =
- __gen_field(values->MinimumPointWidth, 17, 27) |
- __gen_field(values->MaximumPointWidth, 6, 16) |
+ __gen_field(values->MinimumPointWidth * (1 << 3), 17, 27) |
+ __gen_field(values->MaximumPointWidth * (1 << 3), 6, 16) |
__gen_field(values->ForceZeroRTAIndexEnable, 5, 5) |
__gen_field(values->MaximumVPIndex, 0, 3) |
0;
@@ -1937,7 +1937,7 @@ struct GEN7_3DSTATE_LINE_STIPPLE {
uint32_t CurrentRepeatCounter;
uint32_t CurrentStippleIndex;
uint32_t LineStipplePattern;
- uint32_t LineStippleInverseRepeatCount;
+ float LineStippleInverseRepeatCount;
uint32_t LineStippleRepeatCount;
};
@@ -1963,7 +1963,7 @@ GEN7_3DSTATE_LINE_STIPPLE_pack(__gen_user_data *data, void * restrict dst,
0;
dw[2] =
- __gen_field(values->LineStippleInverseRepeatCount, 15, 31) |
+ __gen_field(values->LineStippleInverseRepeatCount * (1 << 16), 15, 31) |
__gen_field(values->LineStippleRepeatCount, 0, 8) |
0;
@@ -2031,22 +2031,22 @@ struct GEN7_3DSTATE_MULTISAMPLE {
#define NUMSAMPLES_4 2
#define NUMSAMPLES_8 3
uint32_t NumberofMultisamples;
- uint32_t Sample3XOffset;
- uint32_t Sample3YOffset;
- uint32_t Sample2XOffset;
- uint32_t Sample2YOffset;
- uint32_t Sample1XOffset;
- uint32_t Sample1YOffset;
- uint32_t Sample0XOffset;
- uint32_t Sample0YOffset;
- uint32_t Sample7XOffset;
- uint32_t Sample7YOffset;
- uint32_t Sample6XOffset;
- uint32_t Sample6YOffset;
- uint32_t Sample5XOffset;
- uint32_t Sample5YOffset;
- uint32_t Sample4XOffset;
- uint32_t Sample4YOffset;
+ float Sample3XOffset;
+ float Sample3YOffset;
+ float Sample2XOffset;
+ float Sample2YOffset;
+ float Sample1XOffset;
+ float Sample1YOffset;
+ float Sample0XOffset;
+ float Sample0YOffset;
+ float Sample7XOffset;
+ float Sample7YOffset;
+ float Sample6XOffset;
+ float Sample6YOffset;
+ float Sample5XOffset;
+ float Sample5YOffset;
+ float Sample4XOffset;
+ float Sample4YOffset;
};
static inline void
@@ -2069,25 +2069,25 @@ GEN7_3DSTATE_MULTISAMPLE_pack(__gen_user_data *data, void * restrict dst,
0;
dw[2] =
- __gen_field(values->Sample3XOffset, 28, 31) |
- __gen_field(values->Sample3YOffset, 24, 27) |
- __gen_field(values->Sample2XOffset, 20, 23) |
- __gen_field(values->Sample2YOffset, 16, 19) |
- __gen_field(values->Sample1XOffset, 12, 15) |
- __gen_field(values->Sample1YOffset, 8, 11) |
- __gen_field(values->Sample0XOffset, 4, 7) |
- __gen_field(values->Sample0YOffset, 0, 3) |
+ __gen_field(values->Sample3XOffset * (1 << 4), 28, 31) |
+ __gen_field(values->Sample3YOffset * (1 << 4), 24, 27) |
+ __gen_field(values->Sample2XOffset * (1 << 4), 20, 23) |
+ __gen_field(values->Sample2YOffset * (1 << 4), 16, 19) |
+ __gen_field(values->Sample1XOffset * (1 << 4), 12, 15) |
+ __gen_field(values->Sample1YOffset * (1 << 4), 8, 11) |
+ __gen_field(values->Sample0XOffset * (1 << 4), 4, 7) |
+ __gen_field(values->Sample0YOffset * (1 << 4), 0, 3) |
0;
dw[3] =
- __gen_field(values->Sample7XOffset, 28, 31) |
- __gen_field(values->Sample7YOffset, 24, 27) |
- __gen_field(values->Sample6XOffset, 20, 23) |
- __gen_field(values->Sample6YOffset, 16, 19) |
- __gen_field(values->Sample5XOffset, 12, 15) |
- __gen_field(values->Sample5YOffset, 8, 11) |
- __gen_field(values->Sample4XOffset, 4, 7) |
- __gen_field(values->Sample4YOffset, 0, 3) |
+ __gen_field(values->Sample7XOffset * (1 << 4), 28, 31) |
+ __gen_field(values->Sample7YOffset * (1 << 4), 24, 27) |
+ __gen_field(values->Sample6XOffset * (1 << 4), 20, 23) |
+ __gen_field(values->Sample6YOffset * (1 << 4), 16, 19) |
+ __gen_field(values->Sample5XOffset * (1 << 4), 12, 15) |
+ __gen_field(values->Sample5YOffset * (1 << 4), 8, 11) |
+ __gen_field(values->Sample4XOffset * (1 << 4), 4, 7) |
+ __gen_field(values->Sample4YOffset * (1 << 4), 0, 3) |
0;
}
@@ -3050,7 +3050,7 @@ struct GEN7_3DSTATE_SF {
#define CULLMODE_FRONT 2
#define CULLMODE_BACK 3
uint32_t CullMode;
- uint32_t LineWidth;
+ float LineWidth;
uint32_t LineEndCapAntialiasingRegionWidth;
uint32_t ScissorRectangleEnable;
uint32_t MultisampleRasterizationMode;
@@ -3068,7 +3068,7 @@ struct GEN7_3DSTATE_SF {
uint32_t AALineDistanceMode;
uint32_t VertexSubPixelPrecisionSelect;
uint32_t UsePointWidthState;
- uint32_t PointWidth;
+ float PointWidth;
uint32_t GlobalDepthOffsetConstant;
uint32_t GlobalDepthOffsetScale;
uint32_t GlobalDepthOffsetClamp;
@@ -3104,7 +3104,7 @@ GEN7_3DSTATE_SF_pack(__gen_user_data *data, void * restrict dst,
dw[2] =
__gen_field(values->AntiAliasingEnable, 31, 31) |
__gen_field(values->CullMode, 29, 30) |
- __gen_field(values->LineWidth, 18, 27) |
+ __gen_field(values->LineWidth * (1 << 7), 18, 27) |
__gen_field(values->LineEndCapAntialiasingRegionWidth, 16, 17) |
__gen_field(values->ScissorRectangleEnable, 11, 11) |
__gen_field(values->MultisampleRasterizationMode, 8, 9) |
@@ -3118,7 +3118,7 @@ GEN7_3DSTATE_SF_pack(__gen_user_data *data, void * restrict dst,
__gen_field(values->AALineDistanceMode, 14, 14) |
__gen_field(values->VertexSubPixelPrecisionSelect, 12, 12) |
__gen_field(values->UsePointWidthState, 11, 11) |
- __gen_field(values->PointWidth, 0, 10) |
+ __gen_field(values->PointWidth * (1 << 3), 0, 10) |
0;
dw[4] =
@@ -6249,7 +6249,7 @@ struct GEN7_SAMPLER_STATE {
uint32_t TextureBorderColorMode;
#define OGL 1
uint32_t LODPreClampEnable;
- uint32_t BaseMipLevel;
+ float BaseMipLevel;
#define MIPFILTER_NONE 0
#define MIPFILTER_NEAREST 1
#define MIPFILTER_LINEAR 3
@@ -6268,8 +6268,8 @@ struct GEN7_SAMPLER_STATE {
#define LEGACY 0
#define EWAApproximation 1
uint32_t AnisotropicAlgorithm;
- uint32_t MinLOD;
- uint32_t MaxLOD;
+ float MinLOD;
+ float MaxLOD;
#define PREFILTEROPALWAYS 0
#define PREFILTEROPNEVER 1
#define PREFILTEROPLESS 2
@@ -6323,7 +6323,7 @@ GEN7_SAMPLER_STATE_pack(__gen_user_data *data, void * restrict dst,
__gen_field(values->SamplerDisable, 31, 31) |
__gen_field(values->TextureBorderColorMode, 29, 29) |
__gen_field(values->LODPreClampEnable, 28, 28) |
- __gen_field(values->BaseMipLevel, 22, 26) |
+ __gen_field(values->BaseMipLevel * (1 << 1), 22, 26) |
__gen_field(values->MipModeFilter, 20, 21) |
__gen_field(values->MagModeFilter, 17, 19) |
__gen_field(values->MinModeFilter, 14, 16) |
@@ -6332,8 +6332,8 @@ GEN7_SAMPLER_STATE_pack(__gen_user_data *data, void * restrict dst,
0;
dw[1] =
- __gen_field(values->MinLOD, 20, 31) |
- __gen_field(values->MaxLOD, 8, 19) |
+ __gen_field(values->MinLOD * (1 << 8), 20, 31) |
+ __gen_field(values->MaxLOD * (1 << 8), 8, 19) |
__gen_field(values->ShadowFunction, 1, 3) |
__gen_field(values->CubeSurfaceControlMode, 0, 0) |
0;