*/
#include "compiler/glsl/ir.h"
-#include "main/shaderimage.h"
#include "brw_fs.h"
#include "brw_fs_surface_builder.h"
#include "brw_nir.h"
const nir_intrinsic_info *info = &nir_intrinsic_infos[instr->intrinsic];
const unsigned arr_dims = type->sampler_array ? 1 : 0;
const unsigned surf_dims = type->coordinate_components() - arr_dims;
- const mesa_format format =
- (var->data.image.write_only ? MESA_FORMAT_NONE :
- _mesa_get_shader_image_format(var->data.image.format));
+ const unsigned format = var->data.image.format;
/* Get the arguments of the image intrinsic. */
const fs_reg image = get_nir_image_deref(instr->variables[0]);
tmp = emit_image_load(bld, image, addr, surf_dims, arr_dims, format);
else if (instr->intrinsic == nir_intrinsic_image_store)
- emit_image_store(bld, image, addr, src0, surf_dims, arr_dims, format);
+ emit_image_store(bld, image, addr, src0, surf_dims, arr_dims,
+ var->data.image.write_only ? GL_NONE : format);
else
tmp = emit_image_atomic(bld, image, addr, src0, src1,
* IN THE SOFTWARE.
*/
+#include "main/shaderimage.h"
#include "brw_fs_surface_builder.h"
#include "brw_fs.h"
emit_image_load(const fs_builder &bld,
const fs_reg &image, const fs_reg &addr,
unsigned surf_dims, unsigned arr_dims,
- mesa_format format)
+ unsigned gl_format)
{
using namespace image_format_info;
using namespace image_format_conversion;
using namespace image_coordinates;
using namespace surface_access;
const brw_device_info *devinfo = bld.shader->devinfo;
+ const mesa_format format = _mesa_get_shader_image_format(gl_format);
const mesa_format lower_format =
brw_lower_mesa_image_format(devinfo, format);
fs_reg tmp;
emit_image_store(const fs_builder &bld, const fs_reg &image,
const fs_reg &addr, const fs_reg &src,
unsigned surf_dims, unsigned arr_dims,
- mesa_format format)
+ unsigned gl_format)
{
using namespace image_format_info;
using namespace image_format_conversion;
using namespace image_validity;
using namespace image_coordinates;
using namespace surface_access;
+ const mesa_format format = _mesa_get_shader_image_format(gl_format);
const brw_device_info *devinfo = bld.shader->devinfo;
/* Transform the image coordinates into actual surface coordinates. */
emit_image_load(const fs_builder &bld,
const fs_reg &image, const fs_reg &addr,
unsigned surf_dims, unsigned arr_dims,
- mesa_format format);
+ unsigned gl_format);
void
emit_image_store(const fs_builder &bld, const fs_reg &image,
const fs_reg &addr, const fs_reg &src,
unsigned surf_dims, unsigned arr_dims,
- mesa_format format);
+ unsigned gl_format);
fs_reg
emit_image_atomic(const fs_builder &bld,
const fs_reg &image, const fs_reg &addr,