Compare commits
35 Commits
mesa-18.0.
...
mesa-18.0.
Author | SHA1 | Date | |
---|---|---|---|
|
3b49ab6219 | ||
|
a7f75b9487 | ||
|
0f9bd67c4b | ||
|
0fa8cdfd13 | ||
|
9a4b915517 | ||
|
1b0406f465 | ||
|
33a8aad459 | ||
|
4a4a51bdfb | ||
|
9a537aad11 | ||
|
538022adf8 | ||
|
4788977798 | ||
|
5cd442e589 | ||
|
81a733214a | ||
|
c78a265f75 | ||
|
430bca7d89 | ||
|
876c7c7006 | ||
|
d2632fc765 | ||
|
83e543e9fa | ||
|
3c0ca29ff0 | ||
|
4368854260 | ||
|
5f0c3879e6 | ||
|
eeaad26ff2 | ||
|
42229106b3 | ||
|
c013960afd | ||
|
8d728f903e | ||
|
7d0f1d676a | ||
|
54c208e48e | ||
|
23cd0c1598 | ||
|
aecf2e1319 | ||
|
749626c473 | ||
|
ee99f7deaf | ||
|
bbd5c75d7d | ||
|
6ca758f6b6 | ||
|
2e97e1ea02 | ||
|
ae12c5e990 |
@@ -39,3 +39,29 @@ a6fbefa67b5b0ed1ee42a9034ee74dfaed1c389a radv: fix DCC enablement since partial
|
||||
d7ffe3b384f4d1c15a9364768cf405d416522e60 radv: set ac_surf_info::num_channels correctly
|
||||
d38425ce872c4a00cfb691ae9dceca6a07afc516 ac: fix texture query LOD for 1D textures on GFX9
|
||||
4d449c94e450c33d7b2b09c1c263322042503893 autotools, meson: bump up required VA version
|
||||
|
||||
# stable: Explicit 18.1 only nominations
|
||||
9267ff9883f749dd1708c573c0df4b46687ff973 radv: Allow vkEnumerateInstanceVersion ProcAddr without instance.
|
||||
467c562a292b4424f24381932b90bcb9869c3d73 radv: Don't check the incoming apiVersion on CreateInstance.
|
||||
b17cfb08a3fc9a599eff64fffe48daba398a672f vulkan/wsi: Only use LINEAR modifier for prime if supported.
|
||||
597b9e881083533b987dbcbb8f679ca1eefff974 radeonsi/gfx9: work around a GPU hang due to broken indirect indexing in LLVM
|
||||
62f50df7b79c273a0eb9bf769eded76933bddc3a radv: Fix multiview queries.
|
||||
|
||||
# stable: The commit requires earlier commit ba79a90fb52 which did not land in
|
||||
# branch.
|
||||
901db25d5b7cd2ac2dd648b370c4bddf23dd5c44 glsl: change ast_type_qualifier bitset size to work around GCC 5.4 bug
|
||||
|
||||
# stable: The commit fixes earlier commit d5f42f96e16 which did not land in
|
||||
# branch.
|
||||
d07466fe18522cde1acadfc597583f80b69c15b7 mesa: fix glGetInteger/Float/etc queries for vertex arrays attribs
|
||||
|
||||
# stable: The commit fixes earlier commit d07466fe18522 which did not land in
|
||||
# branch.
|
||||
e4211b36bba4acde3e56ce1e22b12759e820a241 mesa: revert GL_[SECONDARY_]COLOR_ARRAY_SIZE glGet type to TYPE_INT
|
||||
|
||||
# stable: The commit requires earlier commits ab0e625a671 and 62510846b6e which
|
||||
# did not land in branch.
|
||||
b16fc6cda11576a4dd6c8d95f7bee94121c4b8e7 radv/resolve: do fmask decompress on all layers.
|
||||
|
||||
# stable: There is a specific port for this patch for stable branch.
|
||||
3d4d388e3929d7948b62d90867357aecbfba5aeb radv: Fix up 2_10_10_10 alpha sign.
|
||||
|
@@ -31,7 +31,8 @@ because compatibility contexts are not supported.
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
58cc5c5b1ab2a44e6e47f18ef6c29836ad06f95450adce635ce3c317507a171b mesa-18.0.3.tar.gz
|
||||
099d9667327a76a61741a533f95067d76ea71a656e66b91507b3c0caf1d49e30 mesa-18.0.3.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
|
156
docs/relnotes/18.0.4.html
Normal file
156
docs/relnotes/18.0.4.html
Normal file
@@ -0,0 +1,156 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 18.0.4 Release Notes / May 17, 2018</h1>
|
||||
|
||||
<p>
|
||||
Mesa 18.0.4 is a bug fix release which fixes bugs found since the 18.0.3 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 18.0.4 implements the OpenGL 4.5 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 4.5. OpenGL
|
||||
4.5 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=91808">Bug 91808</a> - trine1 misrender r600g</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=100430">Bug 100430</a> - [radv] graphical glitches on dolphin emulator</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=106243">Bug 106243</a> - [kbl] GPU HANG: 9:0:0x85dffffb, in Cinnamon</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=106480">Bug 106480</a> - A2B10G10R10_SNORM vertex attribute doesn't work.</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Bas Nieuwenhuizen (3):</p>
|
||||
<ul>
|
||||
<li>radv: Translate logic ops.</li>
|
||||
<li>radv: Fix up 2_10_10_10 alpha sign.</li>
|
||||
<li>radv: Disable texel buffers with A2 SNORM/SSCALED/SINT for pre-vega.</li>
|
||||
</ul>
|
||||
|
||||
<p>Dave Airlie (3):</p>
|
||||
<ul>
|
||||
<li>r600: fix constant buffer bounds.</li>
|
||||
<li>radv: resolve all layers in compute resolve path.</li>
|
||||
<li>radv: use compute path for multi-layer images.</li>
|
||||
</ul>
|
||||
|
||||
<p>Deepak Rawat (1):</p>
|
||||
<ul>
|
||||
<li>egl/x11: Send invalidate to driver on copy_region path in swap_buffer</li>
|
||||
</ul>
|
||||
|
||||
<p>Ian Romanick (1):</p>
|
||||
<ul>
|
||||
<li>mesa: Add missing support for glFogiv(GL_FOG_DISTANCE_MODE_NV)</li>
|
||||
</ul>
|
||||
|
||||
<p>Jan Vesely (8):</p>
|
||||
<ul>
|
||||
<li>clover: Add explicit virtual destructor to argument class</li>
|
||||
<li>eg/compute: Drop reference on code_bo in destructor.</li>
|
||||
<li>r600: Cleanup constant buffers on context destruction</li>
|
||||
<li>eg/compute: Drop reference to kernel_param bo in destructor</li>
|
||||
<li>pipe-loader: Free driver_name in error path</li>
|
||||
<li>gallium/auxiliary: Add helper function to count the number of entries in hash table</li>
|
||||
<li>winsys/radeon: Destroy fd_hash table when the last winsys is removed.</li>
|
||||
<li>winsys/amdgpu: Destroy dev_hash table when the last winsys is removed.</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965,anv: Set the CS stall bit on the ISP disable PIPE_CONTROL</li>
|
||||
</ul>
|
||||
|
||||
<p>Jose Maria Casanova Crespo (2):</p>
|
||||
<ul>
|
||||
<li>intel/compiler: fix 16-bit int brw_negate_immediate and brw_abs_immediate</li>
|
||||
<li>intel/compiler: fix brw_imm_w for negative 16-bit integers</li>
|
||||
</ul>
|
||||
|
||||
<p>Juan A. Suarez Romero (7):</p>
|
||||
<ul>
|
||||
<li>docs: add sha256 checksums for 18.0.3</li>
|
||||
<li>cherry-ignore: add explicit 18.1 only nominations</li>
|
||||
<li>cherry-ignore: glsl: change ast_type_qualifier bitset size to work around GCC 5.4 bug</li>
|
||||
<li>cherry-ignore: mesa: fix glGetInteger/Float/etc queries for vertex arrays attribs</li>
|
||||
<li>cherry-ignore: mesa: revert GL_[SECONDARY_]COLOR_ARRAY_SIZE glGet type to TYPE_INT</li>
|
||||
<li>cherry-ignore: radv/resolve: do fmask decompress on all layers.</li>
|
||||
<li>Update version to 18.0.4</li>
|
||||
</ul>
|
||||
|
||||
<p>Kai Wasserbäch (1):</p>
|
||||
<ul>
|
||||
<li>opencl: autotools: Fix linking order for OpenCL target</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (1):</p>
|
||||
<ul>
|
||||
<li>i965: Don't leak blorp on Gen4-5.</li>
|
||||
</ul>
|
||||
|
||||
<p>Lionel Landwerlin (2):</p>
|
||||
<ul>
|
||||
<li>i965: require pixel scoreboard stall prior to ISP disable</li>
|
||||
<li>anv: emit pixel scoreboard stall before ISP disable</li>
|
||||
</ul>
|
||||
|
||||
<p>Matthew Nicholls (1):</p>
|
||||
<ul>
|
||||
<li>radv: fix multisample image copies</li>
|
||||
</ul>
|
||||
|
||||
<p>Neil Roberts (1):</p>
|
||||
<ul>
|
||||
<li>spirv: Apply OriginUpperLeft to FragCoord</li>
|
||||
</ul>
|
||||
|
||||
<p>Rhys Perry (1):</p>
|
||||
<ul>
|
||||
<li>mesa: fix error handling in get_framebuffer_parameteriv</li>
|
||||
</ul>
|
||||
|
||||
<p>Ross Burton (1):</p>
|
||||
<ul>
|
||||
<li>src/intel/Makefile.vulkan.am: add missing MKDIR_GEN</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@@ -5335,6 +5335,48 @@ static void visit_cf_list(struct ac_nir_context *ctx,
|
||||
}
|
||||
}
|
||||
|
||||
/* For 2_10_10_10 formats the alpha is handled as unsigned by pre-vega HW.
|
||||
* so we may need to fix it up. */
|
||||
static LLVMValueRef
|
||||
adjust_vertex_fetch_alpha(struct nir_to_llvm_context *ctx,
|
||||
unsigned adjustment,
|
||||
LLVMValueRef alpha)
|
||||
{
|
||||
if (adjustment == RADV_ALPHA_ADJUST_NONE)
|
||||
return alpha;
|
||||
|
||||
LLVMValueRef c30 = LLVMConstInt(ctx->ac.i32, 30, 0);
|
||||
|
||||
if (adjustment == RADV_ALPHA_ADJUST_SSCALED)
|
||||
alpha = LLVMBuildFPToUI(ctx->ac.builder, alpha, ctx->ac.i32, "");
|
||||
else
|
||||
alpha = ac_to_integer(&ctx->ac, alpha);
|
||||
|
||||
/* For the integer-like cases, do a natural sign extension.
|
||||
*
|
||||
* For the SNORM case, the values are 0.0, 0.333, 0.666, 1.0
|
||||
* and happen to contain 0, 1, 2, 3 as the two LSBs of the
|
||||
* exponent.
|
||||
*/
|
||||
alpha = LLVMBuildShl(ctx->ac.builder, alpha,
|
||||
adjustment == RADV_ALPHA_ADJUST_SNORM ?
|
||||
LLVMConstInt(ctx->ac.i32, 7, 0) : c30, "");
|
||||
alpha = LLVMBuildAShr(ctx->ac.builder, alpha, c30, "");
|
||||
|
||||
/* Convert back to the right type. */
|
||||
if (adjustment == RADV_ALPHA_ADJUST_SNORM) {
|
||||
LLVMValueRef clamp;
|
||||
LLVMValueRef neg_one = LLVMConstReal(ctx->ac.f32, -1.0);
|
||||
alpha = LLVMBuildSIToFP(ctx->ac.builder, alpha, ctx->ac.f32, "");
|
||||
clamp = LLVMBuildFCmp(ctx->ac.builder, LLVMRealULT, alpha, neg_one, "");
|
||||
alpha = LLVMBuildSelect(ctx->ac.builder, clamp, neg_one, alpha, "");
|
||||
} else if (adjustment == RADV_ALPHA_ADJUST_SSCALED) {
|
||||
alpha = LLVMBuildSIToFP(ctx->ac.builder, alpha, ctx->ac.f32, "");
|
||||
}
|
||||
|
||||
return alpha;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_vs_input_decl(struct nir_to_llvm_context *ctx,
|
||||
struct nir_variable *variable)
|
||||
@@ -5344,14 +5386,15 @@ handle_vs_input_decl(struct nir_to_llvm_context *ctx,
|
||||
LLVMValueRef t_list;
|
||||
LLVMValueRef input;
|
||||
LLVMValueRef buffer_index;
|
||||
int index = variable->data.location - VERT_ATTRIB_GENERIC0;
|
||||
int idx = variable->data.location;
|
||||
unsigned attrib_count = glsl_count_attribute_slots(variable->type, true);
|
||||
|
||||
variable->data.driver_location = idx * 4;
|
||||
variable->data.driver_location = variable->data.location * 4;
|
||||
|
||||
for (unsigned i = 0; i < attrib_count; ++i, ++idx) {
|
||||
if (ctx->options->key.vs.instance_rate_inputs & (1u << (index + i))) {
|
||||
for (unsigned i = 0; i < attrib_count; ++i) {
|
||||
LLVMValueRef output[4];
|
||||
unsigned attrib_index = variable->data.location + i - VERT_ATTRIB_GENERIC0;
|
||||
|
||||
if (ctx->options->key.vs.instance_rate_inputs & (1u << attrib_index)) {
|
||||
buffer_index = LLVMBuildAdd(ctx->builder, ctx->abi.instance_id,
|
||||
ctx->abi.start_instance, "");
|
||||
if (ctx->options->key.vs.as_ls) {
|
||||
@@ -5364,7 +5407,7 @@ handle_vs_input_decl(struct nir_to_llvm_context *ctx,
|
||||
} else
|
||||
buffer_index = LLVMBuildAdd(ctx->builder, ctx->abi.vertex_id,
|
||||
ctx->abi.base_vertex, "");
|
||||
t_offset = LLVMConstInt(ctx->ac.i32, index + i, false);
|
||||
t_offset = LLVMConstInt(ctx->ac.i32, attrib_index, false);
|
||||
|
||||
t_list = ac_build_load_to_sgpr(&ctx->ac, t_list_ptr, t_offset);
|
||||
|
||||
@@ -5375,9 +5418,15 @@ handle_vs_input_decl(struct nir_to_llvm_context *ctx,
|
||||
|
||||
for (unsigned chan = 0; chan < 4; chan++) {
|
||||
LLVMValueRef llvm_chan = LLVMConstInt(ctx->ac.i32, chan, false);
|
||||
ctx->inputs[radeon_llvm_reg_index_soa(idx, chan)] =
|
||||
ac_to_integer(&ctx->ac, LLVMBuildExtractElement(ctx->builder,
|
||||
input, llvm_chan, ""));
|
||||
output[chan] = LLVMBuildExtractElement(ctx->builder, input, llvm_chan, "");
|
||||
}
|
||||
|
||||
unsigned alpha_adjust = (ctx->options->key.vs.alpha_adjust >> (attrib_index * 2)) & 3;
|
||||
output[3] = adjust_vertex_fetch_alpha(ctx, alpha_adjust, output[3]);
|
||||
|
||||
for (unsigned chan = 0; chan < 4; chan++) {
|
||||
ctx->inputs[radeon_llvm_reg_index_soa(variable->data.location + i, chan)] =
|
||||
ac_to_integer(&ctx->ac, output[chan]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -39,8 +39,20 @@ struct radv_pipeline_layout;
|
||||
struct ac_llvm_context;
|
||||
struct ac_shader_abi;
|
||||
|
||||
enum {
|
||||
RADV_ALPHA_ADJUST_NONE = 0,
|
||||
RADV_ALPHA_ADJUST_SNORM = 1,
|
||||
RADV_ALPHA_ADJUST_SINT = 2,
|
||||
RADV_ALPHA_ADJUST_SSCALED = 3,
|
||||
};
|
||||
|
||||
struct ac_vs_variant_key {
|
||||
uint32_t instance_rate_inputs;
|
||||
|
||||
/* For 2_10_10_10 formats the alpha is handled as unsigned by pre-vega HW.
|
||||
* so we may need to fix it up. */
|
||||
uint64_t alpha_adjust;
|
||||
|
||||
uint32_t as_es:1;
|
||||
uint32_t as_ls:1;
|
||||
uint32_t export_prim_id:1;
|
||||
|
@@ -6892,34 +6892,22 @@
|
||||
#define S_028808_ROP3(x) (((unsigned)(x) & 0xFF) << 16)
|
||||
#define G_028808_ROP3(x) (((x) >> 16) & 0xFF)
|
||||
#define C_028808_ROP3 0xFF00FFFF
|
||||
#define V_028808_X_0X00 0x00
|
||||
#define V_028808_X_0X05 0x05
|
||||
#define V_028808_X_0X0A 0x0A
|
||||
#define V_028808_X_0X0F 0x0F
|
||||
#define V_028808_X_0X11 0x11
|
||||
#define V_028808_X_0X22 0x22
|
||||
#define V_028808_X_0X33 0x33
|
||||
#define V_028808_X_0X44 0x44
|
||||
#define V_028808_X_0X50 0x50
|
||||
#define V_028808_X_0X55 0x55
|
||||
#define V_028808_X_0X5A 0x5A
|
||||
#define V_028808_X_0X5F 0x5F
|
||||
#define V_028808_X_0X66 0x66
|
||||
#define V_028808_X_0X77 0x77
|
||||
#define V_028808_X_0X88 0x88
|
||||
#define V_028808_X_0X99 0x99
|
||||
#define V_028808_X_0XA0 0xA0
|
||||
#define V_028808_X_0XA5 0xA5
|
||||
#define V_028808_X_0XAA 0xAA
|
||||
#define V_028808_X_0XAF 0xAF
|
||||
#define V_028808_X_0XBB 0xBB
|
||||
#define V_028808_X_0XCC 0xCC
|
||||
#define V_028808_X_0XDD 0xDD
|
||||
#define V_028808_X_0XEE 0xEE
|
||||
#define V_028808_X_0XF0 0xF0
|
||||
#define V_028808_X_0XF5 0xF5
|
||||
#define V_028808_X_0XFA 0xFA
|
||||
#define V_028808_X_0XFF 0xFF
|
||||
#define V_028808_ROP3_CLEAR 0x00
|
||||
#define V_028808_ROP3_NOR 0x11
|
||||
#define V_028808_ROP3_AND_INVERTED 0x22
|
||||
#define V_028808_ROP3_COPY_INVERTED 0x33
|
||||
#define V_028808_ROP3_AND_REVERSE 0x44
|
||||
#define V_028808_ROP3_INVERT 0x55
|
||||
#define V_028808_ROP3_XOR 0x66
|
||||
#define V_028808_ROP3_NAND 0x77
|
||||
#define V_028808_ROP3_AND 0x88
|
||||
#define V_028808_ROP3_EQUIVALENT 0x99
|
||||
#define V_028808_ROP3_NO_OP 0xaa
|
||||
#define V_028808_ROP3_OR_INVERTED 0xbb
|
||||
#define V_028808_ROP3_COPY 0xcc
|
||||
#define V_028808_ROP3_OR_REVERSE 0xdd
|
||||
#define V_028808_ROP3_OR 0xee
|
||||
#define V_028808_ROP3_SET 0xff
|
||||
#define R_02880C_DB_SHADER_CONTROL 0x02880C
|
||||
#define S_02880C_Z_EXPORT_ENABLE(x) (((unsigned)(x) & 0x1) << 0)
|
||||
#define G_02880C_Z_EXPORT_ENABLE(x) (((x) >> 0) & 0x1)
|
||||
|
@@ -619,6 +619,25 @@ radv_physical_device_get_format_properties(struct radv_physical_device *physical
|
||||
tiled |= VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT;
|
||||
}
|
||||
|
||||
switch(format) {
|
||||
case VK_FORMAT_A2R10G10B10_SNORM_PACK32:
|
||||
case VK_FORMAT_A2B10G10R10_SNORM_PACK32:
|
||||
case VK_FORMAT_A2R10G10B10_SSCALED_PACK32:
|
||||
case VK_FORMAT_A2B10G10R10_SSCALED_PACK32:
|
||||
case VK_FORMAT_A2R10G10B10_SINT_PACK32:
|
||||
case VK_FORMAT_A2B10G10R10_SINT_PACK32:
|
||||
if (physical_device->rad_info.chip_class <= VI &&
|
||||
physical_device->rad_info.family != CHIP_STONEY) {
|
||||
buffer &= ~(VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT |
|
||||
VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT);
|
||||
linear = 0;
|
||||
tiled = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
out_properties->linearTilingFeatures = linear;
|
||||
out_properties->optimalTilingFeatures = tiled;
|
||||
out_properties->bufferFeatures = buffer;
|
||||
|
@@ -100,7 +100,8 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
|
||||
struct radv_meta_blit2d_buffer *src_buf,
|
||||
struct blit2d_src_temps *tmp,
|
||||
enum blit2d_src_type src_type, VkFormat depth_format,
|
||||
VkImageAspectFlagBits aspects)
|
||||
VkImageAspectFlagBits aspects,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
struct radv_device *device = cmd_buffer->device;
|
||||
|
||||
@@ -108,7 +109,7 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
|
||||
create_bview(cmd_buffer, src_buf, &tmp->bview, depth_format);
|
||||
|
||||
radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
device->meta_state.blit2d.p_layouts[src_type],
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
0, /* set */
|
||||
1, /* descriptorWriteCount */
|
||||
(VkWriteDescriptorSet[]) {
|
||||
@@ -123,7 +124,7 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
|
||||
});
|
||||
|
||||
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
device->meta_state.blit2d.p_layouts[src_type],
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT, 16, 4,
|
||||
&src_buf->pitch);
|
||||
} else {
|
||||
@@ -131,12 +132,12 @@ blit2d_bind_src(struct radv_cmd_buffer *cmd_buffer,
|
||||
|
||||
if (src_type == BLIT2D_SRC_TYPE_IMAGE_3D)
|
||||
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
device->meta_state.blit2d.p_layouts[src_type],
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT, 16, 4,
|
||||
&src_img->layer);
|
||||
|
||||
radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||
device->meta_state.blit2d.p_layouts[src_type],
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
0, /* set */
|
||||
1, /* descriptorWriteCount */
|
||||
(VkWriteDescriptorSet[]) {
|
||||
@@ -190,10 +191,11 @@ blit2d_bind_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
|
||||
static void
|
||||
bind_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
||||
enum blit2d_src_type src_type, unsigned fs_key)
|
||||
enum blit2d_src_type src_type, unsigned fs_key,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkPipeline pipeline =
|
||||
cmd_buffer->device->meta_state.blit2d.pipelines[src_type][fs_key];
|
||||
cmd_buffer->device->meta_state.blit2d[log2_samples].pipelines[src_type][fs_key];
|
||||
|
||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||
@@ -201,10 +203,11 @@ bind_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
||||
|
||||
static void
|
||||
bind_depth_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
||||
enum blit2d_src_type src_type)
|
||||
enum blit2d_src_type src_type,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkPipeline pipeline =
|
||||
cmd_buffer->device->meta_state.blit2d.depth_only_pipeline[src_type];
|
||||
cmd_buffer->device->meta_state.blit2d[log2_samples].depth_only_pipeline[src_type];
|
||||
|
||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||
@@ -212,10 +215,11 @@ bind_depth_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
||||
|
||||
static void
|
||||
bind_stencil_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
||||
enum blit2d_src_type src_type)
|
||||
enum blit2d_src_type src_type,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkPipeline pipeline =
|
||||
cmd_buffer->device->meta_state.blit2d.stencil_only_pipeline[src_type];
|
||||
cmd_buffer->device->meta_state.blit2d[log2_samples].stencil_only_pipeline[src_type];
|
||||
|
||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||
@@ -227,7 +231,8 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
struct radv_meta_blit2d_buffer *src_buf,
|
||||
struct radv_meta_blit2d_surf *dst,
|
||||
unsigned num_rects,
|
||||
struct radv_meta_blit2d_rect *rects, enum blit2d_src_type src_type)
|
||||
struct radv_meta_blit2d_rect *rects, enum blit2d_src_type src_type,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
struct radv_device *device = cmd_buffer->device;
|
||||
|
||||
@@ -241,7 +246,7 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
else if (aspect_mask == VK_IMAGE_ASPECT_DEPTH_BIT)
|
||||
depth_format = vk_format_depth_only(dst->image->vk_format);
|
||||
struct blit2d_src_temps src_temps;
|
||||
blit2d_bind_src(cmd_buffer, src_img, src_buf, &src_temps, src_type, depth_format, aspect_mask);
|
||||
blit2d_bind_src(cmd_buffer, src_img, src_buf, &src_temps, src_type, depth_format, aspect_mask, log2_samples);
|
||||
|
||||
struct blit2d_dst_temps dst_temps;
|
||||
blit2d_bind_dst(cmd_buffer, dst, rects[r].dst_x + rects[r].width,
|
||||
@@ -255,7 +260,7 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
};
|
||||
|
||||
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
device->meta_state.blit2d.p_layouts[src_type],
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
VK_SHADER_STAGE_VERTEX_BIT, 0, 16,
|
||||
vertex_push_constants);
|
||||
|
||||
@@ -266,7 +271,7 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
&(VkRenderPassBeginInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
|
||||
.renderPass = device->meta_state.blit2d.render_passes[fs_key][dst_layout],
|
||||
.renderPass = device->meta_state.blit2d_render_passes[fs_key][dst_layout],
|
||||
.framebuffer = dst_temps.fb,
|
||||
.renderArea = {
|
||||
.offset = { rects[r].dst_x, rects[r].dst_y, },
|
||||
@@ -277,13 +282,13 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
}, VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
|
||||
bind_pipeline(cmd_buffer, src_type, fs_key);
|
||||
bind_pipeline(cmd_buffer, src_type, fs_key, log2_samples);
|
||||
} else if (aspect_mask == VK_IMAGE_ASPECT_DEPTH_BIT) {
|
||||
enum radv_blit_ds_layout ds_layout = radv_meta_blit_ds_to_type(dst->current_layout);
|
||||
radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
&(VkRenderPassBeginInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
|
||||
.renderPass = device->meta_state.blit2d.depth_only_rp[ds_layout],
|
||||
.renderPass = device->meta_state.blit2d_depth_only_rp[ds_layout],
|
||||
.framebuffer = dst_temps.fb,
|
||||
.renderArea = {
|
||||
.offset = { rects[r].dst_x, rects[r].dst_y, },
|
||||
@@ -294,14 +299,14 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
}, VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
|
||||
bind_depth_pipeline(cmd_buffer, src_type);
|
||||
bind_depth_pipeline(cmd_buffer, src_type, log2_samples);
|
||||
|
||||
} else if (aspect_mask == VK_IMAGE_ASPECT_STENCIL_BIT) {
|
||||
enum radv_blit_ds_layout ds_layout = radv_meta_blit_ds_to_type(dst->current_layout);
|
||||
radv_CmdBeginRenderPass(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
&(VkRenderPassBeginInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
|
||||
.renderPass = device->meta_state.blit2d.stencil_only_rp[ds_layout],
|
||||
.renderPass = device->meta_state.blit2d_stencil_only_rp[ds_layout],
|
||||
.framebuffer = dst_temps.fb,
|
||||
.renderArea = {
|
||||
.offset = { rects[r].dst_x, rects[r].dst_y, },
|
||||
@@ -312,7 +317,7 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
}, VK_SUBPASS_CONTENTS_INLINE);
|
||||
|
||||
|
||||
bind_stencil_pipeline(cmd_buffer, src_type);
|
||||
bind_stencil_pipeline(cmd_buffer, src_type, log2_samples);
|
||||
} else
|
||||
unreachable("Processing blit2d with multiple aspects.");
|
||||
|
||||
@@ -332,7 +337,24 @@ radv_meta_blit2d_normal_dst(struct radv_cmd_buffer *cmd_buffer,
|
||||
|
||||
|
||||
|
||||
radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
|
||||
if (log2_samples > 0) {
|
||||
for (uint32_t sample = 0; sample < src_img->image->info.samples; sample++) {
|
||||
uint32_t sample_mask = 1 << sample;
|
||||
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT, 20, 4,
|
||||
&sample);
|
||||
|
||||
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||
device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
VK_SHADER_STAGE_FRAGMENT_BIT, 24, 4,
|
||||
&sample_mask);
|
||||
|
||||
radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
radv_CmdDraw(radv_cmd_buffer_to_handle(cmd_buffer), 3, 1, 0, 0);
|
||||
radv_CmdEndRenderPass(radv_cmd_buffer_to_handle(cmd_buffer));
|
||||
|
||||
/* At the point where we emit the draw call, all data from the
|
||||
@@ -358,7 +380,8 @@ radv_meta_blit2d(struct radv_cmd_buffer *cmd_buffer,
|
||||
enum blit2d_src_type src_type = src_buf ? BLIT2D_SRC_TYPE_BUFFER :
|
||||
use_3d ? BLIT2D_SRC_TYPE_IMAGE_3D : BLIT2D_SRC_TYPE_IMAGE;
|
||||
radv_meta_blit2d_normal_dst(cmd_buffer, src_img, src_buf, dst,
|
||||
num_rects, rects, src_type);
|
||||
num_rects, rects, src_type,
|
||||
src_img ? util_logbase2(src_img->image->info.samples) : 0);
|
||||
}
|
||||
|
||||
static nir_shader *
|
||||
@@ -421,13 +444,14 @@ build_nir_vertex_shader(void)
|
||||
|
||||
typedef nir_ssa_def* (*texel_fetch_build_func)(struct nir_builder *,
|
||||
struct radv_device *,
|
||||
nir_ssa_def *, bool);
|
||||
nir_ssa_def *, bool, bool);
|
||||
|
||||
static nir_ssa_def *
|
||||
build_nir_texel_fetch(struct nir_builder *b, struct radv_device *device,
|
||||
nir_ssa_def *tex_pos, bool is_3d)
|
||||
nir_ssa_def *tex_pos, bool is_3d, bool is_multisampled)
|
||||
{
|
||||
enum glsl_sampler_dim dim = is_3d ? GLSL_SAMPLER_DIM_3D : GLSL_SAMPLER_DIM_2D;
|
||||
enum glsl_sampler_dim dim =
|
||||
is_3d ? GLSL_SAMPLER_DIM_3D : is_multisampled ? GLSL_SAMPLER_DIM_MS : GLSL_SAMPLER_DIM_2D;
|
||||
const struct glsl_type *sampler_type =
|
||||
glsl_sampler_type(dim, false, false, GLSL_TYPE_UINT);
|
||||
nir_variable *sampler = nir_variable_create(b->shader, nir_var_uniform,
|
||||
@@ -436,6 +460,7 @@ build_nir_texel_fetch(struct nir_builder *b, struct radv_device *device,
|
||||
sampler->data.binding = 0;
|
||||
|
||||
nir_ssa_def *tex_pos_3d = NULL;
|
||||
nir_intrinsic_instr *sample_idx = NULL;
|
||||
if (is_3d) {
|
||||
nir_intrinsic_instr *layer = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_push_constant);
|
||||
nir_intrinsic_set_base(layer, 16);
|
||||
@@ -451,13 +476,26 @@ build_nir_texel_fetch(struct nir_builder *b, struct radv_device *device,
|
||||
chans[2] = &layer->dest.ssa;
|
||||
tex_pos_3d = nir_vec(b, chans, 3);
|
||||
}
|
||||
nir_tex_instr *tex = nir_tex_instr_create(b->shader, 2);
|
||||
if (is_multisampled) {
|
||||
sample_idx = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_push_constant);
|
||||
nir_intrinsic_set_base(sample_idx, 20);
|
||||
nir_intrinsic_set_range(sample_idx, 4);
|
||||
sample_idx->src[0] = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
sample_idx->num_components = 1;
|
||||
nir_ssa_dest_init(&sample_idx->instr, &sample_idx->dest, 1, 32, "sample_idx");
|
||||
nir_builder_instr_insert(b, &sample_idx->instr);
|
||||
}
|
||||
nir_tex_instr *tex = nir_tex_instr_create(b->shader, is_multisampled ? 3 : 2);
|
||||
tex->sampler_dim = dim;
|
||||
tex->op = nir_texop_txf;
|
||||
tex->op = is_multisampled ? nir_texop_txf_ms : nir_texop_txf;
|
||||
tex->src[0].src_type = nir_tex_src_coord;
|
||||
tex->src[0].src = nir_src_for_ssa(is_3d ? tex_pos_3d : tex_pos);
|
||||
tex->src[1].src_type = nir_tex_src_lod;
|
||||
tex->src[1].src = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
tex->src[1].src_type = is_multisampled ? nir_tex_src_ms_index : nir_tex_src_lod;
|
||||
tex->src[1].src = nir_src_for_ssa(is_multisampled ? &sample_idx->dest.ssa : nir_imm_int(b, 0));
|
||||
if (is_multisampled) {
|
||||
tex->src[2].src_type = nir_tex_src_lod;
|
||||
tex->src[2].src = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
}
|
||||
tex->dest_type = nir_type_uint;
|
||||
tex->is_array = false;
|
||||
tex->coord_components = is_3d ? 3 : 2;
|
||||
@@ -473,7 +511,7 @@ build_nir_texel_fetch(struct nir_builder *b, struct radv_device *device,
|
||||
|
||||
static nir_ssa_def *
|
||||
build_nir_buffer_fetch(struct nir_builder *b, struct radv_device *device,
|
||||
nir_ssa_def *tex_pos, bool is_3d)
|
||||
nir_ssa_def *tex_pos, bool is_3d, bool is_multisampled)
|
||||
{
|
||||
const struct glsl_type *sampler_type =
|
||||
glsl_sampler_type(GLSL_SAMPLER_DIM_BUF, false, false, GLSL_TYPE_UINT);
|
||||
@@ -519,9 +557,31 @@ static const VkPipelineVertexInputStateCreateInfo normal_vi_create_info = {
|
||||
.vertexAttributeDescriptionCount = 0,
|
||||
};
|
||||
|
||||
static void
|
||||
build_nir_store_sample_mask(struct nir_builder *b)
|
||||
{
|
||||
nir_intrinsic_instr *sample_mask = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_push_constant);
|
||||
nir_intrinsic_set_base(sample_mask, 24);
|
||||
nir_intrinsic_set_range(sample_mask, 4);
|
||||
sample_mask->src[0] = nir_src_for_ssa(nir_imm_int(b, 0));
|
||||
sample_mask->num_components = 1;
|
||||
nir_ssa_dest_init(&sample_mask->instr, &sample_mask->dest, 1, 32, "sample_mask");
|
||||
nir_builder_instr_insert(b, &sample_mask->instr);
|
||||
|
||||
const struct glsl_type *sample_mask_out_type = glsl_uint_type();
|
||||
|
||||
nir_variable *sample_mask_out =
|
||||
nir_variable_create(b->shader, nir_var_shader_out,
|
||||
sample_mask_out_type, "sample_mask_out");
|
||||
sample_mask_out->data.location = FRAG_RESULT_SAMPLE_MASK;
|
||||
|
||||
nir_store_var(b, sample_mask_out, &sample_mask->dest.ssa, 0x1);
|
||||
}
|
||||
|
||||
static nir_shader *
|
||||
build_nir_copy_fragment_shader(struct radv_device *device,
|
||||
texel_fetch_build_func txf_func, const char* name, bool is_3d)
|
||||
texel_fetch_build_func txf_func, const char* name, bool is_3d,
|
||||
bool is_multisampled)
|
||||
{
|
||||
const struct glsl_type *vec4 = glsl_vec4_type();
|
||||
const struct glsl_type *vec2 = glsl_vector_type(GLSL_TYPE_FLOAT, 2);
|
||||
@@ -538,11 +598,15 @@ build_nir_copy_fragment_shader(struct radv_device *device,
|
||||
vec4, "f_color");
|
||||
color_out->data.location = FRAG_RESULT_DATA0;
|
||||
|
||||
if (is_multisampled) {
|
||||
build_nir_store_sample_mask(&b);
|
||||
}
|
||||
|
||||
nir_ssa_def *pos_int = nir_f2i32(&b, nir_load_var(&b, tex_pos_in));
|
||||
unsigned swiz[4] = { 0, 1 };
|
||||
nir_ssa_def *tex_pos = nir_swizzle(&b, pos_int, swiz, 2, false);
|
||||
|
||||
nir_ssa_def *color = txf_func(&b, device, tex_pos, is_3d);
|
||||
nir_ssa_def *color = txf_func(&b, device, tex_pos, is_3d, is_multisampled);
|
||||
nir_store_var(&b, color_out, color, 0xf);
|
||||
|
||||
return b.shader;
|
||||
@@ -550,7 +614,8 @@ build_nir_copy_fragment_shader(struct radv_device *device,
|
||||
|
||||
static nir_shader *
|
||||
build_nir_copy_fragment_shader_depth(struct radv_device *device,
|
||||
texel_fetch_build_func txf_func, const char* name, bool is_3d)
|
||||
texel_fetch_build_func txf_func, const char* name, bool is_3d,
|
||||
bool is_multisampled)
|
||||
{
|
||||
const struct glsl_type *vec4 = glsl_vec4_type();
|
||||
const struct glsl_type *vec2 = glsl_vector_type(GLSL_TYPE_FLOAT, 2);
|
||||
@@ -567,11 +632,15 @@ build_nir_copy_fragment_shader_depth(struct radv_device *device,
|
||||
vec4, "f_color");
|
||||
color_out->data.location = FRAG_RESULT_DEPTH;
|
||||
|
||||
if (is_multisampled) {
|
||||
build_nir_store_sample_mask(&b);
|
||||
}
|
||||
|
||||
nir_ssa_def *pos_int = nir_f2i32(&b, nir_load_var(&b, tex_pos_in));
|
||||
unsigned swiz[4] = { 0, 1 };
|
||||
nir_ssa_def *tex_pos = nir_swizzle(&b, pos_int, swiz, 2, false);
|
||||
|
||||
nir_ssa_def *color = txf_func(&b, device, tex_pos, is_3d);
|
||||
nir_ssa_def *color = txf_func(&b, device, tex_pos, is_3d, is_multisampled);
|
||||
nir_store_var(&b, color_out, color, 0x1);
|
||||
|
||||
return b.shader;
|
||||
@@ -579,7 +648,8 @@ build_nir_copy_fragment_shader_depth(struct radv_device *device,
|
||||
|
||||
static nir_shader *
|
||||
build_nir_copy_fragment_shader_stencil(struct radv_device *device,
|
||||
texel_fetch_build_func txf_func, const char* name, bool is_3d)
|
||||
texel_fetch_build_func txf_func, const char* name, bool is_3d,
|
||||
bool is_multisampled)
|
||||
{
|
||||
const struct glsl_type *vec4 = glsl_vec4_type();
|
||||
const struct glsl_type *vec2 = glsl_vector_type(GLSL_TYPE_FLOAT, 2);
|
||||
@@ -596,11 +666,15 @@ build_nir_copy_fragment_shader_stencil(struct radv_device *device,
|
||||
vec4, "f_color");
|
||||
color_out->data.location = FRAG_RESULT_STENCIL;
|
||||
|
||||
if (is_multisampled) {
|
||||
build_nir_store_sample_mask(&b);
|
||||
}
|
||||
|
||||
nir_ssa_def *pos_int = nir_f2i32(&b, nir_load_var(&b, tex_pos_in));
|
||||
unsigned swiz[4] = { 0, 1 };
|
||||
nir_ssa_def *tex_pos = nir_swizzle(&b, pos_int, swiz, 2, false);
|
||||
|
||||
nir_ssa_def *color = txf_func(&b, device, tex_pos, is_3d);
|
||||
nir_ssa_def *color = txf_func(&b, device, tex_pos, is_3d, is_multisampled);
|
||||
nir_store_var(&b, color_out, color, 0x1);
|
||||
|
||||
return b.shader;
|
||||
@@ -614,45 +688,48 @@ radv_device_finish_meta_blit2d_state(struct radv_device *device)
|
||||
for(unsigned j = 0; j < NUM_META_FS_KEYS; ++j) {
|
||||
for (unsigned k = 0; k < RADV_META_DST_LAYOUT_COUNT; ++k) {
|
||||
radv_DestroyRenderPass(radv_device_to_handle(device),
|
||||
state->blit2d.render_passes[j][k],
|
||||
&state->alloc);
|
||||
state->blit2d_render_passes[j][k],
|
||||
&state->alloc);
|
||||
}
|
||||
}
|
||||
|
||||
for (enum radv_blit_ds_layout j = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; j < RADV_BLIT_DS_LAYOUT_COUNT; j++) {
|
||||
radv_DestroyRenderPass(radv_device_to_handle(device),
|
||||
state->blit2d.depth_only_rp[j], &state->alloc);
|
||||
state->blit2d_depth_only_rp[j], &state->alloc);
|
||||
radv_DestroyRenderPass(radv_device_to_handle(device),
|
||||
state->blit2d.stencil_only_rp[j], &state->alloc);
|
||||
state->blit2d_stencil_only_rp[j], &state->alloc);
|
||||
}
|
||||
|
||||
for (unsigned src = 0; src < BLIT2D_NUM_SRC_TYPES; src++) {
|
||||
radv_DestroyPipelineLayout(radv_device_to_handle(device),
|
||||
state->blit2d.p_layouts[src],
|
||||
&state->alloc);
|
||||
radv_DestroyDescriptorSetLayout(radv_device_to_handle(device),
|
||||
state->blit2d.ds_layouts[src],
|
||||
&state->alloc);
|
||||
for (unsigned log2_samples = 0; log2_samples < 1 + MAX_SAMPLES_LOG2; ++log2_samples) {
|
||||
for (unsigned src = 0; src < BLIT2D_NUM_SRC_TYPES; src++) {
|
||||
radv_DestroyPipelineLayout(radv_device_to_handle(device),
|
||||
state->blit2d[log2_samples].p_layouts[src],
|
||||
&state->alloc);
|
||||
radv_DestroyDescriptorSetLayout(radv_device_to_handle(device),
|
||||
state->blit2d[log2_samples].ds_layouts[src],
|
||||
&state->alloc);
|
||||
|
||||
for (unsigned j = 0; j < NUM_META_FS_KEYS; ++j) {
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
state->blit2d[log2_samples].pipelines[src][j],
|
||||
&state->alloc);
|
||||
}
|
||||
|
||||
for (unsigned j = 0; j < NUM_META_FS_KEYS; ++j) {
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
state->blit2d.pipelines[src][j],
|
||||
state->blit2d[log2_samples].depth_only_pipeline[src],
|
||||
&state->alloc);
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
state->blit2d[log2_samples].stencil_only_pipeline[src],
|
||||
&state->alloc);
|
||||
}
|
||||
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
state->blit2d.depth_only_pipeline[src],
|
||||
&state->alloc);
|
||||
radv_DestroyPipeline(radv_device_to_handle(device),
|
||||
state->blit2d.stencil_only_pipeline[src],
|
||||
&state->alloc);
|
||||
}
|
||||
}
|
||||
|
||||
static VkResult
|
||||
blit2d_init_color_pipeline(struct radv_device *device,
|
||||
enum blit2d_src_type src_type,
|
||||
VkFormat format)
|
||||
VkFormat format,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkResult result;
|
||||
unsigned fs_key = radv_format_meta_fs_key(format);
|
||||
@@ -681,7 +758,7 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
struct radv_shader_module fs = { .nir = NULL };
|
||||
|
||||
|
||||
fs.nir = build_nir_copy_fragment_shader(device, src_func, name, src_type == BLIT2D_SRC_TYPE_IMAGE_3D);
|
||||
fs.nir = build_nir_copy_fragment_shader(device, src_func, name, src_type == BLIT2D_SRC_TYPE_IMAGE_3D, log2_samples > 0);
|
||||
vi_create_info = &normal_vi_create_info;
|
||||
|
||||
struct radv_shader_module vs = {
|
||||
@@ -705,7 +782,7 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
};
|
||||
|
||||
for (unsigned dst_layout = 0; dst_layout < RADV_META_DST_LAYOUT_COUNT; ++dst_layout) {
|
||||
if (!device->meta_state.blit2d.render_passes[fs_key][dst_layout]) {
|
||||
if (!device->meta_state.blit2d_render_passes[fs_key][dst_layout]) {
|
||||
VkImageLayout layout = radv_meta_dst_layout_to_layout(dst_layout);
|
||||
|
||||
result = radv_CreateRenderPass(radv_device_to_handle(device),
|
||||
@@ -737,7 +814,7 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
.pPreserveAttachments = (uint32_t[]) { 0 },
|
||||
},
|
||||
.dependencyCount = 0,
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d.render_passes[fs_key][dst_layout]);
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d_render_passes[fs_key][dst_layout]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,7 +842,7 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
},
|
||||
.pMultisampleState = &(VkPipelineMultisampleStateCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
|
||||
.rasterizationSamples = 1,
|
||||
.rasterizationSamples = 1 << log2_samples,
|
||||
.sampleShadingEnable = false,
|
||||
.pSampleMask = (VkSampleMask[]) { UINT32_MAX },
|
||||
},
|
||||
@@ -796,8 +873,8 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
},
|
||||
},
|
||||
.flags = 0,
|
||||
.layout = device->meta_state.blit2d.p_layouts[src_type],
|
||||
.renderPass = device->meta_state.blit2d.render_passes[fs_key][0],
|
||||
.layout = device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
.renderPass = device->meta_state.blit2d_render_passes[fs_key][0],
|
||||
.subpass = 0,
|
||||
};
|
||||
|
||||
@@ -809,7 +886,7 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
&vk_pipeline_info, &radv_pipeline_info,
|
||||
&device->meta_state.alloc,
|
||||
&device->meta_state.blit2d.pipelines[src_type][fs_key]);
|
||||
&device->meta_state.blit2d[log2_samples].pipelines[src_type][fs_key]);
|
||||
|
||||
|
||||
ralloc_free(vs.nir);
|
||||
@@ -820,7 +897,8 @@ blit2d_init_color_pipeline(struct radv_device *device,
|
||||
|
||||
static VkResult
|
||||
blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
enum blit2d_src_type src_type)
|
||||
enum blit2d_src_type src_type,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkResult result;
|
||||
const char *name;
|
||||
@@ -847,7 +925,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
const VkPipelineVertexInputStateCreateInfo *vi_create_info;
|
||||
struct radv_shader_module fs = { .nir = NULL };
|
||||
|
||||
fs.nir = build_nir_copy_fragment_shader_depth(device, src_func, name, src_type == BLIT2D_SRC_TYPE_IMAGE_3D);
|
||||
fs.nir = build_nir_copy_fragment_shader_depth(device, src_func, name, src_type == BLIT2D_SRC_TYPE_IMAGE_3D, log2_samples > 0);
|
||||
vi_create_info = &normal_vi_create_info;
|
||||
|
||||
struct radv_shader_module vs = {
|
||||
@@ -871,7 +949,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
};
|
||||
|
||||
for (enum radv_blit_ds_layout ds_layout = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; ds_layout < RADV_BLIT_DS_LAYOUT_COUNT; ds_layout++) {
|
||||
if (!device->meta_state.blit2d.depth_only_rp[ds_layout]) {
|
||||
if (!device->meta_state.blit2d_depth_only_rp[ds_layout]) {
|
||||
VkImageLayout layout = radv_meta_blit_ds_to_layout(ds_layout);
|
||||
result = radv_CreateRenderPass(radv_device_to_handle(device),
|
||||
&(VkRenderPassCreateInfo) {
|
||||
@@ -899,7 +977,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
.pPreserveAttachments = (uint32_t[]) { 0 },
|
||||
},
|
||||
.dependencyCount = 0,
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d.depth_only_rp[ds_layout]);
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d_depth_only_rp[ds_layout]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -927,7 +1005,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
},
|
||||
.pMultisampleState = &(VkPipelineMultisampleStateCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
|
||||
.rasterizationSamples = 1,
|
||||
.rasterizationSamples = 1 << log2_samples,
|
||||
.sampleShadingEnable = false,
|
||||
.pSampleMask = (VkSampleMask[]) { UINT32_MAX },
|
||||
},
|
||||
@@ -958,8 +1036,8 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
},
|
||||
},
|
||||
.flags = 0,
|
||||
.layout = device->meta_state.blit2d.p_layouts[src_type],
|
||||
.renderPass = device->meta_state.blit2d.depth_only_rp[0],
|
||||
.layout = device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
.renderPass = device->meta_state.blit2d_depth_only_rp[0],
|
||||
.subpass = 0,
|
||||
};
|
||||
|
||||
@@ -971,7 +1049,7 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
&vk_pipeline_info, &radv_pipeline_info,
|
||||
&device->meta_state.alloc,
|
||||
&device->meta_state.blit2d.depth_only_pipeline[src_type]);
|
||||
&device->meta_state.blit2d[log2_samples].depth_only_pipeline[src_type]);
|
||||
|
||||
|
||||
ralloc_free(vs.nir);
|
||||
@@ -982,7 +1060,8 @@ blit2d_init_depth_only_pipeline(struct radv_device *device,
|
||||
|
||||
static VkResult
|
||||
blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
enum blit2d_src_type src_type)
|
||||
enum blit2d_src_type src_type,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkResult result;
|
||||
const char *name;
|
||||
@@ -1009,7 +1088,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
const VkPipelineVertexInputStateCreateInfo *vi_create_info;
|
||||
struct radv_shader_module fs = { .nir = NULL };
|
||||
|
||||
fs.nir = build_nir_copy_fragment_shader_stencil(device, src_func, name, src_type == BLIT2D_SRC_TYPE_IMAGE_3D);
|
||||
fs.nir = build_nir_copy_fragment_shader_stencil(device, src_func, name, src_type == BLIT2D_SRC_TYPE_IMAGE_3D, log2_samples > 0);
|
||||
vi_create_info = &normal_vi_create_info;
|
||||
|
||||
struct radv_shader_module vs = {
|
||||
@@ -1033,7 +1112,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
};
|
||||
|
||||
for (enum radv_blit_ds_layout ds_layout = RADV_BLIT_DS_LAYOUT_TILE_ENABLE; ds_layout < RADV_BLIT_DS_LAYOUT_COUNT; ds_layout++) {
|
||||
if (!device->meta_state.blit2d.stencil_only_rp[ds_layout]) {
|
||||
if (!device->meta_state.blit2d_stencil_only_rp[ds_layout]) {
|
||||
VkImageLayout layout = radv_meta_blit_ds_to_layout(ds_layout);
|
||||
result = radv_CreateRenderPass(radv_device_to_handle(device),
|
||||
&(VkRenderPassCreateInfo) {
|
||||
@@ -1061,7 +1140,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
.pPreserveAttachments = (uint32_t[]) { 0 },
|
||||
},
|
||||
.dependencyCount = 0,
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d.stencil_only_rp[ds_layout]);
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d_stencil_only_rp[ds_layout]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1089,7 +1168,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
},
|
||||
.pMultisampleState = &(VkPipelineMultisampleStateCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO,
|
||||
.rasterizationSamples = 1,
|
||||
.rasterizationSamples = 1 << log2_samples,
|
||||
.sampleShadingEnable = false,
|
||||
.pSampleMask = (VkSampleMask[]) { UINT32_MAX },
|
||||
},
|
||||
@@ -1136,8 +1215,8 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
},
|
||||
},
|
||||
.flags = 0,
|
||||
.layout = device->meta_state.blit2d.p_layouts[src_type],
|
||||
.renderPass = device->meta_state.blit2d.stencil_only_rp[0],
|
||||
.layout = device->meta_state.blit2d[log2_samples].p_layouts[src_type],
|
||||
.renderPass = device->meta_state.blit2d_stencil_only_rp[0],
|
||||
.subpass = 0,
|
||||
};
|
||||
|
||||
@@ -1149,7 +1228,7 @@ blit2d_init_stencil_only_pipeline(struct radv_device *device,
|
||||
radv_pipeline_cache_to_handle(&device->meta_state.cache),
|
||||
&vk_pipeline_info, &radv_pipeline_info,
|
||||
&device->meta_state.alloc,
|
||||
&device->meta_state.blit2d.stencil_only_pipeline[src_type]);
|
||||
&device->meta_state.blit2d[log2_samples].stencil_only_pipeline[src_type]);
|
||||
|
||||
|
||||
ralloc_free(vs.nir);
|
||||
@@ -1175,15 +1254,16 @@ static VkFormat pipeline_formats[] = {
|
||||
|
||||
static VkResult
|
||||
meta_blit2d_create_pipe_layout(struct radv_device *device,
|
||||
int idx)
|
||||
int idx,
|
||||
uint32_t log2_samples)
|
||||
{
|
||||
VkResult result;
|
||||
VkDescriptorType desc_type = (idx == BLIT2D_SRC_TYPE_BUFFER) ? VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER : VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE;
|
||||
const VkPushConstantRange push_constant_ranges[] = {
|
||||
{VK_SHADER_STAGE_VERTEX_BIT, 0, 16},
|
||||
{VK_SHADER_STAGE_FRAGMENT_BIT, 16, 4},
|
||||
{VK_SHADER_STAGE_FRAGMENT_BIT, 16, 12},
|
||||
};
|
||||
int num_push_constant_range = (idx != BLIT2D_SRC_TYPE_IMAGE) ? 2 : 1;
|
||||
int num_push_constant_range = (idx != BLIT2D_SRC_TYPE_IMAGE || log2_samples > 0) ? 2 : 1;
|
||||
|
||||
result = radv_CreateDescriptorSetLayout(radv_device_to_handle(device),
|
||||
&(VkDescriptorSetLayoutCreateInfo) {
|
||||
@@ -1199,7 +1279,7 @@ meta_blit2d_create_pipe_layout(struct radv_device *device,
|
||||
.pImmutableSamplers = NULL
|
||||
},
|
||||
}
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d.ds_layouts[idx]);
|
||||
}, &device->meta_state.alloc, &device->meta_state.blit2d[log2_samples].ds_layouts[idx]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
@@ -1207,11 +1287,11 @@ meta_blit2d_create_pipe_layout(struct radv_device *device,
|
||||
&(VkPipelineLayoutCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
|
||||
.setLayoutCount = 1,
|
||||
.pSetLayouts = &device->meta_state.blit2d.ds_layouts[idx],
|
||||
.pSetLayouts = &device->meta_state.blit2d[log2_samples].ds_layouts[idx],
|
||||
.pushConstantRangeCount = num_push_constant_range,
|
||||
.pPushConstantRanges = push_constant_ranges,
|
||||
},
|
||||
&device->meta_state.alloc, &device->meta_state.blit2d.p_layouts[idx]);
|
||||
&device->meta_state.alloc, &device->meta_state.blit2d[log2_samples].p_layouts[idx]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return VK_SUCCESS;
|
||||
@@ -1225,27 +1305,33 @@ radv_device_init_meta_blit2d_state(struct radv_device *device)
|
||||
VkResult result;
|
||||
bool create_3d = device->physical_device->rad_info.chip_class >= GFX9;
|
||||
|
||||
for (unsigned src = 0; src < BLIT2D_NUM_SRC_TYPES; src++) {
|
||||
if (src == BLIT2D_SRC_TYPE_IMAGE_3D && !create_3d)
|
||||
continue;
|
||||
for (unsigned log2_samples = 0; log2_samples < 1 + MAX_SAMPLES_LOG2; log2_samples++) {
|
||||
for (unsigned src = 0; src < BLIT2D_NUM_SRC_TYPES; src++) {
|
||||
if (src == BLIT2D_SRC_TYPE_IMAGE_3D && !create_3d)
|
||||
continue;
|
||||
|
||||
result = meta_blit2d_create_pipe_layout(device, src);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
/* Don't need to handle copies between buffers and multisample images. */
|
||||
if (src == BLIT2D_SRC_TYPE_BUFFER && log2_samples > 0)
|
||||
continue;
|
||||
|
||||
for (unsigned j = 0; j < ARRAY_SIZE(pipeline_formats); ++j) {
|
||||
result = blit2d_init_color_pipeline(device, src, pipeline_formats[j]);
|
||||
result = meta_blit2d_create_pipe_layout(device, src, log2_samples);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
for (unsigned j = 0; j < ARRAY_SIZE(pipeline_formats); ++j) {
|
||||
result = blit2d_init_color_pipeline(device, src, pipeline_formats[j], log2_samples);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
result = blit2d_init_depth_only_pipeline(device, src, log2_samples);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
result = blit2d_init_stencil_only_pipeline(device, src, log2_samples);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
result = blit2d_init_depth_only_pipeline(device, src);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
result = blit2d_init_stencil_only_pipeline(device, src);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
@@ -358,6 +358,8 @@ static void radv_pick_resolve_method_images(struct radv_image *src_image,
|
||||
*method = RESOLVE_COMPUTE;
|
||||
else if (vk_format_is_int(src_image->vk_format))
|
||||
*method = RESOLVE_COMPUTE;
|
||||
else if (src_image->info.array_size > 1)
|
||||
*method = RESOLVE_COMPUTE;
|
||||
|
||||
if (radv_layout_dcc_compressed(dest_image, dest_image_layout, queue_mask)) {
|
||||
*method = RESOLVE_FRAGMENT;
|
||||
|
@@ -536,12 +536,48 @@ radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer)
|
||||
if (dest_att.attachment == VK_ATTACHMENT_UNUSED)
|
||||
continue;
|
||||
|
||||
emit_resolve(cmd_buffer,
|
||||
src_iview,
|
||||
dst_iview,
|
||||
&(VkOffset2D) { 0, 0 },
|
||||
&(VkOffset2D) { 0, 0 },
|
||||
&(VkExtent2D) { fb->width, fb->height });
|
||||
struct radv_image *src_image = src_iview->image;
|
||||
struct radv_image *dst_image = dst_iview->image;
|
||||
for (uint32_t layer = 0; layer < src_image->info.array_size; layer++) {
|
||||
|
||||
struct radv_image_view tsrc_iview;
|
||||
radv_image_view_init(&tsrc_iview, cmd_buffer->device,
|
||||
&(VkImageViewCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||
.image = radv_image_to_handle(src_image),
|
||||
.viewType = radv_meta_get_view_type(src_image),
|
||||
.format = src_image->vk_format,
|
||||
.subresourceRange = {
|
||||
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
.baseMipLevel = src_iview->base_mip,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = layer,
|
||||
.layerCount = 1,
|
||||
},
|
||||
});
|
||||
|
||||
struct radv_image_view tdst_iview;
|
||||
radv_image_view_init(&tdst_iview, cmd_buffer->device,
|
||||
&(VkImageViewCreateInfo) {
|
||||
.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,
|
||||
.image = radv_image_to_handle(dst_image),
|
||||
.viewType = radv_meta_get_view_type(dst_image),
|
||||
.format = vk_to_non_srgb_format(dst_image->vk_format),
|
||||
.subresourceRange = {
|
||||
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
.baseMipLevel = dst_iview->base_mip,
|
||||
.levelCount = 1,
|
||||
.baseArrayLayer = layer,
|
||||
.layerCount = 1,
|
||||
},
|
||||
});
|
||||
emit_resolve(cmd_buffer,
|
||||
&tsrc_iview,
|
||||
&tdst_iview,
|
||||
&(VkOffset2D) { 0, 0 },
|
||||
&(VkOffset2D) { 0, 0 },
|
||||
&(VkExtent2D) { fb->width, fb->height });
|
||||
}
|
||||
}
|
||||
|
||||
radv_meta_restore(&saved_state, cmd_buffer);
|
||||
|
@@ -142,6 +142,47 @@ radv_pipeline_scratch_init(struct radv_device *device,
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
static uint32_t si_translate_blend_logic_op(VkLogicOp op)
|
||||
{
|
||||
switch (op) {
|
||||
case VK_LOGIC_OP_CLEAR:
|
||||
return V_028808_ROP3_CLEAR;
|
||||
case VK_LOGIC_OP_AND:
|
||||
return V_028808_ROP3_AND;
|
||||
case VK_LOGIC_OP_AND_REVERSE:
|
||||
return V_028808_ROP3_AND_REVERSE;
|
||||
case VK_LOGIC_OP_COPY:
|
||||
return V_028808_ROP3_COPY;
|
||||
case VK_LOGIC_OP_AND_INVERTED:
|
||||
return V_028808_ROP3_AND_INVERTED;
|
||||
case VK_LOGIC_OP_NO_OP:
|
||||
return V_028808_ROP3_NO_OP;
|
||||
case VK_LOGIC_OP_XOR:
|
||||
return V_028808_ROP3_XOR;
|
||||
case VK_LOGIC_OP_OR:
|
||||
return V_028808_ROP3_OR;
|
||||
case VK_LOGIC_OP_NOR:
|
||||
return V_028808_ROP3_NOR;
|
||||
case VK_LOGIC_OP_EQUIVALENT:
|
||||
return V_028808_ROP3_EQUIVALENT;
|
||||
case VK_LOGIC_OP_INVERT:
|
||||
return V_028808_ROP3_INVERT;
|
||||
case VK_LOGIC_OP_OR_REVERSE:
|
||||
return V_028808_ROP3_OR_REVERSE;
|
||||
case VK_LOGIC_OP_COPY_INVERTED:
|
||||
return V_028808_ROP3_COPY_INVERTED;
|
||||
case VK_LOGIC_OP_OR_INVERTED:
|
||||
return V_028808_ROP3_OR_INVERTED;
|
||||
case VK_LOGIC_OP_NAND:
|
||||
return V_028808_ROP3_NAND;
|
||||
case VK_LOGIC_OP_SET:
|
||||
return V_028808_ROP3_SET;
|
||||
default:
|
||||
unreachable("Unhandled logic op");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint32_t si_translate_blend_function(VkBlendOp op)
|
||||
{
|
||||
switch (op) {
|
||||
@@ -532,9 +573,9 @@ radv_pipeline_init_blend_state(struct radv_pipeline *pipeline,
|
||||
}
|
||||
blend->cb_color_control = 0;
|
||||
if (vkblend->logicOpEnable)
|
||||
blend->cb_color_control |= S_028808_ROP3(vkblend->logicOp | (vkblend->logicOp << 4));
|
||||
blend->cb_color_control |= S_028808_ROP3(si_translate_blend_logic_op(vkblend->logicOp));
|
||||
else
|
||||
blend->cb_color_control |= S_028808_ROP3(0xcc);
|
||||
blend->cb_color_control |= S_028808_ROP3(V_028808_ROP3_COPY);
|
||||
|
||||
blend->db_alpha_to_mask = S_028B70_ALPHA_TO_MASK_OFFSET0(2) |
|
||||
S_028B70_ALPHA_TO_MASK_OFFSET1(2) |
|
||||
@@ -1755,10 +1796,34 @@ radv_generate_graphics_pipeline_key(struct radv_pipeline *pipeline,
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < input_state->vertexAttributeDescriptionCount; ++i) {
|
||||
unsigned binding;
|
||||
binding = input_state->pVertexAttributeDescriptions[i].binding;
|
||||
unsigned location = input_state->pVertexAttributeDescriptions[i].location;
|
||||
unsigned binding = input_state->pVertexAttributeDescriptions[i].binding;
|
||||
if (binding_input_rate & (1u << binding))
|
||||
key.instance_rate_inputs |= 1u << input_state->pVertexAttributeDescriptions[i].location;
|
||||
|
||||
if (pipeline->device->physical_device->rad_info.chip_class <= VI &&
|
||||
pipeline->device->physical_device->rad_info.family != CHIP_STONEY) {
|
||||
VkFormat format = input_state->pVertexAttributeDescriptions[i].format;
|
||||
uint64_t adjust;
|
||||
switch(format) {
|
||||
case VK_FORMAT_A2R10G10B10_SNORM_PACK32:
|
||||
case VK_FORMAT_A2B10G10R10_SNORM_PACK32:
|
||||
adjust = RADV_ALPHA_ADJUST_SNORM;
|
||||
break;
|
||||
case VK_FORMAT_A2R10G10B10_SSCALED_PACK32:
|
||||
case VK_FORMAT_A2B10G10R10_SSCALED_PACK32:
|
||||
adjust = RADV_ALPHA_ADJUST_SSCALED;
|
||||
break;
|
||||
case VK_FORMAT_A2R10G10B10_SINT_PACK32:
|
||||
case VK_FORMAT_A2B10G10R10_SINT_PACK32:
|
||||
adjust = RADV_ALPHA_ADJUST_SINT;
|
||||
break;
|
||||
default:
|
||||
adjust = 0;
|
||||
break;
|
||||
}
|
||||
key.vertex_alpha_adjust |= adjust << (2 * location);
|
||||
}
|
||||
}
|
||||
|
||||
if (pCreateInfo->pTessellationState)
|
||||
@@ -1787,6 +1852,7 @@ radv_fill_shader_keys(struct ac_shader_variant_key *keys,
|
||||
nir_shader **nir)
|
||||
{
|
||||
keys[MESA_SHADER_VERTEX].vs.instance_rate_inputs = key->instance_rate_inputs;
|
||||
keys[MESA_SHADER_VERTEX].vs.alpha_adjust = key->vertex_alpha_adjust;
|
||||
|
||||
if (nir[MESA_SHADER_TESS_CTRL]) {
|
||||
keys[MESA_SHADER_VERTEX].vs.as_ls = true;
|
||||
|
@@ -329,6 +329,7 @@ struct radv_pipeline_cache {
|
||||
|
||||
struct radv_pipeline_key {
|
||||
uint32_t instance_rate_inputs;
|
||||
uint64_t vertex_alpha_adjust;
|
||||
unsigned tess_input_vertices;
|
||||
uint32_t col_format;
|
||||
uint32_t is_int8;
|
||||
@@ -442,18 +443,18 @@ struct radv_meta_state {
|
||||
} blit;
|
||||
|
||||
struct {
|
||||
VkRenderPass render_passes[NUM_META_FS_KEYS][RADV_META_DST_LAYOUT_COUNT];
|
||||
VkPipelineLayout p_layouts[5];
|
||||
VkDescriptorSetLayout ds_layouts[5];
|
||||
VkPipeline pipelines[5][NUM_META_FS_KEYS];
|
||||
|
||||
VkPipelineLayout p_layouts[3];
|
||||
VkDescriptorSetLayout ds_layouts[3];
|
||||
VkPipeline pipelines[3][NUM_META_FS_KEYS];
|
||||
VkPipeline depth_only_pipeline[5];
|
||||
|
||||
VkRenderPass depth_only_rp[RADV_BLIT_DS_LAYOUT_COUNT];
|
||||
VkPipeline depth_only_pipeline[3];
|
||||
VkPipeline stencil_only_pipeline[5];
|
||||
} blit2d[1 + MAX_SAMPLES_LOG2];
|
||||
|
||||
VkRenderPass stencil_only_rp[RADV_BLIT_DS_LAYOUT_COUNT];
|
||||
VkPipeline stencil_only_pipeline[3];
|
||||
} blit2d;
|
||||
VkRenderPass blit2d_render_passes[NUM_META_FS_KEYS][RADV_META_DST_LAYOUT_COUNT];
|
||||
VkRenderPass blit2d_depth_only_rp[RADV_BLIT_DS_LAYOUT_COUNT];
|
||||
VkRenderPass blit2d_stencil_only_rp[RADV_BLIT_DS_LAYOUT_COUNT];
|
||||
|
||||
struct {
|
||||
VkPipelineLayout img_p_layout;
|
||||
|
@@ -1363,11 +1363,11 @@ apply_var_decoration(struct vtn_builder *b, nir_variable *nir_var,
|
||||
case SpvBuiltInTessLevelInner:
|
||||
nir_var->data.compact = true;
|
||||
break;
|
||||
case SpvBuiltInSamplePosition:
|
||||
nir_var->data.origin_upper_left = b->origin_upper_left;
|
||||
/* fallthrough */
|
||||
case SpvBuiltInFragCoord:
|
||||
nir_var->data.pixel_center_integer = b->pixel_center_integer;
|
||||
/* fallthrough */
|
||||
case SpvBuiltInSamplePosition:
|
||||
nir_var->data.origin_upper_left = b->origin_upper_left;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@@ -864,19 +864,22 @@ dri2_x11_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
|
||||
if (draw->Type == EGL_PIXMAP_BIT || draw->Type == EGL_PBUFFER_BIT)
|
||||
return 0;
|
||||
|
||||
if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available)
|
||||
return dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1;
|
||||
if (draw->SwapBehavior == EGL_BUFFER_PRESERVED || !dri2_dpy->swap_available) {
|
||||
swap_count = dri2_copy_region(drv, disp, draw, dri2_surf->region) ? 0 : -1;
|
||||
} else {
|
||||
dri2_flush_drawable_for_swapbuffers(disp, draw);
|
||||
|
||||
dri2_flush_drawable_for_swapbuffers(disp, draw);
|
||||
cookie = xcb_dri2_swap_buffers_unchecked(dri2_dpy->conn,
|
||||
dri2_surf->drawable, msc_hi,
|
||||
msc_lo, divisor_hi, divisor_lo,
|
||||
remainder_hi, remainder_lo);
|
||||
|
||||
cookie = xcb_dri2_swap_buffers_unchecked(dri2_dpy->conn, dri2_surf->drawable,
|
||||
msc_hi, msc_lo, divisor_hi, divisor_lo, remainder_hi, remainder_lo);
|
||||
reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL);
|
||||
|
||||
reply = xcb_dri2_swap_buffers_reply(dri2_dpy->conn, cookie, NULL);
|
||||
|
||||
if (reply) {
|
||||
swap_count = (((int64_t)reply->swap_hi) << 32) | reply->swap_lo;
|
||||
free(reply);
|
||||
if (reply) {
|
||||
swap_count = (((int64_t)reply->swap_hi) << 32) | reply->swap_lo;
|
||||
free(reply);
|
||||
}
|
||||
}
|
||||
|
||||
/* Since we aren't watching for the server's invalidate events like we're
|
||||
|
@@ -202,6 +202,7 @@ pipe_loader_drm_probe_fd(struct pipe_loader_device **dev, int fd)
|
||||
if (ddev->lib)
|
||||
util_dl_close(ddev->lib);
|
||||
#endif
|
||||
FREE(ddev->base.driver_name);
|
||||
FREE(ddev);
|
||||
return false;
|
||||
}
|
||||
|
@@ -270,6 +270,23 @@ util_hash_table_foreach(struct util_hash_table *ht,
|
||||
}
|
||||
|
||||
|
||||
static enum pipe_error
|
||||
util_hash_inc(void *k, void *v, void *d)
|
||||
{
|
||||
++*(size_t *)d;
|
||||
return PIPE_OK;
|
||||
}
|
||||
|
||||
|
||||
size_t
|
||||
util_hash_table_count(struct util_hash_table *ht)
|
||||
{
|
||||
size_t count = 0;
|
||||
util_hash_table_foreach(ht, util_hash_inc, &count);
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
util_hash_table_destroy(struct util_hash_table *ht)
|
||||
{
|
||||
|
@@ -85,6 +85,11 @@ util_hash_table_foreach(struct util_hash_table *ht,
|
||||
(void *key, void *value, void *data),
|
||||
void *data);
|
||||
|
||||
|
||||
size_t
|
||||
util_hash_table_count(struct util_hash_table *ht);
|
||||
|
||||
|
||||
void
|
||||
util_hash_table_destroy(struct util_hash_table *ht);
|
||||
|
||||
|
@@ -461,11 +461,10 @@ static void evergreen_delete_compute_state(struct pipe_context *ctx, void *state
|
||||
} else {
|
||||
#ifdef HAVE_OPENCL
|
||||
radeon_shader_binary_clean(&shader->binary);
|
||||
pipe_resource_reference(&shader->code_bo, NULL);
|
||||
pipe_resource_reference(&shader->kernel_param, NULL);
|
||||
#endif
|
||||
r600_destroy_shader(&shader->bc);
|
||||
|
||||
/* TODO destroy shader->code_bo, shader->const_bo
|
||||
* we'll need something like r600_buffer_free */
|
||||
}
|
||||
FREE(shader);
|
||||
}
|
||||
|
@@ -2202,7 +2202,7 @@ static void evergreen_emit_constant_buffers(struct r600_context *rctx,
|
||||
radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 8, 0) | pkt_flags);
|
||||
radeon_emit(cs, (buffer_id_base + buffer_index) * 8);
|
||||
radeon_emit(cs, va); /* RESOURCEi_WORD0 */
|
||||
radeon_emit(cs, rbuffer->b.b.width0 - cb->buffer_offset - 1); /* RESOURCEi_WORD1 */
|
||||
radeon_emit(cs, cb->buffer_size -1); /* RESOURCEi_WORD1 */
|
||||
radeon_emit(cs, /* RESOURCEi_WORD2 */
|
||||
S_030008_ENDIAN_SWAP(gs_ring_buffer ? ENDIAN_NONE : r600_endian_swap(32)) |
|
||||
S_030008_STRIDE(gs_ring_buffer ? 4 : 16) |
|
||||
|
@@ -65,7 +65,7 @@ static const struct debug_named_value r600_debug_options[] = {
|
||||
static void r600_destroy_context(struct pipe_context *context)
|
||||
{
|
||||
struct r600_context *rctx = (struct r600_context *)context;
|
||||
unsigned sh;
|
||||
unsigned sh, i;
|
||||
|
||||
r600_isa_destroy(rctx->isa);
|
||||
|
||||
@@ -101,6 +101,10 @@ static void r600_destroy_context(struct pipe_context *context)
|
||||
}
|
||||
util_unreference_framebuffer_state(&rctx->framebuffer.state);
|
||||
|
||||
for (sh = 0; sh < PIPE_SHADER_TYPES; ++sh)
|
||||
for (i = 0; i < PIPE_MAX_CONSTANT_BUFFERS; ++i)
|
||||
rctx->b.b.set_constant_buffer(context, sh, i, NULL);
|
||||
|
||||
if (rctx->blitter) {
|
||||
util_blitter_destroy(rctx->blitter);
|
||||
}
|
||||
|
@@ -1724,7 +1724,7 @@ static void r600_emit_constant_buffers(struct r600_context *rctx,
|
||||
radeon_emit(cs, PKT3(PKT3_SET_RESOURCE, 7, 0));
|
||||
radeon_emit(cs, (buffer_id_base + buffer_index) * 7);
|
||||
radeon_emit(cs, offset); /* RESOURCEi_WORD0 */
|
||||
radeon_emit(cs, rbuffer->b.b.width0 - offset - 1); /* RESOURCEi_WORD1 */
|
||||
radeon_emit(cs, cb->buffer_size - 1); /* RESOURCEi_WORD1 */
|
||||
radeon_emit(cs, /* RESOURCEi_WORD2 */
|
||||
S_038008_ENDIAN_SWAP(gs_ring_buffer ? ENDIAN_NONE : r600_endian_swap(32)) |
|
||||
S_038008_STRIDE(gs_ring_buffer ? 4 : 16));
|
||||
|
@@ -93,6 +93,7 @@ namespace clover {
|
||||
/// Free any resources that were allocated in bind().
|
||||
virtual void unbind(exec_context &ctx) = 0;
|
||||
|
||||
virtual ~argument() {};
|
||||
protected:
|
||||
argument();
|
||||
|
||||
|
@@ -23,11 +23,10 @@ lib@OPENCL_LIBNAME@_la_LIBADD = \
|
||||
$(LIBELF_LIBS) \
|
||||
$(DLOPEN_LIBS) \
|
||||
-lclangCodeGen \
|
||||
-lclangFrontendTool \
|
||||
-lclangFrontend \
|
||||
-lclangFrontendTool \
|
||||
-lclangDriver \
|
||||
-lclangSerialization \
|
||||
-lclangCodeGen \
|
||||
-lclangParse \
|
||||
-lclangSema \
|
||||
-lclangAnalysis \
|
||||
|
@@ -220,8 +220,13 @@ static bool amdgpu_winsys_unref(struct radeon_winsys *rws)
|
||||
simple_mtx_lock(&dev_tab_mutex);
|
||||
|
||||
destroy = pipe_reference(&ws->reference, NULL);
|
||||
if (destroy && dev_tab)
|
||||
if (destroy && dev_tab) {
|
||||
util_hash_table_remove(dev_tab, ws->dev);
|
||||
if (util_hash_table_count(dev_tab) == 0) {
|
||||
util_hash_table_destroy(dev_tab);
|
||||
dev_tab = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
simple_mtx_unlock(&dev_tab_mutex);
|
||||
return destroy;
|
||||
|
@@ -716,8 +716,13 @@ static bool radeon_winsys_unref(struct radeon_winsys *ws)
|
||||
mtx_lock(&fd_tab_mutex);
|
||||
|
||||
destroy = pipe_reference(&rws->reference, NULL);
|
||||
if (destroy && fd_tab)
|
||||
if (destroy && fd_tab) {
|
||||
util_hash_table_remove(fd_tab, intptr_to_pointer(rws->fd));
|
||||
if (util_hash_table_count(fd_tab) == 0) {
|
||||
util_hash_table_destroy(fd_tab);
|
||||
fd_tab = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
mtx_unlock(&fd_tab_mutex);
|
||||
return destroy;
|
||||
|
@@ -71,10 +71,12 @@ EXTRA_DIST += \
|
||||
vulkan/TODO
|
||||
|
||||
vulkan/dev_icd.json : vulkan/anv_extensions.py vulkan/anv_icd.py
|
||||
$(MKDIR_GEN)
|
||||
$(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_icd.py \
|
||||
--lib-path="${abs_top_builddir}/${LIB_DIR}" --out $@
|
||||
|
||||
vulkan/intel_icd.@host_cpu@.json : vulkan/anv_extensions.py vulkan/anv_icd.py
|
||||
$(MKDIR_GEN)
|
||||
$(AM_V_GEN)$(PYTHON2) $(srcdir)/vulkan/anv_icd.py \
|
||||
--lib-path="${libdir}" --out $@
|
||||
|
||||
|
@@ -647,7 +647,7 @@ static inline struct brw_reg
|
||||
brw_imm_w(int16_t w)
|
||||
{
|
||||
struct brw_reg imm = brw_imm_reg(BRW_REGISTER_TYPE_W);
|
||||
imm.d = w | (w << 16);
|
||||
imm.ud = (uint16_t)w | (uint32_t)(uint16_t)w << 16;
|
||||
return imm;
|
||||
}
|
||||
|
||||
|
@@ -566,9 +566,11 @@ brw_negate_immediate(enum brw_reg_type type, struct brw_reg *reg)
|
||||
reg->d = -reg->d;
|
||||
return true;
|
||||
case BRW_REGISTER_TYPE_W:
|
||||
case BRW_REGISTER_TYPE_UW:
|
||||
reg->d = -(int16_t)reg->ud;
|
||||
case BRW_REGISTER_TYPE_UW: {
|
||||
uint16_t value = -(int16_t)reg->ud;
|
||||
reg->ud = value | (uint32_t)value << 16;
|
||||
return true;
|
||||
}
|
||||
case BRW_REGISTER_TYPE_F:
|
||||
reg->f = -reg->f;
|
||||
return true;
|
||||
@@ -602,9 +604,11 @@ brw_abs_immediate(enum brw_reg_type type, struct brw_reg *reg)
|
||||
case BRW_REGISTER_TYPE_D:
|
||||
reg->d = abs(reg->d);
|
||||
return true;
|
||||
case BRW_REGISTER_TYPE_W:
|
||||
reg->d = abs((int16_t)reg->ud);
|
||||
case BRW_REGISTER_TYPE_W: {
|
||||
uint16_t value = abs((int16_t)reg->ud);
|
||||
reg->ud = value | (uint32_t)value << 16;
|
||||
return true;
|
||||
}
|
||||
case BRW_REGISTER_TYPE_F:
|
||||
reg->f = fabsf(reg->f);
|
||||
return true;
|
||||
|
@@ -1048,10 +1048,18 @@ genX(BeginCommandBuffer)(
|
||||
* context restore, so the mentioned hang doesn't happen. However,
|
||||
* software must program push constant commands for all stages prior to
|
||||
* rendering anything. So we flag them dirty in BeginCommandBuffer.
|
||||
*
|
||||
* Finally, we also make sure to stall at pixel scoreboard to make sure the
|
||||
* constants have been loaded into the EUs prior to disable the push constants
|
||||
* so that it doesn't hang a previous 3DPRIMITIVE.
|
||||
*/
|
||||
static void
|
||||
emit_isp_disable(struct anv_cmd_buffer *cmd_buffer)
|
||||
{
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) {
|
||||
pc.StallAtPixelScoreboard = true;
|
||||
pc.CommandStreamerStallEnable = true;
|
||||
}
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) {
|
||||
pc.IndirectStatePointersDisable = true;
|
||||
pc.CommandStreamerStallEnable = true;
|
||||
|
@@ -1077,7 +1077,6 @@ intelDestroyContext(__DRIcontext * driContextPriv)
|
||||
struct brw_context *brw =
|
||||
(struct brw_context *) driContextPriv->driverPrivate;
|
||||
struct gl_context *ctx = &brw->ctx;
|
||||
const struct gen_device_info *devinfo = &brw->screen->devinfo;
|
||||
|
||||
_mesa_meta_free(&brw->ctx);
|
||||
|
||||
@@ -1089,8 +1088,7 @@ intelDestroyContext(__DRIcontext * driContextPriv)
|
||||
brw_destroy_shader_time(brw);
|
||||
}
|
||||
|
||||
if (devinfo->gen >= 6)
|
||||
blorp_finish(&brw->blorp);
|
||||
blorp_finish(&brw->blorp);
|
||||
|
||||
brw_destroy_state(brw);
|
||||
brw_draw_destroy(brw);
|
||||
|
@@ -349,10 +349,18 @@ gen7_emit_vs_workaround_flush(struct brw_context *brw)
|
||||
* context restore, so the mentioned hang doesn't happen. However,
|
||||
* software must program push constant commands for all stages prior to
|
||||
* rendering anything, so we flag them as dirty.
|
||||
*
|
||||
* Finally, we also make sure to stall at pixel scoreboard to make sure the
|
||||
* constants have been loaded into the EUs prior to disable the push constants
|
||||
* so that it doesn't hang a previous 3DPRIMITIVE.
|
||||
*/
|
||||
void
|
||||
gen10_emit_isp_disable(struct brw_context *brw)
|
||||
{
|
||||
brw_emit_pipe_control(brw,
|
||||
PIPE_CONTROL_STALL_AT_SCOREBOARD |
|
||||
PIPE_CONTROL_CS_STALL,
|
||||
NULL, 0, 0);
|
||||
brw_emit_pipe_control(brw,
|
||||
PIPE_CONTROL_ISP_DIS |
|
||||
PIPE_CONTROL_CS_STALL,
|
||||
|
@@ -1488,45 +1488,66 @@ _mesa_FramebufferParameteri(GLenum target, GLenum pname, GLint param)
|
||||
}
|
||||
|
||||
static bool
|
||||
_pname_valid_for_default_framebuffer(struct gl_context *ctx,
|
||||
GLenum pname)
|
||||
validate_get_framebuffer_parameteriv_pname(struct gl_context *ctx,
|
||||
struct gl_framebuffer *fb,
|
||||
GLuint pname, const char *func)
|
||||
{
|
||||
if (!_mesa_is_desktop_gl(ctx))
|
||||
return false;
|
||||
bool cannot_be_winsys_fbo = true;
|
||||
|
||||
switch (pname) {
|
||||
case GL_FRAMEBUFFER_DEFAULT_LAYERS:
|
||||
/*
|
||||
* According to the OpenGL ES 3.1 specification section 9.2.3, the
|
||||
* GL_FRAMEBUFFER_LAYERS parameter name is not supported.
|
||||
*/
|
||||
if (_mesa_is_gles31(ctx) && !ctx->Extensions.OES_geometry_shader) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case GL_FRAMEBUFFER_DEFAULT_WIDTH:
|
||||
case GL_FRAMEBUFFER_DEFAULT_HEIGHT:
|
||||
case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
|
||||
case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:
|
||||
break;
|
||||
case GL_DOUBLEBUFFER:
|
||||
case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
|
||||
case GL_IMPLEMENTATION_COLOR_READ_TYPE:
|
||||
case GL_SAMPLES:
|
||||
case GL_SAMPLE_BUFFERS:
|
||||
case GL_STEREO:
|
||||
return true;
|
||||
/* From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries:
|
||||
*
|
||||
* "An INVALID_OPERATION error is generated by GetFramebufferParameteriv
|
||||
* if the default framebuffer is bound to target and pname is not one
|
||||
* of the accepted values from table 23.73, other than
|
||||
* SAMPLE_POSITION."
|
||||
*
|
||||
* For OpenGL ES, using default framebuffer raises INVALID_OPERATION
|
||||
* for any pname.
|
||||
*/
|
||||
cannot_be_winsys_fbo = !_mesa_is_desktop_gl(ctx);
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cannot_be_winsys_fbo && _mesa_is_winsys_fbo(fb)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s(invalid pname=0x%x for default framebuffer)", func, pname);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
get_framebuffer_parameteriv(struct gl_context *ctx, struct gl_framebuffer *fb,
|
||||
GLenum pname, GLint *params, const char *func)
|
||||
{
|
||||
/* From OpenGL 4.5 spec, section 9.2.3 "Framebuffer Object Queries:
|
||||
*
|
||||
* "An INVALID_OPERATION error is generated by GetFramebufferParameteriv
|
||||
* if the default framebuffer is bound to target and pname is not one
|
||||
* of the accepted values from table 23.73, other than
|
||||
* SAMPLE_POSITION."
|
||||
*
|
||||
* For OpenGL ES, using default framebuffer still raises INVALID_OPERATION
|
||||
* for any pname.
|
||||
*/
|
||||
if (_mesa_is_winsys_fbo(fb) &&
|
||||
!_pname_valid_for_default_framebuffer(ctx, pname)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"%s(invalid pname=0x%x for default framebuffer)", func, pname);
|
||||
if (!validate_get_framebuffer_parameteriv_pname(ctx, fb, pname, func))
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pname) {
|
||||
case GL_FRAMEBUFFER_DEFAULT_WIDTH:
|
||||
@@ -1536,14 +1557,6 @@ get_framebuffer_parameteriv(struct gl_context *ctx, struct gl_framebuffer *fb,
|
||||
*params = fb->DefaultGeometry.Height;
|
||||
break;
|
||||
case GL_FRAMEBUFFER_DEFAULT_LAYERS:
|
||||
/*
|
||||
* According to the OpenGL ES 3.1 specification section 9.2.3, the
|
||||
* GL_FRAMEBUFFER_LAYERS parameter name is not supported.
|
||||
*/
|
||||
if (_mesa_is_gles31(ctx) && !ctx->Extensions.OES_geometry_shader) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname);
|
||||
break;
|
||||
}
|
||||
*params = fb->DefaultGeometry.Layers;
|
||||
break;
|
||||
case GL_FRAMEBUFFER_DEFAULT_SAMPLES:
|
||||
@@ -1570,9 +1583,6 @@ get_framebuffer_parameteriv(struct gl_context *ctx, struct gl_framebuffer *fb,
|
||||
case GL_STEREO:
|
||||
*params = fb->Visual.stereoMode;
|
||||
break;
|
||||
default:
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
"%s(pname=0x%x)", func, pname);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -62,6 +62,7 @@ _mesa_Fogiv(GLenum pname, const GLint *params )
|
||||
case GL_FOG_END:
|
||||
case GL_FOG_INDEX:
|
||||
case GL_FOG_COORDINATE_SOURCE_EXT:
|
||||
case GL_FOG_DISTANCE_MODE_NV:
|
||||
p[0] = (GLfloat) *params;
|
||||
break;
|
||||
case GL_FOG_COLOR:
|
||||
|
Reference in New Issue
Block a user