#include "anv_private.h"
+#include "gen7_pack.h"
+#include "gen8_pack.h"
+
/** \file anv_batch_chain.c
*
* This file contains functions related to anv_cmd_buffer as a data
#include "mesa/main/git_sha1.h"
#include "util/strtod.h"
+#include "gen7_pack.h"
+
struct anv_dispatch_table dtable;
static void
#include "anv_private.h"
#include "brw_surface_formats.h"
+#include "gen7_pack.h"
+
#define fmt(__vk_fmt, __hw_fmt, ...) \
[__vk_fmt] = { \
.vk_format = __vk_fmt, \
#include "anv_private.h"
+/* FIXME: We shouldn't be using the actual hardware enum values here. They
+ * change across gens. Once we get that fixed, this include needs to go.
+ */
+#include "gen8_pack.h"
+
static const uint8_t anv_halign[] = {
[4] = HALIGN4,
[8] = HALIGN8,
[VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_ADJ] = _3DPRIM_LINESTRIP_ADJ,
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_ADJ] = _3DPRIM_TRILIST_ADJ,
[VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_ADJ] = _3DPRIM_TRISTRIP_ADJ,
- [VK_PRIMITIVE_TOPOLOGY_PATCH] = _3DPRIM_PATCHLIST_1
+/* [VK_PRIMITIVE_TOPOLOGY_PATCH] = _3DPRIM_PATCHLIST_1 */
};
static void
}
}
-#include "gen7_pack.h"
-#include "gen75_pack.h"
-#undef GEN8_3DSTATE_MULTISAMPLE
-#include "gen8_pack.h"
-
#define anv_batch_emit(batch, cmd, ...) do { \
void *__dst = anv_batch_emit_dwords(batch, cmd ## _length); \
struct cmd __template = { \
VG(VALGRIND_CHECK_MEM_IS_DEFINED(dw, ARRAY_SIZE(dwords0) * 4));\
} while (0)
-static const struct GEN7_MEMORY_OBJECT_CONTROL_STATE GEN7_MOCS = {
- .GraphicsDataTypeGFDT = 0,
- .LLCCacheabilityControlLLCCC = 0,
- .L3CacheabilityControlL3CC = 1
-};
+#define GEN7_MOCS (struct GEN7_MEMORY_OBJECT_CONTROL_STATE) { \
+ .GraphicsDataTypeGFDT = 0, \
+ .LLCCacheabilityControlLLCCC = 0, \
+ .L3CacheabilityControlL3CC = 1, \
+}
#define GEN8_MOCS { \
.MemoryTypeLLCeLLCCacheabilityControl = WB, \
struct anv_framebuffer * framebuffer;
struct anv_render_pass * pass;
struct anv_subpass * subpass;
- uint32_t state_vf[GEN8_3DSTATE_VF_length];
+ uint32_t state_vf[2];
struct anv_vertex_binding vertex_bindings[MAX_VBS];
struct anv_descriptor_set * descriptors[MAX_SETS];
struct anv_push_constants * push_constants[VK_SHADER_STAGE_NUM];
uint32_t cs_right_mask;
struct {
- uint32_t sf[GEN7_3DSTATE_SF_length];
- uint32_t depth_stencil_state[GEN7_DEPTH_STENCIL_STATE_length];
+ uint32_t sf[7];
+ uint32_t depth_stencil_state[3];
} gen7;
struct {
- uint32_t sf[GEN8_3DSTATE_SF_length];
- uint32_t vf[GEN8_3DSTATE_VF_length];
- uint32_t raster[GEN8_3DSTATE_RASTER_length];
- uint32_t wm_depth_stencil[GEN8_3DSTATE_WM_DEPTH_STENCIL_length];
+ uint32_t sf[4];
+ uint32_t vf[2];
+ uint32_t raster[5];
+ uint32_t wm_depth_stencil[3];
} gen8;
};
#include "anv_private.h"
+#include "gen7_pack.h"
+
static void
gen7_cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer)
{
}
}
- anv_batch_emit(&cmd_buffer->batch, GEN8_3DSTATE_SCISSOR_STATE_POINTERS,
+ anv_batch_emit(&cmd_buffer->batch, GEN7_3DSTATE_SCISSOR_STATE_POINTERS,
.ScissorRectPointer = scissor_state.offset);
}
#include "anv_private.h"
+#include "gen7_pack.h"
+
static void
gen7_emit_vertex_input(struct anv_pipeline *pipeline,
const VkPipelineVertexInputStateCreateInfo *info)
};
static const uint32_t vk_to_gen_front_face[] = {
- [VK_FRONT_FACE_CCW] = CounterClockwise,
- [VK_FRONT_FACE_CW] = Clockwise
+ [VK_FRONT_FACE_CCW] = 1,
+ [VK_FRONT_FACE_CW] = 0
};
static void
anv_batch_emit(&pipeline->batch, GEN7_3DSTATE_WM,
.StatisticsEnable = true,
.ThreadDispatchEnable = true,
- .LineEndCapAntialiasingRegionWidth = _05pixels,
- .LineAntialiasingRegionWidth = _10pixels,
- .EarlyDepthStencilControl = NORMAL,
+ .LineEndCapAntialiasingRegionWidth = 0, /* 0.5 pixels */
+ .LineAntialiasingRegionWidth = 1, /* 1.0 pixels */
+ .EarlyDepthStencilControl = EDSC_NORMAL,
.PointRasterizationRule = RASTRULE_UPPER_RIGHT,
.PixelShaderComputedDepthMode = wm_prog_data->computed_depth_mode,
.BarycentricInterpolationMode = wm_prog_data->barycentric_interp_modes);
#include "anv_private.h"
+#include "gen7_pack.h"
+
void
gen7_fill_buffer_surface_state(void *state, const struct anv_format *format,
uint32_t offset, uint32_t range, uint32_t stride)
iview->color_rt_surface_state =
gen7_alloc_surface_state(device, cmd_buffer);
- surface_state.RenderCacheReadWriteMode = WriteOnlyCache;
+ surface_state.RenderCacheReadWriteMode = 0; /* Write only */
/* For render target surfaces, the hardware interprets field MIPCount/LOD as
* LOD. The Broadwell PRM says:
#include "anv_private.h"
+#include "gen8_pack.h"
+
static void
gen8_cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer)
{
.YMaxViewPort = vp->originY + vp->height - 1,
};
- struct GEN7_CC_VIEWPORT cc_viewport = {
+ struct GEN8_CC_VIEWPORT cc_viewport = {
.MinimumDepth = vp->minDepth,
.MaximumDepth = vp->maxDepth
};
GEN8_SF_CLIP_VIEWPORT_pack(NULL, sf_clip_state.map + i * 64,
&sf_clip_viewport);
- GEN7_CC_VIEWPORT_pack(NULL, cc_state.map + i * 32, &cc_viewport);
+ GEN8_CC_VIEWPORT_pack(NULL, cc_state.map + i * 32, &cc_viewport);
}
anv_batch_emit(&cmd_buffer->batch,
#include "anv_private.h"
+#include "gen8_pack.h"
+
static void
emit_vertex_input(struct anv_pipeline *pipeline,
const VkPipelineVertexInputStateCreateInfo *info)
#include "anv_private.h"
+#include "gen8_pack.h"
+
void
gen8_fill_buffer_surface_state(void *state, const struct anv_format *format,
uint32_t offset, uint32_t range, uint32_t stride)